disable avg24h

This commit is contained in:
2025-10-18 19:26:14 +02:00
parent 067dc84afa
commit 9ff3b38f70
3 changed files with 15 additions and 7 deletions

View File

@ -100,10 +100,12 @@ void initMeasurement(sMeasurement *pMeasurement)
pMeasurement->average60s.bufferIndex = 0U;
memset(pMeasurement->average60s.samples, 0U, AVG60S_SAMPLE_SIZE);
/*
pMeasurement->average24h.fValue = 0.0f;
pMeasurement->average24h.bufferCount = 0U;
pMeasurement->average24h.bufferIndex = 0U;
memset(pMeasurement->average24h.samples, 0U, AVG24H_SAMPLE_SIZE);
*/
pMeasurement->predict60s.fValue = 0.0f;
pMeasurement->predict60s.bufferCount = 0U;
@ -151,6 +153,7 @@ void updateAverage(sMeasurement *pMeasurement)
pMeasurement->average60s.fValue = sum / pMeasurement->average60s.bufferCount;
// Average form the last 24h
/*
pMeasurement->average24h.samples[pMeasurement->average24h.bufferIndex] = pMeasurement->fCurrentValue;
pMeasurement->average24h.bufferIndex = (pMeasurement->average24h.bufferIndex + 1) % AVG24H_SAMPLE_SIZE;
@ -166,6 +169,7 @@ void updateAverage(sMeasurement *pMeasurement)
}
pMeasurement->average24h.fValue = sum / pMeasurement->average24h.bufferCount;
*/
}
void updatePrediction(sMeasurement *pMeasurement)

View File

@ -3,7 +3,7 @@
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define AVG10S_SAMPLE_SIZE 10U
#define AVG60S_SAMPLE_SIZE 60U
#define AVG24H_SAMPLE_SIZE 60U * 60U * 24U
#define AVG24H_SAMPLE_SIZE 60U // * 60U * 24U
#define PRED60S_SAMPLE_SIZE 60U
typedef enum _BurnerErrorState
@ -21,7 +21,7 @@ typedef enum _MeasurementErrorState
typedef struct _Average
{
float fValue;
float samples[MAX(AVG10S_SAMPLE_SIZE, AVG60S_SAMPLE_SIZE)];
float samples[MAX(AVG10S_SAMPLE_SIZE, MAX(AVG60S_SAMPLE_SIZE, AVG24H_SAMPLE_SIZE))];
size_t bufferIndex;
size_t bufferCount;
} sAverage;
@ -39,7 +39,7 @@ typedef struct _Measurement
float fCurrentValue;
sAverage average10s;
sAverage average60s;
sAverage average24h;
// sAverage average24h;
sPredict predict60s;
eMeasurementErrorState state;
} sMeasurement;

View File

@ -129,10 +129,11 @@ void taskMetrics(void *pvParameters)
u16MetricCounter++;
// Chamber Temperature Average 24h
/*
strcpy(aMetrics[u16MetricCounter].caMetricName, "chamber_temperature_avg24h");
aMetrics[u16MetricCounter].type = FLOAT;
aMetrics[u16MetricCounter].fMetricValue = getChamberTemperature().average24h.fValue;
u16MetricCounter++;
u16MetricCounter++;*/
// Chamber Temperature Predict 60s
strcpy(aMetrics[u16MetricCounter].caMetricName, "chamber_temperature_pred60");
@ -159,10 +160,11 @@ void taskMetrics(void *pvParameters)
u16MetricCounter++;
// Inlet Flow Temperature Average 24h
/*
strcpy(aMetrics[u16MetricCounter].caMetricName, "inlet_flow_temperature_avg24h");
aMetrics[u16MetricCounter].type = FLOAT;
aMetrics[u16MetricCounter].fMetricValue = getInletFlowTemperature().average24h.fValue;
u16MetricCounter++;
u16MetricCounter++;*/
// Inlet Flow Temperature Predict 60s
strcpy(aMetrics[u16MetricCounter].caMetricName, "inlet_flow_temperature_pred60");
@ -189,11 +191,12 @@ void taskMetrics(void *pvParameters)
u16MetricCounter++;
// Outdoor Temperature Average 24h
/*
strcpy(aMetrics[u16MetricCounter].caMetricName, "outdoor_temperature_avg24h");
aMetrics[u16MetricCounter].type = FLOAT;
aMetrics[u16MetricCounter].fMetricValue = getOutdoorTemperature().average24h.fValue;
u16MetricCounter++;
*/
// Outdoor Temperature Predict 60s
strcpy(aMetrics[u16MetricCounter].caMetricName, "outdoor_temperature_pred60");
aMetrics[u16MetricCounter].type = FLOAT;
@ -219,10 +222,11 @@ void taskMetrics(void *pvParameters)
u16MetricCounter++;
// Return Flow Temperature Average 24h
/*
strcpy(aMetrics[u16MetricCounter].caMetricName, "return_flow_temperature_avg24h");
aMetrics[u16MetricCounter].type = FLOAT;
aMetrics[u16MetricCounter].fMetricValue = getReturnFlowTemperature().average24h.fValue;
u16MetricCounter++;
u16MetricCounter++;*/
// Return Flow Temperature Predict 60s
strcpy(aMetrics[u16MetricCounter].caMetricName, "return_flow_temperature_pred60");