SysDeviceInfoMessage.h
Go to the documentation of this file.
00001 
00039 #ifndef LibMultiSense_SysDeviceInfoMessage
00040 #define LibMultiSense_SysDeviceInfoMessage
00041 
00042 #include <algorithm>
00043 #include <string>
00044 #include "Protocol.h"
00045 #include "../utility/BufferStream.hh"
00046 
00047 namespace crl {
00048 namespace multisense {
00049 namespace details {
00050 namespace wire {
00051 
00052 class PcbInfo {
00053 public:
00054     static CRL_CONSTEXPR VersionType VERSION = 1;
00055 
00056     std::string name;
00057     uint32_t    revision;
00058 
00059     template<class Archive>
00060         void serialize(Archive&          message,
00061                        const VersionType version)
00062     {
00063         message & name;
00064         message & revision;
00065     };
00066 };
00067 
00068 class SysDeviceInfo {
00069 public:
00070     static CRL_CONSTEXPR IdType      ID      = ID_DATA_SYS_DEVICE_INFO;
00071     static CRL_CONSTEXPR VersionType VERSION = 1;
00072 
00073     //
00074     // These constants are stored in flash on the device, do
00075     // not change these, only add.
00076     //
00077     // crl::multisense::DeviceInfo:: has similar constants
00078     // that can be changed at will (just remember to
00079     // map any differences when translating between
00080     // WIRE and API.)
00081 
00082     static CRL_CONSTEXPR uint8_t  MAX_PCBS = 8;
00083 
00084     static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_SL    = 1;
00085     static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7    = 2;
00086     static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_M     = 3;
00087     static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7S   = 4;
00088     static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S21   = 5;
00089     static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_ST21  = 6;
00090     static CRL_CONSTEXPR uint32_t HARDWARE_REV_BCAM             = 100;
00091 
00092     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_GREY   = 1;
00093     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_COLOR  = 2;
00094     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_GREY   = 3;
00095     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_COLOR  = 4;
00096     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_IMX104_COLOR   = 100;
00097 
00098     std::string key;
00099     std::string name;
00100     std::string buildDate;
00101     std::string serialNumber;
00102     uint32_t    hardwareRevision;
00103 
00104     uint8_t     numberOfPcbs;
00105     PcbInfo     pcbs[MAX_PCBS];
00106 
00107     std::string imagerName;
00108     uint32_t    imagerType;
00109     uint32_t    imagerWidth;
00110     uint32_t    imagerHeight;
00111 
00112     std::string lensName;
00113     uint32_t    lensType;
00114     float       nominalBaseline;          // meters
00115     float       nominalFocalLength;       // meters
00116     float       nominalRelativeAperture;  // f-stop
00117 
00118     uint32_t    lightingType;
00119     uint32_t    numberOfLights;
00120 
00121     std::string laserName;
00122     uint32_t    laserType;
00123 
00124     std::string motorName;
00125     uint32_t    motorType;
00126     float       motorGearReduction;
00127 
00128     //
00129     // Constructors
00130 
00131     SysDeviceInfo(utility::BufferStreamReader&r, VersionType v) {serialize(r,v);};
00132     SysDeviceInfo() :
00133         hardwareRevision(0),
00134         imagerType(0),
00135         imagerWidth(0),
00136         imagerHeight(0),
00137         lensType(0),
00138         nominalBaseline(0),
00139         nominalFocalLength(0),
00140         nominalRelativeAperture(0.0),
00141         lightingType(0),
00142         numberOfLights(0),
00143         laserType(0),
00144         motorType(0),
00145         motorGearReduction(0.0) {};
00146 
00147     //
00148     // Serialization routine
00149 
00150     template<class Archive>
00151         void serialize(Archive&          message,
00152                        const VersionType version)
00153     {
00154         message & key;
00155         message & name;
00156         message & buildDate;
00157         message & serialNumber;
00158         message & hardwareRevision;
00159 
00160         message & numberOfPcbs;
00161 
00162         uint8_t num = std::min(numberOfPcbs, (uint8_t) MAX_PCBS);
00163         for(uint8_t i=0; i<num; i++)
00164             pcbs[i].serialize(message, version);
00165 
00166         message & imagerName;
00167         message & imagerType;
00168         message & imagerWidth;
00169         message & imagerHeight;
00170         message & lensName;
00171         message & lensType;
00172         message & nominalBaseline;
00173         message & nominalFocalLength;
00174         message & nominalRelativeAperture;
00175         message & lightingType;
00176         message & numberOfLights;
00177         message & laserName;
00178         message & laserType;
00179         message & motorName;
00180         message & motorType;
00181         message & motorGearReduction;
00182     }
00183 };
00184 
00185 }}}}; // namespaces
00186 
00187 #endif


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