Fix for multiple shiftright functions
This commit is contained in:
Binary file not shown.
@@ -28,7 +28,7 @@ AnalogIn::AnalogIn(int channel, double rawMin, double rawMax, double euMin, doub
|
||||
m = (euMax - euMin) / (rawMax - rawMin);
|
||||
b = euMax - m * (rawMax);
|
||||
}
|
||||
void shiftright (double myarray[], int size)
|
||||
void ainShiftRight (double myarray[], int size)
|
||||
{
|
||||
double temp;
|
||||
|
||||
@@ -61,7 +61,7 @@ double AnalogIn::setValue(int value){
|
||||
double pv = m * rawValue + b;
|
||||
lastValue = pv;
|
||||
//TODO: lastStored = Instant.now();
|
||||
shiftright(history, 100);
|
||||
ainShiftRight(history, 100);
|
||||
history[0] = lastValue;
|
||||
return pv;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ Measurement::Measurement(std::string tagName){
|
||||
|
||||
}
|
||||
|
||||
void shiftright (double myarray[], int size)
|
||||
void measShiftRight (double myarray[], int size)
|
||||
{
|
||||
double temp;
|
||||
|
||||
@@ -144,8 +144,8 @@ int Measurement::update(double value){
|
||||
return reportValue;
|
||||
}
|
||||
void Measurement::endOfDay(){
|
||||
shiftright(totalHistory, 100);
|
||||
shiftright(averageHistory, 100);
|
||||
measShiftRight(totalHistory, 100);
|
||||
measShiftRight(averageHistory, 100);
|
||||
|
||||
totalHistory[0] = total;
|
||||
averageHistory[0] = average;
|
||||
|
||||
Reference in New Issue
Block a user