From 7d2dfa138692c902cac2f512200396249b1a9cd7 Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Tue, 21 Jan 2020 13:24:36 +0100
Subject: [PATCH] fix repeatedly reporting device-not-opened state as data
 fault

---
 include/TriggerFanOut.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/TriggerFanOut.h b/include/TriggerFanOut.h
index 9df4faff..af5d5d51 100644
--- a/include/TriggerFanOut.h
+++ b/include/TriggerFanOut.h
@@ -80,8 +80,11 @@ namespace ChimeraTK {
       retry:
         try {
           if(!_deviceModule.device.isOpened()) {
-            auto version = externalTrigger->getVersionNumber();
-            //boost::fusion::for_each(fanOutMap.table, SendDataToConsumers(version, DataValidity::faulty));
+            if(lastValidity == DataValidity::ok) {
+              lastValidity = DataValidity::faulty;
+              auto version = externalTrigger->getVersionNumber();
+              boost::fusion::for_each(fanOutMap.table, SendDataToConsumers(version, DataValidity::faulty));
+            }
             Application::getInstance().testableModeUnlock("waitForDeviceOpen");
             boost::this_thread::sleep(boost::posix_time::millisec(DeviceOpenTimeout));
             Application::getInstance().testableModeLock("waitForDeviceOpen");
-- 
GitLab