From d5fc50d91be5a5f5a47d8f85aa0386a635ddf2a5 Mon Sep 17 00:00:00 2001 From: Hugo Jean Ponsin Date: Thu, 30 Jul 2026 16:14:03 +0200 Subject: [PATCH] adding grace period --- src/device/power_switch.cpp | 7 ++++++- src/device/power_switch.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/device/power_switch.cpp b/src/device/power_switch.cpp index 5dd05f5..388dce3 100644 --- a/src/device/power_switch.cpp +++ b/src/device/power_switch.cpp @@ -66,7 +66,12 @@ void powerSwitch::updateOutletNumber() { int returnCode = outletNumberRecord.get(&newNumberOfOutlet); if (returnCode != CM_SUCCESS) { - fMfe->Msg(MERROR, __FUNCTION__, "Unable to read outlet record number"); + if (gracePeriod < 0) { + fMfe->Msg(MERROR, __FUNCTION__, + "Unable to read outlet record number"); + } else { + gracePeriod--; + } } if (this->numberOfOutlet < newNumberOfOutlet) { diff --git a/src/device/power_switch.h b/src/device/power_switch.h index 1acd9a4..b45f0f0 100644 --- a/src/device/power_switch.h +++ b/src/device/power_switch.h @@ -16,8 +16,8 @@ class powerSwitch : public TMFeEquipment { mEpicsCa outletNumberRecord; int numberOfOutlet; std::string equipmentPath; - void updateOutletNumber(); + int gracePeriod = 10; void sendCommand(int index); };