Fix for multiple shiftright functions

This commit is contained in:
Patrick McDonagh
2017-07-11 17:13:00 -05:00
parent c09d57cf9f
commit e64143d1ea
3 changed files with 5 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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;