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             = 2;
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 
00065     //
00066     // The reported uptime for the system
00067     //
00068 
00069     utility::TimeStamp uptime;
00070     uint32_t           status;
00071     float              temperature0; // celsius
00072     float              temperature1;
00073     
00074     //
00075     // Version 2 additions
00076 
00077     float              temperature2; // celsius
00078     float              temperature3;
00079 
00080     float              inputVolts;    // volts
00081     float              inputCurrent;  // amps
00082     float              fpgaPower;     // watts
00083     float              logicPower;
00084     float              imagerPower;
00085 
00086     //
00087     // Constructors
00088 
00089     StatusResponse(utility::BufferStreamReader&r, VersionType v) {serialize(r,v);};
00090     StatusResponse() : uptime(), 
00091                        status(0), 
00092                        temperature0(INVALID_TEMPERATURE()), 
00093                        temperature1(INVALID_TEMPERATURE()),
00094                        temperature2(INVALID_TEMPERATURE()),
00095                        temperature3(INVALID_TEMPERATURE()),
00096                        inputVolts(-1.0),
00097                        inputCurrent(-1.0),
00098                        fpgaPower(-1.0),
00099                        logicPower(-1.0),
00100                        imagerPower(-1.0) {};
00101                        
00102     //
00103     // Serialization routine
00104 
00105     template<class Archive>
00106         void serialize(Archive&          message,
00107                        const VersionType version)
00108     {
00109         message & uptime;
00110         message & status;
00111         message & temperature0;
00112         message & temperature1;
00113 
00114         if (version >= 2) {
00115             message & temperature2;
00116             message & temperature3;
00117             message & inputVolts;
00118             message & inputCurrent;
00119             message & fpgaPower;
00120             message & logicPower;
00121             message & imagerPower;
00122         }   
00123     }
00124 };
00125 
00126 }}}}; // namespaces
00127 
00128 #endif


multisense_lib
Author(s):
autogenerated on Thu Aug 27 2015 14:01:11