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.
46 lines
1.3 KiB
46 lines
1.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Signal_Generator
|
|
{
|
|
class MultiSignal : IAnalogSignal
|
|
{
|
|
private string paramsToString { get; }
|
|
private List<IAnalogSignal> signals { get; set; }
|
|
private Dictionary<string, double> paramsDict { get; set; }
|
|
|
|
public string typeToString => throw new NotImplementedException();
|
|
|
|
string IAnalogSignal.paramsToString => throw new NotImplementedException();
|
|
|
|
Dictionary<string, double> IAnalogSignal.paramsDict { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|