sensors: StoredValueSensor: showInfo()

This commit is contained in:
Andrey Gusakov 2024-03-10 18:28:06 +03:00 committed by rusefillc
parent 180d91b0ed
commit f685025d2c
2 changed files with 7 additions and 1 deletions

View File

@ -75,7 +75,7 @@ public:
m_lastUpdate = timestamp;
}
void showInfo(const char*) const override { }
void showInfo(const char* sensorName) const override;
virtual void setTimeout(int timeoutMs) {
m_timeoutPeriod = MS2NT(timeoutMs);

View File

@ -1,4 +1,5 @@
#include "pch.h"
#include "stored_value_sensor.h"
#include "proxy_sensor.h"
#include "functional_sensor.h"
#include "redundant_sensor.h"
@ -12,6 +13,11 @@
#include "identity_func.h"
#include "map_averaging.h"
void StoredValueSensor::showInfo(const char* sensorName) const {
const auto value = get();
efiPrintf("StoredValue Sensor \"%s\": valid: %s, value: %.2f", sensorName, boolToString(value.Valid), value.Value);
}
void ProxySensor::showInfo(const char* sensorName) const {
efiPrintf("Sensor \"%s\" proxied from sensor \"%s\"", sensorName, getSensorName(m_proxiedSensor));
}