From f768118aab9c6ca314bd08f274f92cc5be07ba0c Mon Sep 17 00:00:00 2001 From: Hugo Jean Ponsin Date: Tue, 28 Jul 2026 10:42:12 +0200 Subject: [PATCH] demandhandler typo fixed --- src/device/handlers/DemandHandler.cpp | 38 +++++++++++------------ src/device/handlers/DemandHandlerConfig.h | 4 +-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/device/handlers/DemandHandler.cpp b/src/device/handlers/DemandHandler.cpp index ca894a2..8c3765d 100644 --- a/src/device/handlers/DemandHandler.cpp +++ b/src/device/handlers/DemandHandler.cpp @@ -6,20 +6,20 @@ #include #include -using namespace DemanHandlerConfig; +using namespace DemandHandlerConfig; bool DemandHandler::init() { bool initSuccess = true; - if (!midas::odb::exists(this->path + "/" + DemanHandlerConfig::DEMAND)) { + if (!midas::odb::exists(this->path + "/" + DemandHandlerConfig::DEMAND)) { TMFE::Instance()->Msg(MERROR, __FUNCTION__, "Key at %s/%s doesn't exists", path.c_str(), - DemanHandlerConfig::DEMAND.c_str()); + DemandHandlerConfig::DEMAND.c_str()); midas::odb o(this->path); std::vector v; v.resize(static_cast(ParameterIndex::MAXIMUM_PARAMETER_INDEX)); - o[DemanHandlerConfig::DEMAND] = v; + o[DemandHandlerConfig::DEMAND] = v; TMFE::Instance()->Msg(MERROR, __FUNCTION__, "Template generated at %s. Please fill it.", @@ -31,7 +31,7 @@ bool DemandHandler::init() { // This is checked every start, in case of someone change the index in the // config header - if (o[DemanHandlerConfig::DEMAND].size() < + if (o[DemandHandlerConfig::DEMAND].size() < static_cast(ParameterIndex::MINIMAL_PRESSURE)) { TMFE::Instance()->Msg( MERROR, __FUNCTION__, @@ -39,7 +39,7 @@ bool DemandHandler::init() { static_cast(ParameterIndex::MINIMAL_PRESSURE), o.size()); initSuccess = false; } - if (o[DemanHandlerConfig::DEMAND].size() < + if (o[DemandHandlerConfig::DEMAND].size() < static_cast(ParameterIndex::MAXIMAL_PRESSURE)) { TMFE::Instance()->Msg( MERROR, __FUNCTION__, @@ -47,7 +47,7 @@ bool DemandHandler::init() { static_cast(ParameterIndex::MAXIMAL_PRESSURE), o.size()); initSuccess = false; } - if (o[DemanHandlerConfig::DEMAND].size() < + if (o[DemandHandlerConfig::DEMAND].size() < static_cast(ParameterIndex::CONSTANTE_1)) { TMFE::Instance()->Msg( MERROR, __FUNCTION__, @@ -55,7 +55,7 @@ bool DemandHandler::init() { static_cast(ParameterIndex::CONSTANTE_1), o.size()); initSuccess = false; } - if (o[DemanHandlerConfig::DEMAND].size() < + if (o[DemandHandlerConfig::DEMAND].size() < static_cast(ParameterIndex::CONSTANTE_2)) { TMFE::Instance()->Msg( MERROR, __FUNCTION__, @@ -63,7 +63,7 @@ bool DemandHandler::init() { static_cast(ParameterIndex::CONSTANTE_2), o.size()); initSuccess = false; } - if (o[DemanHandlerConfig::DEMAND].size() < + if (o[DemandHandlerConfig::DEMAND].size() < static_cast(ParameterIndex::PRESSURE_CONTROL_MODE)) { TMFE::Instance()->Msg( MERROR, __FUNCTION__, @@ -71,7 +71,7 @@ bool DemandHandler::init() { static_cast(ParameterIndex::PRESSURE_CONTROL_MODE), o.size()); initSuccess = false; } - if (o[DemanHandlerConfig::DEMAND].size() < + if (o[DemandHandlerConfig::DEMAND].size() < static_cast(ParameterIndex::SET_PRESSURE)) { TMFE::Instance()->Msg( MERROR, __FUNCTION__, @@ -93,7 +93,7 @@ bool DemandHandler::init() { } bool DemandHandler::setHotlink() { - midas::odb to_watch(this->path + "/" + DemanHandlerConfig::DEMAND); + midas::odb to_watch(this->path + "/" + DemandHandlerConfig::DEMAND); to_watch.watch([&](midas::odb &arg) { switch (arg.get_last_index()) { case static_cast(ParameterIndex::MINIMAL_PRESSURE): @@ -125,7 +125,7 @@ bool DemandHandler::setHotlink() { void DemandHandler::pullMinimalPressure() { midas::odb o(this->path); float minimalPressure = - o[DemanHandlerConfig::DEMAND] + o[DemandHandlerConfig::DEMAND] [static_cast(ParameterIndex::MINIMAL_PRESSURE)]; Event event = {EventType::MINIMAL_PRESSURE, minimalPressure}; eventBus.publish(event); @@ -134,7 +134,7 @@ void DemandHandler::pullMinimalPressure() { void DemandHandler::pullMaximalPressure() { midas::odb o(this->path); float maximalPressure = - o[DemanHandlerConfig::DEMAND] + o[DemandHandlerConfig::DEMAND] [static_cast(ParameterIndex::MAXIMAL_PRESSURE)]; Event event = {EventType::MAXIMAL_PRESSURE, maximalPressure}; eventBus.publish(event); @@ -142,7 +142,7 @@ void DemandHandler::pullMaximalPressure() { void DemandHandler::pullConstante1() { midas::odb o(this->path); - float constante1 = o[DemanHandlerConfig::DEMAND] + float constante1 = o[DemandHandlerConfig::DEMAND] [static_cast(ParameterIndex::CONSTANTE_1)]; Event event = {EventType::CONSTANTE_1, constante1}; eventBus.publish(event); @@ -150,7 +150,7 @@ void DemandHandler::pullConstante1() { void DemandHandler::pullConstante2() { midas::odb o(this->path); - float constance2 = o[DemanHandlerConfig::DEMAND] + float constance2 = o[DemandHandlerConfig::DEMAND] [static_cast(ParameterIndex::CONSTANTE_2)]; Event event = {EventType::CONSTANTE_2, constance2}; eventBus.publish(event); @@ -159,7 +159,7 @@ void DemandHandler::pullConstante2() { void DemandHandler::pullPressureControlMode() { midas::odb o(this->path); float pressureControlMode = - o[DemanHandlerConfig::DEMAND] + o[DemandHandlerConfig::DEMAND] [static_cast(ParameterIndex::PRESSURE_CONTROL_MODE)]; Event event = {EventType::PRESSURE_CONTROL_MODE, pressureControlMode != 0}; eventBus.publish(event); @@ -167,7 +167,7 @@ void DemandHandler::pullPressureControlMode() { void DemandHandler::pullSetPressure() { midas::odb o(this->path); - float setPressure = o[DemanHandlerConfig::DEMAND] + float setPressure = o[DemandHandlerConfig::DEMAND] [static_cast(ParameterIndex::SET_PRESSURE)]; Event event = {EventType::SET_PRESSURE, setPressure != 0}; eventBus.publish(event); @@ -175,8 +175,8 @@ void DemandHandler::pullSetPressure() { DemandHandler::DemandHandler(EventBus &eventBusReference, std::string equipmentName) - : path(DemanHandlerConfig::PATH_PREFIX + equipmentName + - DemanHandlerConfig::PATH_SUFFIX), + : path(DemandHandlerConfig::PATH_PREFIX + equipmentName + + DemandHandlerConfig::PATH_SUFFIX), eventBus(eventBusReference) { eventBus.subscribe( diff --git a/src/device/handlers/DemandHandlerConfig.h b/src/device/handlers/DemandHandlerConfig.h index a6ea7f9..d08975c 100644 --- a/src/device/handlers/DemandHandlerConfig.h +++ b/src/device/handlers/DemandHandlerConfig.h @@ -3,7 +3,7 @@ #include -namespace DemanHandlerConfig { +namespace DemandHandlerConfig { const std::string PATH_PREFIX = "/Equipment/"; const std::string PATH_SUFFIX = "/Variables"; const std::string DEMAND = "Demand"; @@ -19,6 +19,6 @@ enum class ParameterIndex { MAXIMUM_PARAMETER_INDEX = 11 }; -}; // namespace DemanHandlerConfig +}; // namespace DemandHandlerConfig #endif