|Hi again Ralf and thanks for the patience. I understood what OG's method does in terms of the result I got. My problem is now how do I make this list to store my numbers that get generated by the GetAnalog Method.
I would need to have historical analog values for each Sensor and then apply OG's method on each sensor array or list , whatever is made.
Here is the GetAnalogMethod() from the Sensor.cs class,
public double GetAnalogValue(double minAnalogVolt=0.00F,double maxAnalogVolt=1.00F)
if(minAnalogVolt <= AnalogVal && AnalogVal<= maxAnalogVolt)
AnalogVal = rSensVal.NextDouble();
In here I call this GetAnalogValue() method to generate "random" analog values for each of my sensor IDs:
for (int id = 0; id < maxAI; id++)
double AnalogSensorValues = sObj[id].GetAnalogValue();
sTxt = AnalogSensorValues.ToString("F3");
textSensorValues.Text += sTxt + " ";
txtFilterValues.Text = fTx1;
txtFilterValues.Text = GetMovingAverage(AnalogSensorValues).ToString("F3");
If you see above I store all my sensor ID values in a double variable I call AnalogSensorValues.I should have ideally have had a list so that each value gets stored and can be accessed so that GetMoving Average() method can be applied to it.
So yes, that is my problem. Basically sorting these values in a List. This may sound silly, but I don't know how to do it
modified 17-Feb-18 6:42am.