diff --git a/include/ePowerSwitchFront.h b/include/ePowerSwitchFront.h index 53783e3..f4298e6 100644 --- a/include/ePowerSwitchFront.h +++ b/include/ePowerSwitchFront.h @@ -9,16 +9,16 @@ class ePowerSwitchEquipment : public TMFeEquipment { public: /** - * @brief contructor + * @brief constructor * - * @param equipmentName name show on midas for the equipment - * @param equipmentFileName file name for automatic tagged message + * @param equipmentName name show on Midas for the equipment + * @param equipmentFileName file name for automatically tagged message */ ePowerSwitchEquipment(std::string equipmentName, const char *equipmentFileName); /** - * @brief call periodicly by midas + * @brief called periodically by Midas */ void HandlePeriodic(); @@ -29,14 +29,14 @@ class ePowerSwitchEquipment : public TMFeEquipment { int numberOfOutlet; /** - * @brief refresh information about the given socket id + * @brief refresh information about the given socket ID * * @param socketId which socket to refresh */ void refreshSocket(int socketId); /** - * @brief refresh information about all the available socket + * @brief refresh information about all the available sockets */ void refreshAllSockets(); @@ -49,10 +49,10 @@ class ePowerSwitchEquipment : public TMFeEquipment { class ePowerSwitchFrontend : public TMFrontend { public: /** - * @brief contructor + * @brief constructor * - * @param frontendName name show on midas for the frontend - * @param equipmentName name show on midas for the equipment + * @param frontendName name shown on Midas for the frontend + * @param equipmentName name shown on Midas for the equipment */ ePowerSwitchFrontend(std::string frontendName, std::string equipmentName); }; diff --git a/src/ePowerSwitchFront.cpp b/src/ePowerSwitchFront.cpp index e0740c9..79ca831 100644 --- a/src/ePowerSwitchFront.cpp +++ b/src/ePowerSwitchFront.cpp @@ -182,6 +182,21 @@ void ePowerSwitchEquipment::updateSocketNumber() { mEpicsCa *getRecord = this->outletGetRecords.back(); delete getRecord; + std::string requestedVarname = + format("Socket ", i) + std::string(" requested"); + std::string currentVarname = + format("Socket ", i) + std::string(" current"); + + MVOdbError ovbError; + + fOdbEqVariables->Delete(requestedVarname.c_str(), &ovbError); + if (ovbError.fError) + fMfe->Msg(MERROR, __FUNCTION__, ovbError.fErrorString); + + fOdbEqVariables->Delete(currentVarname.c_str(), &ovbError); + if (ovbError.fError) + fMfe->Msg(MERROR, __FUNCTION__, ovbError.fErrorString); + this->outletSetRecords.pop_back(); this->outletGetRecords.pop_back(); }