NEW:support for dynamic configuration files
Change-Id: Iec433ca1f75f223af68c5103013ff47d1acf1678 (cherry picked from commit 40acd7f6b11e9b2b3403a84b4b7d4b70da5d0ed2)
This commit is contained in:
parent
5e23f73866
commit
23079b23df
|
@ -11,10 +11,63 @@
|
|||
"file": {
|
||||
"remote": "enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"support_tunnel_mqtt":false,
|
||||
"support_mqtt_alive":false,
|
||||
"support_command_ams_switch":false,
|
||||
"support_cloud_print_only":false,
|
||||
"support_1080dpi":false,
|
||||
"support_prompt_sound":false,
|
||||
"support_ams_humidity":false,
|
||||
"support_auto_recovery_step_loss":false,
|
||||
"support_auto_leveling":true,
|
||||
"support_update_remain":false,
|
||||
"support_timelapse":true,
|
||||
"support_filament_backup":false,
|
||||
"support_chamber_fan":true,
|
||||
"support_aux_fan":true,
|
||||
"support_send_to_sd":false,
|
||||
"support_print_all":true,
|
||||
"support_print_without_sd":true,
|
||||
"support_flow_calibration":true,
|
||||
"support_build_plate_marker_detect":false,
|
||||
"support_lidar_calibration":true,
|
||||
"support_ai_monitoring":false,
|
||||
"support_first_layer_inspect":true,
|
||||
"support_chamber_temp_edit":false,
|
||||
"support_extrusion_cali":false
|
||||
},
|
||||
"model_id": "BL-P001",
|
||||
"compatible_machine":["BL-P002", "C11", "C12", "C13"],
|
||||
"printer_type": "3DPrinter-X1-Carbon",
|
||||
"printer_thumbnail_image": "printer_thumbnail"
|
||||
},
|
||||
"01.01.01.00": {
|
||||
"print": {
|
||||
"support_1080dpi":true,
|
||||
"support_ams_humidity":true,
|
||||
"support_update_remain":true,
|
||||
"support_auto_recovery_step_loss":true,
|
||||
"support_filament_backup":true,
|
||||
"support_send_to_sd":true,
|
||||
"support_build_plate_marker_detect":true,
|
||||
"support_ai_monitoring":true
|
||||
}
|
||||
},
|
||||
"01.05.06.01" : {
|
||||
"print": {
|
||||
"support_command_ams_switch":true
|
||||
}
|
||||
},
|
||||
"01.05.06.05" : {
|
||||
"engineer":"00.03.10.05",
|
||||
"print": {
|
||||
"support_mqtt_alive":true
|
||||
}
|
||||
},
|
||||
"01.05.06.06": {
|
||||
"rv2166": "00.00.21.20"
|
||||
"print": {
|
||||
"support_tunnel_mqtt":true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,10 +11,63 @@
|
|||
"file": {
|
||||
"remote": "enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"support_tunnel_mqtt":false,
|
||||
"support_mqtt_alive":false,
|
||||
"support_command_ams_switch":false,
|
||||
"support_cloud_print_only":false,
|
||||
"support_1080dpi":false,
|
||||
"support_prompt_sound":false,
|
||||
"support_ams_humidity":false,
|
||||
"support_auto_recovery_step_loss":false,
|
||||
"support_auto_leveling":true,
|
||||
"support_update_remain":false,
|
||||
"support_timelapse":true,
|
||||
"support_filament_backup":false,
|
||||
"support_chamber_fan":true,
|
||||
"support_aux_fan":true,
|
||||
"support_send_to_sd":false,
|
||||
"support_print_all":true,
|
||||
"support_print_without_sd":true,
|
||||
"support_flow_calibration":true,
|
||||
"support_build_plate_marker_detect":false,
|
||||
"support_lidar_calibration":true,
|
||||
"support_ai_monitoring":false,
|
||||
"support_first_layer_inspect":true,
|
||||
"support_chamber_temp_edit":false,
|
||||
"support_extrusion_cali":false
|
||||
},
|
||||
"model_id": "BL-P002",
|
||||
"compatible_machine":["BL-P001", "C11", "C12", "C13"],
|
||||
"printer_type": "3DPrinter-X1",
|
||||
"printer_thumbnail_image": "printer_thumbnail"
|
||||
},
|
||||
"01.01.01.00": {
|
||||
"print": {
|
||||
"support_1080dpi":true,
|
||||
"support_ams_humidity":true,
|
||||
"support_update_remain":true,
|
||||
"support_auto_recovery_step_loss":true,
|
||||
"support_filament_backup":true,
|
||||
"support_send_to_sd":true,
|
||||
"support_build_plate_marker_detect":true,
|
||||
"support_ai_monitoring":true
|
||||
}
|
||||
},
|
||||
"01.05.06.01" : {
|
||||
"print": {
|
||||
"support_command_ams_switch":true
|
||||
}
|
||||
},
|
||||
"01.05.06.05" : {
|
||||
"engineer":"00.03.10.05",
|
||||
"print": {
|
||||
"support_mqtt_alive":true
|
||||
}
|
||||
},
|
||||
"01.05.06.06": {
|
||||
"rv2166": "00.00.21.20"
|
||||
"print": {
|
||||
"support_tunnel_mqtt":true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,16 +7,65 @@
|
|||
"liveview": {
|
||||
"local": "local"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"support_tunnel_mqtt":false,
|
||||
"support_mqtt_alive":false,
|
||||
"support_command_ams_switch":false,
|
||||
"support_cloud_print_only":true,
|
||||
"support_1080dpi":false,
|
||||
"support_prompt_sound":false,
|
||||
"support_ams_humidity":true,
|
||||
"support_auto_recovery_step_loss":true,
|
||||
"support_auto_leveling":true,
|
||||
"support_update_remain":true,
|
||||
"support_timelapse":true,
|
||||
"support_filament_backup":false,
|
||||
"support_chamber_fan":true,
|
||||
"support_aux_fan":true,
|
||||
"support_send_to_sd":false,
|
||||
"support_print_all":false,
|
||||
"support_print_without_sd":false,
|
||||
"support_flow_calibration":false,
|
||||
"support_build_plate_marker_detect":false,
|
||||
"support_lidar_calibration":false,
|
||||
"support_ai_monitoring":false,
|
||||
"support_first_layer_inspect":false,
|
||||
"support_chamber_temp_edit":false,
|
||||
"support_extrusion_cali":true,
|
||||
"bed_temperature_limit": 100
|
||||
},
|
||||
"model_id": "C11",
|
||||
"compatible_machine":["BL-P001", "BL-P002", "C12", "C13"],
|
||||
"printer_type": "C11",
|
||||
"ftp_folder" : "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_p1p"
|
||||
},
|
||||
"01.02.00.00": {
|
||||
"print": {
|
||||
"support_send_to_sd":true,
|
||||
"support_ai_monitoring":true
|
||||
}
|
||||
},
|
||||
"01.02.99.00": {
|
||||
"print": {
|
||||
"ipcam": {
|
||||
"liveview": {
|
||||
"remote": "enabled"
|
||||
}
|
||||
}
|
||||
},
|
||||
"support_ai_monitoring":true
|
||||
}
|
||||
},
|
||||
"01.02.99.10" : {
|
||||
"print": {
|
||||
"support_command_ams_switch":true
|
||||
}
|
||||
},
|
||||
"01.03.50.01" : {
|
||||
"engineer":"00.06.03.51",
|
||||
"print": {
|
||||
"support_mqtt_alive":true,
|
||||
"support_tunnel_mqtt":true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,17 +7,55 @@
|
|||
"liveview": {
|
||||
"local": "local"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"support_tunnel_mqtt":false,
|
||||
"support_mqtt_alive":false,
|
||||
"support_command_ams_switch":false,
|
||||
"support_cloud_print_only":true,
|
||||
"support_1080dpi":false,
|
||||
"support_prompt_sound":false,
|
||||
"support_ams_humidity":true,
|
||||
"support_auto_recovery_step_loss":true,
|
||||
"support_auto_leveling":true,
|
||||
"support_update_remain":true,
|
||||
"support_timelapse":true,
|
||||
"support_filament_backup":true,
|
||||
"support_chamber_fan":true,
|
||||
"support_aux_fan":true,
|
||||
"support_send_to_sd":true,
|
||||
"support_print_all":false,
|
||||
"support_print_without_sd":false,
|
||||
"support_flow_calibration":false,
|
||||
"support_build_plate_marker_detect":false,
|
||||
"support_lidar_calibration":false,
|
||||
"support_ai_monitoring":true,
|
||||
"support_first_layer_inspect":false,
|
||||
"support_chamber_temp_edit":false,
|
||||
"support_extrusion_cali":true,
|
||||
"bed_temperature_limit": 100
|
||||
},
|
||||
"model_id": "C12",
|
||||
"compatible_machine":["BL-P001", "BL-P002", "C11", "C13"],
|
||||
"printer_type": "C12",
|
||||
"ftp_folder" : "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_p1p"
|
||||
},
|
||||
"01.02.99.10" : {
|
||||
"print": {
|
||||
"support_command_ams_switch":true
|
||||
}
|
||||
},
|
||||
"01.03.50.01": {
|
||||
"engineer":"00.06.03.51",
|
||||
"resolution_supported": [ "720p" ],
|
||||
"print": {
|
||||
"ipcam": {
|
||||
"liveview": {
|
||||
"remote": "enabled"
|
||||
}
|
||||
}
|
||||
},
|
||||
"support_mqtt_alive":true,
|
||||
"support_tunnel_mqtt":true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"00.00.00.00": {
|
||||
"print": {
|
||||
"ipcam": {
|
||||
"liveview": {
|
||||
"local": "local",
|
||||
"remote": "enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -729,7 +729,7 @@ void AMSMaterialsSetting::update_widgets()
|
|||
else
|
||||
m_panel_normal->Hide();
|
||||
m_panel_kn->Show();
|
||||
} else if (obj && (obj->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY) || obj->is_high_printer_type())) {
|
||||
} else if (obj && (obj->ams_support_virtual_tray || obj->is_high_printer_type())) {
|
||||
m_panel_normal->Show();
|
||||
m_panel_kn->Show();
|
||||
} else {
|
||||
|
|
|
@ -279,12 +279,24 @@ void AMSSetting::update_starting_read_mode(bool selected)
|
|||
|
||||
void AMSSetting::update_remain_mode(bool selected)
|
||||
{
|
||||
if (obj->is_support_update_remain) {
|
||||
m_checkbox_remain->Show();
|
||||
m_title_remain->Show();
|
||||
m_tip_remain_line1->Show();
|
||||
Layout();
|
||||
}
|
||||
else {
|
||||
m_checkbox_remain->Hide();
|
||||
m_title_remain->Hide();
|
||||
m_tip_remain_line1->Hide();
|
||||
Layout();
|
||||
}
|
||||
m_checkbox_remain->SetValue(selected);
|
||||
}
|
||||
|
||||
void AMSSetting::update_switch_filament(bool selected)
|
||||
{
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_AUTO_SWITCH_FILAMENT)) {
|
||||
if (obj->is_support_filament_backup) {
|
||||
m_checkbox_switch_filament->Show();
|
||||
m_title_switch_filament->Show();
|
||||
m_tip_switch_filament_line1->Show();
|
||||
|
|
|
@ -214,8 +214,7 @@ wxWindow* CalibrationDialog::create_check_option(wxString title, wxWindow* paren
|
|||
void CalibrationDialog::update_cali(MachineObject *obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_AI_MONITORING)
|
||||
&& obj->is_function_supported(PrinterFunction::FUNC_LIDAR_CALIBRATION)) {
|
||||
if (obj->is_support_ai_monitoring && obj->is_support_lidar_calibration) {
|
||||
select_xcam_cali->Show();
|
||||
} else {
|
||||
select_xcam_cali->Hide();
|
||||
|
|
|
@ -160,7 +160,7 @@ void CalibrationPAStartPage::on_device_connected(MachineObject* obj)
|
|||
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
||||
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
||||
|
||||
if (!obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
|
||||
if (!obj->is_support_extrusion_cali) {
|
||||
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -260,7 +260,7 @@ void CameraPopup::check_func_supported(MachineObject *obj2)
|
|||
if (m_obj == nullptr)
|
||||
return;
|
||||
// function supported
|
||||
if (m_obj->is_function_supported(PrinterFunction::FUNC_RECORDING) && m_obj->has_ipcam) {
|
||||
if (m_obj->has_ipcam) {
|
||||
m_text_recording->Show();
|
||||
m_switch_recording->Show();
|
||||
} else {
|
||||
|
@ -282,7 +282,7 @@ void CameraPopup::check_func_supported(MachineObject *obj2)
|
|||
link_underline->Hide();
|
||||
}
|
||||
|
||||
allow_alter_resolution = (m_obj->is_function_supported(PrinterFunction::FUNC_ALTER_RESOLUTION) && m_obj->has_ipcam);
|
||||
allow_alter_resolution = ( (m_obj->camera_resolution_supported.size() > 1?true:false) && m_obj->has_ipcam);
|
||||
|
||||
//check u2 version
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
|
|
|
@ -344,14 +344,11 @@ std::string MachineObject::parse_printer_type(std::string type_str)
|
|||
return "BL-P001";
|
||||
} else if (type_str.compare("BL-P001") == 0) {
|
||||
return type_str;
|
||||
} else if (type_str.compare("BL-P003") == 0) {
|
||||
return type_str;
|
||||
} else {
|
||||
return DeviceManager::parse_printer_type(type_str);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string MachineObject::get_preset_printer_model_name(std::string printer_type)
|
||||
{
|
||||
return DeviceManager::get_printer_display_name(printer_type);
|
||||
|
@ -364,7 +361,7 @@ std::string MachineObject::get_preset_printer_thumbnail_img(std::string printer_
|
|||
|
||||
wxString MachineObject::get_printer_type_display_str()
|
||||
{
|
||||
std::string display_name = get_preset_printer_model_name(printer_type);
|
||||
std::string display_name = get_preset_printer_model_name(printer_type);
|
||||
if (!display_name.empty())
|
||||
return display_name;
|
||||
else
|
||||
|
@ -385,7 +382,6 @@ std::string MachineObject::get_ftp_folder()
|
|||
return DeviceManager::get_ftp_folder(printer_type);
|
||||
}
|
||||
|
||||
|
||||
std::string MachineObject::get_access_code()
|
||||
{
|
||||
if (get_user_access_code().empty())
|
||||
|
@ -1351,8 +1347,7 @@ int MachineObject::get_bed_temperature_limit()
|
|||
return 120;
|
||||
}
|
||||
} else {
|
||||
int limit = BED_TEMP_LIMIT;
|
||||
DeviceManager::get_bed_temperature_limit(printer_type, limit);
|
||||
int limit = bed_temperature_limit < 0?BED_TEMP_LIMIT:bed_temperature_limit;
|
||||
return limit;
|
||||
}
|
||||
return BED_TEMP_LIMIT;
|
||||
|
@ -1411,92 +1406,6 @@ std::string MachineObject::parse_version()
|
|||
|
||||
void MachineObject::parse_version_func()
|
||||
{
|
||||
auto ota_version = module_vers.find("ota");
|
||||
auto esp32_version = module_vers.find("esp32");
|
||||
auto rv1126_version = module_vers.find("rv1126");
|
||||
if (get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
if (ota_version != module_vers.end()) {
|
||||
if (ota_version->second.sw_ver.compare("01.01.01.00") <= 0) {
|
||||
ams_support_remain = false;
|
||||
ams_support_auto_switch_filament_flag = false;
|
||||
is_xcam_buildplate_supported = false;
|
||||
xcam_support_recovery_step_loss = false;
|
||||
is_support_send_to_sdcard = false;
|
||||
is_support_1080dpi = false;
|
||||
is_support_ai_monitoring = false;
|
||||
is_support_ams_humidity = false;
|
||||
} else {
|
||||
ams_support_remain = true;
|
||||
ams_support_auto_switch_filament_flag = true;
|
||||
is_xcam_buildplate_supported = true;
|
||||
xcam_support_recovery_step_loss = true;
|
||||
is_support_send_to_sdcard = true;
|
||||
is_support_1080dpi = true;
|
||||
is_support_ai_monitoring = true;
|
||||
is_support_ams_humidity = true;
|
||||
}
|
||||
|
||||
if (ota_version != module_vers.end()) {
|
||||
if (firmware_type == PrinterFirmwareType::FIRMWARE_TYPE_PRODUCTION) {
|
||||
local_use_ssl_for_mqtt = ota_version->second.sw_ver.compare("01.03.01.04") >= 0;
|
||||
}
|
||||
|
||||
if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_PRODUCTION) {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.05.06.05") >= 0;
|
||||
}
|
||||
else if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_ENGINEER) {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("00.03.10.05") >= 0;
|
||||
}
|
||||
else {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.05.06.05") >= 0;
|
||||
}
|
||||
|
||||
is_support_tunnel_mqtt = (ota_version->second.sw_ver.compare("01.05.06.06") >= 0
|
||||
|| (rv1126_version != module_vers.end() && rv1126_version->second.sw_ver.compare("00.00.21.20") >= 0));
|
||||
}
|
||||
}
|
||||
} else if (printer_type == "C11") {
|
||||
is_cloud_print_only = true;
|
||||
if (ota_version != module_vers.end()) {
|
||||
is_support_send_to_sdcard = ota_version->second.sw_ver.compare("01.02.00.00") >= 0;
|
||||
is_support_ai_monitoring = ota_version->second.sw_ver.compare("01.02.99.00") >= 0;
|
||||
is_support_tunnel_mqtt = (ota_version->second.sw_ver.compare("01.03.50.01") >= 0 ||
|
||||
(esp32_version != module_vers.end() && esp32_version->second.sw_ver.compare("01.05.15.00") >= 0));
|
||||
}
|
||||
|
||||
if (esp32_version != module_vers.end()) {
|
||||
ams_support_auto_switch_filament_flag = esp32_version->second.sw_ver.compare("00.03.11.50") >= 0;
|
||||
}
|
||||
|
||||
if (ota_version != module_vers.end()) {
|
||||
if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_PRODUCTION) {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.03.50.01") >= 0;
|
||||
}
|
||||
else if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_ENGINEER) {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("00.06.03.51") >= 0;
|
||||
}
|
||||
else {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.03.50.01") >= 0;
|
||||
}
|
||||
}
|
||||
} else if (printer_type == "C12") {
|
||||
is_support_ai_monitoring = true;
|
||||
is_cloud_print_only = true;
|
||||
|
||||
if (ota_version != module_vers.end()) {
|
||||
is_support_tunnel_mqtt = (ota_version->second.sw_ver.compare("01.03.50.01") >= 0 ||
|
||||
(esp32_version != module_vers.end() && esp32_version->second.sw_ver.compare("01.05.15.00") >= 0));
|
||||
if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_PRODUCTION) {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.03.50.01") >= 0;
|
||||
}
|
||||
else if (lifecycle == PrinterFirmwareType::FIRMWARE_TYPE_ENGINEER) {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("00.06.03.51") >= 0;
|
||||
}
|
||||
else {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.03.50.01") >= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool MachineObject::is_studio_cmd(int sequence_id)
|
||||
|
@ -1736,6 +1645,14 @@ int MachineObject::command_set_nozzle(int temp)
|
|||
int MachineObject::command_set_chamber(int temp)
|
||||
{
|
||||
std::string gcode_str = (boost::format("M141 S%1%\n") % temp).str();
|
||||
try {
|
||||
json j;
|
||||
j["temp_control"] = "chamber_temp";
|
||||
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
if (agent) agent->track_event("printer_control", j.dump());
|
||||
}
|
||||
catch (...) {}
|
||||
return this->publish_gcode(gcode_str);
|
||||
}
|
||||
|
||||
|
@ -1744,19 +1661,30 @@ int MachineObject::command_ams_switch(int tray_index, int old_temp, int new_temp
|
|||
BOOST_LOG_TRIVIAL(trace) << "ams_switch to " << tray_index << " with temp: " << old_temp << ", " << new_temp;
|
||||
if (old_temp < 0) old_temp = FILAMENT_DEF_TEMP;
|
||||
if (new_temp < 0) new_temp = FILAMENT_DEF_TEMP;
|
||||
int tray_id_int = tray_index;
|
||||
|
||||
std::string gcode = "";
|
||||
if (tray_index == 255) {
|
||||
gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode");
|
||||
} else {
|
||||
// include VIRTUAL_TRAY_ID
|
||||
gcode = DeviceManager::load_gcode(printer_type, "ams_load.gcode");
|
||||
boost::replace_all(gcode, "[next_extruder]", std::to_string(tray_index));
|
||||
boost::replace_all(gcode, "[new_filament_temp]", std::to_string(new_temp));
|
||||
int result = 0;
|
||||
|
||||
//command
|
||||
if (is_support_command_ams_switch) {
|
||||
command_ams_change_filament(tray_index, old_temp, new_temp);
|
||||
}
|
||||
else {
|
||||
std::string gcode = "";
|
||||
if (tray_index == 255) {
|
||||
gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode");
|
||||
}
|
||||
else {
|
||||
// include VIRTUAL_TRAY_ID
|
||||
gcode = DeviceManager::load_gcode(printer_type, "ams_load.gcode");
|
||||
boost::replace_all(gcode, "[next_extruder]", std::to_string(tray_index));
|
||||
boost::replace_all(gcode, "[new_filament_temp]", std::to_string(new_temp));
|
||||
}
|
||||
|
||||
result = this->publish_gcode(gcode);
|
||||
}
|
||||
|
||||
return this->publish_gcode(gcode);
|
||||
return result;
|
||||
}
|
||||
|
||||
int MachineObject::command_ams_change_filament(int tray_id, int old_temp, int new_temp)
|
||||
|
@ -2211,8 +2139,7 @@ int MachineObject::command_get_flow_ratio_calibration_result(float nozzle_diamet
|
|||
|
||||
int MachineObject::command_unload_filament()
|
||||
{
|
||||
if (get_printer_series() == PrinterSeries::SERIES_X1
|
||||
&& !this->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY)) {
|
||||
if (get_printer_series() == PrinterSeries::SERIES_X1 && !ams_support_virtual_tray) {
|
||||
// fixed gcode file
|
||||
json j;
|
||||
j["print"]["command"] = "gcode_file";
|
||||
|
@ -2220,10 +2147,7 @@ int MachineObject::command_unload_filament()
|
|||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
return this->publish_json(j.dump());
|
||||
}
|
||||
else if (printer_type == "C11"
|
||||
|| (get_printer_series() == PrinterSeries::SERIES_X1
|
||||
&& this->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY))
|
||||
) {
|
||||
else if (printer_type == "C11" || (get_printer_series() == PrinterSeries::SERIES_X1 && ams_support_virtual_tray) ) {
|
||||
std::string gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode");
|
||||
if (gcode.empty()) {
|
||||
return -1;
|
||||
|
@ -2438,7 +2362,6 @@ void MachineObject::reset()
|
|||
print_status = "";
|
||||
last_mc_print_stage = -1;
|
||||
m_new_ver_list_exist = false;
|
||||
m_is_support_show_bak = false;
|
||||
extruder_axis_status = LOAD;
|
||||
nozzle_diameter = 0.0f;
|
||||
|
||||
|
@ -2457,11 +2380,6 @@ void MachineObject::set_print_state(std::string status)
|
|||
print_status = status;
|
||||
}
|
||||
|
||||
std::vector<std::string> MachineObject::get_compatible_machine()
|
||||
{
|
||||
return DeviceManager::get_compatible_machine(printer_type);
|
||||
}
|
||||
|
||||
int MachineObject::connect(bool is_anonymous, bool use_openssl)
|
||||
{
|
||||
if (dev_ip.empty()) return -1;
|
||||
|
@ -2535,91 +2453,6 @@ bool MachineObject::is_function_supported(PrinterFunction func)
|
|||
{
|
||||
std::string func_name;
|
||||
switch (func) {
|
||||
case FUNC_MONITORING:
|
||||
func_name = "FUNC_MONITORING";
|
||||
break;
|
||||
case FUNC_TIMELAPSE:
|
||||
func_name = "FUNC_TIMELAPSE";
|
||||
break;
|
||||
case FUNC_RECORDING:
|
||||
func_name = "FUNC_RECORDING";
|
||||
break;
|
||||
case FUNC_FIRSTLAYER_INSPECT:
|
||||
func_name = "FUNC_FIRSTLAYER_INSPECT";
|
||||
break;
|
||||
case FUNC_AI_MONITORING:
|
||||
parse_version_func();
|
||||
if (!is_support_ai_monitoring)
|
||||
return false;
|
||||
func_name = "FUNC_AI_MONITORING";
|
||||
break;
|
||||
case FUNC_LIDAR_CALIBRATION:
|
||||
func_name = "FUNC_LIDAR_CALIBRATION";
|
||||
break;
|
||||
case FUNC_BUILDPLATE_MARKER_DETECT:
|
||||
parse_version_func();
|
||||
if (!is_xcam_buildplate_supported)
|
||||
return false;
|
||||
func_name = "FUNC_BUILDPLATE_MARKER_DETECT";
|
||||
break;
|
||||
case FUNC_AUTO_RECOVERY_STEP_LOSS:
|
||||
parse_version_func();
|
||||
if (!xcam_support_recovery_step_loss)
|
||||
return false;
|
||||
func_name = "FUNC_AUTO_RECOVERY_STEP_LOSS";
|
||||
break;
|
||||
case FUNC_FLOW_CALIBRATION:
|
||||
func_name = "FUNC_FLOW_CALIBRATION";
|
||||
break;
|
||||
case FUNC_AUTO_LEVELING:
|
||||
func_name = "FUNC_AUTO_LEVELING";
|
||||
break;
|
||||
case FUNC_CHAMBER_TEMP:
|
||||
func_name = "FUNC_CHAMBER_TEMP";
|
||||
break;
|
||||
case FUNC_PRINT_WITHOUT_SD:
|
||||
func_name = "FUNC_PRINT_WITHOUT_SD";
|
||||
break;
|
||||
case FUNC_USE_AMS:
|
||||
func_name = "FUNC_USE_AMS";
|
||||
break;
|
||||
case FUNC_ALTER_RESOLUTION:
|
||||
func_name = "FUNC_ALTER_RESOLUTION";
|
||||
break;
|
||||
case FUNC_SEND_TO_SDCARD:
|
||||
parse_version_func();
|
||||
if (!is_support_send_to_sdcard)
|
||||
return false;
|
||||
func_name = "FUNC_SEND_TO_SDCARD";
|
||||
break;
|
||||
case FUNC_AUTO_SWITCH_FILAMENT:
|
||||
parse_version_func();
|
||||
if (!ams_support_auto_switch_filament_flag)
|
||||
return false;
|
||||
func_name = "FUNC_AUTO_SWITCH_FILAMENT";
|
||||
break;
|
||||
case FUNC_CHAMBER_FAN:
|
||||
func_name = "FUNC_CHAMBER_FAN";
|
||||
break;
|
||||
case FUNC_AUX_FAN:
|
||||
func_name = "FUNC_AUX_FAN";
|
||||
break;
|
||||
case FUNC_EXTRUSION_CALI:
|
||||
if (!ams_support_virtual_tray)
|
||||
return false;
|
||||
func_name = "FUNC_EXTRUSION_CALI";
|
||||
break;
|
||||
case FUNC_PRINT_ALL:
|
||||
func_name = "FUNC_PRINT_ALL";
|
||||
break;
|
||||
case FUNC_VIRTUAL_TYAY:
|
||||
if (!ams_support_virtual_tray)
|
||||
return false;
|
||||
func_name = "FUNC_VIRTUAL_TYAY";
|
||||
break;
|
||||
case FUNC_FILAMENT_BACKUP:
|
||||
func_name = "FUNC_FILAMENT_BACKUP";
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
@ -2631,10 +2464,9 @@ std::vector<std::string> MachineObject::get_resolution_supported()
|
|||
return camera_resolution_supported;
|
||||
}
|
||||
|
||||
bool MachineObject::is_support_print_with_timelapse()
|
||||
std::vector<std::string> MachineObject::get_compatible_machine()
|
||||
{
|
||||
//TODO version check, set true by default
|
||||
return true;
|
||||
return DeviceManager::get_compatible_machine(printer_type);
|
||||
}
|
||||
|
||||
bool MachineObject::is_camera_busy_off()
|
||||
|
@ -2713,6 +2545,11 @@ int MachineObject::parse_json(std::string payload)
|
|||
this->set_online_state(true);
|
||||
if (m_active_state == NotActive) m_active_state = Active;
|
||||
|
||||
std::chrono::system_clock::time_point curr_time = std::chrono::system_clock::now();
|
||||
auto diff1 = std::chrono::duration_cast<std::chrono::microseconds>(curr_time - last_update_time);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << "interval = " << diff1.count();
|
||||
|
||||
/* update last received time */
|
||||
last_update_time = std::chrono::system_clock::now();
|
||||
|
||||
|
@ -2814,6 +2651,7 @@ int MachineObject::parse_json(std::string payload)
|
|||
}
|
||||
} catch (...) {}
|
||||
|
||||
|
||||
if (j.contains("print")) {
|
||||
json jj = j["print"];
|
||||
int sequence_id = 0;
|
||||
|
@ -2828,6 +2666,166 @@ int MachineObject::parse_json(std::string payload)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//supported function
|
||||
if (jj.contains("support_chamber_temp_edit")) {
|
||||
if (jj["support_chamber_temp_edit"].is_boolean()) {
|
||||
is_support_chamber_edit = jj["support_chamber_temp_edit"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_extrusion_cali")) {
|
||||
if (jj["support_extrusion_cali"].is_boolean()) {
|
||||
is_support_extrusion_cali = jj["support_extrusion_cali"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_first_layer_inspect")) {
|
||||
if (jj["support_first_layer_inspect"].is_boolean()) {
|
||||
is_support_first_layer_inspect = jj["support_first_layer_inspect"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_ai_monitoring")) {
|
||||
if (jj["support_ai_monitoring"].is_boolean()) {
|
||||
is_support_ai_monitoring = jj["support_ai_monitoring"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_lidar_calibration")) {
|
||||
if (jj["support_lidar_calibration"].is_boolean()) {
|
||||
is_support_lidar_calibration = jj["support_lidar_calibration"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_build_plate_marker_detect")) {
|
||||
if (jj["support_build_plate_marker_detect"].is_boolean()) {
|
||||
is_support_build_plate_marker_detect = jj["support_build_plate_marker_detect"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_flow_calibration")) {
|
||||
if (jj["support_flow_calibration"].is_boolean()) {
|
||||
is_support_flow_calibration = jj["support_flow_calibration"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_print_without_sd")) {
|
||||
if (jj["support_print_without_sd"].is_boolean()) {
|
||||
is_support_print_without_sd = jj["support_print_without_sd"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_print_all")) {
|
||||
if (jj["support_print_all"].is_boolean()) {
|
||||
is_support_print_all = jj["support_print_all"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_send_to_sd")) {
|
||||
if (jj["support_send_to_sd"].is_boolean()) {
|
||||
is_support_send_to_sdcard = jj["support_send_to_sd"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_aux_fan")) {
|
||||
if (jj["support_aux_fan"].is_boolean()) {
|
||||
is_support_aux_fan = jj["support_aux_fan"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_chamber_fan")) {
|
||||
if (jj["support_chamber_fan"].is_boolean()) {
|
||||
is_support_chamber_fan = jj["support_chamber_fan"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_filament_backup")) {
|
||||
if (jj["support_filament_backup"].is_boolean()) {
|
||||
is_support_filament_backup = jj["support_filament_backup"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_update_remain")) {
|
||||
if (jj["support_update_remain"].is_boolean()) {
|
||||
is_support_update_remain = jj["support_update_remain"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_auto_leveling")) {
|
||||
if (jj["support_auto_leveling"].is_boolean()) {
|
||||
is_support_auto_leveling = jj["support_auto_leveling"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_auto_recovery_step_loss")) {
|
||||
if (jj["support_auto_recovery_step_loss"].is_boolean()) {
|
||||
is_support_auto_recovery_step_loss = jj["support_auto_recovery_step_loss"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_ams_humidity")) {
|
||||
if (jj["support_ams_humidity"].is_boolean()) {
|
||||
is_support_ams_humidity = jj["support_ams_humidity"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_prompt_sound")) {
|
||||
if (jj["support_prompt_sound"].is_boolean()) {
|
||||
is_support_prompt_sound = jj["support_prompt_sound"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_1080dpi")) {
|
||||
if (jj["support_1080dpi"].is_boolean()) {
|
||||
is_support_1080dpi = jj["support_1080dpi"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_cloud_print_only")) {
|
||||
if (jj["support_cloud_print_only"].is_boolean()) {
|
||||
is_support_cloud_print_only = jj["support_cloud_print_only"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_command_ams_switch")) {
|
||||
if (jj["support_command_ams_switch"].is_boolean()) {
|
||||
is_support_command_ams_switch = jj["support_command_ams_switch"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_mqtt_alive")) {
|
||||
if (jj["support_mqtt_alive"].is_boolean()) {
|
||||
is_support_mqtt_alive = jj["support_mqtt_alive"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_tunnel_mqtt")) {
|
||||
if (jj["support_tunnel_mqtt"].is_boolean()) {
|
||||
is_support_tunnel_mqtt = jj["support_tunnel_mqtt"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("support_timelapse")) {
|
||||
if (jj["support_timelapse"].is_boolean()) {
|
||||
is_support_timelapse = jj["support_timelapse"].get<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("nozzle_max_temperature")) {
|
||||
if (jj["nozzle_max_temperature"].is_number_integer()) {
|
||||
nozzle_max_temperature = jj["nozzle_max_temperature"].get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
if (jj.contains("bed_temperature_limit")) {
|
||||
if (jj["bed_temperature_limit"].is_number_integer()) {
|
||||
bed_temperature_limit = jj["bed_temperature_limit"].get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (jj.contains("command")) {
|
||||
if (jj["command"].get<std::string>() == "push_status") {
|
||||
m_push_count++;
|
||||
|
@ -3116,7 +3114,7 @@ int MachineObject::parse_json(std::string payload)
|
|||
/*get filam_bak*/
|
||||
try {
|
||||
if (jj.contains("filam_bak")) {
|
||||
m_is_support_show_bak = true;
|
||||
is_support_filament_backup = true;
|
||||
filam_bak.clear();
|
||||
if (jj["filam_bak"].is_array()) {
|
||||
for (auto it = jj["filam_bak"].begin(); it != jj["filam_bak"].end(); it++) {
|
||||
|
@ -3125,7 +3123,7 @@ int MachineObject::parse_json(std::string payload)
|
|||
}
|
||||
}
|
||||
else {
|
||||
m_is_support_show_bak = false;
|
||||
is_support_filament_backup = false;
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
|
@ -3406,9 +3404,9 @@ int MachineObject::parse_json(std::string payload)
|
|||
else {
|
||||
if (jj["xcam"].contains("buildplate_marker_detector")) {
|
||||
xcam_buildplate_marker_detector = jj["xcam"]["buildplate_marker_detector"].get<bool>();
|
||||
is_xcam_buildplate_supported = true;
|
||||
is_support_build_plate_marker_detect = true;
|
||||
} else {
|
||||
is_xcam_buildplate_supported = false;
|
||||
is_support_build_plate_marker_detect = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3861,6 +3859,7 @@ int MachineObject::parse_json(std::string payload)
|
|||
}
|
||||
} else {
|
||||
ams_support_virtual_tray = false;
|
||||
is_support_extrusion_cali = false;
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
|
@ -5053,62 +5052,44 @@ void DeviceManager::load_last_machine()
|
|||
json DeviceManager::function_table = json::object();
|
||||
json DeviceManager::filaments_blacklist = json::object();
|
||||
|
||||
|
||||
std::string DeviceManager::get_string_from_config(std::string type_str, std::string item)
|
||||
{
|
||||
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
||||
std::ifstream json_file(config_file.c_str());
|
||||
try {
|
||||
json jj;
|
||||
if (json_file.is_open()) {
|
||||
json_file >> jj;
|
||||
if (jj.contains("00.00.00.00")) {
|
||||
json const& printer = jj["00.00.00.00"];
|
||||
if (printer.contains(item)) {
|
||||
return printer[item].get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...) {}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string DeviceManager::parse_printer_type(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("printer_type")) {
|
||||
return printer["printer_type"].get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
return get_string_from_config(type_str, "printer_type");
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_display_name(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("display_name")) {
|
||||
return printer["display_name"].get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
return get_string_from_config(type_str, "display_name");
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_ftp_folder(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("ftp_folder")) {
|
||||
return printer["ftp_folder"].get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
return get_string_from_config(type_str, "ftp_folder");
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_thumbnail_img(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("printer_thumbnail_image")) {
|
||||
return printer["printer_thumbnail_image"].get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
return get_string_from_config(type_str, "printer_thumbnail_image");
|
||||
}
|
||||
|
||||
bool DeviceManager::is_function_supported(std::string type_str, std::string function_name)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
|
@ -5127,9 +5108,15 @@ bool DeviceManager::is_function_supported(std::string type_str, std::string func
|
|||
std::vector<std::string> DeviceManager::get_resolution_supported(std::string type_str)
|
||||
{
|
||||
std::vector<std::string> resolution_supported;
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
|
||||
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
||||
std::ifstream json_file(config_file.c_str());
|
||||
try {
|
||||
json jj;
|
||||
if (json_file.is_open()) {
|
||||
json_file >> jj;
|
||||
if (jj.contains("00.00.00.00")) {
|
||||
json const& printer = jj["00.00.00.00"];
|
||||
if (printer.contains("camera_resolution")) {
|
||||
for (auto res : printer["camera_resolution"])
|
||||
resolution_supported.emplace_back(res.get<std::string>());
|
||||
|
@ -5137,39 +5124,30 @@ std::vector<std::string> DeviceManager::get_resolution_supported(std::string typ
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (...) {}
|
||||
return resolution_supported;
|
||||
}
|
||||
|
||||
bool DeviceManager::get_bed_temperature_limit(std::string type_str, int &limit)
|
||||
std::vector<std::string> DeviceManager::get_compatible_machine(std::string type_str)
|
||||
{
|
||||
bool result = false;
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("bed_temperature_limit")) {
|
||||
limit = printer["bed_temperature_limit"].get<int>();
|
||||
return true;
|
||||
std::vector<std::string> compatible_machine;
|
||||
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
||||
std::ifstream json_file(config_file.c_str());
|
||||
try {
|
||||
json jj;
|
||||
if (json_file.is_open()) {
|
||||
json_file >> jj;
|
||||
if (jj.contains("00.00.00.00")) {
|
||||
json const& printer = jj["00.00.00.00"];
|
||||
if (printer.contains("compatible_machine")) {
|
||||
for (auto res : printer["compatible_machine"])
|
||||
compatible_machine.emplace_back(res.get<std::string>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool DeviceManager::get_nozzle_max_temperature(std::string type_str, int& limit)
|
||||
{
|
||||
bool result = false;
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("nozzle_max_temperature")) {
|
||||
limit = printer["nozzle_max_temperature"].get<int>();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
catch (...) {}
|
||||
return compatible_machine;
|
||||
}
|
||||
|
||||
bool DeviceManager::load_functional_config(std::string config_file)
|
||||
|
@ -5292,20 +5270,4 @@ std::string DeviceManager::load_gcode(std::string type_str, std::string gcode_fi
|
|||
return "";
|
||||
}
|
||||
|
||||
std::vector<std::string> DeviceManager::get_compatible_machine(std::string type_str)
|
||||
{
|
||||
std::vector<std::string> compatible_machine;
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("compatible_machine")) {
|
||||
for (auto res : printer["compatible_machine"])
|
||||
compatible_machine.emplace_back(res.get<std::string>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return compatible_machine;
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
|
|
@ -59,28 +59,6 @@ enum PrinterSeries {
|
|||
};
|
||||
|
||||
enum PrinterFunction {
|
||||
FUNC_MONITORING = 0,
|
||||
FUNC_TIMELAPSE,
|
||||
FUNC_RECORDING,
|
||||
FUNC_FIRSTLAYER_INSPECT,
|
||||
FUNC_AI_MONITORING,
|
||||
FUNC_LIDAR_CALIBRATION,
|
||||
FUNC_BUILDPLATE_MARKER_DETECT,
|
||||
FUNC_AUTO_RECOVERY_STEP_LOSS,
|
||||
FUNC_FLOW_CALIBRATION,
|
||||
FUNC_AUTO_LEVELING,
|
||||
FUNC_CHAMBER_TEMP,
|
||||
FUNC_PRINT_WITHOUT_SD,
|
||||
FUNC_USE_AMS,
|
||||
FUNC_ALTER_RESOLUTION,
|
||||
FUNC_SEND_TO_SDCARD,
|
||||
FUNC_AUTO_SWITCH_FILAMENT,
|
||||
FUNC_CHAMBER_FAN,
|
||||
FUNC_AUX_FAN,
|
||||
FUNC_EXTRUSION_CALI,
|
||||
FUNC_VIRTUAL_TYAY,
|
||||
FUNC_PRINT_ALL,
|
||||
FUNC_FILAMENT_BACKUP,
|
||||
FUNC_MAX
|
||||
};
|
||||
|
||||
|
@ -408,9 +386,9 @@ public:
|
|||
float nozzle_diameter { 0.0f };
|
||||
std::string dev_connection_type; /* lan | cloud */
|
||||
std::string connection_type() { return dev_connection_type; }
|
||||
void set_dev_ip(std::string ip) {dev_ip = ip;};
|
||||
bool has_access_right() { return !get_access_code().empty(); }
|
||||
void set_dev_ip(std::string ip) {dev_ip = ip;}
|
||||
std::string get_ftp_folder();
|
||||
bool has_access_right() { return !get_access_code().empty(); }
|
||||
std::string get_access_code();
|
||||
|
||||
void set_access_code(std::string code, bool only_refresh = true);
|
||||
|
@ -428,12 +406,12 @@ public:
|
|||
std::string monitor_upgrade_printer_img;
|
||||
|
||||
wxString get_printer_type_display_str();
|
||||
|
||||
std::string get_printer_thumbnail_img_str();
|
||||
|
||||
std::string product_name; // set by iot service, get /user/print
|
||||
|
||||
std::vector<int> filam_bak;
|
||||
bool m_is_support_show_bak{false};
|
||||
|
||||
|
||||
std::string bind_user_name;
|
||||
std::string bind_user_id;
|
||||
|
@ -454,7 +432,6 @@ public:
|
|||
std::chrono::system_clock::time_point last_request_start; /* last received print push from machine */
|
||||
|
||||
int m_active_state = 0; // 0 - not active, 1 - active, 2 - update-to-date
|
||||
bool is_support_tunnel_mqtt = false;
|
||||
bool is_tunnel_mqtt = false;
|
||||
|
||||
/* ams properties */
|
||||
|
@ -469,10 +446,8 @@ public:
|
|||
bool ams_insert_flag { false };
|
||||
bool ams_power_on_flag { false };
|
||||
bool ams_calibrate_remain_flag { false };
|
||||
bool ams_support_auto_switch_filament_flag { true };
|
||||
bool ams_auto_switch_filament_flag { false };
|
||||
bool ams_support_use_ams { false };
|
||||
bool ams_support_remain { true };
|
||||
bool ams_support_virtual_tray { true };
|
||||
int ams_humidity;
|
||||
int ams_user_setting_hold_count = 0;
|
||||
|
@ -691,25 +666,46 @@ public:
|
|||
bool xcam_ai_monitoring{ false };
|
||||
int xcam_ai_monitoring_hold_count = 0;
|
||||
std::string xcam_ai_monitoring_sensitivity;
|
||||
bool is_xcam_buildplate_supported { true };
|
||||
bool xcam_buildplate_marker_detector{ false };
|
||||
int xcam_buildplate_marker_hold_count = 0;
|
||||
bool xcam_support_recovery_step_loss { true };
|
||||
bool xcam_auto_recovery_step_loss{ false };
|
||||
int xcam_auto_recovery_hold_count = 0;
|
||||
int ams_print_option_count = 0;
|
||||
|
||||
/*not support U2*/
|
||||
bool is_support_1080dpi {false};
|
||||
//supported features
|
||||
bool is_support_chamber_edit{false};
|
||||
bool is_support_extrusion_cali{false};
|
||||
bool is_support_first_layer_inspect{false};
|
||||
bool is_support_ai_monitoring {false};
|
||||
bool is_support_ams_humidity {true};
|
||||
bool is_cloud_print_only {false};
|
||||
bool is_support_lidar_calibration {false};
|
||||
bool is_support_build_plate_marker_detect{false};
|
||||
bool is_support_flow_calibration{false};
|
||||
bool is_support_print_without_sd{false};
|
||||
bool is_support_print_all{false};
|
||||
bool is_support_send_to_sdcard {false};
|
||||
bool is_support_aux_fan {false};
|
||||
bool is_support_chamber_fan{false};
|
||||
bool is_support_filament_backup{false};
|
||||
bool is_support_timelapse{false};
|
||||
bool is_support_update_remain{false};
|
||||
bool is_support_auto_leveling{false};
|
||||
bool is_support_auto_recovery_step_loss{false};
|
||||
bool is_support_ams_humidity {false};
|
||||
bool is_support_prompt_sound{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};
|
||||
|
||||
int nozzle_max_temperature = -1;
|
||||
int bed_temperature_limit = -1;
|
||||
|
||||
|
||||
|
||||
/* sdcard */
|
||||
MachineObject::SdcardState sdcard_state { NO_SDCARD };
|
||||
MachineObject::SdcardState get_sdcard_state();
|
||||
bool is_support_send_to_sdcard { true };
|
||||
|
||||
/* HMS */
|
||||
std::vector<HMSItem> hms_list;
|
||||
|
@ -843,7 +839,6 @@ public:
|
|||
static bool is_in_printing_status(std::string status);
|
||||
|
||||
void set_print_state(std::string status);
|
||||
std::vector<std::string> get_compatible_machine();
|
||||
|
||||
bool is_connected();
|
||||
bool is_connecting();
|
||||
|
@ -851,10 +846,11 @@ public:
|
|||
bool is_online() { return m_is_online; }
|
||||
bool is_info_ready();
|
||||
bool is_function_supported(PrinterFunction func);
|
||||
std::vector<std::string> get_resolution_supported();
|
||||
bool is_support_print_with_timelapse();
|
||||
bool is_camera_busy_off();
|
||||
|
||||
std::vector<std::string> get_resolution_supported();
|
||||
std::vector<std::string> get_compatible_machine();
|
||||
|
||||
/* Msg for display MsgFn */
|
||||
typedef std::function<void(std::string topic, std::string payload)> MsgFn;
|
||||
int publish_json(std::string json_str, int qos = 0);
|
||||
|
@ -926,20 +922,18 @@ public:
|
|||
static json function_table;
|
||||
static json filaments_blacklist;
|
||||
|
||||
static std::string get_string_from_config(std::string type_str, std::string item);
|
||||
static std::string parse_printer_type(std::string type_str);
|
||||
static std::string get_printer_display_name(std::string type_str);
|
||||
static std::string get_printer_thumbnail_img(std::string type_str);
|
||||
static std::string get_ftp_folder(std::string type_str);
|
||||
static bool is_function_supported(std::string type_str, std::string function_name);
|
||||
static std::vector<std::string> get_resolution_supported(std::string type_str);
|
||||
|
||||
static bool get_bed_temperature_limit(std::string type_str, int& limit);
|
||||
static bool get_nozzle_max_temperature(std::string type_str, int& limit);
|
||||
static std::vector<std::string> get_compatible_machine(std::string type_str);
|
||||
static bool load_functional_config(std::string config_file);
|
||||
static bool load_filaments_blacklist_config(std::string config_file);
|
||||
static void check_filaments_in_blacklist(std::string tag_vendor, std::string tag_type, bool& in_blacklist, std::string& ac, std::string& info);
|
||||
static std::string load_gcode(std::string type_str, std::string gcode_file);
|
||||
static std::vector<std::string> get_compatible_machine(std::string type_str);
|
||||
};
|
||||
|
||||
} // namespace Slic3r
|
||||
|
|
|
@ -1451,8 +1451,7 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_ams_list(MachineObject
|
|||
if (!obj) return filament_ams_list;
|
||||
|
||||
auto vt_tray = obj->vt_tray;
|
||||
bool is_support_virtual_tray = obj->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY);
|
||||
if (is_support_virtual_tray) {
|
||||
if (obj->ams_support_virtual_tray) {
|
||||
DynamicPrintConfig vt_tray_config;
|
||||
vt_tray_config.set_key_value("filament_id", new ConfigOptionStrings{ vt_tray.setting_id });
|
||||
vt_tray_config.set_key_value("tag_uid", new ConfigOptionStrings{ vt_tray.tag_uid });
|
||||
|
|
|
@ -82,7 +82,7 @@ void PrintOptionsDialog::update_ai_monitor_status()
|
|||
void PrintOptionsDialog::update_options(MachineObject* obj_)
|
||||
{
|
||||
if (!obj_) return;
|
||||
if (obj_->is_function_supported(PrinterFunction::FUNC_AI_MONITORING)) {
|
||||
if (obj_->is_support_ai_monitoring) {
|
||||
text_ai_monitoring->Show();
|
||||
m_cb_ai_monitoring->Show();
|
||||
text_ai_monitoring_caption->Show();
|
||||
|
@ -97,7 +97,7 @@ void PrintOptionsDialog::update_options(MachineObject* obj_)
|
|||
line1->Hide();
|
||||
}
|
||||
|
||||
if (obj_->is_function_supported(PrinterFunction::FUNC_BUILDPLATE_MARKER_DETECT)) {
|
||||
if (obj_->is_support_build_plate_marker_detect) {
|
||||
text_plate_mark->Show();
|
||||
m_cb_plate_mark->Show();
|
||||
text_plate_mark_caption->Show();
|
||||
|
@ -110,7 +110,7 @@ void PrintOptionsDialog::update_options(MachineObject* obj_)
|
|||
line2->Hide();
|
||||
}
|
||||
|
||||
if (obj_->is_function_supported(PrinterFunction::FUNC_FIRSTLAYER_INSPECT)) {
|
||||
if (obj_->is_support_first_layer_inspect) {
|
||||
text_first_layer->Show();
|
||||
m_cb_first_layer->Show();
|
||||
line3->Show();
|
||||
|
@ -121,7 +121,7 @@ void PrintOptionsDialog::update_options(MachineObject* obj_)
|
|||
line3->Hide();
|
||||
}
|
||||
|
||||
if (obj_->is_function_supported(PrinterFunction::FUNC_AUTO_RECOVERY_STEP_LOSS)) {
|
||||
if (obj_->is_support_auto_recovery_step_loss) {
|
||||
text_auto_recovery->Show();
|
||||
m_cb_auto_recovery->Show();
|
||||
line4->Show();
|
||||
|
|
|
@ -1300,7 +1300,7 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
|
|||
|
||||
//check support function
|
||||
if (!m_obj) return;
|
||||
if (!m_obj->is_function_supported(PrinterFunction::FUNC_SEND_TO_SDCARD)) {
|
||||
if (!m_obj->is_support_send_to_sdcard) {
|
||||
wxString input_str = wxString::Format("%s|%s", ip, str_access_code);
|
||||
auto event = wxCommandEvent(EVT_ENTER_IP_ADDRESS);
|
||||
event.SetString(input_str);
|
||||
|
|
|
@ -1657,21 +1657,19 @@ wxWindow *SelectMachineDialog::create_item_checkbox(wxString title, wxWindow *pa
|
|||
|
||||
void SelectMachineDialog::update_select_layout(MachineObject *obj)
|
||||
{
|
||||
if (obj && obj->is_function_supported(PrinterFunction::FUNC_FLOW_CALIBRATION)) {
|
||||
if (obj && obj->is_support_flow_calibration) {
|
||||
select_flow->Show();
|
||||
} else {
|
||||
select_flow->Hide();
|
||||
}
|
||||
|
||||
if (obj && obj->is_function_supported(PrinterFunction::FUNC_AUTO_LEVELING)) {
|
||||
if (obj && obj->is_support_auto_leveling) {
|
||||
select_bed->Show();
|
||||
} else {
|
||||
select_bed->Hide();
|
||||
}
|
||||
|
||||
if (obj && obj->is_function_supported(PrinterFunction::FUNC_TIMELAPSE)
|
||||
&& obj->is_support_print_with_timelapse()
|
||||
&& is_show_timelapse()) {
|
||||
if (obj && obj->is_support_timelapse && is_show_timelapse()) {
|
||||
select_timelapse->Show();
|
||||
} else {
|
||||
select_timelapse->Hide();
|
||||
|
@ -2531,7 +2529,7 @@ void SelectMachineDialog::on_send_print()
|
|||
m_print_job->m_local_use_ssl_for_mqtt = obj_->local_use_ssl_for_mqtt;
|
||||
#endif
|
||||
m_print_job->connection_type = obj_->connection_type();
|
||||
m_print_job->cloud_print_only = obj_->is_cloud_print_only;
|
||||
m_print_job->cloud_print_only = obj_->is_support_cloud_print_only;
|
||||
|
||||
if (m_print_type == PrintFromType::FROM_NORMAL) {
|
||||
BOOST_LOG_TRIVIAL(info) << "print_job: m_print_type = from_normal";
|
||||
|
@ -2942,10 +2940,8 @@ void SelectMachineDialog::on_timer(wxTimerEvent &event)
|
|||
if (!obj_
|
||||
|| obj_->amsList.empty()
|
||||
|| obj_->ams_exist_bits == 0
|
||||
|| !obj_->m_is_support_show_bak
|
||||
|| !obj_->ams_support_auto_switch_filament_flag
|
||||
|| !obj_->is_support_filament_backup
|
||||
|| !obj_->ams_auto_switch_filament_flag
|
||||
|| !obj_->is_function_supported(PrinterFunction::FUNC_FILAMENT_BACKUP)
|
||||
|| !m_checkbox_list["use_ams"]->GetValue() ) {
|
||||
if (m_ams_backup_tip->IsShown()) {
|
||||
m_ams_backup_tip->Hide();
|
||||
|
@ -3027,9 +3023,7 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
|
|||
|
||||
void SelectMachineDialog::update_ams_check(MachineObject* obj)
|
||||
{
|
||||
if (obj && obj->is_function_supported(FUNC_USE_AMS)
|
||||
&& obj->ams_support_use_ams
|
||||
&& obj->has_ams()) {
|
||||
if (obj && obj->ams_support_use_ams && obj->has_ams()) {
|
||||
select_use_ams->Show();
|
||||
} else {
|
||||
select_use_ams->Hide();
|
||||
|
@ -3107,7 +3101,7 @@ void SelectMachineDialog::update_show_status()
|
|||
reset_timeout();
|
||||
update_ams_check(obj_);
|
||||
|
||||
if (!obj_->is_function_supported(PrinterFunction::FUNC_PRINT_ALL) && m_print_plate_idx == PLATE_ALL_IDX) {
|
||||
if (!obj_->is_support_print_all && m_print_plate_idx == PLATE_ALL_IDX) {
|
||||
show_status(PrintDialogStatus::PrintStatusNotSupportedPrintAll);
|
||||
return;
|
||||
}
|
||||
|
@ -3163,7 +3157,7 @@ void SelectMachineDialog::update_show_status()
|
|||
show_status(PrintDialogStatus::PrintStatusInPrinting);
|
||||
return;
|
||||
}
|
||||
else if (!obj_->is_function_supported(PrinterFunction::FUNC_PRINT_WITHOUT_SD) && (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD)) {
|
||||
else if (!obj_->is_support_print_without_sd && (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD)) {
|
||||
show_status(PrintDialogStatus::PrintStatusNoSdcard);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1039,12 +1039,6 @@ void SendToPrinterDialog::update_show_status()
|
|||
|
||||
reset_timeout();
|
||||
|
||||
bool is_suppt = obj_->is_function_supported(PrinterFunction::FUNC_SEND_TO_SDCARD);
|
||||
if (!is_suppt) {
|
||||
show_status(PrintDialogStatus::PrintStatusNotSupportedSendToSDCard);
|
||||
return;
|
||||
}
|
||||
|
||||
// reading done
|
||||
if (obj_->is_in_upgrading()) {
|
||||
show_status(PrintDialogStatus::PrintStatusInUpgrading);
|
||||
|
@ -1067,7 +1061,12 @@ void SendToPrinterDialog::update_show_status()
|
|||
show_status(PrintDialogStatus::PrintStatusNotOnTheSameLAN);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!obj_->is_support_send_to_sdcard) {
|
||||
show_status(PrintDialogStatus::PrintStatusNotSupportedSendToSDCard);
|
||||
return;
|
||||
}
|
||||
|
||||
show_status(PrintDialogStatus::PrintStatusReadingFinished);
|
||||
}
|
||||
|
||||
|
|
|
@ -1444,24 +1444,23 @@ void StatusPanel::update_camera_state(MachineObject* obj)
|
|||
}
|
||||
|
||||
//recording
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_RECORDING)) {
|
||||
if (m_last_recording != (obj->is_recording() ? 1: 0)) {
|
||||
if (obj->is_recording()) {
|
||||
m_bitmap_recording_img->SetBitmap(m_bitmap_recording_on.bmp());
|
||||
} else {
|
||||
m_bitmap_recording_img->SetBitmap(m_bitmap_recording_off.bmp());
|
||||
}
|
||||
m_last_recording = obj->is_recording() ? 1 : 0;
|
||||
if (m_last_recording != (obj->is_recording() ? 1 : 0)) {
|
||||
if (obj->is_recording()) {
|
||||
m_bitmap_recording_img->SetBitmap(m_bitmap_recording_on.bmp());
|
||||
}
|
||||
if (!m_bitmap_recording_img->IsShown())
|
||||
m_bitmap_recording_img->Show();
|
||||
} else {
|
||||
if (m_bitmap_recording_img->IsShown())
|
||||
m_bitmap_recording_img->Hide();
|
||||
else {
|
||||
m_bitmap_recording_img->SetBitmap(m_bitmap_recording_off.bmp());
|
||||
}
|
||||
m_last_recording = obj->is_recording() ? 1 : 0;
|
||||
}
|
||||
if (!m_bitmap_recording_img->IsShown())
|
||||
m_bitmap_recording_img->Show();
|
||||
|
||||
/*if (m_bitmap_recording_img->IsShown())
|
||||
m_bitmap_recording_img->Hide();*/
|
||||
|
||||
//timelapse
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_TIMELAPSE)) {
|
||||
if (obj->is_support_timelapse) {
|
||||
if (m_last_timelapse != (obj->is_timelapse() ? 1: 0)) {
|
||||
if (obj->is_timelapse()) {
|
||||
m_bitmap_timelapse_img->SetBitmap(m_bitmap_timelapse_on.bmp());
|
||||
|
@ -1815,11 +1814,9 @@ void StatusPanel::update(MachineObject *obj)
|
|||
|
||||
if (obj) {
|
||||
// update extrusion calibration
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
|
||||
if (m_extrusion_cali_dlg) {
|
||||
m_extrusion_cali_dlg->update_machine_obj(obj);
|
||||
m_extrusion_cali_dlg->update();
|
||||
}
|
||||
if (m_extrusion_cali_dlg) {
|
||||
m_extrusion_cali_dlg->update_machine_obj(obj);
|
||||
m_extrusion_cali_dlg->update();
|
||||
}
|
||||
|
||||
// update calibration status
|
||||
|
@ -1832,10 +1829,10 @@ void StatusPanel::update(MachineObject *obj)
|
|||
calibration_dlg->update_cali(obj);
|
||||
|
||||
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_FIRSTLAYER_INSPECT)
|
||||
|| obj->is_function_supported(PrinterFunction::FUNC_AI_MONITORING)
|
||||
|| obj->is_function_supported(PrinterFunction::FUNC_BUILDPLATE_MARKER_DETECT)
|
||||
|| obj->is_function_supported(PrinterFunction::FUNC_AUTO_RECOVERY_STEP_LOSS)) {
|
||||
if (obj->is_support_first_layer_inspect
|
||||
|| obj->is_support_ai_monitoring
|
||||
|| obj->is_support_build_plate_marker_detect
|
||||
|| obj->is_support_auto_recovery_step_loss) {
|
||||
m_options_btn->Show();
|
||||
if (print_options_dlg == nullptr) {
|
||||
print_options_dlg = new PrintOptionsDialog(this);
|
||||
|
@ -1849,7 +1846,7 @@ void StatusPanel::update(MachineObject *obj)
|
|||
}
|
||||
|
||||
//support edit chamber temp
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_CHAMBER_TEMP)) {
|
||||
if (obj->is_support_chamber_edit) {
|
||||
m_tempCtrl_chamber->SetReadOnly(false);
|
||||
m_tempCtrl_chamber->Enable();
|
||||
} else {
|
||||
|
@ -2080,9 +2077,8 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
|
|||
}
|
||||
|
||||
m_tempCtrl_nozzle->SetCurrTemp((int) obj->nozzle_temp);
|
||||
int nozzle_max_temp = 0;
|
||||
if (DeviceManager::get_nozzle_max_temperature(obj->printer_type, nozzle_max_temp)) {
|
||||
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(nozzle_max_temp);
|
||||
if (obj->nozzle_max_temperature > -1) {
|
||||
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(obj->nozzle_max_temperature);
|
||||
}
|
||||
else {
|
||||
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(nozzle_temp_range[1]);
|
||||
|
@ -2136,8 +2132,8 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
|
|||
// update extruder icon
|
||||
update_extruder_status(obj);
|
||||
|
||||
bool is_suppt_aux_fun = obj->is_function_supported(PrinterFunction::FUNC_AUX_FAN);
|
||||
bool is_suppt_cham_fun = obj->is_function_supported(PrinterFunction::FUNC_CHAMBER_FAN);
|
||||
bool is_suppt_aux_fun = obj->is_support_aux_fan;
|
||||
bool is_suppt_cham_fun = obj->is_support_chamber_fan;
|
||||
|
||||
//update cham fan
|
||||
if (m_current_support_cham_fan != is_suppt_cham_fun) {
|
||||
|
@ -2278,8 +2274,8 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
CalibUtils::emit_get_PA_calib_info(obj->nozzle_diameter, "");
|
||||
}
|
||||
|
||||
bool is_support_virtual_tray = obj->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY);
|
||||
bool is_support_filament_backup = obj->is_function_supported(PrinterFunction::FUNC_FILAMENT_BACKUP);
|
||||
bool is_support_virtual_tray = obj->ams_support_virtual_tray;
|
||||
bool is_support_filament_backup = obj->is_support_filament_backup;
|
||||
AMSModel ams_mode = AMSModel::GENERIC_AMS;
|
||||
|
||||
if (!obj
|
||||
|
@ -2309,7 +2305,7 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
|
||||
show_ams_group(true);
|
||||
|
||||
if (!obj->m_is_support_show_bak || !is_support_filament_backup || !obj->ams_support_auto_switch_filament_flag) {
|
||||
if (!is_support_filament_backup) {
|
||||
m_ams_control->show_auto_refill(false);
|
||||
}
|
||||
else {
|
||||
|
@ -3140,7 +3136,7 @@ void StatusPanel::on_ams_setting_click(SimpleEvent &event)
|
|||
try {
|
||||
int ams_id_int = atoi(ams_id.c_str());
|
||||
m_ams_setting_dlg->ams_id = ams_id_int;
|
||||
m_ams_setting_dlg->ams_support_remain = obj->ams_support_remain;
|
||||
m_ams_setting_dlg->ams_support_remain = obj->is_support_update_remain;
|
||||
m_ams_setting_dlg->Show();
|
||||
}
|
||||
catch (...) {
|
||||
|
@ -3569,8 +3565,8 @@ void StatusPanel::on_nozzle_fan_switch(wxCommandEvent &event)
|
|||
m_fan_control_popup = new FanControlPopup(this);
|
||||
|
||||
if (obj) {
|
||||
m_fan_control_popup->show_cham_fan(obj->is_function_supported(PrinterFunction::FUNC_CHAMBER_FAN));
|
||||
m_fan_control_popup->show_aux_fan(obj->is_function_supported(PrinterFunction::FUNC_AUX_FAN));
|
||||
m_fan_control_popup->show_cham_fan(obj->is_support_chamber_fan);
|
||||
m_fan_control_popup->show_aux_fan(obj->is_support_aux_fan);
|
||||
}
|
||||
|
||||
auto pos = m_switch_nozzle_fan->GetScreenPosition();
|
||||
|
|
|
@ -576,7 +576,7 @@ void FanControlPopup::show_aux_fan(bool support_aux_fun)
|
|||
|
||||
void FanControlPopup::update_fan_data(MachineObject::FanType type, MachineObject* obj)
|
||||
{
|
||||
m_is_suppt_cham_fun = obj->is_function_supported(PrinterFunction::FUNC_CHAMBER_FAN);
|
||||
m_is_suppt_cham_fun = obj->is_support_chamber_fan;
|
||||
show_cham_fan(m_is_suppt_cham_fun);
|
||||
|
||||
if (type == MachineObject::FanType::COOLING_FAN && obj->cooling_fan_speed >= 0) {
|
||||
|
|
|
@ -930,7 +930,7 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, std::string &error_m
|
|||
error_message = L("The printer is busy on other print job");
|
||||
return;
|
||||
}
|
||||
else if (!obj_->is_function_supported(PrinterFunction::FUNC_PRINT_WITHOUT_SD) && (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD)) {
|
||||
else if (!obj_->is_support_print_without_sd && (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD)) {
|
||||
error_message = L("An SD card needs to be inserted before printing.");
|
||||
return;
|
||||
}
|
||||
|
@ -956,7 +956,7 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, std::string &error_m
|
|||
#endif
|
||||
|
||||
print_job->connection_type = obj_->connection_type();
|
||||
print_job->cloud_print_only = obj_->is_cloud_print_only;
|
||||
print_job->cloud_print_only = obj_->is_support_cloud_print_only;
|
||||
|
||||
PrintPrepareData job_data;
|
||||
job_data.is_from_plater = false;
|
||||
|
|
Loading…
Reference in New Issue