libvisiontransfer  7.0.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_EDGE, "sgm_p1_edge"},
30  {SGM_P2_EDGE, "sgm_p2_edge"},
31  {SGM_P1_NO_EDGE, "sgm_p1_no_edge"},
32  {SGM_P2_NO_EDGE, "sgm_p2_no_edge"},
33  {SGM_EDGE_SENSITIVITY, "sgm_edge_sensitivity"},
34  {MASK_BORDER_PIXELS_ENABLED, "mask_border_pixels_enabled"},
35  {CONSISTENCY_CHECK_ENABLED, "consistency_check_enabled"},
36  {CONSISTENCY_CHECK_SENSITIVITY, "consistency_check_sensitivity"},
37  {UNIQUENESS_CHECK_ENABLED, "uniqueness_check_enabled"},
38  {UNIQUENESS_CHECK_SENSITIVITY, "uniqueness_check_sensitivity"},
39  {TEXTURE_FILTER_ENABLED, "texture_filter_enabled"},
40  {TEXTURE_FILTER_SENSITIVITY, "texture_filter_sensitivity"},
41  {GAP_INTERPOLATION_ENABLED, "gap_interpolation_enabled"},
42  {NOISE_REDUCTION_ENABLED, "noise_reduction_enabled"},
43  {SPECKLE_FILTER_ITERATIONS, "speckle_filter_iterations"},
44  // Exposure settings
45  {AUTO_EXPOSURE_MODE, "auto_exposure_mode"},
46  {AUTO_TARGET_INTENSITY, "auto_target_intensity"},
47  {AUTO_INTENSITY_DELTA, "auto_intensity_delta"},
48  {AUTO_TARGET_FRAME, "auto_target_frame"},
49  {AUTO_SKIPPED_FRAMES, "auto_skipped_frames"},
50  {AUTO_MAXIMUM_EXPOSURE_TIME, "auto_maximum_exposure_time"},
51  {AUTO_MAXIMUM_GAIN, "auto_maximum_gain"},
52  {MANUAL_EXPOSURE_TIME, "manual_exposure_time"},
53  {MANUAL_GAIN, "manual_gain"},
54  {AUTO_EXPOSURE_ROI_ENABLED, "auto_exposure_roi_enabled"},
55  {AUTO_EXPOSURE_ROI_X, "auto_exposure_roi_x"},
56  {AUTO_EXPOSURE_ROI_Y, "auto_exposure_roi_y"},
57  {AUTO_EXPOSURE_ROI_WIDTH, "auto_exposure_roi_width"},
58  {AUTO_EXPOSURE_ROI_HEIGHT, "auto_exposure_roi_height"},
59  // Trigger / Pairing
60  {MAX_FRAME_TIME_DIFFERENCE_MS, "max_frame_time_difference_ms"},
61  {TRIGGER_FREQUENCY, "trigger_frequency"},
62  {TRIGGER_0_ENABLED, "trigger_0_enabled"},
63  {TRIGGER_0_PULSE_WIDTH, "trigger_0_pulse_width"},
64  {TRIGGER_1_ENABLED, "trigger_1_enabled"},
65  {TRIGGER_1_PULSE_WIDTH, "trigger_1_pulse_width"},
66  {TRIGGER_1_OFFSET, "trigger_1_offset"},
67  // Auto Re-calibration
68  {AUTO_RECALIBRATION_ENABLED, "auto_recalibration_enabled"},
69  {AUTO_RECALIBRATION_PERMANENT, "auto_recalibration_permanent"},
70  // System settings
71  {REBOOT, "reboot"},
72  };
73 
74 }} // namespace
75 
76 
static ParameterID getParameterIDForName(const std::string &name)
Return the ID for a string configuration key (reverse lookup), or UNDEFINED if unknown.
Nerian Vision Technologies