You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
905 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Signal_Generator
{
class MultiSignal : IAnalogSignal
{
private List<IAnalogSignal> signals { get; set; }
public string ParamsToString { get; set; }
public MultiSignal()
{
signals = new List<IAnalogSignal>();
}
public void add(IAnalogSignal signal)
{
signals.Add(signal);
}
public void remove(IAnalogSignal signal)
{
signals.Remove(signal);
}
public double currentAmplitude(double t)
{
double summaryAmplitude = 0;
foreach (IAnalogSignal item in signals)
{
summaryAmplitude += item.currentAmplitude(t);
}
return summaryAmplitude;
}
}
}