Spaces:
Running
Running
class EngineControl { | |
private: | |
float rpm; | |
float map; | |
float tps; | |
float lambda; | |
float engineTemp; | |
float voltage; | |
FuelLearningTable fuelLearning; | |
IgnitionLearningTable ignitionLearning; | |
bool learningEnabled; | |
uint32_t knockEvents; | |
float currentFuelCorrection; | |
float currentIgnitionCorrection; | |
public: | |
float knockLevel; // Перемещено в public для доступа из основного кода | |
EngineControl(); | |
void begin(); | |
void update(); | |
// Геттеры | |
float getRPM() const { return rpm; } | |
float getMAP() const { return map; } | |
float getTPS() const { return tps; } | |
float getLambda() const { return lambda; } | |
float getEngineTemp() const { return engineTemp; } | |
float getVoltage() const { return voltage; } | |
float getLearningProgress() const; | |
float getIgnitionAdvance(); | |
uint32_t getKnockEvents() const { return knockEvents; } | |
float getCurrentFuelCorrection() const { return currentFuelCorrection; } | |
float getCurrentIgnitionCorrection() const { return currentIgnitionCorrection; } | |
// Управление обучением | |
void resetLearning() { fuelLearning.reset(); ignitionLearning.reset(); } | |
bool saveLearningTables(); | |
bool loadLearningTables(); | |
void setLearningEnabled(bool enabled) { learningEnabled = enabled; } | |
bool isLearningEnabled() const { return learningEnabled; } | |
}; | |