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_MULTISENSE_S7AR  = 9;
00091     static CRL_CONSTEXPR uint32_t HARDWARE_REV_BCAM             = 100;
00092 
00093     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_GREY   = 1;
00094     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_COLOR  = 2;
00095     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_GREY   = 3;
00096     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_COLOR  = 4;
00097     static CRL_CONSTEXPR uint32_t IMAGER_TYPE_IMX104_COLOR   = 100;
00098 
00099     static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_NONE = 0;
00100     static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_SL_INTERNAL = 1;
00101     static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_S21_EXTERNAL = 2;
00102 
00103     std::string key;
00104     std::string name;
00105     std::string buildDate;
00106     std::string serialNumber;
00107     uint32_t    hardwareRevision;
00108 
00109     uint8_t     numberOfPcbs;
00110     PcbInfo     pcbs[MAX_PCBS];
00111 
00112     std::string imagerName;
00113     uint32_t    imagerType;
00114     uint32_t    imagerWidth;
00115     uint32_t    imagerHeight;
00116 
00117     std::string lensName;
00118     uint32_t    lensType;
00119     float       nominalBaseline;          // meters
00120     float       nominalFocalLength;       // meters
00121     float       nominalRelativeAperture;  // f-stop
00122 
00123     uint32_t    lightingType;
00124     uint32_t    numberOfLights;
00125 
00126     std::string laserName;
00127     uint32_t    laserType;
00128 
00129     std::string motorName;
00130     uint32_t    motorType;
00131     float       motorGearReduction;
00132 
00133     //
00134     // Constructors
00135 
00136     SysDeviceInfo(utility::BufferStreamReader&r, VersionType v) {serialize(r,v);};
00137     SysDeviceInfo() :
00138         hardwareRevision(0),
00139         imagerType(0),
00140         imagerWidth(0),
00141         imagerHeight(0),
00142         lensType(0),
00143         nominalBaseline(0),
00144         nominalFocalLength(0),
00145         nominalRelativeAperture(0.0),
00146         lightingType(0),
00147         numberOfLights(0),
00148         laserType(0),
00149         motorType(0),
00150         motorGearReduction(0.0) {};
00151 
00152     //
00153     // Serialization routine
00154 
00155     template<class Archive>
00156         void serialize(Archive&          message,
00157                        const VersionType version)
00158     {
00159         message & key;
00160         message & name;
00161         message & buildDate;
00162         message & serialNumber;
00163         message & hardwareRevision;
00164 
00165         message & numberOfPcbs;
00166 
00167         uint8_t num = std::min(numberOfPcbs, (uint8_t) MAX_PCBS);
00168         for(uint8_t i=0; i<num; i++)
00169             pcbs[i].serialize(message, version);
00170 
00171         message & imagerName;
00172         message & imagerType;
00173         message & imagerWidth;
00174         message & imagerHeight;
00175         message & lensName;
00176         message & lensType;
00177         message & nominalBaseline;
00178         message & nominalFocalLength;
00179         message & nominalRelativeAperture;
00180         message & lightingType;
00181         message & numberOfLights;
00182         message & laserName;
00183         message & laserType;
00184         message & motorName;
00185         message & motorType;
00186         message & motorGearReduction;
00187     }
00188 };
00189 
00190 }}}}; // namespaces
00191 
00192 #endif


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