From 38d5e72852b9bc22fe1f1c699df9c13e083e526c Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Mon, 23 Mar 2020 16:21:54 +0100
Subject: [PATCH] chage some commend, added a debug output

---
 modules/src/TecModule.cc | 6 +++++-
 tests/src/TecDummy.cc    | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/src/TecModule.cc b/modules/src/TecModule.cc
index 01baee3..337231d 100644
--- a/modules/src/TecModule.cc
+++ b/modules/src/TecModule.cc
@@ -28,7 +28,10 @@ void TecModule::mainLoop() {
   auto tecIface = std::make_shared<TecChimeraInterface>(
       triggerCommands, responseStatus, commandMemoryRaw_wr, commandMemoryRaw_rd, true);
   TecController tec{tecIface};
-  tec.addFrame(0, TecFrame::TecParameter::ExpFanControlEnable, TecFrame::TecFrameType::TecParameterValueSet, 1, 42);
+
+  /* This code is just for demonstration/testing purposes. We can use code like this to revese engineer the teclib
+   * when implementing the TecDummy backend. It will be removed later! */
+  tec.addFrame(0, TecFrame::TecParameter::ObjMaxTempChange, TecFrame::TecFrameType::TecParameterValueSet, 1, 0.0F);
   tec.addFrame(0, TecFrame::TecParameter::DeviceStatus, TecFrame::TecFrameType::TecParameterValueRead, 1);
   std::cout << "constructAllFrames:" << std::endl;
   tec.constructAllFrames();
@@ -46,6 +49,7 @@ void TecModule::mainLoop() {
   std::cout << "parseAllFrames:" << std::endl;
   tec.parseAllFrames();
   for(uint8_t i = 0; i < tec.getFrameCount(); i++) {
+    std::cout << "STATE = " << tec.getFrameAt(i)->getState() << std::endl;
     tec.getFrameAt(i)->print();
   }
   std::cout << "done." << std::endl;
diff --git a/tests/src/TecDummy.cc b/tests/src/TecDummy.cc
index 12b7d31..a9077df 100644
--- a/tests/src/TecDummy.cc
+++ b/tests/src/TecDummy.cc
@@ -68,7 +68,7 @@ std::string TecDummy::processFrame(const std::string& command) {
   // accessor. Just return this function, the done flag is automatically set by the caller. Remove this comment after
   // implementation.
   std::cout << "TecDummy::processFrame() command = " << command << std::endl;
-  return "MY REPLY";
+  return "!000000MY_REPLY";
 }
 
 /*********************************************************************************************************************/
-- 
GitLab