mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
Merge branch 'v1.7.2-remote'
Signed-off-by: SoftFever <softfeverever@gmail.com> # Conflicts: # deps/ZLIB/ZLIB.cmake # localization/i18n/OrcaSlicer.pot # localization/i18n/de/OrcaSlicer_de.po # localization/i18n/en/OrcaSlicer_en.po # localization/i18n/es/OrcaSlicer_es.po # localization/i18n/fr/OrcaSlicer_fr.po # localization/i18n/hu/OrcaSlicer_hu.po # localization/i18n/it/OrcaSlicer_it.po # localization/i18n/ja/OrcaSlicer_ja.po # localization/i18n/ko/OrcaSlicer_ko.po # localization/i18n/list.txt # localization/i18n/nl/OrcaSlicer_nl.po # localization/i18n/sv/OrcaSlicer_sv.po # localization/i18n/zh_cn/OrcaSlicer_zh_CN.po # resources/calib/PressureAdvance/pa_pattern.3mf # resources/handy_models/Disc.stl # resources/i18n/de/BambuStudio.mo # resources/i18n/en/BambuStudio.mo # resources/i18n/es/BambuStudio.mo # resources/i18n/fr/BambuStudio.mo # resources/i18n/hu/BambuStudio.mo # resources/i18n/it/BambuStudio.mo # resources/i18n/ja/BambuStudio.mo # resources/i18n/ko/BambuStudio.mo # resources/i18n/nl/BambuStudio.mo # resources/i18n/sv/BambuStudio.mo # resources/i18n/zh_cn/BambuStudio.mo # resources/profiles/Anycubic.json # resources/profiles/Anycubic/machine/Anycubic Kobra 2 0.4 nozzle.json # resources/profiles/BBL.json # resources/profiles/BBL/filament/Bambu ASA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Bambu ASA @BBL X1C 0.4 nozzle.json # resources/profiles/BBL/filament/Bambu ASA @BBL X1C.json # resources/profiles/BBL/filament/Bambu PA-CF @base.json # resources/profiles/BBL/filament/Bambu PA6-CF @BBL X1C.json # resources/profiles/BBL/filament/Bambu PA6-CF @base.json # resources/profiles/BBL/filament/Bambu PETG-CF @BBL X1C.json # resources/profiles/BBL/filament/Bambu Support W @BBL X1.json # resources/profiles/BBL/filament/Bambu TPU 95A @BBL X1.json # resources/profiles/BBL/filament/Generic HIPS @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Generic HIPS @BBL X1C.json # resources/profiles/BBL/filament/Generic PA-CF.json # resources/profiles/BBL/filament/Generic PC.json # resources/profiles/BBL/filament/Generic PETG-CF @BBL X1C.json # resources/profiles/BBL/filament/Generic PLA @0.2 nozzle.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL P1P.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL X1C.json # resources/profiles/BBL/filament/Generic PLA-CF.json # resources/profiles/BBL/filament/Generic PLA.json # resources/profiles/BBL/filament/Generic TPU.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL P1P.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL X1.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL X1C.json # resources/profiles/BBL/filament/Overture Matte PLA @base.json # resources/profiles/BBL/filament/Overture PLA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/Overture PLA @BBL P1P.json # resources/profiles/BBL/filament/Overture PLA @BBL X1.json # resources/profiles/BBL/filament/Overture PLA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Overture PLA @BBL X1C.json # resources/profiles/BBL/filament/Overture PLA @base.json # resources/profiles/BBL/filament/P1P/Bambu TPU 95A @BBL P1P.json # resources/profiles/BBL/filament/P1P/Generic PLA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/P1P/Generic TPU @BBL P1P.json # resources/profiles/BBL/filament/P1P/eSUN PLA+ @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/P1P/eSUN PLA+ @BBL P1P.json # resources/profiles/BBL/filament/PolyLite ABS @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ABS @BBL P1P.json # resources/profiles/BBL/filament/PolyLite ABS @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ABS @BBL X1C.json # resources/profiles/BBL/filament/PolyLite ABS @base.json # resources/profiles/BBL/filament/PolyLite ASA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ASA @BBL P1P.json # resources/profiles/BBL/filament/PolyLite ASA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ASA @BBL X1C.json # resources/profiles/BBL/filament/PolyLite ASA @base.json # resources/profiles/BBL/filament/PolyLite PETG @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite PETG @BBL P1P.json # resources/profiles/BBL/filament/PolyLite PETG @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite PETG @BBL X1C.json # resources/profiles/BBL/filament/PolyLite PETG @base.json # resources/profiles/BBL/filament/PolyLite PLA @BBL X1.json # resources/profiles/BBL/filament/PolyTerra PLA @BBL X1.json # resources/profiles/BBL/filament/eSUN PLA+ @BBL X1.json # resources/profiles/BBL/filament/eSUN PLA+ @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/eSUN PLA+ @BBL X1C.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.8 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.8 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.8 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.8 nozzle.json # resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json # resources/profiles/BBL/process/0.06mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.08mm Extra Fine @BBL P1P.json # resources/profiles/BBL/process/0.08mm Extra Fine @BBL X1C.json # resources/profiles/BBL/process/0.08mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.10mm Standard @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/process/0.10mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.12mm Fine @BBL P1P.json # resources/profiles/BBL/process/0.12mm Fine @BBL X1C.json # resources/profiles/BBL/process/0.12mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.14mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.16mm Optimal @BBL P1P.json # resources/profiles/BBL/process/0.16mm Optimal @BBL X1C.json # resources/profiles/BBL/process/0.18mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.20mm Standard @BBL P1P.json # resources/profiles/BBL/process/0.20mm Standard @BBL X1C.json # resources/profiles/BBL/process/0.20mm Strength @BBL P1P.json # resources/profiles/BBL/process/0.20mm Strength @BBL X1C.json # resources/profiles/BBL/process/0.24mm Draft @BBL P1P.json # resources/profiles/BBL/process/0.24mm Draft @BBL X1C.json # resources/profiles/BBL/process/0.24mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.24mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.28mm Extra Draft @BBL P1P.json # resources/profiles/BBL/process/0.28mm Extra Draft @BBL X1C.json # resources/profiles/BBL/process/0.30mm Standard @BBL P1P 0.6 nozzle.json # resources/profiles/BBL/process/0.30mm Standard @BBL X1 0.6 nozzle.json # resources/profiles/BBL/process/0.30mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.30mm Strength @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.32mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.36mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.40mm Standard @BBL P1P 0.8 nozzle.json # resources/profiles/BBL/process/0.40mm Standard @BBL X1 0.8 nozzle.json # resources/profiles/BBL/process/0.40mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.42mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.48mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.56mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/fdm_process_bbl_common.json # resources/profiles/Creality.json # resources/profiles/Creality/machine/Creality CR-10 Max 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-10 V2 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.2 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.6 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.8 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.2 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.6 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.8 nozzle.json # resources/profiles/Creality/machine/Creality Ender-3 S1 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-3 S1 Pro 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5 Plus 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5 S1 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5S 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-6 0.4 nozzle.json # resources/profiles/Elegoo.json # resources/profiles/Elegoo/machine/Elegoo Neptune 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 2 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 2D 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 2S 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 Max 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 Plus 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 Pro 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune X 0.4 nozzle.json # resources/profiles/Prusa.json # resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json # resources/profiles/Prusa/machine/Prusa MK3S 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-CF Pro 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Max 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Max 3 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Plus 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Plus 3 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Smart 3 0.4 nozzle.json # resources/profiles/Tronxy.json # resources/profiles/Tronxy/machine/Tronxy X5SA 400 0.4 nozzle.json # resources/profiles/Tronxy/process/0.08mm Extra Fine @Tronxy.json # resources/profiles/Tronxy/process/0.12mm Fine @Tronxy.json # resources/profiles/Tronxy/process/0.15mm Optimal @Tronxy.json # resources/profiles/Tronxy/process/0.20mm Standard @Tronxy.json # resources/profiles/Tronxy/process/0.24mm Draft @Tronxy.json # resources/profiles/Tronxy/process/0.28mm Extra Draft @Tronxy.json # resources/profiles/Voxelab/machine/Voxelab Aquila X2 0.4 nozzle.json # resources/web/data/text.js # src/OrcaSlicer.cpp # src/libslic3r/GCode.cpp # src/libslic3r/GCode/SeamPlacer.cpp # src/libslic3r/GCode/SeamPlacer.hpp # src/libslic3r/GCodeWriter.cpp # src/libslic3r/GCodeWriter.hpp # src/libslic3r/Preset.cpp # src/libslic3r/PresetBundle.cpp # src/libslic3r/Print.cpp # src/libslic3r/PrintConfig.cpp # src/libslic3r/PrintConfig.hpp # src/libslic3r/TreeSupport.cpp # src/libslic3r/calib.cpp # src/libslic3r/calib.hpp # src/slic3r/GUI/BackgroundSlicingProcess.cpp # src/slic3r/GUI/BedShapeDialog.cpp # src/slic3r/GUI/ConfigManipulation.cpp # src/slic3r/GUI/GUI.cpp # src/slic3r/GUI/GUI_App.cpp # src/slic3r/GUI/GUI_Factories.cpp # src/slic3r/GUI/GUI_ObjectList.cpp # src/slic3r/GUI/Jobs/ArrangeJob.cpp # src/slic3r/GUI/OptionsGroup.cpp # src/slic3r/GUI/PartPlate.cpp # src/slic3r/GUI/PartPlate.hpp # src/slic3r/GUI/Plater.cpp # src/slic3r/GUI/StatusPanel.cpp # src/slic3r/GUI/Tab.cpp # src/slic3r/GUI/Widgets/AMSControl.hpp # version.inc
This commit is contained in:
commit
b8172316b8
608 changed files with 23446 additions and 10493 deletions
|
@ -15,6 +15,9 @@ wxDEFINE_EVENT(EVT_DEVICE_CHANGED, wxCommandEvent);
|
|||
wxDEFINE_EVENT(EVT_CALIBRATION_JOB_FINISHED, wxCommandEvent);
|
||||
|
||||
static const wxString NA_STR = _L("N/A");
|
||||
static const float MIN_PA_K_VALUE = 0.0;
|
||||
static const float MAX_PA_K_VALUE = 0.5;
|
||||
static const float MIN_PA_K_VALUE_STEP = 0.001;
|
||||
|
||||
bool check_preset_name_valid(const wxString& name) {
|
||||
wxString error_message;
|
||||
|
@ -46,6 +49,18 @@ std::map<int, Preset*> get_cached_selected_filament(MachineObject* obj) {
|
|||
return selected_filament_map;
|
||||
}
|
||||
|
||||
bool is_pa_params_valid(const Calib_Params& params)
|
||||
{
|
||||
if (params.start < MIN_PA_K_VALUE || params.end > MAX_PA_K_VALUE || params.step < EPSILON || params.end < params.start + params.step) {
|
||||
MessageDialog msg_dlg(nullptr,
|
||||
wxString::Format(_L("Please input valid values:\nStart value: >= %.1f\nEnd value: <= %.1f\nEnd value: > Start value\nValue step: >= %.3f)"), MIN_PA_K_VALUE, MAX_PA_K_VALUE, MIN_PA_K_VALUE_STEP),
|
||||
wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CalibrationWizard::CalibrationWizard(wxWindow* parent, CalibMode mode, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
||||
: wxPanel(parent, id, pos, size, style)
|
||||
, m_mode(mode)
|
||||
|
@ -136,6 +151,25 @@ void CalibrationWizard::on_device_connected(MachineObject* obj)
|
|||
|
||||
recover_preset_info(obj);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << "on_device_connected - machine object status:"
|
||||
<< " dev_id = " << obj->dev_id
|
||||
<< ", print_type = " << obj->printer_type
|
||||
<< ", printer_status = " << obj->print_status
|
||||
<< ", cali_finished = " << obj->cali_finished
|
||||
<< ", cali_version = " << obj->cali_version
|
||||
<< ", cache_flow_ratio = " << obj->cache_flow_ratio
|
||||
<< ", sub_task_name = " << obj->subtask_name
|
||||
<< ", gcode_file_name = " << obj->m_gcode_file;
|
||||
|
||||
for (const CaliPresetInfo& preset_info : obj->selected_cali_preset) {
|
||||
BOOST_LOG_TRIVIAL(info) << "on_device_connected - selected preset: "
|
||||
<< "tray_id = " << preset_info.tray_id
|
||||
<< ", nozzle_diameter = " << preset_info.nozzle_diameter
|
||||
<< ", filament_id = " << preset_info.filament_id
|
||||
<< ", settring_id = " << preset_info.setting_id
|
||||
<< ", name = " << preset_info.name;
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_page_steps.size(); i++) {
|
||||
if (m_page_steps[i]->page)
|
||||
m_page_steps[i]->page->on_device_connected(obj);
|
||||
|
@ -154,14 +188,14 @@ void CalibrationWizard::set_cali_method(CalibrationMethod method)
|
|||
bool CalibrationWizard::save_preset(const std::string &old_preset_name, const std::string &new_preset_name, const std::map<std::string, ConfigOption *> &key_values, std::string& message)
|
||||
{
|
||||
if (new_preset_name.empty()) {
|
||||
message = L("The name cannot be empty.");
|
||||
message = _u8L("The name cannot be empty.");
|
||||
return false;
|
||||
}
|
||||
|
||||
PresetCollection *filament_presets = &wxGetApp().preset_bundle->filaments;
|
||||
Preset* preset = filament_presets->find_preset(old_preset_name);
|
||||
if (!preset) {
|
||||
message = (boost::format(L("The selected preset: %1% is not found.")) % old_preset_name).str();
|
||||
message = (boost::format(_u8L("The selected preset: %1% is not found.")) % old_preset_name).str();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -173,12 +207,12 @@ bool CalibrationWizard::save_preset(const std::string &old_preset_name, const st
|
|||
Preset *new_preset = filament_presets->find_preset(new_name);
|
||||
if (new_preset) {
|
||||
if (new_preset->is_system) {
|
||||
message = L("The name cannot be the same as the system preset name.");
|
||||
message = _u8L("The name cannot be the same as the system preset name.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (new_preset != preset) {
|
||||
message = L("The name is the same as another existing preset name");
|
||||
message = _u8L("The name is the same as another existing preset name");
|
||||
return false;
|
||||
}
|
||||
if (new_preset != &filament_presets->get_edited_preset()) new_preset = &temp_preset;
|
||||
|
@ -199,7 +233,7 @@ bool CalibrationWizard::save_preset(const std::string &old_preset_name, const st
|
|||
// Preset* preset = &m_presets.preset(it - m_presets.begin(), true);
|
||||
if (!new_preset) {
|
||||
BOOST_LOG_TRIVIAL(info) << "create new preset failed";
|
||||
message = L("create new preset failed.");
|
||||
message = _u8L("create new preset failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -339,6 +373,18 @@ PressureAdvanceWizard::PressureAdvanceWizard(wxWindow* parent, wxWindowID id, co
|
|||
create_pages();
|
||||
}
|
||||
|
||||
void PressureAdvanceWizard::on_cali_job_finished(wxString evt_data)
|
||||
{
|
||||
int cali_stage = 0;
|
||||
CalibMode obj_cali_mode = CalibUtils::get_calib_mode_by_name(evt_data.ToStdString(), cali_stage);
|
||||
|
||||
if (obj_cali_mode == m_mode) {
|
||||
show_step(cali_step);
|
||||
}
|
||||
// change ui, hide
|
||||
static_cast<CalibrationPresetPage *>(preset_step->page)->on_cali_finished_job();
|
||||
}
|
||||
|
||||
void PressureAdvanceWizard::create_pages()
|
||||
{
|
||||
start_step = new CalibrationWizardPageStep(new CalibrationPAStartPage(m_scrolledWindow));
|
||||
|
@ -422,6 +468,7 @@ void PressureAdvanceWizard::on_device_connected(MachineObject* obj)
|
|||
CalibrationMethod method;
|
||||
int cali_stage = 0;
|
||||
CalibMode obj_cali_mode = get_obj_calibration_mode(obj, method, cali_stage);
|
||||
obj->manual_pa_cali_method = ManualPaCaliMethod(cali_stage);
|
||||
|
||||
// show cali step when obj is in pa calibration
|
||||
if (obj) {
|
||||
|
@ -431,6 +478,8 @@ void PressureAdvanceWizard::on_device_connected(MachineObject* obj)
|
|||
if (obj_cali_mode == m_mode) {
|
||||
if (!obj->cali_finished && (obj->is_in_printing() || obj->is_printing_finished())) {
|
||||
CalibrationWizard::set_cali_method(method);
|
||||
CalibrationCaliPage *cali_page = (static_cast<CalibrationCaliPage *>(cali_step->page));
|
||||
cali_page->set_pa_cali_image(cali_stage);
|
||||
show_step(cali_step);
|
||||
}
|
||||
}
|
||||
|
@ -504,11 +553,13 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
return;
|
||||
}
|
||||
|
||||
if (curr_obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
//std::string error_message;
|
||||
wxString wx_err_string;
|
||||
if (m_cali_method == CalibrationMethod::CALI_METHOD_AUTO && curr_obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
X1CCalibInfos calib_infos;
|
||||
for (auto& item : selected_filaments) {
|
||||
int nozzle_temp = -1;
|
||||
int bed_temp = -1;
|
||||
for (auto &item : selected_filaments) {
|
||||
int nozzle_temp = -1;
|
||||
int bed_temp = -1;
|
||||
float max_volumetric_speed = -1;
|
||||
|
||||
if (!get_preset_info(item.second->config, plate_type, nozzle_temp, bed_temp, max_volumetric_speed)) {
|
||||
|
@ -517,54 +568,93 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
}
|
||||
|
||||
X1CCalibInfos::X1CCalibInfo calib_info;
|
||||
calib_info.tray_id = item.first;
|
||||
calib_info.nozzle_diameter = nozzle_dia;
|
||||
calib_info.filament_id = item.second->filament_id;
|
||||
calib_info.setting_id = item.second->setting_id;
|
||||
calib_info.bed_temp = bed_temp;
|
||||
calib_info.nozzle_temp = nozzle_temp;
|
||||
calib_info.tray_id = item.first;
|
||||
calib_info.nozzle_diameter = nozzle_dia;
|
||||
calib_info.filament_id = item.second->filament_id;
|
||||
calib_info.setting_id = item.second->setting_id;
|
||||
calib_info.bed_temp = bed_temp;
|
||||
calib_info.nozzle_temp = nozzle_temp;
|
||||
calib_info.max_volumetric_speed = max_volumetric_speed;
|
||||
calib_infos.calib_datas.push_back(calib_info);
|
||||
}
|
||||
CalibUtils::calib_PA(calib_infos, 0, wx_err_string); // mode = 0 for auto
|
||||
|
||||
std::string error_message;
|
||||
wxString wx_err_string;
|
||||
if (m_cali_method == CalibrationMethod::CALI_METHOD_AUTO) {
|
||||
CalibUtils::calib_PA(calib_infos, 0, error_message); // mode = 0 for auto
|
||||
wx_err_string = from_u8(error_message);
|
||||
} else if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
||||
CalibUtils::calib_PA(calib_infos, 1, error_message); // mode = 1 for manual
|
||||
wx_err_string = from_u8(error_message);
|
||||
} else {
|
||||
assert(false);
|
||||
}
|
||||
if (!wx_err_string.empty()) {
|
||||
MessageDialog msg_dlg(nullptr, wx_err_string, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (curr_obj->get_printer_series() == PrinterSeries::SERIES_P1P) {
|
||||
|
||||
show_step(m_curr_step->next);
|
||||
} else if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
||||
if (selected_filaments.empty()) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "CaliPreset: selected filaments is empty";
|
||||
return;
|
||||
}
|
||||
else {
|
||||
int nozzle_temp = -1;
|
||||
int bed_temp = -1;
|
||||
float max_volumetric_speed = -1;
|
||||
if (!get_preset_info(selected_filaments.begin()->second->config, plate_type, nozzle_temp, bed_temp, max_volumetric_speed)) {
|
||||
BOOST_LOG_TRIVIAL(error) << "CaliPreset: get preset info error";
|
||||
return;
|
||||
}
|
||||
|
||||
CalibInfo calib_info;
|
||||
calib_info.dev_id = curr_obj->dev_id;
|
||||
calib_info.select_ams = "[" + std::to_string(selected_filaments.begin()->first) + "]";
|
||||
Preset *preset = selected_filaments.begin()->second;
|
||||
Preset * temp_filament_preset = new Preset(preset->type, preset->name + "_temp");
|
||||
temp_filament_preset->config = preset->config;
|
||||
|
||||
int nozzle_temp = -1;
|
||||
int bed_temp = -1;
|
||||
float max_volumetric_speed = -1;
|
||||
if (!get_preset_info(selected_filaments.begin()->second->config, plate_type, nozzle_temp, bed_temp, max_volumetric_speed)) {
|
||||
BOOST_LOG_TRIVIAL(error) << "CaliPreset: get preset info error";
|
||||
return;
|
||||
calib_info.bed_type = plate_type;
|
||||
calib_info.process_bar = preset_page->get_sending_progress_bar();
|
||||
calib_info.printer_prest = preset_page->get_printer_preset(curr_obj, nozzle_dia);
|
||||
calib_info.print_prest = preset_page->get_print_preset();
|
||||
calib_info.filament_prest = temp_filament_preset;
|
||||
|
||||
wxArrayString values = preset_page->get_custom_range_values();
|
||||
if (values.size() != 3) {
|
||||
MessageDialog msg_dlg(nullptr, _L("The input value size must be 3."), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
} else {
|
||||
values[0].ToDouble(&calib_info.params.start);
|
||||
values[1].ToDouble(&calib_info.params.end);
|
||||
values[2].ToDouble(&calib_info.params.step);
|
||||
}
|
||||
calib_info.params.mode = preset_page->get_pa_cali_method();
|
||||
calib_info.params.print_numbers = true;
|
||||
|
||||
if (!is_pa_params_valid(calib_info.params))
|
||||
return;
|
||||
|
||||
ManualPaCaliMethod pa_cali_method = ManualPaCaliMethod::PA_LINE;
|
||||
CalibrationCaliPage *cali_page = (static_cast<CalibrationCaliPage *>(cali_step->page));
|
||||
if (calib_info.params.mode == CalibMode::Calib_PA_Line)
|
||||
pa_cali_method = ManualPaCaliMethod::PA_LINE;
|
||||
else if (calib_info.params.mode == CalibMode::Calib_PA_Pattern)
|
||||
pa_cali_method = ManualPaCaliMethod::PA_PATTERN;
|
||||
|
||||
cali_page->set_pa_cali_image(int(pa_cali_method));
|
||||
curr_obj->manual_pa_cali_method = pa_cali_method;
|
||||
|
||||
CalibUtils::calib_generic_PA(calib_info, wx_err_string);
|
||||
|
||||
if (!wx_err_string.empty()) {
|
||||
MessageDialog msg_dlg(nullptr, wx_err_string, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
||||
preset_page->on_cali_start_job();
|
||||
}
|
||||
|
||||
curr_obj->command_start_extrusion_cali(selected_filaments.begin()->first,
|
||||
nozzle_temp, bed_temp, max_volumetric_speed, setting_id);
|
||||
} else {
|
||||
assert(false);
|
||||
BOOST_LOG_TRIVIAL(error) << "CaliPreset: unsupported printer type or cali method";
|
||||
return;
|
||||
}
|
||||
|
||||
show_step(m_curr_step->next);
|
||||
|
||||
CalibrationCaliPage* cali_page = (static_cast<CalibrationCaliPage*>(cali_step->page));
|
||||
cali_page->clear_last_job_status();
|
||||
}
|
||||
|
@ -853,6 +943,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||
if (!wx_err_string.empty()) {
|
||||
MessageDialog msg_dlg(nullptr, wx_err_string, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
show_step(m_curr_step->next);
|
||||
|
||||
|
@ -903,9 +994,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||
calib_info.filament_prest = temp_filament_preset;
|
||||
|
||||
if (cali_stage > 0) {
|
||||
std::string error_message;
|
||||
CalibUtils::calib_flowrate(cali_stage, calib_info, error_message);
|
||||
wx_err_string = from_u8(error_message);
|
||||
CalibUtils::calib_flowrate(cali_stage, calib_info, wx_err_string);
|
||||
}
|
||||
else {
|
||||
wx_err_string = _L("Internal Error") + wxString(": Invalid calibration stage");
|
||||
|
@ -917,6 +1006,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||
if (!wx_err_string.empty()) {
|
||||
MessageDialog msg_dlg(nullptr, wx_err_string, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
preset_page->on_cali_start_job();
|
||||
if (temp_filament_preset)
|
||||
|
@ -1009,7 +1099,7 @@ void FlowRateWizard::on_cali_save()
|
|||
|
||||
std::string message;
|
||||
if (!save_preset(old_preset_name, into_u8(new_preset_name), key_value_map, message)) {
|
||||
MessageDialog error_msg_dlg(nullptr, message, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog error_msg_dlg(nullptr, from_u8(message), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
error_msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
@ -1248,12 +1338,11 @@ void MaxVolumetricSpeedWizard::on_cali_start()
|
|||
calib_info.print_prest = preset_page->get_print_preset();
|
||||
|
||||
wxString wx_err_string;
|
||||
std::string error_message;
|
||||
CalibUtils::calib_max_vol_speed(calib_info, error_message);
|
||||
wx_err_string = from_u8(error_message);
|
||||
CalibUtils::calib_max_vol_speed(calib_info, wx_err_string);
|
||||
if (!wx_err_string.empty()) {
|
||||
MessageDialog msg_dlg(nullptr, wx_err_string, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
||||
preset_page->on_cali_start_job();
|
||||
|
@ -1288,7 +1377,7 @@ void MaxVolumetricSpeedWizard::on_cali_save()
|
|||
|
||||
std::string message;
|
||||
if (!save_preset(old_preset_name, new_preset_name, key_value_map, message)) {
|
||||
MessageDialog error_msg_dlg(nullptr, message, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog error_msg_dlg(nullptr, from_u8(message), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
error_msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue