From d2634806b40ea65d2b71d446ade9c393652624a3 Mon Sep 17 00:00:00 2001
From: aschwinn <al.schwinn@gsi.de>
Date: Fri, 21 Jul 2017 15:07:45 +0200
Subject: [PATCH] [SIL-137] Set Date&Time is required

---
 .../interface/equipment/SilecsRegister.h      | 58 ++++++++++++++-----
 1 file changed, 44 insertions(+), 14 deletions(-)

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 66cd817..a034dce 100644
--- a/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.h
+++ b/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsRegister.h
@@ -521,26 +521,26 @@ namespace Silecs
          */
         const float* getRefFloatArray2D(uint32_t& dim1, uint32_t& dim2);
 
-		/*!
+        /*!
          * \brief Extracts the current value from the register input buffer.
-         * Date type represents the number of millisecond elapsed since 00:00:00
+         * Date type represents the floating-point number of second elapsed since 00:00:00
          * on January 1, 1970, Coordinated Universal Time (UTC)
          * \return the buffer content in a unsigned double format
          */
 		double getValDate();
 		
-		/*!
+        /*!
          * \brief Extracts the vector of values from the register input buffer.
-         * Date type represents the number of millisecond elapsed since 00:00:00
+         * Date type represents the floating-point number of second elapsed since 00:00:00
          * on January 1, 1970, Coordinated Universal Time (UTC)
          * \param pVal a double* pointer to a memory location where the method will store a copy of the array
          * \param dim vector length in unsigned long format
          */
 		void getValDateArray(double* pVal, uint32_t dim);
 		
-		/*!
+        /*!
          * \brief Extracts the 2D-array of values from the register input buffer.
-         * Date type represents the number of millisecond elapsed since 00:00:00
+         * Date type represents the floating-point number of second elapsed since 00:00:00
          * on January 1, 1970, Coordinated Universal Time (UTC)
          * \param pVal a double* pointer to a memory location where the method will store a copy of the flat 2D-array
          * \param dim1 first dimension of 2D-array in unsigned long format
@@ -548,9 +548,9 @@ namespace Silecs
          */
         void getValDateArray2D(double* pVal, uint32_t dim1, uint32_t dim2);
 		
-		/*!
+        /*!
          * \brief Return a reference to register input buffer.
-         * Date type represents the number of millisecond elapsed since 00:00:00
+         * Date type represents the floating-point number of second elapsed since 00:00:00
          * on January 1, 1970, Coordinated Universal Time (UTC)
          * The usage of this method can speed up reading and writing operations when the buffer is very big and a small part of
          * information is requested. This method gives direct access on the buffer and his adoption is not recommended.
@@ -559,9 +559,9 @@ namespace Silecs
          */
 		const double* getRefDateArray(uint32_t& dim);
 		
-		/*!
+        /*!
          * \brief Return a reference to register input buffer.
-         * Date type represents the number of millisecond elapsed since 00:00:00
+         * Date type represents the floating-point number of second elapsed since 00:00:00
          * on January 1, 1970, Coordinated Universal Time (UTC)
          * The usage of this method can speed up reading and writing operations when the buffer is very big and a small part of
          * information is requested. This method gives direct access on the buffer and his adoption is not recommended.
@@ -1029,10 +1029,18 @@ namespace Silecs
 		
         /*!
          * \brief Converts the double Date type to tm broken-down time structure
-		 * conforming to POSIX convention (look at localtime() manpages)
-		 * \return tm broken-down time structure
-		 */
+         * conforming to POSIX convention (look at localtime() man pages)
+         * \param date Floating-point number of second that has elapsed since UTC (00:00) on January 1, 1900
+         * \return tm Broken-down time structure
+         */
 		static struct tm getTMDate(double date);
+
+        /*!
+         * \brief Converts (static-cast) the floating-point SILECS Date type to standard time_t,
+         * as those returned by Linux function time().
+         * \param date Floating-point number of second that has elapsed since UTC (00:00) on January 1, 1900
+         * \return time_t value
+         */
 	    static time_t getEpochDate(double date);
 
 		// SET methods ========================================================
@@ -1230,9 +1238,31 @@ namespace Silecs
          */
         void setValFloatArray2D(const float* pVal, uint32_t dim1, uint32_t dim2);
 		
-		//Set date is not required for the time being
+        /*!
+         * \brief Set the value for the Date register output buffer.(Send must be done afterwards)
+         * Date type represents the floating-point number of second elapsed since 00:00:00
+         * on January 1, 1970, Coordinated Universal Time (UTC)
+         * \param val Value to be written in the buffer in a double format
+         */
 		void setValDate(double val);
+
+        /*!
+         * \brief Set the value for the Date array register output buffer.(Send must be done afterwards)
+         * Date type represents the floating-point number of second elapsed since 00:00:00
+         * on January 1, 1970, Coordinated Universal Time (UTC)
+         * \param pVal A double* pointer to a memory location from where the method will get the array values
+         * \param dim Vector length in unsigned long format
+         */
 		void setValDateArray(const double* pVal, uint32_t dim);
+
+        /*!
+         * \brief Set the value for the 2D-array register output buffer. (Send must be done afterwards)
+         * Date type represents the floating-point number of second elapsed since 00:00:00
+         * on January 1, 1970, Coordinated Universal Time (UTC)
+         * \param pVal A double* pointer to a memory location from where the method will get the flat 2D-array values
+         * \param dim1 First dimension of flat 2D-array in unsigned long format
+         * \param dim2 Second dimension of flat 2D-array in unsigned long format
+         */
 		void setValDateArray2D(const double* pVal, uint32_t dim1, uint32_t dim2);
 		
 
-- 
GitLab