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);
|
m = (euMax - euMin) / (rawMax - rawMin);
|
||||||
b = euMax - m * (rawMax);
|
b = euMax - m * (rawMax);
|
||||||
}
|
}
|
||||||
void shiftright (double myarray[], int size)
|
void ainShiftRight (double myarray[], int size)
|
||||||
{
|
{
|
||||||
double temp;
|
double temp;
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ double AnalogIn::setValue(int value){
|
|||||||
double pv = m * rawValue + b;
|
double pv = m * rawValue + b;
|
||||||
lastValue = pv;
|
lastValue = pv;
|
||||||
//TODO: lastStored = Instant.now();
|
//TODO: lastStored = Instant.now();
|
||||||
shiftright(history, 100);
|
ainShiftRight(history, 100);
|
||||||
history[0] = lastValue;
|
history[0] = lastValue;
|
||||||
return pv;
|
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;
|
double temp;
|
||||||
|
|
||||||
@@ -144,8 +144,8 @@ int Measurement::update(double value){
|
|||||||
return reportValue;
|
return reportValue;
|
||||||
}
|
}
|
||||||
void Measurement::endOfDay(){
|
void Measurement::endOfDay(){
|
||||||
shiftright(totalHistory, 100);
|
measShiftRight(totalHistory, 100);
|
||||||
shiftright(averageHistory, 100);
|
measShiftRight(averageHistory, 100);
|
||||||
|
|
||||||
totalHistory[0] = total;
|
totalHistory[0] = total;
|
||||||
averageHistory[0] = average;
|
averageHistory[0] = average;
|
||||||
|
|||||||
Reference in New Issue
Block a user