From 20d5b50eb75f24c8b4f289674a92b5007e34ce89 Mon Sep 17 00:00:00 2001
From: vargheseg <19566373+vargheseg@users.noreply.github.com>
Date: Mon, 28 Sep 2020 10:34:40 +0200
Subject: [PATCH] default dmsg_info.ident  when no macropulse source

dmsg_info.ident is set to 0 when DoocsProcessArray and
DoocsProcessScalar do not have a macropulse source defined.  This is
what the other supported types do currently; behavior should be
consistent between the types with this commit.

Revert this if it is not the intended behavior.
---
 include/DoocsProcessArray.h  | 7 ++++++-
 include/DoocsProcessScalar.h | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/DoocsProcessArray.h b/include/DoocsProcessArray.h
index 4c5d8eb..fdcf999 100644
--- a/include/DoocsProcessArray.h
+++ b/include/DoocsProcessArray.h
@@ -148,7 +148,12 @@ namespace ChimeraTK {
         memset(&info, 0, sizeof(info));
         info.sec = seconds;
         info.usec = microseconds;
-        info.ident = _macroPulseNumberSource->accessData(0);
+        if(_macroPulseNumberSource != nullptr) {
+          info.ident = _macroPulseNumberSource->accessData(0);
+        }
+        else {
+          info.ident = 0;
+        }
         auto ret = this->send(&info);
         if(ret) {
           std::cout << "ZeroMQ sending failed!!!" << std::endl;
diff --git a/include/DoocsProcessScalar.h b/include/DoocsProcessScalar.h
index b68e712..8f3b330 100644
--- a/include/DoocsProcessScalar.h
+++ b/include/DoocsProcessScalar.h
@@ -103,7 +103,12 @@ namespace ChimeraTK {
         memset(&info, 0, sizeof(info));
         info.sec = seconds;
         info.usec = microseconds;
-        info.ident = _macroPulseNumberSource->accessData(0);
+        if(_macroPulseNumberSource != nullptr) {
+          info.ident = _macroPulseNumberSource->accessData(0);
+        }
+        else {
+          info.ident = 0;
+        }
         auto ret = this->send(&info);
         if(ret) {
           std::cout << "ZeroMQ sending failed!!!" << std::endl;
-- 
GitLab