2020-03-31 20:21:05 -07:00
|
|
|
#include "global.h"
|
2020-03-30 15:29:42 -07:00
|
|
|
#include "proxy_sensor.h"
|
|
|
|
#include "functional_sensor.h"
|
2020-04-02 05:55:21 -07:00
|
|
|
#include "redundant_sensor.h"
|
2020-03-30 15:29:42 -07:00
|
|
|
#include "efilib.h"
|
|
|
|
#include "loggingcentral.h"
|
|
|
|
|
|
|
|
void ProxySensor::showInfo(Logging* logger, const char* sensorName) const {
|
|
|
|
scheduleMsg(logger, "Sensor \"%s\" proxied from sensor \"%s\"", sensorName, getSensorName(m_proxiedSensor));
|
|
|
|
}
|
|
|
|
|
|
|
|
void FunctionalSensor::showInfo(Logging* logger, const char* sensorName) const {
|
|
|
|
const auto [valid, value] = get();
|
|
|
|
scheduleMsg(logger, "Sensor \"%s\": Raw value: %.2f Valid: %d Converted value %.2f", sensorName, m_rawValue, valid, value);
|
2020-03-30 22:07:08 -07:00
|
|
|
|
|
|
|
// now print out the underlying function's info
|
|
|
|
if (auto func = m_function) {
|
|
|
|
func->showInfo(logger, m_rawValue);
|
|
|
|
}
|
2020-03-30 15:29:42 -07:00
|
|
|
}
|
2020-03-31 20:21:05 -07:00
|
|
|
|
|
|
|
#if EFI_CAN_SUPPORT
|
|
|
|
#include "can_sensor.h"
|
|
|
|
|
|
|
|
void CanSensorBase::showInfo(Logging* logger, const char* sensorName) const {
|
|
|
|
const auto [valid, value] = get();
|
|
|
|
scheduleMsg(logger, "CAN Sensor \"%s\": valid: %d value: %.2f", sensorName, valid, value);
|
|
|
|
}
|
2020-04-02 05:55:21 -07:00
|
|
|
#endif // EFI_CAN_SUPPORT
|
|
|
|
|
|
|
|
void RedundantSensor::showInfo(Logging* logger, const char* sensorName) const {
|
|
|
|
scheduleMsg(logger, "Redundant sensor \"%s\" combining \"%s\" and \"%s\"", sensorName, getSensorName(m_first), getSensorName(m_second));
|
|
|
|
}
|