StatusResponseMessage.h
Go to the documentation of this file.
00001 
00040 #ifndef LibMultiSense_StatusResponseMessage
00041 #define LibMultiSense_StatusResponseMessage
00042 
00043 #include "details/utility/Portability.hh"
00044 
00045 namespace crl {
00046 namespace multisense {
00047 namespace details {
00048 namespace wire {
00049 
00050 class StatusResponse {
00051 public:
00052     static CRL_CONSTEXPR IdType      ID                  = ID_DATA_STATUS;
00053     static CRL_CONSTEXPR VersionType VERSION             = 3;
00054         static CRL_CONSTEXPR float       INVALID_TEMPERATURE() { return -99999.0f; }
00055 
00056     //
00057     // Subsytem status
00058 
00059     static CRL_CONSTEXPR uint32_t STATUS_GENERAL_OK      = (1<<0);
00060     static CRL_CONSTEXPR uint32_t STATUS_LASER_OK        = (1<<1);
00061     static CRL_CONSTEXPR uint32_t STATUS_LASER_MOTOR_OK  = (1<<2);
00062     static CRL_CONSTEXPR uint32_t STATUS_CAMERAS_OK      = (1<<3);
00063     static CRL_CONSTEXPR uint32_t STATUS_IMU_OK          = (1<<4);
00064     static CRL_CONSTEXPR uint32_t STATUS_EXTERNAL_LED_OK = (1<<5);
00065     static CRL_CONSTEXPR uint32_t STATUS_PIPELINE_OK     = (1<<6);
00066 
00067     //
00068     // The reported uptime for the system
00069     //
00070 
00071     utility::TimeStamp uptime;
00072     uint32_t           status;
00073     float              temperature0; // celsius
00074     float              temperature1;
00075 
00076     //
00077     // Version 2 additions
00078 
00079     float              temperature2; // celsius
00080     float              temperature3;
00081 
00082     float              inputVolts;    // volts
00083     float              inputCurrent;  // amps
00084     float              fpgaPower;     // watts
00085     float              logicPower;
00086     float              imagerPower;
00087 
00088     //
00089     // Constructors
00090 
00091     StatusResponse(utility::BufferStreamReader&r, VersionType v) {serialize(r,v);};
00092     StatusResponse() : uptime(),
00093                        status(0),
00094                        temperature0(INVALID_TEMPERATURE()),
00095                        temperature1(INVALID_TEMPERATURE()),
00096                        temperature2(INVALID_TEMPERATURE()),
00097                        temperature3(INVALID_TEMPERATURE()),
00098                        inputVolts(-1.0),
00099                        inputCurrent(-1.0),
00100                        fpgaPower(-1.0),
00101                        logicPower(-1.0),
00102                        imagerPower(-1.0) {};
00103 
00104     //
00105     // Serialization routine
00106 
00107     template<class Archive>
00108         void serialize(Archive&          message,
00109                        const VersionType version)
00110     {
00111         message & uptime;
00112         message & status;
00113         message & temperature0;
00114         message & temperature1;
00115 
00116         if (version >= 2) {
00117             message & temperature2;
00118             message & temperature3;
00119             message & inputVolts;
00120             message & inputCurrent;
00121             message & fpgaPower;
00122             message & logicPower;
00123             message & imagerPower;
00124         }
00125 
00126         //
00127         // Enable the LED OK and pipeline OK status for older messages
00128         if (version < 3) {
00129             status |= STATUS_EXTERNAL_LED_OK;
00130             status |= STATUS_PIPELINE_OK;
00131         }
00132     }
00133 };
00134 
00135 }}}}; // namespaces
00136 
00137 #endif


multisense_lib
Author(s):
autogenerated on Mon Oct 9 2017 03:06:21