diff --git a/src/slic3r/GUI/CalibrationWizard.cpp b/src/slic3r/GUI/CalibrationWizard.cpp index 7200479f9c..bf905bc13a 100644 --- a/src/slic3r/GUI/CalibrationWizard.cpp +++ b/src/slic3r/GUI/CalibrationWizard.cpp @@ -842,7 +842,7 @@ void PressureAdvanceWizard::on_cali_start() int selected_tray_id = 0; CalibInfo calib_info; - calib_info.dev_id = curr_obj->dev_id; + calib_info.dev_id = curr_obj->get_dev_id(); get_tray_ams_and_slot_id(curr_obj, item.first, calib_info.ams_id, calib_info.slot_id, selected_tray_id); calib_info.index = preset_page->get_index_by_tray_id(selected_tray_id); calib_info.extruder_id = preset_page->get_extruder_id(calib_info.ams_id); diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp index ada979f80e..9034b5c965 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -2169,9 +2169,9 @@ void CalibrationPresetPage::init_with_machine(MachineObject* obj) m_filament_list_panel->Hide(); } else { - - if ((obj->m_extder_data.extders.size() > 0) && (obj->m_extder_data.extders[0].current_nozzle_flow_type != NozzleFlowType::NONE_FLOWTYPE)) { - m_comboBox_nozzle_volume->SetSelection(obj->m_extder_data.extders[0].current_nozzle_flow_type - 1); + if ((obj->GetExtderSystem()->GetTotalExtderCount() > 0) && (obj->GetExtderSystem()->GetNozzleFlowType(0) != NozzleFlowType::NONE_FLOWTYPE)) + { + m_comboBox_nozzle_volume->SetSelection(obj->GetExtderSystem()->GetNozzleFlowType(0) - 1); } else { m_comboBox_nozzle_volume->SetSelection(0); } diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 06cff54149..40a807eccd 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1632,78 +1632,6 @@ int MachineObject::command_ams_drying_stop() return this->publish_json(j); } -int MachineObject::command_set_chamber_light(LIGHT_EFFECT effect, int on_time, int off_time, int loops, int interval) -{ - json j; - j["system"]["command"] = "ledctrl"; - j["system"]["led_node"] = "chamber_light"; - j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - j["system"]["led_mode"] = light_effect_str(effect); - j["system"]["led_on_time"] = on_time; - j["system"]["led_off_time"] = off_time; - j["system"]["loop_times"] = loops; - j["system"]["interval_time"] = interval; - return this->publish_json(j); -} - - -int MachineObject::command_set_chamber_light2(LIGHT_EFFECT effect, int on_time /*= 500*/, int off_time /*= 500*/, int loops /*= 1*/, int interval /*= 1000*/) -{ - json j; - j["system"]["command"] = "ledctrl"; - j["system"]["led_node"] = "chamber_light2"; - j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - j["system"]["led_mode"] = light_effect_str(effect); - j["system"]["led_on_time"] = on_time; - j["system"]["led_off_time"] = off_time; - j["system"]["loop_times"] = loops; - j["system"]["interval_time"] = interval; - return this->publish_json(j); -} - -int MachineObject::command_set_printer_nozzle(std::string nozzle_type, float diameter) -{ - nozzle_setting_hold_count = HOLD_COUNT_MAX * 2; - - json j; - j["system"]["command"] = "set_accessories"; - j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - j["system"]["accessory_type"] = "nozzle"; - j["system"]["nozzle_type"] = nozzle_type; - j["system"]["nozzle_diameter"] = diameter; - return this->publish_json(j); -} - -int MachineObject::command_set_printer_nozzle2(int id, std::string nozzle_type, float diameter) -{ - nozzle_setting_hold_count = HOLD_COUNT_MAX * 2; - - json j; - j["print"]["command"] = "set_nozzle"; - j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - j["print"]["id"] = id; - j["print"]["type"] = nozzle_type; - j["print"]["diameter"] = diameter; - j["print"]["wear"] = 0; - return this->publish_json(j); -} - - -int MachineObject::command_set_work_light(LIGHT_EFFECT effect, int on_time, int off_time, int loops, int interval) -{ - json j; - j["system"]["command"] = "ledctrl"; - j["system"]["led_node"] = "work_light"; - j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - j["system"]["led_mode"] = light_effect_str(effect); - j["system"]["led_on_time"] = on_time; - j["system"]["led_off_time"] = off_time; - j["system"]["loop_times"] = loops; - j["system"]["interval_time"] = interval; - - return this->publish_json(j); -} - int MachineObject::command_start_extrusion_cali(int tray_index, int nozzle_temp, int bed_temp, float max_volumetric_speed, std::string setting_id) { BOOST_LOG_TRIVIAL(trace) << "extrusion_cali: tray_id = " << tray_index << ", nozzle_temp = " << nozzle_temp << ", bed_temp = " << bed_temp diff --git a/src/slic3r/Utils/CalibUtils.cpp b/src/slic3r/Utils/CalibUtils.cpp index d1a13c1460..16f0b0fb60 100644 --- a/src/slic3r/Utils/CalibUtils.cpp +++ b/src/slic3r/Utils/CalibUtils.cpp @@ -1433,16 +1433,16 @@ bool CalibUtils::check_printable_status_before_cali(const MachineObject *obj, co } } - if (extruder_id >= obj->m_extder_data.extders.size()) { + if (extruder_id >= obj->GetExtderSystem()->GetExtruders().size()) { error_message = _L("The number of printer extruders and the printer selected for calibration does not match."); return false; } - float diameter = obj->m_extder_data.extders[extruder_id].current_nozzle_diameter; + float diameter = obj->GetExtderSystem()->GetNozzleDiameter(extruder_id); bool is_multi_extruder = obj->is_multi_extruders(); std::vector nozzle_volume_types; if (is_multi_extruder) { - for (const Extder &extruder : obj->m_extder_data.extders) { nozzle_volume_types.emplace_back(extruder.current_nozzle_flow_type); } + for (auto &extruder : obj->GetExtderSystem()->GetExtruders()) { nozzle_volume_types.emplace_back(extruder.GetNozzleFlowType()); } } for (const auto &cali_info : cali_infos) { @@ -1859,19 +1859,19 @@ void CalibUtils::send_to_print(const std::vector &calib_infos, wxStri return; } - else if (!obj_->is_support_print_without_sd && (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD)) { + else if (!obj_->GetConfig()->SupportPrintWithoutSD() && (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD)) { error_message = _L("Storage needs to be inserted before printing."); return; } if (obj_->is_lan_mode_printer()) { - if (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD) { + if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD) { error_message = _L("Storage needs to be inserted before printing via LAN."); return; } } auto print_job = std::make_shared(dev_id); - print_job->m_dev_ip = obj_->dev_ip; + print_job->m_dev_ip = obj_->get_dev_ip(); print_job->m_ftp_folder = obj_->get_ftp_folder(); print_job->m_access_code = obj_->get_access_code(); @@ -1931,8 +1931,8 @@ void CalibUtils::send_to_print(const std::vector &calib_infos, wxStri print_job->m_project_name = get_calib_mode_name(cali_mode, flow_ratio_mode); print_job->set_calibration_task(true); - print_job->has_sdcard = obj_->get_sdcard_state() == MachineObject::SdcardState::HAS_SDCARD_NORMAL; - print_job->set_print_config(MachineBedTypeString[bed_type], true, false, false, false, true, false, 0, 1, 0); + print_job->has_sdcard = obj_->GetStorage()->get_sdcard_state() == DevStorage::HAS_SDCARD_NORMAL; + print_job->set_print_config(MachineBedTypeString[bed_type], true, true, false, false, true, false, 0, 1, 0); print_job->set_print_job_finished_event(wxGetApp().plater()->get_send_calibration_finished_event(), print_job->m_project_name); { // after send: record the print job