Browse Source

Немного рефакторинга

master
Никита 6 years ago
parent
commit
ee779e56cb
  1. 12
      Signal Generator/Signal/FmSignal.cs
  2. 2
      Signal Generator/Signal/MultiSignal.cs
  3. 10
      Signal Generator/Signal/SinusoidalSignal.cs

12
Signal Generator/Signal/FmSignal.cs

@ -11,16 +11,10 @@ namespace Signal_Generator
{ {
public Collection<Parameter> paramsCollection { get; set; } public Collection<Parameter> paramsCollection { get; set; }
public string typeToString public string typeToString => "FM сигнал";
{
get { return "FM сигнал"; }
}
public new string paramsToString
{
get { return paramsToString(paramsCollection); }
}
public new string paramsToString => paramsToString(paramsCollection);
public FmSignal(double ampl, double freq, double ampl2) public FmSignal(double ampl, double freq, double ampl2)
{ {
paramsCollection = new Collection<Parameter>(); paramsCollection = new Collection<Parameter>();

2
Signal Generator/Signal/MultiSignal.cs

@ -43,9 +43,7 @@ namespace Signal_Generator
{ {
double summaryAmplitude = 0; double summaryAmplitude = 0;
foreach (IAnalogSignal item in signals) foreach (IAnalogSignal item in signals)
{
summaryAmplitude += item.currentAmplitude(t); summaryAmplitude += item.currentAmplitude(t);
}
return summaryAmplitude; return summaryAmplitude;
} }

10
Signal Generator/Signal/SinusoidalSignal.cs

@ -9,15 +9,9 @@ namespace Signal_Generator
{ {
class SinusoidalSignal : AnalogSignalMethods, IAnalogSignal class SinusoidalSignal : AnalogSignalMethods, IAnalogSignal
{ {
public string typeToString public string typeToString => "SIN сигнал";
{
get { return "SIN сигнал"; }
}
public new string paramsToString public new string paramsToString => paramsToString(paramsCollection);
{
get { return paramsToString(paramsCollection); }
}
public Collection<Parameter> paramsCollection { get; set; } public Collection<Parameter> paramsCollection { get; set; }

Loading…
Cancel
Save