From 492f06055b52530ea847ff67c61ddab1f19b412e Mon Sep 17 00:00:00 2001 From: Jacques Gouno <jacques.gouno@synchrotron-soleil.fr> Date: Tue, 28 Feb 2017 17:09:20 +0000 Subject: [PATCH] Created tag release_1_1_9. --- pom.xml | 2 +- src/CryoCoolerInterface.cpp | 55 ++++++++++++++++++++++++++++++++++++- src/TypesAndConsts.h | 11 ++++++-- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index cc37f38..258dc7f 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ </parent> <groupId>fr.soleil.device</groupId> <artifactId>CryoCooler-${aol}-${mode}</artifactId> - <version>1.1.8</version> + <version>1.1.9</version> <packaging>nar</packaging> <name>CryoCooler</name> <!-- use for the name of executable --> diff --git a/src/CryoCoolerInterface.cpp b/src/CryoCoolerInterface.cpp index d81634c..d740d46 100755 --- a/src/CryoCoolerInterface.cpp +++ b/src/CryoCoolerInterface.cpp @@ -625,6 +625,59 @@ namespace CryoCooler_ns //----------------------------------------------- void CryoCoolerInterface::periodic_job_i (void) { - DEBUG_STREAM << "CryoCoolerInterface::periodic_job_i trying to read PLC Data " << std::endl; + + long l_com_error = 0; +#ifdef _DB_SEGMENTATION_BY_104_ + //- hwp_rd_start is alive + if (hwp_rd_start) + { + l_com_error += hwp_rd_start->get_com_error(); + this->com_state = hwp_rd_start->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp_rd_start->get_com_status(); + this->last_error = hwp_rd_start->get_last_error(); + return; + } + } + //- hwp_rd_end is alive + if (hwp_rd_end) + { + l_com_error += hwp_rd_end->get_com_error(); + this->com_state = hwp_rd_end->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp_rd_end->get_com_status(); + this->last_error = hwp_rd_end->get_last_error(); + return; + } + } +#else + if (hwp) + { + l_com_error += hwp->get_com_error(); + this->com_state = hwp->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp->get_com_status(); + this->last_error = hwp->get_last_error(); + return; + } + } +#endif + //- hwp_wr is alive + if (hwp_wr) + { + l_com_error += hwp_wr->get_com_error(); + this->com_state = hwp_wr->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp_wr->get_com_status(); + this->last_error = hwp_wr->get_last_error(); + return; + } + } + this->com_error = l_com_error; + } } //- namespace diff --git a/src/TypesAndConsts.h b/src/TypesAndConsts.h index 3bbcf57..ef8997e 100755 --- a/src/TypesAndConsts.h +++ b/src/TypesAndConsts.h @@ -8,8 +8,6 @@ //============================================================================= #ifndef __TYPES_AND_CONSTS_H__ #define __TYPES_AND_CONSTS_H__ -#include <math.h> - namespace CryoCooler_ns { @@ -34,7 +32,14 @@ namespace CryoCooler_ns //- DB_WRITE constantes static unsigned int DB_WRITE_INPUT_OFFSET = 0; - static unsigned int DB_WRITE_INPUT_LEN = 0; + + // ------------------------------------------- + // - WRITE must be = READ_WRITE. + // At least one element in input zone otherwise + // the read_hard () method raises an exception. + // Pb corrected in PLCServerProxy version 3.0.5 + // ---------------------------------------------- + static unsigned int DB_WRITE_INPUT_LEN = 1; static unsigned int DB_WRITE_OUTPUT_OFFSET = 0; static unsigned int DB_WRITE_OUTPUT_LEN = 100; -- GitLab