15 _dev_model(dev_model),
18 _process_started(false),
19 _process_timeout(
std::
chrono::seconds(30))
35 bool keep_showing =
true;
36 bool yes_was_chosen =
false;
52 std::string message_text =
"Camera Accuracy Health will ensure you get the highest accuracy from your camera.\n\n" 53 "This process may take several minutes and requires special setup to get good results.\n" 54 "While it is working, the viewer will not be usable.";
57 if (fw_upgrade_needed)
59 disable_reason_text =
"Camera Accuracy Health requires a minimal FW version of " + min_fw_version +
60 "\n\nPlease update your firmware and try again. ";
62 else if (!is_depth_streaming || !is_color_streaming)
64 disable_reason_text =
"Camera Accuracy Health cannot be triggered : both depth & RGB streams must be active.";
66 else if (auto_cah_is_working)
68 disable_reason_text =
"Camera Accuracy Health is already in progress in the background.\n" 69 "Please try again in a few minutes. ";
73 message_text +=
"\n\nAre you sure you want to continue?";
76 bool option_disabled = !is_depth_streaming || !is_color_streaming || auto_cah_is_working || fw_upgrade_needed;
77 if (
yes_no_dialog(
"Camera Accuracy Health Trigger", message_text, yes_was_chosen, window, error_message, option_disabled, disable_reason_text))
98 catch( std::exception
const &
e )
100 error_message =
to_string() <<
"Trigger calibration failure:\n" << e.what();
115 keep_showing =
false;
136 static std::map<rs2_calibration_status, std::string> status_map{
155 process_finished =
true;
161 "Camera Accuracy Health is In progress, this may take a while...";
162 if (
status_dialog(
"Camera Accuracy Health Status", message, status_map[calibration_status], process_finished, window))
164 keep_showing =
false;
184 bool keep_showing =
true;
185 bool yes_was_chosen =
false;
187 std::string message_text(
"This will reset the camera settings to their factory-calibrated state.\nYou will lose any improvements made with Camera Accuracy Health.\n\n Are you sure?");
188 if (
yes_no_dialog(
"Camera Accuracy Health Reset", message_text, yes_was_chosen, window, error_message))
208 catch (std::exception
const &
e)
210 error_message =
to_string() <<
"Calibration reset failure:\n" << e.what();
214 keep_showing =
false;
GLenum GLuint GLenum GLsizei const GLchar * message
bool prompt_trigger_popup(ux_window &window, std::string &error_message)
device_model & _dev_model
bool status_dialog(const std::string &title, const std::string &process_topic_text, const std::string &process_status_text, bool enable_close, ux_window &window)
GLsizei const GLchar *const * string
utilities::time::timer _process_timeout
cah_model(device_model &dev_model, viewer_model &viewer)
const char * get_info(rs2_camera_info info) const
static std::atomic< rs2_calibration_status > global_calib_status
bool yes_no_dialog(const std::string &title, const std::string &message_text, bool &approved, ux_window &window, const std::string &error_message, bool disabled, const std::string &disabled_reason)
std::atomic< model_state_type > _state
std::vector< std::shared_ptr< subdevice_model > > subdevices
bool prompt_reset_popup(ux_window &window, std::string &error_message)
bool is_upgradeable(const std::string &curr, const std::string &available)
void register_calibration_change_callback(T callback)
std::string to_string(T value)