libvisiontransfer  6.5.0
standardparameterids.cpp
1 #include <visiontransfer/standardparameterids.h>
2 
3 namespace visiontransfer {
4 namespace internal {
5 
7 StandardParameterIDs::ParameterID StandardParameterIDs::getParameterIDForName(const std::string& name)
8 {
9  static std::map<std::string, StandardParameterIDs::ParameterID> lookup;
10  if (!lookup.size()) {
11  std::map<std::string, StandardParameterIDs::ParameterID> m;
12  for (const auto& kv: StandardParameterIDs::parameterNameByID) {
13  m[kv.second] = kv.first;
14  }
15  lookup = m;
16  }
17  auto it = lookup.find(name);
18  if (it==lookup.end()) return StandardParameterIDs::ParameterID::UNDEFINED;
19  return it->second;
20 }
21 
22 const std::map<StandardParameterIDs::ParameterID, std::string>
23 StandardParameterIDs::parameterNameByID {
24  // Processing settings
25  {OPERATION_MODE, "operation_mode"},
26  {NUMBER_OF_DISPARITIES, "number_of_disparities"},
27  {DISPARITY_OFFSET, "disparity_offset"},
28  // Algorithmic settings
29  {SGM_P1, "sgm_p1"},
30  {SGM_P2, "sgm_p2"},
31  {MASK_BORDER_PIXELS_ENABLED, "mask_border_pixels_enabled"},
32  {CONSISTENCY_CHECK_ENABLED, "consistency_check_enabled"},
33  {CONSISTENCY_CHECK_SENSITIVITY, "consistency_check_sensitivity"},
34  {UNIQUENESS_CHECK_ENABLED, "uniqueness_check_enabled"},
35  {UNIQUENESS_CHECK_SENSITIVITY, "uniqueness_check_sensitivity"},
36  {TEXTURE_FILTER_ENABLED, "texture_filter_enabled"},
37  {TEXTURE_FILTER_SENSITIVITY, "texture_filter_sensitivity"},
38  {GAP_INTERPOLATION_ENABLED, "gap_interpolation_enabled"},
39  {NOISE_REDUCTION_ENABLED, "noise_reduction_enabled"},
40  {SPECKLE_FILTER_ITERATIONS, "speckle_filter_iterations"},
41  // Exposure settings
42  {AUTO_EXPOSURE_MODE, "auto_exposure_mode"},
43  {AUTO_TARGET_INTENSITY, "auto_target_intensity"},
44  {AUTO_INTENSITY_DELTA, "auto_intensity_delta"},
45  {AUTO_TARGET_FRAME, "auto_target_frame"},
46  {AUTO_SKIPPED_FRAMES, "auto_skipped_frames"},
47  {AUTO_MAXIMUM_EXPOSURE_TIME, "auto_maximum_exposure_time"},
48  {AUTO_MAXIMUM_GAIN, "auto_maximum_gain"},
49  {MANUAL_EXPOSURE_TIME, "manual_exposure_time"},
50  {MANUAL_GAIN, "manual_gain"},
51  {AUTO_EXPOSURE_ROI_ENABLED, "auto_exposure_roi_enabled"},
52  {AUTO_EXPOSURE_ROI_X, "auto_exposure_roi_x"},
53  {AUTO_EXPOSURE_ROI_Y, "auto_exposure_roi_y"},
54  {AUTO_EXPOSURE_ROI_WIDTH, "auto_exposure_roi_width"},
55  {AUTO_EXPOSURE_ROI_HEIGHT, "auto_exposure_roi_height"},
56  // Trigger / Pairing
57  {MAX_FRAME_TIME_DIFFERENCE_MS, "max_frame_time_difference_ms"},
58  {TRIGGER_FREQUENCY, "trigger_frequency"},
59  {TRIGGER_0_ENABLED, "trigger_0_enabled"},
60  {TRIGGER_0_PULSE_WIDTH, "trigger_0_pulse_width"},
61  {TRIGGER_1_ENABLED, "trigger_1_enabled"},
62  {TRIGGER_1_PULSE_WIDTH, "trigger_1_pulse_width"},
63  {TRIGGER_1_OFFSET, "trigger_1_offset"},
64  // Auto Re-calibration
65  {AUTO_RECALIBRATION_ENABLED, "auto_recalibration_enabled"},
66  {AUTO_RECALIBRATION_PERMANENT, "auto_recalibration_permanent"},
67  // System settings
68  {REBOOT, "reboot"},
69  };
70 
71 }} // namespace
72 
73 
static ParameterID getParameterIDForName(const std::string &name)
Return the ID for a string configuration key (reverse lookup), or UNDEFINED if unknown.
Nerian Vision Technologies