From 1b34946bc26b7171127eb00d1aac0d5c935588d8 Mon Sep 17 00:00:00 2001
From: Nabywaniec <localadmin_mnabywan@Campus.gsi.de>
Date: Mon, 10 Oct 2022 15:36:07 +0200
Subject: [PATCH] Add boolean support in sillecs communication

---
 .../interface/equipment/SilecsRegister.cpp                 | 2 ++
 .../interface/equipment/SilecsRegister.h                   | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.cpp b/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.cpp
index 8685283..fb20dde 100644
--- a/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.cpp
+++ b/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.cpp
@@ -1285,6 +1285,8 @@ FormatType Register::whichFormatType(std::string type)
         return Float64;
     else if (type == "string")
         return String;
+    else if (type == "bool")
+        return Bool;
     else
         throw SilecsException(__FILE__, __LINE__, DATA_UNKNOWN_FORMAT_TYPE, type);
 }
diff --git a/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.h b/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.h
index 3bc0838..fcebaa1 100644
--- a/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.h
+++ b/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.h
@@ -48,7 +48,8 @@ static const std::string FormatTypeString[] = { //!!Must be synchronized with Fo
 "uInt64", /*!<: 64-bits unsigned integer*/
 "Int64", /*!<: 64-bits integer*/
 "Float64", /*!<: 64-bits signed float*/
-"String" /*!<: String of ASCII characters*/
+"String", /*!<: String of ASCII characters*/
+"Bool"
 };
 
 /*!
@@ -78,8 +79,8 @@ typedef enum
     uInt64 = 8, /*!<: 64-bits unsigned integer*/
     Int64 = 9, /*!<: 64-bits integer*/
     Float64 = 10, /*!<: 64-bits signed float*/
-    String = 11
-
+    String = 11,
+    Bool = 12
 } FormatType;
 
 /*!
-- 
GitLab