OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::MachineObject Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DeviceManager.hpp>

Collaboration diagram for Slic3r::MachineObject:

Classes

struct  FilamentData

Public Types

enum  ActiveState { NotActive , Active , UpdateToDate }
enum  PrintOption { PRINT_OP_AUTO_RECOVERY = 0 , PRINT_OP_MAX }
enum  PlateMakerDectect : int { POS_CHECK = 1 , TYPE_POS_CHECK = 2 }
enum  DoorOpenCheckState : int { DOOR_OPEN_CHECK_DISABLE = 0 , DOOR_OPEN_CHECK_ENABLE_WARNING = 1 , DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT = 2 }
enum  DeviceMode : unsigned int { DEVICE_MODE_FDM = 0x00000001 , DEVICE_MODE_LASER = 0x00000010 , DEVICE_MODE_CUT = 0x00000100 }
typedef std::function< void(std::string topic, std::string payload)> MsgFn

Public Member Functions

 MachineObject (DeviceManager *manager, NetworkAgent *agent, std::string name, std::string id, std::string ip)
 ~MachineObject ()
void set_agent (NetworkAgent *agent)
NetworkAgent * get_agent () const
std::shared_ptr< DevAxis > GetAxis () const
std::shared_ptr< DevChamber > GetChamber () const
DevCalib * GetCalib () const
DevStatus * GetStatus () const
std::weak_ptr< DevUpgrade > GetUpgrade () const
std::string get_dev_name () const
void set_dev_name (std::string val)
std::string get_dev_ip () const
void set_dev_ip (std::string ip)
std::string get_dev_id () const
void set_dev_id (std::string val)
std::string get_ftp_folder ()
std::string connection_type () const
bool is_lan_mode_printer () const
bool is_cloud_mode_printer () const
bool HasRecentCloudMessage ()
bool HasRecentLanMessage ()
bool has_access_right () const
void revoke_access ()
std::string get_access_code () const
void set_access_code (std::string code, bool only_refresh=true)
std::string get_show_printer_type () const
PrinterSeries get_printer_series () const
PrinterArch get_printer_arch () const
std::string get_printer_ams_type () const
wxString get_printer_type_display_str () const
std::string get_auto_pa_cali_thumbnail_img_str () const
std::string get_printer_series_str () const
bool is_series_n () const
bool is_series_p () const
bool is_series_x () const
bool is_series_o () const
bool can_use_emmc_print () const
void reload_printer_settings ()
std::string get_printer_thumbnail_img_str () const
bool is_avaliable ()
void set_lan_mode_connection_state (bool state)
bool get_lan_mode_connection_state ()
void set_ctt_dlg (wxString text)
void show_unsupported_dlg (int code)
bool is_in_extrusion_cali ()
bool is_extrusion_cali_finished ()
DevAms * get_curr_Ams ()
DevAmsTray * get_curr_tray ()
DevAmsTray * get_ams_tray (std::string ams_id, std::string tray_id)
std::string get_filament_id (std::string ams_id, std::string tray_id) const
std::string get_filament_type (const std::string &ams_id, const std::string &tray_id) const
std::string get_filament_display_type (const std::string &ams_id, const std::string &tray_id) const
void _parse_ams_status (int ams_status)
bool is_target_slot_unload () const
bool can_unload_filament ()
void get_ams_colors (std::vector< wxColour > &ams_colors)
bool is_main_extruder_on_left () const
bool is_multi_extruders () const
int get_extruder_id_by_ams_id (const std::string &ams_id)
int get_preset_extruder_index (int extder_id) const
bool is_nozzle_flow_type_supported () const
wxString get_nozzle_replace_url () const
DevExtderSystem * GetExtderSystem () const
std::weak_ptr< DevExtensionTool > GetExtensionTool () const
DevNozzleSystem * GetNozzleSystem () const
std::shared_ptr< DevNozzleMappingCtrl > get_nozzle_mapping_result () const
void clear_auto_nozzle_mapping ()
std::shared_ptr< DevFilaSystem > GetFilaSystem () const
DevFilaSwitch * GetFilaSwitch () const
bool HasAms () const
DevLamp * GetLamp () const
DevFan * GetFan () const
DevBed * GetBed () const
DevStorage * GetStorage () const
DevCtrl * GetCtrl () const
DevHMS * GetHMS () const
DevConfig * GetConfig () const
DevPrintOptions * GetPrintOptions () const
DevPrintingSpeedLevel GetPrintingSpeedLevel () const
std::string get_firmware_type_str ()
std::string get_lifecycle_type_str ()
bool is_in_upgrading () const
bool is_upgrading_avalable ()
int get_upgrade_percent () const
std::string get_ota_version ()
bool check_version_valid ()
wxString get_upgrade_result_str (int upgrade_err_code)
std::map< int, DevFirmwareVersionInfo > get_ams_version ()
void clear_version_info ()
void store_version_info (const DevFirmwareVersionInfo &info)
bool is_system_printing ()
std::string get_print_error_str () const
void add_command_error_code_dlg (int command_err, nlohmann::json action_json=nlohmann::json{})
void reset_pa_cali_history_result ()
void reset_pa_cali_result ()
void reset_flow_rate_cali_result ()
bool check_pa_result_validation (PACalibResult &result)
bool is_axis_at_home (std::string axis)
bool is_filament_at_extruder ()
wxString get_curr_stage ()
int get_curr_stage_idx ()
int get_stage_remaining_seconds () const
bool is_in_calibration ()
bool is_calibration_running ()
bool is_calibration_done ()
void parse_state_changed_event ()
void parse_home_flag (int flag)
int get_bed_temperature_limit ()
bool is_filament_installed ()
int connect ()
int disconnect ()
bool any_loaded_filament_is_stringing_prone () const
bool is_makeworld_subtask ()
bool is_fdm_type () const
bool is_sdcard_printing ()
bool is_timelapse ()
bool is_recording_enable ()
bool is_recording ()
int get_liveview_remote ()
int get_file_remote ()
std::string parse_version ()
void parse_version_func ()
bool is_studio_cmd (int seq)
bool canEnableTimelapse (wxString &error_message) const
bool is_timelapse_storage_low (const std::string &storage) const
int command_get_version (bool with_retry=true)
int command_request_push_all (bool request_now=false)
int command_pushing (std::string cmd)
int command_clean_print_error (std::string task_id, int print_error)
int command_clean_print_error_uiop (int print_error)
int command_set_printer_nozzle (std::string nozzle_type, float diameter)
int command_set_printer_nozzle2 (int id, std::string nozzle_type, float diameter)
int command_get_access_code ()
int command_start_camera ()
int command_ack_proceed (nlohmann::json &proceed)
int command_purification_disable ()
int command_dont_remind_next_time (nlohmann::json &mqtt_guard_json)
int command_upgrade_confirm ()
int command_consistency_upgrade_confirm ()
int command_upgrade_firmware (FirmwareInfo info)
int command_upgrade_module (std::string url, std::string module_type, std::string version)
int command_xyz_abs ()
int command_auto_leveling ()
int command_go_home ()
int command_task_abort ()
int command_task_partskip (std::vector< int > part_ids)
int command_task_cancel (std::string job_id)
int command_task_pause ()
int command_task_resume ()
int command_hms_idle_ignore (const std::string &error_str, int type)
int command_hms_resume (const std::string &error_str, const std::string &job_id)
int command_hms_ignore (const std::string &error_str, const std::string &job_id)
int command_hms_stop (const std::string &error_str, const std::string &job_id)
int command_stop_buzzer ()
int command_set_bed (int temp)
int command_set_nozzle (int temp)
int command_set_nozzle_new (int nozzle_id, int temp)
int command_refresh_nozzle ()
int command_set_chamber (int temp)
int check_resume_condition ()
int command_ams_change_filament (bool load, std::string ams_id, std::string slot_id, int old_temp=210, int new_temp=210, std::optional< int > extruder_id=std::nullopt)
int command_ams_user_settings (bool start_read_opt, bool tray_read_opt, bool remain_flag=false)
int command_ams_switch_filament (bool switch_filament)
int command_ams_air_print_detect (bool air_print_detect)
int command_ams_calibrate (int ams_id)
int command_ams_filament_settings (int ams_id, int slot_id, std::string filament_id, std::string setting_id, std::string tray_color, std::string tray_type, int nozzle_temp_min, int nozzle_temp_max, const std::vector< std::string > &tray_colors={}, int tray_ctype=2)
int command_ams_select_tray (std::string tray_id)
int command_ams_refresh_rfid (int ams_id, int slot_id)
int command_ams_control (std::string action)
int command_ams_drying_stop ()
int command_start_extrusion_cali (int tray_index, int nozzle_temp, int bed_temp, float max_volumetric_speed, std::string setting_id="")
int command_stop_extrusion_cali ()
int command_extrusion_cali_set (int tray_index, std::string setting_id, std::string name, float k, float n, int bed_temp=-1, int nozzle_temp=-1, float max_volumetric_speed=-1)
int command_set_printing_speed (DevPrintingSpeedLevel lvl)
int command_set_prompt_sound (bool prompt_sound)
int command_set_filament_tangle_detect (bool fliament_tangle_detect)
int command_set_printing_option (bool auto_recovery)
int command_nozzle_blob_detect (bool nozzle_blob_detect)
int command_axis_control (std::string axis, double unit=1.0f, double input_val=1.0f, int speed=3000)
int command_extruder_control (int nozzle_id, double val)
bool is_support_command_calibration ()
int command_start_calibration (bool vibration, bool bed_leveling, bool xcam_cali, bool motor_noise, bool nozzle_cali, bool bed_cali, bool clumppos_cali)
int command_start_pa_calibration (const X1CCalibInfos &pa_data, int mode=0)
int command_set_pa_calibration (const std::vector< PACalibResult > &pa_calib_values, bool is_auto_cali)
int command_delete_pa_calibration (const PACalibIndexInfo &pa_calib)
int command_get_pa_calibration_tab (const PACalibExtruderInfo &calib_info)
int command_get_pa_calibration_result (float nozzle_diameter)
int commnad_select_pa_calibration (const PACalibIndexInfo &pa_calib_info)
int command_start_flow_ratio_calibration (const X1CCalibInfos &calib_data)
int command_get_flow_ratio_calibration_result (float nozzle_diameter)
int command_ipcam_record (bool on_off)
int command_ipcam_timelapse (bool on_off)
int command_ipcam_resolution_set (std::string resolution)
int command_ipcam_check_timelapse_storage (const std::string &storage, int total_layer)
int command_ipcam_delete_oldest_timelapse (const std::string &storage, int total_layer)
int command_xcam_control (std::string module_name, bool on_off, std::string lvl="")
int command_xcam_control_ai_monitoring (bool on_off, std::string lvl)
int command_xcam_control_spaghetti_detection (bool on_off, std::string lvl)
int command_xcam_control_purgechutepileup_detection (bool on_off, std::string lvl)
int command_xcam_control_nozzleclumping_detection (bool on_off, std::string lvl)
int command_xcam_control_airprinting_detection (bool on_off, std::string lvl)
int command_xcam_control_first_layer_inspector (bool on_off, bool print_halt)
int command_xcam_control_buildplate_marker_detector (bool on_off)
int command_xcam_control_auto_recovery_step_loss (bool on_off)
int command_xcam_control_allow_prompt_sound (bool on_off)
int command_xcam_control_filament_tangle_detect (bool on_off)
bool is_local ()
void set_bind_status (std::string status)
std::string get_bind_str ()
bool can_print ()
bool can_resume ()
bool can_pause ()
bool can_abort ()
bool is_in_printing ()
bool is_in_printing_pause () const
bool is_in_prepare ()
bool is_printing_finished ()
bool is_core_xy ()
void reset_update_time ()
void reset ()
void set_print_state (std::string status)
void update_print_progress (const nlohmann::json &value)
bool is_connected ()
bool is_connecting ()
void set_online_state (bool on_off)
bool is_online ()
bool is_info_ready (bool check_version=true) const
bool is_security_control_ready () const
bool is_camera_busy_off ()
std::vector< std::string > get_resolution_supported ()
std::vector< std::string > get_compatible_machine ()
int publish_json (const nlohmann::json &json_item, int qos=0, int flag=0)
int publish_json (const std::string &json_str, int qos=0, int flag=0)=delete
int cloud_publish_json (std::string json_str, int qos=0, int flag=0)
int local_publish_json (std::string json_str, int qos=0, int flag=0)
int parse_json (std::string tunnel, std::string payload, bool key_filed_only=false)
int publish_gcode (std::string gcode_str)
void update_device_cert_state (bool ready)
BBLSubTask * get_subtask ()
BBLModelTask * get_modeltask ()
void set_modeltask (BBLModelTask *task)
void update_model_task ()
void free_slice_info ()
void update_slice_info (std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx)
void get_firmware_info ()
bool is_firmware_info_valid ()
int get_max_filament_color_count () const
DevAmsTray parse_vt_tray (nlohmann::json vtray)
bool contains_tray (const std::string &ams_id, const std::string &tray_id) const
DevAmsTray get_tray (const std::string &ams_id, const std::string &tray_id) const
bool check_enable_np (const nlohmann::json &print) const
void parse_new_info (nlohmann::json print)
void parse_new_info2 (const nlohmann::json &info)
int get_flag_bits (std::string str, int start, int count=1) const
uint32_t get_flag_bits_no_border (std::string str, int start_idx, int count=1) const
int get_flag_bits (int num, int start, int count=1, int base=10) const
void update_filament_list ()
void update_printer_preset_name ()
void check_ams_filament_valid ()
bool support_door_open_check () const
DoorOpenCheckState get_door_open_check_state () const
void command_set_door_open_check (DoorOpenCheckState state)
bool get_save_remote_print_file_to_storage () const
void command_set_save_remote_print_file_to_storage (bool save)

Static Public Member Functions

static std::string dev_id_from_address (const std::string &host, const std::string &port="")
static bool is_series_n (const std::string &series_str)
static bool is_series_p (const std::string &series_str)
static bool is_series_x (const std::string &series_str)
static bool is_series_o (const std::string &series_str)
static std::string get_error_code_str (int error_code)
static bool is_in_printing_status (std::string status)
static std::string setting_id_to_type (std::string setting_id, std::string tray_type)

Public Attributes

bool local_use_ssl { true }
bool local_use_ssl_for_ftp { true }
int subscribe_counter {3}
std::string dev_connection_type
std::chrono::system_clock::time_point last_cloud_msg_time_
std::chrono::system_clock::time_point last_lan_msg_time_
std::string dev_connection_name
std::string printer_type
std::string printer_agent_id
std::string dev_product_name
std::string bind_user_name
std::string bind_user_id
std::string bind_sec_link
std::string bind_ssdp_version
std::string bind_state
time_t last_alive
bool m_is_online
bool m_lan_mode_connection_state {false}
bool m_set_ctt_dlg { false }
bool m_unsupported_dlg_shown { false }
int parse_msg_count = 0
int keep_alive_count = 0
std::chrono::system_clock::time_point last_update_time
std::chrono::system_clock::time_point last_utc_time
std::chrono::system_clock::time_point last_keep_alive
std::chrono::system_clock::time_point last_push_time
std::chrono::system_clock::time_point last_request_push
std::chrono::system_clock::time_point last_request_start
bool device_cert_installed = false
int m_active_state = 0
bool is_tunnel_mqtt = false
long ams_exist_bits = 0
long tray_exist_bits = 0
long tray_is_bbl_bits = 0
long tray_read_done_bits = 0
long tray_reading_bits = 0
bool ams_air_print_status { false }
bool ams_support_virtual_tray { true }
time_t ams_user_setting_start = 0
time_t ams_switch_filament_start = 0
AmsStatusMain ams_status_main = AmsStatusMain::AMS_STATUS_MAIN_IDLE
int ams_status_sub
int ams_version = 0
int extrusion_cali_hold_count = 0
std::chrono::system_clock::time_point last_extrusion_cali_start_time
int extrusion_cali_set_tray_id = -1
std::chrono::system_clock::time_point extrusion_cali_set_hold_start
std::string extrusion_cali_filament_name
bool has_extra_flow_type {false}
bool online_rfid
bool online_ahb
int online_version = -1
int last_online_version = -1
float chamber_temp
float chamber_temp_target
float frame_temp
std::string wifi_signal
std::string link_th
std::string link_ams
bool network_wired { false }
bool upgrade_force_upgrade { false }
bool upgrade_new_version { false }
bool upgrade_consistency_request { false }
DevFirmwareUpgradingState upgrade_display_state
int upgrade_display_hold_count = 0
PrinterFirmwareType firmware_type
PrinterFirmwareType lifecycle { PrinterFirmwareType::FIRMWARE_TYPE_PRODUCTION }
std::string upgrade_progress
std::string upgrade_message
std::string upgrade_status
std::string upgrade_module
std::string ams_new_version_number
std::string ota_new_version_number
std::string ahb_new_version_number
int get_version_retry = 0
DevFirmwareVersionInfo air_pump_version_info
DevFirmwareVersionInfo laser_version_info
DevFirmwareVersionInfo cutting_module_version_info
DevFirmwareVersionInfo extinguish_version_info
DevFirmwareVersionInfo rotary_version_info
DevFirmwareVersionInfo exhaustfan_version_info
DevFirmwareVersionInfo amshub_version_info
DevFirmwareVersionInfo filatrack_version_info
std::map< std::string, DevFirmwareVersionInfo > module_vers
std::map< std::string, DevFirmwareVersionInfo > new_ver_list
bool m_new_ver_list_exist = false
int upgrade_err_code = 0
std::vector< FirmwareInfo > firmware_list
std::string print_type
bool is_220V_voltage { false }
int mc_print_stage
int mc_print_sub_stage
int mc_print_error_code
int mc_print_line_number
int mc_print_percent
int mc_left_time
int last_mc_print_stage
int m_home_flag = 0
int hw_switch_state
int print_error
std::string m_print_error_img_id
std::unordered_set< GUI::DeviceErrorDialog * > m_command_error_code_dlgs
int curr_layer = 0
int total_layers = 0
bool is_support_layer_num { false }
bool nozzle_blob_detection_enabled { false }
time_t nozzle_blob_detection_hold_start = 0
bool is_support_new_auto_cali_method {false}
int last_cali_version = -1
int cali_version = -1
float cali_selected_nozzle_dia { 0.0 }
std::vector< CaliPresetInfo > selected_cali_preset
float cache_flow_ratio { 0.0 }
bool cali_finished = true
FlowRatioCalibrationType flow_ratio_calibration_type = FlowRatioCalibrationType::COMPLETE_CALIBRATION
ManualPaCaliMethod manual_pa_cali_method = ManualPaCaliMethod::PA_LINE
bool has_get_pa_calib_tab { false }
bool request_tab_from_bbs { false }
std::vector< PACalibResult > pa_calib_tab
bool get_pa_calib_result { false }
std::vector< PACalibResult > pa_calib_results
bool get_flow_calib_result { false }
std::vector< FlowRatioCalibResult > flow_ratio_results
std::vector< int > stage_list_info
int stage_curr = 0
int stage_remaining_seconds = 0
int m_push_count = 0
int m_full_msg_count = 0
bool calibration_done { false }
std::string print_status
int queue_number = 0
std::string iot_print_status
int printing_speed_mag = 100
bool has_ipcam { false }
bool camera_recording { false }
bool camera_recording_when_printing { false }
bool camera_timelapse { false }
time_t camera_recording_ctl_start = 0
int camera_timelapse_hold_count = 0
int camera_resolution_hold_count = 0
std::string camera_resolution = ""
std::vector< std::string > camera_resolution_supported
bool xcam_first_layer_inspector { false }
time_t xcam_first_layer_hold_start = 0
std::string local_rtsp_url
std::string webcam_stream_url
std::string tutk_state
LiveviewLocal liveview_local { LiveviewLocal::LVL_None }
LiveviewRemote liveview_remote { LiveviewRemote::LVR_None}
FileLocal file_local { FileLocal::FL_None }
FileRemote file_remote { FileRemote::FR_None }
bool file_model_download {false}
bool virtual_camera {false}
bool m_has_timelapse_kit {false}
bool xcam_ai_monitoring { false }
bool xcam_disable_ai_detection_display {false}
bool xcam_spaghetti_detection {false}
bool xcam_purgechutepileup_detection {false}
bool xcam_nozzleclumping_detection {false}
bool xcam_airprinting_detection {false}
time_t xcam_ai_monitoring_hold_start = 0
std::string xcam_ai_monitoring_sensitivity
std::string xcam_spaghetti_detection_sensitivity
std::string xcam_purgechutepileup_detection_sensitivity
std::string xcam_nozzleclumping_detection_sensitivity
std::string xcam_airprinting_detection_sensitivity
bool xcam_buildplate_marker_detector { false }
time_t xcam_buildplate_marker_hold_start = 0
bool xcam_auto_recovery_step_loss { false }
bool xcam_allow_prompt_sound { false }
bool xcam_filament_tangle_detect { false }
time_t xcam_auto_recovery_hold_start = 0
time_t xcam_prompt_sound_hold_start = 0
time_t xcam_filament_tangle_detect_hold_start = 0
std::vector< int > m_partskip_ids
int targ_nozzle_id_from_pc = INVALID_EXTRUDER_ID
bool is_support_build_plate_marker_detect {false}
PlateMakerDectect m_plate_maker_detect_type { POS_CHECK }
bool is_support_pa_calibration {false}
bool is_support_flow_calibration {false}
bool is_support_send_to_sdcard {false}
bool is_support_filament_backup {false}
bool is_support_timelapse {false}
bool is_support_update_remain {false}
int is_support_bed_leveling = 0
bool is_support_auto_recovery_step_loss {false}
bool is_support_ams_humidity {false}
bool is_support_prompt_sound {false}
bool is_support_filament_tangle_detect {false}
bool is_support_1080dpi {false}
bool is_support_cloud_print_only {false}
bool is_support_command_ams_switch {false}
bool is_support_mqtt_alive {false}
bool is_support_tunnel_mqtt {false}
bool is_support_motor_noise_cali {false}
bool is_support_wait_sending_finish {false}
bool is_support_user_preset {false}
bool is_support_nozzle_blob_detection {false}
bool is_support_air_print_detection {false}
bool is_support_agora {false}
bool is_support_upgrade_kit {false}
bool is_support_filament_setting_inprinting {false}
bool is_support_internal_timelapse { false }
bool m_support_mqtt_homing { false }
bool is_support_brtc {false}
bool is_support_ext_change_assist {false}
bool is_support_partskip {false}
bool is_support_refresh_nozzle {false}
bool is_support_spaghetti_detection {false}
bool is_support_purgechutepileup_detection {false}
bool is_support_nozzleclumping_detection {false}
bool is_support_airprinting_detection {false}
bool is_support_idelheadingprotect_detection {false}
std::atomic< bool > timelapse_storage_check_done { false }
int timelapse_storage_check_result { -1 }
bool timelapse_storage_is_enough { true }
int timelapse_storage_file_count { 0 }
bool is_support_print_with_emmc {false}
bool is_support_remote_dry = false
bool is_support_check_track_switch_match_slice_printer {false}
bool is_support_pa_mode {false}
bool is_support_filament_manual_multi_color {false}
std::optional< bool > m_firmware_support_print_tpu_left
bool installed_upgrade_kit {false}
int bed_temperature_limit = -1
std::vector< int > nozzle_temp_range
std::vector< int > bed_temp_range
json_diff print_json
std::string project_id_
std::string profile_id_
std::string task_id_
std::string subtask_id_
std::string job_id_
std::string last_subtask_id_
std::string m_agent_thumbnail_url
BBLSliceInfo * slice_info {nullptr}
boost::thread * get_slice_info_thread { nullptr }
boost::thread * get_model_task_thread { nullptr }
std::vector< uint16_t > print_job_filament_mapping
int jobState_ = 0
DeviceMode m_device_mode { DEVICE_MODE_FDM }
int m_plate_index { -1 }
std::string m_gcode_file
int gcode_file_prepare_percent = 0
BBLSubTask * subtask_
BBLModelTask * model_task { nullptr }
DevPrintTaskRatingInfo * rating_info { nullptr }
int request_model_result = 0
bool get_model_mall_result_need_retry = false
std::string obj_subtask_id
std::string subtask_name
bool m_support_mqtt_bet_ctrl = false
bool m_support_mqtt_axis_control = false
bool m_firmware_valid { false }
bool m_firmware_thread_started { false }
bool is_enable_np { false }
bool is_enable_ams_np { false }
bool is_support_filament_32_colors { false }
bool is_support_fila_change_abort { false }
bool is_support_ext_change_assist_old { false }
std::vector< DevAmsTray > vt_slot
std::map< std::string, FilamentData > m_nozzle_filament_data

Static Public Attributes

static int m_sequence_id = START_SEQ_ID

Private Member Functions

int command_with_dialog (int cmd_result)

Private Attributes

NetworkAgent * m_agent {nullptr}
DeviceManager * m_manager { nullptr }
std::shared_ptr< int > m_token = std::make_shared<int>(1)
std::string dev_id
std::string dev_name
std::string dev_ip
std::string access_code
bool m_access_revoked = false
std::vector< std::tuple< std::string, uint64_t, uint64_t > > message_delay
DevLamp * m_lamp
std::shared_ptr< DevExtensionTool > m_extension_tool
DevExtderSystem * m_extder_system
DevNozzleSystem * m_nozzle_system
std::shared_ptr< DevFilaSystem > m_fila_system
DevFilaSwitch * m_fila_switch
DevFan * m_fan
DevBed * m_bed
DevStorage * m_storage
std::shared_ptr< DevAxis > m_axis
std::shared_ptr< DevChamber > m_chamber
DevCalib * m_calib { nullptr }
DevStatus * m_status { nullptr }
std::shared_ptr< DevUpgrade > m_upgrade
DevCtrl * m_ctrl
DevPrintOptions * m_print_options
DevHMS * m_hms_system
DevConfig * m_config
std::shared_ptr< DevNozzleMappingCtrl > m_nozzle_mapping_ptr
bool is_support_door_open_check = false
DoorOpenCheckState xcam_door_open_check = DoorOpenCheckState::DOOR_OPEN_CHECK_DISABLE
time_t xcam_door_open_check_start_time = 0
bool xcam__save_remote_print_file_to_storage = false
time_t xcam__save_remote_print_file_to_storage_start_time = 0

Detailed Description


Class Documentation

◆ Slic3r::MachineObject::FilamentData

struct Slic3r::MachineObject::FilamentData
Collaboration diagram for Slic3r::MachineObject::FilamentData:
Class Members
set< string > checked_filament
map< string, pair< vector< int >, vector< int > > > filament_list
string printer_preset_name

Member Typedef Documentation

◆ MsgFn

typedef std::function<void(std::string topic, std::string payload)> Slic3r::MachineObject::MsgFn

Member Enumeration Documentation

◆ ActiveState

Enumerator
NotActive 
Active 
UpdateToDate 
183 {
184 NotActive,
185 Active,
187 };
@ NotActive
Definition DeviceManager.hpp:184
@ Active
Definition DeviceManager.hpp:185
@ UpdateToDate
Definition DeviceManager.hpp:186

◆ DeviceMode

enum Slic3r::MachineObject::DeviceMode : unsigned int
Enumerator
DEVICE_MODE_FDM 
DEVICE_MODE_LASER 
DEVICE_MODE_CUT 
581 {
582 DEVICE_MODE_FDM = 0x00000001,
583 DEVICE_MODE_LASER = 0x00000010,
584 DEVICE_MODE_CUT = 0x00000100,
585 };
@ DEVICE_MODE_FDM
Definition DeviceManager.hpp:582
@ DEVICE_MODE_LASER
Definition DeviceManager.hpp:583
@ DEVICE_MODE_CUT
Definition DeviceManager.hpp:584

◆ DoorOpenCheckState

Enumerator
DOOR_OPEN_CHECK_DISABLE 
DOOR_OPEN_CHECK_ENABLE_WARNING 
DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT 
574 {
575 DOOR_OPEN_CHECK_DISABLE = 0,/*do nothing*/
576 DOOR_OPEN_CHECK_ENABLE_WARNING = 1,/*warning*/
577 DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT = 2,/*pause print*/
578 };
@ DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT
Definition DeviceManager.hpp:577
@ DOOR_OPEN_CHECK_DISABLE
Definition DeviceManager.hpp:575
@ DOOR_OPEN_CHECK_ENABLE_WARNING
Definition DeviceManager.hpp:576

◆ PlateMakerDectect

Enumerator
POS_CHECK 
TYPE_POS_CHECK 
568 {
569 POS_CHECK = 1,
570 TYPE_POS_CHECK = 2,
571 };
@ TYPE_POS_CHECK
Definition DeviceManager.hpp:570
@ POS_CHECK
Definition DeviceManager.hpp:569

◆ PrintOption

Enumerator
PRINT_OP_AUTO_RECOVERY 
PRINT_OP_MAX 
189 {
192 };
@ PRINT_OP_MAX
Definition DeviceManager.hpp:191
@ PRINT_OP_AUTO_RECOVERY
Definition DeviceManager.hpp:190

Constructor & Destructor Documentation

◆ MachineObject()

Slic3r::MachineObject::MachineObject ( DeviceManager * manager,
NetworkAgent * agent,
std::string name,
std::string id,
std::string ip )
636 :dev_name(name),
637 dev_id(id),
638 dev_ip(ip),
639 subtask_(nullptr),
640 model_task(nullptr),
641 slice_info(nullptr),
642 m_is_online(false)
643{
644 m_manager = manager;
645 m_agent = agent;
646
647 reset();
648
649 /* temprature fields */
650
651 chamber_temp = 0.0f;
652 chamber_temp_target = 0.0f;
653 frame_temp = 0.0f;
654
655 /* ams fileds */
656 ams_exist_bits = 0;
657 tray_exist_bits = 0;
659
660 /* signals */
661 wifi_signal = "";
662
663 /* upgrade */
664 upgrade_force_upgrade = false;
665 upgrade_new_version = false;
667
668
669 /* printing */
670 mc_print_stage = 0;
672 print_error = 0;
676 mc_left_time = 0;
677 hw_switch_state = 0;
679
680 has_ipcam = true; // default true
681
682
683 auto vslot = DevAmsTray(std::to_string(VIRTUAL_TRAY_MAIN_ID));
684 vt_slot.push_back(vslot);
685
686 {
687 m_lamp = new DevLamp(this);
688 m_fan = new DevFan(this);
689 m_bed = new DevBed(this);
690 m_storage = new DevStorage(this);
691 m_extder_system = new DevExtderSystem(this);
693 m_nozzle_system = new DevNozzleSystem(this);
694 m_fila_system = std::make_shared<DevFilaSystem>(this);
695 m_fila_switch = new DevFilaSwitch(this);
696 m_hms_system = new DevHMS(this);
697 m_config = new DevConfig(this);
698
699 m_ctrl = new DevCtrl(this);
700 m_print_options = new DevPrintOptions(this);
701
702 m_nozzle_mapping_ptr = std::make_shared<DevNozzleMappingCtrl>(this);
703
704 // Orca: adopt DeviceCore split — axis/calib/chamber/status/upgrade modules
705 m_axis = DevAxis::Create(this);
708 m_status = new DevStatus(this);
709 m_calib = new DevCalib(this);
710 }
711}
#define VIRTUAL_TRAY_MAIN_ID
Definition DevDefs.h:89
static std::shared_ptr< DevAxis > Create(MachineObject *obj)
Definition DevAxis.h:13
static std::shared_ptr< DevChamber > Create(MachineObject *obj)
Definition DevChamber.h:12
static std::shared_ptr< DevExtensionTool > Create(MachineObject *obj)
Definition DevExtensionTool.h:22
static std::shared_ptr< DevUpgrade > Create(MachineObject *owner)
Definition DevUpgrade.h:17
int mc_print_line_number
Definition DeviceManager.hpp:457
BBLModelTask * model_task
Definition DeviceManager.hpp:730
bool has_ipcam
Definition DeviceManager.hpp:548
std::string dev_ip
Definition DeviceManager.hpp:120
std::string dev_name
Definition DeviceManager.hpp:119
bool upgrade_new_version
Definition DeviceManager.hpp:406
DevBed * m_bed
Definition DeviceManager.hpp:135
DevNozzleSystem * m_nozzle_system
Definition DeviceManager.hpp:131
std::shared_ptr< DevExtensionTool > m_extension_tool
Definition DeviceManager.hpp:129
long tray_exist_bits
Definition DeviceManager.hpp:308
int mc_left_time
Definition DeviceManager.hpp:459
DevCtrl * m_ctrl
Definition DeviceManager.hpp:148
int mc_print_percent
Definition DeviceManager.hpp:458
std::shared_ptr< DevUpgrade > m_upgrade
Definition DeviceManager.hpp:145
std::string wifi_signal
Definition DeviceManager.hpp:373
float chamber_temp
Definition DeviceManager.hpp:368
DevLamp * m_lamp
Definition DeviceManager.hpp:128
DeviceManager * m_manager
Definition DeviceManager.hpp:114
void reset()
Definition DeviceManager.cpp:2605
int mc_print_sub_stage
Definition DeviceManager.hpp:455
bool upgrade_consistency_request
Definition DeviceManager.hpp:407
long tray_is_bbl_bits
Definition DeviceManager.hpp:309
std::string m_print_error_img_id
Definition DeviceManager.hpp:466
DevPrintOptions * m_print_options
Definition DeviceManager.hpp:151
BBLSubTask * subtask_
Definition DeviceManager.hpp:729
int hw_switch_state
Definition DeviceManager.hpp:462
std::vector< DevAmsTray > vt_slot
Definition DeviceManager.hpp:951
std::shared_ptr< DevChamber > m_chamber
Definition DeviceManager.hpp:142
int mc_print_error_code
Definition DeviceManager.hpp:456
NetworkAgent * m_agent
Definition DeviceManager.hpp:113
std::string dev_id
Definition DeviceManager.hpp:118
float chamber_temp_target
Definition DeviceManager.hpp:369
DevConfig * m_config
Definition DeviceManager.hpp:157
DevStatus * m_status
Definition DeviceManager.hpp:144
bool m_is_online
Definition DeviceManager.hpp:284
DevFilaSwitch * m_fila_switch
Definition DeviceManager.hpp:133
float frame_temp
Definition DeviceManager.hpp:370
bool upgrade_force_upgrade
Definition DeviceManager.hpp:405
DevStorage * m_storage
Definition DeviceManager.hpp:136
DevHMS * m_hms_system
Definition DeviceManager.hpp:154
int mc_print_stage
Definition DeviceManager.hpp:454
DevFan * m_fan
Definition DeviceManager.hpp:134
DevExtderSystem * m_extder_system
Definition DeviceManager.hpp:130
BBLSliceInfo * slice_info
Definition DeviceManager.hpp:706
DevCalib * m_calib
Definition DeviceManager.hpp:143
std::shared_ptr< DevFilaSystem > m_fila_system
Definition DeviceManager.hpp:132
long ams_exist_bits
Definition DeviceManager.hpp:307
std::shared_ptr< DevNozzleMappingCtrl > m_nozzle_mapping_ptr
Definition DeviceManager.hpp:162
std::shared_ptr< DevAxis > m_axis
Definition DeviceManager.hpp:141
int print_error
Definition DeviceManager.hpp:465

References ams_exist_bits, chamber_temp, chamber_temp_target, Slic3r::DevAxis::Create(), Slic3r::DevChamber::Create(), Slic3r::DevExtensionTool::Create(), Slic3r::DevUpgrade::Create(), dev_id, dev_ip, dev_name, frame_temp, has_ipcam, hw_switch_state, m_agent, m_axis, m_bed, m_calib, m_chamber, m_config, m_ctrl, m_extder_system, m_extension_tool, m_fan, m_fila_switch, m_fila_system, m_hms_system, m_is_online, m_lamp, m_manager, m_nozzle_mapping_ptr, m_nozzle_system, m_print_error_img_id, m_print_options, m_status, m_storage, m_upgrade, mc_left_time, mc_print_error_code, mc_print_line_number, mc_print_percent, mc_print_stage, mc_print_sub_stage, model_task, print_error, reset(), slice_info, subtask_, tray_exist_bits, tray_is_bbl_bits, upgrade_consistency_request, upgrade_force_upgrade, upgrade_new_version, VIRTUAL_TRAY_MAIN_ID, vt_slot, and wifi_signal.

Here is the call graph for this function:

◆ ~MachineObject()

Slic3r::MachineObject::~MachineObject ( )
714{
715 if (subtask_) {
716 delete subtask_;
717 subtask_ = nullptr;
718 }
719
720 if (model_task) {
721 delete model_task;
722 model_task = nullptr;
723 }
724
726
727 while (!m_command_error_code_dlgs.empty()) {
728 delete *m_command_error_code_dlgs.begin();/*element will auto remove from m_command_error_code_dlgs on deleted*/
729 }
730
731 {
732 delete m_lamp;
733 m_lamp = nullptr;
734
735 delete m_fan;
736 m_fan = nullptr;
737
738 delete m_bed;
739 m_bed = nullptr;
740
741 delete m_extder_system;
742 m_extder_system = nullptr;
743
744 delete m_nozzle_system;
745 m_nozzle_system = nullptr;
746
747 delete m_ctrl;
748 m_ctrl = nullptr;
749
750
751 delete m_fila_switch;
752 m_fila_switch = nullptr;
753
754 delete m_hms_system;
755 m_hms_system = nullptr;
756
757 delete m_config;
758 m_config = nullptr;
759
760 delete m_print_options;
761 m_print_options = nullptr;
762
763 // Orca: adopt DeviceCore split
764 delete m_calib;
765 m_calib = nullptr;
766
767 delete m_status;
768 m_status = nullptr;
769 }
770}
std::unordered_set< GUI::DeviceErrorDialog * > m_command_error_code_dlgs
Definition DeviceManager.hpp:470
void free_slice_info()
Definition DeviceManager.cpp:4938

References free_slice_info(), m_bed, m_calib, m_command_error_code_dlgs, m_config, m_ctrl, m_extder_system, m_fan, m_fila_switch, m_hms_system, m_lamp, m_nozzle_system, m_print_options, m_status, model_task, and subtask_.

Here is the call graph for this function:

Member Function Documentation

◆ _parse_ams_status()

void Slic3r::MachineObject::_parse_ams_status ( int ams_status)
866{
867 ams_status_sub = ams_status & 0xFF;
868 int ams_status_main_int = (ams_status & 0xFF00) >> 8;
869 if (ams_status_main_int == (int)AmsStatusMain::AMS_STATUS_MAIN_IDLE) {
871 } else if (ams_status_main_int == (int) AmsStatusMain::AMS_STATUS_MAIN_FILAMENT_CHANGE) {
873 } else if (ams_status_main_int == (int) AmsStatusMain::AMS_STATUS_MAIN_RFID_IDENTIFYING) {
875 } else if (ams_status_main_int == (int) AmsStatusMain::AMS_STATUS_MAIN_ASSIST) {
877 } else if (ams_status_main_int == (int) AmsStatusMain::AMS_STATUS_MAIN_CALIBRATION) {
879 } else if (ams_status_main_int == (int) AmsStatusMain::AMS_STATUS_MAIN_SELF_CHECK) {
881 } else if (ams_status_main_int == (int) AmsStatusMain::AMS_STATUS_MAIN_DEBUG) {
883 } else if (ams_status_main_int == (int) AmsStatusMain::AMS_STATUS_MAIN_COLD_PULL) {
885 } else {
887 }
888
889 BOOST_LOG_TRIVIAL(trace) << "ams_debug: main = " << ams_status_main_int << ", sub = " << ams_status_sub;
890}
AmsStatusMain ams_status_main
Definition DeviceManager.hpp:318
int ams_status_sub
Definition DeviceManager.hpp:319
void trace(unsigned int level, const char *message)
Definition utils.cpp:247
@ AMS_STATUS_MAIN_SELF_CHECK
Definition DevDefs.h:52
@ AMS_STATUS_MAIN_IDLE
Definition DevDefs.h:46
@ AMS_STATUS_MAIN_FILAMENT_CHANGE
Definition DevDefs.h:47
@ AMS_STATUS_MAIN_DEBUG
Definition DevDefs.h:53
@ AMS_STATUS_MAIN_COLD_PULL
Definition DevDefs.h:51
@ AMS_STATUS_MAIN_RFID_IDENTIFYING
Definition DevDefs.h:48
@ AMS_STATUS_MAIN_CALIBRATION
Definition DevDefs.h:50
@ AMS_STATUS_MAIN_UNKNOWN
Definition DevDefs.h:54
@ AMS_STATUS_MAIN_ASSIST
Definition DevDefs.h:49

References ams_status_main, Slic3r::AMS_STATUS_MAIN_ASSIST, Slic3r::AMS_STATUS_MAIN_CALIBRATION, Slic3r::AMS_STATUS_MAIN_COLD_PULL, Slic3r::AMS_STATUS_MAIN_DEBUG, Slic3r::AMS_STATUS_MAIN_FILAMENT_CHANGE, Slic3r::AMS_STATUS_MAIN_IDLE, Slic3r::AMS_STATUS_MAIN_RFID_IDENTIFYING, Slic3r::AMS_STATUS_MAIN_SELF_CHECK, Slic3r::AMS_STATUS_MAIN_UNKNOWN, ams_status_sub, and Slic3r::trace().

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_command_error_code_dlg()

void Slic3r::MachineObject::add_command_error_code_dlg ( int command_err,
nlohmann::json action_json = nlohmann::json{} )
6090{
6091 if (command_err > 0 && !Slic3r::GUI::wxGetApp().get_hms_query()->is_internal_error(this, command_err))
6092 {
6093 GUI::wxGetApp().CallAfter([this, command_err, action_json, token = std::weak_ptr<int>(m_token)]
6094 {
6095 if (token.expired()) { return;}
6096 GUI::DeviceErrorDialog* device_error_dialog = new GUI::DeviceErrorDialog(this, (wxWindow*)GUI::wxGetApp().mainframe);
6097 device_error_dialog->Bind(wxEVT_DESTROY, [this, token = std::weak_ptr<int>(m_token)](auto& event)
6098 {
6099 if (!token.expired()) { m_command_error_code_dlgs.erase((GUI::DeviceErrorDialog*)event.GetEventObject());}
6100 event.Skip();
6101 });
6102
6103 if(!action_json.is_null()) device_error_dialog->set_action_json(action_json);
6104 device_error_dialog->show_error_code(command_err);
6105 m_command_error_code_dlgs.insert(device_error_dialog);
6106 });
6107 };
6108}
std::shared_ptr< int > m_token
Definition DeviceManager.hpp:115
nlohmann::json action_json(const AppAction &a)
Definition ActionRegistry.cpp:443

References m_command_error_code_dlgs, m_token, Slic3r::GUI::DeviceErrorDialog::set_action_json(), and Slic3r::GUI::DeviceErrorDialog::show_error_code().

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ any_loaded_filament_is_stringing_prone()

bool Slic3r::MachineObject::any_loaded_filament_is_stringing_prone ( ) const
839{
840 if (print_job_filament_mapping.empty()) return false;
841
842 std::vector<float> nozzle_diameters;
843 if (m_extder_system) {
844 for (const auto& ext : m_extder_system->GetExtruders()) {
845 const float d = ext.GetNozzleDiameter();
846 if (d > 0.f) nozzle_diameters.push_back(d);
847 }
848 }
849 if (nozzle_diameters.empty()) return false;
850
851 for (uint16_t v : print_job_filament_mapping) {
852 if (v == 0xFFFF) continue;
853 const int ams_id = (v >> 8) & 0xFF;
854 const int slot_id = v & 0xFF;
855 const std::string fid = this->get_filament_id(std::to_string(ams_id), std::to_string(slot_id));
856 if (fid.empty()) continue;
857 for (float d : nozzle_diameters) {
859 return true;
860 }
861 }
862 return false;
863}
std::vector< uint16_t > print_job_filament_mapping
Definition DeviceManager.hpp:712
std::string get_filament_id(std::string ams_id, std::string tray_id) const
Definition DeviceManager.cpp:826
bool is_stringing_prone_filament(const std::string &filament_id, float nozzle_diameter)
Definition DeviceManager.cpp:168

References get_filament_id(), Slic3r::is_stringing_prone_filament(), m_extder_system, and print_job_filament_mapping.

Here is the call graph for this function:

◆ can_abort()

bool Slic3r::MachineObject::can_abort ( )
2545{
2547}
std::string print_status
Definition DeviceManager.hpp:540
static bool is_in_printing_status(std::string status)
Definition DeviceManager.cpp:2549

References is_in_printing_status(), and print_status.

Referenced by is_sdcard_printing(), and Slic3r::GUI::MachineInfoPanel::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ can_pause()

bool Slic3r::MachineObject::can_pause ( )
2538{
2539 if (print_status.compare("RUNNING") == 0)
2540 return true;
2541 return false;
2542}

References print_status.

◆ can_print()

bool Slic3r::MachineObject::can_print ( )
2520{
2521 if (print_status.compare("RUNNING") == 0) {
2522 return false;
2523 }
2524 if (print_status.compare("IDLE") == 0 || print_status.compare("FINISH") == 0) {
2525 return true;
2526 }
2527 return true;
2528}

References print_status.

◆ can_resume()

bool Slic3r::MachineObject::can_resume ( )
2531{
2532 if (print_status.compare("PAUSE") == 0)
2533 return true;
2534 return false;
2535}

References print_status.

Referenced by Slic3r::GUI::CalibrationCaliPage::on_subtask_pause_resume(), and Slic3r::GUI::CalibrationCaliPage::update_subtask().

Here is the caller graph for this function:

◆ can_unload_filament()

bool Slic3r::MachineObject::can_unload_filament ( )
893{
894 bool result = false;
895 if (!HasAms())
896 return true;
897
898 if (ams_status_main == AMS_STATUS_MAIN_IDLE && hw_switch_state == 1 && m_extder_system->GetCurrentAmsId() == "255") {
899 return true;
900 }
901 return result;
902}
bool HasAms() const
Definition DeviceManager.cpp:6140

References ams_status_main, Slic3r::AMS_STATUS_MAIN_IDLE, HasAms(), hw_switch_state, and m_extder_system.

Here is the call graph for this function:

◆ can_use_emmc_print()

bool Slic3r::MachineObject::can_use_emmc_print ( ) const
621{
622 AppConfig* config = GUI::wxGetApp().app_config;
623 std::string disable_emmc_print = config ? config->get("disable_emmc_print") : "true";
624 return is_support_print_with_emmc && (disable_emmc_print == "0" || disable_emmc_print == "false");
625}
bool is_support_print_with_emmc
Definition DeviceManager.hpp:673

References Slic3r::AppConfig::get(), and is_support_print_with_emmc.

Referenced by Slic3r::GUI::SelectMachineDialog::on_send_print(), Slic3r::GUI::CalibUtils::send_to_print(), Slic3r::GUI::CalibUtils::send_to_print(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canEnableTimelapse()

bool Slic3r::MachineObject::canEnableTimelapse ( wxString & error_message) const
1374{
1375 if (!is_support_timelapse) {
1376 error_message = _L("Timelapse is not supported on this printer.");
1377 return false;
1378 }
1379
1381 {
1382 return true;
1383 }
1384
1386 if (m_storage->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD) {
1387 error_message = _L("Timelapse is not supported while the storage does not exist.");
1388 } else if (m_storage->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_ABNORMAL) {
1389 error_message = _L("Timelapse is not supported while the storage is unavailable.");
1390 } else if (m_storage->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_READONLY) {
1391 error_message = _L("Timelapse is not supported while the storage is readonly.");
1392 }
1393
1394 return false;
1395 }
1396
1397 return true;
1398}
#define _L(s)
Definition OBJ.cpp:34
@ HAS_SDCARD_NORMAL
Definition DevStorage.h:19
@ HAS_SDCARD_ABNORMAL
Definition DevStorage.h:20
@ HAS_SDCARD_READONLY
Definition DevStorage.h:21
@ NO_SDCARD
Definition DevStorage.h:18
bool is_support_internal_timelapse
Definition DeviceManager.hpp:652
bool is_support_timelapse
Definition DeviceManager.hpp:632
bool m_has_timelapse_kit
Definition DeviceManager.hpp:589

References _L, Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_NORMAL, Slic3r::DevStorage::HAS_SDCARD_READONLY, is_support_internal_timelapse, is_support_timelapse, m_has_timelapse_kit, m_storage, and Slic3r::DevStorage::NO_SDCARD.

Referenced by Slic3r::GUI::SelectMachineDialog::load_option_vals().

Here is the caller graph for this function:

◆ check_ams_filament_valid()

void Slic3r::MachineObject::check_ams_filament_valid ( )
5865{
5866 PresetBundle * preset_bundle = Slic3r::GUI::wxGetApp().preset_bundle;
5867 // A tray id carried by ANY system filament preset is not a dangling user-preset id
5868 // (ten shipped P-hex system ids pass the 'P' shape gates below), so the destructive
5869 // tray-wipe / temp-rewrite handling must never fire for it.
5870 auto is_system_filament_id = [preset_bundle](const std::string &id) {
5871 if (!preset_bundle)
5872 return false;
5873 for (auto it = preset_bundle->filaments.begin(); it != preset_bundle->filaments.end(); it++)
5874 if (it->is_system && it->filament_id == id)
5875 return true;
5876 return false;
5877 };
5879 std::map<std::string, std::set<std::string>> need_checked_filament_id;
5880 for (auto &ams_pair : m_fila_system->GetAmsList()) {
5881 auto ams_id = ams_pair.first;
5882 auto &ams = ams_pair.second;
5883 std::ostringstream stream;
5884 if (ams->GetExtruderId() < 0 || ams->GetExtruderId() >= m_extder_system->GetTotalExtderCount()) {
5885 return;
5886 }
5887 stream << std::fixed << std::setprecision(1) << m_extder_system->GetNozzleDiameter(ams->GetExtruderId());
5888 std::string nozzle_diameter_str = stream.str();
5889 assert(nozzle_diameter_str.size() == 3);
5890 if (m_nozzle_filament_data.find(nozzle_diameter_str) == m_nozzle_filament_data.end()) {
5891 //assert(false);
5892 continue;
5893 }
5894 auto &data = m_nozzle_filament_data[nozzle_diameter_str];
5895 auto &filament_list = data.filament_list;
5896 auto &checked_filament = data.checked_filament;
5897 for (const auto &[slot_id, curr_tray] : ams->GetTrays()) {
5898
5899 if (curr_tray->setting_id.size() == 8 && curr_tray->setting_id[0] == 'P' && is_system_filament_id(curr_tray->setting_id))
5900 continue;
5901 if (curr_tray->setting_id.size() == 8 && curr_tray->setting_id[0] == 'P' && filament_list.find(curr_tray->setting_id) == filament_list.end()) {
5902 if (checked_filament.find(curr_tray->setting_id) != checked_filament.end()) {
5903 need_checked_filament_id[nozzle_diameter_str].insert(curr_tray->setting_id);
5904 wxColour color = *wxWHITE;
5905 char col_buf[10];
5906 sprintf(col_buf, "%02X%02X%02XFF", (int) color.Red(), (int) color.Green(), (int) color.Blue());
5907 try {
5908 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << " ams settings_id is not exist in filament_list and reset, ams_id: " << ams_id << " tray_id"
5909 << slot_id << "filament_id: " << curr_tray->setting_id;
5910
5911 command_ams_filament_settings(std::stoi(ams_id), std::stoi(slot_id), "", "", std::string(col_buf), "", 0, 0);
5912 continue;
5913 } catch (...) {
5914 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << " stoi error and ams_id: " << ams_id << " tray_id" << slot_id;
5915 }
5916 }
5917 }
5918 if (curr_tray->setting_id.size() == 8 && curr_tray->setting_id[0] == 'P' && curr_tray->nozzle_temp_min != "" && curr_tray->nozzle_temp_max != "") {
5919 if (checked_filament.find(curr_tray->setting_id) != checked_filament.end()) {
5920 need_checked_filament_id[nozzle_diameter_str].insert(curr_tray->setting_id);
5921 try {
5922 std::string preset_setting_id;
5923 const int extruder_id = ams->GetExtruderId();
5924 bool is_equation = preset_bundle->check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(printer_model, nozzle_diameter_str,
5925 curr_tray->setting_id, curr_tray->tag_uid,
5926 curr_tray->nozzle_temp_min,
5927 curr_tray->nozzle_temp_max, preset_setting_id,
5928 get_preset_extruder_index(extruder_id),
5929 DevNozzle::ToNozzleVolumeType(m_extder_system->GetNozzleFlowType(extruder_id)));
5930 if (!is_equation) {
5931 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << " ams filament is not match min max temp and reset, ams_id: " << ams_id << " tray_id"
5932 << slot_id << "filament_id: " << curr_tray->setting_id;
5933
5934
5935 command_ams_filament_settings(std::stoi(ams_id), std::stoi(slot_id), curr_tray->setting_id, preset_setting_id, curr_tray->color, curr_tray->m_fila_type,
5936 std::stoi(curr_tray->nozzle_temp_min), std::stoi(curr_tray->nozzle_temp_max));
5937 }
5938 continue;
5939 } catch (...) {
5940 BOOST_LOG_TRIVIAL(info) << "check fail and curr_tray ams_id" << ams_id << " curr_tray tray_id" << slot_id;
5941 }
5942 }
5943 }
5944 }
5945 }
5946
5947 for (auto vt_tray : vt_slot) {
5948 int vt_id = std::stoi(vt_tray.id);
5949 int index = 255 - vt_id;
5950 if (index >= m_extder_system->GetTotalExtderCount()) {
5951 BOOST_LOG_TRIVIAL(error) << " vt_tray id map for nozzle id is not exist, index is: " << index << " nozzle count" << m_extder_system->GetTotalExtderCount();
5952 continue;
5953 }
5954 auto diameter = m_extder_system->GetNozzleDiameter(index);
5955 std::ostringstream stream;
5956 stream << std::fixed << std::setprecision(1) << diameter;
5957 std::string nozzle_diameter_str = stream.str();
5958 if (m_nozzle_filament_data.find(nozzle_diameter_str) == m_nozzle_filament_data.end()) {
5959 continue;
5960 }
5961 auto &data = m_nozzle_filament_data[nozzle_diameter_str];
5962 auto &checked_filament = data.checked_filament;
5963 auto &filament_list = data.filament_list;
5964 if (vt_tray.setting_id.size() == 8 && vt_tray.setting_id[0] == 'P' && is_system_filament_id(vt_tray.setting_id))
5965 continue;
5966 if (vt_tray.setting_id.size() == 8 && vt_tray.setting_id[0] == 'P' && filament_list.find(vt_tray.setting_id) == filament_list.end()) {
5967 if (checked_filament.find(vt_tray.setting_id) != checked_filament.end()) {
5968 need_checked_filament_id[nozzle_diameter_str].insert(vt_tray.setting_id);
5969 wxColour color = *wxWHITE;
5970 char col_buf[10];
5971 sprintf(col_buf, "%02X%02X%02XFF", (int) color.Red(), (int) color.Green(), (int) color.Blue());
5972 try {
5973 BOOST_LOG_TRIVIAL(info) << "vt_tray.setting_id is not exist in filament_list and reset vt_tray and the filament_id is: " << vt_tray.setting_id;
5974 command_ams_filament_settings(vt_id, 0, "", "", std::string(col_buf), "", 0, 0);
5975 continue;
5976 } catch (...) {
5977 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << " stoi error and tray_id" << vt_tray.id;
5978 }
5979 }
5980 }
5981 if (vt_tray.setting_id.size() == 8 && vt_tray.setting_id[0] == 'P' && vt_tray.nozzle_temp_min != "" && vt_tray.nozzle_temp_max != "") {
5982 if (checked_filament.find(vt_tray.setting_id) != checked_filament.end()) {
5983 need_checked_filament_id[nozzle_diameter_str].insert(vt_tray.setting_id);
5984 try {
5985 std::string preset_setting_id;
5986 PresetBundle * preset_bundle = Slic3r::GUI::wxGetApp().preset_bundle;
5987 std::ostringstream stream;
5988 stream << std::fixed << std::setprecision(1) << m_extder_system->GetNozzleDiameter(MAIN_EXTRUDER_ID);
5989 std::string nozzle_diameter_str = stream.str();
5990 bool is_equation = preset_bundle->check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(DevPrinterConfigUtil::get_printer_display_name(
5991 this->printer_type),
5992 nozzle_diameter_str, vt_tray.setting_id,
5993 vt_tray.tag_uid, vt_tray.nozzle_temp_min,
5994 vt_tray.nozzle_temp_max, preset_setting_id,
5996 DevNozzle::ToNozzleVolumeType(m_extder_system->GetNozzleFlowType(index)));
5997 if (!is_equation) {
5998 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__
5999 << " vt_tray filament is not match min max temp and reset, filament_id: " << vt_tray.setting_id;
6000 command_ams_filament_settings(vt_id, 0, vt_tray.setting_id, preset_setting_id, vt_tray.color, vt_tray.m_fila_type, std::stoi(vt_tray.nozzle_temp_min),
6001 std::stoi(vt_tray.nozzle_temp_max));
6002
6003 }
6004 } catch (...) {
6005 BOOST_LOG_TRIVIAL(info) << "check fail and vt_tray.id" << vt_tray.id;
6006 }
6007 }
6008 }
6009 }
6010
6011 for (auto &diameter_pair : m_nozzle_filament_data) {
6012 auto &diameter = diameter_pair.first;
6013 auto &data = diameter_pair.second;
6014 for (auto &filament_id : need_checked_filament_id[diameter]) {
6015 data.checked_filament.erase(filament_id);
6016 }
6017 }
6018}
#define MAIN_EXTRUDER_ID
Definition DevDefs.h:101
static std::string get_printer_display_name(const std::string &type_str)
Definition DevConfigUtil.h:71
int get_preset_extruder_index(int extder_id) const
Definition DeviceManager.hpp:353
std::map< std::string, FilamentData > m_nozzle_filament_data
Definition DeviceManager.hpp:974
int command_ams_filament_settings(int ams_id, int slot_id, std::string filament_id, std::string setting_id, std::string tray_color, std::string tray_type, int nozzle_temp_min, int nozzle_temp_max, const std::vector< std::string > &tray_colors={}, int tray_ctype=2)
Definition DeviceManager.cpp:1802
std::string printer_type
Definition DeviceManager.hpp:239
static NozzleVolumeType ToNozzleVolumeType(const NozzleFlowType &type)
Definition DevNozzleSystem.cpp:52

References Slic3r::PresetCollection::begin(), Slic3r::PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(), command_ams_filament_settings(), Slic3r::PresetCollection::end(), Slic3r::PresetBundle::filaments, get_preset_extruder_index(), Slic3r::DevPrinterConfigUtil::get_printer_display_name(), m_extder_system, m_fila_system, m_nozzle_filament_data, MAIN_EXTRUDER_ID, printer_type, Slic3r::DevNozzle::ToNozzleVolumeType(), and vt_slot.

Here is the call graph for this function:

◆ check_enable_np()

bool Slic3r::MachineObject::check_enable_np ( const nlohmann::json & print) const
5317{
5318 if (print.contains("cfg") && print.contains("fun") && print.contains("aux") && print.contains("stat"))
5319 {
5320 return true;
5321 }
5322
5323 return false;
5324}

Referenced by parse_json(), and parse_new_info().

Here is the caller graph for this function:

◆ check_pa_result_validation()

bool Slic3r::MachineObject::check_pa_result_validation ( PACalibResult & result)
1085{
1086 if (result.k_value < 0 || result.k_value > 10)
1087 return false;
1088
1089 return true;
1090}

References Slic3r::PACalibResult::k_value.

Referenced by parse_json().

Here is the caller graph for this function:

◆ check_resume_condition()

int Slic3r::MachineObject::check_resume_condition ( )
1728{
1729 if (jobState_ > 1) {
1730 GUI::wxGetApp().show_dialog(_L("To ensure your safety, certain processing tasks (such as laser) can only be resumed on printer."));
1731 return 1;
1732 }
1733 return 0;
1734}
int jobState_
Definition DeviceManager.hpp:716

References _L, and jobState_.

Referenced by command_ams_control(), command_hms_idle_ignore(), command_hms_ignore(), command_hms_resume(), and command_task_resume().

Here is the caller graph for this function:

◆ check_version_valid()

bool Slic3r::MachineObject::check_version_valid ( )
968{
969 bool valid = true;
970 for (auto module : module_vers) {
971 if (module.second.sn.empty()
972 && module.first != "ota"
973 && module.first != "xm")
974 return false;
975 if (module.second.sw_ver.empty())
976 return false;
977 }
979 return valid;
980}
int get_version_retry
Definition DeviceManager.hpp:419
std::map< std::string, DevFirmwareVersionInfo > module_vers
Definition DeviceManager.hpp:429
FileTransferModule & module()
Definition FileTransferUtils.hpp:248

References get_version_retry, Slic3r::module(), and module_vers.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear_auto_nozzle_mapping()

void Slic3r::MachineObject::clear_auto_nozzle_mapping ( )
36{
38 m_nozzle_mapping_ptr->Clear();
39 }
40}

References m_nozzle_mapping_ptr.

Referenced by reset().

Here is the caller graph for this function:

◆ clear_version_info()

void Slic3r::MachineObject::clear_version_info ( )
1031{
1032 air_pump_version_info = DevFirmwareVersionInfo();
1033 laser_version_info = DevFirmwareVersionInfo();
1034 cutting_module_version_info = DevFirmwareVersionInfo();
1035 extinguish_version_info = DevFirmwareVersionInfo();
1036 rotary_version_info = DevFirmwareVersionInfo();
1037 exhaustfan_version_info = DevFirmwareVersionInfo();
1038 amshub_version_info = DevFirmwareVersionInfo();
1039 filatrack_version_info = DevFirmwareVersionInfo();
1040 module_vers.clear();
1041 // Drop cached rack-hotend (WTM) firmware alongside the module list.
1042 // Inert for non-rack printers (rack firmware map is empty).
1043 m_nozzle_system->ClearFirmwareInfoWTM();
1044}
DevFirmwareVersionInfo cutting_module_version_info
Definition DeviceManager.hpp:423
DevFirmwareVersionInfo amshub_version_info
Definition DeviceManager.hpp:427
DevFirmwareVersionInfo air_pump_version_info
Definition DeviceManager.hpp:421
DevFirmwareVersionInfo exhaustfan_version_info
Definition DeviceManager.hpp:426
DevFirmwareVersionInfo laser_version_info
Definition DeviceManager.hpp:422
DevFirmwareVersionInfo extinguish_version_info
Definition DeviceManager.hpp:424
DevFirmwareVersionInfo rotary_version_info
Definition DeviceManager.hpp:425
DevFirmwareVersionInfo filatrack_version_info
Definition DeviceManager.hpp:428

References air_pump_version_info, amshub_version_info, cutting_module_version_info, exhaustfan_version_info, extinguish_version_info, filatrack_version_info, laser_version_info, m_nozzle_system, module_vers, and rotary_version_info.

Referenced by parse_json().

Here is the caller graph for this function:

◆ cloud_publish_json()

int Slic3r::MachineObject::cloud_publish_json ( std::string json_str,
int qos = 0,
int flag = 0 )
2859{
2860 int result = -1;
2861 if (m_agent)
2862 result = m_agent->send_message(get_dev_id(), json_str, qos, flag);
2863
2864 return result;
2865}
std::string get_dev_id() const
Definition DeviceManager.hpp:206

References get_dev_id(), and m_agent.

Referenced by publish_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_ack_proceed()

int Slic3r::MachineObject::command_ack_proceed ( nlohmann::json & proceed)
2320 {
2321 if (proceed["command"].empty()) return -1;
2322
2323 proceed["err_code"] = 0;
2324 if (proceed.contains("err_ignored")) {
2325 proceed["err_ignored"].push_back(proceed["err_index"]);
2326 } else {
2327 proceed["err_ignored"] = std::vector<int>{proceed["err_index"]};
2328 }
2329
2330 for (auto& item : proceed["err_ignored"]) {
2331 json error_item;
2332 error_item["idx"] = item.get<int>();
2333 error_item["mode"] = 0;
2334 proceed["rm_idx"].push_back(error_item);
2335 }
2336
2337 proceed["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2338
2339 json j;
2340 j["print"] = proceed;
2341 return this->publish_json(j);
2342}
int publish_json(const nlohmann::json &json_item, int qos=0, int flag=0)
Definition DeviceManager.cpp:2832
static int m_sequence_id
Definition DeviceManager.hpp:197
nlohmann::json json
Definition AssembleList.cpp:42
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273

References Slic3r::empty(), m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_ams_air_print_detect()

int Slic3r::MachineObject::command_ams_air_print_detect ( bool air_print_detect)
2000{
2001 json j;
2002 j["print"]["command"] = "print_option";
2003 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2004 j["print"]["air_print_detect"] = air_print_detect;
2005
2006 ams_air_print_status = air_print_detect;
2007 BOOST_LOG_TRIVIAL(trace) << "command_ams_air_print_detect:" << air_print_detect;
2008
2009 return this->publish_json(j);
2010}
bool ams_air_print_status
Definition DeviceManager.hpp:312

References ams_air_print_status, m_sequence_id, publish_json(), and Slic3r::trace().

Here is the call graph for this function:

◆ command_ams_calibrate()

int Slic3r::MachineObject::command_ams_calibrate ( int ams_id)
1797{
1798 if (!m_agent) return -1;
1799 return command_with_dialog(m_agent->command_ams_calibrate(get_dev_id(), ams_id, MachineObject::m_sequence_id++, is_lan_mode_printer()));
1800}
bool is_lan_mode_printer() const
Definition DeviceManager.hpp:221
int command_with_dialog(int cmd_result)
Definition DeviceManager.cpp:6145

References command_with_dialog(), get_dev_id(), is_lan_mode_printer(), m_agent, and m_sequence_id.

Here is the call graph for this function:

◆ command_ams_change_filament()

int Slic3r::MachineObject::command_ams_change_filament ( bool load,
std::string ams_id,
std::string slot_id,
int old_temp = 210,
int new_temp = 210,
std::optional< int > extruder_id = std::nullopt )
1736{
1737 json j;
1738 try {
1739 auto tray_id = 0;
1740 if (atoi(ams_id.c_str()) < 16) {
1741 tray_id = atoi(ams_id.c_str()) * 4 + atoi(slot_id.c_str());
1742 }
1743 // TODO: Orca hack
1744 if (ams_id == "254")
1745 ams_id = "255";
1746
1747 j["print"]["command"] = "ams_change_filament";
1748 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1749 j["print"]["curr_temp"] = old_temp;
1750 j["print"]["tar_temp"] = new_temp;
1751 j["print"]["ams_id"] = atoi(ams_id.c_str());
1752
1753 if (!load) {
1754 j["print"]["target"] = 255;
1755 j["print"]["slot_id"] = 255; // the new protocol to mark unload
1756
1757 } else {
1758 if (tray_id == 0) {
1759 j["print"]["target"] = atoi(ams_id.c_str());
1760 } else {
1761 j["print"]["target"] = tray_id;
1762 }
1763
1764 j["print"]["slot_id"] = atoi(slot_id.c_str());
1765 }
1766
1767 // Filament Track Switch: route the load to the chosen extruder. Only present when the
1768 // caller supplied a value (FTS-installed+ready path), so every other caller is unchanged.
1769 if (extruder_id.has_value())
1770 {
1771 j["print"]["extruder_id"] = *extruder_id;
1772 }
1773
1774 } catch (const std::exception &) {}
1775 return this->publish_json(j);
1776}
void load(Archive &archive, wxString &d)
Definition GLGizmoEmboss.cpp:3405

References load(), m_sequence_id, and publish_json().

Referenced by Slic3r::GUI::AMSDryCtrWin::create_cannot_dry_panel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_ams_control()

int Slic3r::MachineObject::command_ams_control ( std::string action)
1860{
1861 if (action == "resume" && check_resume_condition()) return 0;
1862
1863 //valid actions
1864 if (action == "resume" || action == "reset" || action == "pause" || action == "done" || action == "abort") {
1865 json j;
1866 j["print"]["command"] = "ams_control";
1867 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1868 j["print"]["param"] = action;
1869 return this->publish_json(j);
1870 }
1871 return -1;
1872}
int check_resume_condition()
Definition DeviceManager.cpp:1727

References check_resume_condition(), m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_ams_drying_stop()

int Slic3r::MachineObject::command_ams_drying_stop ( )
1875{
1876 json j;
1877 j["print"]["command"] = "auto_stop_ams_dry";
1878 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1879 return this->publish_json(j);
1880}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_ams_filament_settings()

int Slic3r::MachineObject::command_ams_filament_settings ( int ams_id,
int slot_id,
std::string filament_id,
std::string setting_id,
std::string tray_color,
std::string tray_type,
int nozzle_temp_min,
int nozzle_temp_max,
const std::vector< std::string > & tray_colors = {},
int tray_ctype = 2 )
1804{
1805 int tag_tray_id = 0;
1806 int tag_ams_id = ams_id;
1807 int tag_slot_id = slot_id;
1808
1809 if (tag_ams_id == VIRTUAL_TRAY_MAIN_ID || tag_ams_id == VIRTUAL_TRAY_DEPUTY_ID) {
1810 tag_tray_id = VIRTUAL_TRAY_DEPUTY_ID;
1811 } else {
1812 tag_tray_id = tag_slot_id;
1813 }
1814
1815
1816 BOOST_LOG_TRIVIAL(info) << "command_ams_filament_settings, ams_id = " << tag_ams_id << ", slot_id = " << tag_slot_id << ", tray_id = " << tag_tray_id << ", tray_color = " << tray_color
1817 << ", tray_type = " << tray_type << ", filament_id = " << filament_id
1818 << ", setting_id = " << setting_id << ", temp_min: = " << nozzle_temp_min << ", temp_max: = " << nozzle_temp_max;
1819 json j;
1820 j["print"]["command"] = "ams_filament_setting";
1821 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1822 j["print"]["ams_id"] = tag_ams_id;
1823 j["print"]["slot_id"] = tag_slot_id;
1824 j["print"]["tray_id"] = tag_tray_id;
1825 j["print"]["tray_info_idx"] = filament_id;
1826 j["print"]["setting_id"] = setting_id;
1827 // format "FFFFFFFF" RGBA
1828 j["print"]["tray_color"] = tray_color;
1829 j["print"]["nozzle_temp_min"] = nozzle_temp_min;
1830 j["print"]["nozzle_temp_max"] = nozzle_temp_max;
1831 j["print"]["tray_type"] = tray_type;
1832 if (!tray_colors.empty()) {
1833 j["print"]["cols"] = tray_colors;
1834 j["print"]["ctype"] = tray_ctype;
1835 }
1836
1837 return this->publish_json(j);
1838}
#define VIRTUAL_TRAY_DEPUTY_ID
Definition DevDefs.h:90

References m_sequence_id, publish_json(), VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by check_ams_filament_valid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_ams_refresh_rfid()

int Slic3r::MachineObject::command_ams_refresh_rfid ( int ams_id,
int slot_id )
1841{
1842 if (!m_agent) return -1;
1843 return command_with_dialog(m_agent->command_ams_refresh_rfid(get_dev_id(), ams_id, slot_id, MachineObject::m_sequence_id++, is_lan_mode_printer()));
1844}

References command_with_dialog(), get_dev_id(), is_lan_mode_printer(), m_agent, and m_sequence_id.

Here is the call graph for this function:

◆ command_ams_select_tray()

int Slic3r::MachineObject::command_ams_select_tray ( std::string tray_id)
1854{
1855 if (!m_agent) return -1;
1856 return command_with_dialog(m_agent->command_ams_select_tray(get_dev_id(), tray_id, MachineObject::m_sequence_id++, is_lan_mode_printer()));
1857}

References command_with_dialog(), get_dev_id(), is_lan_mode_printer(), m_agent, and m_sequence_id.

Here is the call graph for this function:

◆ command_ams_switch_filament()

int Slic3r::MachineObject::command_ams_switch_filament ( bool switch_filament)
1986{
1987 json j;
1988 j["print"]["command"] = "print_option";
1989 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1990 j["print"]["auto_switch_filament"] = switch_filament;
1991
1992 m_fila_system->GetAmsSystemSetting().SetAutoRefillEnabled(switch_filament);
1993 BOOST_LOG_TRIVIAL(trace) << "command_ams_filament_settings:" << switch_filament;
1994 ams_switch_filament_start = time(nullptr);
1995
1996 return this->publish_json(j);
1997}
time_t ams_switch_filament_start
Definition DeviceManager.hpp:317

References ams_switch_filament_start, m_fila_system, m_sequence_id, publish_json(), and Slic3r::trace().

Here is the call graph for this function:

◆ command_ams_user_settings()

int Slic3r::MachineObject::command_ams_user_settings ( bool start_read_opt,
bool tray_read_opt,
bool remain_flag = false )
1779{
1780 json j;
1781 j["print"]["command"] = "ams_user_setting";
1782 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1783 j["print"]["ams_id"] = -1; // all ams
1784 j["print"]["startup_read_option"] = start_read_opt;
1785 j["print"]["tray_read_option"] = tray_read_opt;
1786 j["print"]["calibrate_remain_flag"] = remain_flag;
1787
1788 m_fila_system->GetAmsSystemSetting().SetDetectOnInsertEnabled(tray_read_opt);
1789 m_fila_system->GetAmsSystemSetting().SetDetectOnPowerupEnabled(start_read_opt);
1790 m_fila_system->GetAmsSystemSetting().SetDetectRemainEnabled(remain_flag);
1791 ams_user_setting_start = time(nullptr);
1792
1793 return this->publish_json(j);
1794}
time_t ams_user_setting_start
Definition DeviceManager.hpp:316

References ams_user_setting_start, m_fila_system, m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_auto_leveling()

int Slic3r::MachineObject::command_auto_leveling ( )
1556{
1557 if (!m_agent) return -1;
1559}

References command_with_dialog(), get_dev_id(), is_lan_mode_printer(), m_agent, and m_sequence_id.

Here is the call graph for this function:

◆ command_axis_control()

int Slic3r::MachineObject::command_axis_control ( std::string axis,
double unit = 1.0f,
double input_val = 1.0f,
int speed = 3000 )
2014{
2015 if (!m_agent) return -1;
2016 return command_with_dialog(m_agent->command_axis_control(get_dev_id(), axis, unit, input_val, speed, is_core_xy(),
2019}
bool m_support_mqtt_axis_control
Definition DeviceManager.hpp:833
bool is_core_xy()
Definition DeviceManager.cpp:2591

References command_with_dialog(), get_dev_id(), is_core_xy(), is_lan_mode_printer(), m_agent, m_sequence_id, and m_support_mqtt_axis_control.

Here is the call graph for this function:

◆ command_clean_print_error()

int Slic3r::MachineObject::command_clean_print_error ( std::string task_id,
int print_error )
1470{
1471 BOOST_LOG_TRIVIAL(info) << "command_clean_print_error, id = " << subtask_id;
1472 json j;
1473 j["print"]["command"] = "clean_print_error";
1474 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1475 j["print"]["subtask_id"] = subtask_id;
1476 j["print"]["print_error"] = print_error;
1477
1478 return this->publish_json(j);
1479}

References m_sequence_id, print_error, and publish_json().

Here is the call graph for this function:

◆ command_clean_print_error_uiop()

int Slic3r::MachineObject::command_clean_print_error_uiop ( int print_error)
1482{
1483 json j;
1484 j["system"]["command"] = "uiop";
1485 j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1486 j["system"]["name"] = "print_error";
1487 j["system"]["action"] = "close";
1488 j["system"]["source"] = 1;// 0-Mushu 1-Studio
1489 j["system"]["type"] = "dialog";
1490
1491 // the error to be cleaned
1492 char buf[32];
1493 ::sprintf(buf, "%08X", print_error);
1494 j["system"]["err"] = std::string(buf);
1495
1496 return this->publish_json(j);
1497}

References m_sequence_id, print_error, and publish_json().

Here is the call graph for this function:

◆ command_consistency_upgrade_confirm()

int Slic3r::MachineObject::command_consistency_upgrade_confirm ( )
1510{
1511 BOOST_LOG_TRIVIAL(info) << "command_consistency_upgrade_confirm";
1512 json j;
1513 j["upgrade"]["command"] = "consistency_confirm";
1514 j["upgrade"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1515 j["upgrade"]["src_id"] = 1; // 1 for slicer
1516 return this->publish_json(j);
1517}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_delete_pa_calibration()

int Slic3r::MachineObject::command_delete_pa_calibration ( const PACalibIndexInfo & pa_calib)
2144{
2145 json j;
2146 j["print"]["command"] = "extrusion_cali_del";
2147 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2148 j["print"]["extruder_id"] = pa_calib.extruder_id;
2149 j["print"]["nozzle_id"] = _generate_nozzle_id(pa_calib.nozzle_volume_type, to_string_nozzle_diameter(pa_calib.nozzle_diameter)).ToStdString();
2150 j["print"]["filament_id"] = pa_calib.filament_id;
2151 j["print"]["cali_idx"] = pa_calib.cali_idx;
2152 if (pa_calib.nozzle_pos_id >= 0) {
2153 j["print"]["nozzle_pos"] = pa_calib.nozzle_pos_id;
2154 j["print"]["nozzle_sn"] = pa_calib.nozzle_sn;
2155 }
2156 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(pa_calib.nozzle_diameter);
2157
2158 BOOST_LOG_TRIVIAL(info) << "extrusion_cali_del: " << j.dump();
2159 return this->publish_json(j);
2160}
std::string to_string_nozzle_diameter(float nozzle_diameter)
Definition DeviceManager.cpp:307
static wxString _generate_nozzle_id(NozzleVolumeType nozzle_type, const std::string &diameter)
Definition DeviceManager.cpp:394

References Slic3r::_generate_nozzle_id(), Slic3r::PACalibIndexInfo::cali_idx, Slic3r::PACalibIndexInfo::extruder_id, Slic3r::PACalibIndexInfo::filament_id, m_sequence_id, Slic3r::PACalibIndexInfo::nozzle_diameter, Slic3r::PACalibIndexInfo::nozzle_pos_id, Slic3r::PACalibIndexInfo::nozzle_sn, Slic3r::PACalibIndexInfo::nozzle_volume_type, publish_json(), and to_string_nozzle_diameter().

Referenced by Slic3r::GUI::CalibUtils::delete_PA_calib_result().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_dont_remind_next_time()

int Slic3r::MachineObject::command_dont_remind_next_time ( nlohmann::json & mqtt_guard_json)
2380{
2381 if (!mqtt_guard_json.contains("command") ||
2382 !mqtt_guard_json.contains("err_index") ||
2383 mqtt_guard_json["err_index"].empty()) return -1;
2384
2385 json j;
2386 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2387
2388 try {
2389 j["print"]["command"] = mqtt_guard_json["command"].get<std::string>();
2390 int err_index = mqtt_guard_json["err_index"].get<int>();
2391
2392 if (mqtt_guard_json.contains("err_ignored") &&
2393 mqtt_guard_json["err_ignored"].is_array()) {
2394 j["print"]["err_ignored"] = mqtt_guard_json["err_ignored"];
2395 j["print"]["err_ignored"].push_back(err_index);
2396 } else {
2397 j["print"]["err_ignored"] = std::vector<int>{err_index};
2398 }
2399
2400 for (auto& item : j["print"]["err_ignored"]) {
2401 if (!item.is_number_integer()) continue;
2402
2403 json item_json;
2404 item_json["idx"] = item.get<int>();
2405 item_json["mode"] = 1; // 1-next time ignore, 2-always ignore
2406 j["print"]["rm_idx"].push_back(item_json);
2407 }
2408 } catch (const json::exception& e) {
2409 BOOST_LOG_TRIVIAL(error) << "JSON parsing error in command_dont_remind_next_time: " << e.what();
2410 return -1;
2411 }
2412
2413 return this->publish_json(j, 1);
2414}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_extruder_control()

int Slic3r::MachineObject::command_extruder_control ( int nozzle_id,
double val )
2022{
2023 json j;
2024 j["print"]["command"] = "set_extrusion_length";
2025 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2026 j["print"]["extruder_index"] = nozzle_id;
2027 j["print"]["length"] = (int)val;
2028 return this->publish_json(j);
2029}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_extrusion_cali_set()

int Slic3r::MachineObject::command_extrusion_cali_set ( int tray_index,
std::string setting_id,
std::string name,
float k,
float n,
int bed_temp = -1,
int nozzle_temp = -1,
float max_volumetric_speed = -1 )
1913{
1914 BOOST_LOG_TRIVIAL(trace) << "extrusion_cali: tray_id = " << tray_index << ", setting_id = " << setting_id << ", k = " << k
1915 << ", n = " << n;
1916 json j;
1917 j["print"]["command"] = "extrusion_cali_set";
1918 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1919 j["print"]["tray_id"] = tray_index;
1920 //j["print"]["setting_id"] = setting_id;
1921 //j["print"]["name"] = name;
1922 j["print"]["k_value"] = k;
1923 j["print"]["n_coef"] = 1.4f; // fixed n
1924 //j["print"]["n_coef"] = n;
1925 if (bed_temp >= 0 && nozzle_temp >= 0 && max_volumetric_speed >= 0) {
1926 j["print"]["bed_temp"] = bed_temp;
1927 j["print"]["nozzle_temp"] = nozzle_temp;
1928 j["print"]["max_volumetric_speed"] = max_volumetric_speed;
1929 }
1930 return this->publish_json(j);
1931}

References m_sequence_id, publish_json(), and Slic3r::trace().

Here is the call graph for this function:

◆ command_get_access_code()

int Slic3r::MachineObject::command_get_access_code ( )
1411 {
1412 BOOST_LOG_TRIVIAL(info) << "command_get_access_code";
1413 json j;
1414 j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1415 j["system"]["command"] = "get_access_code";
1416
1417 return this->publish_json(j);
1418}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_get_flow_ratio_calibration_result()

int Slic3r::MachineObject::command_get_flow_ratio_calibration_result ( float nozzle_diameter)
2253{
2254 json j;
2255 j["print"]["command"] = "flowrate_get_result";
2256 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2257 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(nozzle_diameter);
2258
2259 BOOST_LOG_TRIVIAL(info) << "flowrate_get_result: " << j.dump();
2260 return this->publish_json(j);
2261}
zaa_minimize_perimeter_height nozzle_diameter((ConfigOptionBool, reduce_infill_retraction))((ConfigOptionBool

References m_sequence_id, Slic3r::nozzle_diameter(), publish_json(), and to_string_nozzle_diameter().

Referenced by Slic3r::GUI::CalibUtils::emit_get_flow_ratio_calib_results().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_get_pa_calibration_result()

int Slic3r::MachineObject::command_get_pa_calibration_result ( float nozzle_diameter)
2187{
2188 json j;
2189 j["print"]["command"] = "extrusion_cali_get_result";
2190 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2191 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(nozzle_diameter);
2192
2193 BOOST_LOG_TRIVIAL(info) << "extrusion_cali_get_result: " << j.dump();
2194 return this->publish_json(j);
2195}

References m_sequence_id, Slic3r::nozzle_diameter(), publish_json(), and to_string_nozzle_diameter().

Referenced by Slic3r::GUI::CalibUtils::emit_get_PA_calib_results().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_get_pa_calibration_tab()

int Slic3r::MachineObject::command_get_pa_calibration_tab ( const PACalibExtruderInfo & calib_info)
2163{
2165
2166 json j;
2167 j["print"]["command"] = "extrusion_cali_get";
2168 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2169 j["print"]["filament_id"] = calib_info.filament_id;
2170 if (calib_info.use_extruder_id)
2171 j["print"]["extruder_id"] = calib_info.extruder_id;
2172 if (calib_info.use_nozzle_volume_type)
2173 j["print"]["nozzle_id"] = _generate_nozzle_id(calib_info.nozzle_volume_type, to_string_nozzle_diameter(calib_info.nozzle_diameter)).ToStdString();
2174 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(calib_info.nozzle_diameter);
2175
2176 if (calib_info.nozzle_pos_id >= 0) {
2177 j["print"]["nozzle_pos"] = calib_info.nozzle_pos_id;
2178 j["print"]["nozzle_sn"] = calib_info.nozzle_sn;
2179 }
2180
2181 BOOST_LOG_TRIVIAL(info) << "extrusion_cali_get: " << j.dump();
2182 request_tab_from_bbs = true;
2183 return this->publish_json(j);
2184}
bool request_tab_from_bbs
Definition DeviceManager.hpp:493
void reset_pa_cali_history_result()
Definition DeviceManager.hpp:499

References Slic3r::_generate_nozzle_id(), Slic3r::PACalibExtruderInfo::extruder_id, Slic3r::PACalibExtruderInfo::filament_id, m_sequence_id, Slic3r::PACalibExtruderInfo::nozzle_diameter, Slic3r::PACalibExtruderInfo::nozzle_pos_id, Slic3r::PACalibExtruderInfo::nozzle_sn, Slic3r::PACalibExtruderInfo::nozzle_volume_type, publish_json(), request_tab_from_bbs, reset_pa_cali_history_result(), to_string_nozzle_diameter(), Slic3r::PACalibExtruderInfo::use_extruder_id, and Slic3r::PACalibExtruderInfo::use_nozzle_volume_type.

Referenced by Slic3r::GUI::CalibUtils::emit_get_PA_calib_infos(), and Slic3r::DevCalib::RequestPAHistory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_get_version()

int Slic3r::MachineObject::command_get_version ( bool with_retry = true)
1401{
1402 BOOST_LOG_TRIVIAL(info) << "command_get_version";
1403 json j;
1404 j["info"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1405 j["info"]["command"] = "get_version";
1406 if (with_retry)
1408 return this->publish_json(j, 1);
1409}
#define GET_VERSION_RETRYS
Definition DeviceManager.hpp:59

References get_version_retry, GET_VERSION_RETRYS, m_sequence_id, and publish_json().

Referenced by Slic3r::GUI::SelectMachineDialog::on_selection_changed(), Slic3r::GUI::SendToPrinterDialog::on_selection_changed(), parse_json(), and Slic3r::GUI::UpgradePanel::refresh_version_and_firmware().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_go_home()

int Slic3r::MachineObject::command_go_home ( )
1562{
1563 if (!m_agent) return -1;
1565}
bool is_in_printing()
Definition DeviceManager.cpp:2561
bool m_support_mqtt_homing
Definition DeviceManager.hpp:653

References command_with_dialog(), get_dev_id(), is_in_printing(), is_lan_mode_printer(), m_agent, m_sequence_id, and m_support_mqtt_homing.

Here is the call graph for this function:

◆ command_hms_idle_ignore()

int Slic3r::MachineObject::command_hms_idle_ignore ( const std::string & error_str,
int type )
1624{
1625 if(check_resume_condition()) return 0;
1626
1627 json j;
1628 j["print"]["command"] = "idle_ignore";
1629 j["print"]["err"] = error_str;
1630 j["print"]["type"] = type;
1631 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1632 return this->publish_json(j, 1);
1633}

References check_resume_condition(), m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_hms_ignore()

int Slic3r::MachineObject::command_hms_ignore ( const std::string & error_str,
const std::string & job_id )
1650{
1651 if(check_resume_condition()) return 0;
1652
1653 json j;
1654 j["print"]["command"] = "ignore";
1655 j["print"]["err"] = error_str;
1656 j["print"]["param"] = "reserve";
1657 j["print"]["job_id"] = job_id;
1658 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1659
1660 return this->publish_json(j, 1);
1661}

References check_resume_condition(), m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_hms_resume()

int Slic3r::MachineObject::command_hms_resume ( const std::string & error_str,
const std::string & job_id )
1636{
1637 if(check_resume_condition()) return 0;
1638
1639 json j;
1640 j["print"]["command"] = "resume";
1641 j["print"]["err"] = error_str;
1642 j["print"]["param"] = "reserve";
1643 j["print"]["job_id"] = job_id;
1644 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1645
1646 return this->publish_json(j, 1);
1647}

References check_resume_condition(), m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_hms_stop()

int Slic3r::MachineObject::command_hms_stop ( const std::string & error_str,
const std::string & job_id )
1663 {
1664 json j;
1665 j["print"]["command"] = "stop";
1666 j["print"]["err"] = error_str;
1667 j["print"]["param"] = "reserve";
1668 j["print"]["job_id"] = job_id;
1669 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1670
1671 return this->publish_json(j, 1);
1672}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_ipcam_check_timelapse_storage()

int Slic3r::MachineObject::command_ipcam_check_timelapse_storage ( const std::string & storage,
int total_layer )
2350{
2351 json j;
2352 j["camera"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2353 j["camera"]["command"] = "ipcam_get_media_info";
2354 j["camera"]["sub_command"] = "is_timelapse_storage_enough";
2355 j["camera"]["storage"] = storage;
2356 j["camera"]["total_layer"] = total_layer;
2357 return this->publish_json(j);
2358}

References m_sequence_id, and publish_json().

Referenced by Slic3r::GUI::SelectMachineDialog::start_timelapse_storage_check().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_ipcam_delete_oldest_timelapse()

int Slic3r::MachineObject::command_ipcam_delete_oldest_timelapse ( const std::string & storage,
int total_layer )
2361{
2362 json j;
2363 j["camera"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2364 j["camera"]["command"] = "ipcam_delete_oldest_timelapse";
2365 j["camera"]["storage"] = storage;
2366 j["camera"]["total_layer"] = total_layer;
2367 return this->publish_json(j);
2368}

References m_sequence_id, and publish_json().

Referenced by Slic3r::GUI::SelectMachineDialog::show_timelapse_storage_dialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_ipcam_record()

int Slic3r::MachineObject::command_ipcam_record ( bool on_off)
2264{
2265 BOOST_LOG_TRIVIAL(info) << "command_ipcam_record = " << on_off;
2266 json j;
2267 j["camera"]["command"] = "ipcam_record_set";
2268 j["camera"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2269 j["camera"]["control"] = on_off ? "enable" : "disable";
2270 camera_recording_ctl_start = time(nullptr);
2271 this->camera_recording_when_printing = on_off;
2272 return this->publish_json(j);
2273}
time_t camera_recording_ctl_start
Definition DeviceManager.hpp:552
bool camera_recording_when_printing
Definition DeviceManager.hpp:550

References camera_recording_ctl_start, camera_recording_when_printing, m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_ipcam_resolution_set()

int Slic3r::MachineObject::command_ipcam_resolution_set ( std::string resolution)
2288{
2289 BOOST_LOG_TRIVIAL(info) << "command:ipcam_resolution_set" << ", resolution:" << resolution;
2290 json j;
2291 j["camera"]["command"] = "ipcam_resolution_set";
2292 j["camera"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2293 j["camera"]["resolution"] = resolution;
2295 camera_recording_ctl_start = time(nullptr);
2297 return this->publish_json(j);
2298}
#define HOLD_COUNT_CAMERA
Definition DeviceManager.hpp:54
std::string camera_resolution
Definition DeviceManager.hpp:555
int camera_resolution_hold_count
Definition DeviceManager.hpp:554
zaa_minimize_perimeter_height resolution((ConfigOptionFloats, retraction_minimum_travel))((ConfigOptionBools

References camera_recording_ctl_start, camera_resolution, camera_resolution_hold_count, HOLD_COUNT_CAMERA, m_sequence_id, publish_json(), and Slic3r::resolution().

Here is the call graph for this function:

◆ command_ipcam_timelapse()

int Slic3r::MachineObject::command_ipcam_timelapse ( bool on_off)
2276{
2277 BOOST_LOG_TRIVIAL(info) << "command_ipcam_timelapse " << on_off;
2278 json j;
2279 j["camera"]["command"] = "ipcam_timelapse";
2280 j["camera"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2281 j["camera"]["control"] = on_off ? "enable" : "disable";
2283 this->camera_timelapse = on_off;
2284 return this->publish_json(j);
2285}
bool camera_timelapse
Definition DeviceManager.hpp:551
int camera_timelapse_hold_count
Definition DeviceManager.hpp:553

References camera_timelapse, camera_timelapse_hold_count, HOLD_COUNT_CAMERA, m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_nozzle_blob_detect()

int Slic3r::MachineObject::command_nozzle_blob_detect ( bool nozzle_blob_detect)
1957{
1958 json j;
1959 j["print"]["command"] = "print_option";
1960 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1961 j["print"]["nozzle_blob_detect"] = nozzle_blob_detect;
1962 nozzle_blob_detection_enabled = nozzle_blob_detect;
1963 nozzle_blob_detection_hold_start = time(nullptr);
1964 return this->publish_json(j);
1965}
time_t nozzle_blob_detection_hold_start
Definition DeviceManager.hpp:477
bool nozzle_blob_detection_enabled
Definition DeviceManager.hpp:476

References m_sequence_id, nozzle_blob_detection_enabled, nozzle_blob_detection_hold_start, and publish_json().

Here is the call graph for this function:

◆ command_purification_disable()

int Slic3r::MachineObject::command_purification_disable ( )
2371{
2372 json j;
2373 j["print"]["command"] = "close_air_filt";
2374 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2375
2376 return this->publish_json(j, 1);
2377}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_pushing()

int Slic3r::MachineObject::command_pushing ( std::string cmd)
1448{
1449 auto curr_time = std::chrono::system_clock::now();
1450 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_request_start);
1451 if (diff.count() < REQUEST_START_MIN_TIME) {
1452 BOOST_LOG_TRIVIAL(trace) << "static: command_request_start: send request too fast, dev_id=" << dev_id;
1453 return -1;
1454 }
1455 else {
1456 BOOST_LOG_TRIVIAL(trace) << "static: command_request_start, dev_id=" << dev_id;
1457 last_request_start = std::chrono::system_clock::now();
1458 }
1459
1460 if (cmd == "start" || cmd == "stop") {
1461 json j;
1462 j["pushing"]["command"] = cmd;
1463 j["pushing"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1464 return this->publish_json(j);
1465 }
1466 return -1;
1467}
#define REQUEST_START_MIN_TIME
Definition DeviceManager.hpp:47
std::chrono::system_clock::time_point last_request_start
Definition DeviceManager.hpp:299
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:731

References dev_id, Slic3r::diff(), last_request_start, m_sequence_id, publish_json(), REQUEST_START_MIN_TIME, and Slic3r::trace().

Referenced by Slic3r::DeviceManager::check_pushing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_refresh_nozzle()

int Slic3r::MachineObject::command_refresh_nozzle ( )
1709 {
1710 json j;
1711 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1712 j["print"]["command"] = "refresh_nozzle";
1713
1714 return this->publish_json(j, 1);
1715}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_request_push_all()

int Slic3r::MachineObject::command_request_push_all ( bool request_now = false)
1421{
1422 auto curr_time = std::chrono::system_clock::now();
1423 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_request_push);
1424
1425 if (diff.count() < REQUEST_PUSH_MIN_TIME) {
1426 if (request_now) {
1427 BOOST_LOG_TRIVIAL(trace) << "static: command_request_push_all, dev_id=" << dev_id;
1428 last_request_push = std::chrono::system_clock::now();
1429 }
1430 else {
1431 BOOST_LOG_TRIVIAL(trace) << "static: command_request_push_all: send request too fast, dev_id=" << dev_id;
1432 return -1;
1433 }
1434 } else {
1435 BOOST_LOG_TRIVIAL(trace) << "static: command_request_push_all, dev_id=" << dev_id;
1436 last_request_push = std::chrono::system_clock::now();
1437 }
1438
1439 json j;
1440 j["pushing"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1441 j["pushing"]["command"] = "pushall";
1442 j["pushing"]["version"] = 1;
1443 j["pushing"]["push_target"] = 1;
1444 return this->publish_json(j);
1445}
#define REQUEST_PUSH_MIN_TIME
Definition DeviceManager.hpp:46
std::chrono::system_clock::time_point last_request_push
Definition DeviceManager.hpp:298

References dev_id, Slic3r::diff(), last_request_push, m_sequence_id, publish_json(), REQUEST_PUSH_MIN_TIME, and Slic3r::trace().

Referenced by Slic3r::DeviceManager::keep_alive(), Slic3r::GUI::SelectMachineDialog::on_selection_changed(), Slic3r::GUI::SendToPrinterDialog::on_selection_changed(), and parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_set_bed()

int Slic3r::MachineObject::command_set_bed ( int temp)
1685{
1686 if (!m_agent) return -1;
1688}
bool m_support_mqtt_bet_ctrl
Definition DeviceManager.hpp:793

References command_with_dialog(), get_dev_id(), is_lan_mode_printer(), m_agent, m_sequence_id, and m_support_mqtt_bet_ctrl.

Here is the call graph for this function:

◆ command_set_chamber()

int Slic3r::MachineObject::command_set_chamber ( int temp)
1718{
1719 json j;
1720 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1721 j["print"]["command"] = "set_ctt";
1722 j["print"]["ctt_val"] = temp;
1723
1724 return this->publish_json(j, 1);
1725}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_set_door_open_check()

void Slic3r::MachineObject::command_set_door_open_check ( DoorOpenCheckState state)
6022{
6023 json j;
6024 j["system"]["command"] = "set_door_stat";
6025 j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
6026 switch (state)
6027 {
6028 case Slic3r::MachineObject::DOOR_OPEN_CHECK_DISABLE: j["system"]["config"] = 0; break;
6029 case Slic3r::MachineObject::DOOR_OPEN_CHECK_ENABLE_WARNING: j["system"]["config"] = 1; break;
6030 case Slic3r::MachineObject::DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT: j["system"]["config"] = 2; break;
6031 default: assert(0); return;
6032 }
6033
6034 if (publish_json(j) == 0)
6035 {
6036 xcam_door_open_check = state;
6037 xcam_door_open_check_start_time = time(nullptr);
6038 }
6039}
time_t xcam_door_open_check_start_time
Definition DeviceManager.hpp:995
DoorOpenCheckState xcam_door_open_check
Definition DeviceManager.hpp:994

References DOOR_OPEN_CHECK_DISABLE, DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT, DOOR_OPEN_CHECK_ENABLE_WARNING, m_sequence_id, publish_json(), xcam_door_open_check, and xcam_door_open_check_start_time.

Here is the call graph for this function:

◆ command_set_filament_tangle_detect()

int Slic3r::MachineObject::command_set_filament_tangle_detect ( bool fliament_tangle_detect)
1976 {
1977 json j;
1978 j["print"]["command"] = "print_option";
1979 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1980 j["print"]["filament_tangle_detect"] = filament_tangle_detect;
1981
1982 return this->publish_json(j);
1983}

References m_sequence_id, and publish_json().

Referenced by command_xcam_control_filament_tangle_detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_set_nozzle()

int Slic3r::MachineObject::command_set_nozzle ( int temp)
1691{
1692 if (!m_agent) return -1;
1694}

References command_with_dialog(), get_dev_id(), is_lan_mode_printer(), m_agent, and m_sequence_id.

Here is the call graph for this function:

◆ command_set_nozzle_new()

int Slic3r::MachineObject::command_set_nozzle_new ( int nozzle_id,
int temp )
1697{
1698 BOOST_LOG_TRIVIAL(info) << "set_nozzle_temp";
1699
1700 json j;
1701 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1702 j["print"]["command"] = "set_nozzle_temp";
1703 j["print"]["extruder_index"] = nozzle_id;
1704 j["print"]["target_temp"] = temp;
1705
1706 return this->publish_json(j, 1);
1707}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_set_pa_calibration()

int Slic3r::MachineObject::command_set_pa_calibration ( const std::vector< PACalibResult > & pa_calib_values,
bool is_auto_cali )
2102{
2103 CNumericLocalesSetter locales_setter;
2104
2105 if (pa_calib_values.size() > 0) {
2106 json j;
2107 j["print"]["command"] = "extrusion_cali_set";
2108 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2109 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(pa_calib_values[0].nozzle_diameter);
2110
2111 for (int i = 0; i < pa_calib_values.size(); ++i) {
2112 if (pa_calib_values[i].tray_id >= 0)
2113 j["print"]["filaments"][i]["tray_id"] = pa_calib_values[i].tray_id;
2114 if (pa_calib_values[i].cali_idx >= 0)
2115 j["print"]["filaments"][i]["cali_idx"] = pa_calib_values[i].cali_idx;
2116 j["print"]["filaments"][i]["tray_id"] = pa_calib_values[i].tray_id;
2117 j["print"]["filaments"][i]["extruder_id"] = pa_calib_values[i].extruder_id;
2118 j["print"]["filaments"][i]["nozzle_id"] = _generate_nozzle_id(pa_calib_values[i].nozzle_volume_type, to_string_nozzle_diameter(pa_calib_values[i].nozzle_diameter)).ToStdString();
2119 j["print"]["filaments"][i]["nozzle_diameter"] = to_string_nozzle_diameter(pa_calib_values[i].nozzle_diameter);
2120 j["print"]["filaments"][i]["ams_id"] = pa_calib_values[i].ams_id;
2121 j["print"]["filaments"][i]["slot_id"] = pa_calib_values[i].slot_id;
2122 j["print"]["filaments"][i]["filament_id"] = pa_calib_values[i].filament_id;
2123 j["print"]["filaments"][i]["setting_id"] = pa_calib_values[i].setting_id;
2124 j["print"]["filaments"][i]["name"] = pa_calib_values[i].name;
2125 j["print"]["filaments"][i]["k_value"] = std::to_string(pa_calib_values[i].k_value);
2126 if (is_auto_cali)
2127 j["print"]["filaments"][i]["n_coef"] = std::to_string(pa_calib_values[i].n_coef);
2128 else
2129 j["print"]["filaments"][i]["n_coef"] = "0.0";
2130 if (pa_calib_values[i].nozzle_pos_id >= 0) {
2131 j["print"]["filaments"][i]["nozzle_pos"] = pa_calib_values[i].nozzle_pos_id;
2132 j["print"]["filaments"][i]["nozzle_sn"] = pa_calib_values[i].nozzle_sn;
2133 }
2134 }
2135
2136 BOOST_LOG_TRIVIAL(info) << "extrusion_cali_set: " << j.dump();
2137 return this->publish_json(j);
2138 }
2139
2140 return -1;
2141}
zaa_minimize_perimeter_height nozzle_volume_type((ConfigOptionStrings, extruder_ams_count))((ConfigOptionStrings

References Slic3r::_generate_nozzle_id(), m_sequence_id, Slic3r::nozzle_diameter(), Slic3r::nozzle_volume_type(), publish_json(), and to_string_nozzle_diameter().

Referenced by Slic3r::GUI::CalibUtils::set_PA_calib_result().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_set_printer_nozzle()

int Slic3r::MachineObject::command_set_printer_nozzle ( std::string nozzle_type,
float diameter )

References Slic3r::nozzle_type().

Here is the call graph for this function:

◆ command_set_printer_nozzle2()

int Slic3r::MachineObject::command_set_printer_nozzle2 ( int id,
std::string nozzle_type,
float diameter )

References Slic3r::nozzle_type().

Here is the call graph for this function:

◆ command_set_printing_option()

int Slic3r::MachineObject::command_set_printing_option ( bool auto_recovery)
1945{
1946 int print_option = (int)auto_recovery << (int)PRINT_OP_AUTO_RECOVERY;
1947 json j;
1948 j["print"]["command"] = "print_option";
1949 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1950 j["print"]["option"] = print_option;
1951 j["print"]["auto_recovery"] = auto_recovery;
1952
1953 return this->publish_json(j);
1954}

References m_sequence_id, PRINT_OP_AUTO_RECOVERY, and publish_json().

Referenced by command_xcam_control_auto_recovery_step_loss().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_set_printing_speed()

int Slic3r::MachineObject::command_set_printing_speed ( DevPrintingSpeedLevel lvl)
1935{
1936 json j;
1937 j["print"]["command"] = "print_speed";
1938 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1939 j["print"]["param"] = std::to_string((int)lvl);
1940
1941 return this->publish_json(j);
1942}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_set_prompt_sound()

int Slic3r::MachineObject::command_set_prompt_sound ( bool prompt_sound)
1967 {
1968 json j;
1969 j["print"]["command"] = "print_option";
1970 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1971 j["print"]["sound_enable"] = prompt_sound;
1972
1973 return this->publish_json(j);
1974}

References m_sequence_id, and publish_json().

Referenced by command_xcam_control_allow_prompt_sound().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_set_save_remote_print_file_to_storage()

void Slic3r::MachineObject::command_set_save_remote_print_file_to_storage ( bool save)
6043{
6045 {
6046 json j;
6047 j["system"]["command"] = "print_cache_set";
6048 j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
6049 j["system"]["config"] = save ? true : false;
6050
6051 if (publish_json(j) == 0)
6052 {
6055 }
6056 }
6057}
void save(Archive &archive, wxString const &d)
Definition GLGizmoEmboss.cpp:3403
time_t xcam__save_remote_print_file_to_storage_start_time
Definition DeviceManager.hpp:999
bool get_save_remote_print_file_to_storage() const
Definition DeviceManager.hpp:987
bool xcam__save_remote_print_file_to_storage
Definition DeviceManager.hpp:998

References get_save_remote_print_file_to_storage(), m_sequence_id, publish_json(), save(), xcam__save_remote_print_file_to_storage, and xcam__save_remote_print_file_to_storage_start_time.

Here is the call graph for this function:

◆ command_start_calibration()

int Slic3r::MachineObject::command_start_calibration ( bool vibration,
bool bed_leveling,
bool xcam_cali,
bool motor_noise,
bool nozzle_cali,
bool bed_cali,
bool clumppos_cali )
2044{
2046 // fixed gcode file
2047 json j;
2048 j["print"]["command"] = "gcode_file";
2049 j["print"]["param"] = "/usr/etc/print/auto_cali_for_user.gcode";
2050 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2051 return this->publish_json(j);
2052 } else {
2053 json j;
2054 j["print"]["command"] = "calibration";
2055 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2056 j["print"]["option"] = + (clumppos_cali ? 1 << 6 : 0)
2057 + (bed_cali ? 1 << 5 : 0)
2058 + (nozzle_cali ? 1 << 4 : 0)
2059 + (motor_noise ? 1 << 3 : 0)
2060 + (vibration ? 1 << 2 : 0)
2061 + (bed_leveling ? 1 << 1 : 0)
2062 + (xcam_cali ? 1 << 0 : 0);
2063 return this->publish_json(j);
2064 }
2065}
bool is_support_command_calibration()
Definition DeviceManager.cpp:2031

References is_support_command_calibration(), m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_start_camera()

int Slic3r::MachineObject::command_start_camera ( )
1847{
1848 if (!m_agent) return -1;
1849 return m_agent->command_start_camera(get_dev_id());
1850}

References get_dev_id(), and m_agent.

Here is the call graph for this function:

◆ command_start_extrusion_cali()

int Slic3r::MachineObject::command_start_extrusion_cali ( int tray_index,
int nozzle_temp,
int bed_temp,
float max_volumetric_speed,
std::string setting_id = "" )
1883{
1884 BOOST_LOG_TRIVIAL(trace) << "extrusion_cali: tray_id = " << tray_index << ", nozzle_temp = " << nozzle_temp << ", bed_temp = " << bed_temp
1885 << ", max_volumetric_speed = " << max_volumetric_speed;
1886
1887 json j;
1888 j["print"]["command"] = "extrusion_cali";
1889 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1890 j["print"]["tray_id"] = tray_index;
1891 //j["print"]["setting_id"] = setting_id;
1892 //j["print"]["name"] = "";
1893 j["print"]["nozzle_temp"] = nozzle_temp;
1894 j["print"]["bed_temp"] = bed_temp;
1895 j["print"]["max_volumetric_speed"] = max_volumetric_speed;
1896
1897 // enter extusion cali
1898 last_extrusion_cali_start_time = std::chrono::system_clock::now();
1899 BOOST_LOG_TRIVIAL(trace) << "extrusion_cali: " << j.dump();
1900 return this->publish_json(j);
1901}
std::chrono::system_clock::time_point last_extrusion_cali_start_time
Definition DeviceManager.hpp:323

References last_extrusion_cali_start_time, m_sequence_id, publish_json(), and Slic3r::trace().

Here is the call graph for this function:

◆ command_start_flow_ratio_calibration()

int Slic3r::MachineObject::command_start_flow_ratio_calibration ( const X1CCalibInfos & calib_data)
2218{
2219 CNumericLocalesSetter locales_setter;
2220
2221 if (calib_data.calib_datas.size() > 0) {
2222 json j;
2223 j["print"]["command"] = "flowrate_cali";
2224 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2225 j["print"]["tray_id"] = calib_data.calib_datas[0].tray_id;
2226 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(calib_data.calib_datas[0].nozzle_diameter);
2227
2228 std::string filament_ids;
2229 for (int i = 0; i < calib_data.calib_datas.size(); ++i) {
2230 j["print"]["filaments"][i]["tray_id"] = calib_data.calib_datas[i].tray_id;
2231 j["print"]["filaments"][i]["bed_temp"] = calib_data.calib_datas[i].bed_temp;
2232 j["print"]["filaments"][i]["filament_id"] = calib_data.calib_datas[i].filament_id;
2233 j["print"]["filaments"][i]["setting_id"] = calib_data.calib_datas[i].setting_id;
2234 j["print"]["filaments"][i]["nozzle_temp"] = calib_data.calib_datas[i].nozzle_temp;
2235 j["print"]["filaments"][i]["def_flow_ratio"] = std::to_string(calib_data.calib_datas[i].flow_rate);
2236 j["print"]["filaments"][i]["max_volumetric_speed"] = std::to_string(calib_data.calib_datas[i].max_volumetric_speed);
2237 j["print"]["filaments"][i]["extruder_id"] = calib_data.calib_datas[i].extruder_id;
2238 j["print"]["filaments"][i]["ams_id"] = calib_data.calib_datas[i].ams_id;
2239 j["print"]["filaments"][i]["slot_id"] = calib_data.calib_datas[i].slot_id;
2240
2241 if (i > 0)
2242 filament_ids += ",";
2243 filament_ids += calib_data.calib_datas[i].filament_id;
2244 }
2245
2246 BOOST_LOG_TRIVIAL(info) << "flowrate_cali: " << j.dump();
2247 return this->publish_json(j);
2248 }
2249 return -1;
2250}
zaa_minimize_perimeter_height filament_ids((ConfigOptionStrings, filament_colour))((ConfigOptionStrings

References Slic3r::X1CCalibInfos::calib_datas, Slic3r::filament_ids(), m_sequence_id, publish_json(), and to_string_nozzle_diameter().

Referenced by Slic3r::GUI::CalibUtils::calib_flowrate_X1C().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_start_pa_calibration()

int Slic3r::MachineObject::command_start_pa_calibration ( const X1CCalibInfos & pa_data,
int mode = 0 )
2068{
2069 CNumericLocalesSetter locales_setter;
2070
2071 pa_calib_results.clear();
2072 json j;
2073 j["print"]["command"] = "extrusion_cali";
2074 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2075 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(pa_data.calib_datas[0].nozzle_diameter);
2076 j["print"]["mode"] = mode;
2077
2078 std::string filament_ids;
2079 for (int i = 0; i < pa_data.calib_datas.size(); ++i) {
2080 j["print"]["filaments"][i]["tray_id"] = pa_data.calib_datas[i].tray_id;
2081 j["print"]["filaments"][i]["extruder_id"] = pa_data.calib_datas[i].extruder_id;
2082 j["print"]["filaments"][i]["bed_temp"] = pa_data.calib_datas[i].bed_temp;
2083 j["print"]["filaments"][i]["filament_id"] = pa_data.calib_datas[i].filament_id;
2084 j["print"]["filaments"][i]["setting_id"] = pa_data.calib_datas[i].setting_id;
2085 j["print"]["filaments"][i]["nozzle_temp"] = pa_data.calib_datas[i].nozzle_temp;
2086 j["print"]["filaments"][i]["ams_id"] = pa_data.calib_datas[i].ams_id;
2087 j["print"]["filaments"][i]["slot_id"] = pa_data.calib_datas[i].slot_id;
2088 j["print"]["filaments"][i]["nozzle_id"] = _generate_nozzle_id(pa_data.calib_datas[i].nozzle_volume_type,to_string_nozzle_diameter(pa_data.calib_datas[i].nozzle_diameter)).ToStdString();
2089 j["print"]["filaments"][i]["nozzle_diameter"] = to_string_nozzle_diameter(pa_data.calib_datas[i].nozzle_diameter);
2090 j["print"]["filaments"][i]["max_volumetric_speed"] = std::to_string(pa_data.calib_datas[i].max_volumetric_speed);
2091
2092 if (i > 0) filament_ids += ",";
2093 filament_ids += pa_data.calib_datas[i].filament_id;
2094 }
2095
2096 BOOST_LOG_TRIVIAL(info) << "extrusion_cali: " << j.dump();
2097
2098 return this->publish_json(j);
2099}
std::vector< PACalibResult > pa_calib_results
Definition DeviceManager.hpp:496

References Slic3r::_generate_nozzle_id(), Slic3r::X1CCalibInfos::calib_datas, Slic3r::filament_ids(), m_sequence_id, pa_calib_results, publish_json(), and to_string_nozzle_diameter().

Referenced by Slic3r::GUI::CalibUtils::calib_PA().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_stop_buzzer()

int Slic3r::MachineObject::command_stop_buzzer ( )
1675{
1676 json j;
1677 j["print"]["command"] = "buzzer_ctrl";
1678 j["print"]["mode"] = 0;
1679 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1680
1681 return this->publish_json(j, 1);
1682}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_stop_extrusion_cali()

int Slic3r::MachineObject::command_stop_extrusion_cali ( )
1904{
1905 BOOST_LOG_TRIVIAL(trace) << "extrusion_cali: stop";
1906 if (is_in_extrusion_cali()) {
1907 return command_task_abort();
1908 }
1909 return 0;
1910}
int command_task_abort()
Definition DeviceManager.cpp:1578
bool is_in_extrusion_cali()
Definition DeviceManager.cpp:772

References command_task_abort(), is_in_extrusion_cali(), and Slic3r::trace().

Here is the call graph for this function:

◆ command_task_abort()

int Slic3r::MachineObject::command_task_abort ( )
1579{
1580 BOOST_LOG_TRIVIAL(trace) << "command_task_abort: ";
1581 json j;
1582 j["print"]["command"] = "stop";
1583 j["print"]["param"] = "";
1584 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1585
1586 return this->publish_json(j, 1);
1587}

References m_sequence_id, publish_json(), and Slic3r::trace().

Referenced by command_stop_extrusion_cali(), Slic3r::GUI::CalibrationCaliPage::on_subtask_abort(), and Slic3r::GUI::MultiTaskItem::onStop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_task_cancel()

int Slic3r::MachineObject::command_task_cancel ( std::string job_id)
1590{
1591 BOOST_LOG_TRIVIAL(trace) << "command_task_cancel: " << job_id;
1592 json j;
1593 j["print"]["command"] = "stop";
1594 j["print"]["param"] = "";
1595 j["print"]["job_id"] = job_id;
1596 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1597
1598 return this->publish_json(j, 1);
1599}

References m_sequence_id, publish_json(), and Slic3r::trace().

Referenced by Slic3r::GUI::MultiTaskItem::onCancel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_task_partskip()

int Slic3r::MachineObject::command_task_partskip ( std::vector< int > part_ids)
1568{
1569 BOOST_LOG_TRIVIAL(trace) << "command_task_partskip: ";
1570 json j;
1571 j["print"]["command"] = "skip_objects";
1572 j["print"]["obj_list"] = part_ids;
1573 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1574
1575 return this->publish_json(j, 1);
1576}

References m_sequence_id, publish_json(), and Slic3r::trace().

Here is the call graph for this function:

◆ command_task_pause()

int Slic3r::MachineObject::command_task_pause ( )
1602{
1603 json j;
1604 j["print"]["command"] = "pause";
1605 j["print"]["param"] = "";
1606 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1607
1608 return this->publish_json(j, 1);
1609}

References m_sequence_id, and publish_json().

Referenced by Slic3r::GUI::CalibrationCaliPage::on_subtask_pause_resume(), and Slic3r::GUI::MultiTaskItem::onPause().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_task_resume()

int Slic3r::MachineObject::command_task_resume ( )
1612{
1613 if(check_resume_condition()) return 0;
1614
1615 json j;
1616 j["print"]["command"] = "resume";
1617 j["print"]["param"] = "";
1618 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1619
1620 return this->publish_json(j, 1);
1621}

References check_resume_condition(), m_sequence_id, and publish_json().

Referenced by Slic3r::GUI::CalibrationCaliPage::on_subtask_pause_resume(), and Slic3r::GUI::MultiTaskItem::onResume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_upgrade_confirm()

int Slic3r::MachineObject::command_upgrade_confirm ( )
1500{
1501 BOOST_LOG_TRIVIAL(info) << "command_upgrade_confirm";
1502 json j;
1503 j["upgrade"]["command"] = "upgrade_confirm";
1504 j["upgrade"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1505 j["upgrade"]["src_id"] = 1; // 1 for slicer
1506 return this->publish_json(j);
1507}

References m_sequence_id, and publish_json().

Referenced by Slic3r::GUI::MachineInfoPanel::confirm_upgrade().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_upgrade_firmware()

int Slic3r::MachineObject::command_upgrade_firmware ( FirmwareInfo info)
1520{
1521 std::string version = info.version;
1522 std::string dst_url = info.url;
1523 std::string module_name = info.module_type;
1524
1525 json j;
1526 j["upgrade"]["command"] = "start";
1527 j["upgrade"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1528 j["upgrade"]["url"] = info.url;
1529 j["upgrade"]["module"] = info.module_type;
1530 j["upgrade"]["version"] = info.version;
1531 j["upgrade"]["src_id"] = 1;
1532
1533 return this->publish_json(j);
1534}

References m_sequence_id, Slic3r::FirmwareInfo::module_type, publish_json(), Slic3r::FirmwareInfo::url, and Slic3r::FirmwareInfo::version.

Here is the call graph for this function:

◆ command_upgrade_module()

int Slic3r::MachineObject::command_upgrade_module ( std::string url,
std::string module_type,
std::string version )
1537{
1538 json j;
1539 j["upgrade"]["command"] = "start";
1540 j["upgrade"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
1541 j["upgrade"]["url"] = url;
1542 j["upgrade"]["module"] = module_type;
1543 j["upgrade"]["version"] = version;
1544 j["upgrade"]["src_id"] = 1;
1545
1546 return this->publish_json(j);
1547}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ command_with_dialog()

int Slic3r::MachineObject::command_with_dialog ( int cmd_result)
private
6146{
6147 if (!m_agent)
6148 return -1;
6150 show_unsupported_dlg(cmd_result);
6151 return cmd_result;
6152}
#define ORCA_NETWORK_ERR_CAP_NOT_AVAILABLE
Definition IPrinterAgent.hpp:11
#define ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED
Definition IPrinterAgent.hpp:10
void show_unsupported_dlg(int code)
Definition DeviceManager.cpp:4774

References m_agent, ORCA_NETWORK_ERR_CAP_NOT_AVAILABLE, ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED, and show_unsupported_dlg().

Referenced by command_ams_calibrate(), command_ams_refresh_rfid(), command_ams_select_tray(), command_auto_leveling(), command_axis_control(), command_go_home(), command_set_bed(), command_set_nozzle(), and command_xyz_abs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_xcam_control()

int Slic3r::MachineObject::command_xcam_control ( std::string module_name,
bool on_off,
std::string lvl = "" )
2301{
2302 json j;
2303 j["xcam"]["command"] = "xcam_control_set";
2304 j["xcam"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2305 j["xcam"]["module_name"] = module_name;
2306 j["xcam"]["control"] = on_off;
2307 j["xcam"]["enable"] = on_off; //old protocol
2308 j["xcam"]["print_halt"] = true; //old protocol
2309 if (!lvl.empty()) {
2310 j["xcam"]["halt_print_sensitivity"] = lvl;
2311 }
2312
2313 // int cfg = 123;
2314 // get_flag_bits(cfg, 11, 2);
2315
2316 BOOST_LOG_TRIVIAL(info) << "command:xcam_control_set" << ", module_name:" << module_name << ", control:" << on_off << ", halt_print_sensitivity:" << lvl;
2317 return this->publish_json(j);
2318}

References m_sequence_id, and publish_json().

Referenced by command_xcam_control_ai_monitoring(), command_xcam_control_airprinting_detection(), command_xcam_control_buildplate_marker_detector(), command_xcam_control_first_layer_inspector(), command_xcam_control_nozzleclumping_detection(), command_xcam_control_purgechutepileup_detection(), and command_xcam_control_spaghetti_detection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_xcam_control_ai_monitoring()

int Slic3r::MachineObject::command_xcam_control_ai_monitoring ( bool on_off,
std::string lvl )
2417{
2418 bool print_halt = (lvl == "never_halt") ? false:true;
2419
2420 xcam_ai_monitoring = on_off;
2421 xcam_ai_monitoring_hold_start = time(nullptr);
2423 return command_xcam_control("printing_monitor", on_off, lvl);
2424}
std::string xcam_ai_monitoring_sensitivity
Definition DeviceManager.hpp:599
bool xcam_ai_monitoring
Definition DeviceManager.hpp:591
int command_xcam_control(std::string module_name, bool on_off, std::string lvl="")
Definition DeviceManager.cpp:2300
time_t xcam_ai_monitoring_hold_start
Definition DeviceManager.hpp:598

References command_xcam_control(), xcam_ai_monitoring, xcam_ai_monitoring_hold_start, and xcam_ai_monitoring_sensitivity.

Here is the call graph for this function:

◆ command_xcam_control_airprinting_detection()

int Slic3r::MachineObject::command_xcam_control_airprinting_detection ( bool on_off,
std::string lvl )
2458{
2459 bool print_halt = (lvl == "never_halt") ? false : true;
2460
2462 xcam_ai_monitoring_hold_start = time(nullptr);
2464 return command_xcam_control("airprint_detector", on_off, lvl);
2465}
bool xcam_airprinting_detection
Definition DeviceManager.hpp:596
std::string xcam_airprinting_detection_sensitivity
Definition DeviceManager.hpp:603

References command_xcam_control(), xcam_ai_monitoring_hold_start, xcam_airprinting_detection, and xcam_airprinting_detection_sensitivity.

Here is the call graph for this function:

◆ command_xcam_control_allow_prompt_sound()

int Slic3r::MachineObject::command_xcam_control_allow_prompt_sound ( bool on_off)
2489{
2490 xcam_allow_prompt_sound = on_off;
2491 xcam_prompt_sound_hold_start = time(nullptr);
2492 return command_set_prompt_sound(on_off);
2493}
bool xcam_allow_prompt_sound
Definition DeviceManager.hpp:608
time_t xcam_prompt_sound_hold_start
Definition DeviceManager.hpp:611
int command_set_prompt_sound(bool prompt_sound)
Definition DeviceManager.cpp:1967

References command_set_prompt_sound(), xcam_allow_prompt_sound, and xcam_prompt_sound_hold_start.

Here is the call graph for this function:

◆ command_xcam_control_auto_recovery_step_loss()

int Slic3r::MachineObject::command_xcam_control_auto_recovery_step_loss ( bool on_off)
2482{
2484 xcam_auto_recovery_hold_start = time(nullptr);
2485 return command_set_printing_option(on_off);
2486}
int command_set_printing_option(bool auto_recovery)
Definition DeviceManager.cpp:1944
time_t xcam_auto_recovery_hold_start
Definition DeviceManager.hpp:610
bool xcam_auto_recovery_step_loss
Definition DeviceManager.hpp:607

References command_set_printing_option(), xcam_auto_recovery_hold_start, and xcam_auto_recovery_step_loss.

Here is the call graph for this function:

◆ command_xcam_control_buildplate_marker_detector()

int Slic3r::MachineObject::command_xcam_control_buildplate_marker_detector ( bool on_off)
2468{
2470 xcam_buildplate_marker_hold_start = time(nullptr);
2471 return command_xcam_control("buildplate_marker_detector", on_off);
2472}
time_t xcam_buildplate_marker_hold_start
Definition DeviceManager.hpp:606
bool xcam_buildplate_marker_detector
Definition DeviceManager.hpp:605

References command_xcam_control(), xcam_buildplate_marker_detector, and xcam_buildplate_marker_hold_start.

Here is the call graph for this function:

◆ command_xcam_control_filament_tangle_detect()

int Slic3r::MachineObject::command_xcam_control_filament_tangle_detect ( bool on_off)
2496{
2500}
bool xcam_filament_tangle_detect
Definition DeviceManager.hpp:609
int command_set_filament_tangle_detect(bool fliament_tangle_detect)
Definition DeviceManager.cpp:1976
time_t xcam_filament_tangle_detect_hold_start
Definition DeviceManager.hpp:612

References command_set_filament_tangle_detect(), xcam_filament_tangle_detect, and xcam_filament_tangle_detect_hold_start.

Here is the call graph for this function:

◆ command_xcam_control_first_layer_inspector()

int Slic3r::MachineObject::command_xcam_control_first_layer_inspector ( bool on_off,
bool print_halt )
2475{
2477 xcam_first_layer_hold_start = time(nullptr);
2478 return command_xcam_control("first_layer_inspector", on_off);
2479}
bool xcam_first_layer_inspector
Definition DeviceManager.hpp:557
time_t xcam_first_layer_hold_start
Definition DeviceManager.hpp:558

References command_xcam_control(), xcam_first_layer_hold_start, and xcam_first_layer_inspector.

Here is the call graph for this function:

◆ command_xcam_control_nozzleclumping_detection()

int Slic3r::MachineObject::command_xcam_control_nozzleclumping_detection ( bool on_off,
std::string lvl )
2448{
2449 bool print_halt = (lvl == "never_halt") ? false : true;
2450
2452 xcam_ai_monitoring_hold_start = time(nullptr);
2454 return command_xcam_control("clump_detector", on_off, lvl);
2455}
bool xcam_nozzleclumping_detection
Definition DeviceManager.hpp:595
std::string xcam_nozzleclumping_detection_sensitivity
Definition DeviceManager.hpp:602

References command_xcam_control(), xcam_ai_monitoring_hold_start, xcam_nozzleclumping_detection, and xcam_nozzleclumping_detection_sensitivity.

Here is the call graph for this function:

◆ command_xcam_control_purgechutepileup_detection()

int Slic3r::MachineObject::command_xcam_control_purgechutepileup_detection ( bool on_off,
std::string lvl )
2438{
2439 bool print_halt = (lvl == "never_halt") ? false : true;
2440
2442 xcam_ai_monitoring_hold_start = time(nullptr);
2444 return command_xcam_control("pileup_detector", on_off, lvl);
2445}
bool xcam_purgechutepileup_detection
Definition DeviceManager.hpp:594
std::string xcam_purgechutepileup_detection_sensitivity
Definition DeviceManager.hpp:601

References command_xcam_control(), xcam_ai_monitoring_hold_start, xcam_purgechutepileup_detection, and xcam_purgechutepileup_detection_sensitivity.

Here is the call graph for this function:

◆ command_xcam_control_spaghetti_detection()

int Slic3r::MachineObject::command_xcam_control_spaghetti_detection ( bool on_off,
std::string lvl )
2428{
2429 bool print_halt = (lvl == "never_halt") ? false : true;
2430
2431 xcam_spaghetti_detection = on_off;
2432 xcam_ai_monitoring_hold_start = time(nullptr);
2434 return command_xcam_control("spaghetti_detector", on_off, lvl);
2435}
bool xcam_spaghetti_detection
Definition DeviceManager.hpp:593
std::string xcam_spaghetti_detection_sensitivity
Definition DeviceManager.hpp:600

References command_xcam_control(), xcam_ai_monitoring_hold_start, xcam_spaghetti_detection, and xcam_spaghetti_detection_sensitivity.

Here is the call graph for this function:

◆ command_xyz_abs()

int Slic3r::MachineObject::command_xyz_abs ( )
1550{
1551 if (!m_agent) return -1;
1553}

References command_with_dialog(), get_dev_id(), is_lan_mode_printer(), m_agent, and m_sequence_id.

Here is the call graph for this function:

◆ commnad_select_pa_calibration()

int Slic3r::MachineObject::commnad_select_pa_calibration ( const PACalibIndexInfo & pa_calib_info)
2198{
2199 json j;
2200 j["print"]["command"] = "extrusion_cali_sel";
2201 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
2202 j["print"]["tray_id"] = pa_calib_info.tray_id;
2203 j["print"]["ams_id"] = pa_calib_info.ams_id;
2204 j["print"]["slot_id"] = pa_calib_info.slot_id;
2205 j["print"]["cali_idx"] = pa_calib_info.cali_idx;
2206 j["print"]["filament_id"] = pa_calib_info.filament_id;
2207 if (pa_calib_info.nozzle_pos_id >= 0) {
2208 j["print"]["nozzle_pos"] = pa_calib_info.nozzle_pos_id;
2209 j["print"]["nozzle_sn"] = pa_calib_info.nozzle_sn;
2210 }
2211 j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(pa_calib_info.nozzle_diameter);
2212
2213 BOOST_LOG_TRIVIAL(info) << "extrusion_cali_sel: " << j.dump();
2214 return this->publish_json(j);
2215}

References Slic3r::PACalibIndexInfo::ams_id, Slic3r::PACalibIndexInfo::cali_idx, Slic3r::PACalibIndexInfo::filament_id, m_sequence_id, Slic3r::PACalibIndexInfo::nozzle_diameter, Slic3r::PACalibIndexInfo::nozzle_pos_id, Slic3r::PACalibIndexInfo::nozzle_sn, publish_json(), Slic3r::PACalibIndexInfo::slot_id, to_string_nozzle_diameter(), and Slic3r::PACalibIndexInfo::tray_id.

Referenced by Slic3r::GUI::CalibUtils::select_PA_calib_result().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connect()

int Slic3r::MachineObject::connect ( )
2686{
2687 if (m_access_revoked || get_dev_ip().empty()) return -1;
2688 std::string username = m_agent ? m_agent->default_lan_username() : std::string();
2689 std::string password = get_access_code();
2690
2691 std::string port;
2692 std::string input = get_dev_ip();
2693
2694 bool use_ssl = input.rfind("https", 0) == 0;
2695
2696 // This strips out the http/https prefix
2697 std::string host = Http::get_host_from_url(input, &port);
2698 std::string ca_file;
2699
2700 if (wxTheApp && GUI::wxGetApp().preset_bundle) {
2701 const auto& config = GUI::wxGetApp().preset_bundle->printers.get_edited_preset().config;
2702 if (port.empty())
2703 port = config.opt_string("printhost_port");
2704 ca_file = config.opt_string("printhost_cafile");
2705
2706 // Refresh credentials from the matching preset for connections that bypass GUI_App::select_machine().
2707 const std::string print_host = config.opt_string("print_host");
2708 if (printer_agent_id == MOONRAKER_PRINTER_AGENT_ID && config.opt_string("printer_agent") == MOONRAKER_PRINTER_AGENT_ID &&
2709 !print_host.empty() && dev_id_from_address(print_host, config.opt_string("printhost_port")) == get_dev_id()) {
2710 password = config.opt_string("printhost_apikey");
2711 use_ssl = boost::istarts_with(print_host, "https://");
2712 if (password != get_access_code())
2713 set_access_code(password);
2714 }
2715 }
2716
2717 if (host.empty())
2718 host = get_dev_ip();
2719
2720 if (m_agent) {
2721 try {
2722 PrinterConnectionParams params{
2723 get_dev_id(),
2724 host,
2725 port,
2726 username,
2727 password,
2728 use_ssl,
2729 ca_file
2730 };
2731 return m_agent->connect_printer(params);
2732 } catch (...) {
2733 ;
2734 }
2735 }
2736 return -1;
2737}
static std::string get_host_from_url(const std::string &url, std::string *port=nullptr)
Definition Http.cpp:1008
void set_access_code(std::string code, bool only_refresh=true)
Definition DeviceManager.cpp:550
bool m_access_revoked
Definition DeviceManager.hpp:122
std::string printer_agent_id
Definition DeviceManager.hpp:248
static std::string dev_id_from_address(const std::string &host, const std::string &port="")
Definition DeviceManager.cpp:495
std::string get_dev_ip() const
Definition DeviceManager.hpp:203
std::string get_access_code() const
Definition DeviceManager.cpp:545
static constexpr char MOONRAKER_PRINTER_AGENT_ID[]
Definition NetworkAgentFactory.hpp:21

References dev_id_from_address(), Slic3r::empty(), get_access_code(), get_dev_id(), get_dev_ip(), Slic3r::Http::get_host_from_url(), m_access_revoked, m_agent, Slic3r::MOONRAKER_PRINTER_AGENT_ID, printer_agent_id, and set_access_code().

Here is the call graph for this function:

◆ connection_type()

std::string Slic3r::MachineObject::connection_type ( ) const
inline

◆ contains_tray()

bool Slic3r::MachineObject::contains_tray ( const std::string & ams_id,
const std::string & tray_id ) const
5282{
5283 if (ams_id != VIRTUAL_AMS_MAIN_ID_STR && ams_id != VIRTUAL_AMS_DEPUTY_ID_STR) {
5284
5285 return m_fila_system->GetAmsTray(ams_id, tray_id) != nullptr;
5286 } else {
5287 for (const auto& tray : vt_slot) {
5288 if (tray.id == ams_id) { return true; }
5289 }
5290 }
5291
5292 return false;
5293}
#define VIRTUAL_AMS_DEPUTY_ID_STR
Definition DevDefs.h:93
#define VIRTUAL_AMS_MAIN_ID_STR
Definition DevDefs.h:92

References m_fila_system, VIRTUAL_AMS_DEPUTY_ID_STR, VIRTUAL_AMS_MAIN_ID_STR, and vt_slot.

Referenced by Slic3r::GUI::_check_kval_not_default(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the caller graph for this function:

◆ dev_id_from_address()

std::string Slic3r::MachineObject::dev_id_from_address ( const std::string & host,
const std::string & port = "" )
static
496{
497 std::string result = host;
498 // Normalize host: strip protocol and path
499 if (result.find("http://") == 0)
500 result = result.substr(7);
501 else if (result.find("https://") == 0)
502 result = result.substr(8);
503 auto slash = result.find('/');
504 if (slash != std::string::npos)
505 result = result.substr(0, slash);
506
507 // Build full address (host:port)
508 if (!port.empty()) {
509 // Strip inline port if present (port comes from printhost_port)
510 auto colon = result.find(':');
511 if (colon != std::string::npos)
512 result = result.substr(0, colon);
513
514 result += ":" + port;
515 }
516 return result;
517}

Referenced by connect(), Slic3r::GUI::GUI_App::select_machine(), and Slic3r::GUI::GUI_App::switch_printer_agent().

Here is the caller graph for this function:

◆ disconnect()

int Slic3r::MachineObject::disconnect ( )
2740{
2741 if (m_agent) {
2742 const int result = m_agent->disconnect_printer();
2743 if (result == 0)
2744 set_online_state(false);
2745 return result;
2746 }
2747 return -1;
2748}
void set_online_state(bool on_off)
Definition DeviceManager.cpp:2773

References m_agent, and set_online_state().

Here is the call graph for this function:

◆ free_slice_info()

void Slic3r::MachineObject::free_slice_info ( )
4939{
4941 {
4942 if (get_slice_info_thread->joinable())
4943 {
4944 get_slice_info_thread->interrupt();
4945 get_slice_info_thread->join();
4946 }
4947
4948 delete get_slice_info_thread;
4949 get_slice_info_thread = nullptr;
4950 }
4951
4952 if (slice_info)
4953 {
4954 delete slice_info;
4955 slice_info = nullptr;
4956 }
4957}
boost::thread * get_slice_info_thread
Definition DeviceManager.hpp:707

References get_slice_info_thread, and slice_info.

Referenced by ~MachineObject().

Here is the caller graph for this function:

◆ get_access_code()

◆ get_agent()

NetworkAgent * Slic3r::MachineObject::get_agent ( ) const
inline
169{ return m_agent; } // Orca: needed by DeviceCore modules (DevAxisCtrl)

References m_agent.

◆ get_ams_colors()

void Slic3r::MachineObject::get_ams_colors ( std::vector< wxColour > & ams_colors)
904 {
905 m_fila_system->CollectAmsColors(ams_colors);
906}

References m_fila_system.

Referenced by Slic3r::GUI::SelectMachineDialog::do_ams_mapping(), and Slic3r::GUI::SyncAmsInfoDialog::do_ams_mapping().

Here is the caller graph for this function:

◆ get_ams_tray()

Slic3r::DevAmsTray * Slic3r::MachineObject::get_ams_tray ( std::string ams_id,
std::string tray_id )
6136{
6137 return m_fila_system->GetAmsTray(ams_id, tray_id);
6138}

References m_fila_system.

◆ get_ams_version()

std::map< int, DevFirmwareVersionInfo > Slic3r::MachineObject::get_ams_version ( )
1002{
1003 std::vector<std::string> multi_tray_ams_type = {"ams", "n3f"};
1004 std::map<int, DevFirmwareVersionInfo> result;
1005 for (int i = 0; i < 8; i++) {
1006 std::string ams_id;
1007 for (auto type : multi_tray_ams_type)
1008 {
1009 ams_id = type + "/" + std::to_string(i);
1010 auto it = module_vers.find(ams_id);
1011 if (it != module_vers.end()) {
1012 result.emplace(std::pair(i, it->second));
1013 }
1014 }
1015 }
1016
1017 std::string single_tray_ams_type = "n3s";
1018 int n3s_start_id = 128;
1019 for (int i = n3s_start_id; i < n3s_start_id + 8; i++) {
1020 std::string ams_id;
1021 ams_id = single_tray_ams_type + "/" + std::to_string(i);
1022 auto it = module_vers.find(ams_id);
1023 if (it != module_vers.end()) {
1024 result.emplace(std::pair(i, it->second));
1025 }
1026 }
1027 return result;
1028}

References module_vers.

Referenced by Slic3r::GUI::MachineInfoPanel::update_ams_ext().

Here is the caller graph for this function:

◆ get_auto_pa_cali_thumbnail_img_str()

std::string Slic3r::MachineObject::get_auto_pa_cali_thumbnail_img_str ( ) const
486{
488}
static std::string get_printer_auto_pa_cali_image(const std::string &type_str)
Definition DevConfigUtil.h:78

References Slic3r::DevPrinterConfigUtil::get_printer_auto_pa_cali_image(), and printer_type.

Here is the call graph for this function:

◆ get_bed_temperature_limit()

int Slic3r::MachineObject::get_bed_temperature_limit ( )
1261{
1263 if (is_220V_voltage)
1264 return 110;
1265 else {
1266 return 120;
1267 }
1268 } else {
1270 return limit;
1271 }
1272 return BED_TEMP_LIMIT;
1273}
@ SERIES_X1
Definition DevDefs.h:35
#define BED_TEMP_LIMIT
Definition DeviceManager.hpp:51
bool is_220V_voltage
Definition DeviceManager.hpp:452
PrinterSeries get_printer_series() const
Definition DeviceManager.cpp:589
int bed_temperature_limit
Definition DeviceManager.hpp:681

References BED_TEMP_LIMIT, bed_temperature_limit, get_printer_series(), is_220V_voltage, and SERIES_X1.

Here is the call graph for this function:

◆ get_bind_str()

std::string Slic3r::MachineObject::get_bind_str ( )
2508{
2509 std::string default_result = "N/A";
2510 if (bind_user_name.compare("null") == 0) {
2511 return "Free";
2512 }
2513 else if (!bind_user_name.empty()) {
2514 return bind_user_name;
2515 }
2516 return default_result;
2517}
std::string bind_user_name
Definition DeviceManager.hpp:276

References bind_user_name.

◆ get_compatible_machine()

std::vector< std::string > Slic3r::MachineObject::get_compatible_machine ( )
2821{
2823}
static std::vector< std::string > get_compatible_machine(std::string type_str)
Definition DevConfigUtil.h:83

References Slic3r::DevPrinterConfigUtil::get_compatible_machine(), and printer_type.

Referenced by Slic3r::DevPrinterConfigUtil::is_printer_model_compatible().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_curr_Ams()

Slic3r::DevAms * Slic3r::MachineObject::get_curr_Ams ( )
6131{
6132 return m_fila_system->GetAmsById(m_extder_system->GetCurrentAmsId());
6133}

References m_extder_system, and m_fila_system.

Referenced by get_curr_tray().

Here is the caller graph for this function:

◆ get_curr_stage()

wxString Slic3r::MachineObject::get_curr_stage ( )
1120{
1121 if (stage_list_info.empty()) {
1122 return "";
1123 }
1125}
int stage_curr
Definition DeviceManager.hpp:518
std::vector< int > stage_list_info
Definition DeviceManager.hpp:517
wxString get_stage_string(int stage)
Definition DeviceManager.cpp:178

References Slic3r::get_stage_string(), stage_curr, and stage_list_info.

Referenced by Slic3r::GUI::CalibrationCaliPage::update_subtask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_curr_stage_idx()

int Slic3r::MachineObject::get_curr_stage_idx ( )
1128{
1129 int result = -1;
1130 for (int i = 0; i < stage_list_info.size(); i++) {
1131 if (stage_list_info[i] == stage_curr) {
1132 return i;
1133 }
1134 }
1135 return -1;
1136}

References stage_curr, and stage_list_info.

Referenced by Slic3r::GUI::CalibrationDialog::update_cali().

Here is the caller graph for this function:

◆ get_curr_tray()

DevAmsTray * Slic3r::MachineObject::get_curr_tray ( )
808{
809 const std::string& cur_ams_id = m_extder_system->GetCurrentAmsId();
810 if (cur_ams_id.compare(std::to_string(VIRTUAL_TRAY_MAIN_ID)) == 0) {
811 return &vt_slot[0];
812 }
813
814 DevAms* curr_ams = get_curr_Ams();
815 if (!curr_ams) return nullptr;
816
817 auto it = curr_ams->GetTrays().find(m_extder_system->GetCurrentSlotId());
818 if (it != curr_ams->GetTrays().end())
819 {
820 return it->second;
821 }
822
823 return nullptr;
824}
DevAms * get_curr_Ams()
Definition DeviceManager.cpp:6130

References get_curr_Ams(), Slic3r::DevAms::GetTrays(), m_extder_system, VIRTUAL_TRAY_MAIN_ID, and vt_slot.

Here is the call graph for this function:

◆ get_dev_id()

std::string Slic3r::MachineObject::get_dev_id ( ) const
inline
206{ return dev_id; }

References dev_id.

Referenced by Slic3r::DevCtrlInfo::DevCtrlInfo(), Slic3r::GUI::MultiMachineItem::MultiMachineItem(), Slic3r::GUI::CalibrationWizard::back_preset_info(), Slic3r::GUI::Sidebar::build_filament_ams_list(), cloud_publish_json(), command_ams_calibrate(), command_ams_refresh_rfid(), command_ams_select_tray(), command_auto_leveling(), command_axis_control(), command_go_home(), command_set_bed(), command_set_nozzle(), command_start_camera(), command_xyz_abs(), connect(), Slic3r::GUI::PartSkipDialog::fetchUrl(), Slic3r::GUI::HMSQuery::get_dev_id_type(), get_firmware_info(), Slic3r::GUI::get_hms_wiki_url(), Slic3r::GUI::Sidebar::priv::get_nozzle_options(), Slic3r::GUI::SendToPrinterDialog::GetConnection(), Slic3r::GUI::SelectMachineDialog::init_bind(), Slic3r::GUI::SelectMachineDialog::is_same_printer_model(), Slic3r::GUI::Sidebar::load_ams_list(), Slic3r::GUI::SelectMachineDialog::load_option_vals(), local_publish_json(), Slic3r::GUI::CalibrationWizard::on_device_connected(), Slic3r::GUI::SendToPrinterDialog::on_ok(), Slic3r::GUI::SelectMachineDialog::on_ok_btn(), Slic3r::GUI::MonitorPanel::on_select_printer(), Slic3r::GUI::SelectMachineDialog::on_selection_changed(), Slic3r::GUI::SendToPrinterDialog::on_selection_changed(), Slic3r::GUI::SelectMachineDialog::on_send_print(), Slic3r::GUI::PrintingTaskPanel::on_stage_clicked(), Slic3r::GUI::GUI_App::on_start_subscribe_again(), Slic3r::DeviceManagerRefresher::on_timer(), Slic3r::DeviceManager::OnMachineBindStateChanged(), Slic3r::GUI::MultiTaskItem::onPause(), Slic3r::GUI::MultiTaskItem::onResume(), Slic3r::GUI::MultiTaskItem::onStop(), parse_json(), Slic3r::GUI::Plater::print_job_finished(), Slic3r::GUI::GUI_App::process_network_msg(), Slic3r::GUI::CalibrationWizard::recover_preset_info(), Slic3r::GUI::SendMultiMachinePage::request_params(), Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list(), Slic3r::GUI::sCheckFilamentInfo(), set_access_code(), Slic3r::GUI::SelectMachineDialog::set_default_from_sdcard(), Slic3r::GUI::MediaPlayCtrl::SetMachineObject(), Slic3r::GUI::GUI_App::switch_printer_agent(), Slic3r::GUI::MultiMachineManagerPage::sync_state(), Slic3r::GUI::CalibrationCaliPage::update(), Slic3r::GUI::MachineInfoPanel::update(), Slic3r::DeviceManager::update_local_machine(), Slic3r::GUI::SelectMachinePopup::update_other_devices(), Slic3r::GUI::SelectMachineDialog::update_show_status(), Slic3r::GUI::Sidebar::priv::update_sync_status(), Slic3r::GUI::SendToPrinterDialog::update_user_printer(), and Slic3r::GUI::MediaFilePanel::UpdateByObj().

◆ get_dev_ip()

◆ get_dev_name()

◆ get_door_open_check_state()

DoorOpenCheckState Slic3r::MachineObject::get_door_open_check_state ( ) const
inline
983{ return xcam_door_open_check;};

References xcam_door_open_check.

◆ get_error_code_str()

std::string Slic3r::MachineObject::get_error_code_str ( int error_code)
static
6079{
6080 if (error_code < 0) { return std::string();}
6081
6082 char buf[32];
6083 ::sprintf(buf, "%08X", error_code);
6084 std::string print_error_str = std::string(buf);
6085 if (print_error_str.size() > 4) { print_error_str.insert(4, "-"); }
6086 return print_error_str;
6087}

Referenced by get_print_error_str().

Here is the caller graph for this function:

◆ get_extruder_id_by_ams_id()

int Slic3r::MachineObject::get_extruder_id_by_ams_id ( const std::string & ams_id)
6116{
6117 return m_fila_system->GetExtruderIdByAmsId(ams_id);
6118}

References m_fila_system.

Referenced by Slic3r::check_filaments_printable(), Slic3r::GUI::SelectMachineDialog::update_show_status(), and Slic3r::GUI::SyncAmsInfoDialog::update_show_status().

Here is the caller graph for this function:

◆ get_filament_display_type()

std::string Slic3r::MachineObject::get_filament_display_type ( const std::string & ams_id,
const std::string & tray_id ) const
834 {
835 return this->get_tray(ams_id, tray_id).get_display_filament_type();
836}
std::string get_display_filament_type() const
Definition DevFilaSystem.cpp:104
DevAmsTray get_tray(const std::string &ams_id, const std::string &tray_id) const
Definition DeviceManager.cpp:5295

References Slic3r::DevAmsTray::get_display_filament_type(), and get_tray().

Here is the call graph for this function:

◆ get_filament_id()

std::string Slic3r::MachineObject::get_filament_id ( std::string ams_id,
std::string tray_id ) const
826 {
827 return this->get_tray(ams_id, tray_id).setting_id;
828}
std::string setting_id
Definition DevFilaSystem.h:61

References get_tray(), and Slic3r::DevAmsTray::setting_id.

Referenced by any_loaded_filament_is_stringing_prone(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_filament_type()

std::string Slic3r::MachineObject::get_filament_type ( const std::string & ams_id,
const std::string & tray_id ) const
830 {
831 return this->get_tray(ams_id, tray_id).get_filament_type();
832}
std::string get_filament_type()
Definition DevFilaSystem.cpp:112

References Slic3r::DevAmsTray::get_filament_type(), and get_tray().

Referenced by Slic3r::GUI::SelectMachineDialog::on_ok_btn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_file_remote()

int Slic3r::MachineObject::get_file_remote ( )
1340{
1341 if (is_support_agora)
1343 return file_remote;
1344}
FileRemote file_remote
Definition DeviceManager.hpp:565
bool is_support_agora
Definition DeviceManager.hpp:649
@ FR_Tutk
Definition PrinterNetworkTypes.hpp:29
@ FR_TutkAgora
Definition PrinterNetworkTypes.hpp:31
@ FR_None
Definition PrinterNetworkTypes.hpp:28
@ FR_Agora
Definition PrinterNetworkTypes.hpp:30

References file_remote, Slic3r::FR_Agora, Slic3r::FR_None, Slic3r::FR_Tutk, Slic3r::FR_TutkAgora, and is_support_agora.

Referenced by Slic3r::GUI::SendToPrinterDialog::GetConnection(), and Slic3r::GUI::MediaFilePanel::UpdateByObj().

Here is the caller graph for this function:

◆ get_firmware_info()

void Slic3r::MachineObject::get_firmware_info ( )
5060{
5061 m_firmware_valid = false;
5063 return;
5064
5065 boost::thread update_info_thread = Slic3r::create_thread(
5066 [&] {
5068 int result = 0;
5069 unsigned int http_code;
5070 std::string http_body;
5071 if (!m_agent) return;
5072 result = m_agent->get_printer_firmware(get_dev_id(), &http_code, &http_body, Slic3r::GUI::wxGetApp().get_printer_cloud_provider());
5073 if (result < 0) {
5074 // get upgrade list failed
5075 return;
5076 }
5077 try {
5078 json j = json::parse(http_body);
5079 if (j.contains("devices") && !j["devices"].is_null()) {
5080 firmware_list.clear();
5081 for (json::iterator it = j["devices"].begin(); it != j["devices"].end(); it++) {
5082 if ((*it)["dev_id"].get<std::string>() == this->get_dev_id()) {
5083 try {
5084 json firmware = (*it)["firmware"];
5085 for (json::iterator firmware_it = firmware.begin(); firmware_it != firmware.end(); firmware_it++) {
5086 FirmwareInfo item;
5087 item.version = (*firmware_it)["version"].get<std::string>();
5088 item.url = (*firmware_it)["url"].get<std::string>();
5089 if ((*firmware_it).contains("description"))
5090 item.description = (*firmware_it)["description"].get<std::string>();
5091 item.module_type = "ota";
5092 int name_start = item.url.find_last_of('/') + 1;
5093 if (name_start > 0) {
5094 item.name = item.url.substr(name_start, item.url.length() - name_start);
5095 firmware_list.push_back(item);
5096 }
5097 else {
5098 BOOST_LOG_TRIVIAL(trace) << "skip";
5099 }
5100 }
5101 }
5102 catch (...) {}
5103 try {
5104 if ((*it).contains("ams")) {
5105 json ams_list = (*it)["ams"];
5106 if (ams_list.size() > 0) {
5107 auto ams_front = ams_list.front();
5108 json firmware_ams = (ams_front)["firmware"];
5109 for (json::iterator ams_it = firmware_ams.begin(); ams_it != firmware_ams.end(); ams_it++) {
5110 FirmwareInfo item;
5111 item.version = (*ams_it)["version"].get<std::string>();
5112 item.url = (*ams_it)["url"].get<std::string>();
5113 if ((*ams_it).contains("description"))
5114 item.description = (*ams_it)["description"].get<std::string>();
5115 item.module_type = "ams";
5116 int name_start = item.url.find_last_of('/') + 1;
5117 if (name_start > 0) {
5118 item.name = item.url.substr(name_start, item.url.length() - name_start);
5119 firmware_list.push_back(item);
5120 }
5121 else {
5122 BOOST_LOG_TRIVIAL(trace) << "skip";
5123 }
5124 }
5125 }
5126 }
5127 }
5128 catch (...) {
5129 ;
5130 }
5131 }
5132 }
5133 }
5134 }
5135 catch (...) {
5136 return;
5137 }
5139 m_firmware_valid = true;
5140 }
5141 );
5142 return;
5143}
bool m_firmware_thread_started
Definition DeviceManager.hpp:927
bool m_firmware_valid
Definition DeviceManager.hpp:926
std::vector< FirmwareInfo > firmware_list
Definition DeviceManager.hpp:433
T * begin(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:838
boost::thread create_thread(boost::thread::attributes &attrs, Fn &&fn)
Definition Thread.hpp:48

References Slic3r::create_thread(), Slic3r::FirmwareInfo::description, firmware_list, get_dev_id(), m_agent, m_firmware_thread_started, m_firmware_valid, Slic3r::FirmwareInfo::module_type, Slic3r::FirmwareInfo::name, Slic3r::trace(), Slic3r::FirmwareInfo::url, and Slic3r::FirmwareInfo::version.

Referenced by Slic3r::GUI::UpgradePanel::refresh_version_and_firmware().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_firmware_type_str()

std::string Slic3r::MachineObject::get_firmware_type_str ( )
909{
910 /*if (firmware_type == PrinterFirmwareType::FIRMWARE_TYPE_ENGINEER)
911 return "engineer";
912 else if (firmware_type == PrinterFirmwareType::FIRMWARE_TYPE_PRODUCTION)
913 return "product";*/
914
915 // return product by default;
916 // always return product, printer do not push this field
917 return "product";
918}

◆ get_flag_bits() [1/2]

int Slic3r::MachineObject::get_flag_bits ( int num,
int start,
int count = 1,
int base = 10 ) const
5745{
5746 try {
5747 unsigned long long mask = (1ULL << count) - 1;
5748 unsigned long long value;
5749 if (base == 10) {
5750 value = static_cast<unsigned long long>(num);
5751 } else if (base == 16) {
5752 value = static_cast<unsigned long long>(std::stoul(std::to_string(num), nullptr, 16));
5753 } else {
5754 throw std::invalid_argument("Unsupported base");
5755 }
5756
5757 int flag = (value >> start) & mask;
5758 return flag;
5759 } catch (...) {
5760 return 0;
5761 }
5762}
static unsigned int count
Definition AuxiliaryDataViewModel.cpp:246

References count.

◆ get_flag_bits() [2/2]

int Slic3r::MachineObject::get_flag_bits ( std::string str,
int start,
int count = 1 ) const
5646{
5647 try {
5648 unsigned long long decimal_value = std::stoull(str, nullptr, 16);
5649 unsigned long long mask = (1ULL << count) - 1;
5650 int flag = (decimal_value >> start) & mask;
5651 return flag;
5652 }
5653 catch (...) {
5654 return 0;
5655 }
5656}

References count.

Referenced by parse_home_flag(), parse_json(), parse_new_info(), and Slic3r::DevBed::ParseV2_0().

Here is the caller graph for this function:

◆ get_flag_bits_no_border()

uint32_t Slic3r::MachineObject::get_flag_bits_no_border ( std::string str,
int start_idx,
int count = 1 ) const
5659{
5660 if (start_idx < 0 || count <= 0) return 0;
5661
5662 try {
5663 // --- 1) trim ---
5664 auto ltrim = [](std::string& s) {
5665 s.erase(s.begin(), std::find_if(s.begin(), s.end(),
5666 [](unsigned char ch) { return !std::isspace(ch); }));
5667 };
5668 auto rtrim = [](std::string& s) {
5669 s.erase(std::find_if(s.rbegin(), s.rend(),
5670 [](unsigned char ch) { return !std::isspace(ch); }).base(), s.end());
5671 };
5672 ltrim(str); rtrim(str);
5673
5674 // --- 2) remove 0x/0X prefix ---
5675 if (str.size() >= 2 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) {
5676 str.erase(0, 2);
5677 }
5678
5679 // --- 3) keep only hex digits ---
5680 std::string hex;
5681 hex.reserve(str.size());
5682 for (char c : str) {
5683 if (std::isxdigit(static_cast<unsigned char>(c))) hex.push_back(c);
5684 }
5685 if (hex.empty()) return 0;
5686
5687 // --- 4) use size_t for all index/bit math ---
5688 const size_t total_bits = hex.size() * 4ULL;
5689
5690 const size_t ustart = static_cast<size_t>(start_idx);
5691 if (ustart >= total_bits) return 0;
5692
5693 const int int_bits = std::numeric_limits<uint32_t>::digits; // typically 32
5694 const size_t need_bits = static_cast<size_t>(std::min(count, int_bits));
5695
5696 // [first_bit, last_bit]
5697 const size_t first_bit = ustart;
5698 const size_t last_bit = std::min(ustart + need_bits, total_bits) - 1ULL;
5699 if (last_bit < first_bit) return 0;
5700
5701
5702 const size_t right_index = hex.size() - 1ULL;
5703
5704 const size_t first_nibble = first_bit / 4ULL;
5705 const size_t last_nibble = last_bit / 4ULL;
5706
5707 const size_t start_idx = right_index - last_nibble;
5708 const size_t end_idx = right_index - first_nibble;
5709 if (end_idx < start_idx) return 0;
5710
5711 const size_t sub_len = end_idx - start_idx + 1ULL;
5712 if (end_idx >= hex.size()) return 0;
5713
5714 const std::string sub_hex = hex.substr(start_idx, sub_len);
5715
5716 unsigned long long chunk = std::stoull(sub_hex, nullptr, 16);
5717
5718 const unsigned nibble_offset = static_cast<unsigned>(first_bit % 4ULL);
5719 const unsigned long long shifted =
5720 (nibble_offset == 0U) ? chunk : (chunk >> nibble_offset);
5721
5722 uint32_t mask;
5723 if (need_bits >= static_cast<size_t>(std::numeric_limits<uint32_t>::digits)) {
5724 mask = std::numeric_limits<uint32_t>::max();
5725 }
5726 else {
5727 mask = static_cast<uint32_t>((1ULL << need_bits) - 1ULL);
5728 }
5729
5730 const uint32_t val = static_cast<uint32_t>(shifted & mask);
5731 return val;
5732 }
5733 catch (const std::invalid_argument&) {
5734 return 0;
5735 }
5736 catch (const std::out_of_range&) {
5737 return 0;
5738 }
5739 catch (...) {
5740 return 0;
5741 }
5742}

References count.

Referenced by Slic3r::DevPrintOptionsParser::Parse(), and parse_new_info().

Here is the caller graph for this function:

◆ get_ftp_folder()

std::string Slic3r::MachineObject::get_ftp_folder ( )
491{
493}
static std::string get_ftp_folder(std::string type_str)
Definition DevConfigUtil.h:81

References Slic3r::DevPrinterConfigUtil::get_ftp_folder(), and printer_type.

Referenced by Slic3r::GUI::SelectMachineDialog::on_send_print(), Slic3r::GUI::SendMultiMachinePage::request_params(), Slic3r::GUI::CalibUtils::send_to_print(), and Slic3r::GUI::CalibUtils::send_to_print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_lan_mode_connection_state()

bool Slic3r::MachineObject::get_lan_mode_connection_state ( )
inline
bool m_lan_mode_connection_state
Definition DeviceManager.hpp:285

References m_lan_mode_connection_state.

Referenced by Slic3r::GUI::SelectMachineDialog::on_selection_changed(), and Slic3r::GUI::SendToPrinterDialog::on_selection_changed().

Here is the caller graph for this function:

◆ get_lifecycle_type_str()

std::string Slic3r::MachineObject::get_lifecycle_type_str ( )
921{
922 /*if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_ENGINEER)
923 return "engineer";
924 else if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_PRODUCTION)
925 return "product";*/
926
927 // return product by default;
928 // always return product, printer do not push this field
929 return "product";
930}

◆ get_liveview_remote()

int Slic3r::MachineObject::get_liveview_remote ( )
1332{
1333 if (is_support_agora) {
1335 }
1336 return liveview_remote;
1337}
LiveviewRemote liveview_remote
Definition DeviceManager.hpp:563
@ LVR_Tutk
Definition PrinterNetworkTypes.hpp:17
@ LVR_Agora
Definition PrinterNetworkTypes.hpp:18
@ LVR_TutkAgora
Definition PrinterNetworkTypes.hpp:19
@ LVR_None
Definition PrinterNetworkTypes.hpp:16

References is_support_agora, liveview_remote, Slic3r::LVR_Agora, Slic3r::LVR_None, Slic3r::LVR_Tutk, and Slic3r::LVR_TutkAgora.

Referenced by Slic3r::GUI::MediaPlayCtrl::SetMachineObject().

Here is the caller graph for this function:

◆ get_max_filament_color_count()

int Slic3r::MachineObject::get_max_filament_color_count ( ) const
5328{
5329 if (is_support_filament_32_colors) return 32;
5330 if (is_enable_ams_np && !is_series_x()) return 20;
5331 if (!is_series_x() && !is_series_o()) return 16;
5332 return 0;
5333}
bool is_series_x() const
Definition DeviceManager.cpp:617
bool is_enable_ams_np
Definition DeviceManager.hpp:933
bool is_support_filament_32_colors
Definition DeviceManager.hpp:934
bool is_series_o() const
Definition DeviceManager.cpp:618

References is_enable_ams_np, is_series_o(), is_series_x(), and is_support_filament_32_colors.

Referenced by Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_modeltask()

BBLModelTask * Slic3r::MachineObject::get_modeltask ( )
4832{
4833 return model_task;
4834}

References model_task.

Referenced by Slic3r::GUI::CalibrationCaliPage::update_subtask().

Here is the caller graph for this function:

◆ get_nozzle_mapping_result()

◆ get_nozzle_replace_url()

wxString Slic3r::MachineObject::get_nozzle_replace_url ( ) const
nodiscard
6060{
6061 const wxString& strLanguage = GUI::wxGetApp().app_config->get("language");
6062 const wxString& lan_code = strLanguage.BeforeFirst('_');
6063
6064 const json& link_map = DevPrinterConfigUtil::get_json_from_config(printer_type, "print", "nozzle_replace_wiki");
6065 if (link_map.contains(lan_code.ToStdString())) {
6066 return link_map[lan_code.ToStdString()].get<wxString>();
6067 }
6068
6069 if (link_map.contains("en")){
6070 return link_map["en"].get<wxString>();
6071 }/*retry with en*/
6072
6073 // Orca: no neutral wiki equivalent for this fallback — return empty so the caller hides the link
6074 // (PrinterPartsDialog::OnWikiClicked reports "No wiki link available" instead of opening a browser)
6075 return wxEmptyString;
6076}
static nlohmann::json get_json_from_config(const std::string &type_str, const std::string &key1, const std::string &key2=std::string())
Definition DevConfigUtil.h:179

References Slic3r::DevPrinterConfigUtil::get_json_from_config(), and printer_type.

Here is the call graph for this function:

◆ get_ota_version()

std::string Slic3r::MachineObject::get_ota_version ( )
956{
957 auto it = module_vers.find("ota");
958 if (it != module_vers.end()) {
959 //double check name
960 if (it->second.name == "ota") {
961 return it->second.sw_ver;
962 }
963 }
964 return "";
965}

References module_vers.

Referenced by Slic3r::GUI::PartSkipDialog::fetchUrl(), Slic3r::GUI::SendToPrinterDialog::GetConnection(), Slic3r::GUI::SelectMachineDialog::on_send_print(), Slic3r::anonymous_namespace{PluginHostApp.cpp}::selected_printer(), Slic3r::GUI::MediaPlayCtrl::SetMachineObject(), and Slic3r::GUI::MediaFilePanel::UpdateByObj().

Here is the caller graph for this function:

◆ get_preset_extruder_index()

int Slic3r::MachineObject::get_preset_extruder_index ( int extder_id) const
inline
353{ return is_multi_extruders() ? (is_main_extruder_on_left() ? extder_id : 1 - extder_id) : 0; }
bool is_multi_extruders() const
Definition DeviceManager.cpp:6110
bool is_main_extruder_on_left() const
Definition DeviceManager.hpp:349

References is_main_extruder_on_left(), and is_multi_extruders().

Referenced by check_ams_filament_valid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_print_error_str()

std::string Slic3r::MachineObject::get_print_error_str ( ) const
inline
static std::string get_error_code_str(int error_code)
Definition DeviceManager.cpp:6078

References get_error_code_str().

Here is the call graph for this function:

◆ get_printer_ams_type()

std::string Slic3r::MachineObject::get_printer_ams_type ( ) const
606{
608}
static std::string get_printer_use_ams_type(std::string type_str)
Definition DevConfigUtil.h:87

References Slic3r::DevPrinterConfigUtil::get_printer_use_ams_type(), and printer_type.

Referenced by Slic3r::DevFilaSystemParser::ParseV1_0().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_printer_arch()

PrinterArch Slic3r::MachineObject::get_printer_arch ( ) const
601{
603}
static PrinterArch get_printer_arch(std::string type_str)
Definition DevConfigUtil.cpp:126

References Slic3r::DevPrinterConfigUtil::get_printer_arch(), and printer_type.

Referenced by is_core_xy(), Slic3r::GUI::CalibrationPAStartPage::on_device_connected(), and Slic3r::GUI::SelectMachineDialog::update_select_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_printer_series()

PrinterSeries Slic3r::MachineObject::get_printer_series ( ) const
590{
592 if (series == "series_x1" || series == "series_o")
594 else if (series == "series_p1p")
596 else
598}
@ SERIES_P1P
Definition DevDefs.h:36
static std::string get_printer_series_str(std::string type_str)
Definition DevConfigUtil.h:72

References Slic3r::DevPrinterConfigUtil::get_printer_series_str(), printer_type, SERIES_P1P, and SERIES_X1.

Referenced by get_bed_temperature_limit(), Slic3r::GUI::get_cali_filament_mode(), Slic3r::GUI::get_cali_style(), Slic3r::GUI::get_obj_calibration_mode(), is_camera_busy_off(), is_support_command_calibration(), Slic3r::GUI::CalibrationPresetPage::need_check_sdcard(), Slic3r::GUI::CalibrationFlowRateStartPage::on_device_connected(), Slic3r::GUI::CalibrationPAStartPage::on_device_connected(), and parse_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_printer_series_str()

std::string Slic3r::MachineObject::get_printer_series_str ( ) const

References Slic3r::DevPrinterConfigUtil::get_printer_series_str(), and printer_type.

Here is the call graph for this function:

◆ get_printer_thumbnail_img_str()

std::string Slic3r::MachineObject::get_printer_thumbnail_img_str ( ) const
461{
463 std::string img_url;
464
465 if (!img_str.empty())
466 {
467 img_url = Slic3r::resources_dir() + "\\images\\" + img_str ;
468 if (fs::exists(img_url + ".svg"))
469 {
470 return img_url;
471 }
472 else
473 {
474 img_url = img_str;
475 }
476 }
477 else
478 {
479 img_url = "printer_thumbnail";
480 }
481
482 return img_url;
483}
static std::string get_printer_thumbnail_img(const std::string &type_str)
Definition DevConfigUtil.h:76
const std::string & resources_dir()
Definition utils.cpp:296

References Slic3r::DevPrinterConfigUtil::get_printer_thumbnail_img(), printer_type, and Slic3r::resources_dir().

Referenced by Slic3r::GUI::MachineInfoPanel::update_printer_imgs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_printer_type_display_str()

wxString Slic3r::MachineObject::get_printer_type_display_str ( ) const
438{
440
441 // Bambu printers use m_resource_file_path + "/printers/" + type_str + ".json", which is a semantic that only works for their profiles.
442 // For any other profile, we can simply consult preset bundle if the model_id exists.
443 if (display_name.empty()) {
444 for (const auto& [vendor_id, vendor] : GUI::wxGetApp().preset_bundle->vendors) {
445 for (const auto& model : vendor.models) {
446 if (printer_type == model.model_id)
447 display_name = model.name;
448 }
449 }
450 }
451
452 if (!display_name.empty())
453 return display_name;
454 else if (printer_type == "orcasonar")
455 return "OrcaSonar Printer";
456 else
457 return _L("Unknown");
458}

References _L, Slic3r::DevPrinterConfigUtil::get_printer_display_name(), and printer_type.

Referenced by Slic3r::GUI::_get_tips(), Slic3r::GUI::SelectMachineDialog::show_status(), Slic3r::GUI::SyncAmsInfoDialog::show_status(), and Slic3r::GUI::MachineInfoPanel::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_resolution_supported()

std::vector< std::string > Slic3r::MachineObject::get_resolution_supported ( )
2816{
2818}
std::vector< std::string > camera_resolution_supported
Definition DeviceManager.hpp:556

References camera_resolution_supported.

◆ get_save_remote_print_file_to_storage()

bool Slic3r::MachineObject::get_save_remote_print_file_to_storage ( ) const
inline

References xcam__save_remote_print_file_to_storage.

Referenced by command_set_save_remote_print_file_to_storage().

Here is the caller graph for this function:

◆ get_show_printer_type()

std::string Slic3r::MachineObject::get_show_printer_type ( ) const

◆ get_stage_remaining_seconds()

int Slic3r::MachineObject::get_stage_remaining_seconds ( ) const
inline
530{ return stage_remaining_seconds; }
int stage_remaining_seconds
Definition DeviceManager.hpp:519

References stage_remaining_seconds.

Referenced by Slic3r::GUI::ThermalPreconditioningDialog::update_thermal_remaining_time().

Here is the caller graph for this function:

◆ get_subtask()

BBLSubTask * Slic3r::MachineObject::get_subtask ( )
4825{
4826 if (!subtask_)
4827 subtask_ = new BBLSubTask(nullptr);
4828 return subtask_;
4829}

References subtask_.

Referenced by parse_json(), and update_print_progress().

Here is the caller graph for this function:

◆ get_tray()

DevAmsTray Slic3r::MachineObject::get_tray ( const std::string & ams_id,
const std::string & tray_id ) const
5296{
5297 if (ams_id.empty() && tray_id.empty())
5298 {
5299 return DevAmsTray(tray_id);
5300 }
5301
5302 if (ams_id != VIRTUAL_AMS_MAIN_ID_STR && ams_id != VIRTUAL_AMS_DEPUTY_ID_STR) {
5303 auto tray = m_fila_system->GetAmsTray(ams_id, tray_id);
5304 if (tray) { return *tray;};
5305 }
5306 else {
5307 for (const auto &tray : vt_slot) {
5308 if (tray.id == ams_id) { return tray; }
5309 }
5310 }
5311
5312 assert(0);/*use contains_tray() check first*/
5313 return DevAmsTray(tray_id);
5314}

References m_fila_system, VIRTUAL_AMS_DEPUTY_ID_STR, VIRTUAL_AMS_MAIN_ID_STR, and vt_slot.

Referenced by Slic3r::GUI::_check_kval_not_default(), get_filament_display_type(), get_filament_id(), get_filament_type(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the caller graph for this function:

◆ get_upgrade_percent()

int Slic3r::MachineObject::get_upgrade_percent ( ) const
943{
944 if (upgrade_progress.empty())
945 return 0;
946 try {
947 int result = atoi(upgrade_progress.c_str());
948 return result;
949 } catch(...) {
950 ;
951 }
952 return 0;
953}
std::string upgrade_progress
Definition DeviceManager.hpp:412

References upgrade_progress.

Referenced by Slic3r::GUI::MachineInfoPanel::update(), and Slic3r::GUI::AMSSettingTypePanel::UpdateInfo().

Here is the caller graph for this function:

◆ get_upgrade_result_str()

wxString Slic3r::MachineObject::get_upgrade_result_str ( int upgrade_err_code)
983{
984 switch(err_code) {
985 case UpgradeNoError:
986 return _L("Update successful.");
988 return _L("Downloading failed.");
990 return _L("Verification failed.");
992 return _L("Update failed.");
993 case UpgradePrinting:
994 return _L("Update failed.");
995 default:
996 return _L("Update failed.");
997 }
998 return "";
999}
#define UpgradeVerfifyFailed
Definition DevUpgrade.cpp:121
#define UpgradePrinting
Definition DevUpgrade.cpp:123
#define UpgradeFlashFailed
Definition DevUpgrade.cpp:122
#define UpgradeDownloadFailed
Definition DevUpgrade.cpp:120
#define UpgradeNoError
Definition DevUpgrade.cpp:119

References _L, UpgradeDownloadFailed, UpgradeFlashFailed, UpgradeNoError, UpgradePrinting, and UpgradeVerfifyFailed.

Referenced by Slic3r::GUI::MachineInfoPanel::update().

Here is the caller graph for this function:

◆ GetAxis()

std::shared_ptr< DevAxis > Slic3r::MachineObject::GetAxis ( ) const
inline
176{ return m_axis; }

References m_axis.

◆ GetBed()

DevBed * Slic3r::MachineObject::GetBed ( ) const
inline
394{ return m_bed; };

References m_bed.

◆ GetCalib()

DevCalib * Slic3r::MachineObject::GetCalib ( ) const
inline
178{ return m_calib; }

References m_calib.

◆ GetChamber()

std::shared_ptr< DevChamber > Slic3r::MachineObject::GetChamber ( ) const
inline
177{ return m_chamber; }

References m_chamber.

◆ GetConfig()

◆ GetCtrl()

DevCtrl * Slic3r::MachineObject::GetCtrl ( ) const
inline
397{ return m_ctrl; } /* ctrl*/

References m_ctrl.

◆ GetExtderSystem()

DevExtderSystem * Slic3r::MachineObject::GetExtderSystem ( ) const
inline
379{ return m_extder_system; }

References m_extder_system.

Referenced by Slic3r::GUI::NewCalibrationHistoryDialog::NewCalibrationHistoryDialog(), Slic3r::GUI::_get_tips(), Slic3r::GUI::Plater::priv::check_ams_status_impl(), Slic3r::GUI::check_nozzle_diameter_and_type(), Slic3r::GUI::CalibUtils::check_printable_status_before_cali(), Slic3r::GUI::CalibUtils::check_printable_status_before_cali(), Slic3r::GUI::Plater::check_printer_initialized(), Slic3r::GUI::SelectMachineDialog::CheckErrorExtruderNozzleWithSlicing(), Slic3r::GUI::SelectMachineDialog::CheckWarningFilamentCrossExtruder(), Slic3r::GUI::SelectMachineDialog::do_ams_mapping(), Slic3r::GUI::NewCalibrationHistoryDialog::get_all_filaments(), Slic3r::GUI::SelectMachineDialog::get_mapped_nozzles(), Slic3r::GUI::get_printer_preset(), Slic3r::GUI::CalibrationCaliPage::get_selected_calibration_nozzle_dia(), Slic3r::DevNozzle::GetTotalExtruderCount(), Slic3r::GUI::CalibrationPresetPage::init_with_machine(), Slic3r::GUI::is_same_nozzle_type(), Slic3r::GUI::SyncAmsInfoDialog::is_same_nozzle_type(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::SelectMachineDialog::on_timer(), Slic3r::GUI::SyncAmsInfoDialog::on_timer(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), Slic3r::GUI::AmsMapingPopup::update(), Slic3r::GUI::CalibrationCaliPage::update(), Slic3r::GUI::PressureAdvanceWizard::update(), Slic3r::GUI::SelectMachineDialog::update_filament_change_count(), Slic3r::GUI::AMSDryCtrWin::update_filament_list(), Slic3r::GUI::AmsReplaceMaterialDialog::update_machine_obj(), Slic3r::GUI::SelectMachineDialog::update_material_item_pos(), Slic3r::GUI::AMSDryCtrWin::update_printer_state(), Slic3r::GUI::SelectMachineDialog::update_show_status(), Slic3r::GUI::SyncAmsInfoDialog::update_show_status(), Slic3r::GUI::Sidebar::priv::update_sync_status(), and Slic3r::GUI::ExtruderSwithingStatus::updateBy().

Here is the caller graph for this function:

◆ GetExtensionTool()

std::weak_ptr< DevExtensionTool > Slic3r::MachineObject::GetExtensionTool ( ) const
inline
380{ return m_extension_tool; }

References m_extension_tool.

Referenced by Slic3r::GUI::SelectMachineDialog::UpdateStatusCheckWarning_ExtensionTool().

Here is the caller graph for this function:

◆ GetFan()

DevFan * Slic3r::MachineObject::GetFan ( ) const
inline
393{ return m_fan; }

References m_fan.

Referenced by Slic3r::GUI::FanControlPopupNew::update_fan_data(), and Slic3r::GUI::PrintOptionsDialog::update_purify_air_at_print_end().

Here is the caller graph for this function:

◆ GetFilaSwitch()

◆ GetFilaSystem()

std::shared_ptr< DevFilaSystem > Slic3r::MachineObject::GetFilaSystem ( ) const
inline
388{ return m_fila_system;}

References m_fila_system.

Referenced by Slic3r::_get_filament_name_from_ams(), Slic3r::DevMappingUtil::ams_filament_mapping(), Slic3r::MoonrakerPrinterAgent::build_ams_payload(), Slic3r::GUI::Sidebar::build_filament_ams_list(), Slic3r::GUI::ReselectMachineDialog::CaculateSwitcherDistribution(), Slic3r::GUI::FeedDirectionDialog::calcTrayName(), Slic3r::GUI::Plater::priv::check_ams_status_impl(), Slic3r::GUI::SyncAmsInfoDialog::deal_only_exist_ext_spool(), Slic3r::GUI::SelectMachineDialog::do_ams_mapping(), Slic3r::DevCalib::ExtrusionCalibGetResultParse(), Slic3r::DevCalib::ExtrusionCalibSelectParse(), Slic3r::DevCalib::ExtrusionCalibSetParse(), Slic3r::GUI::SelectMachineDialog::get_filament_change_gap_time(), Slic3r::GUI::SelectMachineDialog::get_filament_suggest_pos(), Slic3r::DevExtderSystem::GetBackupAmsSlotInGroup(), Slic3r::GUI::ReselectMachineDialog::getTrayID(), Slic3r::GUI::SelectMachineDialog::is_ams_drying(), Slic3r::GUI::SelectMachineDialog::is_at_suggested_pos(), Slic3r::GUI::SelectMachineDialog::is_selected_ams_drying(), Slic3r::DevMappingUtil::is_valid_mapping_result(), Slic3r::GUI::SelectMachineDialog::on_ok_btn(), Slic3r::GUI::SelectMachineDialog::on_timer(), Slic3r::GUI::SyncAmsInfoDialog::on_timer(), Slic3r::GUI::AMSControl::parse_object(), Slic3r::GUI::sCheckFilamentInfo(), Slic3r::GUI::FilamentLoad::SetupSteps(), Slic3r::GUI::ExtruderGroup::sync_ams(), Slic3r::GUI::CalibrationPresetPage::sync_ams_info(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), Slic3r::GUI::AmsMapingPopup::update(), Slic3r::GUI::TrayListModel::update(), Slic3r::GUI::MachineInfoPanel::update_ams_ext(), Slic3r::GUI::AMSSetting::update_ams_img(), Slic3r::GUI::AMSDryCtrWin::update_filament_list(), Slic3r::GUI::AMSSetting::update_insert_material_read_mode(), Slic3r::GUI::AmsMapingPopup::update_mapping_items(), Slic3r::GUI::SelectMachineDialog::update_show_status(), Slic3r::GUI::Sidebar::priv::update_sync_status(), Slic3r::GUI::AMSControl::UpdateAmsDryControl(), Slic3r::GUI::AMSSetting::UpdateByObj(), Slic3r::GUI::AMSSettingTypePanel::UpdateInfo(), and Slic3r::GUI::ReselectMachineDialog::UpdateInfo().

Here is the caller graph for this function:

◆ GetHMS()

DevHMS * Slic3r::MachineObject::GetHMS ( ) const
inline
398{ return m_hms_system; } /* hms*/

References m_hms_system.

◆ GetLamp()

DevLamp * Slic3r::MachineObject::GetLamp ( ) const
inline
392{ return m_lamp; }

References m_lamp.

◆ GetNozzleSystem()

DevNozzleSystem * Slic3r::MachineObject::GetNozzleSystem ( ) const
inline

◆ GetPrintingSpeedLevel()

Slic3r::DevPrintingSpeedLevel Slic3r::MachineObject::GetPrintingSpeedLevel ( ) const
6121{
6122 return m_print_options->GetPrintingSpeedLevel();
6123}

References m_print_options.

◆ GetPrintOptions()

DevPrintOptions * Slic3r::MachineObject::GetPrintOptions ( ) const
inline
401{ return m_print_options; } /* print options */

References m_print_options.

Referenced by Slic3r::GUI::SelectMachineDialog::CheckWarningSmartNozzleBlobAuto(), Slic3r::GUI::PrintOptionsDialog::update_options(), Slic3r::GUI::PrintOptionsDialog::update_purify_air_at_print_end(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the caller graph for this function:

◆ GetStatus()

DevStatus * Slic3r::MachineObject::GetStatus ( ) const
inline
179{ return m_status; }

References m_status.

◆ GetStorage()

◆ GetUpgrade()

std::weak_ptr< DevUpgrade > Slic3r::MachineObject::GetUpgrade ( ) const
inline
180{ return m_upgrade; }

References m_upgrade.

◆ has_access_right()

bool Slic3r::MachineObject::has_access_right ( ) const
534{
536}

References get_access_code(), m_access_revoked, Slic3r::MOONRAKER_PRINTER_AGENT_ID, and printer_agent_id.

Referenced by Slic3r::DeviceManager::load_local_machines_from_config(), Slic3r::GUI::GUI_App::select_machine(), set_access_code(), Slic3r::GUI::SyncAmsInfoDialog::update_lan_machine_list(), Slic3r::DeviceManager::update_local_machine(), Slic3r::GUI::SelectMachinePopup::update_other_devices(), and Slic3r::GUI::SyncAmsInfoDialog::update_user_printer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasAms()

bool Slic3r::MachineObject::HasAms ( ) const
6141{
6142 return m_fila_system->HasAms();
6143}

References m_fila_system.

Referenced by can_unload_filament(), Slic3r::GUI::SelectMachineDialog::do_ams_mapping(), Slic3r::GUI::SelectMachineDialog::on_send_print(), Slic3r::GUI::CalibrationPresetPage::sync_ams_info(), and Slic3r::GUI::SelectMachineDialog::update_ams_check().

Here is the caller graph for this function:

◆ HasRecentCloudMessage()

bool Slic3r::MachineObject::HasRecentCloudMessage ( )
520{
521 auto curr_time = std::chrono::system_clock::now();
522 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_cloud_msg_time_);
523 return diff.count() < 5000;
524}
std::chrono::system_clock::time_point last_cloud_msg_time_
Definition DeviceManager.hpp:224

References Slic3r::diff(), and last_cloud_msg_time_.

Here is the call graph for this function:

◆ HasRecentLanMessage()

bool Slic3r::MachineObject::HasRecentLanMessage ( )
527{
528 auto curr_time = std::chrono::system_clock::now();
529 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_lan_msg_time_);
530 return diff.count() < 5000;
531}
std::chrono::system_clock::time_point last_lan_msg_time_
Definition DeviceManager.hpp:225

References Slic3r::diff(), and last_lan_msg_time_.

Here is the call graph for this function:

◆ is_avaliable()

bool Slic3r::MachineObject::is_avaliable ( )
inline
281{ return bind_state == "free"; }
std::string bind_state
Definition DeviceManager.hpp:280

References bind_state.

Referenced by Slic3r::GUI::SyncAmsInfoDialog::update_lan_machine_list(), Slic3r::GUI::SelectMachinePopup::update_other_devices(), and Slic3r::GUI::SyncAmsInfoDialog::update_user_printer().

Here is the caller graph for this function:

◆ is_axis_at_home()

bool Slic3r::MachineObject::is_axis_at_home ( std::string axis)
1093{
1094 if (m_home_flag == 0) { return true; }
1095
1096 if (axis == "X") {
1097 return (m_home_flag & 1) == 1;
1098 } else if (axis == "Y") {
1099 return ((m_home_flag >> 1) & 1) == 1;
1100 } else if (axis == "Z") {
1101 return ((m_home_flag >> 2) & 1) == 1;
1102 }
1103
1104 return true;
1105}
int m_home_flag
Definition DeviceManager.hpp:461

References m_home_flag.

◆ is_calibration_done()

bool Slic3r::MachineObject::is_calibration_done ( )
1154{
1155 return calibration_done;
1156}
bool calibration_done
Definition DeviceManager.hpp:522

References calibration_done.

Referenced by Slic3r::GUI::CalibrationDialog::update_cali().

Here is the caller graph for this function:

◆ is_calibration_running()

bool Slic3r::MachineObject::is_calibration_running ( )
1159{
1161 return true;
1162 return false;
1163}
bool is_in_calibration()
Definition DeviceManager.cpp:1138

References is_in_calibration(), is_in_printing_status(), and print_status.

Referenced by Slic3r::GUI::CalibrationDialog::update_cali().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_camera_busy_off()

bool Slic3r::MachineObject::is_camera_busy_off ( )
2826{
2828 return is_in_prepare() || is_in_upgrading();
2829 return false;
2830}
bool is_in_upgrading() const
Definition DeviceManager.cpp:932
bool is_in_prepare()
Definition DeviceManager.cpp:2572

References get_printer_series(), is_in_prepare(), is_in_upgrading(), and SERIES_P1P.

Referenced by Slic3r::GUI::SendToPrinterDialog::GetConnection(), Slic3r::GUI::MediaPlayCtrl::SetMachineObject(), and Slic3r::GUI::MediaFilePanel::UpdateByObj().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_cloud_mode_printer()

bool Slic3r::MachineObject::is_cloud_mode_printer ( ) const
inline
222{ return dev_connection_type == "cloud"; }

References dev_connection_type.

◆ is_connected()

bool Slic3r::MachineObject::is_connected ( )
2751{
2752 std::chrono::system_clock::time_point curr_time = std::chrono::system_clock::now();
2753 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_update_time);
2754 if (diff.count() > DISCONNECT_TIMEOUT) {
2755 BOOST_LOG_TRIVIAL(trace) << "machine_object: dev_id=" << dev_id <<", diff count = " << diff.count();
2756 return false;
2757 }
2758
2759 if (!is_lan_mode_printer()) {
2760 NetworkAgent* m_agent = Slic3r::GUI::wxGetApp().getAgent();
2761 if (m_agent) {
2762 return m_agent->is_server_connected(Slic3r::GUI::wxGetApp().get_printer_cloud_provider());
2763 }
2764 }
2765 return true;
2766}
#define DISCONNECT_TIMEOUT
Definition DeviceManager.hpp:42
std::chrono::system_clock::time_point last_update_time
Definition DeviceManager.hpp:294

References dev_id, Slic3r::diff(), DISCONNECT_TIMEOUT, is_lan_mode_printer(), last_update_time, m_agent, and Slic3r::trace().

Referenced by Slic3r::GUI::_collect_sorted_machines(), is_connecting(), Slic3r::GUI::SelectMachineDialog::on_send_print(), Slic3r::anonymous_namespace{PluginHostApp.cpp}::selected_printer(), Slic3r::GUI::CalibrationCaliPage::update(), Slic3r::GUI::MachineInfoPanel::update(), Slic3r::GUI::CalibrationPresetPage::update_show_status(), and Slic3r::GUI::SideTools::update_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_connecting()

bool Slic3r::MachineObject::is_connecting ( )
2769{
2770 return is_connected() && m_push_count == 0;
2771}
bool is_connected()
Definition DeviceManager.cpp:2750
int m_push_count
Definition DeviceManager.hpp:520

References is_connected(), and m_push_count.

Referenced by Slic3r::GUI::GUI_App::on_start_subscribe_again(), Slic3r::GUI::CalibrationCaliPage::update(), Slic3r::GUI::CalibrationPresetPage::update_show_status(), and Slic3r::GUI::SideTools::update_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_core_xy()

bool Slic3r::MachineObject::is_core_xy ( )
2592{
2594 return true;
2595 return false;
2596}
@ ARCH_CORE_XY
Definition DevDefs.h:29
PrinterArch get_printer_arch() const
Definition DeviceManager.cpp:600

References ARCH_CORE_XY, and get_printer_arch().

Referenced by command_axis_control().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_extrusion_cali_finished()

bool Slic3r::MachineObject::is_extrusion_cali_finished ( )
792{
793 auto curr_time = std::chrono::system_clock::now();
794 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_extrusion_cali_start_time);
795 if (diff.count() < EXTRUSION_OMIT_TIME) {
796 return false;
797 }
798
799 if (boost::contains(m_gcode_file, "extrusion_cali")
800 && this->mc_print_percent == 100)
801 return true;
802 else
803 return false;
804}
#define EXTRUSION_OMIT_TIME
Definition DeviceManager.hpp:48
std::string m_gcode_file
Definition DeviceManager.hpp:727

References Slic3r::diff(), EXTRUSION_OMIT_TIME, last_extrusion_cali_start_time, m_gcode_file, and mc_print_percent.

Here is the call graph for this function:

◆ is_fdm_type()

bool Slic3r::MachineObject::is_fdm_type ( ) const
inline
724{ return m_device_mode == DEVICE_MODE_FDM; }
DeviceMode m_device_mode
Definition DeviceManager.hpp:723

References DEVICE_MODE_FDM, and m_device_mode.

Referenced by Slic3r::GUI::SelectMachineDialog::update_show_status(), and Slic3r::GUI::AMSControl::UpdateAms().

Here is the caller graph for this function:

◆ is_filament_at_extruder()

bool Slic3r::MachineObject::is_filament_at_extruder ( )
1108{
1109 if (hw_switch_state == 1)
1110 return true;
1111 else if (hw_switch_state == 0)
1112 return false;
1113 else {
1114 //default
1115 return true;
1116 }
1117}

References hw_switch_state.

◆ is_filament_installed()

bool Slic3r::MachineObject::is_filament_installed ( )
1276{
1277 if (m_extder_system->GetTotalExtderCount() > 0) {
1278 // right//or single
1279 auto ext = m_extder_system->m_extders[MAIN_EXTRUDER_ID];
1280 if (ext.m_ext_has_filament) {
1281 return true;
1282 }
1283 }
1284 /*left*/
1285 if (m_extder_system->GetTotalExtderCount() > 1) {
1286 auto ext = m_extder_system->m_extders[DEPUTY_EXTRUDER_ID];
1287 if (ext.m_ext_has_filament) {
1288 return true;
1289 }
1290 }
1291 return false;
1292}
#define DEPUTY_EXTRUDER_ID
Definition DevDefs.h:102

References DEPUTY_EXTRUDER_ID, m_extder_system, and MAIN_EXTRUDER_ID.

◆ is_firmware_info_valid()

bool Slic3r::MachineObject::is_firmware_info_valid ( )
5146{
5147 return m_firmware_valid;
5148}

References m_firmware_valid.

◆ is_in_calibration()

bool Slic3r::MachineObject::is_in_calibration ( )
1139{
1140 // gcode file: auto_cali_for_user.gcode or auto_cali_for_user_param
1141 if (boost::contains(m_gcode_file, "auto_cali_for_user")
1142 && stage_curr != 0) {
1143 return true;
1144 } else {
1145 // reset
1146 if (stage_curr != 0) {
1147 calibration_done = false;
1148 }
1149 }
1150 return false;
1151}

References calibration_done, m_gcode_file, and stage_curr.

Referenced by is_calibration_running(), is_system_printing(), and Slic3r::GUI::CalibrationCaliPage::update_subtask().

Here is the caller graph for this function:

◆ is_in_extrusion_cali()

bool Slic3r::MachineObject::is_in_extrusion_cali ( )
773{
774 auto curr_time = std::chrono::system_clock::now();
775 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_extrusion_cali_start_time);
776 if (diff.count() < EXTRUSION_OMIT_TIME) {
778 return true;
779 }
780
782 && print_type == "system"
783 && boost::contains(m_gcode_file, "extrusion_cali")
784 )
785 {
786 return true;
787 }
788 return false;
789}
std::string print_type
Definition DeviceManager.hpp:450

References Slic3r::diff(), EXTRUSION_OMIT_TIME, is_in_printing_status(), last_extrusion_cali_start_time, m_gcode_file, mc_print_percent, print_status, and print_type.

Referenced by command_stop_extrusion_cali().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_in_prepare()

bool Slic3r::MachineObject::is_in_prepare ( )
2573{
2574 return print_status == "PREPARE";
2575}

References print_status.

Referenced by is_camera_busy_off(), and Slic3r::GUI::CalibrationCaliPage::update_subtask().

Here is the caller graph for this function:

◆ is_in_printing()

bool Slic3r::MachineObject::is_in_printing ( )

◆ is_in_printing_pause()

bool Slic3r::MachineObject::is_in_printing_pause ( ) const
2578{
2579 return print_status == "PAUSE";
2580}

References print_status.

◆ is_in_printing_status()

bool Slic3r::MachineObject::is_in_printing_status ( std::string status)
static
2550{
2551 if (status.compare("PAUSE") == 0
2552 || status.compare("RUNNING") == 0
2553 || status.compare("SLICING") == 0
2554 || status.compare("PREPARE") == 0) {
2555 return true;
2556 }
2557 return false;
2558}

Referenced by can_abort(), is_calibration_running(), is_in_extrusion_cali(), is_in_printing(), is_system_printing(), and Slic3r::GUI::PrintJob::process().

Here is the caller graph for this function:

◆ is_in_upgrading()

bool Slic3r::MachineObject::is_in_upgrading ( ) const

◆ is_info_ready()

bool Slic3r::MachineObject::is_info_ready ( bool check_version = true) const
2788{
2789 if (check_version && module_vers.empty())
2790 {
2791 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": not ready, failed to check version";
2792 return false;
2793 }
2794
2795 std::chrono::system_clock::time_point curr_time = std::chrono::system_clock::now();
2796 auto diff = std::chrono::duration_cast<std::chrono::microseconds>(last_push_time - curr_time);
2797 if (m_full_msg_count > 0 && m_push_count > 0 && diff.count() < PUSHINFO_TIMEOUT) {
2798 return true;
2799 }
2800
2801 BOOST_LOG_TRIVIAL(info) << __FUNCTION__
2802 << ": not ready, m_full_msg_count=" << m_full_msg_count
2803 << ", m_push_count=" << m_push_count
2804 << ", diff.count()=" << diff.count()
2805 << ", dev_id=" << dev_id;
2806 return false;
2807}
#define PUSHINFO_TIMEOUT
Definition DeviceManager.hpp:43
std::chrono::system_clock::time_point last_push_time
Definition DeviceManager.hpp:297
int m_full_msg_count
Definition DeviceManager.hpp:521

References dev_id, Slic3r::diff(), last_push_time, m_full_msg_count, m_push_count, module_vers, and PUSHINFO_TIMEOUT.

Referenced by Slic3r::GUI::SyncAmsInfoDialog::on_timer(), Slic3r::GUI::MediaPlayCtrl::SetMachineObject(), Slic3r::GUI::CalibrationPresetPage::update_combobox_filaments(), Slic3r::GUI::SelectMachineDialog::update_show_status(), Slic3r::GUI::SendToPrinterDialog::update_show_status(), Slic3r::GUI::SyncAmsInfoDialog::update_show_status(), Slic3r::GUI::Sidebar::priv::update_sync_status(), and Slic3r::GUI::MediaFilePanel::UpdateByObj().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_lan_mode_printer()

◆ is_local()

bool Slic3r::MachineObject::is_local ( )
inline
875{ return !get_dev_ip().empty(); }

References get_dev_ip().

Here is the call graph for this function:

◆ is_main_extruder_on_left()

bool Slic3r::MachineObject::is_main_extruder_on_left ( ) const
inline
349{ return false; } // only means the extruder is on the left hand when extruder id is 0

Referenced by Slic3r::GUI::Plater::priv::check_ams_status_impl(), Slic3r::GUI::SelectMachineDialog::do_ams_mapping(), get_preset_extruder_index(), Slic3r::GUI::CalibrationPresetPage::init_with_machine(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), and Slic3r::GUI::Sidebar::priv::update_sync_status().

Here is the caller graph for this function:

◆ is_makeworld_subtask()

bool Slic3r::MachineObject::is_makeworld_subtask ( )
1295{
1296 if (model_task && model_task->design_id > 0) {
1297 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " model task id: " << model_task->task_id << " is makeworld model";
1298 return true;
1299 }
1300 return false;
1301}

References model_task.

◆ is_multi_extruders()

◆ is_nozzle_flow_type_supported()

bool Slic3r::MachineObject::is_nozzle_flow_type_supported ( ) const
inlinenodiscard
bool has_extra_flow_type
Definition DeviceManager.hpp:356
bool is_enable_np
Definition DeviceManager.hpp:932

References has_extra_flow_type, and is_enable_np.

Referenced by Slic3r::GUI::SelectMachineDialog::CheckErrorExtruderNozzleWithSlicing(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), and Slic3r::GUI::Sidebar::priv::update_sync_status().

Here is the caller graph for this function:

◆ is_online()

bool Slic3r::MachineObject::is_online ( )
inline
898{ return m_is_online; }

References m_is_online.

Referenced by Slic3r::GUI::_collect_sorted_machines(), Slic3r::anonymous_namespace{PluginHostApp.cpp}::selected_printer(), Slic3r::GUI::SyncAmsInfoDialog::update_lan_machine_list(), Slic3r::GUI::SideTools::update_status(), and Slic3r::GUI::SyncAmsInfoDialog::update_user_printer().

Here is the caller graph for this function:

◆ is_printing_finished()

bool Slic3r::MachineObject::is_printing_finished ( )
2583{
2584 if (print_status.compare("FINISH") == 0
2585 || print_status.compare("FAILED") == 0) {
2586 return true;
2587 }
2588 return false;
2589}

References print_status.

Referenced by Slic3r::GUI::FlowRateWizard::on_device_connected(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_device_connected(), Slic3r::GUI::PressureAdvanceWizard::on_device_connected(), and Slic3r::GUI::CalibrationCaliPage::update().

Here is the caller graph for this function:

◆ is_recording()

bool Slic3r::MachineObject::is_recording ( )
1327{
1328 return camera_recording;
1329}
bool camera_recording
Definition DeviceManager.hpp:549

References camera_recording.

◆ is_recording_enable()

bool Slic3r::MachineObject::is_recording_enable ( )
1322{
1324}

References camera_recording_when_printing.

◆ is_sdcard_printing()

bool Slic3r::MachineObject::is_sdcard_printing ( )
1304{
1305 if (can_abort()
1306 && (obj_subtask_id.compare("0") == 0 || obj_subtask_id.empty())
1307 && (profile_id_ == "0" || profile_id_.empty())
1308 && (project_id_ == "0" || project_id_.empty()))
1309 return true;
1310 else
1311 return false;
1312}
bool can_abort()
Definition DeviceManager.cpp:2544
std::string project_id_
Definition DeviceManager.hpp:698
std::string profile_id_
Definition DeviceManager.hpp:699
std::string obj_subtask_id
Definition DeviceManager.hpp:735

References can_abort(), obj_subtask_id, profile_id_, and project_id_.

Here is the call graph for this function:

◆ is_security_control_ready()

bool Slic3r::MachineObject::is_security_control_ready ( ) const
2811{
2812 return device_cert_installed;
2813}
bool device_cert_installed
Definition DeviceManager.hpp:301

References device_cert_installed.

◆ is_series_n() [1/2]

bool Slic3r::MachineObject::is_series_n ( ) const
bool is_series_n() const
Definition DeviceManager.cpp:615

References Slic3r::DevPrinterConfigUtil::get_printer_series_str(), is_series_n(), and printer_type.

Referenced by is_series_n().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_series_n() [2/2]

bool Slic3r::MachineObject::is_series_n ( const std::string & series_str)
static
610{ return series_str == "series_n"; }

Referenced by Slic3r::GUI::AMSextruder::updateNozzleNum().

Here is the caller graph for this function:

◆ is_series_o() [1/2]

bool Slic3r::MachineObject::is_series_o ( ) const

References Slic3r::DevPrinterConfigUtil::get_printer_series_str(), is_series_o(), and printer_type.

Referenced by get_max_filament_color_count(), is_series_o(), parse_home_flag(), and parse_new_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_series_o() [2/2]

bool Slic3r::MachineObject::is_series_o ( const std::string & series_str)
static
613{ return series_str == "series_o"; }

Referenced by Slic3r::GUI::MachineInfoPanel::update_ams_ext(), and Slic3r::GUI::MachineInfoPanel::update_amshub().

Here is the caller graph for this function:

◆ is_series_p() [1/2]

bool Slic3r::MachineObject::is_series_p ( ) const
bool is_series_p() const
Definition DeviceManager.cpp:616

References Slic3r::DevPrinterConfigUtil::get_printer_series_str(), is_series_p(), and printer_type.

Referenced by is_series_p(), parse_home_flag(), and parse_new_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_series_p() [2/2]

bool Slic3r::MachineObject::is_series_p ( const std::string & series_str)
static
611{ return series_str == "series_p1p";}

Referenced by Slic3r::GUI::AMSextruder::updateNozzleNum().

Here is the caller graph for this function:

◆ is_series_x() [1/2]

bool Slic3r::MachineObject::is_series_x ( ) const

References Slic3r::DevPrinterConfigUtil::get_printer_series_str(), is_series_x(), and printer_type.

Referenced by get_max_filament_color_count(), and is_series_x().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_series_x() [2/2]

bool Slic3r::MachineObject::is_series_x ( const std::string & series_str)
static
612{ return series_str == "series_x1"; }

Referenced by Slic3r::GUI::CalibUtils::check_printable_status_before_cali(), Slic3r::GUI::CalibUtils::check_printable_status_before_cali(), and Slic3r::GUI::AMSextruder::updateNozzleNum().

Here is the caller graph for this function:

◆ is_studio_cmd()

bool Slic3r::MachineObject::is_studio_cmd ( int seq)
1366{
1367 if (sequence_id >= START_SEQ_ID && sequence_id < END_SEQ_ID) {
1368 return true;
1369 }
1370 return false;
1371}
#define START_SEQ_ID
Definition DeviceManager.hpp:62
#define END_SEQ_ID
Definition DeviceManager.hpp:63

References END_SEQ_ID, and START_SEQ_ID.

Referenced by parse_json().

Here is the caller graph for this function:

◆ is_support_command_calibration()

bool Slic3r::MachineObject::is_support_command_calibration ( )
2032{
2034 auto ap_ver_it = module_vers.find("rv1126");
2035 if (ap_ver_it != module_vers.end()) {
2036 if (ap_ver_it->second.sw_ver.compare("00.00.15.79") < 0)
2037 return false;
2038 }
2039 }
2040 return true;
2041}

References get_printer_series(), module_vers, and SERIES_X1.

Referenced by command_start_calibration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_system_printing()

bool Slic3r::MachineObject::is_system_printing ( )
1075{
1077 return true;
1078 //FIXME
1079 //if (print_type == "system" && is_in_printing_status(print_status))
1080 //return true;
1081 return false;
1082}

References is_in_calibration(), is_in_printing_status(), and print_status.

Referenced by Slic3r::GUI::CalibUtils::send_to_print(), Slic3r::GUI::CalibUtils::send_to_print(), Slic3r::GUI::CalibrationPresetPage::update_show_status(), Slic3r::GUI::SelectMachineDialog::update_show_status(), Slic3r::GUI::SendToPrinterDialog::update_show_status(), Slic3r::GUI::SyncAmsInfoDialog::update_show_status(), and Slic3r::GUI::CalibrationCaliPage::update_subtask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_target_slot_unload()

bool Slic3r::MachineObject::is_target_slot_unload ( ) const
6126{
6127 return m_extder_system->GetTargetSlotId().compare("255") == 0;
6128}

References m_extder_system.

◆ is_timelapse()

bool Slic3r::MachineObject::is_timelapse ( )
1317{
1318 return camera_timelapse;
1319}

References camera_timelapse.

◆ is_timelapse_storage_low()

bool Slic3r::MachineObject::is_timelapse_storage_low ( const std::string & storage) const
2345{
2346 return m_storage && m_storage->is_timelapse_storage_low(storage);
2347}

References m_storage.

Referenced by Slic3r::GUI::SelectMachineDialog::check_timelapse_storage_warning().

Here is the caller graph for this function:

◆ is_upgrading_avalable()

bool Slic3r::MachineObject::is_upgrading_avalable ( )

◆ local_publish_json()

int Slic3r::MachineObject::local_publish_json ( std::string json_str,
int qos = 0,
int flag = 0 )
2868{
2869 int result = -1;
2870 if (m_agent) {
2871 result = m_agent->send_message_to_printer(get_dev_id(), json_str, qos, flag);
2872 }
2873 return result;
2874}

References get_dev_id(), and m_agent.

Referenced by publish_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_home_flag()

void Slic3r::MachineObject::parse_home_flag ( int flag)
1179{
1180 m_home_flag = flag;
1181
1182 is_220V_voltage = ((flag >> 3) & 0x1) != 0;
1183 if (time(nullptr) - xcam_auto_recovery_hold_start > HOLD_TIME_3SEC) {
1184 xcam_auto_recovery_step_loss = ((flag >> 4) & 0x1) != 0;
1185 }
1186
1187 camera_recording = ((flag >> 5) & 0x1) != 0;
1188
1189 if (time(nullptr) - ams_user_setting_start > HOLD_COUNT_MAX)
1190 {
1191 m_fila_system->GetAmsSystemSetting().SetDetectRemainEnabled(((flag >> 7) & 0x1) != 0);
1192 }
1193
1194 // sdcard_state = MachineObject::SdcardState(get_flag_bits(flag, 8, 2));
1195 m_storage->set_sdcard_state(get_flag_bits(flag, 8, 2));
1196
1197
1198 if (time(nullptr) - ams_switch_filament_start > HOLD_TIME_3SEC)
1199 {
1200 m_fila_system->GetAmsSystemSetting().SetAutoRefillEnabled(((flag >> 10) & 0x1) != 0);
1201 }
1202
1203 is_support_flow_calibration = ((flag >> 15) & 0x1) != 0;
1204 if (this->is_series_o()) { is_support_flow_calibration = false; } // todo: Temp modification due to incorrect machine push message for H2D
1205
1206 is_support_pa_calibration = ((flag >> 16) & 0x1) != 0;
1207 if (this->is_series_p()) { is_support_pa_calibration = false; } // todo: Temp modification due to incorrect machine push message for P
1208
1209 if (time(nullptr) - xcam_prompt_sound_hold_start > HOLD_TIME_3SEC) {
1210 xcam_allow_prompt_sound = ((flag >> 17) & 0x1) != 0;
1211 }
1212
1213 is_support_prompt_sound = ((flag >> 18) & 0x1) != 0;
1214 is_support_filament_tangle_detect = ((flag >> 19) & 0x1) != 0;
1215
1217 xcam_filament_tangle_detect = ((flag >> 20) & 0x1) != 0;
1218 }
1219
1220 /*if(!is_support_motor_noise_cali){
1221 is_support_motor_noise_cali = ((flag >> 21) & 0x1) != 0;
1222 }*/
1223 is_support_motor_noise_cali = ((flag >> 21) & 0x1) != 0;
1224
1225 is_support_user_preset = ((flag >> 22) & 0x1) != 0;
1226
1227 is_support_nozzle_blob_detection = ((flag >> 25) & 0x1) != 0;
1228
1229 if (time(nullptr) - nozzle_blob_detection_hold_start > HOLD_TIME_3SEC) {
1230 nozzle_blob_detection_enabled = ((flag >> 24) & 0x1) != 0;
1231 }
1232
1233 is_support_air_print_detection = ((flag >> 29) & 0x1) != 0;
1234 if (auto ptr = m_fila_system->GetAmsFirmwareSwitch().lock();
1235 ptr->GetCurrentFirmwareIdxRun() == DevAmsSystemFirmwareSwitch::IDX_AMS_AMS2_AMSHT) {
1236 is_support_air_print_detection = false;// special case, for the firmware, air print is not supported
1237 }
1238 ams_air_print_status = ((flag >> 28) & 0x1) != 0;
1239
1240 /*if (!is_support_p1s_plus) {
1241 auto supported_plus = ((flag >> 27) & 0x1) != 0;
1242 auto installed_plus = ((flag >> 26) & 0x1) != 0;
1243
1244 if (installed_plus && supported_plus) {
1245 is_support_p1s_plus = true;
1246 }
1247 else {
1248 is_support_p1s_plus = false;
1249 }
1250 }*/
1251
1252 is_support_upgrade_kit = ((flag >> 27) & 0x1) != 0;
1253 installed_upgrade_kit = ((flag >> 26) & 0x1) != 0;
1254
1255 is_support_agora = ((flag >> 30) & 0x1) != 0;
1256 if (is_support_agora)
1257 is_support_tunnel_mqtt = false;
1258}
#define HOLD_COUNT_MAX
Definition DevFilaSystem.h:21
#define HOLD_TIME_3SEC
Definition DeviceManager.hpp:56
@ IDX_AMS_AMS2_AMSHT
Definition DevFilaAmsSetting.h:48
bool is_support_nozzle_blob_detection
Definition DeviceManager.hpp:647
bool is_support_filament_tangle_detect
Definition DeviceManager.hpp:638
bool is_support_pa_calibration
Definition DeviceManager.hpp:626
bool is_support_prompt_sound
Definition DeviceManager.hpp:637
bool is_support_flow_calibration
Definition DeviceManager.hpp:627
bool is_support_user_preset
Definition DeviceManager.hpp:646
bool is_support_tunnel_mqtt
Definition DeviceManager.hpp:643
int get_flag_bits(std::string str, int start, int count=1) const
Definition DeviceManager.cpp:5645
bool is_support_air_print_detection
Definition DeviceManager.hpp:648
bool is_support_motor_noise_cali
Definition DeviceManager.hpp:644

References ams_air_print_status, ams_switch_filament_start, ams_user_setting_start, camera_recording, get_flag_bits(), HOLD_COUNT_MAX, HOLD_TIME_3SEC, Slic3r::DevAmsSystemFirmwareSwitch::IDX_AMS_AMS2_AMSHT, installed_upgrade_kit, is_220V_voltage, is_series_o(), is_series_p(), is_support_agora, is_support_air_print_detection, is_support_filament_tangle_detect, is_support_flow_calibration, is_support_motor_noise_cali, is_support_nozzle_blob_detection, is_support_pa_calibration, is_support_prompt_sound, is_support_tunnel_mqtt, is_support_upgrade_kit, is_support_user_preset, m_fila_system, m_home_flag, m_storage, nozzle_blob_detection_enabled, nozzle_blob_detection_hold_start, xcam_allow_prompt_sound, xcam_auto_recovery_hold_start, xcam_auto_recovery_step_loss, xcam_filament_tangle_detect, xcam_filament_tangle_detect_hold_start, and xcam_prompt_sound_hold_start.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_json()

int Slic3r::MachineObject::parse_json ( std::string tunnel,
std::string payload,
bool key_filed_only = false )
2908{
2909#ifdef ORCA_NETWORK_DEBUG
2910 BOOST_LOG_TRIVIAL(info) << "parse_json: payload = " << payload;
2911 flush_logs();
2912#endif
2913
2914 if (tunnel == "lan") last_lan_msg_time_ = std::chrono::system_clock::now();
2915 if (tunnel == "cloud") last_cloud_msg_time_ = std::chrono::system_clock::now();
2916
2918 std::chrono::system_clock::time_point clock_start = std::chrono::system_clock::now();
2919
2920 json j_pre;
2921 bool parse_ok = false;
2922 try {
2923 j_pre = json::parse(payload);
2924 parse_ok = true;
2925 }
2926 catch(...) {
2927 parse_ok = false;
2928 /* post process payload */
2929 sanitizeToUtf8(payload);
2930 BOOST_LOG_TRIVIAL(info) << "parse_json: sanitize to utf8";
2931 try {
2932 j_pre = json::parse(payload);
2933 parse_ok = true;
2934 }
2935 catch (...) {}
2936 }
2937
2938 bool client_disconnected = false;
2939 if (parse_ok && j_pre.is_object() && j_pre.contains("event") && j_pre["event"].is_object() &&
2940 j_pre["event"].contains("event") && j_pre["event"]["event"].is_string()) {
2941 client_disconnected = j_pre["event"]["event"].get<std::string>() == "client.disconnected";
2942 }
2943
2944 // A disconnect notification is a transport message too, but it must not first mark an
2945 // already-offline device as online through the generic message-received path.
2946 set_online_state(!client_disconnected);
2947
2948 std::chrono::system_clock::time_point curr_time = std::chrono::system_clock::now();
2949 auto diff1 = std::chrono::duration_cast<std::chrono::microseconds>(curr_time - last_update_time);
2950
2951 /* update last received time */
2952 last_update_time = std::chrono::system_clock::now();
2953
2954 try {
2955 bool restored_json = false;
2956 json j;
2957 if (!parse_ok)
2958 j_pre = json::parse(payload);
2959 CNumericLocalesSetter locales_setter;
2960 if (j_pre.empty()) {
2961 return 0;
2962 }
2963 if (j_pre.contains("print")) {
2965 if (j_pre["print"].contains("command")) {
2966 if (j_pre["print"]["command"].get<std::string>() == "push_status") {
2967 if (j_pre["print"].contains("msg")) {
2968 if (j_pre["print"]["msg"].get<int>() == 0) { //all message
2969 BOOST_LOG_TRIVIAL(trace) << "static: get push_all msg, dev_id=" << dev_id;
2970 m_push_count++;
2972
2973 if (!printer_type.empty())
2974 print_json.load_compatible_settings(printer_type, "");
2975 print_json.diff2all_base_reset(j_pre);
2976 } else if (j_pre["print"]["msg"].get<int>() == 1) { //diff message
2977 if (print_json.diff2all(j_pre, j) == 0) {
2978 restored_json = true;
2979 } else {
2980 BOOST_LOG_TRIVIAL(trace) << "parse_json: restore failed! count = " << parse_msg_count;
2981 if (print_json.is_need_request()) {
2982 BOOST_LOG_TRIVIAL(trace) << "parse_json: need request pushall, count = " << parse_msg_count;
2983 // request new push
2984 GUI::wxGetApp().CallAfter([this]{
2986 });
2987 return -1;
2988 }
2989 return -1;
2990 }
2991 } else {
2992 BOOST_LOG_TRIVIAL(warning) << "unsupported msg_type=" << j_pre["print"]["msg"].get<std::string>();
2993 }
2994 }
2995 else {
2996 if (!printer_type.empty()) {
2997 m_full_msg_count++;/* all message package is full at LAN mode*/
2998 print_json.load_compatible_settings(printer_type, "");
2999 }
3000
3001 print_json.diff2all_base_reset(j_pre);
3002 }
3003
3004 if (j_pre["print"].contains("s_obj")){
3005 if(j_pre["print"]["s_obj"].is_array()){
3006 m_partskip_ids.clear();
3007 for(auto it=j_pre["print"]["s_obj"].begin(); it!=j_pre["print"]["s_obj"].end(); it++){
3008 m_partskip_ids.push_back(it.value().get<int>());
3009 }
3010 }
3011 }
3012 }
3013 }
3014 if (j_pre["print"].contains("plate_idx")){ // && m_plate_index == -1
3015 if (j_pre["print"]["plate_idx"].is_number())
3016 {
3017 m_plate_index = j_pre["print"]["plate_idx"].get<int>();
3018 }
3019 else if (j_pre["print"]["plate_idx"].is_string())
3020 {
3021 try
3022 {
3023 m_plate_index = std::stoi(j_pre["print"]["plate_idx"].get<std::string>());
3024 }
3025 catch (...) { BOOST_LOG_TRIVIAL(error) << "parse_json: failed to convert plate_idx to int"; }
3026 }
3027 }
3028 }
3029 if (j_pre.contains("system")) {
3030 if (j_pre["system"].contains("command")) {
3031 if (j_pre["system"]["command"].get<std::string>() == "get_access_code") {
3032 if (j_pre["system"].contains("access_code")) {
3033 std::string access_code = j_pre["system"]["access_code"].get<std::string>();
3034 if (!access_code.empty()) {
3036 }
3037 }
3038 }
3039 }
3040 }
3041 if (!restored_json) {
3042 j = j_pre;
3043 }
3044
3045 uint64_t t_utc = j.value("t_utc", 0ULL);
3046 if (t_utc > 0) {
3047 last_utc_time = std::chrono::system_clock::time_point(t_utc * 1ms);
3048 std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
3049 auto millisec_since_epoch = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
3050 auto delay = millisec_since_epoch - t_utc; //ms
3051
3052 std::string message_type = is_lan_mode_printer() ? "Local Mqtt" : is_tunnel_mqtt ? "Tunnel Mqtt" : "Cloud Mqtt";
3053 if (!message_delay.empty()) {
3054 const auto& [first_type, first_time_stamp, first_delay] = message_delay.front();
3055 const auto& [last_type, last_time_stap, last_delay] = message_delay.back();
3056
3057 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ", message delay, last time stamp: " << last_time_stap;
3058 if (last_time_stap - first_time_stamp >= MINUTE_30) {
3059 // record, excluding current data
3060 int total = message_delay.size();
3061 int local_mqtt = 0;
3062 int tunnel_mqtt = 0;
3063 int cloud_mqtt = 0;
3064
3065 int local_mqtt_timeout = 0;
3066 int tunnel_mqtt_timeout = 0;
3067 int cloud_mqtt_timeout = 0;
3068
3069 for (const auto& [type, time_stamp, delay] : message_delay) {
3070 if (type == "Local Mqtt") {
3071 local_mqtt++;
3072 if (delay >= TIME_OUT) {
3073 local_mqtt_timeout++;
3074 }
3075 }
3076 else if (type == "Tunnel Mqtt") {
3077 tunnel_mqtt++;
3078 if (delay >= TIME_OUT) {
3079 tunnel_mqtt_timeout++;
3080 }
3081 }
3082 else if (type == "Cloud Mqtt"){
3083 cloud_mqtt++;
3084 if (delay >= TIME_OUT) {
3085 cloud_mqtt_timeout++;
3086 }
3087 }
3088 }
3089
3090 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ", message delay, message total: " << total;
3091
3092 message_delay.clear();
3093 message_delay.shrink_to_fit();
3094 }
3095 }
3096 message_delay.push_back(std::make_tuple(message_type, t_utc, delay));
3097 }
3098 else
3100
3101#if !BBL_RELEASE_TO_PUBLIC
3102 BOOST_LOG_TRIVIAL(info) << "parse_json: dev_id=" << dev_id << ", tunnel is=" << tunnel << ", merged playload=" << j.dump();
3103#else
3105 BOOST_LOG_TRIVIAL(info) << "parse_json: dev_id=" << dev_id << ", origin playload=" << j_pre.dump();
3106 } else {
3107 BOOST_LOG_TRIVIAL(trace) << "parse_json: dev_id=" << dev_id << ", tunnel is=" << tunnel << ", merged playload=" << j.dump();
3108 }
3109#endif
3110
3111 // Parse version info first, as if version arrive or change, 'print' need parse again with new compatible settings
3112 try {
3113 if (j.contains("info")) {
3114 if (j["info"].contains("command") && j["info"]["command"].get<std::string>() == "get_version") {
3115 json j_module = j["info"]["module"];
3117 for (auto it = j_module.begin(); it != j_module.end(); it++) {
3118 DevFirmwareVersionInfo ver_info;
3119 ver_info.name = (*it)["name"].get<std::string>();
3120 if ((*it).contains("product_name"))
3121 ver_info.product_name = wxString::FromUTF8((*it)["product_name"].get<std::string>());
3122 if ((*it).contains("sw_ver"))
3123 ver_info.sw_ver = (*it)["sw_ver"].get<std::string>();
3124 if ((*it).contains("sw_new_ver"))
3125 ver_info.sw_new_ver = (*it)["sw_new_ver"].get<std::string>();
3126 if ((*it).contains("visible") && (*it).contains("new_ver")) {
3127 ver_info.sw_new_ver = (*it)["new_ver"].get<std::string>();
3128 }
3129 if ((*it).contains("sn"))
3130 ver_info.sn = (*it)["sn"].get<std::string>();
3131 if ((*it).contains("hw_ver"))
3132 ver_info.hw_ver = (*it)["hw_ver"].get<std::string>();
3133 if((*it).contains("flag"))
3134 ver_info.firmware_flag= (*it)["flag"].get<int>();
3135
3136 store_version_info(ver_info);
3137 if (ver_info.name == "ota") {
3138 NetworkAgent* agent = GUI::wxGetApp().getAgent();
3139 if (agent) {
3140 std::string dev_ota_str = "dev_ota_ver:" + this->get_dev_id();
3141 agent->track_update_property(dev_ota_str, ver_info.sw_ver);
3142 }
3143 }
3144 }
3145
3147
3148 bool get_version_result = true;
3149 if (j["info"].contains("result"))
3150 if (j["info"]["result"].get<std::string>() == "fail")
3151 get_version_result = false;
3152 if ((!check_version_valid() && get_version_retry-- >= 0)
3153 && get_version_result) {
3154 BOOST_LOG_TRIVIAL(info) << "get_version_retry = " << get_version_retry;
3155 boost::thread retry = boost::thread([this] {
3156 boost::this_thread::sleep_for(boost::chrono::milliseconds(RETRY_INTERNAL));
3157 GUI::wxGetApp().CallAfter([this] {
3158 this->command_get_version(false);
3159 });
3160 });
3161 }
3162 }
3163 std::string version = parse_version();
3164 if (!version.empty() && print_json.load_compatible_settings(printer_type, version)) {
3165 // reload because compatible settings changed
3166 j.clear();
3167 print_json.diff2all(json{}, j);
3168 }
3169
3170 }
3171 } catch (...) {}
3172
3173 try {
3174 if (j.contains("info"))
3175 parse_new_info2(j["info"]);
3176 } catch (...) {
3177 BOOST_LOG_TRIVIAL(error) << "parse_json: failed to parse OrcaSonar capability info";
3178 }
3179
3180 try {
3181 if (auto ptr = m_fila_system->GetAmsFirmwareSwitch().lock()) {
3182 ptr->ParseFirmwareSwitch(j);
3183 }
3184 } catch (...) {
3185 BOOST_LOG_TRIVIAL(error) << "parse_json: failed to parse firmware switch info";
3186 }
3187
3188 if (j.contains("print")) {
3189 json jj = j["print"];
3190 int sequence_id = 0;
3191 if (jj.contains("sequence_id")) {
3192 if (jj["sequence_id"].is_string()) {
3193 std::string str_seq = jj["sequence_id"].get<std::string>();
3194 try {
3195 sequence_id = stoi(str_seq);
3196 }
3197 catch(...) {
3198 ;
3199 }
3200 }
3201 }
3202
3203 if (!key_field_only) {
3204 if (!m_manager->IsMultiMachineEnabled() && !is_support_agora) {
3205 if (jj.contains("support_tunnel_mqtt")) {
3206 if (jj["support_tunnel_mqtt"].is_boolean()) {
3207 is_support_tunnel_mqtt = jj["support_tunnel_mqtt"].get<bool>();
3208 }
3209 }
3210 }
3211
3212 //nozzle temp range
3213 if (jj.contains("nozzle_temp_range")) {
3214 if (jj["nozzle_temp_range"].is_array()) {
3215 nozzle_temp_range.clear();
3216 for (auto it = jj["nozzle_temp_range"].begin(); it != jj["nozzle_temp_range"].end(); it++) {
3217 nozzle_temp_range.push_back(it.value().get<int>());
3218 }
3219 }
3220 }
3221
3222 // bed temp range
3223 if (jj.contains("bed_temp_range")) {
3224 if (jj["bed_temp_range"].is_array()) {
3225 bed_temp_range.clear();
3226 for (auto it = jj["bed_temp_range"].begin(); it != jj["bed_temp_range"].end(); it++) {
3227 bed_temp_range.push_back(it.value().get<int>());
3228 }
3229 }
3230 }
3231
3232 //supported function
3233 m_config->ParseConfig(jj);
3234 m_status->ParseStatus(jj); // Orca: adopt DeviceCore split — populate DevStatus module
3235
3236 if (jj.contains("support_build_plate_marker_detect")) {
3237 if (jj["support_build_plate_marker_detect"].is_boolean()) {
3238 is_support_build_plate_marker_detect = jj["support_build_plate_marker_detect"].get<bool>();
3239 }
3240 }
3241
3242 if(jj.contains("support_build_plate_marker_detect_type") && jj["support_build_plate_marker_detect_type"].is_number()) {
3243 m_plate_maker_detect_type = (PlateMakerDectect)jj["support_build_plate_marker_detect_type"].get<int>();
3244 }
3245
3246 if (jj.contains("support_flow_calibration") && jj["support_flow_calibration"].is_boolean())
3247 {
3248 is_support_pa_calibration = jj["support_flow_calibration"].get<bool>();
3249 }
3250
3251 if (jj.contains("support_send_to_sd")) {
3252 if (jj["support_send_to_sd"].is_boolean()) {
3253 is_support_send_to_sdcard = jj["support_send_to_sd"].get<bool>();
3254 }
3255 }
3256
3257 m_fan->ParseV2_0(jj);
3258 m_fila_switch->ParseFilaSwitchInfo(jj);
3259
3260 if (jj.contains("support_filament_backup")) {
3261 if (jj["support_filament_backup"].is_boolean()) {
3262 is_support_filament_backup = jj["support_filament_backup"].get<bool>();
3263 }
3264 }
3265
3266 if (jj.contains("support_update_remain")) {
3267 if (jj["support_update_remain"].is_boolean()) {
3268 is_support_update_remain = jj["support_update_remain"].get<bool>();
3269 if (auto ptr = m_fila_system->GetAmsFirmwareSwitch().lock();
3270 ptr->GetCurrentFirmwareIdxRun() == DevAmsSystemFirmwareSwitch::IDX_AMS_AMS2_AMSHT) {
3271 is_support_update_remain = true;// special case, for the firmware, remain is supported
3272 }
3273 }
3274 }
3275
3276 if (jj.contains("support_bed_leveling")) {
3277 if (jj["support_bed_leveling"].is_number_integer()) {
3278 is_support_bed_leveling = jj["support_bed_leveling"].get<int>();
3279 }
3280 }
3281
3282 if (jj.contains("support_auto_recovery_step_loss")) {
3283 if (jj["support_auto_recovery_step_loss"].is_boolean()) {
3284 is_support_auto_recovery_step_loss = jj["support_auto_recovery_step_loss"].get<bool>();
3285 }
3286 }
3287
3288 if (jj.contains("support_ams_humidity")) {
3289 if (jj["support_ams_humidity"].is_boolean()) {
3290 is_support_ams_humidity = jj["support_ams_humidity"].get<bool>();
3291 }
3292 }
3293
3294 if (jj.contains("support_prompt_sound")) {
3295 if (jj["support_prompt_sound"].is_boolean()) {
3296 is_support_prompt_sound = jj["support_prompt_sound"].get<bool>();
3297 }
3298 }
3299
3300 if (jj.contains("support_filament_tangle_detect")) {
3301 if (jj["support_filament_tangle_detect"].is_boolean()) {
3302 is_support_filament_tangle_detect = jj["support_filament_tangle_detect"].get<bool>();
3303 }
3304 }
3305
3306 if (jj.contains("support_1080dpi")) {
3307 if (jj["support_1080dpi"].is_boolean()) {
3308 is_support_1080dpi = jj["support_1080dpi"].get<bool>();
3309 }
3310 }
3311
3312 if (jj.contains("support_cloud_print_only")) {
3313 if (jj["support_cloud_print_only"].is_boolean()) {
3314 is_support_cloud_print_only = jj["support_cloud_print_only"].get<bool>();
3315 }
3316 }
3317
3318 if (jj.contains("support_command_ams_switch")) {
3319 if (jj["support_command_ams_switch"].is_boolean()) {
3320 is_support_command_ams_switch = jj["support_command_ams_switch"].get<bool>();
3321 }
3322 }
3323
3324 if (jj.contains("support_mqtt_alive")) {
3325 if (jj["support_mqtt_alive"].is_boolean()) {
3326 is_support_mqtt_alive = jj["support_mqtt_alive"].get<bool>();
3327 }
3328 }
3329
3330 if (jj.contains("support_motor_noise_cali")) {
3331 if (jj["support_motor_noise_cali"].is_boolean()) {
3332 is_support_motor_noise_cali = jj["support_motor_noise_cali"].get<bool>();
3333 }
3334 }
3335
3336 if (jj.contains("support_timelapse")) {
3337 if (jj["support_timelapse"].is_boolean()) {
3338 is_support_timelapse = jj["support_timelapse"].get<bool>();
3339 }
3340 }
3341
3342 if (jj.contains("support_user_preset")) {
3343 if (jj["support_user_preset"].is_boolean()) {
3344 is_support_user_preset = jj["support_user_preset"].get<bool>();
3345 }
3346 }
3347
3348 if (jj.contains("bed_temperature_limit")) {
3349 if (jj["bed_temperature_limit"].is_number_integer()) {
3350 bed_temperature_limit = jj["bed_temperature_limit"].get<int>();
3351 }
3352 }
3353
3354 if (jj.contains("support_refresh_nozzle")) {
3355 if (jj["support_refresh_nozzle"].is_boolean()) {
3356 is_support_refresh_nozzle = jj["support_refresh_nozzle"].get<bool>();
3357 }
3358 }
3359 }
3360
3361
3362 if (jj.contains("command")) {
3363 m_nozzle_mapping_ptr->ParseAutoNozzleMapping(jj);
3364
3365 if (jj["command"].get<std::string>() == "ams_change_filament") {
3366 if (jj.contains("errno")) {
3367 if (jj["errno"].is_number()) {
3368 if (jj.contains("soft_temp")) {
3369 int soft_temp = jj["soft_temp"].get<int>();
3370 if (jj["errno"].get<int>() == -2) {
3371 wxString text = wxString::Format(_L("The chamber temperature is too high, which may cause the filament to soften. Please wait until the chamber temperature drops below %d\u2103. You may open the front door or enable fans to cool down."), soft_temp);
3372 GUI::wxGetApp().push_notification(this, text);
3373 } else if (jj["errno"].get<int>() == -4) {
3374 wxString text = wxString::Format(_L("AMS temperature is too high, which may cause the filament to soften. Please wait until the AMS temperature drops below %d\u2103."), soft_temp);
3375 GUI::wxGetApp().push_notification(this, text);
3376 }
3377 } else {
3378 if (jj["errno"].get<int>() == -2) {
3379 wxString text = _L("The current chamber temperature or the target chamber temperature exceeds 45\u2103. In order to avoid extruder clogging, low temperature filament(PLA/PETG/TPU) is not allowed to be loaded.");
3380 GUI::wxGetApp().push_notification(this, text);
3381 }
3382 }
3383 }
3384 }
3385 }
3386
3387 if (jj["command"].get<std::string>() == "set_ctt") {
3388 if (m_agent && is_studio_cmd(sequence_id)) {
3389 if (jj["errno"].is_number()) {
3390 wxString text;
3391 if (jj["errno"].get<int>() == -2) {
3392 text = _L("Low temperature filament(PLA/PETG/TPU) is loaded in the extruder. In order to avoid extruder clogging, it is not allowed to set the chamber temperature.");
3393 }
3394 else if (jj["errno"].get<int>() == -4) {
3395 text = _L("When you set the chamber temperature below 40\u2103, the chamber temperature control will not be activated, "
3396 "and the target chamber temperature will automatically be set to 0\u2103." /* 0°C */);
3397 }
3398 if(!text.empty()){
3399#if __WXOSX__
3400 set_ctt_dlg(text);
3401#else
3402 GUI::wxGetApp().push_notification(this, text);
3403#endif
3404 }
3405 }
3406 }
3407 }
3408
3409 if (!key_field_only)
3410 {
3411 if (is_studio_cmd(sequence_id) && jj.contains("command") && jj.contains("err_code"))
3412 {
3413 if (jj["err_code"].is_number())
3414 {
3415 /* proceed action*/
3416 json action_json = jj.contains("err_index") ? jj : json();
3417
3418 add_command_error_code_dlg(jj["err_code"].get<int>(), action_json);
3419 }
3420 }
3421 }
3422
3423 if (jj["command"].get<std::string>() == "push_status") {
3424 m_push_count++;
3426#pragma region printing
3427 // U0 firmware
3428 if (jj.contains("print_type")) {
3429 print_type = jj["print_type"].get<std::string>();
3430 }
3431 if (jj.contains("mc_percent")) {
3432 update_print_progress(jj["mc_percent"]);
3433 }
3434 if (jj.contains("mc_print_sub_stage")) {
3435 if (jj["mc_print_sub_stage"].is_number_integer())
3436 mc_print_sub_stage = j["print"]["mc_print_sub_stage"].get<int>();
3437 }
3438 /* printing */
3439 if (jj.contains("mc_print_stage")) {
3440 if (jj["mc_print_stage"].is_string())
3441 mc_print_stage = atoi(jj["mc_print_stage"].get<std::string>().c_str());
3442 if (jj["mc_print_stage"].is_number())
3443 mc_print_stage = jj["mc_print_stage"].get<int>();
3444 }
3445 if (jj.contains("mc_print_error_code")) {
3446 if (jj["mc_print_error_code"].is_number())
3447 mc_print_error_code = jj["mc_print_error_code"].get<int>();
3448 }
3449 if (jj.contains("mc_remaining_time")) {
3450 if (jj["mc_remaining_time"].is_string())
3451 mc_left_time = stoi(j["print"]["mc_remaining_time"].get<std::string>()) * 60;
3452 else if (jj["mc_remaining_time"].is_number_integer())
3453 mc_left_time = j["print"]["mc_remaining_time"].get<int>() * 60;
3454 }
3455 if (jj.contains("print_error")) {
3456 if (jj["print_error"].is_number())
3457 print_error = jj["print_error"].get<int>();
3458 }
3459 // Orca: keep the failure-snapshot id only while an error is active, so a stale
3460 // id can't leak into a later unrelated error dialog once the failure clears.
3461 if (print_error <= 0) {
3462 m_print_error_img_id.clear();
3463 }
3464 else if (jj.contains("err2") && jj["err2"].is_object()) {
3465 json err2 = jj["err2"];
3466 if (err2.contains("img_id") && err2["img_id"].is_string()) {
3467 m_print_error_img_id = err2["img_id"].get<std::string>();
3468 }
3469 }
3470
3472
3473 if (!key_field_only) {
3474 if (jj.contains("home_flag")) { parse_home_flag(jj["home_flag"].get<int>());}
3475
3476 /*the param is invalid in np for Yeshu*/
3477 if (jj.contains("hw_switch_state")) {
3478 hw_switch_state = jj["hw_switch_state"].get<int>();
3479 m_extder_system->m_extders[MAIN_EXTRUDER_ID].m_ext_has_filament = hw_switch_state;
3480 }
3481 if (jj.contains("mc_print_line_number")) {
3482 if (jj["mc_print_line_number"].is_string() && !jj["mc_print_line_number"].is_null())
3483 mc_print_line_number = atoi(jj["mc_print_line_number"].get<std::string>().c_str());
3484 }
3485 }
3486 if (!key_field_only) {
3487 if (jj.contains("flag3")) {
3488 int flag3 = jj["flag3"].get<int>();
3490 is_enable_ams_np = get_flag_bits(flag3, 9);
3491 is_support_fila_change_abort = get_flag_bits(flag3, 13); // filament-change Stop button
3492 is_support_ext_change_assist_old = get_flag_bits(flag3, 16); // A/P-series multi-color external change assist
3494 }
3495 }
3496 if (!key_field_only) {
3497 if (jj.contains("net")) {
3498 if (jj["net"].contains("conf")) {
3499 network_wired = (jj["net"]["conf"].get<int>() & (0x1)) != 0;
3500 }
3501 if (jj["net"].contains("info")) {
3502 for (auto info_item = jj["net"]["info"].begin(); info_item != jj["net"]["info"].end(); info_item++) {
3503
3504 if (info_item->contains("ip")) {
3505 auto tmp_dev_ip = (*info_item)["ip"].get<int64_t>();
3506 if (tmp_dev_ip == 0)
3507 continue ;
3508 else {
3509 set_dev_ip(DevUtil::convertToIp(tmp_dev_ip));
3510 }
3511 } else {
3512 break;
3513 }
3514 }
3515 }
3516 }
3517 }
3518
3519#pragma endregion
3520
3521#pragma region online
3522 if (!key_field_only) {
3523 // parse online info
3524 try {
3525 if (jj.contains("online")) {
3526 if (jj["online"].contains("ahb")) {
3527 if (jj["online"]["ahb"].get<bool>()) {
3528 online_ahb = true;
3529 } else {
3530 online_ahb = false;
3531 }
3532 }
3533 if (jj["online"].contains("rfid")) {
3534 if (jj["online"]["rfid"].get<bool>()) {
3535 online_rfid = true;
3536 } else {
3537 online_rfid = false;
3538 }
3539 }
3540 std::string str = jj.dump();
3541 if (jj["online"].contains("version")) {
3542 online_version = jj["online"]["version"].get<int>();
3543 }
3546 GUI::wxGetApp().CallAfter([this] {
3547 this->command_get_version();
3548 });
3549 }
3550 }
3551 } catch (...) {
3552 ;
3553 }
3554 }
3555#pragma endregion
3556
3557#pragma region print_task
3558 if (jj.contains("gcode_state")) {
3559 this->set_print_state(jj["gcode_state"].get<std::string>());
3560 }
3561 if (jj.contains("job_id")) {
3563 this->job_id_ = DevJsonValParser::get_longlong_val(jj["job_id"]);
3564 }
3565 else {
3567 }
3568
3569 if (jj.contains("subtask_name")) {
3570 subtask_name = jj["subtask_name"].get<std::string>();
3571 }
3572
3573 if (!key_field_only) {
3574 if (jj.contains("printer_type")) {
3575 printer_type = _parse_printer_type(jj["printer_type"].get<std::string>());
3576 }
3577
3578 if (jj.contains("layer_num")) {
3579 curr_layer = jj["layer_num"].get<int>();
3580 }
3581 if (jj.contains("total_layer_num")) {
3582 total_layers = jj["total_layer_num"].get<int>();
3583 if (total_layers == 0)
3584 is_support_layer_num = false;
3585 else
3586 is_support_layer_num = true;
3587 }
3588 else {
3589 is_support_layer_num = false;
3590 }
3591 if (jj.contains("queue_number")) {
3592 this->queue_number = jj["queue_number"].get<int>();
3593 }
3594 else {
3595 this->queue_number = 0;
3596 }
3597
3598 if (jj.contains("task_id")) {
3599 this->task_id_ = jj["task_id"].get<std::string>();
3600 }
3601
3602 if (jj.contains("thumbnail_url") && jj["thumbnail_url"].is_string())
3603 m_agent_thumbnail_url = jj["thumbnail_url"].get<std::string>();
3604
3605 if (jj.contains("job_attr")) {
3606 int jobAttr = jj["job_attr"].get<int>();
3607 jobState_ = get_flag_bits(jobAttr, 4, 4);
3608 }
3609
3610 if (jj.contains("gcode_file"))
3611 this->m_gcode_file = jj["gcode_file"].get<std::string>();
3612 if (jj.contains("gcode_file_prepare_percent")) {
3613 std::string percent_str = jj["gcode_file_prepare_percent"].get<std::string>();
3614 if (!percent_str.empty()) {
3615 try {
3616 this->gcode_file_prepare_percent = atoi(percent_str.c_str());
3617 }
3618 catch (...) {}
3619 }
3620 }
3621 }
3622
3623 if (jj.contains("project_id")
3624 && jj.contains("profile_id")
3625 && jj.contains("subtask_id")
3626 ) {
3627 obj_subtask_id = jj["subtask_id"].get<std::string>();
3628
3629 int plate_index = -1;
3630 /* parse local plate_index from task */
3631 if (obj_subtask_id.compare("0") == 0 && jj["profile_id"].get<std::string>() != "0") {
3632 if (jj.contains("gcode_file")) {
3633 m_gcode_file = jj["gcode_file"].get<std::string>();
3634 int idx_start = m_gcode_file.find_last_of("_") + 1;
3635 int idx_end = m_gcode_file.find_last_of(".");
3636 if (idx_start > 0 && idx_end > idx_start) {
3637 try {
3638 plate_index = atoi(m_gcode_file.substr(idx_start, idx_end - idx_start).c_str());
3639 this->m_plate_index = plate_index;
3640 }
3641 catch (...) {
3642 ;
3643 }
3644 }
3645 }
3646 }
3647 update_slice_info(jj["project_id"].get<std::string>(), jj["profile_id"].get<std::string>(), jj["subtask_id"].get<std::string>(), plate_index);
3648 BBLSubTask* curr_task = get_subtask();
3649 if (curr_task) {
3650 curr_task->printing_status = print_status;
3651 curr_task->task_id = jj["subtask_id"].get<std::string>();
3652 }
3653 }
3654
3655#pragma endregion
3656
3657#pragma region status
3658 if (!key_field_only) {
3659 /* temperature */
3660
3661 // Orca: adopt DeviceCore split — populate DevAxis/DevChamber modules
3662 // alongside the inline handling (side-effect-free; inline stays authoritative).
3663 // Contained locally so a malformed field cannot abort the whole status parse.
3664 try {
3665 m_axis->ParseAxis(jj);
3666 m_chamber->ParseChamber(jj);
3667 } catch (...) {
3668 BOOST_LOG_TRIVIAL(warning) << "parse_json: DevAxis/DevChamber parse failed";
3669 }
3670
3672
3673 if (jj.contains("frame_temper")) {
3674 if (jj["frame_temper"].is_number()) {
3675 frame_temp = jj["frame_temper"].get<float>();
3676 }
3677 }
3678
3680
3681 if (jj.contains("chamber_temper")) {
3682 if (jj["chamber_temper"].is_number()) {
3683 chamber_temp = jj["chamber_temper"].get<float>();
3684 }
3685 }
3686 if (jj.contains("ctt")) {
3687 if (jj["ctt"].is_number()) {
3688 chamber_temp_target = jj["ctt"].get<float>();
3689 }
3690 }
3691 /* signals */
3692 if (jj.contains("link_th_state"))
3693 link_th = jj["link_th_state"].get<std::string>();
3694 if (jj.contains("link_ams_state"))
3695 link_ams = jj["link_ams_state"].get<std::string>();
3696 if (jj.contains("wifi_signal"))
3697 wifi_signal = jj["wifi_signal"].get<std::string>();
3698
3699 /* cooling */
3700 m_fan->ParseV1_0(jj);
3701
3702 /* parse speed */
3704
3705 try {
3706 if (jj.contains("spd_mag")) {
3707 printing_speed_mag = jj["spd_mag"].get<int>();
3708 }
3709 }
3710 catch (...) {
3711 ;
3712 }
3713 }
3714
3715 try {
3716 if (jj.contains("stg")) {
3717 stage_list_info.clear();
3718 if (jj["stg"].is_array()) {
3719 for (auto it = jj["stg"].begin(); it != jj["stg"].end(); it++) {
3720 for (auto kv = (*it).begin(); kv != (*it).end(); kv++) {
3721 stage_list_info.push_back(kv.value().get<int>());
3722 }
3723 }
3724 }
3725 }
3726 if (jj.contains("stg_cur")) {
3727 stage_curr = jj["stg_cur"].get<int>();
3728 }
3729
3730 if (jj.contains("stg_cd")) {
3731 stage_remaining_seconds = jj["stg_cd"].get<int>();
3732 }
3733 }
3734 catch (...) {
3735 ;
3736 }
3737
3738 if (!key_field_only) {
3739 /*get filam_bak*/
3740 try {
3741 m_extder_system->m_extders[MAIN_EXTRUDER_ID].m_filam_bak.clear();
3742
3743 if (jj.contains("filam_bak")) {
3744 if (jj["filam_bak"].is_array()) {
3745 for (auto it = jj["filam_bak"].begin(); it != jj["filam_bak"].end(); it++) {
3746 const auto& filam_bak_val = it.value().get<int>();
3747 m_extder_system->m_extders[MAIN_EXTRUDER_ID].m_filam_bak.push_back(filam_bak_val);
3748 }
3749 }
3750 }
3751 }
3752 catch (...) {
3753 ;
3754 }
3755
3756 /* get fimware type */
3757 try {
3758 if (jj.contains("mess_production_state")) {
3759 if (jj["mess_production_state"].get<std::string>() == "engineer")
3761 else if (jj["mess_production_state"].get<std::string>() == "product")
3763 }
3764 }
3765 catch (...) {
3766 ;
3767 }
3768 }
3769 if (!key_field_only) {
3770 try {
3771 if (jj.contains("lifecycle")) {
3772 if (jj["lifecycle"].get<std::string>() == "engineer")
3774 else if (jj["lifecycle"].get<std::string>() == "product")
3776 }
3777 }
3778 catch (...) {
3779 ;
3780 }
3781
3782 try {
3783 if (jj.contains("lights_report") && jj["lights_report"].is_array()) {
3784 for (auto it = jj["lights_report"].begin(); it != jj["lights_report"].end(); it++) {
3785 if ((*it)["node"].get<std::string>().compare("chamber_light") == 0)
3786 {
3787 m_lamp->SetChamberLight((*it)["mode"].get<std::string>());
3788 }
3789 }
3790 }
3791 }
3792 catch (...) {
3793 ;
3794 }
3795 }
3796#pragma endregion
3797 if (!key_field_only) {
3798
3799 if (jj.contains("nozzle_diameter") && jj.contains("nozzle_type"))
3800 {
3801 std::optional<int> flag_e3d;
3802 if (jj.contains("flag3")) {
3803 int flag3 = jj["flag3"].get<int>();
3804 flag_e3d = std::make_optional(get_flag_bits(flag3, 10, 3));
3805 has_extra_flow_type = true;
3806 }
3807
3808 DevNozzleSystemParser::ParseV1_0(jj["nozzle_type"], jj["nozzle_diameter"], m_nozzle_system, flag_e3d);
3809 }
3810 }
3811
3812#pragma region upgrade
3813 try {
3814 if (jj.contains("upgrade_state")) {
3815 if (jj["upgrade_state"].contains("status"))
3816 upgrade_status = jj["upgrade_state"]["status"].get<std::string>();
3817 if (jj["upgrade_state"].contains("progress")) {
3818 upgrade_progress = jj["upgrade_state"]["progress"].get<std::string>();
3819 } if (jj["upgrade_state"].contains("new_version_state"))
3820 upgrade_new_version = jj["upgrade_state"]["new_version_state"].get<int>() == 1 ? true : false;
3821 if (!check_enable_np(jj) && jj["upgrade_state"].contains("ams_new_version_number"))/* is not used in new np, by AP*/
3822 ams_new_version_number = jj["upgrade_state"]["ams_new_version_number"].get<std::string>();
3823 if (jj["upgrade_state"].contains("ota_new_version_number"))
3824 ota_new_version_number = jj["upgrade_state"]["ota_new_version_number"].get<std::string>();
3825 if (jj["upgrade_state"].contains("ahb_new_version_number"))
3826 ahb_new_version_number = jj["upgrade_state"]["ahb_new_version_number"].get<std::string>();
3827 if (jj["upgrade_state"].contains("module"))
3828 upgrade_module = jj["upgrade_state"]["module"].get<std::string>();
3829 if (jj["upgrade_state"].contains("message"))
3830 upgrade_message = jj["upgrade_state"]["message"].get<std::string>();
3831 if (jj["upgrade_state"].contains("consistency_request"))
3832 upgrade_consistency_request = jj["upgrade_state"]["consistency_request"].get<bool>();
3833 if (jj["upgrade_state"].contains("force_upgrade"))
3834 upgrade_force_upgrade = jj["upgrade_state"]["force_upgrade"].get<bool>();
3835 if (jj["upgrade_state"].contains("err_code"))
3836 upgrade_err_code = jj["upgrade_state"]["err_code"].get<int>();
3837 if (jj["upgrade_state"].contains("dis_state")) {
3838 if ((int)upgrade_display_state != jj["upgrade_state"]["dis_state"].get<int>()
3839 && jj["upgrade_state"]["dis_state"].get<int>() == 3) {
3840 GUI::wxGetApp().CallAfter([this] {
3841 this->command_get_version();
3842 });
3843 }
3845 {
3847 }
3848 else
3849 {
3850 upgrade_display_state = (DevFirmwareUpgradingState)jj["upgrade_state"]["dis_state"].get<int>();
3852 {
3854 }
3855 }
3856 }
3857 else {
3860 else {
3861 //BBS compatibility with old version
3862 if (upgrade_status == "DOWNLOADING"
3863 || upgrade_status == "FLASHING"
3864 || upgrade_status == "UPGRADE_REQUEST"
3865 || upgrade_status == "PRE_FLASH_START"
3866 || upgrade_status == "PRE_FLASH_SUCCESS") {
3868 }
3869 else if (upgrade_status == "UPGRADE_SUCCESS"
3870 || upgrade_status == "DOWNLOAD_FAIL"
3871 || upgrade_status == "FLASH_FAIL"
3872 || upgrade_status == "PRE_FLASH_FAIL"
3873 || upgrade_status == "UPGRADE_FAIL") {
3875 }
3876 else {
3877 if (upgrade_new_version) {
3879 }
3880 else {
3882 }
3883 }
3884 }
3885 }
3886 // new ver list
3887 if (jj["upgrade_state"].contains("new_ver_list")) {
3888 m_new_ver_list_exist = true;
3889 new_ver_list.clear();
3890 for (auto ver_item = jj["upgrade_state"]["new_ver_list"].begin(); ver_item != jj["upgrade_state"]["new_ver_list"].end(); ver_item++) {
3891 DevFirmwareVersionInfo ver_info;
3892 if (ver_item->contains("name"))
3893 ver_info.name = (*ver_item)["name"].get<std::string>();
3894 else
3895 continue;
3896
3897 if (ver_item->contains("cur_ver"))
3898 ver_info.sw_ver = (*ver_item)["cur_ver"].get<std::string>();
3899 if (ver_item->contains("new_ver"))
3900 ver_info.sw_new_ver = (*ver_item)["new_ver"].get<std::string>();
3901
3902 if (ver_info.name == "ota") {
3903 ota_new_version_number = ver_info.sw_new_ver;
3904 }
3905
3906 new_ver_list.insert(std::make_pair(ver_info.name, ver_info));
3907 }
3908 }
3909 else {
3910 new_ver_list.clear();
3911 }
3912 }
3913 }
3914 catch (...) {
3915 ;
3916 }
3917#pragma endregion
3918
3919#pragma region camera
3920 if (!key_field_only) {
3921 // parse camera info
3922 try {
3923 if (jj.contains("ipcam")) {
3924 json const & ipcam = jj["ipcam"];
3925 if (ipcam.contains("ipcam_record")) {
3926 if (time(nullptr) - camera_recording_ctl_start > HOLD_TIME_3SEC) {
3927 if (ipcam["ipcam_record"].get<std::string>() == "enable") {
3929 }
3930 else {
3932 }
3933 }
3934 }
3935 if (ipcam.contains("timelapse")) {
3938 else {
3939 if (ipcam["timelapse"].get<std::string>() == "enable") {
3940 camera_timelapse = true;
3941 }
3942 else {
3943 camera_timelapse = false;
3944 }
3945 }
3946 }
3947 if (ipcam.contains("ipcam_dev")) {
3948 if (ipcam["ipcam_dev"].get<std::string>() == "1") {
3949 has_ipcam = true;
3950 } else {
3951 has_ipcam = false;
3952 webcam_stream_url.clear();
3953 }
3954 }
3955 if (ipcam.contains("resolution")) {
3958 else {
3959 camera_resolution = ipcam["resolution"].get<std::string>();
3960 }
3961 }
3962 if (ipcam.contains("resolution_supported")) {
3963 std::vector<std::string> resolution_supported;
3964 for (auto res : ipcam["resolution_supported"])
3965 resolution_supported.emplace_back(res.get<std::string>());
3966 camera_resolution_supported.swap(resolution_supported);
3967 }
3968 if (ipcam.contains("liveview")) {
3969 char const *local_protos[] = {"none", "disabled", "local", "rtsps", "rtsp"};
3970 liveview_local = enum_index_of(ipcam["liveview"].value<std::string>("local", "none").c_str(), local_protos, 5, LiveviewLocal::LVL_None);
3971 char const *remote_protos[] = {"none", "tutk", "agora", "tutk_agaro"};
3972 liveview_remote = enum_index_of(ipcam["liveview"].value<std::string>("remote", "none").c_str(), remote_protos, 4, LiveviewRemote::LVR_None);
3973 }
3974 if (ipcam.contains("file")) {
3975 char const *local_protos[] = {"none", "local"};
3976 file_local = enum_index_of(ipcam["file"].value<std::string>("local", "none").c_str(), local_protos, 2, FileLocal::FL_None);
3977 char const *remote_protos[] = {"none", "tutk", "agora", "tutk_agaro"};
3978 file_remote = enum_index_of(ipcam["file"].value<std::string>("remote", "none").c_str(), remote_protos, 4, FileRemote::FR_None);
3979 file_model_download = ipcam["file"].value<std::string>("model_download", "disabled") == "enabled";
3980 }
3981 virtual_camera = ipcam.value<std::string>("virtual_camera", "disabled") == "enabled";
3982 if (ipcam.contains("rtsp_url")) {
3983 local_rtsp_url = ipcam["rtsp_url"].get<std::string>();
3984 liveview_local = local_rtsp_url.empty() ? LVL_None : local_rtsp_url == "disable"
3985 ? LVL_Disable : boost::algorithm::starts_with(local_rtsp_url, "rtsps") ? LVL_Rtsps : LVL_Rtsp;
3986 }
3987 if (ipcam.contains("stream_url") && ipcam["stream_url"].is_string()) {
3988 webcam_stream_url = ipcam["stream_url"].get<std::string>();
3989 }
3990 if (ipcam.contains("tutk_server")) {
3991 tutk_state = ipcam["tutk_server"].get<std::string>();
3992 }
3993 }
3994 }
3995 catch (...) {
3996 ;
3997 }
3998
3999 try {
4000 if (jj.contains("xcam")) {
4001 if (time(nullptr) - xcam_ai_monitoring_hold_start > HOLD_TIME_3SEC) {
4002
4003 if (jj["xcam"].contains("cfg")) {
4005 // std::string cfg = jj["xcam"]["cfg"].get<std::string>();
4006
4007 int cfg = jj["xcam"]["cfg"].get<int>();
4009 switch (get_flag_bits(cfg, 8, 2)) {
4010 case 0: xcam_spaghetti_detection_sensitivity = "low"; break;
4011 case 1: xcam_spaghetti_detection_sensitivity = "medium"; break;
4012 case 2: xcam_spaghetti_detection_sensitivity = "high"; break;
4013 default: break;
4014 }
4015
4017 switch (get_flag_bits(cfg, 11, 2)) {
4018
4019 case 0: xcam_purgechutepileup_detection_sensitivity = "low"; break;
4020 case 1: xcam_purgechutepileup_detection_sensitivity = "medium"; break;
4021 case 2: xcam_purgechutepileup_detection_sensitivity = "high"; break;
4022 default: break;
4023 }
4024
4026 switch (get_flag_bits(cfg, 14, 2)) {
4027
4028 case 0: xcam_nozzleclumping_detection_sensitivity = "low"; break;
4029 case 1: xcam_nozzleclumping_detection_sensitivity = "medium"; break;
4030 case 2: xcam_nozzleclumping_detection_sensitivity = "high"; break;
4031 default: break;
4032 }
4033
4035 switch (get_flag_bits(cfg, 17, 2)) {
4036
4037 case 0: xcam_airprinting_detection_sensitivity = "low"; break;
4038 case 1: xcam_airprinting_detection_sensitivity = "medium"; break;
4039 case 2: xcam_airprinting_detection_sensitivity = "high"; break;
4040 default: break;
4041 }
4042
4043 }
4044 else if (jj["xcam"].contains("printing_monitor")) {
4045 // new protocol
4046 xcam_ai_monitoring = jj["xcam"]["printing_monitor"].get<bool>();
4047 } else {
4048 // old version protocol
4049 if (jj["xcam"].contains("spaghetti_detector")) {
4050 xcam_ai_monitoring = jj["xcam"]["spaghetti_detector"].get<bool>();
4051 if (jj["xcam"].contains("print_halt")) {
4052 bool print_halt = jj["xcam"]["print_halt"].get<bool>();
4053 if (print_halt) { xcam_ai_monitoring_sensitivity = "medium"; }
4054 }
4055 }
4056 }
4057
4058 if (jj["xcam"].contains("halt_print_sensitivity")) {
4059 xcam_ai_monitoring_sensitivity = jj["xcam"]["halt_print_sensitivity"].get<std::string>();
4060 }
4061
4062 }
4063
4064 if (time(nullptr) - xcam_first_layer_hold_start > HOLD_TIME_3SEC) {
4065 if (jj["xcam"].contains("first_layer_inspector")) {
4066 xcam_first_layer_inspector = jj["xcam"]["first_layer_inspector"].get<bool>();
4067 }
4068 }
4069
4070 if (time(nullptr) - xcam_buildplate_marker_hold_start > HOLD_TIME_3SEC) {
4071 if (jj["xcam"].contains("buildplate_marker_detector")) {
4072 xcam_buildplate_marker_detector = jj["xcam"]["buildplate_marker_detector"].get<bool>();
4074 } else {
4076 }
4077 }
4078 }
4079 }
4080 catch (...) {
4081 ;
4082 }
4083 }
4084#pragma endregion
4085
4086#pragma region hms
4087 if (!key_field_only && jj.contains("hms")) {
4088 m_hms_system->ParseHMSItems(jj["hms"]);
4089 }
4090#pragma endregion
4091
4092
4093#pragma region push_ams
4094 /* ams status */
4095 try {
4096 if (jj.contains("ams_status")) {
4097 int ams_status = jj["ams_status"].get<int>();
4098 this->_parse_ams_status(ams_status);
4099 }
4100 std::string str_j = jj.dump();
4101 if (jj.contains("cali_version")) {
4102 cali_version = jj["cali_version"].get<int>();
4103 }
4104 else {
4105 cali_version = -1;
4106 }
4107 std::string str = jj.dump();
4108 }
4109 catch (...) {
4110 ;
4111 }
4114 if (jj.contains("ams")) {
4115 DevFilaSystemParser::ParseV1_0(jj, this, m_fila_system.get(), key_field_only);
4116 }
4117
4118 /* vitrual tray*/
4119 if (!key_field_only) {
4120 try {
4121 if (jj.contains("vir_slot") && jj["vir_slot"].is_array()) {
4122
4123 for (auto it = jj["vir_slot"].begin(); it != jj["vir_slot"].end(); it++) {
4124 auto vslot = parse_vt_tray(it.value().get<json>());
4125
4126 if (vslot.id == std::to_string(VIRTUAL_TRAY_MAIN_ID)) {
4127 auto it = std::next(vt_slot.begin(), 0);
4128 if (it != vt_slot.end()) {
4129 vt_slot[0] = vslot;
4130 }
4131 else {
4132 vt_slot.push_back(vslot);
4133 }
4134 }
4135 else if (vslot.id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
4136 auto it = std::next(vt_slot.begin(), 1);
4137 if (it != vt_slot.end()) {
4138 vt_slot[1] = vslot;
4139 }
4140 else {
4141 vt_slot.push_back(vslot);
4142 }
4143 }
4144 }
4145
4146 }
4147 else if (jj.contains("vt_tray")) {
4148 auto main_slot = parse_vt_tray(jj["vt_tray"].get<json>());
4149 main_slot.id = std::to_string(VIRTUAL_TRAY_MAIN_ID);
4150
4151
4152 auto it = std::next(vt_slot.begin(), 0);
4153 if (it != vt_slot.end()) {
4154 vt_slot[0] = main_slot;
4155 }
4156 else {
4157 vt_slot.push_back(main_slot);
4158 }
4159 }
4160 else {
4162 }
4163 }
4164 catch (...) {
4165 ;
4166 }
4167 }
4168
4169 /*parse new print data*/
4170 try {
4171 parse_new_info(jj);
4172 } catch (...) {}
4173#pragma endregion
4174 } else if (jj["command"].get<std::string>() == "gcode_line") {
4175 //ack of gcode_line
4176 BOOST_LOG_TRIVIAL(debug) << "parse_json, ack of gcode_line = " << j.dump(4);
4177 } else if (jj["command"].get<std::string>() == "project_prepare") {
4178 //ack of project file
4179 BOOST_LOG_TRIVIAL(info) << "parse_json, ack of project_prepare = " << j.dump(4);
4180 if (m_agent) {
4181 if (jj.contains("job_id")) {
4182 this->job_id_ = DevJsonValParser::get_longlong_val(jj["job_id"]);
4183 }
4184 }
4185
4186 } else if (jj["command"].get<std::string>() == "project_file") {
4187 //ack of project file
4188 BOOST_LOG_TRIVIAL(debug) << "parse_json, ack of project_file = " << j.dump(4);
4189 std::string result;
4190 if (jj.contains("result")) {
4191 result = jj["result"].get<std::string>();
4192 if (result == "FAIL") {
4193 wxString text = _L("Failed to start print job");
4194 GUI::wxGetApp().push_notification(this, text);
4195 }
4196 }
4197 } else if (jj["command"].get<std::string>() == "ams_filament_setting" && !key_field_only) {
4198 // BBS trigger ams UI update
4199 ams_version = -1;
4200
4201 if (jj["ams_id"].is_number()) {
4202 int ams_id = jj["ams_id"].get<int>();
4203 int tray_id = 0;
4204 if (jj.contains("tray_id")) {
4205 tray_id = jj["tray_id"].get<int>();
4206 }
4207 if (ams_id == 255 && tray_id == VIRTUAL_TRAY_MAIN_ID) {
4208 BOOST_LOG_TRIVIAL(info) << "ams_filament_setting, parse tray info";
4209 vt_slot[0].nozzle_temp_max = std::to_string(jj["nozzle_temp_max"].get<int>());
4210 vt_slot[0].nozzle_temp_min = std::to_string(jj["nozzle_temp_min"].get<int>());
4211 vt_slot[0].color = jj["tray_color"].get<std::string>();
4212 vt_slot[0].setting_id = jj["tray_info_idx"].get<std::string>();
4213 //vt_tray.type = jj["tray_type"].get<std::string>();
4214 vt_slot[0].m_fila_type = setting_id_to_type(vt_slot[0].setting_id, jj["tray_type"].get<std::string>());
4215 // delay update
4216 vt_slot[0].set_hold_count();
4217 } else {
4218 auto ams = m_fila_system->GetAmsById(std::to_string(ams_id));
4219 if (ams) {
4220 tray_id = jj["tray_id"].get<int>();
4221 auto tray_it = ams->GetTrays().find(std::to_string(tray_id));
4222 if (tray_it != ams->GetTrays().end()) {
4223 BOOST_LOG_TRIVIAL(trace) << "ams_filament_setting, parse tray info";
4224 tray_it->second->nozzle_temp_max = std::to_string(jj["nozzle_temp_max"].get<int>());
4225 tray_it->second->nozzle_temp_min = std::to_string(jj["nozzle_temp_min"].get<int>());
4226 //tray_it->second->type = jj["tray_type"].get<std::string>();
4227 tray_it->second->color = jj["tray_color"].get<std::string>();
4228
4229 /*tray_it->second->cols.clear();
4230 if (jj.contains("cols")) {
4231 if (jj["cols"].is_array()) {
4232 for (auto it = jj["cols"].begin(); it != jj["cols"].end(); it++) {
4233 tray_it->second->cols.push_back(it.value().get<std::string>());
4234 }
4235 }
4236 }*/
4237
4238 tray_it->second->setting_id = jj["tray_info_idx"].get<std::string>();
4239 tray_it->second->m_fila_type = setting_id_to_type(tray_it->second->setting_id, jj["tray_type"].get<std::string>());
4240 // delay update
4241 tray_it->second->set_hold_count();
4242 } else {
4243 BOOST_LOG_TRIVIAL(warning) << "ams_filament_setting, can not find in trayList, tray_id=" << tray_id;
4244 }
4245 } else {
4246 BOOST_LOG_TRIVIAL(warning) << "ams_filament_setting, can not find in amsList, ams_id=" << ams_id;
4247 }
4248 }
4249 }
4250 } else if (jj["command"].get<std::string>() == "xcam_control_set" && !key_field_only) {
4251 if (jj.contains("module_name")) {
4252 if (jj.contains("enable") || jj.contains("control")) {
4253 bool enable = false;
4254 if (jj.contains("enable"))
4255 enable = jj["enable"].get<bool>();
4256 else if (jj.contains("control"))
4257 enable = jj["control"].get<bool>();
4258 else {
4259 ;
4260 }
4261
4262 if (jj["module_name"].get<std::string>() == "first_layer_inspector") {
4263 if (time(nullptr) - xcam_first_layer_hold_start > HOLD_TIME_3SEC) {
4265 }
4266 }
4267 else if (jj["module_name"].get<std::string>() == "buildplate_marker_detector") {
4268 if (time(nullptr) - xcam_buildplate_marker_hold_start > HOLD_TIME_3SEC) {
4270 }
4271 }
4272 else if (jj["module_name"].get<std::string>() == "printing_monitor") {
4273 if (time(nullptr) - xcam_ai_monitoring_hold_start > HOLD_TIME_3SEC) {
4274 xcam_ai_monitoring = enable;
4275 if (jj.contains("halt_print_sensitivity")) {
4276 xcam_ai_monitoring_sensitivity = jj["halt_print_sensitivity"].get<std::string>();
4277 }
4278 }
4279 }
4280 else if (jj["module_name"].get<std::string>() == "spaghetti_detector") {
4281 if (time(nullptr) - xcam_ai_monitoring_hold_start > HOLD_TIME_3SEC) {
4282 // old protocol
4283 xcam_ai_monitoring = enable;
4284 if (jj.contains("print_halt")) {
4285 if (jj["print_halt"].get<bool>()) {
4287 }
4288 }
4289 }
4290 }
4291 }
4292 }
4293 } else if(jj["command"].get<std::string>() == "print_option") {
4294 try {
4295 if (jj.contains("option")) {
4296 if (jj["option"].is_number()) {
4297 int option = jj["option"].get<int>();
4298 if (time(nullptr) - xcam_auto_recovery_hold_start > HOLD_TIME_3SEC) {
4299 xcam_auto_recovery_step_loss = ((option >> (int)PRINT_OP_AUTO_RECOVERY) & 0x01) != 0;
4300 }
4301 }
4302 }
4303
4304 if (time(nullptr) - xcam_auto_recovery_hold_start > HOLD_TIME_3SEC) {
4305 if (jj.contains("auto_recovery")) {
4306 xcam_auto_recovery_step_loss = jj["auto_recovery"].get<bool>();
4307 }
4308 }
4309 }
4310 catch(...) {
4311 }
4312 } else if (jj["command"].get<std::string>() == "extrusion_cali" || jj["command"].get<std::string>() == "flowrate_cali") {
4313 if (jj.contains("result")) {
4314 if (jj["result"].get<std::string>() == "success") {
4315 ;
4316 }
4317 else if (jj["result"].get<std::string>() == "fail") {
4318 std::string cali_mode = jj["command"].get<std::string>();
4319 std::string reason = jj["reason"].get<std::string>();
4320 wxString info = "";
4321 if (reason == "invalid nozzle_diameter" || reason == "nozzle_diameter is not supported") {
4322 info = _L("This calibration does not support the currently selected nozzle diameter");
4323 }
4324 else if (reason == "invalid handle_flowrate_cali param") {
4325 info = _L("Current flowrate cali param is invalid");
4326 }
4327 else if (reason == "nozzle_diameter is not matched") {
4328 info = _L("Selected diameter and machine diameter do not match");
4329 }
4330 else if (reason == "generate auto filament cali gcode failure") {
4331 info = _L("Failed to generate calibration G-code");
4332 }
4333 else {
4334 info = reason;
4335 }
4336 GUI::wxGetApp().push_notification(this, info, _L("Calibration error"), UserNotificationStyle::UNS_WARNING_CONFIRM);
4337 BOOST_LOG_TRIVIAL(info) << cali_mode << " result fail, reason = " << reason;
4338 }
4339 }
4340 } else if (jj["command"].get<std::string>() == "extrusion_cali_set") {
4341 int ams_id = -1;
4342 int tray_id = -1;
4343 int curr_tray_id = -1;
4344 if (jj.contains("tray_id")) {
4345 try {
4346 curr_tray_id = jj["tray_id"].get<int>();
4347 if (curr_tray_id == VIRTUAL_TRAY_MAIN_ID)
4348 tray_id = curr_tray_id;
4349 else if (curr_tray_id >= 0 && curr_tray_id < 16){
4350 ams_id = curr_tray_id / 4;
4351 tray_id = curr_tray_id % 4;
4352 } else {
4353 BOOST_LOG_TRIVIAL(trace) << "extrusion_cali_set: unsupported tray_id = " << curr_tray_id;
4354 }
4355 }
4356 catch(...) {
4357 ;
4358 }
4359 }
4360 if (tray_id == VIRTUAL_TRAY_MAIN_ID) {
4361 if (jj.contains("k_value"))
4362 vt_slot[0].k = jj["k_value"].get<float>();
4363 if (jj.contains("n_coef"))
4364 vt_slot[0].n = jj["n_coef"].get<float>();
4365 } else {
4366
4367 auto ams_item = m_fila_system->GetAmsById(std::to_string(ams_id));
4368 if (ams_item) {
4369 auto tray_item = ams_item->GetTrays().find(std::to_string(tray_id));
4370 if (tray_item != ams_item->GetTrays().end()) {
4371 if (jj.contains("k_value"))
4372 tray_item->second->k = jj["k_value"].get<float>();
4373 if (jj.contains("n_coef"))
4374 tray_item->second->n = jj["n_coef"].get<float>();
4375 }
4376 }
4377 }
4378 extrusion_cali_set_tray_id = curr_tray_id;
4379 extrusion_cali_set_hold_start = std::chrono::system_clock::now();
4380 }
4381 else if (jj["command"].get<std::string>() == "extrusion_cali_sel") {
4382 int ams_id = -1;
4383 int slot_id = -1;
4384 int tray_id = -1;
4385
4386 if (jj.contains("ams_id")) {
4387 try {
4388 ams_id = jj["ams_id"].get<int>();
4389 slot_id = jj["slot_id"].get<int>();
4390 } catch (...) {
4391 ;
4392 }
4393 }
4394 else {
4395 tray_id = jj["tray_id"].get<int>();
4396 if(tray_id >= 0 && tray_id < 16)
4397 {
4398 ams_id = tray_id / 4;
4399 slot_id = tray_id % 4;
4400 }
4401 else if(tray_id == VIRTUAL_TRAY_MAIN_ID || tray_id == VIRTUAL_TRAY_DEPUTY_ID){
4402 ams_id = tray_id;
4403 slot_id = 0;
4404 }
4405 }
4406
4407 BOOST_LOG_TRIVIAL(trace) << "extrusion_cali_sel: unsupported ams_id = " << ams_id << "slot_id = " << slot_id;
4408
4409 if (jj.contains("cali_idx")) {
4410 if (ams_id == VIRTUAL_TRAY_MAIN_ID || ams_id == VIRTUAL_TRAY_DEPUTY_ID) {
4411
4412 if (ams_id == VIRTUAL_TRAY_MAIN_ID && vt_slot.size() > 0) {
4413
4414 vt_slot[MAIN_EXTRUDER_ID].cali_idx = jj["cali_idx"].get<int>();
4415 vt_slot[MAIN_EXTRUDER_ID].set_hold_count();
4416
4417 } else if (ams_id == VIRTUAL_TRAY_DEPUTY_ID && vt_slot.size() > 1) {
4418
4419 vt_slot[DEPUTY_EXTRUDER_ID].cali_idx = jj["cali_idx"].get<int>();
4420 vt_slot[DEPUTY_EXTRUDER_ID].set_hold_count();
4421
4422 }
4423
4424 }
4425 else {
4426 auto tray_item = m_fila_system->GetAmsTray(std::to_string(ams_id), std::to_string(slot_id));
4427 if (tray_item)
4428 {
4429 tray_item->cali_idx = jj["cali_idx"].get<int>();
4430 tray_item->set_hold_count();
4431 }
4432 }
4433 }
4434
4435 }
4436 else if (jj["command"].get<std::string>() == "extrusion_cali_get") {
4437 std::string str = jj.dump();
4439 BOOST_LOG_TRIVIAL(info) << "bbs extrusion_cali_get: " << str;
4440 request_tab_from_bbs = false;
4442 bool is_succeed = true;
4443 if (jj.contains("result") && jj.contains("reason")) {
4444 if (jj["result"].get<std::string>() == "fail") {
4445 is_succeed = false;
4446 }
4447 }
4448
4449 if (is_succeed) {
4451 has_get_pa_calib_tab = true;
4452 }
4453
4454 if (jj.contains("filaments") && jj["filaments"].is_array()) {
4455 try {
4456 for (auto it = jj["filaments"].begin(); it != jj["filaments"].end(); it++) {
4457 PACalibResult pa_calib_result;
4458 pa_calib_result.filament_id = (*it)["filament_id"].get<std::string>();
4459 pa_calib_result.name = (*it)["name"].get<std::string>();
4460 pa_calib_result.cali_idx = (*it)["cali_idx"].get<int>();
4461
4462 if ((*it).contains("setting_id")) {
4463 pa_calib_result.setting_id = (*it)["setting_id"].get<std::string>();
4464 }
4465
4466 if ((*it).contains("extruder_id")) {
4467 pa_calib_result.extruder_id = (*it)["extruder_id"].get<int>();
4468 }
4469
4470 if ((*it).contains("nozzle_id")) {
4471 pa_calib_result.nozzle_volume_type = convert_to_nozzle_type((*it)["nozzle_id"].get<std::string>());
4472 }
4473
4474 if ((*it).contains("nozzle_pos")) {
4475 pa_calib_result.nozzle_pos_id = (*it)["nozzle_pos"].get<int>();
4476 }
4477
4478 if ((*it).contains("nozzle_sn")) {
4479 pa_calib_result.nozzle_sn = (*it)["nozzle_sn"].get<std::string>();
4480 }
4481
4482 if (jj["nozzle_diameter"].is_number_float()) {
4483 pa_calib_result.nozzle_diameter = jj["nozzle_diameter"].get<float>();
4484 } else if (jj["nozzle_diameter"].is_string()) {
4485 pa_calib_result.nozzle_diameter = string_to_float(jj["nozzle_diameter"].get<std::string>());
4486 }
4487
4488 if ((*it)["k_value"].is_number_float())
4489 pa_calib_result.k_value = (*it)["k_value"].get<float>();
4490 else if ((*it)["k_value"].is_string())
4491 pa_calib_result.k_value = string_to_float((*it)["k_value"].get<std::string>());
4492
4493 if ((*it)["n_coef"].is_number_float())
4494 pa_calib_result.n_coef = (*it)["n_coef"].get<float>();
4495 else if ((*it)["n_coef"].is_string())
4496 pa_calib_result.n_coef = string_to_float((*it)["n_coef"].get<std::string>());
4497
4498 if (check_pa_result_validation(pa_calib_result))
4499 pa_calib_tab.push_back(pa_calib_result);
4500 else {
4501 BOOST_LOG_TRIVIAL(info) << "pa result is invalid";
4502 }
4503 }
4504
4505 }
4506 catch (...) {
4507
4508 }
4509 }
4510 // notify cali history to update
4511 }
4512 }
4513 else if (jj["command"].get<std::string>() == "extrusion_cali_get_result") {
4514 std::string str = jj.dump();
4515 BOOST_LOG_TRIVIAL(info) << "extrusion_cali_get_result: " << str;
4517 bool is_succeed = true;
4518 if (jj.contains("result") && jj.contains("reason")) {
4519 if (jj["result"].get<std::string>() == "fail") {
4520 if (jj.contains("err_code")) {
4521 is_succeed = false;
4522 }
4523 }
4524 }
4525
4526 if (is_succeed)
4527 get_pa_calib_result = true;
4528
4529 if (jj.contains("filaments") && jj["filaments"].is_array()) {
4530 try {
4531 for (auto it = jj["filaments"].begin(); it != jj["filaments"].end(); it++) {
4532 PACalibResult pa_calib_result;
4533 pa_calib_result.filament_id = (*it)["filament_id"].get<std::string>();
4534
4535 if ((*it).contains("setting_id")) {
4536 pa_calib_result.setting_id = (*it)["setting_id"].get<std::string>();
4537 }
4538
4539 // old
4540 if (jj["nozzle_diameter"].is_number_float()) {
4541 pa_calib_result.nozzle_diameter = jj["nozzle_diameter"].get<float>();
4542 } else if (jj["nozzle_diameter"].is_string()) {
4543 pa_calib_result.nozzle_diameter = string_to_float(jj["nozzle_diameter"].get<std::string>());
4544 }
4545
4546 // new: should get nozzle diameter from filament item
4547 if ((*it).contains("setting_id")) {
4548 if ((*it)["nozzle_diameter"].is_number_float()) {
4549 pa_calib_result.nozzle_diameter = (*it)["nozzle_diameter"].get<float>();
4550 } else if ((*it)["nozzle_diameter"].is_string()) {
4551 pa_calib_result.nozzle_diameter = string_to_float((*it)["nozzle_diameter"].get<std::string>());
4552 }
4553 }
4554
4555 if (it->contains("ams_id")) {
4556 pa_calib_result.ams_id = (*it)["ams_id"].get<int>();
4557 } else {
4558 pa_calib_result.ams_id = 0;
4559 }
4560
4561 if (it->contains("slot_id")) {
4562 pa_calib_result.slot_id = (*it)["slot_id"].get<int>();
4563 } else {
4564 pa_calib_result.slot_id = 0;
4565 }
4566
4567 if (it->contains("extruder_id")) {
4568 pa_calib_result.extruder_id = (*it)["extruder_id"].get<int>();
4569 } else {
4570 pa_calib_result.extruder_id = -1;
4571 }
4572
4573 if (it->contains("nozzle_id")) {
4574 pa_calib_result.nozzle_volume_type = convert_to_nozzle_type((*it)["nozzle_id"].get<std::string>());
4575 } else {
4576 pa_calib_result.nozzle_volume_type = NozzleVolumeType::nvtStandard;
4577 }
4578
4579 if (it->contains("nozzle_pos")) {
4580 pa_calib_result.nozzle_pos_id = (*it)["nozzle_pos"].get<int>();
4581 }
4582
4583 if (it->contains("nozzle_sn")) {
4584 pa_calib_result.nozzle_sn = (*it)["nozzle_sn"].get<std::string>();
4585 }
4586
4587 if ((*it)["k_value"].is_number_float())
4588 pa_calib_result.k_value = (*it)["k_value"].get<float>();
4589 else if ((*it)["k_value"].is_string())
4590 pa_calib_result.k_value = string_to_float((*it)["k_value"].get<std::string>());
4591
4592 if ((*it)["n_coef"].is_number_float())
4593 pa_calib_result.n_coef = (*it)["n_coef"].get<float>();
4594 else if ((*it)["n_coef"].is_string())
4595 pa_calib_result.n_coef = string_to_float((*it)["n_coef"].get<std::string>());
4596
4597 if (it->contains("confidence")) {
4598 pa_calib_result.confidence = (*it)["confidence"].get<int>();
4599 } else {
4600 pa_calib_result.confidence = 0;
4601 }
4602
4604 pa_calib_result.tray_id = get_tray_id_by_ams_id_and_slot_id(pa_calib_result.ams_id, pa_calib_result.slot_id);
4605 else
4606 pa_calib_result.tray_id = (*it)["tray_id"].get<int>();
4607
4608 if (check_pa_result_validation(pa_calib_result))
4609 pa_calib_results.push_back(pa_calib_result);
4610 else {
4611 BOOST_LOG_TRIVIAL(info) << "pa result is invalid";
4612 }
4613 }
4614 } catch (...) {}
4615 }
4616
4617 if (pa_calib_results.empty()) {
4618 BOOST_LOG_TRIVIAL(info) << "no pa calib result";
4619 }
4620 }
4621 else if (jj["command"].get<std::string>() == "flowrate_get_result" && !key_field_only) {
4623
4624 get_flow_calib_result = true;
4625 if (jj.contains("filaments") && jj["filaments"].is_array()) {
4626 try {
4627#ifdef CALI_DEBUG
4628 std::string str = jj.dump();
4629 BOOST_LOG_TRIVIAL(info) << "flowrate_get_result: " << str;
4630#endif
4631 for (auto it = jj["filaments"].begin(); it != jj["filaments"].end(); it++) {
4632 FlowRatioCalibResult flow_ratio_calib_result;
4633 flow_ratio_calib_result.tray_id = (*it)["tray_id"].get<int>();
4634 flow_ratio_calib_result.filament_id = (*it)["filament_id"].get<std::string>();
4635 flow_ratio_calib_result.setting_id = (*it)["setting_id"].get<std::string>();
4636 flow_ratio_calib_result.nozzle_diameter = string_to_float(jj["nozzle_diameter"].get<std::string>());
4637 flow_ratio_calib_result.flow_ratio = string_to_float((*it)["flow_ratio"].get<std::string>());
4638 if (it->contains("confidence")) {
4639 flow_ratio_calib_result.confidence = (*it)["confidence"].get<int>();
4640 } else {
4641 flow_ratio_calib_result.confidence = 0;
4642 }
4643
4644 flow_ratio_results.push_back(flow_ratio_calib_result);
4645 }
4646
4647 } catch (...) {}
4648 }
4649 }
4650 m_fan->command_handle_response(jj);
4651 }
4652 }
4653
4654 if (!key_field_only) {
4655 try {
4656 if (j.contains("camera")) {
4657 if (j["camera"].contains("command")) {
4658 if (j["camera"]["command"].get<std::string>() == "ipcam_timelapse") {
4661 }
4662 else
4663 {
4664 if (j["camera"]["control"].get<std::string>() == "enable") this->camera_timelapse = true;
4665 if (j["camera"]["control"].get<std::string>() == "disable") this->camera_timelapse = false;
4666 BOOST_LOG_TRIVIAL(info) << "ack of timelapse = " << camera_timelapse;
4667 }
4668 } else if (j["camera"]["command"].get<std::string>() == "ipcam_record_set") {
4669 if (time(nullptr) - camera_recording_ctl_start > HOLD_TIME_3SEC) {
4670 if (j["camera"]["control"].get<std::string>() == "enable") this->camera_recording_when_printing = true;
4671 if (j["camera"]["control"].get<std::string>() == "disable") this->camera_recording_when_printing = false;
4672 BOOST_LOG_TRIVIAL(info) << "ack of ipcam_record_set " << camera_recording_when_printing;
4673 }
4674 } else if (j["camera"]["command"].get<std::string>() == "ipcam_resolution_set") {
4677 }
4678 else
4679 {
4680 this->camera_resolution = j["camera"]["resolution"].get<std::string>();
4681 BOOST_LOG_TRIVIAL(info) << "ack of resolution = " << camera_resolution;
4682 }
4683 } else if (j["camera"]["command"].get<std::string>() == "ipcam_get_media_info") {
4684 if (j["camera"].contains("sub_command") &&
4685 j["camera"]["sub_command"].get<std::string>() == "is_timelapse_storage_enough") {
4686 timelapse_storage_check_result = j["camera"].value("result", -1);
4687 timelapse_storage_is_enough = j["camera"].value("is_enough", true);
4688 timelapse_storage_file_count = j["camera"].value("file_count", 0);
4690 BOOST_LOG_TRIVIAL(info) << "timelapse storage check: result=" << timelapse_storage_check_result
4691 << " is_enough=" << timelapse_storage_is_enough
4692 << " file_count=" << timelapse_storage_file_count;
4693 }
4694 }
4695 }
4696 }
4697 } catch (...) {}
4698 }
4699
4700 if (!key_field_only) {
4701 // upgrade
4702 try {
4703 if (j.contains("upgrade")) {
4704 if (j["upgrade"].contains("command")) {
4705 if (j["upgrade"]["command"].get<std::string>() == "upgrade_confirm") {
4708 BOOST_LOG_TRIVIAL(info) << "ack of upgrade_confirm";
4709 }
4710
4711 bool check_studio_cmd = true;
4712 if (j["upgrade"].contains("sequence_id")) {
4713 try
4714 {
4715 std::string str_seq = j["upgrade"]["sequence_id"].get<std::string>();
4716 check_studio_cmd = is_studio_cmd(stoi(str_seq));
4717 }
4718 catch (...) { }
4719 }
4720
4721 if (check_studio_cmd && j["upgrade"].contains("err_code")) {
4722 if (j["upgrade"]["err_code"].is_number()) {
4723 add_command_error_code_dlg(j["upgrade"]["err_code"].get<int>());
4724 }
4725 }
4726 }
4727 }
4728 }
4729 catch (...) {
4730 ;
4731 }
4732 }
4733
4734 if (!key_field_only) {
4735 BOOST_LOG_TRIVIAL(trace) << "parse_json m_active_state =" << m_active_state;
4737 }
4738 }
4739 catch (...) {
4740 BOOST_LOG_TRIVIAL(trace) << "parse_json failed! dev_id=" << this->get_dev_id() <<", payload = " << payload;
4741 }
4742
4743 std::chrono::system_clock::time_point clock_stop = std::chrono::system_clock::now();
4744 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(clock_stop - clock_start);
4745 if (diff.count() > 10.0f) {
4746 BOOST_LOG_TRIVIAL(trace) << "parse_json timeout = " << diff.count();
4747 }
4748 DeviceManager::update_local_machine(*this, m_manager ? m_manager->get_app_config() : GUI::wxGetApp().app_config);
4749
4750 return 0;
4751}
int get_tray_id_by_ams_id_and_slot_id(int ams_id, int slot_id)
Definition DeviceManager.cpp:129
#define TIME_OUT
Definition DeviceManager.cpp:119
#define MINUTE_30
Definition DeviceManager.cpp:118
void sanitizeToUtf8(std::string &str)
Definition DeviceManager.cpp:325
#define RETRY_INTERNAL
Definition DeviceManager.hpp:60
static void ParseV1_0(const nlohmann::json &print_json, DevBed *system)
Definition DevBed.cpp:9
static void ParseV1_0(const nlohmann::json &print_json, MachineObject *obj, DevFilaSystem *system, bool key_field_only)
Definition DevFilaSystem.cpp:382
static std::string get_longlong_val(const nlohmann::json &j)
Definition DevUtil.cpp:173
static void ParseV1_0(const nlohmann::json &nozzletype_json, const nlohmann::json &diameter_json, DevNozzleSystem *system, std::optional< int > flag_e3d)
Definition DevNozzleSystem.cpp:472
static void Parse(DevPrintOptions *opts, const nlohmann::json &print_json)
Definition DevPrintOptions.cpp:38
static void ParseV1_0(const nlohmann::json &print_json, DevStorage *system)
Definition DevStorage.cpp:21
static std::string convertToIp(long long ip)
Definition DevUtil.cpp:166
static void update_local_machine(const MachineObject &m)
Definition DevManager.cpp:504
static void ParseV1_0(const nlohmann::json &extruder_json, DevExtderSystem *system)
Definition DevExtruderSystem.cpp:202
PlateMakerDectect m_plate_maker_detect_type
Definition DeviceManager.hpp:623
PrinterFirmwareType firmware_type
Definition DeviceManager.hpp:410
BBLSubTask * get_subtask()
Definition DeviceManager.cpp:4824
PlateMakerDectect
Definition DeviceManager.hpp:568
std::string task_id_
Definition DeviceManager.hpp:700
int command_request_push_all(bool request_now=false)
Definition DeviceManager.cpp:1420
int last_online_version
Definition DeviceManager.hpp:365
bool is_support_wait_sending_finish
Definition DeviceManager.hpp:645
bool ams_support_virtual_tray
Definition DeviceManager.hpp:315
std::chrono::system_clock::time_point last_utc_time
Definition DeviceManager.hpp:295
std::string parse_version()
Definition DeviceManager.cpp:1346
std::string link_th
Definition DeviceManager.hpp:374
std::vector< int > bed_temp_range
Definition DeviceManager.hpp:687
int is_support_bed_leveling
Definition DeviceManager.hpp:634
void update_printer_preset_name()
Definition DeviceManager.cpp:5827
int last_cali_version
Definition DeviceManager.hpp:480
bool xcam_disable_ai_detection_display
Definition DeviceManager.hpp:592
void update_filament_list()
Definition DeviceManager.cpp:5764
int ams_version
Definition DeviceManager.hpp:320
std::vector< int > nozzle_temp_range
Definition DeviceManager.hpp:684
bool is_support_fila_change_abort
Definition DeviceManager.hpp:935
LiveviewLocal liveview_local
Definition DeviceManager.hpp:562
std::vector< PACalibResult > pa_calib_tab
Definition DeviceManager.hpp:494
std::string job_id_
Definition DeviceManager.hpp:702
int upgrade_err_code
Definition DeviceManager.hpp:432
void parse_version_func()
Definition DeviceManager.cpp:1361
void parse_new_info(nlohmann::json print)
Definition DeviceManager.cpp:5335
bool is_support_ams_humidity
Definition DeviceManager.hpp:636
std::string link_ams
Definition DeviceManager.hpp:375
bool online_rfid
Definition DeviceManager.hpp:362
bool is_support_command_ams_switch
Definition DeviceManager.hpp:641
bool is_support_new_auto_cali_method
Definition DeviceManager.hpp:479
bool is_support_send_to_sdcard
Definition DeviceManager.hpp:629
bool virtual_camera
Definition DeviceManager.hpp:588
bool is_support_ext_change_assist_old
Definition DeviceManager.hpp:936
bool is_studio_cmd(int seq)
Definition DeviceManager.cpp:1365
bool online_ahb
Definition DeviceManager.hpp:363
json_diff print_json
Definition DeviceManager.hpp:695
void parse_home_flag(int flag)
Definition DeviceManager.cpp:1178
std::vector< std::tuple< std::string, uint64_t, uint64_t > > message_delay
Definition DeviceManager.hpp:125
std::map< std::string, DevFirmwareVersionInfo > new_ver_list
Definition DeviceManager.hpp:430
std::string ota_new_version_number
Definition DeviceManager.hpp:417
bool network_wired
Definition DeviceManager.hpp:376
int curr_layer
Definition DeviceManager.hpp:473
int extrusion_cali_set_tray_id
Definition DeviceManager.hpp:324
void parse_new_info2(const nlohmann::json &info)
Definition DeviceManager.cpp:5561
void update_print_progress(const nlohmann::json &value)
Definition DeviceManager.cpp:2667
int total_layers
Definition DeviceManager.hpp:474
bool get_pa_calib_result
Definition DeviceManager.hpp:495
PrinterFirmwareType lifecycle
Definition DeviceManager.hpp:411
bool check_enable_np(const nlohmann::json &print) const
Definition DeviceManager.cpp:5316
bool is_support_auto_recovery_step_loss
Definition DeviceManager.hpp:635
bool is_support_filament_backup
Definition DeviceManager.hpp:631
std::chrono::system_clock::time_point extrusion_cali_set_hold_start
Definition DeviceManager.hpp:325
bool file_model_download
Definition DeviceManager.hpp:587
bool is_support_build_plate_marker_detect
Definition DeviceManager.hpp:622
int cali_version
Definition DeviceManager.hpp:481
int gcode_file_prepare_percent
Definition DeviceManager.hpp:728
void store_version_info(const DevFirmwareVersionInfo &info)
Definition DeviceManager.cpp:1046
std::string upgrade_message
Definition DeviceManager.hpp:413
int upgrade_display_hold_count
Definition DeviceManager.hpp:409
void _parse_ams_status(int ams_status)
Definition DeviceManager.cpp:865
void reset_pa_cali_result()
Definition DeviceManager.hpp:505
std::string tutk_state
Definition DeviceManager.hpp:561
bool is_support_layer_num
Definition DeviceManager.hpp:475
int parse_msg_count
Definition DeviceManager.hpp:292
void parse_state_changed_event()
Definition DeviceManager.cpp:1165
int m_plate_index
Definition DeviceManager.hpp:726
bool timelapse_storage_is_enough
Definition DeviceManager.hpp:669
bool has_get_pa_calib_tab
Definition DeviceManager.hpp:492
bool is_support_mqtt_alive
Definition DeviceManager.hpp:642
bool m_new_ver_list_exist
Definition DeviceManager.hpp:431
static std::string setting_id_to_type(std::string setting_id, std::string tray_type)
Definition DeviceManager.cpp:2876
int printing_speed_mag
Definition DeviceManager.hpp:543
void set_dev_ip(std::string ip)
Definition DeviceManager.hpp:204
int timelapse_storage_check_result
Definition DeviceManager.hpp:668
int timelapse_storage_file_count
Definition DeviceManager.hpp:670
void set_print_state(std::string status)
Definition DeviceManager.cpp:2653
FileLocal file_local
Definition DeviceManager.hpp:564
void update_slice_info(std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx)
Definition DeviceManager.cpp:4959
std::vector< FlowRatioCalibResult > flow_ratio_results
Definition DeviceManager.hpp:498
bool check_version_valid()
Definition DeviceManager.cpp:967
std::string subtask_name
Definition DeviceManager.hpp:736
std::string local_rtsp_url
Definition DeviceManager.hpp:559
bool is_tunnel_mqtt
Definition DeviceManager.hpp:304
bool is_support_1080dpi
Definition DeviceManager.hpp:639
bool get_flow_calib_result
Definition DeviceManager.hpp:497
std::vector< int > m_partskip_ids
Definition DeviceManager.hpp:615
void set_ctt_dlg(wxString text)
Definition DeviceManager.cpp:4753
std::string ahb_new_version_number
Definition DeviceManager.hpp:418
std::string ams_new_version_number
Definition DeviceManager.hpp:416
void add_command_error_code_dlg(int command_err, nlohmann::json action_json=nlohmann::json{})
Definition DeviceManager.cpp:6089
bool is_support_refresh_nozzle
Definition DeviceManager.hpp:657
bool is_support_filament_setting_inprinting
Definition DeviceManager.hpp:651
bool check_pa_result_validation(PACalibResult &result)
Definition DeviceManager.cpp:1084
int m_active_state
Definition DeviceManager.hpp:303
int online_version
Definition DeviceManager.hpp:364
DevAmsTray parse_vt_tray(nlohmann::json vtray)
Definition DeviceManager.cpp:5151
void reset_flow_rate_cali_result()
Definition DeviceManager.hpp:510
std::atomic< bool > timelapse_storage_check_done
Definition DeviceManager.hpp:667
bool is_support_update_remain
Definition DeviceManager.hpp:633
std::string m_agent_thumbnail_url
Definition DeviceManager.hpp:705
int command_get_version(bool with_retry=true)
Definition DeviceManager.cpp:1400
std::string upgrade_status
Definition DeviceManager.hpp:414
std::string webcam_stream_url
Definition DeviceManager.hpp:560
bool is_support_cloud_print_only
Definition DeviceManager.hpp:640
int queue_number
Definition DeviceManager.hpp:541
std::string upgrade_module
Definition DeviceManager.hpp:415
void clear_version_info()
Definition DeviceManager.cpp:1030
bool contains(const std::vector< T > &vector, const Point &point)
Definition Geometry.cpp:55
@ UpgradingUnavaliable
Definition DevDefs.h:148
@ UpgradingFinished
Definition DevDefs.h:151
@ nvtStandard
Definition PrintConfig.hpp:619
@ UNS_WARNING_CONFIRM
Definition UserNotification.hpp:9
DevFirmwareUpgradeState DevFirmwareUpgradingState
Definition DevDefs.h:156
void flush_logs()
Definition utils.cpp:480
static NozzleVolumeType convert_to_nozzle_type(const std::string &str)
Definition DevCalib.cpp:36
static std::string _parse_printer_type(const std::string &type_str)
Definition DevConfigUtil.h:217
static ENUM enum_index_of(char const *key, char const **enum_names, int enum_count, ENUM defl=static_cast< ENUM >(0))
Definition DeviceManager.cpp:2900
@ LVL_Disable
Definition PrinterNetworkTypes.hpp:9
@ LVL_Rtsps
Definition PrinterNetworkTypes.hpp:11
@ LVL_None
Definition PrinterNetworkTypes.hpp:8
@ LVL_Rtsp
Definition PrinterNetworkTypes.hpp:12
@ FL_None
Definition PrinterNetworkTypes.hpp:23
unsigned get_logging_level()
Definition utils.cpp:221
unsigned int level_string_to_boost(std::string level)
Definition utils.cpp:195
static float string_to_float(const std::string &str_value)
Definition DevCalib.cpp:29
@ FIRMWARE_TYPE_ENGINEER
Definition DevFirmware.h:16
@ FIRMWARE_TYPE_PRODUCTION
Definition DevFirmware.h:17

References _L, _parse_ams_status(), Slic3r::_parse_printer_type(), access_code, Active, add_command_error_code_dlg(), ahb_new_version_number, Slic3r::PACalibResult::ams_id, ams_new_version_number, ams_support_virtual_tray, ams_version, bed_temp_range, bed_temperature_limit, Slic3r::PACalibResult::cali_idx, cali_version, camera_recording_ctl_start, camera_recording_when_printing, camera_resolution, camera_resolution_hold_count, camera_resolution_supported, camera_timelapse, camera_timelapse_hold_count, chamber_temp, chamber_temp_target, check_enable_np(), check_pa_result_validation(), check_version_valid(), clear_version_info(), command_get_version(), command_request_push_all(), Slic3r::FlowRatioCalibResult::confidence, Slic3r::PACalibResult::confidence, Slic3r::Geometry::contains(), Slic3r::convert_to_nozzle_type(), Slic3r::DevUtil::convertToIp(), curr_layer, DEPUTY_EXTRUDER_ID, dev_id, Slic3r::diff(), Slic3r::enum_index_of(), Slic3r::PACalibResult::extruder_id, extrusion_cali_set_hold_start, extrusion_cali_set_tray_id, Slic3r::FlowRatioCalibResult::filament_id, Slic3r::PACalibResult::filament_id, file_local, file_model_download, file_remote, Slic3r::DevFirmwareVersionInfo::firmware_flag, firmware_type, Slic3r::FIRMWARE_TYPE_ENGINEER, Slic3r::FIRMWARE_TYPE_PRODUCTION, Slic3r::FL_None, Slic3r::FlowRatioCalibResult::flow_ratio, flow_ratio_results, Slic3r::flush_logs(), Slic3r::FR_None, frame_temp, gcode_file_prepare_percent, get_dev_id(), get_flag_bits(), get_flow_calib_result, Slic3r::get_logging_level(), Slic3r::DevJsonValParser::get_longlong_val(), get_pa_calib_result, get_subtask(), get_tray_id_by_ams_id_and_slot_id(), get_version_retry, has_extra_flow_type, has_get_pa_calib_tab, has_ipcam, HOLD_COUNT_MAX, HOLD_TIME_3SEC, hw_switch_state, Slic3r::DevFirmwareVersionInfo::hw_ver, Slic3r::DevAmsSystemFirmwareSwitch::IDX_AMS_AMS2_AMSHT, is_enable_ams_np, is_lan_mode_printer(), is_studio_cmd(), is_support_1080dpi, is_support_agora, is_support_ams_humidity, is_support_auto_recovery_step_loss, is_support_bed_leveling, is_support_build_plate_marker_detect, is_support_cloud_print_only, is_support_command_ams_switch, is_support_ext_change_assist_old, is_support_fila_change_abort, is_support_filament_32_colors, is_support_filament_backup, is_support_filament_setting_inprinting, is_support_filament_tangle_detect, is_support_layer_num, is_support_motor_noise_cali, is_support_mqtt_alive, is_support_new_auto_cali_method, is_support_pa_calibration, is_support_prompt_sound, is_support_refresh_nozzle, is_support_send_to_sdcard, is_support_timelapse, is_support_tunnel_mqtt, is_support_update_remain, is_support_user_preset, is_support_wait_sending_finish, is_tunnel_mqtt, job_id_, jobState_, Slic3r::PACalibResult::k_value, last_cali_version, last_cloud_msg_time_, last_lan_msg_time_, last_online_version, last_push_time, last_update_time, last_utc_time, Slic3r::level_string_to_boost(), lifecycle, link_ams, link_th, liveview_local, liveview_remote, local_rtsp_url, Slic3r::LVL_Disable, Slic3r::LVL_None, Slic3r::LVL_Rtsp, Slic3r::LVL_Rtsps, Slic3r::LVR_None, m_active_state, m_agent, m_agent_thumbnail_url, m_axis, m_bed, m_chamber, m_config, m_extder_system, m_fan, m_fila_switch, m_fila_system, m_full_msg_count, m_gcode_file, m_hms_system, m_lamp, m_manager, m_new_ver_list_exist, m_nozzle_mapping_ptr, m_nozzle_system, m_partskip_ids, m_plate_index, m_plate_maker_detect_type, m_print_error_img_id, m_print_options, m_push_count, m_status, m_storage, MAIN_EXTRUDER_ID, mc_left_time, mc_print_error_code, mc_print_line_number, mc_print_stage, mc_print_sub_stage, message_delay, MINUTE_30, Slic3r::PACalibResult::n_coef, Slic3r::DevFirmwareVersionInfo::name, Slic3r::PACalibResult::name, network_wired, new_ver_list, NotActive, Slic3r::FlowRatioCalibResult::nozzle_diameter, Slic3r::PACalibResult::nozzle_diameter, Slic3r::PACalibResult::nozzle_pos_id, Slic3r::PACalibResult::nozzle_sn, nozzle_temp_range, Slic3r::PACalibResult::nozzle_volume_type, Slic3r::nvtStandard, obj_subtask_id, online_ahb, online_rfid, online_version, ota_new_version_number, pa_calib_results, pa_calib_tab, Slic3r::DevPrintOptionsParser::Parse(), parse_home_flag(), parse_msg_count, parse_new_info(), parse_new_info2(), parse_state_changed_event(), parse_version(), parse_version_func(), parse_vt_tray(), Slic3r::DevBed::ParseV1_0(), Slic3r::DevFilaSystemParser::ParseV1_0(), Slic3r::DevNozzleSystemParser::ParseV1_0(), Slic3r::DevStorage::ParseV1_0(), Slic3r::ExtderSystemParser::ParseV1_0(), print_error, print_json, PRINT_OP_AUTO_RECOVERY, print_status, print_type, printer_type, printing_speed_mag, Slic3r::BBLSubTask::printing_status, Slic3r::DevFirmwareVersionInfo::product_name, queue_number, request_tab_from_bbs, reset_flow_rate_cali_result(), reset_pa_cali_history_result(), reset_pa_cali_result(), RETRY_INTERNAL, sanitizeToUtf8(), set_access_code(), set_ctt_dlg(), set_dev_ip(), set_online_state(), set_print_state(), Slic3r::FlowRatioCalibResult::setting_id, Slic3r::PACalibResult::setting_id, setting_id_to_type(), Slic3r::PACalibResult::slot_id, Slic3r::DevFirmwareVersionInfo::sn, stage_curr, stage_list_info, stage_remaining_seconds, store_version_info(), Slic3r::string_to_float(), subtask_name, Slic3r::DevFirmwareVersionInfo::sw_new_ver, Slic3r::DevFirmwareVersionInfo::sw_ver, Slic3r::BBLSubTask::task_id, task_id_, TIME_OUT, timelapse_storage_check_done, timelapse_storage_check_result, timelapse_storage_file_count, timelapse_storage_is_enough, total_layers, Slic3r::trace(), Slic3r::NetworkAgent::track_update_property(), Slic3r::FlowRatioCalibResult::tray_id, Slic3r::PACalibResult::tray_id, tutk_state, Slic3r::UNS_WARNING_CONFIRM, update_filament_list(), Slic3r::DeviceManager::update_local_machine(), update_print_progress(), update_printer_preset_name(), update_slice_info(), upgrade_consistency_request, upgrade_display_hold_count, upgrade_display_state, upgrade_err_code, upgrade_force_upgrade, upgrade_message, upgrade_module, upgrade_new_version, upgrade_progress, upgrade_status, Slic3r::UpgradingAvaliable, Slic3r::UpgradingFinished, Slic3r::UpgradingInProgress, Slic3r::UpgradingUnavaliable, virtual_camera, VIRTUAL_TRAY_DEPUTY_ID, VIRTUAL_TRAY_MAIN_ID, vt_slot, webcam_stream_url, wifi_signal, xcam_ai_monitoring, xcam_ai_monitoring_hold_start, xcam_ai_monitoring_sensitivity, xcam_airprinting_detection, xcam_airprinting_detection_sensitivity, xcam_auto_recovery_hold_start, xcam_auto_recovery_step_loss, xcam_buildplate_marker_detector, xcam_buildplate_marker_hold_start, xcam_disable_ai_detection_display, xcam_first_layer_hold_start, xcam_first_layer_inspector, xcam_nozzleclumping_detection, xcam_nozzleclumping_detection_sensitivity, xcam_purgechutepileup_detection, xcam_purgechutepileup_detection_sensitivity, xcam_spaghetti_detection, and xcam_spaghetti_detection_sensitivity.

Referenced by reload_printer_settings().

Here is the caller graph for this function:

◆ parse_new_info()

void Slic3r::MachineObject::parse_new_info ( nlohmann::json print)
5336{
5338 if (!is_enable_np)
5339 {
5340 return;
5341 }
5342
5343 BOOST_LOG_TRIVIAL(info) << "using new print data for parsing";
5344
5345 /*cfg*/
5346 std::string cfg = print["cfg"].get<std::string>();
5347
5348 BOOST_LOG_TRIVIAL(info) << "new print data cfg = " << cfg;
5349
5350 if(!cfg.empty()){
5353
5354
5355 if (time(nullptr) - ams_user_setting_start > HOLD_COUNT_MAX)
5356 {
5357 m_fila_system->GetAmsSystemSetting().SetDetectOnInsertEnabled(get_flag_bits(cfg, 0));
5358 m_fila_system->GetAmsSystemSetting().SetDetectOnPowerupEnabled(get_flag_bits(cfg, 1));
5359 }
5360
5362
5363 if (time(nullptr) - camera_recording_ctl_start > HOLD_COUNT_MAX)
5364 {
5366 }
5367
5369 {
5371 }
5372 else
5373 {
5374 camera_resolution = get_flag_bits(cfg, 4) == 0 ? "720p" : "1080p";
5375 }
5376
5378 {
5380 }
5381 else
5382 {
5384 }
5385
5386 tutk_state = get_flag_bits(cfg, 6) == 1 ? "disable" : "";
5388 //is_support_build_plate_marker_detect = get_flag_bits(cfg, 12); todo yangcong
5390
5391 if (time(nullptr) - xcam_ai_monitoring_hold_start > HOLD_COUNT_MAX) {
5393
5394 switch (get_flag_bits(cfg, 13, 2)) {
5395 case 0: xcam_ai_monitoring_sensitivity = "never_halt"; break;
5396 case 1: xcam_ai_monitoring_sensitivity = "low"; break;
5397 case 2: xcam_ai_monitoring_sensitivity = "medium"; break;
5398 case 3: xcam_ai_monitoring_sensitivity = "high"; break;
5399 default: break;
5400 }
5401 }
5402
5403 if (time(nullptr) - xcam_auto_recovery_hold_start > HOLD_COUNT_MAX) {
5405 }
5406
5407 if (time(nullptr) - ams_user_setting_start > HOLD_COUNT_MAX){
5408 m_fila_system->GetAmsSystemSetting().SetDetectRemainEnabled(get_flag_bits(cfg, 17));
5409 }
5410
5411 if (time(nullptr) - ams_switch_filament_start > HOLD_TIME_3SEC){
5412 m_fila_system->GetAmsSystemSetting().SetAutoRefillEnabled(get_flag_bits(cfg, 18));
5413 }
5414
5417 }
5418
5419 if (time(nullptr) - xcam_door_open_check_start_time > HOLD_TIME_3SEC){
5421 }
5422
5423 if (time(nullptr) - xcam_prompt_sound_hold_start > HOLD_TIME_3SEC) {
5425 }
5426
5429 }
5430
5431 if (time(nullptr) - nozzle_blob_detection_hold_start > HOLD_TIME_3SEC) {
5433 }
5434
5436
5438 }
5439
5440 /*fun*/
5441 std::string fun = print["fun"].get<std::string>();
5442 BOOST_LOG_TRIVIAL(info) << "new print data fun = " << fun;
5443
5444 if (!fun.empty()) {
5445
5448
5449 is_220V_voltage = get_flag_bits(fun, 2) == 0?false:true;
5451 if (this->is_series_o()) { is_support_flow_calibration = false; } // todo: Temp modification due to incorrect machine push message for H2D
5453 if (this->is_series_p()) { is_support_pa_calibration = false; } // todo: Temp modification due to incorrect machine push message for P
5460 m_nozzle_system->SetSupportNozzleRack(get_flag_bits(fun, 60)); // H2C hotend rack support (device-side gate for the sync dialog)
5464 is_support_brtc = get_flag_bits(fun, 31);
5472 m_fan->SetSupportCoolingFilter(get_flag_bits(fun, 46));
5476 }
5477
5478 /*fun2*/
5479 std::string fun2;
5480 if (print.contains("fun2") && print["fun2"].is_string()) {
5481 fun2 = print["fun2"].get<std::string>();
5482 BOOST_LOG_TRIVIAL(info) << "new print data fun2 = " << fun2;
5483 }
5484
5485 // fun2 may have infinite length, use get_flag_bits_no_border
5486 if (!fun2.empty()) {
5492
5495 }
5496 }
5497
5498 /* Per-filament-index AMS slot mapping reported by the printer (task-level state) */
5499 if (print.contains("mapping") && print["mapping"].is_array()) {
5500 std::vector<uint16_t> new_mapping;
5501 new_mapping.reserve(print["mapping"].size());
5502 for (const auto& v : print["mapping"]) {
5503 new_mapping.push_back(static_cast<uint16_t>(v.get<unsigned>()));
5504 }
5505 print_job_filament_mapping = std::move(new_mapping);
5506 }
5507
5508 /*aux*/
5509 std::string aux = print["aux"].get<std::string>();
5510
5511 BOOST_LOG_TRIVIAL(info) << "new print data aux = " << aux;
5512
5513 if (!aux.empty()) {
5514 m_storage->set_sdcard_state(get_flag_bits(aux, 12, 2));
5515 m_has_timelapse_kit = (get_flag_bits(aux, 26, 1) == 1);
5516 }
5517
5518 /*stat*/
5519 std::string stat = print["stat"].get<std::string>();
5520
5521 BOOST_LOG_TRIVIAL(info) << "new print data stat = " << stat;
5522
5523 if (!stat.empty()) {
5525 m_lamp->SetLampCloseRecheck((get_flag_bits(stat, 36) == 1));
5526 }
5527
5528 /*device*/
5529 if (print.contains("device")) {
5530 json const& device = print["device"];
5531
5532
5533 //new fan data
5534 m_fan->ParseV3_0(device);
5535
5536 if (device.contains("type")) {
5537 m_device_mode = (DeviceMode)device["type"].get<int>();// FDM:1<<0 Laser:1<< Cut:1<<2
5538 }
5539
5540 DevBed::ParseV2_0(device,m_bed);
5541
5542 // Pass the whole device json: ParseV2_0 reads ext/rack nozzles from device["nozzle"] and the
5543 // hotend-rack state from device["holder"] (rack data lives outside device["nozzle"]). It is a
5544 // no-op for devices that report neither key, so non-rack machines are unaffected.
5546 if (device.contains("extruder")) { ExtderSystemParser::ParseV2_0(device["extruder"], m_extder_system);}
5547 if (device.contains("ext_tool")) { DevExtensionToolParser::ParseV2_0(device["ext_tool"], m_extension_tool); }
5548
5549 if (device.contains("ctc")) {
5550 json const& ctc = device["ctc"];
5551 int state = get_flag_bits(ctc["state"].get<int>(), 0, 4);
5552 if (ctc.contains("info")) {
5553 json const &info = ctc["info"];
5554 chamber_temp = get_flag_bits(info["temp"].get<int>(), 0, 16);
5555 chamber_temp_target = get_flag_bits(info["temp"].get<int>(), 16, 16);
5556 }
5557 }
5558 }
5559}
static void ParseV2_0(const nlohmann::json &print_json, DevBed *system)
Definition DevBed.cpp:19
static void ParseV2_0(const nlohmann::json &extension_tool_json, std::weak_ptr< DevExtensionTool > extension_tool)
Definition DevExtensionTool.cpp:18
@ LIGHT_EFFECT_OFF
Definition DevLamp.h:18
@ LIGHT_EFFECT_ON
Definition DevLamp.h:17
static void ParseV2_0(const nlohmann::json &device_json, DevNozzleSystem *system)
Definition DevNozzleSystem.cpp:529
static void ParseDetectionV2_1(DevPrintOptions *opts, std::string cfg)
Definition DevPrintOptions.cpp:202
static bool support_print_check_firmware_for_tpu_left(std::string type_str)
Definition DevConfigUtil.h:111
static void ParseV2_0(const nlohmann::json &extruder_json, DevExtderSystem *system)
Definition DevExtruderSystem.cpp:293
DeviceMode
Definition DeviceManager.hpp:581
bool is_support_partskip
Definition DeviceManager.hpp:656
bool is_support_spaghetti_detection
Definition DeviceManager.hpp:660
DoorOpenCheckState
Definition DeviceManager.hpp:574
bool is_support_ext_change_assist
Definition DeviceManager.hpp:655
bool is_support_airprinting_detection
Definition DeviceManager.hpp:663
bool is_support_nozzleclumping_detection
Definition DeviceManager.hpp:662
bool is_support_pa_mode
Definition DeviceManager.hpp:676
bool is_support_filament_manual_multi_color
Definition DeviceManager.hpp:677
bool is_support_brtc
Definition DeviceManager.hpp:654
bool is_support_purgechutepileup_detection
Definition DeviceManager.hpp:661
bool is_support_idelheadingprotect_detection
Definition DeviceManager.hpp:664
bool is_support_door_open_check
Definition DeviceManager.hpp:993
std::optional< bool > m_firmware_support_print_tpu_left
Definition DeviceManager.hpp:678
bool is_support_remote_dry
Definition DeviceManager.hpp:674
bool is_support_check_track_switch_match_slice_printer
Definition DeviceManager.hpp:675
uint32_t get_flag_bits_no_border(std::string str, int start_idx, int count=1) const
Definition DeviceManager.cpp:5658

References ams_switch_filament_start, ams_user_setting_start, camera_recording, camera_recording_ctl_start, camera_recording_when_printing, camera_resolution, camera_resolution_hold_count, camera_timelapse, camera_timelapse_hold_count, chamber_temp, chamber_temp_target, check_enable_np(), get_flag_bits(), get_flag_bits_no_border(), HOLD_COUNT_MAX, HOLD_TIME_3SEC, installed_upgrade_kit, is_220V_voltage, is_enable_np, is_series_o(), is_series_p(), is_support_agora, is_support_airprinting_detection, is_support_brtc, is_support_check_track_switch_match_slice_printer, is_support_door_open_check, is_support_ext_change_assist, is_support_filament_manual_multi_color, is_support_filament_tangle_detect, is_support_flow_calibration, is_support_idelheadingprotect_detection, is_support_internal_timelapse, is_support_motor_noise_cali, is_support_new_auto_cali_method, is_support_nozzle_blob_detection, is_support_nozzleclumping_detection, is_support_pa_calibration, is_support_pa_mode, is_support_partskip, is_support_print_with_emmc, is_support_prompt_sound, is_support_purgechutepileup_detection, is_support_remote_dry, is_support_spaghetti_detection, is_support_tunnel_mqtt, is_support_upgrade_kit, is_support_user_preset, Slic3r::DevLamp::LIGHT_EFFECT_OFF, Slic3r::DevLamp::LIGHT_EFFECT_ON, m_bed, m_device_mode, m_extder_system, m_extension_tool, m_fan, m_fila_system, m_firmware_support_print_tpu_left, m_has_timelapse_kit, m_lamp, m_nozzle_system, m_print_options, m_storage, m_support_mqtt_axis_control, m_support_mqtt_bet_ctrl, m_support_mqtt_homing, nozzle_blob_detection_enabled, nozzle_blob_detection_hold_start, Slic3r::DevPrintOptionsParser::ParseDetectionV2_1(), Slic3r::DevBed::ParseV2_0(), Slic3r::DevExtensionToolParser::ParseV2_0(), Slic3r::DevNozzleSystemParser::ParseV2_0(), Slic3r::ExtderSystemParser::ParseV2_0(), print_job_filament_mapping, printer_type, Slic3r::DevPrinterConfigUtil::support_print_check_firmware_for_tpu_left(), tutk_state, upgrade_force_upgrade, xcam__save_remote_print_file_to_storage, xcam__save_remote_print_file_to_storage_start_time, xcam_ai_monitoring, xcam_ai_monitoring_hold_start, xcam_ai_monitoring_sensitivity, xcam_allow_prompt_sound, xcam_auto_recovery_hold_start, xcam_auto_recovery_step_loss, xcam_door_open_check, xcam_door_open_check_start_time, xcam_filament_tangle_detect, xcam_filament_tangle_detect_hold_start, xcam_first_layer_hold_start, xcam_first_layer_inspector, and xcam_prompt_sound_hold_start.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_new_info2()

void Slic3r::MachineObject::parse_new_info2 ( const nlohmann::json & info)
5562{
5563 if (!info.is_object() || info.value("command", "") != "get_capabilities")
5564 return;
5565
5566 const auto capabilities_it = info.find("capabilities");
5567 if (capabilities_it == info.end() || !capabilities_it->is_object())
5568 return;
5569 const auto flags_it = capabilities_it->find("flags");
5570 if (flags_it == capabilities_it->end() || !flags_it->is_object())
5571 return;
5572
5573 const json& flags = *flags_it;
5574 BOOST_LOG_TRIVIAL(info) << "parse_new_info2: OrcaSonar capability flags=" << flags.dump();
5575
5576 auto parse_bool = [&flags](const char* name, bool& target) {
5577 const auto it = flags.find(name);
5578 if (it != flags.end() && it->is_boolean())
5579 target = it->get<bool>();
5580 };
5581
5582 parse_bool("support_send_to_sd", is_support_send_to_sdcard);
5583 parse_bool("support_filament_backup", is_support_filament_backup);
5584 parse_bool("support_update_remain", is_support_update_remain);
5585 parse_bool("support_auto_recovery_step_loss", is_support_auto_recovery_step_loss);
5586 parse_bool("support_ams_humidity", is_support_ams_humidity);
5587 parse_bool("support_prompt_sound", is_support_prompt_sound);
5588 parse_bool("support_filament_tangle_detect", is_support_filament_tangle_detect);
5589 parse_bool("support_1080dpi", is_support_1080dpi);
5590 parse_bool("support_cloud_print_only", is_support_cloud_print_only);
5591 parse_bool("support_command_ams_switch", is_support_command_ams_switch);
5592 parse_bool("support_mqtt_alive", is_support_mqtt_alive);
5593 parse_bool("support_motor_noise_cali", is_support_motor_noise_cali);
5594 parse_bool("support_timelapse", is_support_timelapse);
5595 parse_bool("support_user_preset", is_support_user_preset);
5596 parse_bool("support_refresh_nozzle", is_support_refresh_nozzle);
5597 parse_bool("support_flow_calibration", is_support_flow_calibration);
5598 parse_bool("support_build_plate_marker_detect", is_support_build_plate_marker_detect);
5599 parse_bool("support_nozzle_blob_detect", is_support_nozzle_blob_detection);
5600
5601 if (!m_manager->IsMultiMachineEnabled() && !is_support_agora)
5602 parse_bool("support_tunnel_mqtt", is_support_tunnel_mqtt);
5603
5604 const auto bed_leveling_it = flags.find("support_bed_leveling");
5605 if (bed_leveling_it != flags.end() && bed_leveling_it->is_number_integer())
5606 is_support_bed_leveling = bed_leveling_it->get<int>();
5607
5608 auto copy_bool = [&flags](json& target, const char* name) {
5609 const auto it = flags.find(name);
5610 if (it != flags.end() && it->is_boolean())
5611 target[name] = *it;
5612 };
5613
5614 // The capability manifest uses an object for this range, while the legacy
5615 // DeviceCore parser consumes a boolean plus a two-element range array.
5616 json device_config;
5617 copy_bool(device_config, "support_chamber");
5618 copy_bool(device_config, "support_first_layer_inspect");
5619 copy_bool(device_config, "support_ai_monitoring");
5620 copy_bool(device_config, "support_lidar_calibration");
5621 const auto chamber_edit_it = flags.find("support_chamber_temp_edit");
5622 if (chamber_edit_it != flags.end() && chamber_edit_it->is_boolean()) {
5623 device_config["support_chamber_temp_edit"] = *chamber_edit_it;
5624 } else if (chamber_edit_it != flags.end() && chamber_edit_it->is_object()) {
5625 const auto min_it = chamber_edit_it->find("min");
5626 const auto max_it = chamber_edit_it->find("max");
5627 if (min_it != chamber_edit_it->end() && max_it != chamber_edit_it->end() && min_it->is_number() && max_it->is_number()) {
5628 device_config["support_chamber_temp_edit"] = true;
5629 device_config["support_chamber_temp_edit_range"] = {*min_it, *max_it};
5630 }
5631 }
5632
5633 json fan_config;
5634 copy_bool(fan_config, "support_aux_fan");
5635 copy_bool(fan_config, "support_chamber_fan");
5636
5637 m_config->ParseConfig(device_config);
5638 m_fan->ParseV2_0(fan_config);
5639}

References is_support_1080dpi, is_support_agora, is_support_ams_humidity, is_support_auto_recovery_step_loss, is_support_bed_leveling, is_support_build_plate_marker_detect, is_support_cloud_print_only, is_support_command_ams_switch, is_support_filament_backup, is_support_filament_tangle_detect, is_support_flow_calibration, is_support_motor_noise_cali, is_support_mqtt_alive, is_support_nozzle_blob_detection, is_support_prompt_sound, is_support_refresh_nozzle, is_support_send_to_sdcard, is_support_timelapse, is_support_tunnel_mqtt, is_support_update_remain, is_support_user_preset, m_config, m_fan, and m_manager.

Referenced by parse_json().

Here is the caller graph for this function:

◆ parse_state_changed_event()

void Slic3r::MachineObject::parse_state_changed_event ( )
1166{
1167 // parse calibration done
1169 if (mc_print_stage == 1 && boost::contains(m_gcode_file, "auto_cali_for_user")) {
1170 calibration_done = true;
1171 } else {
1172 calibration_done = false;
1173 }
1174 }
1176}
int last_mc_print_stage
Definition DeviceManager.hpp:460

References calibration_done, last_mc_print_stage, m_gcode_file, and mc_print_stage.

Referenced by parse_json().

Here is the caller graph for this function:

◆ parse_version()

std::string Slic3r::MachineObject::parse_version ( )
1347{
1348 auto ota_version = module_vers.find("ota");
1349 if (ota_version != module_vers.end()) return ota_version->second.sw_ver;
1350 auto series = get_printer_series();
1351 if (series == PrinterSeries::SERIES_X1) {
1352 auto rv1126_version = module_vers.find("rv1126");
1353 if (rv1126_version != module_vers.end()) return rv1126_version->second.sw_ver;
1354 } else if (series == PrinterSeries::SERIES_P1P) {
1355 auto esp32_version = module_vers.find("esp32");
1356 if (esp32_version != module_vers.end()) return esp32_version->second.sw_ver;
1357 }
1358 return "";
1359}

References get_printer_series(), module_vers, SERIES_P1P, and SERIES_X1.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_version_func()

void Slic3r::MachineObject::parse_version_func ( )
1362{
1363}

Referenced by parse_json().

Here is the caller graph for this function:

◆ parse_vt_tray()

DevAmsTray Slic3r::MachineObject::parse_vt_tray ( nlohmann::json vtray)
5152{
5153 auto vt_tray = DevAmsTray(std::to_string(VIRTUAL_TRAY_MAIN_ID));
5154
5155 if (vtray.contains("id"))
5156 vt_tray.id = vtray["id"].get<std::string>();
5157 auto curr_time = std::chrono::system_clock::now();
5158 auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - extrusion_cali_set_hold_start);
5159 if (diff.count() > HOLD_TIMEOUT || diff.count() < 0
5161 if (vtray.contains("k"))
5162 vt_tray.k = vtray["k"].get<float>();
5163 if (vtray.contains("n"))
5164 vt_tray.n = vtray["n"].get<float>();
5165 }
5167
5168 if (vt_tray.hold_count > 0) {
5169 vt_tray.hold_count--;
5170 }
5171 else {
5172 if (vtray.contains("tag_uid"))
5173 vt_tray.tag_uid = vtray["tag_uid"].get<std::string>();
5174 else
5175 vt_tray.tag_uid = "0";
5176 if (vtray.contains("tray_info_idx") && vtray.contains("tray_type")) {
5177 vt_tray.setting_id = vtray["tray_info_idx"].get<std::string>();
5178 //std::string type = vtray["tray_type"].get<std::string>();
5179 std::string type = setting_id_to_type(vt_tray.setting_id, vtray["tray_type"].get<std::string>());
5180 // vt_tray.setting_id is our OF id (translated on the way in); the two support ids below are the printer's own.
5181 auto* agent = GUI::wxGetApp().getAgent();
5182 const std::string printer_filament_id = agent ? agent->from_orca_filament_id(vt_tray.setting_id) : vt_tray.setting_id;
5183 if (printer_filament_id == "GFS00") {
5184 vt_tray.m_fila_type = "PLA-S";
5185 }
5186 else if (printer_filament_id == "GFS01") {
5187 vt_tray.m_fila_type = "PA-S";
5188 }
5189 else {
5190 vt_tray.m_fila_type = type;
5191 }
5192 }
5193 else {
5194 vt_tray.setting_id = "";
5195 vt_tray.m_fila_type = "";
5196 }
5197 if (vtray.contains("tray_sub_brands"))
5198 vt_tray.sub_brands = vtray["tray_sub_brands"].get<std::string>();
5199 else
5200 vt_tray.sub_brands = "";
5201 if (vtray.contains("tray_weight"))
5202 vt_tray.weight = vtray["tray_weight"].get<std::string>();
5203 else
5204 vt_tray.weight = "";
5205 if (vtray.contains("tray_diameter"))
5206 vt_tray.diameter = vtray["tray_diameter"].get<std::string>();
5207 else
5208 vt_tray.diameter = "";
5209 if (vtray.contains("tray_temp"))
5210 vt_tray.temp = vtray["tray_temp"].get<std::string>();
5211 else
5212 vt_tray.temp = "";
5213 if (vtray.contains("tray_time"))
5214 vt_tray.time = vtray["tray_time"].get<std::string>();
5215 else
5216 vt_tray.time = "";
5217 if (vtray.contains("bed_temp_type"))
5218 vt_tray.bed_temp_type = vtray["bed_temp_type"].get<std::string>();
5219 else
5220 vt_tray.bed_temp_type = "";
5221 if (vtray.contains("bed_temp"))
5222 vt_tray.bed_temp = vtray["bed_temp"].get<std::string>();
5223 else
5224 vt_tray.bed_temp = "";
5225 if (vtray.contains("tray_color")) {
5226 auto color = vtray["tray_color"].get<std::string>();
5227 vt_tray.UpdateColorFromStr(color);
5228 }
5229 else {
5230 vt_tray.color = "";
5231 }
5232 if (vtray.contains("ctype")) {
5233 vt_tray.ctype = vtray["ctype"].get<int>();
5234 }
5235 else {
5236 vt_tray.ctype = 1;
5237 }
5238 if (vtray.contains("nozzle_temp_max"))
5239 vt_tray.nozzle_temp_max = vtray["nozzle_temp_max"].get<std::string>();
5240 else
5241 vt_tray.nozzle_temp_max = "";
5242 if (vtray.contains("nozzle_temp_min"))
5243 vt_tray.nozzle_temp_min = vtray["nozzle_temp_min"].get<std::string>();
5244 else
5245 vt_tray.nozzle_temp_min = "";
5246 if (vtray.contains("xcam_info"))
5247 vt_tray.xcam_info = vtray["xcam_info"].get<std::string>();
5248 else
5249 vt_tray.xcam_info = "";
5250 if (vtray.contains("tray_uuid"))
5251 vt_tray.uuid = vtray["tray_uuid"].get<std::string>();
5252 else
5253 vt_tray.uuid = "0";
5254
5255 if (vtray.contains("cali_idx"))
5256 vt_tray.cali_idx = vtray["cali_idx"].get<int>();
5257 else
5258 vt_tray.cali_idx = -1;
5259 vt_tray.cols.clear();
5260 if (vtray.contains("cols")) {
5261 if (vtray["cols"].is_array()) {
5262 for (auto it = vtray["cols"].begin(); it != vtray["cols"].end(); it++) {
5263 vt_tray.cols.push_back(it.value().get<std::string>());
5264 }
5265 }
5266 } else {
5267 vt_tray.cols.push_back(vt_tray.color);
5268 }
5269
5270 if (vtray.contains("remain")) {
5271 vt_tray.remain = vtray["remain"].get<int>();
5272 }
5273 else {
5274 vt_tray.remain = -1;
5275 }
5276 }
5277
5278 return vt_tray;
5279}
#define HOLD_TIMEOUT
Definition DeviceManager.hpp:49

References ams_support_virtual_tray, Slic3r::diff(), extrusion_cali_set_hold_start, extrusion_cali_set_tray_id, HOLD_TIMEOUT, setting_id_to_type(), and VIRTUAL_TRAY_MAIN_ID.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_gcode()

int Slic3r::MachineObject::publish_gcode ( std::string gcode_str)
4810{
4811 json j;
4812 j["print"]["command"] = "gcode_line";
4813 j["print"]["param"] = gcode_str;
4814 j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
4815
4816 return publish_json(j);
4817}

References m_sequence_id, and publish_json().

Here is the call graph for this function:

◆ publish_json() [1/2]

int Slic3r::MachineObject::publish_json ( const nlohmann::json & json_item,
int qos = 0,
int flag = 0 )
2833{
2834 int rtn = 0;
2835 if (is_lan_mode_printer()) {
2836 rtn = local_publish_json(json_item.dump(), qos, flag);
2837 } else {
2838 rtn = cloud_publish_json(json_item.dump(), qos, flag);
2839 }
2840
2841 if (rtn == 0) {
2842 BOOST_LOG_TRIVIAL(info) << "publish_json: " << json_item.dump() << " code: " << rtn;
2843 } else {
2844 BOOST_LOG_TRIVIAL(error) << "publish_json: " << json_item.dump() << " code: " << rtn;
2845 }
2846
2847 // why: the agent is the only thing that knows what it can translate, so it reports
2848 // not-supported in its return value and this - the single funnel every command_* builder
2849 // passes through - is the one place that turns it into something the user sees. No list of
2850 // unsupported commands is needed anywhere: an agent that has no case for a command says so.
2853 }
2854
2855 return rtn;
2856}
int local_publish_json(std::string json_str, int qos=0, int flag=0)
Definition DeviceManager.cpp:2867
int cloud_publish_json(std::string json_str, int qos=0, int flag=0)
Definition DeviceManager.cpp:2858

References cloud_publish_json(), is_lan_mode_printer(), local_publish_json(), ORCA_NETWORK_ERR_CAP_NOT_AVAILABLE, ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED, and show_unsupported_dlg().

Referenced by command_ack_proceed(), command_ams_air_print_detect(), command_ams_change_filament(), command_ams_control(), command_ams_drying_stop(), command_ams_filament_settings(), command_ams_switch_filament(), command_ams_user_settings(), command_clean_print_error(), command_clean_print_error_uiop(), command_consistency_upgrade_confirm(), command_delete_pa_calibration(), command_dont_remind_next_time(), command_extruder_control(), command_extrusion_cali_set(), command_get_access_code(), command_get_flow_ratio_calibration_result(), command_get_pa_calibration_result(), command_get_pa_calibration_tab(), command_get_version(), command_hms_idle_ignore(), command_hms_ignore(), command_hms_resume(), command_hms_stop(), command_ipcam_check_timelapse_storage(), command_ipcam_delete_oldest_timelapse(), command_ipcam_record(), command_ipcam_resolution_set(), command_ipcam_timelapse(), command_nozzle_blob_detect(), command_purification_disable(), command_pushing(), command_refresh_nozzle(), command_request_push_all(), command_set_chamber(), command_set_door_open_check(), Slic3r::DevPrintOptions::command_set_filament_tangle_detect(), command_set_filament_tangle_detect(), command_set_nozzle_new(), command_set_pa_calibration(), Slic3r::DevPrintOptions::command_set_printing_option(), command_set_printing_option(), command_set_printing_speed(), Slic3r::DevPrintOptions::command_set_prompt_sound(), command_set_prompt_sound(), Slic3r::DevPrintOptions::command_set_purify_air_at_print_end(), command_set_save_remote_print_file_to_storage(), Slic3r::DevPrintOptions::command_set_snapshot_control(), command_start_calibration(), command_start_extrusion_cali(), command_start_flow_ratio_calibration(), command_start_pa_calibration(), command_stop_buzzer(), command_task_abort(), command_task_cancel(), command_task_partskip(), command_task_pause(), command_task_resume(), command_upgrade_confirm(), command_upgrade_firmware(), command_upgrade_module(), Slic3r::DevPrintOptions::command_xcam_control(), command_xcam_control(), commnad_select_pa_calibration(), Slic3r::DevAmsSystemFirmwareSwitch::CrtlSwitchFirmware(), and publish_gcode().

Here is the call graph for this function:

◆ publish_json() [2/2]

int Slic3r::MachineObject::publish_json ( const std::string & json_str,
int qos = 0,
int flag = 0 )
delete

◆ reload_printer_settings()

void Slic3r::MachineObject::reload_printer_settings ( )
630{
631 print_json.load_compatible_settings("", "");
632 parse_json("cloud", "{}");
633}
int parse_json(std::string tunnel, std::string payload, bool key_filed_only=false)
Definition DeviceManager.cpp:2907

References parse_json(), and print_json.

Here is the call graph for this function:

◆ reset()

void Slic3r::MachineObject::reset ( )
2606{
2607 BOOST_LOG_TRIVIAL(trace) << "reset dev_id=" << dev_id;
2608 last_update_time = std::chrono::system_clock::now();
2610 m_push_count = 0;
2611 m_full_msg_count = 0;
2612 is_220V_voltage = false;
2614 camera_recording = false;
2616 camera_timelapse = false;
2617 //camera_resolution = "";
2618 printing_speed_mag = 100;
2620 iot_print_status = "";
2621 print_status = "";
2623 m_new_ver_list_exist = false;
2624 network_wired = false;
2626 job_id_ = "";
2627 jobState_ = 0;
2628 m_plate_index = -1;
2629 device_cert_installed = false;
2630 clear_auto_nozzle_mapping();// reset nozzle mapping
2631
2632 // reset print_json
2633 json empty_j;
2634 print_json.diff2all_base_reset(empty_j);
2635
2636 for (auto i = 0; i < vt_slot.size(); i++) {
2637 vt_slot[i].reset();
2638
2639 if (i == 1) {
2640 vt_slot.erase(vt_slot.begin() + 1);
2641 }
2642 }
2643 // why: reset reuses MachineObject, so release its lazy subtask
2644 // before dropping the pointer to prevent reconnect leaks.
2645 if (subtask_) {
2646 delete subtask_;
2647 subtask_ = nullptr;
2648 }
2649 has_extra_flow_type = false;
2650 m_partskip_ids.clear();
2651}
#define SUBSCRIBE_RETRY_COUNT
Definition DeviceManager.hpp:64
int subscribe_counter
Definition DeviceManager.hpp:217
void clear_auto_nozzle_mapping()
Definition DevMappingNozzle.cpp:35
std::string dev_connection_name
Definition DeviceManager.hpp:230

References camera_recording, camera_recording_when_printing, camera_timelapse, clear_auto_nozzle_mapping(), dev_connection_name, dev_id, device_cert_installed, gcode_file_prepare_percent, get_version_retry, has_extra_flow_type, iot_print_status, is_220V_voltage, job_id_, jobState_, last_mc_print_stage, last_update_time, m_full_msg_count, m_new_ver_list_exist, m_partskip_ids, m_plate_index, m_push_count, network_wired, print_json, print_status, printing_speed_mag, subscribe_counter, SUBSCRIBE_RETRY_COUNT, subtask_, Slic3r::trace(), and vt_slot.

Referenced by MachineObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_flow_rate_cali_result()

void Slic3r::MachineObject::reset_flow_rate_cali_result ( )
inline
510 {
511 get_flow_calib_result = false;
512 flow_ratio_results.clear();
513 }

References flow_ratio_results, and get_flow_calib_result.

Referenced by parse_json().

Here is the caller graph for this function:

◆ reset_pa_cali_history_result()

void Slic3r::MachineObject::reset_pa_cali_history_result ( )
inline
500 {
501 has_get_pa_calib_tab = false;
502 pa_calib_tab.clear();
503 }

References has_get_pa_calib_tab, and pa_calib_tab.

Referenced by command_get_pa_calibration_tab(), and parse_json().

Here is the caller graph for this function:

◆ reset_pa_cali_result()

void Slic3r::MachineObject::reset_pa_cali_result ( )
inline
505 {
506 get_pa_calib_result = false;
507 pa_calib_results.clear();
508 }

References get_pa_calib_result, and pa_calib_results.

Referenced by parse_json().

Here is the caller graph for this function:

◆ reset_update_time()

void Slic3r::MachineObject::reset_update_time ( )
2599{
2600 BOOST_LOG_TRIVIAL(trace) << "reset reset_update_time, dev_id =" << dev_id;
2601 last_update_time = std::chrono::system_clock::now();
2603}

References dev_id, last_update_time, subscribe_counter, SUBSCRIBE_RETRY_COUNT, and Slic3r::trace().

Here is the call graph for this function:

◆ revoke_access()

void Slic3r::MachineObject::revoke_access ( )
539{
540 // UI panels retain this object; revoke its binding without invalidating their pointers.
541 access_code.clear();
542 m_access_revoked = true;
543}

References access_code, and m_access_revoked.

◆ set_access_code()

void Slic3r::MachineObject::set_access_code ( std::string code,
bool only_refresh = true )
551{
552 this->access_code = code;
553 m_access_revoked = false;
554 if (only_refresh) {
555 AppConfig* config = m_manager ? m_manager->get_app_config() : GUI::wxGetApp().app_config;
556 if (config) {
557 if (is_lan_mode_printer()) {
558 // why: LAN codes are scoped via BBLocalMachine::access_code, keyed by dev_id and
559 // scoped by that record's own printer_agent_id field - see the matching comment
560 // on get_access_code_with_legacy_fallback() in DevManager.cpp - so binding this
561 // device under one printer agent doesn't silently read as already-bound under a
562 // different, independent one. Cloud devices (the else branch below) aren't
563 // scoped this way: they're never recalled from a stale local cache across a
564 // session boundary, since parse_user_print_info() always overwrites their code
565 // fresh from the cloud API's current response, so there's no cross-agent leakage
566 // risk to guard against there.
567 if (has_access_right()) {
569 } else {
570 config->clear_local_machine_access_code(get_dev_id(), printer_agent_id);
571 }
572 } else {
573 if (!code.empty())
574 config->set_str("access_code", get_dev_id(), code);
575 else
576 config->erase("access_code", get_dev_id());
577 }
578 }
579 }
580}
bool has_access_right() const
Definition DeviceManager.cpp:533

References access_code, Slic3r::AppConfig::clear_local_machine_access_code(), Slic3r::AppConfig::erase(), get_dev_id(), has_access_right(), is_lan_mode_printer(), m_access_revoked, m_manager, printer_agent_id, Slic3r::AppConfig::set_str(), and Slic3r::DeviceManager::update_local_machine().

Referenced by connect(), Slic3r::DeviceManager::insert_local_device(), Slic3r::DeviceManager::load_local_machines_from_config(), Slic3r::DeviceManager::on_machine_alive(), Slic3r::GUI::UnBindMachineDialog::on_unbind_printer(), parse_json(), Slic3r::DeviceManager::parse_user_print_info(), and Slic3r::GUI::GUI_App::select_machine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_agent()

void Slic3r::MachineObject::set_agent ( NetworkAgent * agent)
inline
168{ m_agent = agent; }

References m_agent.

◆ set_bind_status()

void Slic3r::MachineObject::set_bind_status ( std::string status)
2503{
2504 bind_user_name = status;
2505}

References bind_user_name.

Referenced by Slic3r::DeviceManager::parse_user_print_info().

Here is the caller graph for this function:

◆ set_ctt_dlg()

void Slic3r::MachineObject::set_ctt_dlg ( wxString text)
4753 {
4754 if (!m_set_ctt_dlg) {
4755 m_set_ctt_dlg = true;
4756 // Parented so it is destroyed with the main frame: a parentless top-level window,
4757 // even hidden, keeps wx from leaving the event loop on exit.
4758 auto print_error_dlg = new GUI::SecondaryCheckDialog(GUI::wxGetApp().mainframe, wxID_ANY, _L("Warning"), GUI::SecondaryCheckDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
4759 print_error_dlg->update_text(text);
4760 print_error_dlg->Bind(wxEVT_SHOW, [this](auto& e) {
4761 if (!e.IsShown()) {
4762 m_set_ctt_dlg = false;
4763 }
4764 });
4765 print_error_dlg->Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {
4766 e.Skip();
4767 m_set_ctt_dlg = false;
4768 });
4769 print_error_dlg->on_show();
4770
4771 }
4772}
@ ONLY_CONFIRM
Definition ReleaseNote.hpp:129
bool m_set_ctt_dlg
Definition DeviceManager.hpp:286

References _L, m_set_ctt_dlg, and Slic3r::GUI::SecondaryCheckDialog::ONLY_CONFIRM.

Referenced by parse_json().

Here is the caller graph for this function:

◆ set_dev_id()

void Slic3r::MachineObject::set_dev_id ( std::string val)
inline
207{ dev_id = val; }

References dev_id.

Referenced by Slic3r::DeviceManager::parse_user_print_info(), and Slic3r::GUI::CalibrationWizard::recover_preset_info().

Here is the caller graph for this function:

◆ set_dev_ip()

void Slic3r::MachineObject::set_dev_ip ( std::string ip)
inline
204{ dev_ip = ip; }

References dev_ip.

Referenced by Slic3r::DeviceManager::on_machine_alive(), and parse_json().

Here is the caller graph for this function:

◆ set_dev_name()

void Slic3r::MachineObject::set_dev_name ( std::string val)
inline
201{ dev_name = val; }

References dev_name.

Referenced by Slic3r::DeviceManager::on_machine_alive(), and Slic3r::DeviceManager::parse_user_print_info().

Here is the caller graph for this function:

◆ set_lan_mode_connection_state()

void Slic3r::MachineObject::set_lan_mode_connection_state ( bool state)
inline

◆ set_modeltask()

void Slic3r::MachineObject::set_modeltask ( BBLModelTask * task)
4837{
4838 model_task = task;
4839}

References model_task.

◆ set_online_state()

void Slic3r::MachineObject::set_online_state ( bool on_off)
2774{
2775 const bool changed = (m_is_online != on_off);
2776 m_is_online = on_off;
2777 if (!on_off) m_active_state = NotActive;
2778 if (changed) {
2779 LifecycleEventContext ctx;
2780 ctx.name = dev_id;
2781 ctx.code = LifecycleEvtCode::Ok;
2782 ctx.msg = on_off ? "online" : "offline";
2784 }
2785}
@ DeviceOnline
Definition LifecycleEvents.hpp:52
@ DeviceOffline
Definition LifecycleEvents.hpp:53
@ Ok
Definition LifecycleEvents.hpp:68
void fire_lifecycle_event(LifecycleEvent event, const LifecycleEventContext &ctx)
Definition LifecycleEvents.hpp:234

References Slic3r::LifecycleEventContext::code, dev_id, Slic3r::DeviceOffline, Slic3r::DeviceOnline, Slic3r::fire_lifecycle_event(), m_active_state, m_is_online, Slic3r::LifecycleEventContext::msg, Slic3r::LifecycleEventContext::name, NotActive, and Slic3r::Ok.

Referenced by disconnect(), Slic3r::DeviceManager::on_machine_alive(), and parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_print_state()

void Slic3r::MachineObject::set_print_state ( std::string status)
2654{
2655 const bool changed = (print_status != status);
2656 print_status = status;
2657 if (changed) {
2658 LifecycleEventContext ctx;
2659 ctx.name = dev_id;
2660 ctx.code = LifecycleEvtCode::Ok;
2661 ctx.msg = print_status;
2663 }
2664}
@ PrintStateChanged
Definition LifecycleEvents.hpp:51

References Slic3r::LifecycleEventContext::code, dev_id, Slic3r::fire_lifecycle_event(), Slic3r::LifecycleEventContext::msg, Slic3r::LifecycleEventContext::name, Slic3r::Ok, print_status, and Slic3r::PrintStateChanged.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setting_id_to_type()

std::string Slic3r::MachineObject::setting_id_to_type ( std::string setting_id,
std::string tray_type )
static
2877{
2878 std::string type;
2879 PresetBundle* preset_bundle = GUI::wxGetApp().preset_bundle;
2880 if (preset_bundle) {
2881 for (auto it = preset_bundle->filaments.begin(); it != preset_bundle->filaments.end(); it++) {
2882
2883 if (it->filament_id.compare(setting_id) == 0 && it->is_system) {
2884 std::string display_filament_type;
2885 it->config.get_filament_type(display_filament_type);
2886 type = display_filament_type;
2887 break;
2888 }
2889 }
2890 }
2891
2892 if (tray_type != type || type.empty()) {
2893 if (type.empty()) { type = tray_type; }
2894 BOOST_LOG_TRIVIAL(info) << "The values of tray_info_idx and tray_type do not match tray_info_idx " << setting_id << " tray_type " << tray_type << " system_type" << type;
2895 }
2896 return type;
2897}

References Slic3r::PresetCollection::begin(), Slic3r::PresetCollection::end(), and Slic3r::PresetBundle::filaments.

Referenced by parse_json(), parse_vt_tray(), and Slic3r::DevFilaSystemParser::ParseV1_0().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_unsupported_dlg()

void Slic3r::MachineObject::show_unsupported_dlg ( int code)
4775{
4776 // why: a dead control invites repeat clicks, and the frame is modeless - without the guard
4777 // every click stacks another one. Same shape as set_ctt_dlg above, including the reset on
4778 // both hide and close so a dismissed dialog can reappear on the next attempt.
4780 return;
4781 }
4783
4784 // why: two codes so the user learns which kind of dead end this is - the slicer having no
4785 // translation for the command, or the printer's own config lacking the hardware to run it.
4786 const wxString text = (code == ORCA_NETWORK_ERR_CAP_NOT_AVAILABLE) ?
4787 _L("This printer is not configured with the hardware this control needs.") :
4788 _L("This control is not supported on this printer.");
4789
4790 // note: constructed directly rather than through CallAfter because every publish_json caller
4791 // is on the UI thread - clicks come from wx handlers, and the agent marshals its own push
4792 // callbacks back to main before parse_json runs. set_ctt_dlg relies on the same property.
4793 // Parented for the same reason as in set_ctt_dlg.
4794 auto unsupported_dlg = new GUI::SecondaryCheckDialog(GUI::wxGetApp().mainframe, wxID_ANY, _L("Warning"),
4796 unsupported_dlg->update_text(text);
4797 unsupported_dlg->Bind(wxEVT_SHOW, [this](auto& e) {
4798 if (!e.IsShown()) {
4800 }
4801 });
4802 unsupported_dlg->Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {
4803 e.Skip();
4805 });
4806 unsupported_dlg->on_show();
4807}
bool m_unsupported_dlg_shown
Definition DeviceManager.hpp:287

References _L, m_unsupported_dlg_shown, Slic3r::GUI::SecondaryCheckDialog::ONLY_CONFIRM, and ORCA_NETWORK_ERR_CAP_NOT_AVAILABLE.

Referenced by command_with_dialog(), and publish_json().

Here is the caller graph for this function:

◆ store_version_info()

void Slic3r::MachineObject::store_version_info ( const DevFirmwareVersionInfo & info)
1047{
1048 if (info.isAirPump()) {
1049 air_pump_version_info = info;
1050 } else if (info.isLaszer()) {
1051 laser_version_info = info;
1052 } else if (info.isCuttingModule()) {
1054 } else if (info.isExtinguishSystem()) {
1056 } else if (info.isRotary()) {
1057 rotary_version_info = info;
1058 } else if (info.isWTM()) {
1059 // Route rack-hotend / extruder-nozzle firmware into the nozzle system so
1060 // the rack upgrade UI can read per-nozzle versions. isWTM() is false for every non-rack
1061 // printer's modules, so this branch never fires outside H2C.
1062 m_nozzle_system->AddFirmwareInfoWTM(info);
1063 } else if (info.isExhaustFan()) {
1065 } else if (info.isHmshub()) {
1066 amshub_version_info = info;
1067 } else if (info.isFilaTrackSwitch()) {
1069 }
1070
1071 module_vers.emplace(info.name, info);
1072}

References air_pump_version_info, amshub_version_info, cutting_module_version_info, exhaustfan_version_info, extinguish_version_info, filatrack_version_info, Slic3r::DevFirmwareVersionInfo::isAirPump(), Slic3r::DevFirmwareVersionInfo::isCuttingModule(), Slic3r::DevFirmwareVersionInfo::isExhaustFan(), Slic3r::DevFirmwareVersionInfo::isExtinguishSystem(), Slic3r::DevFirmwareVersionInfo::isFilaTrackSwitch(), Slic3r::DevFirmwareVersionInfo::isHmshub(), Slic3r::DevFirmwareVersionInfo::isLaszer(), Slic3r::DevFirmwareVersionInfo::isRotary(), Slic3r::DevFirmwareVersionInfo::isWTM(), laser_version_info, m_nozzle_system, module_vers, Slic3r::DevFirmwareVersionInfo::name, and rotary_version_info.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ support_door_open_check()

bool Slic3r::MachineObject::support_door_open_check ( ) const
inline

◆ update_device_cert_state()

void Slic3r::MachineObject::update_device_cert_state ( bool ready)
4820{
4821 device_cert_installed = ready;
4822}

References device_cert_installed.

◆ update_filament_list()

void Slic3r::MachineObject::update_filament_list ( )
5765{
5766 PresetBundle *preset_bundle = Slic3r::GUI::wxGetApp().preset_bundle;
5767
5768 // custom filament
5769 typedef std::map<std::string, std::pair<std::vector<int>, std::vector<int>>> map_pair;
5770 std::map<std::string, map_pair> map_list;
5771 for (auto &pair : m_nozzle_filament_data) {
5772 map_list[pair.second.printer_preset_name] = map_pair{};
5773 }
5774 for (auto &preset : preset_bundle->filaments()) {
5775 if (preset.is_user() && preset.inherits() == "") {
5776 ConfigOption * printer_opt = const_cast<Preset &>(preset).config.option("compatible_printers");
5777 ConfigOptionStrings *printer_strs = dynamic_cast<ConfigOptionStrings *>(printer_opt);
5778 for (const std::string &printer_str : printer_strs->values) {
5779 if (map_list.find(printer_str) != map_list.end()) {
5780 auto & filament_list = map_list[printer_str];
5781 // Every variant's range, so a change to any of them rechecks the trays
5782 std::vector<int> min_temps{-1}, max_temps{-1};
5783 if (auto *opt_min = preset.config.option<ConfigOptionInts>("nozzle_temperature_range_low"))
5784 min_temps = opt_min->values;
5785 if (auto *opt_max = preset.config.option<ConfigOptionInts>("nozzle_temperature_range_high"))
5786 max_temps = opt_max->values;
5787 filament_list[preset.filament_id] = std::make_pair(min_temps, max_temps);
5788 break;
5789 }
5790 }
5791 }
5792 }
5793
5794 for (auto& pair : m_nozzle_filament_data) {
5795 auto & m_printer_preset_name = pair.second.printer_preset_name;
5796 auto & m_filament_list = pair.second.filament_list;
5797 auto & m_checked_filament = pair.second.checked_filament;
5798 auto & filament_list = map_list[m_printer_preset_name];
5799
5800 for (auto it = filament_list.begin(); it != filament_list.end(); it++) {
5801 if (m_filament_list.find(it->first) != m_filament_list.end()) {
5802 // User roots may legitimately carry adopted system-shaped ids (GF*/OF*/P-hex
5803 // system), so a non-'P' id here is expected, not an invariant violation.
5804 if (it->first.size() != 8 || it->first[0] != 'P')
5805 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ": user-root filament_id is not user-shaped: " << it->first;
5806
5807 if (it->second.first != m_filament_list[it->first].first) {
5808 BOOST_LOG_TRIVIAL(info) << "old min temp is not equal to new min temp and filament id: " << it->first;
5809 continue;
5810 }
5811
5812 if (it->second.second != m_filament_list[it->first].second) {
5813 BOOST_LOG_TRIVIAL(info) << "old max temp is not equal to new max temp and filament id: " << it->first;
5814 continue;
5815 }
5816
5817 m_filament_list.erase(it->first);
5818 }
5819 }
5820
5821 for (auto it = m_filament_list.begin(); it != m_filament_list.end(); it++) { m_checked_filament.insert(it->first); }
5822
5823 m_filament_list = filament_list;
5824 }
5825}
@ Preset
Definition calib.hpp:39
ConfigOptionIntsTempl< false > ConfigOptionInts
Definition Config.hpp:1154

References Slic3r::PresetBundle::filaments, m_nozzle_filament_data, and Slic3r::ConfigOptionVector< T >::values.

Referenced by parse_json().

Here is the caller graph for this function:

◆ update_model_task()

void Slic3r::MachineObject::update_model_task ( )
4842{
4843 if (request_model_result > 10) return;
4844 if (!m_agent) return;
4845 if (!model_task) return;
4846 if (!subtask_) return;
4847 if (model_task->task_id != subtask_->task_id) {
4848 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " times: " << request_model_result << " model_task_id !=subtask_id";
4849 return;
4850 }
4851 if (model_task->instance_id <= 0) {
4852 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " times: " << request_model_result << " instance_id <= 0";
4853 return;
4854 }
4855
4857 if (!subtask_id_.empty() && last_subtask_id_ != subtask_id_) {
4858 BOOST_LOG_TRIVIAL(info) << "update_model_task: last=" << last_subtask_id_ << ", curr=" << subtask_id_;
4861 }
4863 BOOST_LOG_TRIVIAL(info) << "need retry";
4865 }
4866 } else {
4867 BOOST_LOG_TRIVIAL(info) << "subtask_id_ no change and do not need retry";
4868 return;
4869 }
4870
4871 int curr_instance_id = model_task->instance_id;
4872 if (rating_info) {
4873 delete rating_info;
4874 rating_info = nullptr;
4875 }
4876 get_model_task_thread = new boost::thread([this, curr_instance_id, token = std::weak_ptr<int>(m_token)]{
4877 if (token.expired()) { return; }
4878 try {
4879 std::string rating_result;
4880 unsigned int http_code = 404;
4881 std::string http_error;
4882 int res = -1;
4883 res = m_agent->get_model_mall_rating_result(curr_instance_id, rating_result, http_code, http_error, Slic3r::GUI::wxGetApp().get_printer_cloud_provider());
4885 BOOST_LOG_TRIVIAL(info) << "request times: " << request_model_result << " http code: " << http_code;
4886 auto rating_info = new DevPrintTaskRatingInfo();
4887 rating_info->http_code = http_code;
4888 if (0 == res && 200 == http_code) {
4889 try {
4890 json rating_json = json::parse(rating_result);
4891 if (rating_json.contains("id")) {
4892 rating_info->rating_id = rating_json["id"].get<unsigned int>();
4893 //rating id is necessary info, so rating id must have
4895 rating_info->request_successful = true;
4896 BOOST_LOG_TRIVIAL(info) << "get rating id";
4897 } else {
4898 rating_info->request_successful = false;
4899 BOOST_LOG_TRIVIAL(info) << "can not get rating id";
4900 Slic3r::GUI::wxGetApp().CallAfter([this, token, rating_info]() {
4901 if (!token.expired()) this->rating_info = rating_info;
4902 });
4903 return;
4904 }
4905 if (rating_json.contains("score")) {
4906 rating_info->start_count = rating_json["score"].get<int>();
4907 }
4908 if (rating_json.contains("content"))
4909 rating_info->content = rating_json["content"].get<std::string>();
4910 if (rating_json.contains("successPrinted"))
4911 rating_info->success_printed = rating_json["successPrinted"].get<bool>();
4912 if (rating_json.contains("images")) {
4913 rating_info->image_url_paths = rating_json["images"].get<std::vector<std::string>>();
4914 }
4915 Slic3r::GUI::wxGetApp().CallAfter([this, token, rating_info]() {
4916 if (!token.expired()) this->rating_info = rating_info;
4917 });
4918 } catch (...) {
4919 BOOST_LOG_TRIVIAL(info) << "parse model mall result json failed";
4920 }
4921 }
4922 else {
4923 rating_info->request_successful = false;
4924 Slic3r::GUI::wxGetApp().CallAfter([this, token, rating_info]() {
4925 if (!token.expired()) this->rating_info = rating_info;
4926 });
4927 BOOST_LOG_TRIVIAL(info) << "model mall result request failed, request time: " << request_model_result << " http_code: " << http_code
4928 << " error msg: " << http_error;
4929 return;
4930 }
4931 }
4932 catch (...) {
4933 BOOST_LOG_TRIVIAL(info) << "get mall model rating id failed and hide scoring page";
4934 }
4935 });
4936}
std::string subtask_id_
Definition DeviceManager.hpp:701
boost::thread * get_model_task_thread
Definition DeviceManager.hpp:708
DevPrintTaskRatingInfo * rating_info
Definition DeviceManager.hpp:731
std::string last_subtask_id_
Definition DeviceManager.hpp:703
bool get_model_mall_result_need_retry
Definition DeviceManager.hpp:733
int request_model_result
Definition DeviceManager.hpp:732

References get_model_mall_result_need_retry, get_model_task_thread, last_subtask_id_, m_agent, m_token, model_task, rating_info, request_model_result, subtask_, and subtask_id_.

◆ update_print_progress()

void Slic3r::MachineObject::update_print_progress ( const nlohmann::json & value)
2668{
2669 if (value.is_string()) {
2670 const std::string progress = value.get<std::string>();
2671 int parsed_progress;
2672 const auto result = std::from_chars(progress.data(), progress.data() + progress.size(), parsed_progress);
2673 if (result.ec != std::errc{} || result.ptr != progress.data() + progress.size())
2674 return;
2675 mc_print_percent = parsed_progress;
2676 } else if (value.is_number_integer())
2677 mc_print_percent = value.get<int>();
2678 else
2679 return;
2680
2681 if (BBLSubTask* curr_task = get_subtask())
2682 curr_task->task_progress = mc_print_percent;
2683}

References get_subtask(), and mc_print_percent.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_printer_preset_name()

void Slic3r::MachineObject::update_printer_preset_name ( )
5828{
5829 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << "start update preset_name";
5830 PresetBundle * preset_bundle = Slic3r::GUI::wxGetApp().preset_bundle;
5831 if (!preset_bundle) return;
5833 std::set<std::string> diameter_set;
5834 for (auto &nozzle : m_extder_system->m_extders) {
5835 float diameter = nozzle.GetNozzleDiameter();
5836 std::ostringstream stream;
5837 stream << std::fixed << std::setprecision(1) << diameter;
5838 std::string nozzle_diameter_str = stream.str();
5839 diameter_set.insert(nozzle_diameter_str);
5840 if (m_nozzle_filament_data.find(nozzle_diameter_str) != m_nozzle_filament_data.end()) continue;
5841 auto data = FilamentData();
5842 auto printer_set = preset_bundle->get_printer_names_by_printer_type_and_nozzle(printer_model, nozzle_diameter_str);
5843 if (printer_set.size() > 0) {
5844 data.printer_preset_name = *printer_set.begin();
5845 m_nozzle_filament_data[nozzle_diameter_str] = data;
5846 }
5847 else
5848 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << " update printer preset name failed: "<< "printer_type: " << printer_type << "nozzle_diameter_str" << nozzle_diameter_str;
5849 }
5850
5851 for (auto iter = m_nozzle_filament_data.begin(); iter != m_nozzle_filament_data.end();)
5852 {
5853 if (diameter_set.find(iter->first) == diameter_set.end())
5854 {
5855 iter = m_nozzle_filament_data.erase(iter);
5856 }
5857 else
5858 {
5859 ++iter;
5860 }
5861 }
5862}
Definition DeviceManager.hpp:968

References Slic3r::DevPrinterConfigUtil::get_printer_display_name(), Slic3r::PresetBundle::get_printer_names_by_printer_type_and_nozzle(), m_extder_system, m_nozzle_filament_data, and printer_type.

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_slice_info()

void Slic3r::MachineObject::update_slice_info ( std::string project_id,
std::string profile_id,
std::string subtask_id,
int plate_idx )
4960{
4961 if (!m_agent) return;
4962
4963 if (project_id_ != project_id || profile_id_ != profile_id || slice_info == nullptr || subtask_id_ != subtask_id) {
4964 project_id_ = project_id;
4965 profile_id_ = profile_id;
4966 subtask_id_ = subtask_id;
4967
4968 if (project_id.empty()
4969 || profile_id.empty()
4970 || subtask_id.empty()) {
4971 return;
4972 }
4973
4974 if (project_id.compare("0") == 0
4975 || profile_id.compare("0") == 0
4976 || subtask_id.compare("0") == 0) return;
4977
4978 BOOST_LOG_TRIVIAL(trace) << "slice_info: start";
4979 slice_info = new BBLSliceInfo();
4980 get_slice_info_thread = new boost::thread([this, project_id, profile_id, subtask_id, plate_idx] {
4981 int plate_index = -1;
4982
4983 if (!m_agent) return;
4984 if (!slice_info) return;
4985 if (!get_slice_info_thread) return;/*STUDIO-12264*/
4986 if (get_slice_info_thread->interruption_requested()) { return;}
4987
4988 if (plate_idx >= 0) {
4989 plate_index = plate_idx;
4990 this->m_plate_index = plate_idx;
4991 }
4992 else {
4993 std::string subtask_json;
4994 unsigned http_code = 0;
4995 std::string http_body;
4996 if (m_agent->get_subtask_info(subtask_id, &subtask_json, &http_code, &http_body,
4997 Slic3r::GUI::wxGetApp().get_printer_cloud_provider()) == 0) {
4998 try {
4999 if (!subtask_json.empty()) {
5000
5001 json task_j = json::parse(subtask_json);
5002 if (task_j.contains("content")) {
5003 std::string content_str = task_j["content"].get<std::string>();
5004 json content_j = json::parse(content_str);
5005 plate_index = content_j["info"]["plate_idx"].get<int>();
5006 }
5007
5008 if (task_j.contains("context") && task_j["context"].contains("plates")) {
5009 for (int i = 0; i < task_j["context"]["plates"].size(); i++) {
5010 if (task_j["context"]["plates"][i].contains("index") && task_j["context"]["plates"][i]["index"].get<int>() == plate_index) {
5011 if (task_j["context"]["plates"][i].contains("thumbnail") && task_j["context"]["plates"][i]["thumbnail"].contains("url")) {
5012 slice_info->thumbnail_url = task_j["context"]["plates"][i]["thumbnail"]["url"].get<std::string>();
5013 }
5014 if (task_j["context"]["plates"][i].contains("prediction")) {
5015 slice_info->prediction = task_j["context"]["plates"][i]["prediction"].get<int>();
5016 }
5017 if (task_j["context"]["plates"][i].contains("weight")) {
5018 slice_info->weight = task_j["context"]["plates"][i]["weight"].get<float>();
5019 }
5020 if (!task_j["context"]["plates"][i]["filaments"].is_null()) {
5021 for (auto filament : task_j["context"]["plates"][i]["filaments"]) {
5022 FilamentInfo f;
5023 if(filament.contains("color")){
5024 f.color = filament["color"].get<std::string>();
5025 }
5026 if (filament.contains("type")) {
5027 f.type = filament["type"].get<std::string>();
5028 }
5029 if (filament.contains("used_g")) {
5030 f.used_g = stof(filament["used_g"].get<std::string>());
5031 }
5032 if (filament.contains("used_m")) {
5033 f.used_m = stof(filament["used_m"].get<std::string>());
5034 }
5035 slice_info->filaments_info.push_back(f);
5036 }
5037 }
5038 BOOST_LOG_TRIVIAL(trace) << "task_info: thumbnail url=" << slice_info->thumbnail_url;
5039 }
5040 }
5041 }
5042 else {
5043 BOOST_LOG_TRIVIAL(error) << "task_info: no context or plates";
5044 }
5045 }
5046 }
5047 catch (...) {
5048 }
5049 }
5050 else {
5051 BOOST_LOG_TRIVIAL(error) << "task_info: get subtask id failed!";
5052 }
5053 }
5054 // this->m_plate_index = plate_index;
5055 });
5056 }
5057}
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124

References Slic3r::Geometry::contains(), Slic3r::f(), get_slice_info_thread, m_agent, m_plate_index, profile_id_, project_id_, slice_info, subtask_id_, and Slic3r::trace().

Referenced by parse_json().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ access_code

std::string Slic3r::MachineObject::access_code
private

◆ ahb_new_version_number

std::string Slic3r::MachineObject::ahb_new_version_number

◆ air_pump_version_info

◆ ams_air_print_status

bool Slic3r::MachineObject::ams_air_print_status { false }

◆ ams_exist_bits

◆ ams_new_version_number

std::string Slic3r::MachineObject::ams_new_version_number

◆ ams_status_main

◆ ams_status_sub

int Slic3r::MachineObject::ams_status_sub

Referenced by _parse_ams_status().

◆ ams_support_virtual_tray

bool Slic3r::MachineObject::ams_support_virtual_tray { true }

Whether this printer supports virtual trays (external/manual filament loading). When true, vt_slot data is used by build_filament_ams_list() to include external filaments.

315{ true };

Referenced by Slic3r::GUI::Sidebar::build_filament_ams_list(), parse_json(), and parse_vt_tray().

◆ ams_switch_filament_start

time_t Slic3r::MachineObject::ams_switch_filament_start = 0

◆ ams_user_setting_start

time_t Slic3r::MachineObject::ams_user_setting_start = 0

◆ ams_version

int Slic3r::MachineObject::ams_version = 0

◆ amshub_version_info

◆ bed_temp_range

std::vector<int> Slic3r::MachineObject::bed_temp_range

Referenced by parse_json().

◆ bed_temperature_limit

int Slic3r::MachineObject::bed_temperature_limit = -1

◆ bind_sec_link

◆ bind_ssdp_version

std::string Slic3r::MachineObject::bind_ssdp_version

◆ bind_state

◆ bind_user_id

std::string Slic3r::MachineObject::bind_user_id

◆ bind_user_name

std::string Slic3r::MachineObject::bind_user_name

Referenced by get_bind_str(), and set_bind_status().

◆ cache_flow_ratio

◆ cali_finished

◆ cali_selected_nozzle_dia

float Slic3r::MachineObject::cali_selected_nozzle_dia { 0.0 }

◆ cali_version

◆ calibration_done

bool Slic3r::MachineObject::calibration_done { false }

◆ camera_recording

bool Slic3r::MachineObject::camera_recording { false }
549{ false };

Referenced by is_recording(), parse_home_flag(), parse_new_info(), and reset().

◆ camera_recording_ctl_start

time_t Slic3r::MachineObject::camera_recording_ctl_start = 0

◆ camera_recording_when_printing

bool Slic3r::MachineObject::camera_recording_when_printing { false }

◆ camera_resolution

std::string Slic3r::MachineObject::camera_resolution = ""

◆ camera_resolution_hold_count

int Slic3r::MachineObject::camera_resolution_hold_count = 0

◆ camera_resolution_supported

std::vector<std::string> Slic3r::MachineObject::camera_resolution_supported

◆ camera_timelapse

bool Slic3r::MachineObject::camera_timelapse { false }

◆ camera_timelapse_hold_count

int Slic3r::MachineObject::camera_timelapse_hold_count = 0

◆ chamber_temp

float Slic3r::MachineObject::chamber_temp

◆ chamber_temp_target

float Slic3r::MachineObject::chamber_temp_target

◆ curr_layer

int Slic3r::MachineObject::curr_layer = 0

◆ cutting_module_version_info

DevFirmwareVersionInfo Slic3r::MachineObject::cutting_module_version_info

◆ dev_connection_name

std::string Slic3r::MachineObject::dev_connection_name

◆ dev_connection_type

◆ dev_id

◆ dev_ip

std::string Slic3r::MachineObject::dev_ip
private

◆ dev_name

std::string Slic3r::MachineObject::dev_name
private

◆ dev_product_name

std::string Slic3r::MachineObject::dev_product_name

◆ device_cert_installed

bool Slic3r::MachineObject::device_cert_installed = false

◆ exhaustfan_version_info

◆ extinguish_version_info

◆ extrusion_cali_filament_name

std::string Slic3r::MachineObject::extrusion_cali_filament_name

◆ extrusion_cali_hold_count

int Slic3r::MachineObject::extrusion_cali_hold_count = 0

◆ extrusion_cali_set_hold_start

std::chrono::system_clock::time_point Slic3r::MachineObject::extrusion_cali_set_hold_start

◆ extrusion_cali_set_tray_id

int Slic3r::MachineObject::extrusion_cali_set_tray_id = -1

◆ filatrack_version_info

◆ file_local

FileLocal Slic3r::MachineObject::file_local { FileLocal::FL_None }

◆ file_model_download

bool Slic3r::MachineObject::file_model_download {false}

◆ file_remote

FileRemote Slic3r::MachineObject::file_remote { FileRemote::FR_None }

Referenced by get_file_remote(), and parse_json().

◆ firmware_list

std::vector<FirmwareInfo> Slic3r::MachineObject::firmware_list

Referenced by get_firmware_info().

◆ firmware_type

PrinterFirmwareType Slic3r::MachineObject::firmware_type

Referenced by parse_json().

◆ flow_ratio_calibration_type

◆ flow_ratio_results

std::vector<FlowRatioCalibResult> Slic3r::MachineObject::flow_ratio_results

◆ frame_temp

float Slic3r::MachineObject::frame_temp

Referenced by MachineObject(), and parse_json().

◆ gcode_file_prepare_percent

int Slic3r::MachineObject::gcode_file_prepare_percent = 0

◆ get_flow_calib_result

bool Slic3r::MachineObject::get_flow_calib_result { false }

◆ get_model_mall_result_need_retry

bool Slic3r::MachineObject::get_model_mall_result_need_retry = false

Referenced by update_model_task().

◆ get_model_task_thread

boost::thread* Slic3r::MachineObject::get_model_task_thread { nullptr }
708{ nullptr };

Referenced by update_model_task().

◆ get_pa_calib_result

bool Slic3r::MachineObject::get_pa_calib_result { false }

◆ get_slice_info_thread

boost::thread* Slic3r::MachineObject::get_slice_info_thread { nullptr }
707{ nullptr };

Referenced by free_slice_info(), and update_slice_info().

◆ get_version_retry

int Slic3r::MachineObject::get_version_retry = 0

◆ has_extra_flow_type

bool Slic3r::MachineObject::has_extra_flow_type {false}
356{false};

Referenced by is_nozzle_flow_type_supported(), parse_json(), and reset().

◆ has_get_pa_calib_tab

bool Slic3r::MachineObject::has_get_pa_calib_tab { false }

◆ has_ipcam

bool Slic3r::MachineObject::has_ipcam { false }

◆ hw_switch_state

int Slic3r::MachineObject::hw_switch_state

◆ installed_upgrade_kit

◆ iot_print_status

std::string Slic3r::MachineObject::iot_print_status

◆ is_220V_voltage

bool Slic3r::MachineObject::is_220V_voltage { false }

◆ is_enable_ams_np

bool Slic3r::MachineObject::is_enable_ams_np { false }

◆ is_enable_np

◆ is_support_1080dpi

bool Slic3r::MachineObject::is_support_1080dpi {false}

◆ is_support_agora

bool Slic3r::MachineObject::is_support_agora {false}

◆ is_support_air_print_detection

bool Slic3r::MachineObject::is_support_air_print_detection {false}

◆ is_support_airprinting_detection

bool Slic3r::MachineObject::is_support_airprinting_detection {false}

◆ is_support_ams_humidity

◆ is_support_auto_recovery_step_loss

bool Slic3r::MachineObject::is_support_auto_recovery_step_loss {false}

◆ is_support_bed_leveling

◆ is_support_brtc

bool Slic3r::MachineObject::is_support_brtc {false}

◆ is_support_build_plate_marker_detect

bool Slic3r::MachineObject::is_support_build_plate_marker_detect {false}

◆ is_support_check_track_switch_match_slice_printer

bool Slic3r::MachineObject::is_support_check_track_switch_match_slice_printer {false}

◆ is_support_cloud_print_only

◆ is_support_command_ams_switch

bool Slic3r::MachineObject::is_support_command_ams_switch {false}
641{false};

Referenced by parse_json(), and parse_new_info2().

◆ is_support_door_open_check

bool Slic3r::MachineObject::is_support_door_open_check = false
private

◆ is_support_ext_change_assist

bool Slic3r::MachineObject::is_support_ext_change_assist {false}

◆ is_support_ext_change_assist_old

bool Slic3r::MachineObject::is_support_ext_change_assist_old { false }
936{ false }; // A/P-series multi-color external change assist

Referenced by parse_json(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

◆ is_support_fila_change_abort

bool Slic3r::MachineObject::is_support_fila_change_abort { false }
935{ false }; // filament-change Stop button

Referenced by parse_json().

◆ is_support_filament_32_colors

bool Slic3r::MachineObject::is_support_filament_32_colors { false }
934{ false };

Referenced by get_max_filament_color_count(), and parse_json().

◆ is_support_filament_backup

bool Slic3r::MachineObject::is_support_filament_backup {false}

◆ is_support_filament_manual_multi_color

bool Slic3r::MachineObject::is_support_filament_manual_multi_color {false}
677{false};

Referenced by parse_new_info().

◆ is_support_filament_setting_inprinting

bool Slic3r::MachineObject::is_support_filament_setting_inprinting {false}
651{false};

Referenced by parse_json().

◆ is_support_filament_tangle_detect

bool Slic3r::MachineObject::is_support_filament_tangle_detect {false}

◆ is_support_flow_calibration

bool Slic3r::MachineObject::is_support_flow_calibration {false}

◆ is_support_idelheadingprotect_detection

bool Slic3r::MachineObject::is_support_idelheadingprotect_detection {false}
664{false};

Referenced by parse_new_info().

◆ is_support_internal_timelapse

◆ is_support_layer_num

bool Slic3r::MachineObject::is_support_layer_num { false }

◆ is_support_motor_noise_cali

bool Slic3r::MachineObject::is_support_motor_noise_cali {false}

◆ is_support_mqtt_alive

bool Slic3r::MachineObject::is_support_mqtt_alive {false}

◆ is_support_new_auto_cali_method

bool Slic3r::MachineObject::is_support_new_auto_cali_method {false}
479{false};

Referenced by parse_json(), and parse_new_info().

◆ is_support_nozzle_blob_detection

bool Slic3r::MachineObject::is_support_nozzle_blob_detection {false}
647{false};

Referenced by parse_home_flag(), parse_new_info(), and parse_new_info2().

◆ is_support_nozzleclumping_detection

bool Slic3r::MachineObject::is_support_nozzleclumping_detection {false}

◆ is_support_pa_calibration

◆ is_support_pa_mode

◆ is_support_partskip

bool Slic3r::MachineObject::is_support_partskip {false}
656{false};

Referenced by parse_new_info().

◆ is_support_print_with_emmc

bool Slic3r::MachineObject::is_support_print_with_emmc {false}

◆ is_support_prompt_sound

bool Slic3r::MachineObject::is_support_prompt_sound {false}

◆ is_support_purgechutepileup_detection

bool Slic3r::MachineObject::is_support_purgechutepileup_detection {false}

◆ is_support_refresh_nozzle

bool Slic3r::MachineObject::is_support_refresh_nozzle {false}
657{false};

Referenced by parse_json(), and parse_new_info2().

◆ is_support_remote_dry

◆ is_support_send_to_sdcard

bool Slic3r::MachineObject::is_support_send_to_sdcard {false}

◆ is_support_spaghetti_detection

bool Slic3r::MachineObject::is_support_spaghetti_detection {false}

◆ is_support_timelapse

bool Slic3r::MachineObject::is_support_timelapse {false}
632{false};

Referenced by canEnableTimelapse(), parse_json(), and parse_new_info2().

◆ is_support_tunnel_mqtt

bool Slic3r::MachineObject::is_support_tunnel_mqtt {false}

◆ is_support_update_remain

bool Slic3r::MachineObject::is_support_update_remain {false}

◆ is_support_upgrade_kit

◆ is_support_user_preset

◆ is_support_wait_sending_finish

bool Slic3r::MachineObject::is_support_wait_sending_finish {false}
645{false};

Referenced by parse_json(), and Slic3r::GUI::PrintJob::process().

◆ is_tunnel_mqtt

bool Slic3r::MachineObject::is_tunnel_mqtt = false

Referenced by parse_json().

◆ job_id_

std::string Slic3r::MachineObject::job_id_

◆ jobState_

int Slic3r::MachineObject::jobState_ = 0

◆ keep_alive_count

int Slic3r::MachineObject::keep_alive_count = 0

◆ laser_version_info

◆ last_alive

◆ last_cali_version

int Slic3r::MachineObject::last_cali_version = -1

◆ last_cloud_msg_time_

std::chrono::system_clock::time_point Slic3r::MachineObject::last_cloud_msg_time_

◆ last_extrusion_cali_start_time

std::chrono::system_clock::time_point Slic3r::MachineObject::last_extrusion_cali_start_time

◆ last_keep_alive

std::chrono::system_clock::time_point Slic3r::MachineObject::last_keep_alive

◆ last_lan_msg_time_

std::chrono::system_clock::time_point Slic3r::MachineObject::last_lan_msg_time_

Referenced by HasRecentLanMessage(), and parse_json().

◆ last_mc_print_stage

int Slic3r::MachineObject::last_mc_print_stage

Referenced by parse_state_changed_event(), and reset().

◆ last_online_version

int Slic3r::MachineObject::last_online_version = -1

Referenced by parse_json().

◆ last_push_time

std::chrono::system_clock::time_point Slic3r::MachineObject::last_push_time

◆ last_request_push

std::chrono::system_clock::time_point Slic3r::MachineObject::last_request_push

◆ last_request_start

std::chrono::system_clock::time_point Slic3r::MachineObject::last_request_start

Referenced by command_pushing().

◆ last_subtask_id_

std::string Slic3r::MachineObject::last_subtask_id_

Referenced by update_model_task().

◆ last_update_time

std::chrono::system_clock::time_point Slic3r::MachineObject::last_update_time

◆ last_utc_time

std::chrono::system_clock::time_point Slic3r::MachineObject::last_utc_time

Referenced by parse_json().

◆ lifecycle

◆ link_ams

std::string Slic3r::MachineObject::link_ams

Referenced by parse_json().

◆ link_th

std::string Slic3r::MachineObject::link_th

Referenced by parse_json().

◆ liveview_local

◆ liveview_remote

LiveviewRemote Slic3r::MachineObject::liveview_remote { LiveviewRemote::LVR_None}

◆ local_rtsp_url

std::string Slic3r::MachineObject::local_rtsp_url

Referenced by parse_json().

◆ local_use_ssl

◆ local_use_ssl_for_ftp

◆ m_access_revoked

bool Slic3r::MachineObject::m_access_revoked = false
private

◆ m_active_state

int Slic3r::MachineObject::m_active_state = 0

Referenced by parse_json(), and set_online_state().

◆ m_agent

◆ m_agent_thumbnail_url

std::string Slic3r::MachineObject::m_agent_thumbnail_url

Referenced by parse_json().

◆ m_axis

std::shared_ptr<DevAxis> Slic3r::MachineObject::m_axis
private

Referenced by MachineObject(), GetAxis(), and parse_json().

◆ m_bed

DevBed* Slic3r::MachineObject::m_bed
private

◆ m_calib

DevCalib* Slic3r::MachineObject::m_calib { nullptr }
private
143{ nullptr };

Referenced by MachineObject(), ~MachineObject(), and GetCalib().

◆ m_chamber

std::shared_ptr<DevChamber> Slic3r::MachineObject::m_chamber
private

◆ m_command_error_code_dlgs

std::unordered_set<GUI::DeviceErrorDialog*> Slic3r::MachineObject::m_command_error_code_dlgs

◆ m_config

DevConfig* Slic3r::MachineObject::m_config
private

◆ m_ctrl

DevCtrl* Slic3r::MachineObject::m_ctrl
private

◆ m_device_mode

DeviceMode Slic3r::MachineObject::m_device_mode { DEVICE_MODE_FDM }

Referenced by is_fdm_type(), and parse_new_info().

◆ m_extder_system

◆ m_extension_tool

std::shared_ptr<DevExtensionTool> Slic3r::MachineObject::m_extension_tool
private

◆ m_fan

DevFan* Slic3r::MachineObject::m_fan
private

◆ m_fila_switch

DevFilaSwitch* Slic3r::MachineObject::m_fila_switch
private

◆ m_fila_system

◆ m_firmware_support_print_tpu_left

std::optional<bool> Slic3r::MachineObject::m_firmware_support_print_tpu_left

◆ m_firmware_thread_started

bool Slic3r::MachineObject::m_firmware_thread_started { false }
927{ false };

Referenced by get_firmware_info().

◆ m_firmware_valid

bool Slic3r::MachineObject::m_firmware_valid { false }
926{ false };

Referenced by get_firmware_info(), and is_firmware_info_valid().

◆ m_full_msg_count

int Slic3r::MachineObject::m_full_msg_count = 0

◆ m_gcode_file

◆ m_has_timelapse_kit

bool Slic3r::MachineObject::m_has_timelapse_kit {false}

◆ m_hms_system

DevHMS* Slic3r::MachineObject::m_hms_system
private

◆ m_home_flag

int Slic3r::MachineObject::m_home_flag = 0

Referenced by is_axis_at_home(), and parse_home_flag().

◆ m_is_online

◆ m_lamp

DevLamp* Slic3r::MachineObject::m_lamp
private

◆ m_lan_mode_connection_state

bool Slic3r::MachineObject::m_lan_mode_connection_state {false}

◆ m_manager

DeviceManager* Slic3r::MachineObject::m_manager { nullptr }
private
114{ nullptr };

Referenced by MachineObject(), parse_json(), parse_new_info2(), and set_access_code().

◆ m_new_ver_list_exist

bool Slic3r::MachineObject::m_new_ver_list_exist = false

◆ m_nozzle_filament_data

std::map<std::string, FilamentData> Slic3r::MachineObject::m_nozzle_filament_data

◆ m_nozzle_mapping_ptr

std::shared_ptr<DevNozzleMappingCtrl> Slic3r::MachineObject::m_nozzle_mapping_ptr
private

◆ m_nozzle_system

◆ m_partskip_ids

std::vector<int> Slic3r::MachineObject::m_partskip_ids

Referenced by parse_json(), and reset().

◆ m_plate_index

int Slic3r::MachineObject::m_plate_index { -1 }
726{ -1 };

Referenced by parse_json(), reset(), and update_slice_info().

◆ m_plate_maker_detect_type

PlateMakerDectect Slic3r::MachineObject::m_plate_maker_detect_type { POS_CHECK }

◆ m_print_error_img_id

std::string Slic3r::MachineObject::m_print_error_img_id

Referenced by MachineObject(), and parse_json().

◆ m_print_options

DevPrintOptions* Slic3r::MachineObject::m_print_options
private

◆ m_push_count

◆ m_sequence_id

int Slic3r::MachineObject::m_sequence_id = START_SEQ_ID
inlinestatic

Referenced by command_ack_proceed(), command_ams_air_print_detect(), command_ams_calibrate(), command_ams_change_filament(), command_ams_control(), command_ams_drying_stop(), command_ams_filament_settings(), Slic3r::BBLPrinterAgent::command_ams_refresh_rfid(), command_ams_refresh_rfid(), command_ams_select_tray(), command_ams_switch_filament(), command_ams_user_settings(), command_auto_leveling(), command_axis_control(), command_clean_print_error(), command_clean_print_error_uiop(), command_consistency_upgrade_confirm(), Slic3r::DevFan::command_control_air_duct(), Slic3r::DevFan::command_control_fan_new(), command_delete_pa_calibration(), command_dont_remind_next_time(), command_extruder_control(), command_extrusion_cali_set(), command_get_access_code(), command_get_flow_ratio_calibration_result(), command_get_pa_calibration_result(), command_get_pa_calibration_tab(), command_get_version(), command_go_home(), command_hms_idle_ignore(), command_hms_ignore(), command_hms_resume(), command_hms_stop(), command_ipcam_check_timelapse_storage(), command_ipcam_delete_oldest_timelapse(), command_ipcam_record(), command_ipcam_resolution_set(), command_ipcam_timelapse(), command_nozzle_blob_detect(), command_purification_disable(), command_pushing(), command_refresh_nozzle(), command_request_push_all(), Slic3r::DevCtrl::command_select_extruder(), Slic3r::DevPrintOptions::command_set_against_continued_heating_mode(), command_set_bed(), command_set_chamber(), Slic3r::DevLamp::command_set_chamber_light(), Slic3r::DevLamp::command_set_chamber_light2(), command_set_door_open_check(), Slic3r::DevPrintOptions::command_set_filament_tangle_detect(), command_set_filament_tangle_detect(), command_set_nozzle(), command_set_nozzle_new(), command_set_pa_calibration(), Slic3r::DevPrintOptions::command_set_printing_option(), command_set_printing_option(), command_set_printing_speed(), Slic3r::DevPrintOptions::command_set_prompt_sound(), command_set_prompt_sound(), Slic3r::DevPrintOptions::command_set_purify_air_at_print_end(), command_set_save_remote_print_file_to_storage(), Slic3r::DevPrintOptions::command_set_snapshot_control(), Slic3r::DevPrintOptions::command_smart_nozzle_blob_detect_mode(), command_start_calibration(), command_start_extrusion_cali(), command_start_flow_ratio_calibration(), command_start_pa_calibration(), command_stop_buzzer(), command_task_abort(), command_task_cancel(), command_task_partskip(), command_task_pause(), command_task_resume(), command_upgrade_confirm(), command_upgrade_firmware(), command_upgrade_module(), Slic3r::DevPrintOptions::command_xcam_control(), command_xcam_control(), command_xyz_abs(), commnad_select_pa_calibration(), Slic3r::DevNozzleRack::CrtlRackReadNozzle(), Slic3r::DevAmsSystemFirmwareSwitch::CrtlSwitchFirmware(), Slic3r::DevAxis::Ctrl_Axis(), Slic3r::DevAxis::Ctrl_GoHome(), Slic3r::DevFilaSystem::CtrlAmsReset(), Slic3r::DevFilaSystem::CtrlAmsStartDryingHour(), Slic3r::DevFilaSystem::CtrlAmsStopDrying(), Slic3r::DevNozzleMappingCtrl::CtrlGetAutoNozzleMappingV0(), Slic3r::DevNozzleMappingCtrl::CtrlGetAutoNozzleMappingV1(), Slic3r::DevNozzleRack::CtrlRackConfirmAll(), Slic3r::DevNozzleRack::CtrlRackConfirmNozzle(), Slic3r::DevNozzleRack::CtrlRackPosGoHome(), Slic3r::DevNozzleRack::CtrlRackPosMove(), Slic3r::DevNozzleRack::CtrlRackReadAll(), Slic3r::DevNozzleRack::CtrlRackUpgrade(), Slic3r::DevChamber::CtrlSetChamberTemp(), Slic3r::DevUpgrade::CtrlUpgradeConfirm(), Slic3r::DevUpgrade::CtrlUpgradeConsistencyConfirm(), Slic3r::DevUpgrade::CtrlUpgradeFirmware(), Slic3r::DevUpgrade::CtrlUpgradeModule(), and publish_gcode().

◆ m_set_ctt_dlg

bool Slic3r::MachineObject::m_set_ctt_dlg { false }
286{ false };

Referenced by set_ctt_dlg().

◆ m_status

DevStatus* Slic3r::MachineObject::m_status { nullptr }
private
144{ nullptr };

Referenced by MachineObject(), ~MachineObject(), GetStatus(), and parse_json().

◆ m_storage

◆ m_support_mqtt_axis_control

bool Slic3r::MachineObject::m_support_mqtt_axis_control = false

◆ m_support_mqtt_bet_ctrl

bool Slic3r::MachineObject::m_support_mqtt_bet_ctrl = false

Referenced by command_set_bed(), and parse_new_info().

◆ m_support_mqtt_homing

bool Slic3r::MachineObject::m_support_mqtt_homing { false }
653{ false };// fun[32]

Referenced by command_go_home(), and parse_new_info().

◆ m_token

std::shared_ptr<int> Slic3r::MachineObject::m_token = std::make_shared<int>(1)
private

◆ m_unsupported_dlg_shown

bool Slic3r::MachineObject::m_unsupported_dlg_shown { false }
287{ false };

Referenced by show_unsupported_dlg().

◆ m_upgrade

std::shared_ptr<DevUpgrade> Slic3r::MachineObject::m_upgrade
private

Referenced by MachineObject(), and GetUpgrade().

◆ manual_pa_cali_method

◆ mc_left_time

int Slic3r::MachineObject::mc_left_time

◆ mc_print_error_code

int Slic3r::MachineObject::mc_print_error_code

Referenced by MachineObject(), and parse_json().

◆ mc_print_line_number

int Slic3r::MachineObject::mc_print_line_number

Referenced by MachineObject(), and parse_json().

◆ mc_print_percent

int Slic3r::MachineObject::mc_print_percent

◆ mc_print_stage

int Slic3r::MachineObject::mc_print_stage

◆ mc_print_sub_stage

int Slic3r::MachineObject::mc_print_sub_stage

Referenced by MachineObject(), and parse_json().

◆ message_delay

std::vector<std::tuple<std::string, uint64_t, uint64_t> > Slic3r::MachineObject::message_delay
private

Referenced by parse_json().

◆ model_task

BBLModelTask* Slic3r::MachineObject::model_task { nullptr }

◆ module_vers

◆ network_wired

bool Slic3r::MachineObject::network_wired { false }
376{ false };

Referenced by parse_json(), reset(), and Slic3r::GUI::SideTools::update_status().

◆ new_ver_list

◆ nozzle_blob_detection_enabled

bool Slic3r::MachineObject::nozzle_blob_detection_enabled { false }

◆ nozzle_blob_detection_hold_start

time_t Slic3r::MachineObject::nozzle_blob_detection_hold_start = 0

◆ nozzle_temp_range

std::vector<int> Slic3r::MachineObject::nozzle_temp_range

Referenced by parse_json().

◆ obj_subtask_id

std::string Slic3r::MachineObject::obj_subtask_id

Referenced by is_sdcard_printing(), and parse_json().

◆ online_ahb

◆ online_rfid

bool Slic3r::MachineObject::online_rfid

Referenced by parse_json().

◆ online_version

int Slic3r::MachineObject::online_version = -1

Referenced by parse_json().

◆ ota_new_version_number

std::string Slic3r::MachineObject::ota_new_version_number

◆ pa_calib_results

◆ pa_calib_tab

◆ parse_msg_count

int Slic3r::MachineObject::parse_msg_count = 0

Referenced by parse_json().

◆ print_error

◆ print_job_filament_mapping

std::vector<uint16_t> Slic3r::MachineObject::print_job_filament_mapping

◆ print_json

json_diff Slic3r::MachineObject::print_json

◆ print_status

◆ print_type

std::string Slic3r::MachineObject::print_type

◆ printer_agent_id

◆ printer_type

std::string Slic3r::MachineObject::printer_type

Referenced by Slic3r::GUI::EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(), Slic3r::MoonrakerPrinterAgent::build_ams_payload(), Slic3r::GUI::CalibUtils::calib_generic_auto_pa_cali(), Slic3r::GUI::SelectMachineDialog::can_support_pa_auto_cali(), check_ams_filament_valid(), Slic3r::check_filaments_printable(), Slic3r::GUI::NewCalibrationHistoryDialog::get_all_filaments(), get_auto_pa_cali_thumbnail_img_str(), get_compatible_machine(), get_ftp_folder(), get_nozzle_replace_url(), get_printer_ams_type(), get_printer_arch(), Slic3r::GUI::CalibrationPresetPage::get_printer_preset(), get_printer_series(), get_printer_series_str(), get_printer_thumbnail_img_str(), get_printer_type_display_str(), get_show_printer_type(), Slic3r::GUI::FanControlPopupNew::init_names(), Slic3r::DeviceManager::insert_local_device(), Slic3r::DevPrinterConfigUtil::is_printer_model_compatible(), Slic3r::GUI::Plater::is_same_printer_for_connected_and_selected(), Slic3r::GUI::SelectMachineDialog::is_same_printer_model(), Slic3r::GUI::SyncAmsInfoDialog::is_same_printer_model(), is_series_n(), is_series_o(), is_series_p(), is_series_x(), Slic3r::DeviceManager::load_local_machines_from_config(), Slic3r::GUI::SelectMachineDialog::load_option_vals(), Slic3r::GUI::CalibrationWizard::on_device_connected(), Slic3r::GUI::HistoryWindow::on_device_connected(), Slic3r::DeviceManager::on_machine_alive(), Slic3r::GUI::SelectMachineDialog::on_ok_btn(), parse_json(), parse_new_info(), Slic3r::DeviceManager::parse_user_print_info(), Slic3r::GUI::CalibUtils::process_and_store_3mf(), Slic3r::GUI::SelectMachineDialog::save_option_vals(), Slic3r::GUI::sCheckFilamentInfo(), Slic3r::anonymous_namespace{PluginHostApp.cpp}::selected_printer(), Slic3r::GUI::MediaPlayCtrl::SetMachineObject(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), Slic3r::GUI::CalibrationCaliPage::update(), Slic3r::GUI::AMSSetting::update_ams_img(), Slic3r::GUI::AMSDryCtrWin::update_filament_list(), Slic3r::GUI::AMSSetting::update_insert_material_read_mode(), Slic3r::DeviceManager::update_local_machine(), Slic3r::GUI::AmsReplaceMaterialDialog::update_machine_obj(), update_printer_preset_name(), Slic3r::GUI::CalibrationPresetPage::update_show_status(), Slic3r::GUI::SelectMachineDialog::update_show_status(), Slic3r::GUI::SyncAmsInfoDialog::update_show_status(), Slic3r::GUI::Sidebar::priv::update_sync_status(), Slic3r::GUI::AmsMapingPopup::update_title(), and Slic3r::GUI::SelectMachineDialog::UpdateStatusCheckWarning_ExtensionTool().

◆ printing_speed_mag

int Slic3r::MachineObject::printing_speed_mag = 100

Referenced by parse_json(), and reset().

◆ profile_id_

std::string Slic3r::MachineObject::profile_id_

◆ project_id_

std::string Slic3r::MachineObject::project_id_

◆ queue_number

int Slic3r::MachineObject::queue_number = 0

◆ rating_info

DevPrintTaskRatingInfo* Slic3r::MachineObject::rating_info { nullptr }
731{ nullptr };

Referenced by update_model_task().

◆ request_model_result

int Slic3r::MachineObject::request_model_result = 0

Referenced by update_model_task().

◆ request_tab_from_bbs

bool Slic3r::MachineObject::request_tab_from_bbs { false }
493{ false };

Referenced by command_get_pa_calibration_tab(), and parse_json().

◆ rotary_version_info

◆ selected_cali_preset

◆ slice_info

BBLSliceInfo* Slic3r::MachineObject::slice_info {nullptr}

◆ stage_curr

◆ stage_list_info

◆ stage_remaining_seconds

int Slic3r::MachineObject::stage_remaining_seconds = 0

◆ subscribe_counter

int Slic3r::MachineObject::subscribe_counter {3}

◆ subtask_

◆ subtask_id_

std::string Slic3r::MachineObject::subtask_id_

◆ subtask_name

◆ targ_nozzle_id_from_pc

int Slic3r::MachineObject::targ_nozzle_id_from_pc = INVALID_EXTRUDER_ID

◆ task_id_

std::string Slic3r::MachineObject::task_id_

Referenced by parse_json().

◆ timelapse_storage_check_done

std::atomic<bool> Slic3r::MachineObject::timelapse_storage_check_done { false }

◆ timelapse_storage_check_result

int Slic3r::MachineObject::timelapse_storage_check_result { -1 }

◆ timelapse_storage_file_count

int Slic3r::MachineObject::timelapse_storage_file_count { 0 }

◆ timelapse_storage_is_enough

bool Slic3r::MachineObject::timelapse_storage_is_enough { true }

◆ total_layers

int Slic3r::MachineObject::total_layers = 0

◆ tray_exist_bits

long Slic3r::MachineObject::tray_exist_bits = 0

◆ tray_is_bbl_bits

long Slic3r::MachineObject::tray_is_bbl_bits = 0

◆ tray_read_done_bits

long Slic3r::MachineObject::tray_read_done_bits = 0

◆ tray_reading_bits

long Slic3r::MachineObject::tray_reading_bits = 0

◆ tutk_state

std::string Slic3r::MachineObject::tutk_state

◆ upgrade_consistency_request

◆ upgrade_display_hold_count

int Slic3r::MachineObject::upgrade_display_hold_count = 0

◆ upgrade_display_state

◆ upgrade_err_code

int Slic3r::MachineObject::upgrade_err_code = 0

◆ upgrade_force_upgrade

◆ upgrade_message

std::string Slic3r::MachineObject::upgrade_message

Referenced by parse_json().

◆ upgrade_module

std::string Slic3r::MachineObject::upgrade_module

Referenced by parse_json().

◆ upgrade_new_version

bool Slic3r::MachineObject::upgrade_new_version { false }

◆ upgrade_progress

std::string Slic3r::MachineObject::upgrade_progress

Referenced by get_upgrade_percent(), and parse_json().

◆ upgrade_status

std::string Slic3r::MachineObject::upgrade_status

◆ virtual_camera

bool Slic3r::MachineObject::virtual_camera {false}
588{false};

Referenced by parse_json().

◆ vt_slot

std::vector<DevAmsTray> Slic3r::MachineObject::vt_slot

Virtual Tray (vt_slot) - External/manual filament loading slots.

Data Flow: Populated from printer JSON via parse_vt_tray() during MachineObject::parse_json(). Used by: Sidebar::build_filament_ams_list() when ams_support_virtual_tray is true.

Virtual trays represent filament that is manually loaded into the extruder rather than fed through an AMS unit. This supports printers without AMS or scenarios where users want to bypass the AMS.

Referenced by MachineObject(), Slic3r::DevMappingUtil::ams_filament_mapping(), Slic3r::GUI::Sidebar::build_filament_ams_list(), check_ams_filament_valid(), contains_tray(), Slic3r::DevCalib::ExtrusionCalibSelectParse(), Slic3r::DevCalib::ExtrusionCalibSetParse(), get_curr_tray(), get_tray(), parse_json(), Slic3r::DevFilaSystemParser::ParseAgentFilament(), reset(), Slic3r::GUI::CalibrationPresetPage::sync_ams_info(), and Slic3r::GUI::AmsMapingPopup::update_mapping_items().

◆ webcam_stream_url

std::string Slic3r::MachineObject::webcam_stream_url

Referenced by parse_json().

◆ wifi_signal

std::string Slic3r::MachineObject::wifi_signal

◆ xcam__save_remote_print_file_to_storage

bool Slic3r::MachineObject::xcam__save_remote_print_file_to_storage = false
private

◆ xcam__save_remote_print_file_to_storage_start_time

time_t Slic3r::MachineObject::xcam__save_remote_print_file_to_storage_start_time = 0
private

◆ xcam_ai_monitoring

bool Slic3r::MachineObject::xcam_ai_monitoring { false }

◆ xcam_ai_monitoring_hold_start

◆ xcam_ai_monitoring_sensitivity

std::string Slic3r::MachineObject::xcam_ai_monitoring_sensitivity

◆ xcam_airprinting_detection

bool Slic3r::MachineObject::xcam_airprinting_detection {false}

◆ xcam_airprinting_detection_sensitivity

std::string Slic3r::MachineObject::xcam_airprinting_detection_sensitivity

◆ xcam_allow_prompt_sound

bool Slic3r::MachineObject::xcam_allow_prompt_sound { false }

◆ xcam_auto_recovery_hold_start

time_t Slic3r::MachineObject::xcam_auto_recovery_hold_start = 0

◆ xcam_auto_recovery_step_loss

bool Slic3r::MachineObject::xcam_auto_recovery_step_loss { false }

◆ xcam_buildplate_marker_detector

bool Slic3r::MachineObject::xcam_buildplate_marker_detector { false }

◆ xcam_buildplate_marker_hold_start

time_t Slic3r::MachineObject::xcam_buildplate_marker_hold_start = 0

◆ xcam_disable_ai_detection_display

bool Slic3r::MachineObject::xcam_disable_ai_detection_display {false}

◆ xcam_door_open_check

◆ xcam_door_open_check_start_time

time_t Slic3r::MachineObject::xcam_door_open_check_start_time = 0
private

◆ xcam_filament_tangle_detect

bool Slic3r::MachineObject::xcam_filament_tangle_detect { false }

◆ xcam_filament_tangle_detect_hold_start

time_t Slic3r::MachineObject::xcam_filament_tangle_detect_hold_start = 0

◆ xcam_first_layer_hold_start

time_t Slic3r::MachineObject::xcam_first_layer_hold_start = 0

◆ xcam_first_layer_inspector

bool Slic3r::MachineObject::xcam_first_layer_inspector { false }

◆ xcam_nozzleclumping_detection

bool Slic3r::MachineObject::xcam_nozzleclumping_detection {false}

◆ xcam_nozzleclumping_detection_sensitivity

std::string Slic3r::MachineObject::xcam_nozzleclumping_detection_sensitivity

◆ xcam_prompt_sound_hold_start

time_t Slic3r::MachineObject::xcam_prompt_sound_hold_start = 0

◆ xcam_purgechutepileup_detection

bool Slic3r::MachineObject::xcam_purgechutepileup_detection {false}

◆ xcam_purgechutepileup_detection_sensitivity

std::string Slic3r::MachineObject::xcam_purgechutepileup_detection_sensitivity

◆ xcam_spaghetti_detection

bool Slic3r::MachineObject::xcam_spaghetti_detection {false}

◆ xcam_spaghetti_detection_sensitivity

std::string Slic3r::MachineObject::xcam_spaghetti_detection_sensitivity

The documentation for this class was generated from the following files: