SysDeviceInfoMessage.h
Go to the documentation of this file.
1 
39 #ifndef LibMultiSense_SysDeviceInfoMessage
40 #define LibMultiSense_SysDeviceInfoMessage
41 
42 #include <algorithm>
43 #include <string>
44 #include "Protocol.h"
45 #include "../utility/BufferStream.hh"
46 
47 namespace crl {
48 namespace multisense {
49 namespace details {
50 namespace wire {
51 
52 class PcbInfo {
53 public:
55 
56  std::string name;
57  uint32_t revision;
58 
59  template<class Archive>
60  void serialize(Archive& message,
61  const VersionType version)
62  {
63  message & name;
64  message & revision;
65  };
66 };
67 
69 public:
72 
73  //
74  // These constants are stored in flash on the device, do
75  // not change these, only add.
76  //
77  // crl::multisense::DeviceInfo:: has similar constants
78  // that can be changed at will (just remember to
79  // map any differences when translating between
80  // WIRE and API.)
81 
82  static CRL_CONSTEXPR uint8_t MAX_PCBS = 8;
83 
84  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_SL = 1;
85  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7 = 2;
86  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_M = 3;
87  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7S = 4;
88  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S21 = 5;
89  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_ST21 = 6;
90  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7AR = 9;
91  static CRL_CONSTEXPR uint32_t HARDWARE_REV_BCAM = 100;
92 
93  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_GREY = 1;
94  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_COLOR = 2;
95  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_GREY = 3;
96  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_COLOR = 4;
97  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_IMX104_COLOR = 100;
98 
99  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_NONE = 0;
100  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_SL_INTERNAL = 1;
101  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_S21_EXTERNAL = 2;
102 
103  std::string key;
104  std::string name;
105  std::string buildDate;
106  std::string serialNumber;
108 
109  uint8_t numberOfPcbs;
110  PcbInfo pcbs[MAX_PCBS];
111 
112  std::string imagerName;
113  uint32_t imagerType;
114  uint32_t imagerWidth;
115  uint32_t imagerHeight;
116 
117  std::string lensName;
118  uint32_t lensType;
119  float nominalBaseline; // meters
120  float nominalFocalLength; // meters
121  float nominalRelativeAperture; // f-stop
122 
123  uint32_t lightingType;
124  uint32_t numberOfLights;
125 
126  std::string laserName;
127  uint32_t laserType;
128 
129  std::string motorName;
130  uint32_t motorType;
132 
133  //
134  // Constructors
135 
138  hardwareRevision(0),
139  imagerType(0),
140  imagerWidth(0),
141  imagerHeight(0),
142  lensType(0),
143  nominalBaseline(0),
144  nominalFocalLength(0),
145  nominalRelativeAperture(0.0),
146  lightingType(0),
147  numberOfLights(0),
148  laserType(0),
149  motorType(0),
150  motorGearReduction(0.0) {};
151 
152  //
153  // Serialization routine
154 
155  template<class Archive>
156  void serialize(Archive& message,
157  const VersionType version)
158  {
159  message & key;
160  message & name;
161  message & buildDate;
162  message & serialNumber;
163  message & hardwareRevision;
164 
165  message & numberOfPcbs;
166 
167  uint8_t num = std::min(numberOfPcbs, (uint8_t) MAX_PCBS);
168  for(uint8_t i=0; i<num; i++)
169  pcbs[i].serialize(message, version);
170 
171  message & imagerName;
172  message & imagerType;
173  message & imagerWidth;
174  message & imagerHeight;
175  message & lensName;
176  message & lensType;
177  message & nominalBaseline;
178  message & nominalFocalLength;
179  message & nominalRelativeAperture;
180  message & lightingType;
181  message & numberOfLights;
182  message & laserName;
183  message & laserType;
184  message & motorName;
185  message & motorType;
186  message & motorGearReduction;
187  }
188 };
189 
190 }}}}; // namespaces
191 
192 #endif
void serialize(Archive &message, const VersionType version)
void serialize(Archive &message, const VersionType version)
static CRL_CONSTEXPR IdType ID_DATA_SYS_DEVICE_INFO
Definition: Protocol.h:190
Definition: channel.cc:56
SysDeviceInfo(utility::BufferStreamReader &r, VersionType v)
#define CRL_CONSTEXPR
Definition: Portability.hh:38
static CRL_CONSTEXPR VersionType VERSION


multisense_lib
Author(s):
autogenerated on Sat Apr 6 2019 02:16:46