43 lines
896 B
C++
43 lines
896 B
C++
#ifndef PRESSURE_CALCULATOR_H
|
|
#define PRESSURE_CALCULATOR_H
|
|
|
|
#include "Average.h"
|
|
#include "EventBus.h"
|
|
|
|
class PressureCalculator {
|
|
private:
|
|
Average average;
|
|
EventBus &eventBus;
|
|
|
|
struct Event {
|
|
float c1contrib;
|
|
float c2contrib;
|
|
float uncapedPressure;
|
|
float cappedPressure;
|
|
};
|
|
|
|
float cachedSP;
|
|
float cachedTemperature;
|
|
float cachedPower;
|
|
|
|
float cachedMinimalPressure;
|
|
float cachedMaximalPressure;
|
|
float cachedConstante1;
|
|
float cachedConstante2;
|
|
|
|
void updateSP(float value);
|
|
void updateTemperature(float value);
|
|
void updatePower(float value);
|
|
|
|
void updateMinimalPressure(float value);
|
|
void updateMaximalPressure(float value);
|
|
void updateConstante1(float value);
|
|
void updateConstante2(float value);
|
|
|
|
void update();
|
|
|
|
public:
|
|
PressureCalculator(EventBus &eventBusReference);
|
|
};
|
|
|
|
#endif |