8 #ifndef _CAMGIGEPROSILICALOOKUP_H
9 #define _CAMGIGEPROSILICALOOKUP_H
11 #include "camera_interface/CamTypes.h"
23 case ePvErrCameraFault:
24 return "Unexpected camera fault";
25 case ePvErrInternalFault:
26 return "Unexpected fault in PvApi or driver";
28 return "Camera handle is invalid";
29 case ePvErrBadParameter:
30 return "Bad parameter to API call";
31 case ePvErrBadSequence:
32 return "Sequence of API calls is incorrect";
34 return "Camera or attribute not found";
35 case ePvErrAccessDenied:
36 return "Camera cannot be opened in the specified mode";
38 return "Camera was unplugged";
39 case ePvErrInvalidSetup:
40 return "Setup is invalid (an attribute is invalid)";
42 return "System/network resources or memory not available";
44 return "1394 bandwidth not available";
46 return "Too many frames on queue";
47 case ePvErrBufferTooSmall:
48 return "Frame buffer is too small";
50 return "Frame cancelled by user";
52 return "The data for the frame was lost";
53 case ePvErrDataMissing:
54 return "Some data in the frame is missing";
56 return "Timeout during wait";
57 case ePvErrOutOfRange:
58 return "Attribute value is out of the expected range";
60 return "Attribute is not this type (wrong access function) ";
62 return "Attribute write forbidden at this time";
63 case ePvErrUnavailable:
64 return "Attribute is not available at this time";
66 return "A firewall is blocking the traffic (Windows only)";
68 return "unkown camera error";
70 return "unkown camera error";
73 inline static void attribToStr(enum_attrib::CamAttrib attrib,
79 case enum_attrib::FrameStartTriggerModeToFreerun:
80 string1 =
"FrameStartTriggerMode";
83 case enum_attrib::FrameStartTriggerModeToSyncIn1:
84 string1 =
"FrameStartTriggerMode";
87 case enum_attrib::FrameStartTriggerModeToSyncIn2:
88 string1 =
"FrameStartTriggerMode";
91 case enum_attrib::FrameStartTriggerModeToSyncIn3:
92 string1 =
"FrameStartTriggerMode";
95 case enum_attrib::FrameStartTriggerModeToSyncIn4:
96 string1 =
"FrameStartTriggerMode";
99 case enum_attrib::FrameStartTriggerModeToFixedRate:
100 string1 =
"FrameStartTriggerMode";
101 string2 =
"FixedRate";
103 case enum_attrib::FrameStartTriggerModeToSoftware:
104 string1 =
"FrameStartTriggerMode";
105 string2 =
"Software";
107 case enum_attrib::ExposureModeToManual:
108 string1 =
"ExposureMode";
111 case enum_attrib::ExposureModeToAuto:
112 string1 =
"ExposureMode";
115 case enum_attrib::ExposureModeToAutoOnce:
116 string1 =
"ExposureMode";
117 string2 =
"AutoOnce";
119 case enum_attrib::ExposureModeToExternal:
120 string1 =
"ExposureMode";
121 string2 =
"External";
123 case enum_attrib::GainModeToManual:
124 string1 =
"GainMode";
127 case enum_attrib::GainModeToAuto:
128 string1 =
"GainMode";
131 case enum_attrib::WhitebalModeToAuto:
132 string1 =
"WhitebalMode";
135 case enum_attrib::WhitebalModeToManual:
136 string1 =
"WhitebalMode";
139 case enum_attrib::WhitebalModeToAutoOnce:
140 string1 =
"WhitebalMode";
141 string2 =
"AutoOnce";
143 case enum_attrib::ConfigFileIndexTo1:
144 string1 =
"ConfigFileIndex";
147 case enum_attrib::ConfigFileIndexTo2:
148 string1 =
"ConfigFileIndex";
151 case enum_attrib::ConfigFileIndexTo3:
152 string1 =
"ConfigFileIndex";
155 case enum_attrib::ConfigFileIndexTo4:
156 string1 =
"ConfigFileIndex";
159 case enum_attrib::ConfigFileIndexToFactory:
160 string1 =
"ConfigFileIndex";
163 case enum_attrib::FrameStartTriggerEventToEdgeFalling:
164 string1 =
"FrameStartTriggerEvent";
165 string2 =
"EdgeFalling";
167 case enum_attrib::FrameStartTriggerEventToEdgeAny:
168 string1 =
"FrameStartTriggerEvent";
171 case enum_attrib::FrameStartTriggerEventToEdgeRising:
172 string1 =
"FrameStartTriggerEvent";
173 string2 =
"EdgeRising";
175 case enum_attrib::FrameStartTriggerEventToLevelHigh:
176 string1 =
"FrameStartTriggerEvent";
177 string2 =
"LevelHigh";
179 case enum_attrib::FrameStartTriggerEventToLevelLow:
180 string1 =
"FrameStartTriggerEvent";
181 string2 =
"LevelLow";
183 case enum_attrib::SyncOut1ModeToGPO:
184 string1 =
"SyncOut1Mode";
187 case enum_attrib::SyncOut1ModeToAcquisitionTriggerReady:
188 string1 =
"SyncOut1Mode";
189 string2 =
"AcquisitionTriggerReady";
191 case enum_attrib::SyncOut1ModeToFrameTriggerReady:
192 string1 =
"SyncOut1Mode";
193 string2 =
"FrameTriggerReady";
195 case enum_attrib::SyncOut1ModeToFrameTrigger:
196 string1 =
"SyncOut1Mode";
197 string2 =
"FrameTrigger";
199 case enum_attrib::SyncOut1ModeToExposing:
200 string1 =
"SyncOut1Mode";
201 string2 =
"Exposing";
203 case enum_attrib::SyncOut1ModeToFrameReadout:
204 string1 =
"SyncOut1Mode";
205 string2 =
"FrameReadout";
207 case enum_attrib::SyncOut1ModeToImaging:
208 string1 =
"SyncOut1Mode";
211 case enum_attrib::SyncOut1ModeToAcquiring:
212 string1 =
"SyncOut1Mode";
213 string2 =
"Acquiring";
215 case enum_attrib::SyncOut1ModeToSyncIn1:
216 string1 =
"SyncOut1Mode";
219 case enum_attrib::SyncOut1ModeToSyncIn2:
220 string1 =
"SyncOut1Mode";
223 case enum_attrib::SyncOut1ModeToStrobe1:
224 string1 =
"SyncOut1Mode";
227 case enum_attrib::SyncOut1ModeToStrobe2:
228 string1 =
"SyncOut1Mode";
231 case enum_attrib::SyncOut2ModeToGPO:
232 string1 =
"SyncOut2Mode";
235 case enum_attrib::SyncOut2ModeToAcquisitionTriggerReady:
236 string1 =
"SyncOut2Mode";
237 string2 =
"AcquisitionTriggerReady";
239 case enum_attrib::SyncOut2ModeToFrameTriggerReady:
240 string1 =
"SyncOut2Mode";
241 string2 =
"FrameTriggerReady";
243 case enum_attrib::SyncOut2ModeToFrameTrigger:
244 string1 =
"SyncOut2Mode";
245 string2 =
"FrameTrigger";
247 case enum_attrib::SyncOut2ModeToExposing:
248 string1 =
"SyncOut2Mode";
249 string2 =
"Exposing";
251 case enum_attrib::SyncOut2ModeToFrameReadout:
252 string1 =
"SyncOut2Mode";
253 string2 =
"FrameReadout";
255 case enum_attrib::SyncOut2ModeToImaging:
256 string1 =
"SyncOut2Mode";
259 case enum_attrib::SyncOut2ModeToAcquiring:
260 string1 =
"SyncOut2Mode";
261 string2 =
"Acquiring";
263 case enum_attrib::SyncOut2ModeToSyncIn1:
264 string1 =
"SyncOut2Mode";
267 case enum_attrib::SyncOut2ModeToSyncIn2:
268 string1 =
"SyncOut2Mode";
271 case enum_attrib::SyncOut2ModeToStrobe1:
272 string1 =
"SyncOut2Mode";
275 case enum_attrib::SyncOut2ModeToStrobe2:
276 string1 =
"SyncOut2Mode";
279 case enum_attrib::SyncOut1InvertToOn:
280 string1 =
"SyncOut1Invert";
283 case enum_attrib::SyncOut1InvertToOff:
284 string1 =
"SyncOut1Invert";
287 case enum_attrib::SyncOut2InvertToOn:
288 string1 =
"SyncOut2Invert";
291 case enum_attrib::SyncOut2InvertToOff:
292 string1 =
"SyncOut2Invert";
295 case enum_attrib::ExposureAutoAlgToMean:
296 string1 =
"ExposureAutoAlg";
299 case enum_attrib::ExposureAutoAlgToFitRange:
300 string1 =
"ExposureAutoAlg";
301 string2 =
"FitRange";
305 std::stringstream strstr;
306 strstr <<
"Enum Attribute "<< attrib <<
" is not find in CamGigEProsilicaLookUp.h";
307 throw std::runtime_error(strstr.str());
312 inline static void attribToStr(str_attrib::CamAttrib attrib,std::string &
string)
316 case str_attrib::DeviceEthAddress:
317 string =
"DeviceEthAddress";
319 case str_attrib::DeviceIPAddress:
320 string =
"DeviceIPAddress";
322 case str_attrib::HostIPAddress:
323 string =
"HostIPAddress";
325 case str_attrib::MulticastIPAddress:
326 string =
"MulticastIPAddress";
328 case str_attrib::CameraName:
329 string =
"CameraName";
331 case str_attrib::ModelName:
332 string =
"ModelName";
334 case str_attrib::SerialNumber:
335 string =
"SerialNumber";
337 case str_attrib::PartRevision:
338 string =
"PartRevision";
340 case str_attrib::StatFilterVersion:
341 string =
"StatFilterVersion";
345 std::stringstream strstr;
346 strstr <<
"String Attribute "<< attrib <<
" is not supported by the "
347 <<
"camera. Call isAttribAvail first!";
348 throw std::runtime_error(strstr.str());
353 inline static void attribToStr(double_attrib::CamAttrib attrib,std::string &
string)
357 case double_attrib::FrameRate:
358 string =
"FrameRate";
360 case double_attrib::StatFrameRate:
361 string =
"StatFrameRate";
365 std::stringstream strstr;
366 strstr <<
"Double Attribute "<< attrib <<
" is not supported by the "
367 <<
"camera. Call isAttribAvail first!";
368 throw std::runtime_error(strstr.str());
373 inline static void attribToStr(int_attrib::CamAttrib attrib,std::string &
string)
377 case int_attrib::BinningX:
380 case int_attrib::BinningY:
383 case int_attrib::RegionX:
386 case int_attrib::RegionY:
389 case int_attrib::TotalBytesPerFrame:
390 string =
"TotalBytesPerFrame";
392 case int_attrib::AcquisitionFrameCount:
393 string =
"AcquisitionFrameCount";
395 case int_attrib::RecorderPreEventCount:
396 string =
"RecorderPreEventCount";
398 case int_attrib::FrameStartTriggerDelay:
399 string =
"FrameStartTriggerDelay";
401 case int_attrib::ExposureValue:
402 string =
"ExposureValue";
404 case int_attrib::ExposureAutoMax:
405 string =
"ExposureAutoMax";
407 case int_attrib::ExposureAutoMin:
408 string =
"ExposureAutoMin";
410 case int_attrib::ExposureAutoOutliers:
411 string =
"ExposureAutoOutliers";
413 case int_attrib::ExposureAutoRate:
414 string =
"ExposureAutoRate";
416 case int_attrib::ExposureAutoTarget:
417 string =
"ExposureAutoTarget";
419 case int_attrib::ExposureAutoAdjustTol:
420 string =
"ExposureAutoAdjustTol";
422 case int_attrib::GainValue:
423 string =
"GainValue";
425 case int_attrib::GainAutoAdjustDelay:
426 string =
"GainAutoAdjustDelay";
428 case int_attrib::GainAutoAdjustTol:
429 string =
"GainAutoAdjustTol";
431 case int_attrib::GainAutoMax:
432 string =
"GainAutoMax";
434 case int_attrib::GainAutoMin:
435 string =
"GainAutoMin";
437 case int_attrib::GainAutoOutliers:
438 string =
"GainAutoOutliers";
440 case int_attrib::GainAutoRate:
441 string =
"GainAutoRate";
443 case int_attrib::GainAutoTarget:
444 string =
"ExposureAutoAdjustTol";
446 case int_attrib::WhitebalValueRed:
447 string =
"WhitebalValueRed";
449 case int_attrib::WhitebalValueBlue:
450 string =
"WhitebalValueBlue";
452 case int_attrib::WhitebalAutoAdjustDelay:
453 string =
"WhitebalAutoAdjustDelay";
455 case int_attrib::WhitebalAutoAdjustTol:
456 string =
"WhitebalAutoAdjustTol";
458 case int_attrib::WhitebalAutoAlg:
459 string =
"WhitebalAutoAlg";
461 case int_attrib::WhitebalAutoRate:
462 string =
"WhitebalAutoRate";
464 case int_attrib::OffsetValue:
465 string =
"OffsetValue";
467 case int_attrib::DSPSubregionLeft:
468 string =
"DSPSubregionLeft";
470 case int_attrib::DSPSubregionTop:
471 string =
"DSPSubregionTop";
473 case int_attrib::DSPSubregionRight:
474 string =
"DSPSubregionRight";
476 case int_attrib::DSPSubregionBottom:
477 string =
"DSPSubregionBottom";
479 case int_attrib::IrisAutoTarget:
480 string =
"IrisAutoTarget";
482 case int_attrib::IrisVideoLevelMin:
483 string =
"IrisVideoLevelMin";
485 case int_attrib::IrisVideoLevelMax:
486 string =
"IrisVideoLevelMax";
488 case int_attrib::IrisVideoLevel:
489 string =
"IrisVideoLevel";
491 case int_attrib::SyncInLevels:
492 string =
"SyncInLevels";
494 case int_attrib::SyncOutGpoLevels:
495 string =
"SyncOutGpoLevels";
497 case int_attrib::Strobe1Delay:
498 string =
"Strobe1Delay";
500 case int_attrib::Strobe1Duration:
501 string =
"Strobe1Duration";
503 case int_attrib::StreamBytesPerSecond:
504 string =
"StreamBytesPerSecond";
506 case int_attrib::GvcpRetries:
507 string =
"GvcpRetries";
509 case int_attrib::HeartbeatTimeout:
510 string =
"HeartbeatTimeout";
512 case int_attrib::HeartbeatInterval:
513 string =
"HeartbeatInterval";
515 case int_attrib::StreamHoldCapacity:
516 string =
"StreamHoldCapacity";
518 case int_attrib::UniqueId:
521 case int_attrib::PartNumber:
522 string =
"PartNumber";
524 case int_attrib::PartVersion:
525 string =
"PartVersion";
527 case int_attrib::FirmwareVerMajor:
528 string =
"FirmwareVerMajor";
530 case int_attrib::FirmwareVerMinor:
531 string =
"FirmwareVerMinor";
533 case int_attrib::FirmwareVerBuild:
534 string =
"FirmwareVerBuild";
536 case int_attrib::SensorBits:
537 string =
"SensorBits";
539 case int_attrib::SensorWidth:
540 string =
"SensorWidth";
542 case int_attrib::SensorHeight:
543 string =
"SensorHeight";
545 case int_attrib::TimeStampFrequency:
546 string =
"TimeStampFrequency";
548 case int_attrib::StatFramesCompleted:
549 string =
"StatFramesCompleted";
551 case int_attrib::StatFramesDropped:
552 string =
"StatFramesDropped";
554 case int_attrib::StatPacketsErroneous:
555 string =
"StatPacketsErroneous";
557 case int_attrib::StatPacketsMissed:
558 string =
"StatPacketsMissed";
560 case int_attrib::StatPacketsReceived:
561 string =
"StatPacketsReceived";
563 case int_attrib::StatPacketsRequested:
564 string =
"StatPacketsRequested";
566 case int_attrib::StatPacketsResent:
567 string =
"StatPacketsResent";
576 std::stringstream strstr;
577 strstr <<
"Int Attribute "<< attrib <<
" is not supported by the "
578 <<
"camera. Call isAttribAvail first!";
579 throw std::runtime_error(strstr.str());
584 inline static void convertStrToPixelFormat(
const std::string &str,
585 base::samples::frame::frame_mode_t &mode,
590 mode = base::samples::frame::MODE_GRAYSCALE;
593 else if(str ==
"Mono16")
595 mode = base::samples::frame::MODE_GRAYSCALE;
598 else if(str ==
"Rgb24")
600 mode = base::samples::frame::MODE_RGB;
603 else if(str ==
"Rgb48")
605 mode = base::samples::frame::MODE_RGB;
608 else if(str ==
"Bayer8")
610 mode = base::samples::frame::MODE_BAYER;
613 else if(str ==
"Bayer16")
615 mode = base::samples::frame::MODE_BAYER;
620 throw std::runtime_error(
"Can not convert string to PixelFormat! "
621 "Add the actual camera frame format to the CamInterface");
626 inline static std::string convertPixelFormatToStr(
const base::samples::frame::frame_mode_t mode,
631 case base::samples::frame::MODE_GRAYSCALE:
641 throw std::runtime_error(
"Choosen color depth value is "
642 "not supported by the camera!");
645 case base::samples::frame::MODE_RGB:
655 throw std::runtime_error(
"Choosen color depth value is "
656 "not supported by the camera!");
659 case base::samples::frame::MODE_BAYER:
660 case base::samples::frame::MODE_BAYER_GRBG:
661 case base::samples::frame::MODE_BAYER_GBRG:
662 case base::samples::frame::MODE_BAYER_RGGB:
663 case base::samples::frame::MODE_BAYER_BGGR:
674 std::stringstream strstr;
675 strstr <<
"Choosen color depth "<< depth <<
" is not supported by the camera!";
676 throw std::runtime_error(strstr.str());
681 throw std::runtime_error(
"Frame mode is not supported by"
std::string tPvErrToString(tPvErr err)
Definition: CamGigEProsilicaLookUp.h:17