From 1597bfee306600b87407d30f6c53d276b74ceb65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laurent=20P=C3=A9tr=C3=A9?= <laurent.petre@cern.ch>
Date: Thu, 19 Nov 2020 18:02:13 +0100
Subject: [PATCH 1/3] Use an unique timer name for polling the AMC13 trigger
 counter

---
 gemhardware/managers/src/amc13/AMC13Manager.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gemhardware/managers/src/amc13/AMC13Manager.cpp b/gemhardware/managers/src/amc13/AMC13Manager.cpp
index 39d6c77d..b508028f 100644
--- a/gemhardware/managers/src/amc13/AMC13Manager.cpp
+++ b/gemhardware/managers/src/amc13/AMC13Manager.cpp
@@ -167,7 +167,15 @@ gem::hardware::amc13::AMC13Manager::AMC13Manager(xdaq::ApplicationStub* stub)
     xoap::bind(this, &gem::hardware::amc13::AMC13Manager::disableTriggers, "disableTriggers", XDAQ_NS_URI);
 
     xoap::bind(this, &gem::hardware::amc13::AMC13Manager::restartAMC13Counts, "restartAMC13Counts", XDAQ_NS_URI);
-    p_timer = toolbox::task::getTimerFactory()->createTimer("AMC13ScanTriggerCounter");
+
+    // Create the timer polling the trigger counter
+    const std::string class_name = this->getApplicationDescriptor()->getClassName();
+    const uint32_t instance_number = this->getApplicationDescriptor()->getInstance();
+
+    std::stringstream tmp_timer_name;
+    tmp_timer_name << class_name << ":" << instance_number << ":AMC13ScanTriggerCounter";
+
+    p_timer = toolbox::task::getTimerFactory()->createTimer(tmp_timer_name.str());
 
     m_updatedL1ACount = 0;
 }
-- 
GitLab


From 5b28795d7fdc4bc3f90da51c59801cc86380336d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laurent=20P=C3=A9tr=C3=A9?= <laurent.petre@cern.ch>
Date: Tue, 19 Jan 2021 15:14:11 +0100
Subject: [PATCH 2/3] Use the standard naming scheme for the FSM workloop

i.e. <xDAQ defined prefix>:<class name>:<instance number>:<my name>
---
 gembase/src/GEMFSM.cpp | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/gembase/src/GEMFSM.cpp b/gembase/src/GEMFSM.cpp
index 2b85dc8b..e08db7e8 100644
--- a/gembase/src/GEMFSM.cpp
+++ b/gembase/src/GEMFSM.cpp
@@ -29,14 +29,13 @@ gem::base::GEMFSM::GEMFSM(GEMFSMApplication* const gemAppP)
     CMSGEMOS_DEBUG("GEMFSM::ctor begin");
 
     // Create the underlying Finite State Machine itself.
-    std::stringstream commandLoopName;
-    uint32_t instanceNumber = p_gemApp->getApplicationDescriptor()->getInstance();
-    std::string className = p_gemApp->getApplicationDescriptor()->getClassName();
-
-    // also want to get the name of the GEM FSM aplication to put it into this commandLoopName
-    commandLoopName << "urn:toolbox-task-workloop:gemFSMCommandLoop:"
-                    << className << ":" << instanceNumber;
-    p_gemfsm = new toolbox::fsm::AsynchronousFiniteStateMachine(commandLoopName.str());
+    const std::string class_name = p_gemApp->getApplicationDescriptor()->getClassName();
+    const uint32_t instance_number = p_gemApp->getApplicationDescriptor()->getInstance();
+
+    std::stringstream tmp_workloop_name;
+    tmp_workloop_name << class_name << ":" << instance_number << ":asyncFSM";
+
+    p_gemfsm = new toolbox::fsm::AsynchronousFiniteStateMachine(tmp_workloop_name.str());
 
     // A map to look up the names of the 'intermediate' state transitions.
     // TCDS does things this way, is it the right way for GEMs?
-- 
GitLab


From 196edc6ed33abf88c9e91c1dc05819805e29f0c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laurent=20P=C3=A9tr=C3=A9?= <laurent.petre@cern.ch>
Date: Tue, 19 Jan 2021 15:17:17 +0100
Subject: [PATCH 3/3] Use the standard naming scheme for the GEMFSMApplication
 workloop

i.e. <xDAQ defined prefix>:<class name>:<instance number>:<my name>
---
 gembase/src/GEMFSMApplication.cpp | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/gembase/src/GEMFSMApplication.cpp b/gembase/src/GEMFSMApplication.cpp
index 1781a960..0751ae26 100644
--- a/gembase/src/GEMFSMApplication.cpp
+++ b/gembase/src/GEMFSMApplication.cpp
@@ -93,15 +93,14 @@ gem::base::GEMFSMApplication::GEMFSMApplication(xdaq::ApplicationStub* stub)
     m_resetSig = toolbox::task::bind(this, &GEMFSMApplication::reset, "reset");
     CMSGEMOS_DEBUG("GEMFSMApplication::Created task bindings");
 
-    std::stringstream tmpLoopName;
-    uint32_t localID = this->getApplicationDescriptor()->getLocalId();
-    std::string className = this->getApplicationDescriptor()->getClassName();
-    CMSGEMOS_DEBUG("GEMFSMApplication::Obtained local ID and class names " << localID << ", " << className);
-
-    // also want to get the name of the GEM FSM aplication to put it into this commandLoopName
-    tmpLoopName << "urn:toolbox-task-workloop:"
-                << className << ":" << localID;
-    workLoopName = tmpLoopName.str();
+    // Workloop name
+    const std::string class_name = this->getApplicationDescriptor()->getClassName();
+    const uint32_t instance_number = this->getApplicationDescriptor()->getInstance();
+
+    std::stringstream tmp_workloop_name;
+    tmp_workloop_name << class_name << ":" << instance_number << ":fsmTransition";
+
+    workLoopName = tmp_workloop_name.str();
     CMSGEMOS_DEBUG("GEMFSMApplication::Created workloop name " << workLoopName);
 
     updateState();
-- 
GitLab