mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 06:41:14 -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
|
@ -747,16 +747,6 @@ bool AMSMaterialsSetting::Show(bool show)
|
|||
m_input_nozzle_min->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
|
||||
//m_clr_picker->set_color(m_clr_picker->GetParent()->GetBackgroundColour());
|
||||
|
||||
/*if (obj && (obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI) || obj->is_high_printer_type())) {
|
||||
m_ratio_text->Show();
|
||||
m_k_param->Show();
|
||||
m_input_k_val->Show();
|
||||
}
|
||||
else {
|
||||
m_ratio_text->Hide();
|
||||
m_k_param->Hide();
|
||||
m_input_k_val->Hide();
|
||||
}*/
|
||||
m_ratio_text->Show();
|
||||
m_k_param->Show();
|
||||
m_input_k_val->Show();
|
||||
|
|
|
@ -192,8 +192,8 @@ void AMSSetting::create()
|
|||
wxPanel* m_panel_img = new wxPanel(m_panel_body, wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
||||
m_panel_img->SetBackgroundColour(AMS_SETTING_GREY200);
|
||||
wxBoxSizer *m_sizer_img = new wxBoxSizer(wxVERTICAL);
|
||||
auto img = new wxStaticBitmap(m_panel_img, wxID_ANY, create_scaled_bitmap("ams_icon", nullptr, 126), wxDefaultPosition, wxDefaultSize);
|
||||
m_sizer_img->Add(img, 0, wxALIGN_CENTER | wxTOP, 26);
|
||||
ams_img = new wxStaticBitmap(m_panel_img, wxID_ANY, create_scaled_bitmap("ams_icon", nullptr, 126), wxDefaultPosition, wxDefaultSize);
|
||||
m_sizer_img->Add(ams_img, 0, wxALIGN_CENTER | wxTOP, 26);
|
||||
m_sizer_img->Add(0, 0, 0, wxTOP, 18);
|
||||
m_panel_img->SetSizer(m_sizer_img);
|
||||
m_panel_img->Layout();
|
||||
|
@ -262,6 +262,19 @@ void AMSSetting::update_insert_material_read_mode(bool selected)
|
|||
Fit();
|
||||
}
|
||||
|
||||
void AMSSetting::update_image(std::string ams_type)
|
||||
{
|
||||
if (ams_type == m_current_ams_type) return;
|
||||
if (ams_type == "generic") {
|
||||
ams_img->SetBitmap(create_scaled_bitmap("monitor_upgrade_f1", nullptr, 126));
|
||||
}
|
||||
else {
|
||||
ams_img->SetBitmap(create_scaled_bitmap("ams_icon", nullptr, 126));
|
||||
}
|
||||
m_current_ams_type = ams_type;
|
||||
Layout();
|
||||
}
|
||||
|
||||
void AMSSetting::update_starting_read_mode(bool selected)
|
||||
{
|
||||
m_checkbox_starting_auto_read->SetValue(selected);
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
void create();
|
||||
|
||||
void update_insert_material_read_mode(bool selected);
|
||||
void update_image(std::string ams_type);
|
||||
void update_starting_read_mode(bool selected);
|
||||
void update_remain_mode(bool selected);
|
||||
void update_switch_filament(bool selected);
|
||||
|
@ -46,6 +47,7 @@ protected:
|
|||
void on_dpi_changed(const wxRect &suggested_rect) override;
|
||||
|
||||
protected:
|
||||
std::string m_current_ams_type;
|
||||
wxPanel * m_panel_body;
|
||||
CheckBox * m_checkbox_Insert_material_auto_read;
|
||||
wxStaticText *m_title_Insert_material_auto_read;
|
||||
|
@ -68,7 +70,7 @@ protected:
|
|||
|
||||
wxStaticText *m_tip_ams_img;
|
||||
Button * m_button_auto_demarcate;
|
||||
|
||||
wxStaticBitmap* ams_img;
|
||||
wxBoxSizer *m_sizer_Insert_material_tip_inline;
|
||||
wxBoxSizer *m_sizer_starting_tip_inline;
|
||||
wxBoxSizer *m_sizer_remain_inline;
|
||||
|
|
|
@ -273,7 +273,7 @@ void BackgroundSlicingProcess::process_sla()
|
|||
|
||||
//BBS: add plate id for thumbnail generation
|
||||
ThumbnailsList thumbnails = this->render_thumbnails(
|
||||
ThumbnailsParams{ THUMBNAIL_SIZE, true, true, true, true, 0 });
|
||||
ThumbnailsParams{ current_print()->full_print_config().option<ConfigOptionPoints>("thumbnail_size")->values, true, true, true, true, 0 });
|
||||
|
||||
Zipper zipper(export_path);
|
||||
m_sla_archive.export_print(zipper, *m_sla_print); // true, false, true, true); // renders also supports and pad
|
||||
|
|
|
@ -50,16 +50,16 @@ CalibrationDialog::CalibrationDialog(Plater *plater)
|
|||
|
||||
select_xcam_cali = create_check_option(_L("Micro lidar calibration"), cali_left_panel, _L("Micro lidar calibration"), "xcam_cali");
|
||||
select_bed_leveling = create_check_option(_L("Bed leveling"), cali_left_panel, _L("Bed leveling"), "bed_leveling");
|
||||
select_vibration = create_check_option(_L("Resonance frequency identification"), cali_left_panel, _L("Resonance frequency identification"), "vibration");
|
||||
select_vibration = create_check_option(_L("Vibration compensation"), cali_left_panel, _L("Vibration compensation"), "vibration");
|
||||
select_motor_noise = create_check_option(_L("Motor noise cancellation"), cali_left_panel, _L("Motor noise cancellation"), "motor_noise");
|
||||
|
||||
m_checkbox_list["xcam_cali"]->SetValue(true);
|
||||
m_checkbox_list["bed_leveling"]->SetValue(true);
|
||||
m_checkbox_list["vibration"]->SetValue(true);
|
||||
|
||||
|
||||
cali_left_sizer->Add(0, FromDIP(18), 0, wxEXPAND, 0);
|
||||
cali_left_sizer->Add(select_xcam_cali, 0, wxLEFT, FromDIP(15));
|
||||
cali_left_sizer->Add(select_bed_leveling, 0, wxLEFT, FromDIP(15));
|
||||
cali_left_sizer->Add(select_vibration, 0, wxLEFT, FromDIP(15));
|
||||
cali_left_sizer->Add(select_motor_noise, 0, wxLEFT, FromDIP(15));
|
||||
cali_left_sizer->Add(0, FromDIP(30), 0, wxEXPAND, 0);
|
||||
|
||||
auto cali_left_text_top = new wxStaticText(cali_left_panel, wxID_ANY, _L("Calibration program"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
|
@ -208,6 +208,7 @@ wxWindow* CalibrationDialog::create_check_option(wxString title, wxWindow* paren
|
|||
|
||||
text->Bind(wxEVT_LEFT_DOWN, [this, check](wxMouseEvent&) { check->SetValue(check->GetValue() ? false : true); });
|
||||
m_checkbox_list[param] = check;
|
||||
m_checkbox_list[param]->SetValue(true);
|
||||
return checkbox;
|
||||
}
|
||||
|
||||
|
@ -219,6 +220,30 @@ void CalibrationDialog::update_cali(MachineObject *obj)
|
|||
select_xcam_cali->Show();
|
||||
} else {
|
||||
select_xcam_cali->Hide();
|
||||
m_checkbox_list["xcam_cali"]->SetValue(false);
|
||||
}
|
||||
|
||||
if(obj->is_function_supported(PrinterFunction::FUNC_AUTO_LEVELING)){
|
||||
select_bed_leveling->Show();
|
||||
}else{
|
||||
select_bed_leveling->Hide();
|
||||
m_checkbox_list["bed_leveling"]->SetValue(false);
|
||||
}
|
||||
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_MOTOR_NOISE_CALI)) {
|
||||
select_motor_noise->Show();
|
||||
} else {
|
||||
select_motor_noise->Hide();
|
||||
m_checkbox_list["motor_noise"]->SetValue(false);
|
||||
}
|
||||
|
||||
if (!m_checkbox_list["vibration"]->GetValue() && !m_checkbox_list["bed_leveling"]->GetValue() && !m_checkbox_list["xcam_cali"]->GetValue() &&
|
||||
!m_checkbox_list["motor_noise"]->GetValue()) {
|
||||
m_calibration_btn->Disable();
|
||||
m_calibration_btn->SetLabel(_L("No step selected"));
|
||||
return ;
|
||||
} else {
|
||||
m_calibration_btn->Enable();
|
||||
}
|
||||
|
||||
if (obj->is_calibration_running() || obj->is_calibration_done()) {
|
||||
|
@ -284,7 +309,8 @@ void CalibrationDialog::on_start_calibration(wxMouseEvent &event)
|
|||
m_obj->command_start_calibration(
|
||||
m_checkbox_list["vibration"]->GetValue(),
|
||||
m_checkbox_list["bed_leveling"]->GetValue(),
|
||||
m_checkbox_list["xcam_cali"]->GetValue()
|
||||
m_checkbox_list["xcam_cali"]->GetValue(),
|
||||
m_checkbox_list["motor_noise"]->GetValue()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ private:
|
|||
wxWindow* select_xcam_cali { nullptr };
|
||||
wxWindow* select_bed_leveling { nullptr };
|
||||
wxWindow* select_vibration { nullptr };
|
||||
wxWindow* select_motor_noise { nullptr };
|
||||
|
||||
wxWindow* create_check_option(wxString title, wxWindow *parent, wxString tooltip, std::string param);
|
||||
|
||||
|
|
|
@ -526,6 +526,14 @@ void CalibrationPanel::update_all() {
|
|||
if (!dev) return;
|
||||
obj = dev->get_selected_machine();
|
||||
|
||||
// check valid machine
|
||||
if (obj && dev->get_my_machine(obj->dev_id) == nullptr) {
|
||||
dev->set_selected_machine("");
|
||||
if (m_agent) m_agent->set_user_selected_machine("");
|
||||
show_status((int) MONITOR_NO_PRINTER);
|
||||
return;
|
||||
}
|
||||
|
||||
// update current wizard only
|
||||
int curr_selected = m_tabpanel->GetSelection();
|
||||
|
||||
|
@ -543,15 +551,6 @@ void CalibrationPanel::update_all() {
|
|||
}
|
||||
}
|
||||
|
||||
// check valid machine
|
||||
if (obj && dev->get_my_machine(obj->dev_id) == nullptr) {
|
||||
dev->set_selected_machine("");
|
||||
if (m_agent)
|
||||
m_agent->set_user_selected_machine("");
|
||||
show_status((int)MONITOR_NO_PRINTER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (wxGetApp().is_user_login()) {
|
||||
dev->check_pushing();
|
||||
try {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -105,6 +105,9 @@ class PressureAdvanceWizard : public CalibrationWizard {
|
|||
public:
|
||||
PressureAdvanceWizard(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL);
|
||||
~PressureAdvanceWizard() {};
|
||||
|
||||
void on_cali_job_finished(wxString evt_data) override;
|
||||
|
||||
protected:
|
||||
void create_pages();
|
||||
|
||||
|
|
|
@ -125,6 +125,17 @@ void CalibrationCaliPage::set_cali_img()
|
|||
}
|
||||
}
|
||||
|
||||
void CalibrationCaliPage::set_pa_cali_image(int stage)
|
||||
{
|
||||
if (m_cali_mode == CalibMode::Calib_PA_Line && m_cali_method == CALI_METHOD_MANUAL) {
|
||||
if (stage == 0) {
|
||||
m_picture_panel->set_img(create_scaled_bitmap("fd_calibration_manual", nullptr, 400));
|
||||
} else if (stage == 1) {
|
||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual", nullptr, 400));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrationCaliPage::clear_last_job_status()
|
||||
{
|
||||
m_is_between_start_and_running = true;
|
||||
|
@ -132,6 +143,29 @@ void CalibrationCaliPage::clear_last_job_status()
|
|||
|
||||
void CalibrationCaliPage::update(MachineObject* obj)
|
||||
{
|
||||
if (this->IsShown()) {
|
||||
if (obj) {
|
||||
if (obj->print_status != "RUNNING") {
|
||||
BOOST_LOG_TRIVIAL(info) << "on_show_cali_page - machine object status:"
|
||||
<< " dev_id = " << obj->dev_id
|
||||
<< ", print_type = " << obj->printer_type
|
||||
<< ", printer_status = " << obj->print_status
|
||||
<< ", is_connected = " << obj->is_connected()
|
||||
<< ", m_is_between_start_and_running = " << m_is_between_start_and_running
|
||||
<< ", 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
|
||||
<< ", get_pa_calib_result" << obj->get_pa_calib_result
|
||||
<< ", get_flow_calib_result" << obj->get_flow_calib_result;
|
||||
}
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << "on_show_cali_page - machine object is nullptr";
|
||||
}
|
||||
}
|
||||
|
||||
static int get_result_count = 0;
|
||||
// enable calibration when finished
|
||||
bool enable_cali = false;
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
void update_basic_print_data(bool def, float weight = 0.0, int prediction = 0);
|
||||
void reset_printing_values();
|
||||
void clear_last_job_status();
|
||||
void set_pa_cali_image(int stage);
|
||||
|
||||
void on_device_connected(MachineObject* obj) override;
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
#include "libslic3r/Print.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
static int PA_LINE = 0;
|
||||
static int PA_PATTERN = 1;
|
||||
|
||||
CaliPresetCaliStagePanel::CaliPresetCaliStagePanel(
|
||||
wxWindow* parent,
|
||||
wxWindowID id,
|
||||
|
@ -124,6 +127,71 @@ void CaliPresetCaliStagePanel::set_flow_ratio_value(float flow_ratio)
|
|||
m_flow_ratio_value = flow_ratio;
|
||||
}
|
||||
|
||||
CaliComboBox::CaliComboBox(wxWindow* parent,
|
||||
wxString title,
|
||||
wxArrayString values,
|
||||
int default_index, // default delected id
|
||||
std::function<void(wxCommandEvent&)> on_value_change,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style)
|
||||
: wxPanel(parent, id, pos, size, style)
|
||||
, m_title(title)
|
||||
, m_on_value_change_call_back(on_value_change)
|
||||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
m_top_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_top_sizer->AddSpacer(PRESET_GAP);
|
||||
auto combo_title = new Label(this, title);
|
||||
combo_title->SetFont(Label::Head_14);
|
||||
combo_title->Wrap(-1);
|
||||
m_top_sizer->Add(combo_title, 0, wxALL, 0);
|
||||
m_top_sizer->AddSpacer(FromDIP(10));
|
||||
m_combo_box = new ComboBox(this, wxID_ANY, "", wxDefaultPosition, CALIBRATION_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
|
||||
m_top_sizer->Add(m_combo_box, 0, wxALL, 0);
|
||||
m_top_sizer->AddSpacer(PRESET_GAP);
|
||||
|
||||
this->SetSizer(m_top_sizer);
|
||||
m_top_sizer->Fit(this);
|
||||
|
||||
// set values
|
||||
for (int i = 0; i < values.size(); ++i) {
|
||||
m_combo_box->AppendString(values[i]);
|
||||
}
|
||||
m_combo_box->SetSelection(default_index);
|
||||
|
||||
// bind call back function
|
||||
if (m_on_value_change_call_back)
|
||||
m_combo_box->Bind(wxEVT_COMBOBOX, m_on_value_change_call_back);
|
||||
}
|
||||
|
||||
int CaliComboBox::get_selection() const
|
||||
{
|
||||
if (m_combo_box)
|
||||
return m_combo_box->GetSelection();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxString CaliComboBox::get_value() const
|
||||
{
|
||||
if (m_combo_box)
|
||||
return m_combo_box->GetValue();
|
||||
|
||||
return wxString();
|
||||
}
|
||||
|
||||
void CaliComboBox::set_values(const wxArrayString &values)
|
||||
{
|
||||
if (m_combo_box) {
|
||||
for (int i = 0; i < values.size(); ++i) {
|
||||
m_combo_box->AppendString(values[i]);
|
||||
}
|
||||
m_combo_box->SetSelection(0);
|
||||
}
|
||||
}
|
||||
|
||||
CaliPresetWarningPanel::CaliPresetWarningPanel(
|
||||
wxWindow* parent,
|
||||
wxWindowID id,
|
||||
|
@ -704,6 +772,13 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
|
|||
m_filament_list_panel = new wxPanel(parent);
|
||||
m_filament_list_panel->SetBackgroundColour(*wxWHITE);
|
||||
create_filament_list_panel(m_filament_list_panel);
|
||||
|
||||
if (m_cali_mode == CalibMode::Calib_PA_Line || m_cali_mode == CalibMode::Calib_PA_Pattern) {
|
||||
wxArrayString pa_cali_modes;
|
||||
pa_cali_modes.push_back(_L("Line"));
|
||||
pa_cali_modes.push_back(_L("Pattern"));
|
||||
m_pa_cali_method_combox = new CaliComboBox(parent, _L("Method"), pa_cali_modes);
|
||||
}
|
||||
|
||||
m_ext_spool_panel = new wxPanel(parent);
|
||||
create_ext_spool_panel(m_ext_spool_panel);
|
||||
|
@ -719,9 +794,7 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
|
|||
|
||||
m_sending_panel->Hide();
|
||||
|
||||
if (m_show_custom_range) {
|
||||
m_custom_range_panel = new CaliPresetCustomRangePanel(parent);
|
||||
}
|
||||
m_custom_range_panel = new CaliPresetCustomRangePanel(parent);
|
||||
|
||||
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_PRESET);
|
||||
|
||||
|
@ -732,11 +805,10 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
|
|||
m_top_sizer->Add(m_selection_panel, 0);
|
||||
m_top_sizer->Add(m_filament_list_panel, 0);
|
||||
m_top_sizer->Add(m_ext_spool_panel, 0);
|
||||
m_top_sizer->Add(m_pa_cali_method_combox, 0);
|
||||
m_top_sizer->Add(m_custom_range_panel, 0);
|
||||
m_top_sizer->AddSpacer(FromDIP(15));
|
||||
m_top_sizer->Add(m_warning_panel, 0);
|
||||
if (m_show_custom_range) {
|
||||
m_top_sizer->Add(m_custom_range_panel, 0);
|
||||
m_top_sizer->AddSpacer(FromDIP(15));
|
||||
}
|
||||
m_top_sizer->Add(m_tips_panel, 0);
|
||||
m_top_sizer->AddSpacer(PRESET_GAP);
|
||||
m_top_sizer->Add(m_sending_panel, 0, wxALIGN_CENTER);
|
||||
|
@ -1430,16 +1502,50 @@ void CalibrationPresetPage::set_cali_filament_mode(CalibrationFilamentMode mode)
|
|||
void CalibrationPresetPage::set_cali_method(CalibrationMethod method)
|
||||
{
|
||||
CalibrationWizardPage::set_cali_method(method);
|
||||
if (method == CalibrationMethod::CALI_METHOD_MANUAL && m_cali_mode == CalibMode::Calib_Flow_Rate) {
|
||||
wxArrayString steps;
|
||||
steps.Add(_L("Preset"));
|
||||
steps.Add(_L("Calibration1"));
|
||||
steps.Add(_L("Calibration2"));
|
||||
steps.Add(_L("Record Factor"));
|
||||
m_step_panel->set_steps_string(steps);
|
||||
m_step_panel->set_steps(0);
|
||||
if (m_cali_stage_panel)
|
||||
m_cali_stage_panel->Show();
|
||||
if (method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
||||
if (m_cali_mode == CalibMode::Calib_Flow_Rate) {
|
||||
wxArrayString steps;
|
||||
steps.Add(_L("Preset"));
|
||||
steps.Add(_L("Calibration1"));
|
||||
steps.Add(_L("Calibration2"));
|
||||
steps.Add(_L("Record Factor"));
|
||||
m_step_panel->set_steps_string(steps);
|
||||
m_step_panel->set_steps(0);
|
||||
if (m_cali_stage_panel)
|
||||
m_cali_stage_panel->Show();
|
||||
|
||||
if (m_pa_cali_method_combox)
|
||||
m_pa_cali_method_combox->Show(false);
|
||||
|
||||
if (m_custom_range_panel)
|
||||
m_custom_range_panel->Show(false);
|
||||
}
|
||||
else if (m_cali_mode == CalibMode::Calib_PA_Line || m_cali_mode == CalibMode::Calib_PA_Pattern) {
|
||||
if (m_cali_stage_panel)
|
||||
m_cali_stage_panel->Show(false);
|
||||
|
||||
if (m_pa_cali_method_combox)
|
||||
m_pa_cali_method_combox->Show();
|
||||
|
||||
if (m_custom_range_panel) {
|
||||
wxArrayString titles;
|
||||
titles.push_back(_L("From k Value"));
|
||||
titles.push_back(_L("To k Value"));
|
||||
titles.push_back(_L("Step value"));
|
||||
m_custom_range_panel->set_titles(titles);
|
||||
|
||||
wxArrayString values;
|
||||
Preset* printer_preset = get_printer_preset(curr_obj, get_nozzle_value());
|
||||
int extruder_type = printer_preset->config.opt_enum("extruder_type", 0);
|
||||
values.push_back(_L("0"));
|
||||
values.push_back(_L("0.5"));
|
||||
values.push_back(_L("0.005"));
|
||||
m_custom_range_panel->set_values(values);
|
||||
|
||||
m_custom_range_panel->set_unit(_L(""));
|
||||
m_custom_range_panel->Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
wxArrayString steps;
|
||||
|
@ -1450,6 +1556,10 @@ void CalibrationPresetPage::set_cali_method(CalibrationMethod method)
|
|||
m_step_panel->set_steps(0);
|
||||
if (m_cali_stage_panel)
|
||||
m_cali_stage_panel->Show(false);
|
||||
if (m_custom_range_panel)
|
||||
m_custom_range_panel->Show(false);
|
||||
if (m_pa_cali_method_combox)
|
||||
m_pa_cali_method_combox->Show(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1847,12 +1957,26 @@ std::string CalibrationPresetPage::get_print_preset_name()
|
|||
|
||||
wxArrayString CalibrationPresetPage::get_custom_range_values()
|
||||
{
|
||||
if (m_show_custom_range && m_custom_range_panel) {
|
||||
if (m_custom_range_panel) {
|
||||
return m_custom_range_panel->get_values();
|
||||
}
|
||||
return wxArrayString();
|
||||
}
|
||||
|
||||
CalibMode CalibrationPresetPage::get_pa_cali_method()
|
||||
{
|
||||
if (m_pa_cali_method_combox) {
|
||||
int selected_mode = m_pa_cali_method_combox->get_selection();
|
||||
if (selected_mode == PA_LINE) {
|
||||
return CalibMode::Calib_PA_Line;
|
||||
}
|
||||
else if (selected_mode == PA_PATTERN) {
|
||||
return CalibMode::Calib_PA_Pattern;
|
||||
}
|
||||
}
|
||||
return CalibMode::Calib_PA_Line;
|
||||
}
|
||||
|
||||
MaxVolumetricSpeedPresetPage::MaxVolumetricSpeedPresetPage(
|
||||
wxWindow *parent, CalibMode cali_mode, bool custom_range, wxWindowID id, const wxPoint &pos, const wxSize &size, long style)
|
||||
: CalibrationPresetPage(parent, cali_mode, custom_range, id, pos, size, style)
|
||||
|
@ -1861,7 +1985,7 @@ MaxVolumetricSpeedPresetPage::MaxVolumetricSpeedPresetPage(
|
|||
wxArrayString titles;
|
||||
titles.push_back(_L("From Volumetric Speed"));
|
||||
titles.push_back(_L("To Volumetric Speed"));
|
||||
titles.push_back(_L("Step"));
|
||||
titles.push_back(_L("Step value"));
|
||||
m_custom_range_panel->set_titles(titles);
|
||||
|
||||
m_custom_range_panel->set_unit(_L("mm\u00B3/s"));
|
||||
|
|
|
@ -40,6 +40,30 @@ protected:
|
|||
float m_flow_ratio_value;
|
||||
};
|
||||
|
||||
class CaliComboBox : public wxPanel
|
||||
{
|
||||
public:
|
||||
CaliComboBox(wxWindow *parent,
|
||||
wxString title,
|
||||
wxArrayString values,
|
||||
int default_index = 0, // default delected id
|
||||
std::function<void(wxCommandEvent &)> on_value_change = nullptr,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL);
|
||||
|
||||
int get_selection() const;
|
||||
wxString get_value() const;
|
||||
void set_values(const wxArrayString& values);
|
||||
|
||||
private:
|
||||
wxBoxSizer* m_top_sizer;
|
||||
wxString m_title;
|
||||
ComboBox* m_combo_box;
|
||||
std::function<void(wxCommandEvent&)> m_on_value_change_call_back;
|
||||
};
|
||||
|
||||
class CaliPresetWarningPanel : public wxPanel
|
||||
{
|
||||
public:
|
||||
|
@ -181,6 +205,7 @@ public:
|
|||
std::string get_print_preset_name();
|
||||
|
||||
wxArrayString get_custom_range_values();
|
||||
CalibMode get_pa_cali_method();
|
||||
|
||||
CaliPresetPageStatus get_page_status() { return m_page_status; }
|
||||
protected:
|
||||
|
@ -227,6 +252,7 @@ protected:
|
|||
CaliPresetPageStatus get_status() { return m_page_status; }
|
||||
|
||||
CaliPageStepGuide* m_step_panel{ nullptr };
|
||||
CaliComboBox * m_pa_cali_method_combox{nullptr};
|
||||
CaliPresetCaliStagePanel* m_cali_stage_panel { nullptr };
|
||||
wxPanel* m_selection_panel { nullptr };
|
||||
wxPanel* m_filament_from_panel { nullptr };
|
||||
|
|
|
@ -462,10 +462,10 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
|
|||
auto complete_text_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
complete_text_panel->SetBackgroundColour(*wxWHITE);
|
||||
wxBoxSizer* complete_text_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
auto complete_text = new Label(complete_text_panel, _L("Please find the best line on your plate"));
|
||||
complete_text->SetFont(Label::Head_14);
|
||||
complete_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
|
||||
complete_text_sizer->Add(complete_text, 0);
|
||||
m_complete_text = new Label(complete_text_panel, _L("Please find the best line on your plate"));
|
||||
m_complete_text->SetFont(Label::Head_14);
|
||||
m_complete_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
|
||||
complete_text_sizer->Add(m_complete_text, 0);
|
||||
complete_text_panel->SetSizer(complete_text_sizer);
|
||||
m_top_sizer->Add(complete_text_panel, 0, wxEXPAND, 0);
|
||||
|
||||
|
@ -523,6 +523,21 @@ void CaliPASaveManualPanel::set_save_img() {
|
|||
}
|
||||
}
|
||||
|
||||
void CaliPASaveManualPanel::set_pa_cali_method(ManualPaCaliMethod method)
|
||||
{
|
||||
if (method == ManualPaCaliMethod::PA_LINE) {
|
||||
m_complete_text->SetLabel(_L("Please find the best line on your plate"));
|
||||
set_save_img();
|
||||
} else if (method == ManualPaCaliMethod::PA_PATTERN) {
|
||||
m_complete_text->SetLabel(_L("Please find the cornor with perfect degree of extrusion"));
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result_CN", nullptr, 350));
|
||||
} else {
|
||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result", nullptr, 350));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CaliPASaveManualPanel::set_default_name(const wxString& name) {
|
||||
m_save_name_input->GetTextCtrl()->SetValue(name);
|
||||
}
|
||||
|
@ -610,10 +625,10 @@ void CaliPASaveP1PPanel::create_panel(wxWindow* parent)
|
|||
auto complete_text_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
complete_text_panel->SetBackgroundColour(*wxWHITE);
|
||||
wxBoxSizer* complete_text_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
auto complete_text = new Label(complete_text_panel, _L("Please find the best line on your plate"));
|
||||
complete_text->SetFont(Label::Head_14);
|
||||
complete_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
|
||||
complete_text_sizer->Add(complete_text, 0, wxEXPAND);
|
||||
m_complete_text = new Label(complete_text_panel, _L("Please find the best line on your plate"));
|
||||
m_complete_text->SetFont(Label::Head_14);
|
||||
m_complete_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
|
||||
complete_text_sizer->Add(m_complete_text, 0, wxEXPAND);
|
||||
complete_text_panel->SetSizer(complete_text_sizer);
|
||||
m_top_sizer->Add(complete_text_panel, 0, wxEXPAND, 0);
|
||||
|
||||
|
@ -662,6 +677,22 @@ void CaliPASaveP1PPanel::set_save_img() {
|
|||
}
|
||||
}
|
||||
|
||||
void CaliPASaveP1PPanel::set_pa_cali_method(ManualPaCaliMethod method)
|
||||
{
|
||||
if (method == ManualPaCaliMethod::PA_LINE) {
|
||||
m_complete_text->SetLabel(_L("Please find the best line on your plate"));
|
||||
set_save_img();
|
||||
}
|
||||
else if (method == ManualPaCaliMethod::PA_PATTERN) {
|
||||
m_complete_text->SetLabel(_L("Please find the cornor with perfect degree of extrusion"));
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result_CN", nullptr, 350));
|
||||
} else {
|
||||
m_picture_panel->set_img(create_scaled_bitmap("fd_pattern_manual_result", nullptr, 350));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CaliPASaveP1PPanel::get_result(float* out_k, float* out_n){
|
||||
// Check if the value is valid
|
||||
if (!CalibUtils::validate_input_k_value(m_k_val->GetTextCtrl()->GetValue(), out_k)) {
|
||||
|
@ -808,6 +839,7 @@ void CalibrationPASavePage::sync_cali_result(MachineObject* obj)
|
|||
void CalibrationPASavePage::show_panels(CalibrationMethod method, const PrinterSeries printer_ser) {
|
||||
if (printer_ser == PrinterSeries::SERIES_X1) {
|
||||
if (method == CalibrationMethod::CALI_METHOD_MANUAL) {
|
||||
m_manual_panel->set_pa_cali_method(curr_obj->manual_pa_cali_method);
|
||||
m_manual_panel->Show();
|
||||
m_auto_panel->Show(false);
|
||||
}
|
||||
|
@ -820,10 +852,12 @@ void CalibrationPASavePage::show_panels(CalibrationMethod method, const PrinterS
|
|||
else if (printer_ser == PrinterSeries::SERIES_P1P) {
|
||||
m_auto_panel->Show(false);
|
||||
m_manual_panel->Show(false);
|
||||
m_p1p_panel->set_pa_cali_method(curr_obj->manual_pa_cali_method);
|
||||
m_p1p_panel->Show();
|
||||
} else {
|
||||
m_auto_panel->Show(false);
|
||||
m_manual_panel->Show(false);
|
||||
m_p1p_panel->set_pa_cali_method(curr_obj->manual_pa_cali_method);
|
||||
m_p1p_panel->Show();
|
||||
assert(false);
|
||||
}
|
||||
|
@ -1158,10 +1192,10 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
|
|||
coarse_block_items.Add(std::to_string(-20 + (i * 5)));
|
||||
}
|
||||
m_optimal_block_coarse->Set(coarse_block_items);
|
||||
auto coarse_calc_result_text = new Label(parent, "");
|
||||
m_coarse_calc_result_text = new Label(parent, "");
|
||||
coarse_value_sizer->Add(coarse_value_text, 0, 0);
|
||||
coarse_value_sizer->Add(m_optimal_block_coarse, 0, 0);
|
||||
coarse_value_sizer->Add(coarse_calc_result_text, 0);
|
||||
coarse_value_sizer->Add(m_coarse_calc_result_text, 0);
|
||||
m_top_sizer->Add(coarse_value_sizer, 0, 0, 0);
|
||||
m_top_sizer->AddSpacer(FromDIP(20));
|
||||
|
||||
|
@ -1169,16 +1203,16 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
|
|||
checkBox_panel->SetBackgroundColour(*wxWHITE);
|
||||
auto cb_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
checkBox_panel->SetSizer(cb_sizer);
|
||||
auto checkBox_skip_calibration = new CheckBox(checkBox_panel);
|
||||
cb_sizer->Add(checkBox_skip_calibration);
|
||||
m_checkBox_skip_calibration = new CheckBox(checkBox_panel);
|
||||
cb_sizer->Add(m_checkBox_skip_calibration);
|
||||
|
||||
auto cb_text = new Label(checkBox_panel, _L("Skip Calibration2"));
|
||||
cb_sizer->Add(cb_text);
|
||||
cb_text->Bind(wxEVT_LEFT_DOWN, [this, checkBox_skip_calibration](auto&) {
|
||||
checkBox_skip_calibration->SetValue(!checkBox_skip_calibration->GetValue());
|
||||
cb_text->Bind(wxEVT_LEFT_DOWN, [this](auto&) {
|
||||
m_checkBox_skip_calibration->SetValue(!m_checkBox_skip_calibration->GetValue());
|
||||
wxCommandEvent event(wxEVT_TOGGLEBUTTON);
|
||||
event.SetEventObject(checkBox_skip_calibration);
|
||||
checkBox_skip_calibration->GetEventHandler()->ProcessEvent(event);
|
||||
event.SetEventObject(m_checkBox_skip_calibration);
|
||||
m_checkBox_skip_calibration->GetEventHandler()->ProcessEvent(event);
|
||||
});
|
||||
|
||||
m_top_sizer->Add(checkBox_panel, 0, 0, 0);
|
||||
|
@ -1201,8 +1235,8 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
|
|||
|
||||
m_top_sizer->AddSpacer(FromDIP(20));
|
||||
|
||||
checkBox_skip_calibration->Bind(wxEVT_TOGGLEBUTTON, [this, save_panel, checkBox_skip_calibration](wxCommandEvent& e) {
|
||||
if (checkBox_skip_calibration->GetValue()) {
|
||||
m_checkBox_skip_calibration->Bind(wxEVT_TOGGLEBUTTON, [this, save_panel](wxCommandEvent &e) {
|
||||
if (m_checkBox_skip_calibration->GetValue()) {
|
||||
m_skip_fine_calibration = true;
|
||||
save_panel->Show();
|
||||
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_FLOW_COARSE_SAVE);
|
||||
|
@ -1219,9 +1253,9 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
|
|||
e.Skip();
|
||||
});
|
||||
|
||||
m_optimal_block_coarse->Bind(wxEVT_COMBOBOX, [this, coarse_calc_result_text](auto& e) {
|
||||
m_optimal_block_coarse->Bind(wxEVT_COMBOBOX, [this](auto& e) {
|
||||
m_coarse_flow_ratio = m_curr_flow_ratio * (100.0f + stof(m_optimal_block_coarse->GetValue().ToStdString())) / 100.0f;
|
||||
coarse_calc_result_text->SetLabel(wxString::Format(_L("flow ratio : %s "), std::to_string(m_coarse_flow_ratio)));
|
||||
m_coarse_calc_result_text->SetLabel(wxString::Format(_L("flow ratio : %s "), std::to_string(m_coarse_flow_ratio)));
|
||||
});
|
||||
|
||||
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_COARSE_SAVE);
|
||||
|
@ -1237,8 +1271,15 @@ void CalibrationFlowCoarseSavePage::set_save_img() {
|
|||
}
|
||||
}
|
||||
|
||||
void CalibrationFlowCoarseSavePage::set_default_name(const wxString& name) {
|
||||
void CalibrationFlowCoarseSavePage::set_default_options(const wxString& name) {
|
||||
m_optimal_block_coarse->SetSelection(-1);
|
||||
m_coarse_calc_result_text->SetLabelText("");
|
||||
m_checkBox_skip_calibration->SetValue(false);
|
||||
m_save_name_input->GetTextCtrl()->SetValue(name);
|
||||
|
||||
wxCommandEvent event(wxEVT_TOGGLEBUTTON);
|
||||
event.SetEventObject(m_checkBox_skip_calibration);
|
||||
m_checkBox_skip_calibration->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
bool CalibrationFlowCoarseSavePage::is_skip_fine_calibration() {
|
||||
|
@ -1272,7 +1313,7 @@ bool CalibrationFlowCoarseSavePage::Show(bool show) {
|
|||
assert(curr_obj->selected_cali_preset.size() <= 1);
|
||||
if (!curr_obj->selected_cali_preset.empty()) {
|
||||
wxString default_name = get_default_name(curr_obj->selected_cali_preset[0].name, CalibMode::Calib_Flow_Rate);
|
||||
set_default_name(default_name);
|
||||
set_default_options(default_name);
|
||||
set_curr_flow_ratio(curr_obj->cache_flow_ratio);
|
||||
}
|
||||
}
|
||||
|
@ -1337,10 +1378,10 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
|
|||
fine_block_items.Add(std::to_string(-9 + (i)));
|
||||
}
|
||||
m_optimal_block_fine->Set(fine_block_items);
|
||||
auto fine_calc_result_text = new Label(parent, "");
|
||||
m_fine_calc_result_text = new Label(parent, "");
|
||||
fine_value_sizer->Add(fine_value_text, 0, 0);
|
||||
fine_value_sizer->Add(m_optimal_block_fine, 0, 0);
|
||||
fine_value_sizer->Add(fine_calc_result_text, 0);
|
||||
fine_value_sizer->Add(m_fine_calc_result_text, 0);
|
||||
m_top_sizer->Add(fine_value_sizer, 0, 0, 0);
|
||||
m_top_sizer->AddSpacer(FromDIP(20));
|
||||
|
||||
|
@ -1354,9 +1395,9 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
|
|||
|
||||
m_top_sizer->AddSpacer(FromDIP(20));
|
||||
|
||||
m_optimal_block_fine->Bind(wxEVT_COMBOBOX, [this, fine_calc_result_text](auto& e) {
|
||||
m_optimal_block_fine->Bind(wxEVT_COMBOBOX, [this](auto& e) {
|
||||
m_fine_flow_ratio = m_curr_flow_ratio * (100.0f + stof(m_optimal_block_fine->GetValue().ToStdString())) / 100.0f;
|
||||
fine_calc_result_text->SetLabel(wxString::Format(_L("flow ratio : %s "), std::to_string(m_fine_flow_ratio)));
|
||||
m_fine_calc_result_text->SetLabel(wxString::Format(_L("flow ratio : %s "), std::to_string(m_fine_flow_ratio)));
|
||||
});
|
||||
|
||||
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_FINE_SAVE);
|
||||
|
@ -1371,7 +1412,9 @@ void CalibrationFlowFineSavePage::set_save_img() {
|
|||
}
|
||||
}
|
||||
|
||||
void CalibrationFlowFineSavePage::set_default_name(const wxString& name) {
|
||||
void CalibrationFlowFineSavePage::set_default_options(const wxString &name) {
|
||||
m_optimal_block_fine->SetSelection(-1);
|
||||
m_fine_calc_result_text->SetLabelText("");
|
||||
m_save_name_input->GetTextCtrl()->SetValue(name);
|
||||
}
|
||||
|
||||
|
@ -1402,7 +1445,7 @@ bool CalibrationFlowFineSavePage::Show(bool show) {
|
|||
assert(curr_obj->selected_cali_preset.size() <= 1);
|
||||
if (!curr_obj->selected_cali_preset.empty()) {
|
||||
wxString default_name = get_default_name(curr_obj->selected_cali_preset[0].name, CalibMode::Calib_Flow_Rate);
|
||||
set_default_name(default_name);
|
||||
set_default_options(default_name);
|
||||
set_curr_flow_ratio(curr_obj->cache_flow_ratio);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,6 +119,7 @@ public:
|
|||
long style = wxTAB_TRAVERSAL);
|
||||
void create_panel(wxWindow* parent);
|
||||
void set_save_img();
|
||||
void set_pa_cali_method(ManualPaCaliMethod method);
|
||||
|
||||
void set_machine_obj(MachineObject* obj) { m_obj = obj; }
|
||||
|
||||
|
@ -130,6 +131,7 @@ public:
|
|||
|
||||
protected:
|
||||
wxBoxSizer* m_top_sizer;
|
||||
Label * m_complete_text;
|
||||
CaliPagePicture* m_picture_panel;
|
||||
::TextInput* m_save_name_input;
|
||||
::TextInput* m_k_val;
|
||||
|
@ -149,11 +151,13 @@ public:
|
|||
long style = wxTAB_TRAVERSAL);
|
||||
void create_panel(wxWindow* parent);
|
||||
void set_save_img();
|
||||
void set_pa_cali_method(ManualPaCaliMethod method);
|
||||
|
||||
bool get_result(float* out_k, float* out_n);
|
||||
|
||||
protected:
|
||||
wxBoxSizer* m_top_sizer;
|
||||
Label * m_complete_text;
|
||||
CaliPagePicture* m_picture_panel;
|
||||
::TextInput* m_k_val;
|
||||
::TextInput* m_n_val;
|
||||
|
@ -223,7 +227,7 @@ public:
|
|||
void create_page(wxWindow* parent);
|
||||
void set_save_img();
|
||||
|
||||
void set_default_name(const wxString& name);
|
||||
void set_default_options(const wxString &name);
|
||||
|
||||
bool is_skip_fine_calibration();
|
||||
|
||||
|
@ -239,6 +243,9 @@ protected:
|
|||
ComboBox* m_optimal_block_coarse;
|
||||
TextInput* m_save_name_input;
|
||||
|
||||
Label* m_coarse_calc_result_text;
|
||||
CheckBox* m_checkBox_skip_calibration;
|
||||
|
||||
bool m_skip_fine_calibration = false;
|
||||
float m_curr_flow_ratio;
|
||||
float m_coarse_flow_ratio;
|
||||
|
@ -252,7 +259,7 @@ public:
|
|||
void create_page(wxWindow* parent);
|
||||
void set_save_img();
|
||||
|
||||
void set_default_name(const wxString& name);
|
||||
void set_default_options(const wxString &name);
|
||||
|
||||
void set_curr_flow_ratio(float value);
|
||||
|
||||
|
@ -266,6 +273,8 @@ protected:
|
|||
ComboBox* m_optimal_block_fine;
|
||||
TextInput* m_save_name_input;
|
||||
|
||||
Label* m_fine_calc_result_text;
|
||||
|
||||
float m_curr_flow_ratio;
|
||||
float m_fine_flow_ratio;
|
||||
};
|
||||
|
|
|
@ -155,17 +155,11 @@ void CalibrationPAStartPage::on_device_connected(MachineObject* obj)
|
|||
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
||||
}
|
||||
}
|
||||
else if (obj->get_printer_series() == PrinterSeries::SERIES_P1P) {
|
||||
else if (obj->get_printer_series() == PrinterSeries::SERIES_P1P || obj->get_printer_arch() == PrinterArch::ARCH_I3) {
|
||||
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
||||
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)) {
|
||||
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
||||
}
|
||||
else {
|
||||
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
||||
}
|
||||
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
||||
}
|
||||
|
||||
//is support auto cali
|
||||
|
|
|
@ -109,39 +109,6 @@ void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPri
|
|||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::check_bed_temperature_difference(int bed_type, DynamicPrintConfig* config)
|
||||
{
|
||||
if (is_msg_dlg_already_exist)
|
||||
return;
|
||||
|
||||
if (config->has("bed_temperature_difference") && config->has("temperature_vitrification")) {
|
||||
int bed_temp_difference = config->opt_int("bed_temperature_difference", 0);
|
||||
int vitrification = config->opt_int("temperature_vitrification", 0);
|
||||
const ConfigOptionInts* bed_temp_1st_layer_opt = config->option<ConfigOptionInts>(get_bed_temp_1st_layer_key((BedType)bed_type));
|
||||
const ConfigOptionInts* bed_temp_opt = config->option<ConfigOptionInts>(get_bed_temp_key((BedType)bed_type));
|
||||
|
||||
if (bed_temp_1st_layer_opt != nullptr && bed_temp_opt != nullptr) {
|
||||
int first_layer_bed_temp = bed_temp_1st_layer_opt->get_at(0);
|
||||
int bed_temp = bed_temp_opt->get_at(0);
|
||||
if (first_layer_bed_temp - bed_temp > bed_temp_difference) {
|
||||
const wxString msg_text = wxString::Format(_L("Bed temperature of other layer is lower than bed temperature of initial layer for more than %d degree centigrade.\nThis may cause model broken free from build plate during printing"), bed_temp_difference);
|
||||
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
|
||||
is_msg_dlg_already_exist = true;
|
||||
dialog.ShowModal();
|
||||
is_msg_dlg_already_exist = false;
|
||||
}
|
||||
|
||||
if (first_layer_bed_temp > vitrification || bed_temp > vitrification) {
|
||||
const wxString msg_text = wxString::Format(
|
||||
_L("Bed temperature is higher than vitrification temperature of this filament.\nThis may cause nozzle blocked and printing failure\nPlease keep the printer open during the printing process to ensure air circulation or reduce the temperature of the hot bed"));
|
||||
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
|
||||
is_msg_dlg_already_exist = true;
|
||||
dialog.ShowModal();
|
||||
is_msg_dlg_already_exist = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::check_filament_max_volumetric_speed(DynamicPrintConfig *config)
|
||||
{
|
||||
|
@ -163,6 +130,32 @@ void ConfigManipulation::check_filament_max_volumetric_speed(DynamicPrintConfig
|
|||
|
||||
}
|
||||
|
||||
void ConfigManipulation::check_chamber_temperature(DynamicPrintConfig* config)
|
||||
{
|
||||
const static std::map<std::string, int>recommend_temp_map = {
|
||||
{"PLA",45},
|
||||
{"PLA-CF",45},
|
||||
{"PVA",45},
|
||||
{"TPU",50},
|
||||
{"PETG",55},
|
||||
{"PETG-CF",55}
|
||||
};
|
||||
bool support_chamber_temp_control=GUI::wxGetApp().preset_bundle->printers.get_selected_preset().config.opt_bool("support_chamber_temp_control");
|
||||
if (support_chamber_temp_control&&config->has("chamber_temperatures")) {
|
||||
std::string filament_type = config->option<ConfigOptionStrings>("filament_type")->get_at(0);
|
||||
auto iter = recommend_temp_map.find(filament_type);
|
||||
if (iter!=recommend_temp_map.end()) {
|
||||
if (iter->second < config->option<ConfigOptionInts>("chamber_temperatures")->get_at(0)) {
|
||||
wxString msg_text = wxString::Format(_L("Current chamber temperature is higher than the material's safe temperature,it may result in material softening and clogging.The maximum safe temperature for the material is %d"), iter->second);
|
||||
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
|
||||
is_msg_dlg_already_exist = true;
|
||||
dialog.ShowModal();
|
||||
is_msg_dlg_already_exist = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config)
|
||||
{
|
||||
// #ys_FIXME_to_delete
|
||||
|
@ -285,6 +278,12 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
|
|||
config->opt_enum<TimelapseType>("timelapse_type") == TimelapseType::tlTraditional))
|
||||
{
|
||||
wxString msg_text = _(L("Spiral mode only works when wall loops is 1, support is disabled, top shell layers is 0, sparse infill density is 0 and timelapse type is traditional."));
|
||||
|
||||
auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
|
||||
if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) {
|
||||
msg_text += _(L(" But machines with I3 structure will not generate timelapse videos."));
|
||||
}
|
||||
|
||||
if (is_global_config)
|
||||
msg_text += "\n\n" + _(L("Change these settings automatically? \n"
|
||||
"Yes - Change these settings and enable spiral mode automatically\n"
|
||||
|
|
|
@ -76,8 +76,8 @@ public:
|
|||
//BBS: FFF filament nozzle temperature range
|
||||
void check_nozzle_temperature_range(DynamicPrintConfig* config);
|
||||
void check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config);
|
||||
void check_bed_temperature_difference(int bed_type, DynamicPrintConfig* config);
|
||||
void check_filament_max_volumetric_speed(DynamicPrintConfig *config);
|
||||
void check_chamber_temperature(DynamicPrintConfig* config);
|
||||
void set_is_BBL_Printer(bool is_bbl_printer) { is_BBL_Printer = is_bbl_printer; };
|
||||
// SLA print
|
||||
void update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config = false);
|
||||
|
|
|
@ -8,7 +8,6 @@ namespace Slic3r { namespace GUI {
|
|||
ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style)
|
||||
: DPIDialog(parent, id, _L("ConnectPrinter(LAN)"), pos, size, style)
|
||||
{
|
||||
init_bitmap();
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
this->SetSizeHints(wxDefaultSize, wxDefaultSize);
|
||||
|
||||
|
@ -86,7 +85,7 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons
|
|||
wxBoxSizer *sizer_diagram;
|
||||
sizer_diagram = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_bitmap_diagram = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(FromDIP(340), FromDIP(190)), 0);
|
||||
m_bitmap_diagram = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(FromDIP(340), -1), 0);
|
||||
m_bitmap_diagram->SetBitmap(m_diagram_img);
|
||||
sizer_diagram->Add(m_bitmap_diagram);
|
||||
|
||||
|
@ -117,19 +116,48 @@ void ConnectPrinterDialog::init_bitmap()
|
|||
{
|
||||
AppConfig *config = get_app_config();
|
||||
std::string language = config->get("language");
|
||||
if (language == "zh_CN") {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_cn", nullptr, 190);
|
||||
|
||||
if (m_obj) {
|
||||
if (m_obj->printer_type == "C11" || m_obj->printer_type == "C12") {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_accesscode_help2", nullptr, 190);
|
||||
}
|
||||
else if (m_obj->printer_type == "BL-P001" || m_obj->printer_type == "BL-P002" || m_obj->printer_type == "C13") {
|
||||
if (language == "zh_CN") {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_cn", nullptr, 190);
|
||||
}
|
||||
else {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_en", nullptr, 190);
|
||||
}
|
||||
}
|
||||
else if (m_obj->printer_type == "N1") {
|
||||
if (language == "zh_CN") {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_n1_cn", nullptr, 250);
|
||||
}
|
||||
else {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_n1_en", nullptr, 250);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_en", nullptr, 190);
|
||||
else {
|
||||
if (language == "zh_CN") {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_cn", nullptr, 190);
|
||||
}
|
||||
else {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_en", nullptr, 190);
|
||||
}
|
||||
}
|
||||
m_diagram_img = m_diagram_bmp.ConvertToImage();
|
||||
m_diagram_img.Rescale(FromDIP(340), FromDIP(190));
|
||||
auto bmp_size = m_diagram_bmp.GetSize();
|
||||
float scale = (float)FromDIP(340) / (float)bmp_size.x;
|
||||
m_diagram_img.Rescale(FromDIP(340), bmp_size.y * scale);
|
||||
m_bitmap_diagram->SetBitmap(m_diagram_img);
|
||||
Fit();
|
||||
}
|
||||
|
||||
void ConnectPrinterDialog::set_machine_object(MachineObject* obj)
|
||||
{
|
||||
m_obj = obj;
|
||||
init_bitmap();
|
||||
}
|
||||
|
||||
void ConnectPrinterDialog::on_input_enter(wxCommandEvent& evt)
|
||||
|
|
|
@ -34,7 +34,7 @@ protected:
|
|||
wxBitmap m_diagram_bmp;
|
||||
wxImage m_diagram_img;
|
||||
|
||||
MachineObject* m_obj;
|
||||
MachineObject* m_obj{ nullptr };
|
||||
wxString m_input_access_code;
|
||||
public:
|
||||
ConnectPrinterDialog(wxWindow * parent,
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace pt = boost::property_tree;
|
||||
|
||||
const int PRINTING_STAGE_COUNT = 20;
|
||||
const int PRINTING_STAGE_COUNT = 32;
|
||||
std::string PRINTING_STAGE_STR[PRINTING_STAGE_COUNT] = {
|
||||
"printing",
|
||||
"bed_leveling",
|
||||
|
@ -42,7 +42,19 @@ std::string PRINTING_STAGE_STR[PRINTING_STAGE_COUNT] = {
|
|||
"user_pause",
|
||||
"toolhead_shell_off_pause",
|
||||
"scanner_laser_para_cali",
|
||||
"extruder_absolute_flow_cali"
|
||||
"extruder_absolute_flow_cali",
|
||||
"hotend_temperature_error_pause", // 20
|
||||
"heated_bed_temperature_error_pause",
|
||||
"filament_unloading",
|
||||
"skip_step_pause",
|
||||
"filament_loading",
|
||||
"motor_noise_calibration",
|
||||
"ams_lost_pause",
|
||||
"heat_break_fan_pause",
|
||||
"chamber_temperature_control_error_pause",
|
||||
"chamber_cooling",
|
||||
"user_insert_gcode_pause",
|
||||
"motor_noise_showoff"
|
||||
};
|
||||
|
||||
|
||||
|
@ -97,6 +109,26 @@ wxString get_stage_string(int stage)
|
|||
return _L("Paused due to nozzle temperature malfunction");
|
||||
case 21:
|
||||
return _L("Paused due to heat bed temperature malfunction");
|
||||
case 22:
|
||||
return _L("Filament unloading");
|
||||
case 23:
|
||||
return _L("Skip step pause");
|
||||
case 24:
|
||||
return _L("Filament loading");
|
||||
case 25:
|
||||
return _L("Motor noise calibration");
|
||||
case 26:
|
||||
return _L("Paused due to AMS lost");
|
||||
case 27:
|
||||
return _L("Paused due to low speed of the heat break fan");
|
||||
case 28:
|
||||
return _L("Paused due to chamber temperature control error");
|
||||
case 29:
|
||||
return _L("Cooling chamber");
|
||||
case 30:
|
||||
return _L("Paused by the Gcode inserted by user");
|
||||
case 31:
|
||||
return _L("Motor noise showoff");
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
@ -139,6 +171,18 @@ void split_string(std::string s, std::vector<std::string>& v) {
|
|||
v.push_back(t);
|
||||
}
|
||||
|
||||
PrinterArch get_printer_arch_by_str(std::string arch_str)
|
||||
{
|
||||
if (arch_str == "i3") {
|
||||
return PrinterArch::ARCH_I3;
|
||||
}
|
||||
else if (arch_str == "core_xy") {
|
||||
return PrinterArch::ARCH_CORE_XY;
|
||||
}
|
||||
|
||||
return PrinterArch::ARCH_CORE_XY;
|
||||
}
|
||||
|
||||
void AmsTray::update_color_from_str(std::string color)
|
||||
{
|
||||
if (color.empty()) return;
|
||||
|
@ -241,10 +285,7 @@ bool HMSItem::parse_hms_info(unsigned attr, unsigned code)
|
|||
{
|
||||
bool result = true;
|
||||
unsigned int model_id_int = (attr >> 24) & 0xFF;
|
||||
if (model_id_int < (unsigned) MODULE_MAX)
|
||||
this->module_id = (ModuleID)model_id_int;
|
||||
else
|
||||
this->module_id = MODULE_UKNOWN;
|
||||
this->module_id = (ModuleID)model_id_int;
|
||||
this->module_num = (attr >> 16) & 0xFF;
|
||||
this->part_id = (attr >> 8) & 0xFF;
|
||||
this->reserved = (attr >> 0) & 0xFF;
|
||||
|
@ -420,7 +461,7 @@ bool MachineObject::is_high_printer_type()
|
|||
|
||||
PrinterSeries MachineObject::get_printer_series() const
|
||||
{
|
||||
if (printer_type == "BL-P001" || printer_type == "BL-P002")
|
||||
if (printer_type == "BL-P001" || printer_type == "BL-P002" || printer_type == "C13")
|
||||
return PrinterSeries::SERIES_X1;
|
||||
else if (printer_type == "C11" || printer_type == "C12")
|
||||
return PrinterSeries::SERIES_P1P;
|
||||
|
@ -428,6 +469,11 @@ PrinterSeries MachineObject::get_printer_series() const
|
|||
return PrinterSeries::SERIES_P1P;
|
||||
}
|
||||
|
||||
PrinterArch MachineObject::get_printer_arch() const
|
||||
{
|
||||
return DeviceManager::get_printer_arch(printer_type);
|
||||
}
|
||||
|
||||
MachineObject::MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip)
|
||||
:dev_name(name),
|
||||
dev_id(id),
|
||||
|
@ -448,6 +494,7 @@ MachineObject::MachineObject(NetworkAgent* agent, std::string name, std::string
|
|||
bed_temp = 0.0f;
|
||||
bed_temp_target = 0.0f;
|
||||
chamber_temp = 0.0f;
|
||||
chamber_temp_target = 0.0f;
|
||||
frame_temp = 0.0f;
|
||||
|
||||
/* ams fileds */
|
||||
|
@ -693,7 +740,7 @@ bool MachineObject::is_U0_firmware()
|
|||
|
||||
bool MachineObject::is_support_ams_mapping()
|
||||
{
|
||||
if (get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
if (get_printer_series() == PrinterSeries::SERIES_X1 && printer_type != "C13") {
|
||||
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
||||
if (config) {
|
||||
if (config->get("check_ams_version") == "0")
|
||||
|
@ -725,6 +772,27 @@ bool MachineObject::is_support_ams_mapping()
|
|||
}
|
||||
}
|
||||
|
||||
bool MachineObject::is_support_command_ams_switch()
|
||||
{
|
||||
auto ota_ver_it = module_vers.find("ota");
|
||||
if (ota_ver_it != module_vers.end()) {
|
||||
if (printer_type == "BL-P001" || printer_type == "BL-P002") {
|
||||
|
||||
if (ota_ver_it->second.sw_ver.compare("01.05.06.01") < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}else if (printer_type == "C11" || printer_type == "C12") {
|
||||
|
||||
if (ota_ver_it->second.sw_ver.compare("01.02.99.10") < 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MachineObject::is_support_ams_mapping_version(std::string module, std::string version)
|
||||
{
|
||||
bool result = true;
|
||||
|
@ -1311,7 +1379,15 @@ void MachineObject::parse_status(int flag)
|
|||
ams_auto_switch_filament_flag = ((flag >> 10) & 0x1) != 0;
|
||||
}
|
||||
|
||||
if (xcam_prompt_sound_hold_count > 0)
|
||||
xcam_prompt_sound_hold_count--;
|
||||
else {
|
||||
xcam_allow_prompt_sound = ((flag >> 17) & 0x1) != 0;
|
||||
}
|
||||
|
||||
sdcard_state = MachineObject::SdcardState((flag >> 8) & 0x11);
|
||||
|
||||
network_wired = ((flag >> 18) & 0x1) != 0;
|
||||
}
|
||||
|
||||
PrintingSpeedLevel MachineObject::_parse_printing_speed_lvl(int lvl)
|
||||
|
@ -1381,48 +1457,69 @@ void MachineObject::parse_version_func()
|
|||
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;
|
||||
if (printer_type != "C13") {
|
||||
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 {
|
||||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.05.06.05") >= 0;
|
||||
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;
|
||||
}
|
||||
|
||||
is_support_remote_tunnel = true;
|
||||
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));
|
||||
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_remote_tunnel = true;
|
||||
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));
|
||||
}
|
||||
local_camera_proto = local_rtsp_url.empty() ? -1 : local_rtsp_url == "disable" ? 0
|
||||
: boost::algorithm::starts_with(local_rtsp_url, "rtsps") ? 2 : 3;
|
||||
file_proto = 2;
|
||||
}
|
||||
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;
|
||||
is_support_mqtt_alive = true;
|
||||
local_use_ssl_for_mqtt = true;
|
||||
is_support_remote_tunnel = true;
|
||||
is_support_tunnel_mqtt = true;
|
||||
local_camera_proto = local_rtsp_url.empty() ? -1 : local_rtsp_url == "disable" ? 0
|
||||
: boost::algorithm::starts_with(local_rtsp_url, "rtsps") ? 2 : 3;
|
||||
file_proto = 2;
|
||||
}
|
||||
local_camera_proto = local_rtsp_url.empty() ? -1 : local_rtsp_url == "disable" ? 0
|
||||
: boost::algorithm::starts_with(local_rtsp_url, "rtsps") ? 2 : 3;
|
||||
file_proto = 2;
|
||||
}
|
||||
} else if (printer_type == "C11") {
|
||||
is_cloud_print_only = true;
|
||||
|
@ -1469,6 +1566,13 @@ void MachineObject::parse_version_func()
|
|||
is_support_mqtt_alive = ota_version->second.sw_ver.compare("01.03.50.01") >= 0;
|
||||
}
|
||||
}
|
||||
} else if (printer_type == "N1") {
|
||||
is_support_remote_tunnel = true;
|
||||
local_camera_proto = 1;
|
||||
is_support_tunnel_mqtt = true;
|
||||
is_support_ams_humidity = false;
|
||||
is_support_1080dpi = true;
|
||||
ams_support_remain = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1672,24 +1776,46 @@ int MachineObject::command_set_nozzle(int temp)
|
|||
return this->publish_gcode(gcode_str);
|
||||
}
|
||||
|
||||
int MachineObject::command_set_chamber(int temp)
|
||||
{
|
||||
json j;
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["command"] = "set_ctt";
|
||||
j["print"]["ctt_val"] = temp;
|
||||
|
||||
return this->publish_json(j.dump(), 1);
|
||||
}
|
||||
|
||||
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;
|
||||
int result = 0;
|
||||
|
||||
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));
|
||||
|
||||
//command
|
||||
if (is_support_command_ams_switch()) {
|
||||
command_ams_change_filament(tray_index, old_temp, new_temp);
|
||||
}
|
||||
//gcode
|
||||
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)
|
||||
|
@ -1902,6 +2028,15 @@ int MachineObject::command_set_printing_option(bool auto_recovery)
|
|||
return this->publish_json(j.dump());
|
||||
}
|
||||
|
||||
int MachineObject::command_set_prompt_sound(bool prompt_sound){
|
||||
json j;
|
||||
j["print"]["command"] = "print_option";
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["sound_enable"] = prompt_sound;
|
||||
|
||||
return this->publish_json(j.dump());
|
||||
}
|
||||
|
||||
int MachineObject::command_ams_switch_filament(bool switch_filament)
|
||||
{
|
||||
json j;
|
||||
|
@ -1916,8 +2051,17 @@ int MachineObject::command_ams_switch_filament(bool switch_filament)
|
|||
return this->publish_json(j.dump());
|
||||
}
|
||||
|
||||
int MachineObject::command_axis_control(std::string axis, double unit, double value, int speed)
|
||||
|
||||
int MachineObject::command_axis_control(std::string axis, double unit, double input_val, int speed)
|
||||
{
|
||||
double value = input_val;
|
||||
if (!is_core_xy()) {
|
||||
if ( axis.compare("Y") == 0
|
||||
|| axis.compare("Z") == 0) {
|
||||
value = -1.0 * input_val;
|
||||
}
|
||||
}
|
||||
|
||||
char cmd[256];
|
||||
if (axis.compare("X") == 0
|
||||
|| axis.compare("Y") == 0
|
||||
|
@ -1956,7 +2100,7 @@ bool MachineObject::is_support_command_calibration()
|
|||
return true;
|
||||
}
|
||||
|
||||
int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali)
|
||||
int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali, bool motor_noise)
|
||||
{
|
||||
if (!is_support_command_calibration()) {
|
||||
// fixed gcode file
|
||||
|
@ -1969,7 +2113,8 @@ int MachineObject::command_start_calibration(bool vibration, bool bed_leveling,
|
|||
json j;
|
||||
j["print"]["command"] = "calibration";
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["option"] = (vibration ? 1 << 2 : 0)
|
||||
j["print"]["option"]= (motor_noise ? 1 << 3 : 0)
|
||||
+ (vibration ? 1 << 2 : 0)
|
||||
+ (bed_leveling ? 1 << 1 : 0)
|
||||
+ (xcam_cali ? 1 << 0 : 0);
|
||||
return this->publish_json(j.dump());
|
||||
|
@ -2264,6 +2409,13 @@ int MachineObject::command_xcam_control_auto_recovery_step_loss(bool on_off)
|
|||
return command_set_printing_option(on_off);
|
||||
}
|
||||
|
||||
int MachineObject::command_xcam_control_allow_prompt_sound(bool on_off)
|
||||
{
|
||||
xcam_allow_prompt_sound = on_off;
|
||||
xcam_prompt_sound_hold_count = HOLD_COUNT_MAX;
|
||||
return command_set_prompt_sound(on_off);
|
||||
}
|
||||
|
||||
void MachineObject::set_bind_status(std::string status)
|
||||
{
|
||||
bind_user_name = status;
|
||||
|
@ -2347,6 +2499,13 @@ bool MachineObject::is_printing_finished()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool MachineObject::is_core_xy()
|
||||
{
|
||||
if (get_printer_arch() == PrinterArch::ARCH_CORE_XY)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void MachineObject::reset_update_time()
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "reset reset_update_time, dev_id =" << dev_id;
|
||||
|
@ -2373,6 +2532,8 @@ void MachineObject::reset()
|
|||
m_is_support_show_bak = false;
|
||||
extruder_axis_status = LOAD;
|
||||
nozzle_diameter = 0.0f;
|
||||
network_wired = false;
|
||||
dev_connection_name = "";
|
||||
|
||||
// reset print_json
|
||||
json empty_j;
|
||||
|
@ -2513,7 +2674,10 @@ bool MachineObject::is_function_supported(PrinterFunction func)
|
|||
func_name = "FUNC_CAMERA_VIDEO";
|
||||
break;
|
||||
case FUNC_MEDIA_FILE:
|
||||
func_name = "FUNC_MEDIA_FILE";
|
||||
func_name = "FUNC_MEDIA_FILE";
|
||||
break;
|
||||
case FUNC_PROMPT_SOUND:
|
||||
func_name = "FUNC_PROMPT_SOUND";
|
||||
break;
|
||||
case FUNC_REMOTE_TUNNEL:
|
||||
parse_version_func();
|
||||
|
@ -2551,6 +2715,9 @@ bool MachineObject::is_function_supported(PrinterFunction func)
|
|||
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;
|
||||
|
@ -2567,6 +2734,9 @@ bool MachineObject::is_function_supported(PrinterFunction func)
|
|||
case FUNC_FILAMENT_BACKUP:
|
||||
func_name = "FUNC_FILAMENT_BACKUP";
|
||||
break;
|
||||
case FUNC_MOTOR_NOISE_CALI:
|
||||
func_name = "FUNC_MOTOR_NOISE_CALI";
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
@ -2586,7 +2756,7 @@ bool MachineObject::is_support_print_with_timelapse()
|
|||
|
||||
bool MachineObject::is_camera_busy_off()
|
||||
{
|
||||
if (printer_type == "C11" || printer_type == "C12")
|
||||
if (printer_type == "C11" || printer_type == "C12" || printer_type == "N1")
|
||||
return is_in_prepare() || is_in_upgrading();
|
||||
return false;
|
||||
}
|
||||
|
@ -2708,6 +2878,34 @@ int MachineObject::parse_json(std::string payload)
|
|||
}
|
||||
}
|
||||
if (jj.contains("command")) {
|
||||
|
||||
if (jj["command"].get<std::string>() == "ams_change_filament") {
|
||||
if (jj.contains("errno")) {
|
||||
if (jj["errno"].is_number()) {
|
||||
if (jj["errno"].get<int>() == -2) {
|
||||
wxString text = _L("The current chamber temperature or the target chamber temperature exceeds 45\u2103.In order to avoid extruder clogging,low temperature filament(PLA/PETG/TPU) is not allowed to be loaded.");
|
||||
GUI::wxGetApp().show_dialog(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jj["command"].get<std::string>() == "set_ctt") {
|
||||
if (m_agent && is_studio_cmd(sequence_id)) {
|
||||
if (jj["errno"].is_number()) {
|
||||
if (jj["errno"].get<int>() == -2) {
|
||||
wxString text = _L("Low temperature filament(PLA/PETG/TPU) is loaded in the extruder.In order to avoid extruder clogging,it is not allowed to set the chamber temperature above 45\u2103.");
|
||||
GUI::wxGetApp().show_dialog(text);
|
||||
}
|
||||
else if (jj["errno"].get<int>() == -4) {
|
||||
wxString text = _L("When you set the chamber temperature below 40\u2103, the chamber temperature control will not be activated. And the target chamber temperature will automatically be set to 0\u2103.");
|
||||
GUI::wxGetApp().show_dialog(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (jj["command"].get<std::string>() == "push_status") {
|
||||
m_push_count++;
|
||||
last_push_time = std::chrono::system_clock::now();
|
||||
|
@ -2910,6 +3108,11 @@ int MachineObject::parse_json(std::string payload)
|
|||
chamber_temp = jj["chamber_temper"].get<float>();
|
||||
}
|
||||
}
|
||||
if (jj.contains("ctt")) {
|
||||
if (jj["ctt"].is_number()) {
|
||||
chamber_temp_target = jj["ctt"].get<float>();
|
||||
}
|
||||
}
|
||||
/* signals */
|
||||
if (jj.contains("link_th_state"))
|
||||
link_th = jj["link_th_state"].get<std::string>();
|
||||
|
@ -4087,7 +4290,7 @@ int MachineObject::parse_json(std::string payload)
|
|||
if (it->contains("confidence")) {
|
||||
flow_ratio_calib_result.confidence = (*it)["confidence"].get<int>();
|
||||
} else {
|
||||
flow_ratio_calib_result.confidence = 0;
|
||||
flow_ratio_calib_result.confidence = 0;
|
||||
}
|
||||
|
||||
flow_ratio_results.push_back(flow_ratio_calib_result);
|
||||
|
@ -4256,7 +4459,8 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil
|
|||
}
|
||||
|
||||
if (project_id.compare("0") == 0
|
||||
|| profile_id.compare("0") == 0) return;
|
||||
|| profile_id.compare("0") == 0
|
||||
|| subtask_id.compare("0") == 0) return;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "slice_info: start";
|
||||
slice_info = new BBLSliceInfo();
|
||||
|
@ -4268,9 +4472,35 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil
|
|||
if (plate_idx >= 0) {
|
||||
plate_index = plate_idx;
|
||||
} else {
|
||||
if (subtask_id.compare("0") == 0)
|
||||
return;
|
||||
m_agent->get_task_plate_index(subtask_id, &plate_index);
|
||||
|
||||
std::string subtask_json;
|
||||
unsigned http_code = 0;
|
||||
std::string http_body;
|
||||
if (m_agent->get_subtask_info(subtask_id, &subtask_json, &http_code, &http_body) == 0) {
|
||||
try {
|
||||
json task_j = json::parse(subtask_json);
|
||||
if (task_j.contains("content")) {
|
||||
std::string content_str = task_j["content"].get<std::string>();
|
||||
json content_j = json::parse(content_str);
|
||||
plate_index = content_j["info"]["plate_idx"].get<int>();
|
||||
}
|
||||
|
||||
if (task_j.contains("context") && task_j["context"].contains("plates")) {
|
||||
for (int i = 0; i < task_j["context"]["plates"].size(); i++) {
|
||||
if (task_j["context"]["plates"][i].contains("index") && task_j["context"]["plates"][i]["index"].get<int>() == plate_index) {
|
||||
slice_info->thumbnail_url = task_j["context"]["plates"][i]["thumbnail"]["url"].get<std::string>();
|
||||
BOOST_LOG_TRIVIAL(trace) << "task_info: thumbnail url=" << slice_info->thumbnail_url;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(error) << "task_info: no context or plates";
|
||||
}
|
||||
}
|
||||
catch(...) {
|
||||
}
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(error) << "task_info: get subtask id failed!";
|
||||
}
|
||||
}
|
||||
|
||||
if (plate_index >= 0) {
|
||||
|
@ -4285,7 +4515,7 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil
|
|||
if (!j["weight"].is_null())
|
||||
slice_info->weight = j["weight"].get<float>();
|
||||
if (!j["thumbnail"].is_null()) {
|
||||
slice_info->thumbnail_url = j["thumbnail"]["url"].get<std::string>();
|
||||
//slice_info->thumbnail_url = j["thumbnail"]["url"].get<std::string>();
|
||||
BOOST_LOG_TRIVIAL(trace) << "slice_info: thumbnail url=" << slice_info->thumbnail_url;
|
||||
}
|
||||
if (!j["filaments"].is_null()) {
|
||||
|
@ -4479,6 +4709,10 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
|||
if (j.contains("sec_link")) {
|
||||
sec_link = j["sec_link"].get<std::string>();
|
||||
}
|
||||
std::string connection_name = "";
|
||||
if (j.contains("connection_name")) {
|
||||
connection_name = j["connection_name"].get<std::string>();
|
||||
}
|
||||
|
||||
MachineObject* obj;
|
||||
|
||||
|
@ -4497,11 +4731,24 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
|||
// update properties
|
||||
/* ip changed */
|
||||
obj = it->second;
|
||||
if (obj->dev_ip.compare(dev_ip) != 0 && !obj->dev_ip.empty()) {
|
||||
BOOST_LOG_TRIVIAL(info) << "MachineObject IP changed from " << obj->dev_ip << " to " << dev_ip;
|
||||
obj->dev_ip = dev_ip;
|
||||
|
||||
if (obj->dev_ip.compare(dev_ip) != 0) {
|
||||
if ( connection_name.empty() ) {
|
||||
BOOST_LOG_TRIVIAL(info) << "MachineObject IP changed from " << obj->dev_ip << " to " << dev_ip;
|
||||
obj->dev_ip = dev_ip;
|
||||
}
|
||||
else {
|
||||
if ( obj->dev_connection_name.empty() || obj->dev_connection_name.compare(connection_name) == 0) {
|
||||
BOOST_LOG_TRIVIAL(info) << "MachineObject IP changed from " << obj->dev_ip << " to " << dev_ip << " connection_name is " << connection_name;
|
||||
if(obj->dev_connection_name.empty()){obj->dev_connection_name = connection_name;}
|
||||
obj->dev_ip = dev_ip;
|
||||
}
|
||||
|
||||
}
|
||||
/* ip changed reconnect mqtt */
|
||||
}
|
||||
|
||||
|
||||
obj->wifi_signal = printer_signal;
|
||||
obj->dev_connection_type= connect_type;
|
||||
obj->bind_state = bind_state;
|
||||
|
@ -4529,6 +4776,7 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
|||
obj->dev_connection_type = connect_type;
|
||||
obj->bind_state = bind_state;
|
||||
obj->bind_sec_link = sec_link;
|
||||
obj->dev_connection_name = connection_name;
|
||||
|
||||
//load access code
|
||||
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
||||
|
@ -4968,6 +5216,21 @@ std::string DeviceManager::get_ftp_folder(std::string type_str)
|
|||
return "";
|
||||
}
|
||||
|
||||
PrinterArch DeviceManager::get_printer_arch(std::string type_str)
|
||||
{
|
||||
PrinterArch arch = PrinterArch::ARCH_CORE_XY;
|
||||
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_arch")) {
|
||||
return get_printer_arch_by_str(printer["printer_arch"].get<std::string>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return arch;
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_thumbnail_img(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
|
@ -5029,6 +5292,22 @@ bool DeviceManager::get_bed_temperature_limit(std::string type_str, int &limit)
|
|||
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;
|
||||
}
|
||||
|
||||
bool DeviceManager::load_functional_config(std::string config_file)
|
||||
{
|
||||
std::ifstream json_file(config_file.c_str());
|
||||
|
|
|
@ -52,6 +52,11 @@ using namespace nlohmann;
|
|||
namespace Slic3r {
|
||||
|
||||
|
||||
enum PrinterArch {
|
||||
ARCH_CORE_XY,
|
||||
ARCH_I3,
|
||||
};
|
||||
|
||||
enum PrinterSeries {
|
||||
SERIES_X1 = 0,
|
||||
SERIES_P1P,
|
||||
|
@ -100,10 +105,13 @@ enum PrinterFunction {
|
|||
FUNC_SEND_TO_SDCARD,
|
||||
FUNC_AUTO_SWITCH_FILAMENT,
|
||||
FUNC_CHAMBER_FAN,
|
||||
FUNC_AUX_FAN,
|
||||
FUNC_EXTRUSION_CALI,
|
||||
FUNC_PROMPT_SOUND,
|
||||
FUNC_VIRTUAL_TYAY,
|
||||
FUNC_PRINT_ALL,
|
||||
FUNC_FILAMENT_BACKUP,
|
||||
FUNC_MOTOR_NOISE_CALI,
|
||||
FUNC_MAX
|
||||
};
|
||||
|
||||
|
@ -166,6 +174,11 @@ enum AmsOptionType {
|
|||
AMS_OP_CALIBRATE_REMAIN
|
||||
};
|
||||
|
||||
enum ManualPaCaliMethod {
|
||||
PA_LINE = 0,
|
||||
PA_PATTERN,
|
||||
};
|
||||
|
||||
class AmsTray {
|
||||
public:
|
||||
AmsTray(std::string tray_id) {
|
||||
|
@ -431,6 +444,7 @@ public:
|
|||
float nozzle_diameter { 0.0f };
|
||||
std::string dev_connection_type; /* lan | cloud */
|
||||
std::string connection_type() { return dev_connection_type; }
|
||||
std::string dev_connection_name; /* lan | eth */
|
||||
void set_dev_ip(std::string ip) {dev_ip = ip;};
|
||||
bool has_access_right() { return !get_access_code().empty(); }
|
||||
std::string get_ftp_folder();
|
||||
|
@ -446,6 +460,7 @@ public:
|
|||
//PRINTER_TYPE printer_type = PRINTER_3DPrinter_UKNOWN;
|
||||
std::string printer_type; /* model_id */
|
||||
PrinterSeries get_printer_series() const;
|
||||
PrinterArch get_printer_arch() const;
|
||||
|
||||
std::string printer_thumbnail_img;
|
||||
std::string monitor_upgrade_printer_img;
|
||||
|
@ -529,6 +544,7 @@ public:
|
|||
bool can_unload_filament();
|
||||
bool is_U0_firmware();
|
||||
bool is_support_ams_mapping();
|
||||
bool is_support_command_ams_switch();
|
||||
static bool is_support_ams_mapping_version(std::string module, std::string version);
|
||||
|
||||
int ams_filament_mapping(std::vector<FilamentInfo> filaments, std::vector<FilamentInfo> &result, std::vector<int> exclude_id = std::vector<int>());
|
||||
|
@ -549,6 +565,7 @@ public:
|
|||
float bed_temp;
|
||||
float bed_temp_target;
|
||||
float chamber_temp;
|
||||
float chamber_temp_target;
|
||||
float frame_temp;
|
||||
|
||||
/* cooling */
|
||||
|
@ -562,6 +579,7 @@ public:
|
|||
std::string wifi_signal;
|
||||
std::string link_th;
|
||||
std::string link_ams;
|
||||
bool network_wired { false };
|
||||
|
||||
/* lights */
|
||||
LIGHT_EFFECT chamber_light;
|
||||
|
@ -632,6 +650,7 @@ public:
|
|||
float cache_flow_ratio { 0.0 };
|
||||
bool cali_finished = true;
|
||||
|
||||
ManualPaCaliMethod manual_pa_cali_method = ManualPaCaliMethod::PA_LINE;
|
||||
bool has_get_pa_calib_tab{ false };
|
||||
std::vector<PACalibResult> pa_calib_tab;
|
||||
float pa_calib_tab_nozzle_dia;
|
||||
|
@ -711,7 +730,9 @@ public:
|
|||
int xcam_buildplate_marker_hold_count = 0;
|
||||
bool xcam_support_recovery_step_loss { true };
|
||||
bool xcam_auto_recovery_step_loss{ false };
|
||||
bool xcam_allow_prompt_sound{ false };
|
||||
int xcam_auto_recovery_hold_count = 0;
|
||||
int xcam_prompt_sound_hold_count = 0;
|
||||
int ams_print_option_count = 0;
|
||||
|
||||
/*not support U2*/
|
||||
|
@ -786,6 +807,7 @@ public:
|
|||
int command_task_resume();
|
||||
int command_set_bed(int temp);
|
||||
int command_set_nozzle(int temp);
|
||||
int command_set_chamber(int temp);
|
||||
// ams controls
|
||||
int command_ams_switch(int tray_index, int old_temp = 210, int new_temp = 210);
|
||||
int command_ams_change_filament(int tray_id, int old_temp = 210, int new_temp = 210);
|
||||
|
@ -806,15 +828,18 @@ public:
|
|||
// set printing speed
|
||||
int command_set_printing_speed(PrintingSpeedLevel lvl);
|
||||
|
||||
//set pormpt sound
|
||||
int command_set_prompt_sound(bool prompt_sound);
|
||||
|
||||
// set print option
|
||||
int command_set_printing_option(bool auto_recovery);
|
||||
|
||||
// axis string is X, Y, Z, E
|
||||
int command_axis_control(std::string axis, double unit = 1.0f, double value = 1.0f, int speed = 3000);
|
||||
int command_axis_control(std::string axis, double unit = 1.0f, double input_val = 1.0f, int speed = 3000);
|
||||
|
||||
// calibration printer
|
||||
bool is_support_command_calibration();
|
||||
int command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali);
|
||||
int command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali, bool motor_noise);
|
||||
|
||||
// PA calibration
|
||||
int command_start_pa_calibration(const X1CCalibInfos& pa_data, int mode = 0); // 0: automatic mode; 1: manual mode. default: automatic mode
|
||||
|
@ -839,6 +864,7 @@ public:
|
|||
int command_xcam_control_first_layer_inspector(bool on_off, bool print_halt);
|
||||
int command_xcam_control_buildplate_marker_detector(bool on_off);
|
||||
int command_xcam_control_auto_recovery_step_loss(bool on_off);
|
||||
int command_xcam_control_allow_prompt_sound(bool on_off);
|
||||
|
||||
/* common apis */
|
||||
inline bool is_local() { return !dev_ip.empty(); }
|
||||
|
@ -851,6 +877,7 @@ public:
|
|||
bool is_in_printing();
|
||||
bool is_in_prepare();
|
||||
bool is_printing_finished();
|
||||
bool is_core_xy();
|
||||
void reset_update_time();
|
||||
void reset();
|
||||
static bool is_in_printing_status(std::string status);
|
||||
|
@ -944,11 +971,13 @@ public:
|
|||
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 PrinterArch get_printer_arch(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 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);
|
||||
|
|
|
@ -66,6 +66,12 @@ wxString double_to_string(double const value, const int max_precision /*= 4*/)
|
|||
return s;
|
||||
}
|
||||
|
||||
wxString get_thumbnail_string(const Vec2d& value)
|
||||
{
|
||||
wxString ret_str = wxString::Format("%.2fx%.2f", value[0], value[1]);
|
||||
return ret_str;
|
||||
}
|
||||
|
||||
wxString get_thumbnails_string(const std::vector<Vec2d>& values)
|
||||
{
|
||||
wxString ret_str;
|
||||
|
@ -367,6 +373,34 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
|||
|
||||
m_value = into_u8(str);
|
||||
break; }
|
||||
case coPoint:{
|
||||
Vec2d out_value;
|
||||
str.Replace(" ", wxEmptyString, true);
|
||||
if (!str.IsEmpty()) {
|
||||
bool invalid_val = true;
|
||||
double x, y;
|
||||
wxStringTokenizer thumbnail(str, "x");
|
||||
if (thumbnail.HasMoreTokens()) {
|
||||
wxString x_str = thumbnail.GetNextToken();
|
||||
if (x_str.ToDouble(&x) && thumbnail.HasMoreTokens()) {
|
||||
wxString y_str = thumbnail.GetNextToken();
|
||||
if (y_str.ToDouble(&y) && !thumbnail.HasMoreTokens()) {
|
||||
out_value = Vec2d(x, y);
|
||||
invalid_val = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (invalid_val) {
|
||||
wxString text_value;
|
||||
if (!m_value.empty()) text_value = get_thumbnail_string(boost::any_cast<Vec2d>(m_value));
|
||||
set_value(text_value, true);
|
||||
show_error(m_parent, format_wxstr(_L("Invalid format. Expected vector format: \"%1%\""), "XxY, XxY, ..."));
|
||||
}
|
||||
}
|
||||
|
||||
m_value = out_value;
|
||||
break; }
|
||||
|
||||
case coPoints: {
|
||||
std::vector<Vec2d> out_values;
|
||||
|
@ -446,7 +480,7 @@ void Field::sys_color_changed()
|
|||
template<class T>
|
||||
bool is_defined_input_value(wxWindow* win, const ConfigOptionType& type)
|
||||
{
|
||||
if (!win || (static_cast<T*>(win)->GetValue().empty() && type != coString && type != coStrings && type != coPoints))
|
||||
if (!win || (static_cast<T*>(win)->GetValue().empty() && type != coString && type != coStrings && type != coPoints && type != coPoint))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -495,6 +529,9 @@ void TextCtrl::BUILD() {
|
|||
text_value = vec->get_at(m_opt_idx);
|
||||
break;
|
||||
}
|
||||
case coPoint:
|
||||
text_value = get_thumbnail_string(m_opt.get_default_value<ConfigOptionPoint>()->value);
|
||||
break;
|
||||
case coPoints:
|
||||
text_value = get_thumbnails_string(m_opt.get_default_value<ConfigOptionPoints>()->values);
|
||||
break;
|
||||
|
@ -1622,8 +1659,11 @@ void PointCtrl::BUILD()
|
|||
auto temp = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
const wxSize field_size(4 * m_em_unit, -1);
|
||||
|
||||
auto default_pt = m_opt.get_default_value<ConfigOptionPoints>()->values.at(0);
|
||||
Slic3r::Vec2d default_pt;
|
||||
if(m_opt.type == coPoints)
|
||||
default_pt = m_opt.get_default_value<ConfigOptionPoints>()->values.at(0);
|
||||
else
|
||||
default_pt = m_opt.get_default_value<ConfigOptionPoint>()->value;
|
||||
double val = default_pt(0);
|
||||
wxString X = val - int(val) == 0 ? wxString::Format(_T("%i"), int(val)) : wxNumberFormatter::ToString(val, 2, wxNumberFormatter::Style_None);
|
||||
val = default_pt(1);
|
||||
|
@ -1734,14 +1774,19 @@ void PointCtrl::set_value(const Vec2d& value, bool change_event)
|
|||
void PointCtrl::set_value(const boost::any& value, bool change_event)
|
||||
{
|
||||
Vec2d pt(Vec2d::Zero());
|
||||
const Vec2d *ptf = boost::any_cast<Vec2d>(&value);
|
||||
if (!ptf)
|
||||
{
|
||||
ConfigOptionPoints* pts = boost::any_cast<ConfigOptionPoints*>(value);
|
||||
pt = pts->values.at(0);
|
||||
}
|
||||
else
|
||||
pt = *ptf;
|
||||
const Vec2d* ptf = boost::any_cast<Vec2d>(&value);
|
||||
if (!ptf) {
|
||||
if (m_opt.type == coPoint) {
|
||||
ConfigOptionPoint* pts = boost::any_cast<ConfigOptionPoint*>(value);
|
||||
pt = pts->value;
|
||||
}
|
||||
else {
|
||||
ConfigOptionPoints* pts = boost::any_cast<ConfigOptionPoints*>(value);
|
||||
pt = pts->values.at(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
pt = *ptf;
|
||||
set_value(pt, change_event);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ using t_change = std::function<void(const t_config_option_key&, const boost::any
|
|||
using t_back_to_init = std::function<void(const std::string&)>;
|
||||
|
||||
wxString double_to_string(double const value, const int max_precision = 4);
|
||||
wxString get_thumbnail_string(const Vec2d& value);
|
||||
wxString get_thumbnails_string(const std::vector<Vec2d>& values);
|
||||
|
||||
class Field {
|
||||
|
|
|
@ -5379,6 +5379,7 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
|
|||
std::string bed_shrink_x_key = "bed_shrink_x", bed_shrink_y_key = "bed_shrink_y";
|
||||
std::string multi_material_key = "allow_multi_materials_on_same_plate";
|
||||
std::string avoid_extrusion_key = "avoid_extrusion_cali_region";
|
||||
std::string align_to_y_axis_key = "align_to_y_axis";
|
||||
std::string postfix;
|
||||
//BBS:
|
||||
bool seq_print = false;
|
||||
|
@ -5394,7 +5395,7 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
|
|||
//BBS:
|
||||
seq_print = true;
|
||||
} else {
|
||||
dist_min = 0.1f;
|
||||
dist_min = 0.0f;
|
||||
postfix = "_fff";
|
||||
}
|
||||
}
|
||||
|
@ -5446,6 +5447,22 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
|
|||
settings_out.avoid_extrusion_cali_region = false;
|
||||
}
|
||||
|
||||
// Align to Y axis. Only enable this option when auto rotation not enabled
|
||||
{
|
||||
if (settings_out.enable_rotation) { // do not allow align to Y axis if rotation is enabled
|
||||
imgui->disabled_begin(true);
|
||||
settings_out.align_to_y_axis = false;
|
||||
}
|
||||
|
||||
if (imgui->bbl_checkbox(_L("Align to Y axis"), settings.align_to_y_axis)) {
|
||||
settings_out.align_to_y_axis = settings.align_to_y_axis;
|
||||
appcfg->set("arrange", align_to_y_axis_key, settings_out.align_to_y_axis ? "1" : "0");
|
||||
settings_changed = true;
|
||||
}
|
||||
|
||||
if (settings_out.enable_rotation == true) { imgui->disabled_end(); }
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(15.0f, 10.0f));
|
||||
if (imgui->button(_L("Arrange"))) {
|
||||
|
@ -5460,8 +5477,16 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
|
|||
settings_out.distance = std::max(dist_min, settings_out.distance);
|
||||
//BBS: add specific arrange settings
|
||||
if (seq_print) settings_out.is_seq_print = true;
|
||||
appcfg->set("arrange", dist_key.c_str(), float_to_string_decimal_point(settings_out.distance));
|
||||
appcfg->set("arrange", rot_key.c_str(), settings_out.enable_rotation? "1" : "0");
|
||||
|
||||
if (auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure")) {
|
||||
settings_out.align_to_y_axis = (printer_structure_opt->value == PrinterStructure::psI3);
|
||||
}
|
||||
else
|
||||
settings_out.align_to_y_axis = false;
|
||||
|
||||
appcfg->set("arrange", dist_key, float_to_string_decimal_point(settings_out.distance));
|
||||
appcfg->set("arrange", rot_key, settings_out.enable_rotation ? "1" : "0");
|
||||
appcfg->set("arrange", align_to_y_axis_key, settings_out.align_to_y_axis ? "1" : "0");
|
||||
settings_changed = true;
|
||||
}
|
||||
ImGui::PopStyleVar(1);
|
||||
|
|
|
@ -472,7 +472,7 @@ public:
|
|||
|
||||
struct ArrangeSettings
|
||||
{
|
||||
float distance = 5.;
|
||||
float distance = 0.f;
|
||||
// float distance_sla = 6.;
|
||||
float accuracy = 0.65f; // Unused currently
|
||||
bool enable_rotation = false;
|
||||
|
@ -482,6 +482,7 @@ public:
|
|||
bool is_seq_print = false;
|
||||
float bed_shrink_x = 0.f;
|
||||
float bed_shrink_y = 0.f;
|
||||
bool align_to_y_axis = false;
|
||||
};
|
||||
|
||||
struct OrientSettings
|
||||
|
@ -624,7 +625,6 @@ private:
|
|||
return *ptr;
|
||||
}
|
||||
|
||||
ArrangeSettings &get_arrange_settings() { return get_arrange_settings(this); }
|
||||
|
||||
|
||||
//BBS:record key botton frequency
|
||||
|
@ -650,6 +650,7 @@ public:
|
|||
}
|
||||
|
||||
void load_arrange_settings();
|
||||
ArrangeSettings& get_arrange_settings() { return get_arrange_settings(this); }
|
||||
|
||||
class SequentialPrintClearance
|
||||
{
|
||||
|
|
|
@ -198,6 +198,10 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
|
|||
config.option<ConfigOptionEnumsGeneric>(opt_key)->set_at(vec_new, opt_index, 0);
|
||||
}
|
||||
break;
|
||||
case coPoint:{
|
||||
config.set_key_value(opt_key, new ConfigOptionPoint(boost::any_cast<Vec2d>(value)));
|
||||
}
|
||||
break;
|
||||
case coPoints:{
|
||||
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "thumbnails") {
|
||||
config.option<ConfigOptionPoints>(opt_key)->values = boost::any_cast<std::vector<Vec2d>>(value);
|
||||
|
|
|
@ -737,7 +737,11 @@ static const FileWildcards file_wildcards_by_type[FT_SIZE] = {
|
|||
/* FT_AMF */ { "AMF files"sv, { ".amf"sv, ".zip.amf"sv, ".xml"sv } },
|
||||
/* FT_3MF */ { "3MF files"sv, { ".3mf"sv } },
|
||||
/* FT_GCODE */ { "G-code files"sv, { ".gcode"sv, ".3mf"sv } },
|
||||
#ifdef __APPLE__
|
||||
/* FT_MODEL */ { "Supported files"sv, { ".3mf"sv, ".stl"sv, ".stp"sv, ".step"sv, ".svg"sv, ".amf"sv, ".obj"sv , ".usd"sv, ".usda"sv, ".usdc"sv, ".usdz"sv, ".abc"sv, ".ply"sv} },
|
||||
#else
|
||||
/* FT_MODEL */ {"Supported files"sv, {".3mf"sv, ".stl"sv, ".stp"sv, ".step"sv, ".svg"sv, ".amf"sv, ".obj"sv }},
|
||||
#endif
|
||||
/* FT_PROJECT */ { "Project files"sv, { ".3mf"sv} },
|
||||
/* FT_GALLERY */ { "Known files"sv, { ".stl"sv, ".obj"sv } },
|
||||
|
||||
|
@ -3001,7 +3005,7 @@ bool GUI_App::has_model_mall()
|
|||
{
|
||||
if (auto cc = app_config->get_country_code(); cc == "CN" || cc == "")
|
||||
return false;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void GUI_App::update_label_colours()
|
||||
|
@ -3625,7 +3629,11 @@ void GUI_App::import_model(wxWindow *parent, wxArrayString& input_files) const
|
|||
{
|
||||
input_files.Clear();
|
||||
wxFileDialog dialog(parent ? parent : GetTopWindow(),
|
||||
#ifdef __APPLE__
|
||||
_L("Choose one or more files (3mf/step/stl/svg/obj/amf/usd*/abc/ply):"),
|
||||
#else
|
||||
_L("Choose one or more files (3mf/step/stl/svg/obj/amf):"),
|
||||
#endif
|
||||
from_u8(app_config->get_last_dir()), "",
|
||||
file_wildcards(FT_MODEL), wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST);
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ private:
|
|||
#endif
|
||||
|
||||
//import model from mall
|
||||
std::string m_download_file_url;
|
||||
wxString m_download_file_url;
|
||||
|
||||
//#ifdef _WIN32
|
||||
wxColour m_color_label_modified;
|
||||
|
@ -627,6 +627,7 @@ private:
|
|||
bool check_networking_version();
|
||||
void cancel_networking_install();
|
||||
void restart_networking();
|
||||
void check_config_updates_from_updater() { check_updates(false); }
|
||||
|
||||
private:
|
||||
int updating_bambu_networking();
|
||||
|
|
|
@ -500,6 +500,8 @@ wxMenu* MenuFactory::append_submenu_add_generic(wxMenu* menu, ModelVolumeType ty
|
|||
file_name = "ksr_fdmtest_v4.stl";
|
||||
else if (file_name == L("Voron Cube"))
|
||||
file_name = "Voron_Design_Cube_v7.stl";
|
||||
else if (file_name == "Disc")
|
||||
file_name ="Disc.stl";
|
||||
else
|
||||
return;
|
||||
input_files.push_back(
|
||||
|
|
|
@ -1710,7 +1710,8 @@ bool GLGizmoAdvancedCut::render_combo(const std::string &label, const std::vecto
|
|||
|
||||
size_t selection_out = selection_idx;
|
||||
|
||||
if (ImGui::BBLBeginCombo(("##" + label).c_str(), lines[selection_idx].c_str(), 0)) {
|
||||
const char* selected_str = (selection_idx >= 0 && selection_idx < int(lines.size())) ? lines[selection_idx].c_str() : "";
|
||||
if (ImGui::BBLBeginCombo(("##" + label).c_str(), selected_str, 0)) {
|
||||
for (size_t line_idx = 0; line_idx < lines.size(); ++line_idx) {
|
||||
ImGui::PushID(int(line_idx));
|
||||
if (ImGui::Selectable("", line_idx == selection_idx))
|
||||
|
|
|
@ -1002,8 +1002,9 @@ bool GLGizmoText::update_text_positions(const std::vector<std::string>& texts)
|
|||
Vec3d temp_position = m_mouse_position_world;
|
||||
Vec3d temp_normal = m_mouse_normal_world;
|
||||
|
||||
Vec3d cut_plane = Vec3d::UnitY();
|
||||
if (temp_normal != Vec3d::UnitZ()) {
|
||||
Vec3d cut_plane = Vec3d::UnitY();
|
||||
double epson = 1e-6;
|
||||
if (!(abs(temp_normal.x()) <= epson && abs(temp_normal.y()) <= epson && abs(temp_normal.z()) > epson)) { // temp_normal != Vec3d::UnitZ()
|
||||
Vec3d v_plane = temp_normal.cross(Vec3d::UnitZ());
|
||||
cut_plane = v_plane.cross(temp_normal);
|
||||
}
|
||||
|
@ -1092,6 +1093,9 @@ bool GLGizmoText::update_text_positions(const std::vector<std::string>& texts)
|
|||
|
||||
MeshSlicingParams slicing_params;
|
||||
slicing_params.trafo = transfo * mi->get_transformation().get_matrix() /** volume->get_transformation().get_matrix()*/;
|
||||
// for debug
|
||||
// its_write_obj(slice_meshs.its, "D:/debug_files/mesh.obj");
|
||||
|
||||
// generate polygons
|
||||
const Polygons temp_polys = slice_mesh(slice_meshs.its, click_point.z(), slicing_params);
|
||||
|
||||
|
|
|
@ -279,9 +279,22 @@ std::string get_hms_wiki_url(std::string error_code)
|
|||
std::string hms_host = wxGetApp().app_config->get_hms_host();
|
||||
std::string lang_code = HMSQuery::hms_language_code();
|
||||
std::string url = (boost::format("https://%1%/index.php?e=%2%&s=device_hms&lang=%3%")
|
||||
% hms_host
|
||||
% error_code
|
||||
% lang_code).str();
|
||||
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return url;
|
||||
MachineObject* obj = dev->get_selected_machine();
|
||||
if (!obj) return url;
|
||||
|
||||
if (!obj->dev_id.empty()) {
|
||||
url = (boost::format("https://%1%/index.php?e=%2%&d=%3%&s=device_hms&lang=%4%")
|
||||
% hms_host
|
||||
% error_code
|
||||
% obj->dev_id
|
||||
% lang_code).str();
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ void IMSlider::SetTicksValues(const Info &custom_gcode_per_print_z)
|
|||
m_ticks.ticks.clear();
|
||||
const std::vector<CustomGCode::Item> &heights = custom_gcode_per_print_z.gcodes;
|
||||
for (auto h : heights) {
|
||||
int tick = get_tick_from_value(h.print_z);
|
||||
int tick = get_tick_from_value(h.print_z, true);
|
||||
if (tick >= 0) m_ticks.ticks.emplace(TickCode{tick, h.type, h.extruder, h.color, h.extra});
|
||||
}
|
||||
|
||||
|
|
|
@ -257,7 +257,12 @@ void ArrangeJob::prepare_wipe_tower()
|
|||
// if wipe tower is explicitly disabled, no need to estimate
|
||||
DynamicPrintConfig ¤t_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
auto op = current_config.option("enable_prime_tower");
|
||||
if (op && op->getBool() == false || params.is_seq_print) return;
|
||||
bool enable_prime_tower = op && op->getBool();
|
||||
if (!enable_prime_tower || params.is_seq_print) return;
|
||||
bool smooth_timelapse = false;
|
||||
auto sop = current_config.option("timelapse_type");
|
||||
if (sop) { smooth_timelapse = sop->getInt() == TimelapseType::tlSmooth; }
|
||||
if (smooth_timelapse) { need_wipe_tower = true; }
|
||||
|
||||
// estimate if we need wipe tower for all plates:
|
||||
// need wipe tower if some object has multiple extruders (has paint-on colors or support material)
|
||||
|
@ -270,7 +275,7 @@ void ArrangeJob::prepare_wipe_tower()
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if multile extruders have same bed temp, we need wipe tower
|
||||
// 允许不同材料落在相同盘,且所有选定对象中使用了多种热床温度相同的材料
|
||||
if (params.allow_multi_materials_on_same_plate) {
|
||||
|
@ -287,35 +292,24 @@ void ArrangeJob::prepare_wipe_tower()
|
|||
}
|
||||
BOOST_LOG_TRIVIAL(info) << "arrange: need_wipe_tower=" << need_wipe_tower;
|
||||
|
||||
if (need_wipe_tower) {
|
||||
// check all plates to see if wipe tower is already there
|
||||
ArrangePolygon wipe_tower_ap;
|
||||
std::vector<bool> plates_have_wipe_tower(MAX_NUM_PLATES, false);
|
||||
for (int bedid = 0; bedid < MAX_NUM_PLATES; bedid++)
|
||||
if (auto wti = get_wipe_tower(*m_plater, bedid)) {
|
||||
ArrangePolygon &&ap = get_wipetower_arrange_poly(&wti);
|
||||
wipe_tower_ap = ap;
|
||||
ap.bed_idx = bedid;
|
||||
m_unselected.emplace_back(std::move(ap));
|
||||
plates_have_wipe_tower[bedid] = true;
|
||||
}
|
||||
|
||||
// if wipe tower is not init yet (no wipe tower in any plate before arrangement)
|
||||
//if (wipe_tower_ap.poly.empty()) {
|
||||
// auto &print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
|
||||
// wipe_tower_ap.poly.contour.points = print.first_layer_wipe_tower_corners(false);
|
||||
wipe_tower_ap.name = "WipeTower";
|
||||
wipe_tower_ap.is_virt_object = true;
|
||||
wipe_tower_ap.is_wipe_tower = true;
|
||||
//}
|
||||
const GLCanvas3D* canvas3D=static_cast<const GLCanvas3D *>(m_plater->canvas3D());
|
||||
for (int bedid = 0; bedid < MAX_NUM_PLATES; bedid++) {
|
||||
if (!plates_have_wipe_tower[bedid]) {
|
||||
wipe_tower_ap.translation = {0, 0};
|
||||
wipe_tower_ap.poly.contour.points = canvas3D->estimate_wipe_tower_points(bedid, !only_on_partplate);
|
||||
wipe_tower_ap.bed_idx = bedid;
|
||||
m_unselected.emplace_back(wipe_tower_ap);
|
||||
}
|
||||
// check all plates to see if wipe tower is already there
|
||||
ArrangePolygon wipe_tower_ap;
|
||||
wipe_tower_ap.name = "WipeTower";
|
||||
wipe_tower_ap.is_virt_object = true;
|
||||
wipe_tower_ap.is_wipe_tower = true;
|
||||
const GLCanvas3D *canvas3D = static_cast<const GLCanvas3D *>(m_plater->canvas3D());
|
||||
for (int bedid = 0; bedid < MAX_NUM_PLATES; bedid++) {
|
||||
if (auto wti = get_wipe_tower(*m_plater, bedid)) {
|
||||
// wipe tower is already there
|
||||
wipe_tower_ap = get_wipetower_arrange_poly(&wti);
|
||||
wipe_tower_ap.bed_idx = bedid;
|
||||
m_unselected.emplace_back(wipe_tower_ap);
|
||||
} else if (need_wipe_tower) {
|
||||
wipe_tower_ap.translation = {0, 0};
|
||||
wipe_tower_ap.poly.contour.points = canvas3D->estimate_wipe_tower_points(bedid, !only_on_partplate);
|
||||
wipe_tower_ap.bed_idx = bedid;
|
||||
m_unselected.emplace_back(wipe_tower_ap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -395,8 +389,13 @@ void ArrangeJob::prepare()
|
|||
params = init_arrange_params(m_plater);
|
||||
|
||||
//BBS update extruder params and speed table before arranging
|
||||
Plater::setExtruderParams(Model::extruderParamsMap);
|
||||
Plater::setPrintSpeedTable(Model::printSpeedMap);
|
||||
const Slic3r::DynamicPrintConfig& config = wxGetApp().preset_bundle->full_config();
|
||||
auto& print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
|
||||
auto print_config = print.config();
|
||||
int numExtruders = wxGetApp().preset_bundle->filament_presets.size();
|
||||
|
||||
Model::setExtruderParams(config, numExtruders);
|
||||
Model::setPrintSpeedTable(config, print_config);
|
||||
|
||||
int state = m_plater->get_prepare_state();
|
||||
if (state == Job::JobPrepareState::PREPARE_STATE_DEFAULT) {
|
||||
|
@ -502,17 +501,17 @@ void ArrangeJob::process()
|
|||
const bool is_bbl = wxGetApp().preset_bundle->is_bbl_vendor();
|
||||
if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
|
||||
partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);
|
||||
|
||||
update_arrange_params(params, *m_plater, m_selected);
|
||||
update_selected_items_inflation(m_selected, *m_plater, params);
|
||||
update_unselected_items_inflation(m_unselected, *m_plater, params);
|
||||
|
||||
Points bedpts = get_shrink_bedpts(*m_plater,params);
|
||||
update_arrange_params(params, *m_plater, m_selected);
|
||||
update_selected_items_inflation(m_selected, m_plater->config(), params);
|
||||
update_unselected_items_inflation(m_unselected, m_plater->config(), params);
|
||||
update_selected_items_axis_align(m_selected, m_plater->config(), params);
|
||||
|
||||
Points bedpts = get_shrink_bedpts(m_plater->config(),params);
|
||||
double scaled_exclusion_gap = scale_(1);
|
||||
partplate_list.preprocess_exclude_areas(params.excluded_regions, 1, scaled_exclusion_gap);
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "arrange bed_shrink_x=" << params.bed_shrink_x
|
||||
<< "; bedpts:" << bedpts[0].transpose() << ", " << bedpts[1].transpose() << ", " << bedpts[2].transpose() << ", " << bedpts[3].transpose();
|
||||
BOOST_LOG_TRIVIAL(debug) << "arrange bedpts:" << bedpts[0].transpose() << ", " << bedpts[1].transpose() << ", " << bedpts[2].transpose() << ", " << bedpts[3].transpose();
|
||||
|
||||
params.stopcondition = [this]() { return was_canceled(); };
|
||||
|
||||
|
@ -521,14 +520,14 @@ void ArrangeJob::process()
|
|||
};
|
||||
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(debug)<< "Arrange full params: "<< params.to_json();
|
||||
BOOST_LOG_TRIVIAL(debug) << "items selected before arrange: ";
|
||||
for (auto selected : m_selected)
|
||||
BOOST_LOG_TRIVIAL(debug) << selected.name << ", extruder: " << selected.extrude_ids.back() << ", bed: " << selected.bed_idx
|
||||
<< ", bed_temp: " << selected.first_bed_temp << ", print_temp: " << selected.print_temp;
|
||||
BOOST_LOG_TRIVIAL(debug) << "items unselected before arrange: ";
|
||||
for (auto item : m_unselected)
|
||||
if (!item.is_virt_object)
|
||||
BOOST_LOG_TRIVIAL(debug) << item.name << ", extruder: " << item.extrude_ids.back() << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose();
|
||||
BOOST_LOG_TRIVIAL(debug) << item.name << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose();
|
||||
}
|
||||
|
||||
arrangement::arrange(m_selected, m_unselected, bedpts, params);
|
||||
|
@ -543,9 +542,7 @@ void ArrangeJob::process()
|
|||
<< ", trans: " << unscale<double>(selected.translation(X)) << ","<< unscale<double>(selected.translation(Y));
|
||||
BOOST_LOG_TRIVIAL(debug) << "items unselected after arrange: ";
|
||||
for (auto item : m_unselected)
|
||||
if (!item.is_virt_object)
|
||||
BOOST_LOG_TRIVIAL(debug) << item.name << ", extruder: " << item.extrude_ids.back() << ", bed: " << item.bed_idx
|
||||
<< ", trans: " << item.translation.transpose();
|
||||
BOOST_LOG_TRIVIAL(debug) << item.name << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose();
|
||||
}
|
||||
|
||||
arrangement::arrange(m_unprintable, {}, bedpts, params);
|
||||
|
@ -735,18 +732,22 @@ arrangement::ArrangeParams init_arrange_params(Plater *p)
|
|||
arrangement::ArrangeParams params;
|
||||
const GLCanvas3D::ArrangeSettings &settings = static_cast<const GLCanvas3D *>(p->canvas3D())->get_arrange_settings();
|
||||
auto & print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
|
||||
const PrintConfig& print_config = print.config();
|
||||
|
||||
|
||||
params.clearance_height_to_rod = print.config().extruder_clearance_height_to_rod.value;
|
||||
params.clearance_height_to_lid = print.config().extruder_clearance_height_to_lid.value;
|
||||
params.cleareance_radius = print.config().extruder_clearance_radius.value;
|
||||
params.printable_height = print.config().printable_height.value;
|
||||
params.allow_rotations = settings.enable_rotation;
|
||||
params.align_center = print_config.best_object_pos.value;
|
||||
params.allow_multi_materials_on_same_plate = settings.allow_multi_materials_on_same_plate;
|
||||
params.avoid_extrusion_cali_region = settings.avoid_extrusion_cali_region;
|
||||
params.is_seq_print = settings.is_seq_print;
|
||||
params.min_obj_distance = scaled(settings.distance);
|
||||
params.bed_shrink_x = settings.bed_shrink_x;
|
||||
params.bed_shrink_y = settings.bed_shrink_y;
|
||||
params.align_to_y_axis = settings.align_to_y_axis;
|
||||
|
||||
int state = p->get_prepare_state();
|
||||
if (state == Job::JobPrepareState::PREPARE_STATE_MENU) {
|
||||
|
@ -760,17 +761,15 @@ arrangement::ArrangeParams init_arrange_params(Plater *p)
|
|||
return params;
|
||||
}
|
||||
|
||||
//after get selected.call this to update bed_shrink
|
||||
//after get selected call this to update bed_shrink
|
||||
void update_arrange_params(arrangement::ArrangeParams ¶ms, const Plater &p, const arrangement::ArrangePolygons &selected)
|
||||
{
|
||||
const GLCanvas3D::ArrangeSettings &settings = static_cast<const GLCanvas3D *>(p.canvas3D())->get_arrange_settings();
|
||||
auto & print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
|
||||
double skirt_distance = print.has_skirt() ? print.config().skirt_distance.value : 0;
|
||||
double brim_max = 0;
|
||||
std::for_each(selected.begin(), selected.end(), [&](const ArrangePolygon &ap) { brim_max = std::max(brim_max, ap.brim_width); });
|
||||
// Note: skirt_distance is now defined between outermost brim and skirt, not the object and skirt.
|
||||
// So we can't do max but do adding instead.
|
||||
params.brim_skirt_distance = skirt_distance + brim_max;
|
||||
params.brim_skirt_distance = skirt_distance;
|
||||
params.bed_shrink_x = settings.bed_shrink_x + params.brim_skirt_distance;
|
||||
params.bed_shrink_y = settings.bed_shrink_y + params.brim_skirt_distance;
|
||||
// for sequential print, we need to inflate the bed because cleareance_radius is so large
|
||||
|
@ -781,55 +780,4 @@ void update_arrange_params(arrangement::ArrangeParams ¶ms, const Plater &p,
|
|||
}
|
||||
}
|
||||
|
||||
//it will bed accurate after call update_params
|
||||
Points get_shrink_bedpts(const Plater &plater, const arrangement::ArrangeParams ¶ms)
|
||||
{
|
||||
Points bedpts = get_bed_shape(*plater.config());
|
||||
// shrink bed by moving to center by dist
|
||||
auto shrinkFun = [](Points &bedpts, double dist, int direction) {
|
||||
#define SGN(x) ((x) >= 0 ? 1 : -1)
|
||||
Point center = Polygon(bedpts).bounding_box().center();
|
||||
for (auto &pt : bedpts) pt[direction] += dist * SGN(center[direction] - pt[direction]);
|
||||
};
|
||||
shrinkFun(bedpts, scaled(params.bed_shrink_x), 0);
|
||||
shrinkFun(bedpts, scaled(params.bed_shrink_y), 1);
|
||||
return bedpts;
|
||||
}
|
||||
|
||||
void update_selected_items_inflation(arrangement::ArrangePolygons &selected, const Plater &p, const arrangement::ArrangeParams ¶ms) {
|
||||
// do not inflate brim_width. Objects are allowed to have overlapped brim.
|
||||
Points bedpts = get_shrink_bedpts(p, params);
|
||||
BoundingBox bedbb = Polygon(bedpts).bounding_box();
|
||||
std::for_each(selected.begin(), selected.end(), [&](ArrangePolygon &ap) {
|
||||
ap.inflation = std::max(scaled(ap.brim_width), params.min_obj_distance / 2);
|
||||
BoundingBox apbb = ap.poly.contour.bounding_box();
|
||||
auto diffx = bedbb.size().x() - apbb.size().x() - 5;
|
||||
auto diffy = bedbb.size().y() - apbb.size().y() - 5;
|
||||
if (diffx > 0 && diffy > 0) {
|
||||
auto min_diff = std::min(diffx, diffy);
|
||||
ap.inflation = std::min(min_diff / 2, ap.inflation);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void update_unselected_items_inflation(arrangement::ArrangePolygons &unselected, const Plater &p, const arrangement::ArrangeParams ¶ms)
|
||||
{
|
||||
if (params.is_seq_print) {
|
||||
float shift_dist = params.cleareance_radius / 2 - 5;
|
||||
// dont forget to move the excluded region
|
||||
for (auto ®ion : unselected) {
|
||||
if (region.is_virt_object) region.poly.translate(-scaled(shift_dist), -scaled(shift_dist));
|
||||
}
|
||||
}
|
||||
// For occulusion regions, inflation should be larger to prevent genrating brim on them.
|
||||
// However, extrusion cali regions are exceptional, since we can allow brim overlaps them.
|
||||
// 屏蔽区域只需要膨胀brim宽度,防止brim长过去;挤出标定区域不需要膨胀,brim可以长过去。
|
||||
// 以前我们认为还需要膨胀clearance_radius/2,这其实是不需要的,因为这些区域并不会真的摆放物体,
|
||||
// 其他物体的膨胀轮廓是可以跟它们重叠的。
|
||||
double scaled_exclusion_gap = scale_(1);
|
||||
std::for_each(unselected.begin(), unselected.end(),
|
||||
[&](auto &ap) { ap.inflation = !ap.is_virt_object ? std::max(scaled(ap.brim_width), params.min_obj_distance / 2)
|
||||
: (ap.is_extrusion_cali_object ? 0 : scaled_exclusion_gap); });
|
||||
}
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
|
|
@ -80,14 +80,8 @@ arrangement::ArrangeParams get_arrange_params(Plater *p);
|
|||
|
||||
arrangement::ArrangeParams init_arrange_params(Plater *p);
|
||||
|
||||
Points get_shrink_bedpts(const Plater& plater,const arrangement::ArrangeParams& params);
|
||||
|
||||
void update_arrange_params(arrangement::ArrangeParams ¶ms, const Plater &p, const arrangement::ArrangePolygons &selected);
|
||||
|
||||
void update_selected_items_inflation(arrangement::ArrangePolygons &selected, const Plater &p, const arrangement::ArrangeParams ¶ms);
|
||||
|
||||
void update_unselected_items_inflation(arrangement::ArrangePolygons &unselected, const Plater &p, const arrangement::ArrangeParams ¶ms);
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
#endif // ARRANGEJOB_HPP
|
||||
|
|
|
@ -206,7 +206,7 @@ void FillBedJob::process()
|
|||
static_cast<const GLCanvas3D*>(m_plater->canvas3D())->get_arrange_settings();
|
||||
|
||||
update_arrange_params(params, *m_plater, m_selected);
|
||||
m_bedpts = get_shrink_bedpts(*m_plater, params);
|
||||
m_bedpts = get_shrink_bedpts(m_plater->config(), params);
|
||||
|
||||
auto &partplate_list = m_plater->get_partplate_list();
|
||||
auto &print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
|
||||
|
@ -216,8 +216,8 @@ void FillBedJob::process()
|
|||
if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
|
||||
partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);
|
||||
|
||||
update_selected_items_inflation(m_selected, *m_plater, params);
|
||||
update_unselected_items_inflation(m_unselected, *m_plater, params);
|
||||
update_selected_items_inflation(m_selected, m_plater->config(), params);
|
||||
update_unselected_items_inflation(m_unselected, m_plater->config(), params);
|
||||
|
||||
bool do_stop = false;
|
||||
params.stopcondition = [this, &do_stop]() {
|
||||
|
|
|
@ -31,7 +31,8 @@ static wxString sending_over_cloud_str = _L("Sending print job through clou
|
|||
|
||||
PrintJob::PrintJob(std::shared_ptr<ProgressIndicator> pri, Plater* plater, std::string dev_id)
|
||||
: PlaterJob{ std::move(pri), plater },
|
||||
m_dev_id(dev_id)
|
||||
m_dev_id(dev_id),
|
||||
m_is_calibration_task(false)
|
||||
{
|
||||
m_print_job_completed_id = plater->get_print_finished_event();
|
||||
}
|
||||
|
@ -208,7 +209,7 @@ void PrintJob::process()
|
|||
params.filename = job_data._temp_path.string();
|
||||
params.connection_type = this->connection_type;
|
||||
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr);
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr, nullptr);
|
||||
if (result != 0) {
|
||||
BOOST_LOG_TRIVIAL(error) << "access code is invalid";
|
||||
m_enter_ip_address_fun_fail();
|
||||
|
@ -280,6 +281,11 @@ void PrintJob::process()
|
|||
if (params.preset_name.empty() && m_print_type == "from_normal") { params.preset_name = wxString::Format("%s_plate_%d", m_project_name, curr_plate_idx).ToStdString(); }
|
||||
if (params.project_name.empty()) {params.project_name = m_project_name;}
|
||||
|
||||
if (m_is_calibration_task) {
|
||||
params.project_name = m_project_name;
|
||||
params.origin_model_id = "";
|
||||
}
|
||||
|
||||
wxString error_text;
|
||||
wxString msg_text;
|
||||
|
||||
|
@ -385,6 +391,12 @@ void PrintJob::process()
|
|||
return was_canceled();
|
||||
};
|
||||
|
||||
auto wait_fn = [this](int state, std::string job_info) {
|
||||
// TODO
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
if (params.connection_type != "lan") {
|
||||
if (params.dev_ip.empty())
|
||||
params.comments = "no_ip";
|
||||
|
@ -407,7 +419,7 @@ void PrintJob::process()
|
|||
BOOST_LOG_TRIVIAL(info) << "print_job: use ftp send print only";
|
||||
this->update_status(curr_percent, _L("Sending print job over LAN"));
|
||||
is_try_lan_mode = true;
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn, wait_fn);
|
||||
if (result < 0) {
|
||||
error_text = wxString::Format("Access code:%s Ip address:%s", params.password, params.dev_ip);
|
||||
// try to send with cloud
|
||||
|
@ -423,7 +435,7 @@ void PrintJob::process()
|
|||
// try to send local with record
|
||||
BOOST_LOG_TRIVIAL(info) << "print_job: try to start local print with record";
|
||||
this->update_status(curr_percent, _L("Sending print job over LAN"));
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn, wait_fn);
|
||||
if (result == 0) {
|
||||
params.comments = "";
|
||||
}
|
||||
|
@ -438,13 +450,13 @@ void PrintJob::process()
|
|||
// try to send with cloud
|
||||
BOOST_LOG_TRIVIAL(warning) << "print_job: try to send with cloud";
|
||||
this->update_status(curr_percent, _L("Sending print job through cloud service"));
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn, wait_fn);
|
||||
}
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << "print_job: send with cloud";
|
||||
this->update_status(curr_percent, _L("Sending print job through cloud service"));
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn, wait_fn);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -483,6 +495,8 @@ void PrintJob::process()
|
|||
|
||||
BOOST_LOG_TRIVIAL(error) << "print_job: failed, result = " << result;
|
||||
} else {
|
||||
// wait for printer mqtt ready the same job id
|
||||
|
||||
wxGetApp().plater()->record_slice_preset("print");
|
||||
|
||||
BOOST_LOG_TRIVIAL(error) << "print_job: send ok.";
|
||||
|
@ -534,5 +548,9 @@ void PrintJob::connect_to_local_mqtt()
|
|||
this->update_status(0, wxEmptyString);
|
||||
}
|
||||
|
||||
void PrintJob::set_calibration_task(bool is_calibration)
|
||||
{
|
||||
m_is_calibration_task = is_calibration;
|
||||
}
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
|
|
@ -63,6 +63,8 @@ public:
|
|||
std::string m_print_type;
|
||||
std::string m_dst_path;
|
||||
|
||||
bool m_is_calibration_task = false;
|
||||
|
||||
int m_print_from_sdc_plate_idx = 0;
|
||||
|
||||
bool m_local_use_ssl_for_mqtt { true };
|
||||
|
@ -106,6 +108,7 @@ public:
|
|||
void connect_to_local_mqtt();
|
||||
wxString get_http_error_msg(unsigned int status, std::string body);
|
||||
std::string truncate_string(const std::string& str, size_t maxLength);
|
||||
void set_calibration_task(bool is_calibration);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ void SendJob::process()
|
|||
params.filename = job_data._temp_path.string();
|
||||
params.connection_type = this->connection_type;
|
||||
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr);
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr, nullptr);
|
||||
if (result != 0) {
|
||||
BOOST_LOG_TRIVIAL(error) << "access code is invalid";
|
||||
m_enter_ip_address_fun_fail();
|
||||
|
@ -317,7 +317,7 @@ void SendJob::process()
|
|||
// try to send local with record
|
||||
BOOST_LOG_TRIVIAL(info) << "send_job: try to send gcode to printer";
|
||||
this->update_status(curr_percent, _L("Sending gcode file over LAN"));
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
|
||||
if (result == BAMBU_NETWORK_ERR_FTP_UPLOAD_FAILED) {
|
||||
params.comments = "upload_failed";
|
||||
} else {
|
||||
|
@ -335,7 +335,7 @@ void SendJob::process()
|
|||
} else {
|
||||
if (this->has_sdcard) {
|
||||
this->update_status(curr_percent, _L("Sending gcode file over LAN"));
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
|
||||
} else {
|
||||
this->update_status(curr_percent, _L("An SD card needs to be inserted before sending to printer."));
|
||||
return;
|
||||
|
|
|
@ -179,11 +179,11 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
|||
set_miniaturizable(GetHandle());
|
||||
#endif
|
||||
|
||||
//reset developer_mode to false and user_mode to comAdvanced
|
||||
wxGetApp().app_config->set_bool("developer_mode", false);
|
||||
if (wxGetApp().app_config->get("user_mode") == "develop") {
|
||||
wxGetApp().app_config->set("user_mode", "advanced");
|
||||
}
|
||||
if (!wxGetApp().app_config->has("user_mode")) {
|
||||
wxGetApp().app_config->set("user_mode", "simple");
|
||||
wxGetApp().app_config->set_bool("developer_mode", false);
|
||||
wxGetApp().app_config->save();
|
||||
}
|
||||
|
||||
wxGetApp().app_config->set_bool("internal_developer_mode", false);
|
||||
|
||||
|
@ -1500,7 +1500,7 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||
{
|
||||
//this->m_plater->select_view_3D("Preview");
|
||||
m_plater->update();
|
||||
m_plater->update(false, true);
|
||||
if (m_slice_select == eSliceAll)
|
||||
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_ALL));
|
||||
else
|
||||
|
|
|
@ -153,7 +153,7 @@ void MediaPlayCtrl::Play()
|
|||
m_button_play->SetIcon("media_stop");
|
||||
NetworkAgent *agent = wxGetApp().getAgent();
|
||||
std::string agent_version = agent ? agent->get_version() : "";
|
||||
if (m_lan_proto > 0 && (m_lan_mode ||!m_remote_support) && !m_disable_lan && !m_lan_ip.empty()) {
|
||||
if (m_lan_proto > 0 && (m_lan_mode || m_lan_proto == 1 || !m_remote_support) && !m_disable_lan && !m_lan_ip.empty()) {
|
||||
m_disable_lan = m_remote_support && !m_lan_mode; // try remote next time
|
||||
if (m_lan_proto == 1)
|
||||
m_url = "bambu:///local/" + m_lan_ip + ".?port=6000&user=" + m_lan_user + "&passwd=" + m_lan_passwd + "&device=" + m_machine + "&version=" + agent_version;
|
||||
|
@ -161,7 +161,7 @@ void MediaPlayCtrl::Play()
|
|||
m_url = "bambu:///rtsps___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?device=" + m_machine + "&version=" + agent_version;
|
||||
else if (m_lan_proto == 3)
|
||||
m_url = "bambu:///rtsp___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?device=" + m_machine + "&version=" + agent_version;
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl camera_url: " << m_url;
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << m_url.substr(0, 16);
|
||||
m_last_state = MEDIASTATE_LOADING;
|
||||
SetStatus(_L("Loading..."));
|
||||
if (wxGetApp().app_config->get("internal_developer_mode") == "true") {
|
||||
|
@ -207,7 +207,7 @@ void MediaPlayCtrl::Play()
|
|||
url += "&device=" + m;
|
||||
url += "&version=" + v;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl camera_url: " << url << ", machine: " << m_machine;
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << url.substr(0, 16) << ", machine: " << m_machine;
|
||||
CallAfter([this, m, url] {
|
||||
if (m != m_machine) {
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl drop late ttcode for machine: " << m;
|
||||
|
@ -263,6 +263,7 @@ void MediaPlayCtrl::Stop(wxString const &msg)
|
|||
}
|
||||
|
||||
|
||||
bool remote = m_url.find("/local/") == wxString::npos && m_url.find("/rtsp") == wxString::npos;
|
||||
if (last_state != wxMEDIASTATE_PLAYING && m_failed_code != 0
|
||||
&& m_last_failed_codes.find(m_failed_code) == m_last_failed_codes.end()
|
||||
&& (m_user_triggered || m_failed_retry > 3)) {
|
||||
|
@ -273,7 +274,6 @@ void MediaPlayCtrl::Stop(wxString const &msg)
|
|||
j["result"] = "failed";
|
||||
j["user_triggered"] = m_user_triggered;
|
||||
j["failed_retry"] = m_failed_retry;
|
||||
bool remote = m_url.find("/local/") == wxString::npos;
|
||||
j["tunnel"] = remote ? "remote" : "local";
|
||||
j["code"] = m_failed_code;
|
||||
if (remote)
|
||||
|
@ -285,7 +285,7 @@ void MediaPlayCtrl::Stop(wxString const &msg)
|
|||
|
||||
m_url.clear();
|
||||
++m_failed_retry;
|
||||
if (m_failed_code < 0 && last_state != wxMEDIASTATE_PLAYING && (!m_remote_support || m_lan_mode) && (m_failed_retry > 1 || m_user_triggered)) {
|
||||
if (m_failed_code < 0 && last_state != wxMEDIASTATE_PLAYING && !remote && (m_failed_retry > 1 || m_user_triggered)) {
|
||||
m_next_retry = wxDateTime(); // stop retry
|
||||
if (wxGetApp().show_modal_ip_address_enter_dialog(_L("LAN Connection Failed (Failed to start liveview)"))) {
|
||||
m_failed_retry = 0;
|
||||
|
@ -384,7 +384,7 @@ void MediaPlayCtrl::ToggleStream()
|
|||
url += "&device=" + m;
|
||||
url += "&version=" + v;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << "camera_url: " << url;
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::ToggleStream: " << url.substr(0, 16);
|
||||
CallAfter([this, m, url] {
|
||||
if (m != m_machine) return;
|
||||
if (url.empty() || !boost::algorithm::starts_with(url, "bambu:///")) {
|
||||
|
|
|
@ -1903,7 +1903,7 @@ void NotificationManager::push_slicing_error_notification(const std::string &tex
|
|||
push_notification_data({ NotificationType::SlicingError, NotificationLevel::ErrorNotificationLevel, 0, _u8L("Error:") + "\n" + text, link, callback }, 0);
|
||||
set_slicing_progress_hidden();
|
||||
}
|
||||
void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ModelObject const * obj, ObjectID oid, int warning_step, int warning_msg_id)
|
||||
void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ModelObject const * obj, ObjectID oid, int warning_step, int warning_msg_id, NotificationLevel level/* = NotificationLevel::WarningNotificationLevel*/)
|
||||
{
|
||||
auto callback = obj ? [id = obj->id()](wxEvtHandler *) {
|
||||
auto & objects = wxGetApp().model().objects;
|
||||
|
@ -1916,7 +1916,7 @@ void NotificationManager::push_slicing_warning_notification(const std::string& t
|
|||
} : std::function<bool(wxEvtHandler *)>();
|
||||
auto link = callback ? _u8L("Jump to") : "";
|
||||
if (obj) link += std::string(" [") + obj->name + "]";
|
||||
NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("Warning:") + "\n" + text, link, callback };
|
||||
NotificationData data { NotificationType::SlicingWarning, level, 0, _u8L("Warning:") + "\n" + text, link, callback };
|
||||
|
||||
data.sub_msg_id = warning_msg_id;
|
||||
data.ori_text = text;
|
||||
|
@ -2072,6 +2072,14 @@ void NotificationManager::push_exporting_finished_notification(const std::string
|
|||
set_slicing_progress_hidden();
|
||||
}
|
||||
|
||||
void NotificationManager::push_import_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable)
|
||||
{
|
||||
close_notification_of_type(NotificationType::ExportFinished);
|
||||
NotificationData data{ NotificationType::ExportFinished, NotificationLevel::RegularNotificationLevel, on_removable ? 0 : 20, _u8L("Model file downloaded.") + "\n" + path };
|
||||
push_notification_data(std::make_unique<NotificationManager::ExportFinishedNotification>(data, m_id_provider, m_evt_handler, on_removable, path, dir_path), 0);
|
||||
set_slicing_progress_hidden();
|
||||
}
|
||||
|
||||
void NotificationManager::push_upload_job_notification(int id, float filesize, const std::string& filename, const std::string& host, float percentage)
|
||||
{
|
||||
// find if upload with same id was not already in notification
|
||||
|
|
|
@ -200,7 +200,7 @@ public:
|
|||
// Creates Slicing Error notification with a custom text and no fade out.
|
||||
void push_slicing_error_notification(const std::string &text, std::vector<ModelObject const *> objs);
|
||||
// Creates Slicing Warning notification with a custom text and no fade out.
|
||||
void push_slicing_warning_notification(const std::string &text, bool gray, ModelObject const *obj, ObjectID oid, int warning_step, int warning_msg_id);
|
||||
void push_slicing_warning_notification(const std::string &text, bool gray, ModelObject const *obj, ObjectID oid, int warning_step, int warning_msg_id, NotificationLevel level = NotificationLevel::WarningNotificationLevel);
|
||||
// marks slicing errors as gray
|
||||
void set_all_slicing_errors_gray(bool g);
|
||||
// marks slicing warings as gray
|
||||
|
@ -236,6 +236,7 @@ public:
|
|||
void set_sla(bool b) { set_fff(!b); }
|
||||
// Exporting finished, show this information with path, button to open containing folder and if ejectable - eject button
|
||||
void push_exporting_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable);
|
||||
void push_import_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable);
|
||||
// notifications with progress bar
|
||||
// slicing progress
|
||||
void init_slicing_progress_notification(std::function<bool()> cancel_callback);
|
||||
|
|
|
@ -78,6 +78,7 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
|
|||
case coEnums:
|
||||
m_fields.emplace(id, Choice::Create<Choice>(this->ctrl_parent(), opt, id));
|
||||
break;
|
||||
case coPoint:
|
||||
case coPoints:
|
||||
m_fields.emplace(id, PointCtrl::Create<PointCtrl>(this->ctrl_parent(), opt, id));
|
||||
break;
|
||||
|
@ -1033,6 +1034,9 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
|
|||
case coEnums:
|
||||
ret = config.opt_int(opt_key, idx);
|
||||
break;
|
||||
case coPoint:
|
||||
ret = config.option<ConfigOptionPoint>(opt_key)->value;
|
||||
break;
|
||||
case coPoints:
|
||||
if (opt_key == "printable_area")
|
||||
ret = config.option<ConfigOptionPoints>(opt_key)->values;
|
||||
|
@ -1145,6 +1149,9 @@ boost::any ConfigOptionsGroup::get_config_value2(const DynamicPrintConfig& confi
|
|||
case coEnums:
|
||||
ret = config.opt_int(opt_key, idx);
|
||||
break;
|
||||
case coPoint:
|
||||
ret = config.option<ConfigOptionPoint>(opt_key)->value;
|
||||
break;
|
||||
case coPoints:
|
||||
if (opt_key == "printable_area")
|
||||
ret = config.option<ConfigOptionPoints>(opt_key)->values;
|
||||
|
|
|
@ -2106,7 +2106,7 @@ void PartPlate::duplicate_all_instance(unsigned int dup_count, bool need_skip, s
|
|||
ModelObject* newObj = m_model->add_object(*object);
|
||||
newObj->name = object->name +"_"+ std::to_string(index+1);
|
||||
int new_obj_id = m_model->objects.size() - 1;
|
||||
for ( size_t new_instance_id = 0; new_instance_id < object->instances.size(); new_instance_id++ )
|
||||
for ( size_t new_instance_id = 0; new_instance_id < newObj->instances.size(); new_instance_id++ )
|
||||
{
|
||||
obj_to_instance_set.emplace(std::pair(new_obj_id, new_instance_id));
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": duplicate object into plate: index_pair [%1%,%2%], obj_id %3%") % new_obj_id % new_instance_id % newObj->id().id;
|
||||
|
@ -2115,6 +2115,31 @@ void PartPlate::duplicate_all_instance(unsigned int dup_count, bool need_skip, s
|
|||
}
|
||||
}
|
||||
|
||||
for (std::set<std::pair<int, int>>::iterator it = obj_to_instance_set.begin(); it != obj_to_instance_set.end(); ++it)
|
||||
{
|
||||
int obj_id = it->first;
|
||||
int instance_id = it->second;
|
||||
|
||||
if ((obj_id >= 0) && (obj_id < m_model->objects.size()))
|
||||
{
|
||||
ModelObject* object = m_model->objects[obj_id];
|
||||
ModelInstance* instance = object->instances[instance_id];
|
||||
|
||||
if (instance->printable)
|
||||
{
|
||||
instance->loaded_id = instance->id().id;
|
||||
if (need_skip) {
|
||||
while (skip_objects.find(instance->loaded_id) != skip_objects.end())
|
||||
{
|
||||
instance->loaded_id ++;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": duplicated id %1% with skip, try new one %2%") %instance->id().id % instance->loaded_id;
|
||||
}
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": set obj %1% instance %2%'s loaded_id to its id %3%, name %4%") % obj_id %instance_id %instance->loaded_id % object->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4518,7 +4543,7 @@ bool PartPlateList::set_shapes(const Pointfs& shape, const Pointfs& exclude_area
|
|||
pos = compute_shape_position(i, m_plate_cols);
|
||||
plate->set_shape(shape, exclude_areas, pos, height_to_lid, height_to_rod);
|
||||
}
|
||||
|
||||
is_load_bedtype_textures = false;//reload textures
|
||||
calc_bounding_boxes();
|
||||
|
||||
auto check_texture = [](const std::string& texture) {
|
||||
|
@ -4851,6 +4876,8 @@ int PartPlateList::store_to_3mf_structure(PlateDataPtrs& plate_data_list, bool w
|
|||
plate_data_item->gcode_prediction = std::to_string(
|
||||
(int) m_plate_list[i]->get_slice_result()->print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time);
|
||||
plate_data_item->toolpath_outside = m_plate_list[i]->m_gcode_result->toolpath_outside;
|
||||
plate_data_item->timelapse_warning_code = m_plate_list[i]->m_gcode_result->timelapse_warning_code;
|
||||
m_plate_list[i]->set_timelapse_warning_code(plate_data_item->timelapse_warning_code);
|
||||
plate_data_item->is_label_object_enabled = m_plate_list[i]->m_gcode_result->label_object_enabled;
|
||||
Print *print = nullptr;
|
||||
m_plate_list[i]->get_print((PrintBase **) &print, nullptr, nullptr);
|
||||
|
@ -4923,6 +4950,8 @@ int PartPlateList::load_from_3mf_structure(PlateDataPtrs& plate_data_list)
|
|||
ps.total_used_filament *= 1000; //koef
|
||||
gcode_result->toolpath_outside = plate_data_list[i]->toolpath_outside;
|
||||
gcode_result->label_object_enabled = plate_data_list[i]->is_label_object_enabled;
|
||||
gcode_result->timelapse_warning_code = plate_data_list[i]->timelapse_warning_code;
|
||||
m_plate_list[index]->set_timelapse_warning_code(plate_data_list[i]->timelapse_warning_code);
|
||||
m_plate_list[index]->slice_filaments_info = plate_data_list[i]->slice_filaments_info;
|
||||
gcode_result->warnings = plate_data_list[i]->warnings;
|
||||
if (m_plater && !plate_data_list[i]->thumbnail_file.empty()) {
|
||||
|
@ -5054,15 +5083,17 @@ void PartPlateList::BedTextureInfo::TexturePart::update_buffer()
|
|||
|
||||
void PartPlateList::init_bed_type_info()
|
||||
{
|
||||
BedTextureInfo::TexturePart pc_part1( 5, 130, 10, 110, "bbl_bed_pc_left.svg");
|
||||
BedTextureInfo::TexturePart pc_part2( 74, -12, 150, 12, "bbl_bed_pc_bottom.svg");
|
||||
BedTextureInfo::TexturePart ep_part1( 4, 87, 12, 153, "bbl_bed_ep_left.svg");
|
||||
BedTextureInfo::TexturePart ep_part2( 72, -11, 150, 12, "bbl_bed_ep_bottom.svg");
|
||||
BedTextureInfo::TexturePart pei_part1( 6, 50, 12, 190, "bbl_bed_pei_left.svg");
|
||||
BedTextureInfo::TexturePart pei_part2(72, -11, 150, 12, "bbl_bed_pei_bottom.svg");
|
||||
BedTextureInfo::TexturePart pte_part1( 6, 40, 12, 200, "bbl_bed_pte_left.svg");
|
||||
BedTextureInfo::TexturePart pte_part2(72, -11, 150, 12, "bbl_bed_pte_bottom.svg");
|
||||
|
||||
BedTextureInfo::TexturePart pc_part1(10, 130, 10, 110, "bbl_bed_pc_left.svg");
|
||||
BedTextureInfo::TexturePart pc_part2(74, -10, 148, 12, "bbl_bed_pc_bottom.svg");
|
||||
BedTextureInfo::TexturePart ep_part1(7.5, 90, 12.5, 150, "bbl_bed_ep_left.svg");
|
||||
BedTextureInfo::TexturePart ep_part2(74, -10, 148, 12, "bbl_bed_ep_bottom.svg");
|
||||
BedTextureInfo::TexturePart pei_part1(7.5, 50, 12.5, 190, "bbl_bed_pei_left.svg");
|
||||
BedTextureInfo::TexturePart pei_part2(74, -10, 148, 12, "bbl_bed_pei_bottom.svg");
|
||||
BedTextureInfo::TexturePart pte_part1(10, 80, 10, 160, "bbl_bed_pte_left.svg");
|
||||
BedTextureInfo::TexturePart pte_part2(74, -10, 148, 12, "bbl_bed_pte_bottom.svg");
|
||||
for (size_t i = 0; i < btCount; i++) {
|
||||
bed_texture_info[i].parts.clear();
|
||||
}
|
||||
bed_texture_info[btPC].parts.push_back(pc_part1);
|
||||
bed_texture_info[btPC].parts.push_back(pc_part2);
|
||||
bed_texture_info[btEP].parts.push_back(ep_part1);
|
||||
|
@ -5072,8 +5103,19 @@ void PartPlateList::init_bed_type_info()
|
|||
bed_texture_info[btPTE].parts.push_back(pte_part1);
|
||||
bed_texture_info[btPTE].parts.push_back(pte_part2);
|
||||
|
||||
auto bed_ext = get_extents(m_shape);
|
||||
int bed_width = bed_ext.size()(0);
|
||||
int bed_height = bed_ext.size()(1);
|
||||
float base_width = 256;
|
||||
float base_height = 256;
|
||||
float x_rate = bed_width / base_width;
|
||||
float y_rate = bed_height / base_height;
|
||||
for (int i = 0; i < btCount; i++) {
|
||||
for (int j = 0; j < bed_texture_info[i].parts.size(); j++) {
|
||||
bed_texture_info[i].parts[j].x *= x_rate;
|
||||
bed_texture_info[i].parts[j].y *= y_rate;
|
||||
bed_texture_info[i].parts[j].w *= x_rate;
|
||||
bed_texture_info[i].parts[j].h *= y_rate;
|
||||
bed_texture_info[i].parts[j].update_buffer();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,6 +144,7 @@ private:
|
|||
GLUquadricObject* m_quadric;
|
||||
int m_hover_id;
|
||||
bool m_selected;
|
||||
int m_timelapse_warning_code = 0;
|
||||
|
||||
// BBS
|
||||
DynamicPrintConfig m_config;
|
||||
|
@ -263,6 +264,9 @@ public:
|
|||
//set the plate's name
|
||||
void set_plate_name(const std::string& name);
|
||||
|
||||
void set_timelapse_warning_code(int code) { m_timelapse_warning_code = code; }
|
||||
int timelapse_warning_code() { return m_timelapse_warning_code; }
|
||||
|
||||
//get the print's object, result and index
|
||||
void get_print(PrintBase **print, GCodeResult **result, int *index);
|
||||
|
||||
|
@ -560,16 +564,16 @@ public:
|
|||
class TexturePart {
|
||||
public:
|
||||
// position
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
float x;
|
||||
float y;
|
||||
float w;
|
||||
float h;
|
||||
unsigned int vbo_id;
|
||||
std::string filename;
|
||||
GLTexture* texture { nullptr };
|
||||
Vec2d offset;
|
||||
GeometryBuffer* buffer { nullptr };
|
||||
TexturePart(int xx, int yy, int ww, int hh, std::string file) {
|
||||
TexturePart(float xx, float yy, float ww, float hh, std::string file){
|
||||
x = xx; y = yy;
|
||||
w = ww; h = hh;
|
||||
filename = file;
|
||||
|
@ -799,7 +803,8 @@ public:
|
|||
template<class Archive> void serialize(Archive& ar)
|
||||
{
|
||||
//ar(cereal::base_class<ObjectBase>(this));
|
||||
ar(m_shape, m_plate_width, m_plate_depth, m_plate_height, m_height_to_lid, m_height_to_rod, m_height_limit_mode, m_plate_count, m_current_plate, m_plate_list, unprintable_plate);
|
||||
//Cancel undo/redo for m_shape ,Because the printing area of different models is different, currently if the grid changes, it cannot correspond to the model on the left ui
|
||||
ar(m_plate_width, m_plate_depth, m_plate_height, m_height_to_lid, m_height_to_rod, m_height_limit_mode, m_plate_count, m_current_plate, m_plate_list, unprintable_plate);
|
||||
//ar(m_plate_width, m_plate_depth, m_plate_height, m_plate_count, m_current_plate);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <wx/popupwin.h>
|
||||
#endif
|
||||
#include <wx/clrpicker.h>
|
||||
#include <wx/tokenzr.h>
|
||||
|
||||
#include "libslic3r/libslic3r.h"
|
||||
#include "libslic3r/Format/STL.hpp"
|
||||
|
@ -174,7 +175,7 @@ wxDEFINE_EVENT(EVT_INSTALL_PLUGIN_HINT, wxCommandEvent);
|
|||
wxDEFINE_EVENT(EVT_PREVIEW_ONLY_MODE_HINT, wxCommandEvent);
|
||||
//BBS: change light/dark mode
|
||||
wxDEFINE_EVENT(EVT_GLCANVAS_COLOR_MODE_CHANGED, SimpleEvent);
|
||||
//BBS: print
|
||||
//BBS: print
|
||||
wxDEFINE_EVENT(EVT_PRINT_FROM_SDCARD_VIEW, SimpleEvent);
|
||||
|
||||
|
||||
|
@ -1451,7 +1452,7 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_ams_list(MachineObject
|
|||
void Sidebar::load_ams_list(std::string const &device, MachineObject* obj)
|
||||
{
|
||||
std::map<int, DynamicPrintConfig> filament_ams_list = build_filament_ams_list(obj);
|
||||
|
||||
|
||||
if (!obj) {
|
||||
p->ams_list_device = device;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " clear list";
|
||||
|
@ -2333,6 +2334,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||
"enable_support", "support_filament", "support_interface_filament",
|
||||
"support_top_z_distance", "support_bottom_z_distance", "raft_layers",
|
||||
"wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extruder",
|
||||
"best_object_pos"
|
||||
}))
|
||||
, sidebar(new Sidebar(q))
|
||||
, notification_manager(std::make_unique<NotificationManager>(q))
|
||||
|
@ -2569,7 +2571,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||
|
||||
// update slice and print button
|
||||
wxGetApp().mainframe->update_slice_print_status(MainFrame::SlicePrintEventType::eEventSliceUpdate, true, false);
|
||||
update();
|
||||
set_need_update(true);
|
||||
});
|
||||
}
|
||||
if (wxGetApp().is_gcode_viewer())
|
||||
|
@ -2807,97 +2809,6 @@ void Plater::priv::select_view(const std::string& direction)
|
|||
assemble_view->select_view(direction);
|
||||
}
|
||||
}
|
||||
// BBS set print speed table and find maximum speed
|
||||
void Plater::setPrintSpeedTable(GlobalSpeedMap &printSpeedMap) {
|
||||
Slic3r::DynamicPrintConfig config = wxGetApp().preset_bundle->full_config();
|
||||
printSpeedMap.maxSpeed = 0;
|
||||
if (config.has("inner_wall_speed")) {
|
||||
printSpeedMap.perimeterSpeed = config.opt_float("inner_wall_speed");
|
||||
if (printSpeedMap.perimeterSpeed > printSpeedMap.maxSpeed)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.perimeterSpeed;
|
||||
}
|
||||
if (config.has("outer_wall_speed")) {
|
||||
printSpeedMap.externalPerimeterSpeed = config.opt_float("outer_wall_speed");
|
||||
printSpeedMap.maxSpeed = std::max(printSpeedMap.maxSpeed, printSpeedMap.externalPerimeterSpeed);
|
||||
}
|
||||
if (config.has("sparse_infill_speed")) {
|
||||
printSpeedMap.infillSpeed = config.opt_float("sparse_infill_speed");
|
||||
if (printSpeedMap.infillSpeed > printSpeedMap.maxSpeed)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.infillSpeed;
|
||||
}
|
||||
if (config.has("internal_solid_infill_speed")) {
|
||||
printSpeedMap.solidInfillSpeed = config.opt_float("internal_solid_infill_speed");
|
||||
if (printSpeedMap.solidInfillSpeed > printSpeedMap.maxSpeed)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.solidInfillSpeed;
|
||||
}
|
||||
if (config.has("top_surface_speed")) {
|
||||
printSpeedMap.topSolidInfillSpeed = config.opt_float("top_surface_speed");
|
||||
if (printSpeedMap.topSolidInfillSpeed > printSpeedMap.maxSpeed)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.topSolidInfillSpeed;
|
||||
}
|
||||
if (config.has("support_speed")) {
|
||||
printSpeedMap.supportSpeed = config.opt_float("support_speed");
|
||||
|
||||
if (printSpeedMap.supportSpeed > printSpeedMap.maxSpeed)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.supportSpeed;
|
||||
}
|
||||
if (config.has("small_perimeter_speed")) {
|
||||
printSpeedMap.smallPerimeterSpeed = config.get_abs_value("small_perimeter_speed");
|
||||
|
||||
if (printSpeedMap.smallPerimeterSpeed > printSpeedMap.maxSpeed)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.smallPerimeterSpeed;
|
||||
}
|
||||
/* "inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed",
|
||||
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
|
||||
"bridge_speed", "gap_infill_speed", "travel_speed", "initial_layer_speed"*/
|
||||
|
||||
auto& print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
|
||||
auto print_config = print.config();
|
||||
printSpeedMap.bed_poly.points = get_bed_shape(*(wxGetApp().plater()->config()));
|
||||
Pointfs excluse_area_points = print_config.bed_exclude_area.values;
|
||||
Polygons exclude_polys;
|
||||
Polygon exclude_poly;
|
||||
for (int i = 0; i < excluse_area_points.size(); i++) {
|
||||
auto pt = excluse_area_points[i];
|
||||
exclude_poly.points.emplace_back(scale_(pt.x()), scale_(pt.y()));
|
||||
if (i % 4 == 3) { // exclude areas are always rectangle
|
||||
exclude_polys.push_back(exclude_poly);
|
||||
exclude_poly.points.clear();
|
||||
}
|
||||
}
|
||||
printSpeedMap.bed_poly = diff({ printSpeedMap.bed_poly }, exclude_polys)[0];
|
||||
}
|
||||
|
||||
// find temperature of heatend and bed and matierial of an given extruder
|
||||
void Plater::setExtruderParams(std::map<size_t, Slic3r::ExtruderParams>& extParas) {
|
||||
extParas.clear();
|
||||
Slic3r::DynamicPrintConfig config = wxGetApp().preset_bundle->full_config();
|
||||
// BBS
|
||||
int numExtruders = wxGetApp().preset_bundle->filament_presets.size();
|
||||
for (unsigned int i = 0; i != numExtruders; ++i) {
|
||||
std::string matName = "";
|
||||
// BBS
|
||||
int bedTemp = 35;
|
||||
double endTemp = 0.f;
|
||||
if (config.has("filament_type")) {
|
||||
matName = config.opt_string("filament_type", i);
|
||||
}
|
||||
if (config.has("nozzle_temperature")) {
|
||||
endTemp = config.opt_int("nozzle_temperature", i);
|
||||
}
|
||||
|
||||
// FIXME: curr_bed_type is now a plate config rather than a global config.
|
||||
// Currently bed temp is not used for brim generation, so just comment it for now.
|
||||
#if 0
|
||||
if (config.has("curr_bed_type")) {
|
||||
BedType curr_bed_type = config.opt_enum<BedType>("curr_bed_type");
|
||||
bedTemp = config.opt_int(get_bed_temp_key(curr_bed_type), i);
|
||||
}
|
||||
#endif
|
||||
if (i == 0) extParas.insert({ i,{matName, bedTemp, endTemp} });
|
||||
extParas.insert({ i + 1,{matName, bedTemp, endTemp} });
|
||||
}
|
||||
}
|
||||
|
||||
wxColour Plater::get_next_color_for_filament()
|
||||
{
|
||||
|
@ -2930,7 +2841,12 @@ wxString Plater::get_slice_warning_string(GCodeProcessorResult::SliceWarning& wa
|
|||
return _L("The bed temperature exceeds filament's vitrification temperature. Please open the front door of printer before printing to avoid nozzle clog.");
|
||||
} else if (warning.msg == NOZZLE_HRC_CHECKER) {
|
||||
return _L("The nozzle hardness required by the filament is higher than the default nozzle hardness of the printer. Please replace the hardened nozzle or filament, otherwise, the nozzle will be attrited or damaged.");
|
||||
} else {
|
||||
} else if (warning.msg == NOT_SUPPORT_TRADITIONAL_TIMELAPSE) {
|
||||
return _L("Enabling traditional timelapse photography may cause surface imperfections. It is recommended to change to smooth mode.");
|
||||
} else if (warning.msg == NOT_GENERATE_TIMELAPSE) {
|
||||
return wxString();
|
||||
}
|
||||
else {
|
||||
return wxString(warning.msg);
|
||||
}
|
||||
}
|
||||
|
@ -2963,8 +2879,13 @@ void Plater::priv::select_view_3D(const std::string& name, bool no_slice)
|
|||
else if (name == "Preview") {
|
||||
BOOST_LOG_TRIVIAL(info) << "select preview";
|
||||
//BBS update extruder params and speed table before slicing
|
||||
Plater::setExtruderParams(Slic3r::Model::extruderParamsMap);
|
||||
Plater::setPrintSpeedTable(Slic3r::Model::printSpeedMap);
|
||||
const Slic3r::DynamicPrintConfig& config = wxGetApp().preset_bundle->full_config();
|
||||
auto& print = q->get_partplate_list().get_current_fff_print();
|
||||
auto print_config = print.config();
|
||||
int numExtruders = wxGetApp().preset_bundle->filament_presets.size();
|
||||
|
||||
Model::setExtruderParams(config, numExtruders);
|
||||
Model::setPrintSpeedTable(config, print_config);
|
||||
set_current_panel(preview, no_slice);
|
||||
}
|
||||
else if (name == "Assemble") {
|
||||
|
@ -4853,7 +4774,7 @@ bool Plater::priv::replace_volume_with_stl(int object_idx, int volume_idx, const
|
|||
|
||||
Model new_model;
|
||||
try {
|
||||
new_model = Model::read_from_file(path, nullptr, nullptr, LoadStrategy::AddDefaultInstances);
|
||||
new_model = Model::read_from_file(path, nullptr, nullptr, LoadStrategy::AddDefaultInstances | LoadStrategy::LoadModel);
|
||||
for (ModelObject* model_object : new_model.objects) {
|
||||
model_object->center_around_origin();
|
||||
model_object->ensure_on_bed();
|
||||
|
@ -5876,7 +5797,11 @@ void Plater::priv::on_slicing_update(SlicingStatusEvent &evt)
|
|||
// Now process state.warnings.
|
||||
for (auto const& warning : state.warnings) {
|
||||
if (warning.current) {
|
||||
notification_manager->push_slicing_warning_notification(warning.message, false, model_object, object_id, warning_step, warning.message_id);
|
||||
NotificationManager::NotificationLevel notif_level = NotificationManager::NotificationLevel::WarningNotificationLevel;
|
||||
if (evt.status.message_type == PrintStateBase::SlicingNotificationType::SlicingReplaceInitEmptyLayers | PrintStateBase::SlicingNotificationType::SlicingEmptyGcodeLayers) {
|
||||
notif_level = NotificationManager::NotificationLevel::SeriousWarningNotificationLevel;
|
||||
}
|
||||
notification_manager->push_slicing_warning_notification(warning.message, false, model_object, object_id, warning_step, warning.message_id, notif_level);
|
||||
add_warning(warning, object_id.id);
|
||||
}
|
||||
}
|
||||
|
@ -6045,8 +5970,8 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt)
|
|||
}
|
||||
} else {
|
||||
std::vector<const ModelObject *> ptrs;
|
||||
for (auto oid : message.second)
|
||||
{
|
||||
for (auto oid : message.second)
|
||||
{
|
||||
const PrintObject *print_object = this->background_process.m_fff_print->get_object(ObjectID(oid));
|
||||
if (print_object) { ptrs.push_back(print_object->model_object()); }
|
||||
}
|
||||
|
@ -6258,8 +6183,13 @@ void Plater::priv::on_action_slice_plate(SimpleEvent&)
|
|||
if (q != nullptr) {
|
||||
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":received slice plate event\n" ;
|
||||
//BBS update extruder params and speed table before slicing
|
||||
Plater::setExtruderParams(Slic3r::Model::extruderParamsMap);
|
||||
Plater::setPrintSpeedTable(Slic3r::Model::printSpeedMap);
|
||||
const Slic3r::DynamicPrintConfig& config = wxGetApp().preset_bundle->full_config();
|
||||
auto& print = q->get_partplate_list().get_current_fff_print();
|
||||
auto print_config = print.config();
|
||||
int numExtruders = wxGetApp().preset_bundle->filament_presets.size();
|
||||
|
||||
Model::setExtruderParams(config, numExtruders);
|
||||
Model::setPrintSpeedTable(config, print_config);
|
||||
m_slice_all = false;
|
||||
q->reslice();
|
||||
q->select_view_3D("Preview");
|
||||
|
@ -6272,8 +6202,13 @@ void Plater::priv::on_action_slice_all(SimpleEvent&)
|
|||
if (q != nullptr) {
|
||||
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":received slice project event\n" ;
|
||||
//BBS update extruder params and speed table before slicing
|
||||
Plater::setExtruderParams(Slic3r::Model::extruderParamsMap);
|
||||
Plater::setPrintSpeedTable(Slic3r::Model::printSpeedMap);
|
||||
const Slic3r::DynamicPrintConfig& config = wxGetApp().preset_bundle->full_config();
|
||||
auto& print = q->get_partplate_list().get_current_fff_print();
|
||||
auto print_config = print.config();
|
||||
int numExtruders = wxGetApp().preset_bundle->filament_presets.size();
|
||||
|
||||
Model::setExtruderParams(config, numExtruders);
|
||||
Model::setPrintSpeedTable(config, print_config);
|
||||
m_slice_all = true;
|
||||
m_slice_all_only_has_gcode = true;
|
||||
m_cur_slice_plate = 0;
|
||||
|
@ -7642,10 +7577,10 @@ void Plater::priv::update_after_undo_redo(const UndoRedo::Snapshot& snapshot, bo
|
|||
// triangle meshes may have gotten released from the scene or the background processing, therefore now being calculated into the Undo / Redo stack size.
|
||||
this->undo_redo_stack().release_least_recently_used();
|
||||
//YS_FIXME update obj_list from the deserialized model (maybe store ObjectIDs into the tree?) (no selections at this point of time)
|
||||
get_current_canvas3D()->get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
|
||||
get_current_canvas3D()->get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
|
||||
assemble_view->get_canvas3d()->get_selection().set_deserialized(GUI::Selection::EMode(this->undo_redo_stack().selection_deserialized().mode), this->undo_redo_stack().selection_deserialized().volumes_and_instances) :
|
||||
this->view3D->get_canvas3d()->get_selection().set_deserialized(GUI::Selection::EMode(this->undo_redo_stack().selection_deserialized().mode), this->undo_redo_stack().selection_deserialized().volumes_and_instances);
|
||||
get_current_canvas3D()->get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
|
||||
get_current_canvas3D()->get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
|
||||
assemble_view->get_canvas3d()->get_gizmos_manager().update_after_undo_redo(snapshot) :
|
||||
this->view3D->get_canvas3d()->get_gizmos_manager().update_after_undo_redo(snapshot);
|
||||
|
||||
|
@ -8039,26 +7974,25 @@ int Plater::save_project(bool saveAs)
|
|||
//BBS import model by model id
|
||||
void Plater::import_model_id(wxString download_info)
|
||||
{
|
||||
//std::string download_origin_url = wxGetApp().url_decode(download_info.ToStdString());
|
||||
|
||||
std::string download_origin_url = download_info.ToStdString();
|
||||
std::string download_url;
|
||||
std::string filename;
|
||||
wxString download_origin_url = download_info;
|
||||
wxString download_url;
|
||||
wxString filename;
|
||||
wxString separator = "&name=";
|
||||
|
||||
try
|
||||
{
|
||||
std::vector<std::string> origin_array = wxGetApp().split_str(download_origin_url, "&name=");
|
||||
if (origin_array.size() >= 2) {
|
||||
size_t namePos = download_info.Find(separator);
|
||||
if (namePos != wxString::npos) {
|
||||
download_url = download_info.Mid(0, namePos);
|
||||
filename = download_info.Mid(namePos + separator.Length());
|
||||
|
||||
download_url = origin_array[0];
|
||||
filename = origin_array[1];
|
||||
}
|
||||
else if (!download_origin_url.empty()) {
|
||||
|
||||
fs::path download_path = fs::path(download_origin_url);
|
||||
else {
|
||||
fs::path download_path = fs::path(download_origin_url.wx_str());
|
||||
download_url = download_origin_url;
|
||||
filename = download_path.filename().string();
|
||||
}
|
||||
|
||||
}
|
||||
catch (const std::exception& error)
|
||||
{
|
||||
|
@ -8066,7 +8000,8 @@ void Plater::import_model_id(wxString download_info)
|
|||
}
|
||||
|
||||
bool download_ok = false;
|
||||
/* save to a file */
|
||||
int retry_count = 0;
|
||||
const int max_retries = 3;
|
||||
|
||||
/* jump to 3D eidtor */
|
||||
wxGetApp().mainframe->select_tab((size_t)MainFrame::TabPosition::tp3DEditor);
|
||||
|
@ -8094,7 +8029,7 @@ void Plater::import_model_id(wxString download_info)
|
|||
p->project.reset();
|
||||
|
||||
/* prepare project and profile */
|
||||
boost::thread import_thread = Slic3r::create_thread([&percent, &cont, &cancel, &msg, &target_path, &download_ok, download_url, &filename] {
|
||||
boost::thread import_thread = Slic3r::create_thread([&percent, &cont, &cancel, &retry_count, max_retries, &msg, &target_path, &download_ok, download_url, &filename] {
|
||||
|
||||
NetworkAgent* m_agent = Slic3r::GUI::wxGetApp().getAgent();
|
||||
if (!m_agent) return;
|
||||
|
@ -8115,7 +8050,7 @@ void Plater::import_model_id(wxString download_info)
|
|||
try
|
||||
{
|
||||
vecFiles.clear();
|
||||
wxString extension = fs::path(filename).extension().c_str();
|
||||
wxString extension = fs::path(filename.wx_str()).extension().c_str();
|
||||
auto name = filename.substr(0, filename.length() - extension.length() - 1);
|
||||
|
||||
for (const auto& iter : boost::filesystem::directory_iterator(target_path))
|
||||
|
@ -8138,7 +8073,7 @@ void Plater::import_model_id(wxString download_info)
|
|||
|
||||
//update filename
|
||||
if (is_already_exist && vecFiles.size() >= 1) {
|
||||
wxString extension = fs::path(filename).extension().c_str();
|
||||
wxString extension = fs::path(filename.wx_str()).extension().c_str();
|
||||
wxString name = filename.substr(0, filename.length() - extension.length());
|
||||
filename = wxString::Format("%s(%d)%s", name, vecFiles.size() + 1, extension).ToStdString();
|
||||
}
|
||||
|
@ -8158,43 +8093,49 @@ void Plater::import_model_id(wxString download_info)
|
|||
}
|
||||
|
||||
//target_path /= (boost::format("%1%_%2%.3mf") % filename % unique).str();
|
||||
target_path /= fs::path(wxString(filename).wc_str());
|
||||
target_path /= fs::path(filename.wc_str());
|
||||
|
||||
fs::path tmp_path = target_path;
|
||||
tmp_path += format(".%1%", ".download");
|
||||
|
||||
auto url = download_url;
|
||||
auto http = Http::get(url);
|
||||
http.on_progress([&percent, &cont, &msg](Http::Progress progress, bool& cancel) {
|
||||
if (!cont) cancel = true;
|
||||
if (progress.dltotal != 0) {
|
||||
percent = progress.dlnow * 100 / progress.dltotal;
|
||||
}
|
||||
msg = wxString::Format(_L("Project downloaded %d%%"), percent);
|
||||
})
|
||||
.on_error([&msg, &cont](std::string body, std::string error, unsigned http_status) {
|
||||
(void)body;
|
||||
BOOST_LOG_TRIVIAL(error) << format("Error getting: `%1%`: HTTP %2%, %3%",
|
||||
body,
|
||||
http_status,
|
||||
error);
|
||||
msg = wxString::Format("Download Failed! body=%s, error=%s, status=%d", body, error, http_status);
|
||||
cont = false;
|
||||
return;
|
||||
|
||||
auto http = Http::get(download_url.ToStdString());
|
||||
|
||||
while (cont && retry_count < max_retries) {
|
||||
retry_count++;
|
||||
http.on_progress([&percent, &cont, &msg](Http::Progress progress, bool& cancel) {
|
||||
if (!cont) cancel = true;
|
||||
if (progress.dltotal != 0) {
|
||||
percent = progress.dlnow * 100 / progress.dltotal;
|
||||
}
|
||||
msg = wxString::Format(_L("Project downloaded %d%%"), percent);
|
||||
})
|
||||
.on_error([&msg, &cont, &retry_count, max_retries](std::string body, std::string error, unsigned http_status) {
|
||||
(void)body;
|
||||
BOOST_LOG_TRIVIAL(error) << format("Error getting: `%1%`: HTTP %2%, %3%",
|
||||
body,
|
||||
http_status,
|
||||
error);
|
||||
|
||||
if (retry_count == max_retries) {
|
||||
msg = _L("Importing to Bambu Studio failed. Please download the file and manually import it.");
|
||||
cont = false;
|
||||
}
|
||||
})
|
||||
.on_complete([&cont, &download_ok, tmp_path, target_path](std::string body, unsigned /* http_status */) {
|
||||
fs::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc);
|
||||
file.write(body.c_str(), body.size());
|
||||
file.close();
|
||||
fs::rename(tmp_path, target_path);
|
||||
cont = false;
|
||||
download_ok = true;
|
||||
})
|
||||
.perform_sync();
|
||||
fs::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc);
|
||||
file.write(body.c_str(), body.size());
|
||||
file.close();
|
||||
fs::rename(tmp_path, target_path);
|
||||
cont = false;
|
||||
download_ok = true;
|
||||
}).perform_sync();
|
||||
|
||||
// for break while
|
||||
cont = false;
|
||||
});
|
||||
// for break while
|
||||
//cont = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
while (cont && cont_dlg) {
|
||||
wxMilliSleep(50);
|
||||
|
@ -8216,8 +8157,7 @@ void Plater::import_model_id(wxString download_info)
|
|||
if (download_ok) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "import_model_id: target_path = " << target_path.string();
|
||||
/* load project */
|
||||
this->load_project(encode_path(target_path.string().c_str()));
|
||||
|
||||
this->load_project(target_path.wstring());
|
||||
/*BBS set project info after load project, project info is reset in load project */
|
||||
//p->project.project_model_id = model_id;
|
||||
//p->project.project_design_id = design_id;
|
||||
|
@ -8227,10 +8167,15 @@ void Plater::import_model_id(wxString download_info)
|
|||
}
|
||||
|
||||
// show save new project
|
||||
p->set_project_filename(wxString(filename));
|
||||
p->set_project_filename(filename);
|
||||
p->notification_manager->push_import_finished_notification(target_path.string(), target_path.parent_path().string(), false);
|
||||
}
|
||||
else {
|
||||
if (!msg.empty()) wxMessageBox(msg);
|
||||
if (!msg.empty()) {
|
||||
MessageDialog msg_wingow(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_wingow.SetSize(wxSize(FromDIP(480), -1));
|
||||
msg_wingow.ShowModal();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -9598,16 +9543,17 @@ void Plater::add_file()
|
|||
}
|
||||
}
|
||||
|
||||
void Plater::update(bool conside_update_flag)
|
||||
void Plater::update(bool conside_update_flag, bool force_background_processing_update)
|
||||
{
|
||||
unsigned int flag = force_background_processing_update ? (unsigned int)Plater::priv::UpdateParams::FORCE_BACKGROUND_PROCESSING_UPDATE : 0;
|
||||
if (conside_update_flag) {
|
||||
if (need_update()) {
|
||||
p->update();
|
||||
p->update(flag);
|
||||
p->set_need_update(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
p->update();
|
||||
p->update(flag);
|
||||
}
|
||||
|
||||
void Plater::object_list_changed() { p->object_list_changed(); }
|
||||
|
@ -11085,7 +11031,7 @@ void Plater::print_job_finished(wxCommandEvent &evt)
|
|||
p->enter_prepare_mode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return;
|
||||
|
||||
|
@ -11220,7 +11166,7 @@ void Plater::on_filaments_change(size_t num_filaments)
|
|||
for (int i = 0; i < plate_list.get_plate_count(); ++i) {
|
||||
PartPlate* part_plate = plate_list.get_plate(i);
|
||||
part_plate->update_first_layer_print_sequence(num_filaments);
|
||||
}
|
||||
}
|
||||
|
||||
for (ModelObject* mo : wxGetApp().model().objects) {
|
||||
for (ModelVolume* mv : mo->volumes) {
|
||||
|
@ -11481,7 +11427,7 @@ void Plater::update_print_error_info(int code, std::string msg, std::string extr
|
|||
if (p->main_frame->m_calibration)
|
||||
p->main_frame->m_calibration->update_print_error_info(code, msg, extra);
|
||||
}
|
||||
|
||||
|
||||
wxString Plater::get_project_filename(const wxString& extension) const
|
||||
{
|
||||
return p->get_project_filename(extension);
|
||||
|
@ -12299,7 +12245,7 @@ int Plater::select_plate_by_hover_id(int hover_id, bool right_click, bool isModi
|
|||
if (!ret) {
|
||||
PlateNameEditDialog dlg(this, wxID_ANY, _L("Edit Plate Name"));
|
||||
PartPlate * curr_plate = p->partplate_list.get_curr_plate();
|
||||
|
||||
|
||||
wxString curr_plate_name = from_u8(curr_plate->get_plate_name());
|
||||
dlg.set_plate_name(curr_plate_name);
|
||||
|
||||
|
|
|
@ -259,9 +259,7 @@ public:
|
|||
void update_all_plate_thumbnails(bool force_update = false);
|
||||
void invalid_all_plate_thumbnails();
|
||||
void force_update_all_plate_thumbnails();
|
||||
//BBS static functions that update extruder params and speed table
|
||||
static void setPrintSpeedTable(Slic3r::GlobalSpeedMap& printSpeedMap);
|
||||
static void setExtruderParams(std::map<size_t, Slic3r::ExtruderParams>& extParas);
|
||||
|
||||
static wxColour get_next_color_for_filament();
|
||||
static wxString get_slice_warning_string(GCodeProcessorResult::SliceWarning& warning);
|
||||
|
||||
|
@ -274,7 +272,7 @@ public:
|
|||
|
||||
const wxString& get_last_loaded_gcode() const { return m_last_loaded_gcode; }
|
||||
|
||||
void update(bool conside_update_flag = false);
|
||||
void update(bool conside_update_flag = false, bool force_background_processing_update = false);
|
||||
//BBS
|
||||
void object_list_changed();
|
||||
void stop_jobs();
|
||||
|
@ -292,7 +290,7 @@ public:
|
|||
|
||||
bool is_view3D_overhang_shown() const;
|
||||
void show_view3D_overhang(bool show);
|
||||
|
||||
|
||||
bool is_sidebar_collapsed() const;
|
||||
void collapse_sidebar(bool show);
|
||||
|
||||
|
|
|
@ -55,6 +55,12 @@ PrintOptionsDialog::PrintOptionsDialog(wxWindow* parent)
|
|||
}
|
||||
evt.Skip();
|
||||
});
|
||||
m_cb_sup_sound->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) {
|
||||
if (obj) {
|
||||
obj->command_xcam_control_allow_prompt_sound(m_cb_sup_sound->GetValue());
|
||||
}
|
||||
evt.Skip();
|
||||
});
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
@ -131,14 +137,23 @@ void PrintOptionsDialog::update_options(MachineObject* obj_)
|
|||
m_cb_auto_recovery->Hide();
|
||||
line4->Hide();
|
||||
}
|
||||
if (obj_->is_function_supported(PrinterFunction::FUNC_PROMPT_SOUND)) {
|
||||
text_sup_sound->Show();
|
||||
m_cb_sup_sound->Show();
|
||||
line5->Show();
|
||||
}
|
||||
else {
|
||||
text_sup_sound->Hide();
|
||||
m_cb_sup_sound->Hide();
|
||||
line5->Hide();
|
||||
}
|
||||
|
||||
this->Freeze();
|
||||
auto test1 = obj_->xcam_first_layer_inspector;
|
||||
auto test2 = obj_->xcam_buildplate_marker_detector;
|
||||
auto test3 = obj_->xcam_auto_recovery_step_loss;
|
||||
|
||||
m_cb_first_layer->SetValue(obj_->xcam_first_layer_inspector);
|
||||
m_cb_plate_mark->SetValue(obj_->xcam_buildplate_marker_detector);
|
||||
m_cb_auto_recovery->SetValue(obj_->xcam_auto_recovery_step_loss);
|
||||
m_cb_sup_sound->SetValue(obj_->xcam_allow_prompt_sound);
|
||||
|
||||
m_cb_ai_monitoring->SetValue(obj_->xcam_ai_monitoring);
|
||||
for (auto i = AiMonitorSensitivityLevel::LOW; i < LEVELS_NUM; i = (AiMonitorSensitivityLevel) (i + 1)) {
|
||||
|
@ -256,6 +271,22 @@ wxBoxSizer* PrintOptionsDialog::create_settings_group(wxWindow* parent)
|
|||
sizer->Add(line4, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
|
||||
sizer->Add(0,0,0,wxTOP, FromDIP(20));
|
||||
|
||||
//Allow prompt sound
|
||||
line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_cb_sup_sound = new CheckBox(parent);
|
||||
text_sup_sound = new wxStaticText(parent, wxID_ANY, _L("Allow Prompt Sound"));
|
||||
text_sup_sound->SetFont(Label::Body_14);
|
||||
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
||||
line_sizer->Add(m_cb_sup_sound, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
||||
line_sizer->Add(text_sup_sound, 1, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
||||
sizer->Add(0, 0, 0, wxTOP, FromDIP(15));
|
||||
sizer->Add(line_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(18));
|
||||
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
||||
|
||||
line5 = new StaticLine(parent, false);
|
||||
line5->SetLineColour(STATIC_BOX_LINE_COL);
|
||||
sizer->Add(line5, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
|
||||
|
||||
ai_monitoring_level_list->Connect( wxEVT_COMBOBOX, wxCommandEventHandler(PrintOptionsDialog::set_ai_monitor_sensitivity), NULL, this );
|
||||
|
||||
return sizer;
|
||||
|
|
|
@ -26,6 +26,7 @@ protected:
|
|||
CheckBox* m_cb_ai_monitoring;
|
||||
CheckBox* m_cb_plate_mark;
|
||||
CheckBox* m_cb_auto_recovery;
|
||||
CheckBox* m_cb_sup_sound;
|
||||
wxStaticText* text_first_layer;
|
||||
wxStaticText* text_ai_monitoring;
|
||||
wxStaticText* text_ai_monitoring_caption;
|
||||
|
@ -33,10 +34,12 @@ protected:
|
|||
wxStaticText* text_plate_mark;
|
||||
wxStaticText* text_plate_mark_caption;
|
||||
wxStaticText* text_auto_recovery;
|
||||
wxStaticText* text_sup_sound;
|
||||
StaticLine* line1;
|
||||
StaticLine* line2;
|
||||
StaticLine* line3;
|
||||
StaticLine* line4;
|
||||
StaticLine* line5;
|
||||
wxBoxSizer* create_settings_group(wxWindow* parent);
|
||||
|
||||
bool print_halt = false;
|
||||
|
|
|
@ -310,11 +310,18 @@ std::map<std::string, std::vector<json>> ProjectPanel::Reload(wxString aux_path)
|
|||
pfile_obj["filename"] = wxGetApp().url_encode(file_path_obj.filename().string().c_str());
|
||||
pfile_obj["size"] = formatBytes((unsigned long)filelen);
|
||||
|
||||
std::string file_extension = file_path_obj.extension().string();
|
||||
boost::algorithm::to_lower(file_extension);
|
||||
|
||||
//image
|
||||
if (file_path_obj.extension() == ".jpg" ||
|
||||
file_path_obj.extension() == ".jpeg" ||
|
||||
file_path_obj.extension() == ".png" ||
|
||||
file_path_obj.extension() == ".bmp")
|
||||
if (file_extension == ".jpg" ||
|
||||
file_extension == ".jpeg" ||
|
||||
file_extension == ".pjpeg" ||
|
||||
file_extension == ".png" ||
|
||||
file_extension == ".jfif" ||
|
||||
file_extension == ".pjp" ||
|
||||
file_extension == ".webp" ||
|
||||
file_extension == ".bmp")
|
||||
{
|
||||
|
||||
wxString base64_str = to_base64(file_path);
|
||||
|
@ -343,25 +350,29 @@ std::string ProjectPanel::formatBytes(unsigned long bytes)
|
|||
|
||||
wxString ProjectPanel::to_base64(std::string file_path)
|
||||
{
|
||||
std::map<std::string, wxBitmapType> base64_format;
|
||||
base64_format[".jpg"] = wxBITMAP_TYPE_JPEG;
|
||||
base64_format[".jpeg"] = wxBITMAP_TYPE_JPEG;
|
||||
base64_format[".png"] = wxBITMAP_TYPE_PNG;
|
||||
base64_format[".bmp"] = wxBITMAP_TYPE_BMP;
|
||||
std::ifstream imageFile(encode_path(file_path.c_str()), std::ios::binary);
|
||||
if (!imageFile) {
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
std::string extension = file_path.substr(file_path.rfind("."), file_path.length());
|
||||
std::ostringstream imageStream;
|
||||
imageStream << imageFile.rdbuf();
|
||||
|
||||
auto image = new wxImage(encode_path(file_path.c_str()));
|
||||
wxMemoryOutputStream mem;
|
||||
image->SaveFile(mem, base64_format[extension]);
|
||||
std::string binaryImageData = imageStream.str();
|
||||
|
||||
std::string extension;
|
||||
size_t last_dot = file_path.find_last_of(".");
|
||||
|
||||
if (last_dot != std::string::npos) {
|
||||
extension = file_path.substr(last_dot + 1);
|
||||
}
|
||||
|
||||
wxString bease64_head = wxString::Format("data:image/%s;base64,", extension);
|
||||
|
||||
wxString km = wxBase64Encode(mem.GetOutputStreamBuffer()->GetBufferStart(),
|
||||
mem.GetSize());
|
||||
|
||||
std::wstringstream wss;
|
||||
wss << L"data:image/jpg;base64,";
|
||||
//wss << wxBase64Encode(km.data(), km.size());
|
||||
wss << km;
|
||||
wss << bease64_head;
|
||||
wss << wxBase64Encode(binaryImageData.data(), binaryImageData.size());
|
||||
|
||||
wxString base64_str = wss.str();
|
||||
return base64_str;
|
||||
|
|
|
@ -225,14 +225,14 @@ void MachineObjectPanel::doRender(wxDC &dc)
|
|||
}
|
||||
auto sizet = dc.GetTextExtent(dev_name);
|
||||
auto text_end = 0;
|
||||
|
||||
|
||||
if (m_show_edit) {
|
||||
text_end = size.x - m_unbind_img.GetBmpSize().x - 30;
|
||||
}
|
||||
else {
|
||||
text_end = size.x - m_unbind_img.GetBmpSize().x;
|
||||
}
|
||||
|
||||
|
||||
wxString finally_name = dev_name;
|
||||
if (sizet.x > (text_end - left)) {
|
||||
auto limit_width = text_end - left - dc.GetTextExtent("...").x - 15;
|
||||
|
@ -268,7 +268,7 @@ void MachineObjectPanel::doRender(wxDC &dc)
|
|||
dc.DrawBitmap(m_edit_name_img.bmp(), left, (size.y - m_edit_name_img.GetBmpSize().y) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void MachineObjectPanel::update_machine_info(MachineObject *info, bool is_my_devices)
|
||||
|
@ -867,14 +867,16 @@ void SelectMachinePopup::OnLeftUp(wxMouseEvent &event)
|
|||
static wxString MACHINE_BED_TYPE_STRING[BED_TYPE_COUNT] = {
|
||||
//_L("Auto"),
|
||||
_L("Bambu Cool Plate") + " / " + _L("PLA Plate"),
|
||||
_L("Bamabu Engineering Plate"),
|
||||
_L("Bamabu High Temperature Plate")};
|
||||
_L("Bambu Engineering Plate"),
|
||||
_L("Bambu Smooth PEI Plate") + "/" + _L("High temperature Plate"),
|
||||
_L("Bambu Textured PEI Plate")};
|
||||
|
||||
static std::string MachineBedTypeString[BED_TYPE_COUNT] = {
|
||||
//"auto",
|
||||
"pc",
|
||||
"pei",
|
||||
"pe",
|
||||
"pei",
|
||||
"pte",
|
||||
};
|
||||
|
||||
void SelectMachineDialog::stripWhiteSpace(std::string& str)
|
||||
|
@ -1205,7 +1207,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_sizer_prepare->Add(0, 0, 1, wxTOP, FromDIP(12));
|
||||
|
||||
auto hyperlink_sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
m_hyperlink = new wxHyperlinkCtrl(m_panel_prepare, wxID_ANY, _L("Can't connect to the printer"), wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
|
||||
m_hyperlink = new wxHyperlinkCtrl(m_panel_prepare, wxID_ANY, _L("Click here if you can't connect to the printer"), wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
|
||||
|
||||
hyperlink_sizer->Add(m_hyperlink, 0, wxALIGN_CENTER | wxALL, 5);
|
||||
m_sizer_prepare->Add(hyperlink_sizer, 0, wxALIGN_CENTER | wxALL, 5);
|
||||
|
@ -1297,7 +1299,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_st_txt_error_desc = new Label(m_sw_print_failed_info, wxEmptyString);
|
||||
st_title_error_desc->SetForegroundColour(0x909090);
|
||||
st_title_error_desc_doc->SetForegroundColour(0x909090);
|
||||
m_st_txt_error_desc->SetForegroundColour(0x909090);
|
||||
m_st_txt_error_desc->SetForegroundColour(0x909090);
|
||||
st_title_error_desc->SetFont(::Label::Body_13);
|
||||
st_title_error_desc_doc->SetFont(::Label::Body_13);
|
||||
m_st_txt_error_desc->SetFont(::Label::Body_13);
|
||||
|
@ -1314,7 +1316,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_st_txt_extra_info = new Label(m_sw_print_failed_info, wxEmptyString);
|
||||
st_title_extra_info->SetForegroundColour(0x909090);
|
||||
st_title_extra_info_doc->SetForegroundColour(0x909090);
|
||||
m_st_txt_extra_info->SetForegroundColour(0x909090);
|
||||
m_st_txt_extra_info->SetForegroundColour(0x909090);
|
||||
st_title_extra_info->SetFont(::Label::Body_13);
|
||||
st_title_extra_info_doc->SetFont(::Label::Body_13);
|
||||
m_st_txt_extra_info->SetFont(::Label::Body_13);
|
||||
|
@ -1369,7 +1371,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(11));
|
||||
m_sizer_main->Add(m_statictext_printer_msg, 0, wxALIGN_CENTER_HORIZONTAL, 0);
|
||||
m_sizer_main->Add(0, 1, 0, wxTOP, FromDIP(16));
|
||||
m_sizer_main->Add(m_sizer_select, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(40));
|
||||
m_sizer_main->Add(m_sizer_select, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, FromDIP(30));
|
||||
m_sizer_main->Add(0, 1, 0, wxTOP, FromDIP(10));
|
||||
m_sizer_main->Add(m_line_schedule, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
|
||||
m_sizer_main->Add(m_simplebook, 0, wxALIGN_CENTER_HORIZONTAL, 0);
|
||||
|
@ -1440,7 +1442,7 @@ void SelectMachineDialog::init_bind()
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
m_bitmap_last_plate->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
|
||||
if (m_print_plate_idx > 0) {
|
||||
|
@ -1541,10 +1543,10 @@ wxWindow *SelectMachineDialog::create_ams_checkbox(wxString title, wxWindow *par
|
|||
sizer_checkbox->Add(text, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
enable_ams = new ScalableBitmap(this, "enable_ams", 16);
|
||||
auto img_ams_tip = new wxStaticBitmap(checkbox, wxID_ANY, enable_ams->bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
|
||||
img_ams_tip = new wxStaticBitmap(checkbox, wxID_ANY, enable_ams->bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
|
||||
sizer_checkbox->Add(img_ams_tip, 0, wxALIGN_CENTER | wxLEFT, FromDIP(5));
|
||||
|
||||
img_ams_tip->Bind(wxEVT_ENTER_WINDOW, [this, img_ams_tip](auto& e) {
|
||||
img_ams_tip->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
|
||||
wxPoint img_pos = img_ams_tip->ClientToScreen(wxPoint(0, 0));
|
||||
wxPoint popup_pos(img_pos.x, img_pos.y + img_ams_tip->GetRect().height);
|
||||
m_mapping_tip_popup.Position(popup_pos, wxSize(0, 0));
|
||||
|
@ -1561,7 +1563,6 @@ wxWindow *SelectMachineDialog::create_ams_checkbox(wxString title, wxWindow *par
|
|||
img_ams_tip->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& e) {
|
||||
m_mapping_tip_popup.Dismiss();
|
||||
});
|
||||
ams_tip = img_ams_tip;
|
||||
|
||||
checkbox->SetSizer(sizer_checkbox);
|
||||
checkbox->Layout();
|
||||
|
@ -1637,7 +1638,7 @@ wxWindow *SelectMachineDialog::create_item_checkbox(wxString title, wxWindow *pa
|
|||
config->set_str("print", param, "0");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
text->Bind(wxEVT_LEFT_DOWN, [this, check, param](wxMouseEvent &) {
|
||||
//if (!m_checkbox_state_list[param]) {return;}
|
||||
check->SetValue(check->GetValue() ? false : true);
|
||||
|
@ -1673,15 +1674,17 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj)
|
|||
&& obj->is_support_print_with_timelapse()
|
||||
&& is_show_timelapse()) {
|
||||
select_timelapse->Show();
|
||||
update_timelapse_enable_status();
|
||||
} else {
|
||||
select_timelapse->Hide();
|
||||
}
|
||||
|
||||
m_sizer_select->Layout();
|
||||
Layout();
|
||||
Fit();
|
||||
}
|
||||
|
||||
void SelectMachineDialog::prepare_mode()
|
||||
void SelectMachineDialog::prepare_mode(bool refresh_button)
|
||||
{
|
||||
// disable combobox
|
||||
m_comboBox_printer->Enable();
|
||||
|
@ -1696,7 +1699,9 @@ void SelectMachineDialog::prepare_mode()
|
|||
if (wxIsBusy())
|
||||
wxEndBusyCursor();
|
||||
|
||||
Enable_Send_Button(true);
|
||||
if (refresh_button) {
|
||||
Enable_Send_Button(true);
|
||||
}
|
||||
|
||||
m_status_bar->reset();
|
||||
if (m_simplebook->GetSelection() != 0) {
|
||||
|
@ -1726,7 +1731,7 @@ void SelectMachineDialog::sending_mode()
|
|||
Fit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (m_print_page_mode != PrintPageModeSending) {
|
||||
m_print_page_mode = PrintPageModeSending;
|
||||
for (auto it = m_materialList.begin(); it != m_materialList.end(); it++) {
|
||||
|
@ -2014,12 +2019,6 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
|||
else
|
||||
m_comboBox_printer->Enable();
|
||||
|
||||
// m_panel_warn m_simplebook
|
||||
if (status == PrintDialogStatus::PrintStatusSending) {
|
||||
sending_mode();
|
||||
} else {
|
||||
prepare_mode();
|
||||
}
|
||||
|
||||
// other
|
||||
if (status == PrintDialogStatus::PrintStatusInit) {
|
||||
|
@ -2161,6 +2160,30 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
|||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Refresh_Button(true);
|
||||
} else if (status == PrintDialogStatus::PrintStatusTimelapseWarning) {
|
||||
wxString msg_text;
|
||||
PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
|
||||
for (auto warning : plate->get_slice_result()->warnings) {
|
||||
if (warning.msg == NOT_GENERATE_TIMELAPSE) {
|
||||
if (warning.error_code == "1001C001") {
|
||||
msg_text = _L("When enable spiral vase mode, machines with I3 structure will not generate timelapse videos.");
|
||||
}
|
||||
else if (warning.error_code == "1001C002") {
|
||||
msg_text = _L("When print by object, machines with I3 structure will not generate timelapse videos.");
|
||||
}
|
||||
}
|
||||
}
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(true);
|
||||
Enable_Refresh_Button(true);
|
||||
}
|
||||
|
||||
// m_panel_warn m_simplebook
|
||||
if (status == PrintDialogStatus::PrintStatusSending) {
|
||||
sending_mode();
|
||||
}
|
||||
else {
|
||||
prepare_mode(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2260,14 +2283,23 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
|||
|
||||
|
||||
PartPlate* plate = m_plater->get_partplate_list().get_curr_plate();
|
||||
|
||||
|
||||
for (auto warning : plate->get_slice_result()->warnings) {
|
||||
if (warning.msg == BED_TEMP_TOO_HIGH_THAN_FILAMENT) {
|
||||
if ((obj_->printer_type == "BL-P001" || obj_->printer_type == "BL-P002")) {
|
||||
if ((obj_->get_printer_series() == PrinterSeries::SERIES_X1)) {
|
||||
confirm_text.push_back(Plater::get_slice_warning_string(warning) + "\n");
|
||||
has_slice_warnings = true;
|
||||
}
|
||||
}
|
||||
else if (warning.msg == NOT_SUPPORT_TRADITIONAL_TIMELAPSE) {
|
||||
if (obj_->get_printer_arch() == PrinterArch::ARCH_I3 && m_checkbox_list["timelapse"]->GetValue()) {
|
||||
confirm_text.push_back(Plater::get_slice_warning_string(warning) + "\n");
|
||||
has_slice_warnings = true;
|
||||
}
|
||||
}
|
||||
else if (warning.msg == NOT_GENERATE_TIMELAPSE) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
wxString error_info = Plater::get_slice_warning_string(warning);
|
||||
if (error_info.IsEmpty()) {
|
||||
|
@ -2345,7 +2377,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
|||
else {
|
||||
this->on_send_print();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
confirm_text.push_back(_L("Please click the confirm button if you still want to proceed with printing.") + "\n");
|
||||
|
@ -2939,7 +2971,6 @@ 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_->ams_auto_switch_filament_flag
|
||||
|| !obj_->is_function_supported(PrinterFunction::FUNC_FILAMENT_BACKUP)
|
||||
|
@ -3028,6 +3059,8 @@ void SelectMachineDialog::update_ams_check(MachineObject* obj)
|
|||
&& obj->ams_support_use_ams
|
||||
&& obj->has_ams()) {
|
||||
select_use_ams->Show();
|
||||
if (obj->printer_type == "N1") {img_ams_tip->Hide();}
|
||||
else {img_ams_tip->Show();}
|
||||
} else {
|
||||
select_use_ams->Hide();
|
||||
}
|
||||
|
@ -3144,7 +3177,7 @@ void SelectMachineDialog::update_show_status()
|
|||
}
|
||||
}
|
||||
|
||||
if (is_blocking_printing()) {
|
||||
if (m_print_type == PrintFromType::FROM_NORMAL && is_blocking_printing()) {
|
||||
show_status(PrintDialogStatus::PrintStatusUnsupportedPrinter);
|
||||
return;
|
||||
}
|
||||
|
@ -3173,6 +3206,11 @@ void SelectMachineDialog::update_show_status()
|
|||
}
|
||||
}
|
||||
|
||||
if (has_timelapse_warning()) {
|
||||
show_status(PrintDialogStatus::PrintStatusTimelapseWarning);
|
||||
return;
|
||||
}
|
||||
|
||||
// no ams
|
||||
if (!obj_->has_ams() || !m_checkbox_list["use_ams"]->GetValue()) {
|
||||
if (!has_tips(obj_))
|
||||
|
@ -3239,6 +3277,35 @@ void SelectMachineDialog::update_show_status()
|
|||
}
|
||||
}
|
||||
|
||||
bool SelectMachineDialog::has_timelapse_warning()
|
||||
{
|
||||
PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
|
||||
for (auto warning : plate->get_slice_result()->warnings) {
|
||||
if (warning.msg == NOT_GENERATE_TIMELAPSE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SelectMachineDialog::update_timelapse_enable_status()
|
||||
{
|
||||
AppConfig *config = wxGetApp().app_config;
|
||||
if (!has_timelapse_warning()) {
|
||||
if (!config || config->get("print", "timelapse") == "0")
|
||||
m_checkbox_list["timelapse"]->SetValue(false);
|
||||
else
|
||||
m_checkbox_list["timelapse"]->SetValue(true);
|
||||
select_timelapse->Enable(true);
|
||||
} else {
|
||||
m_checkbox_list["timelapse"]->SetValue(false);
|
||||
select_timelapse->Enable(false);
|
||||
if (config) { config->set_str("print", "timelapse", "0"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SelectMachineDialog::is_show_timelapse()
|
||||
{
|
||||
auto compare_version = [](const std::string &version1, const std::string &version2) -> bool {
|
||||
|
@ -3342,7 +3409,7 @@ void SelectMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
|
|||
enable_ams_mapping->msw_rescale();
|
||||
amsmapping_tip->SetBitmap(enable_ams_mapping->bmp());
|
||||
enable_ams->msw_rescale();
|
||||
ams_tip->SetBitmap(enable_ams->bmp());
|
||||
img_ams_tip->SetBitmap(enable_ams->bmp());
|
||||
|
||||
m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
|
||||
m_button_refresh->SetCornerRadius(FromDIP(12));
|
||||
|
@ -3350,11 +3417,11 @@ void SelectMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
|
|||
m_button_ensure->SetCornerRadius(FromDIP(12));
|
||||
m_status_bar->msw_rescale();
|
||||
|
||||
for (auto checkpire : m_checkbox_list) {
|
||||
for (auto checkpire : m_checkbox_list) {
|
||||
checkpire.second->Rescale();
|
||||
}
|
||||
|
||||
for (auto material1 : m_materialList) {
|
||||
for (auto material1 : m_materialList) {
|
||||
material1.second->item->msw_rescale();
|
||||
}
|
||||
|
||||
|
@ -3435,7 +3502,7 @@ void SelectMachineDialog::set_default()
|
|||
filename = m_plater->get_export_gcode_filename("", true);
|
||||
if (filename.empty()) filename = _L("Untitled");
|
||||
}
|
||||
|
||||
|
||||
fs::path filename_path(filename.c_str());
|
||||
m_current_project_name = wxString::FromUTF8(filename_path.filename().string());
|
||||
|
||||
|
@ -3531,7 +3598,7 @@ void SelectMachineDialog::set_default_normal()
|
|||
std::vector<std::string> materials;
|
||||
std::vector<std::string> brands;
|
||||
std::vector<std::string> display_materials;
|
||||
|
||||
|
||||
auto preset_bundle = wxGetApp().preset_bundle;
|
||||
for (auto filament_name : preset_bundle->filament_presets) {
|
||||
for (auto iter = preset_bundle->filaments.lbegin(); iter != preset_bundle->filaments.end(); iter++) {
|
||||
|
@ -3549,7 +3616,7 @@ void SelectMachineDialog::set_default_normal()
|
|||
}
|
||||
}
|
||||
|
||||
//init MaterialItem
|
||||
//init MaterialItem
|
||||
auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders();
|
||||
BitmapCache bmcache;
|
||||
|
||||
|
@ -3716,8 +3783,8 @@ void SelectMachineDialog::set_default_from_sdcard()
|
|||
materials.push_back(fo.type);
|
||||
brands.push_back(fo.brand);
|
||||
}
|
||||
|
||||
//init MaterialItem
|
||||
|
||||
//init MaterialItem
|
||||
MaterialHash::iterator iter = m_materialList.begin();
|
||||
while (iter != m_materialList.end()) {
|
||||
int id = iter->first;
|
||||
|
@ -3732,7 +3799,7 @@ void SelectMachineDialog::set_default_from_sdcard()
|
|||
m_materialList.clear();
|
||||
m_filaments.clear();
|
||||
|
||||
|
||||
|
||||
for (auto i = 0; i < m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size(); i++) {
|
||||
FilamentInfo fo = m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info[i];
|
||||
|
||||
|
@ -3900,7 +3967,7 @@ bool SelectMachineDialog::Show(bool show)
|
|||
if (obj_->is_connected()) {
|
||||
obj_->disconnect();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -272,7 +272,8 @@ enum PrintDialogStatus {
|
|||
PrintStatusNotSupportedSendToSDCard,
|
||||
PrintStatusNotSupportedPrintAll,
|
||||
PrintStatusBlankPlate,
|
||||
PrintStatusUnsupportedPrinter
|
||||
PrintStatusUnsupportedPrinter,
|
||||
PrintStatusTimelapseWarning
|
||||
};
|
||||
|
||||
std::string get_print_status_info(PrintDialogStatus status);
|
||||
|
@ -385,7 +386,7 @@ protected:
|
|||
ScalableBitmap * print_weight{nullptr};
|
||||
wxStaticBitmap * amsmapping_tip{nullptr};
|
||||
ScalableBitmap * enable_ams_mapping{nullptr};
|
||||
wxStaticBitmap * ams_tip{nullptr};
|
||||
wxStaticBitmap * img_ams_tip{nullptr};
|
||||
wxStaticBitmap * img_ams_backup{nullptr};
|
||||
ScalableBitmap * enable_ams{nullptr};
|
||||
|
||||
|
@ -400,7 +401,7 @@ public:
|
|||
void check_fcous_state(wxWindow* window);
|
||||
void popup_filament_backup();
|
||||
void update_select_layout(MachineObject *obj);
|
||||
void prepare_mode();
|
||||
void prepare_mode(bool refresh_button = true);
|
||||
void sending_mode();
|
||||
void finish_mode();
|
||||
void sync_ams_mapping_result(std::vector<FilamentInfo>& result);
|
||||
|
@ -443,6 +444,8 @@ public:
|
|||
void update_print_error_info(int code, std::string msg, std::string extra);
|
||||
void set_flow_calibration_state(bool state);
|
||||
bool is_show_timelapse();
|
||||
bool has_timelapse_warning();
|
||||
void update_timelapse_enable_status();
|
||||
bool is_same_printer_model();
|
||||
bool is_blocking_printing();
|
||||
bool has_tips(MachineObject* obj);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -61,12 +61,102 @@ enum PrintingTaskType {
|
|||
CALIBRATION,
|
||||
};
|
||||
|
||||
struct ScoreData
|
||||
{
|
||||
int rating_id;
|
||||
int design_id;
|
||||
std::string model_id;
|
||||
int profile_id;
|
||||
int star_count;
|
||||
bool success_printed;
|
||||
wxString comment_text;
|
||||
std::vector<std::string> image_url_paths;
|
||||
std::set<wxString> need_upload_images;
|
||||
std::vector<std::pair<wxString, std::string>> local_to_url_image;
|
||||
};
|
||||
|
||||
typedef std::function<void(BBLModelTask* subtask)> OnGetSubTaskFn;
|
||||
|
||||
class ScoreDialog : public GUI::DPIDialog
|
||||
{
|
||||
public:
|
||||
ScoreDialog(wxWindow *parent, int design_id, std::string model_id, int profile_id, int rating_id, bool success_printed, int star_count = 0);
|
||||
ScoreDialog(wxWindow *parent, ScoreData *score_data);
|
||||
~ScoreDialog();
|
||||
|
||||
int get_rating_id() { return m_rating_id; }
|
||||
ScoreData get_score_data();
|
||||
void set_comment(std::string comment);
|
||||
void set_cloud_bitmap(std::vector<std::string> cloud_bitmaps);
|
||||
|
||||
protected:
|
||||
enum StatusCode {
|
||||
UPLOAD_PROGRESS = 0,
|
||||
UPLOAD_EXIST_ISSUE,
|
||||
UPLOAD_IMG_FAILED,
|
||||
CODE_NUMBER
|
||||
};
|
||||
|
||||
std::shared_ptr<int> m_tocken;
|
||||
const int m_photo_nums = 16;
|
||||
int m_rating_id;
|
||||
int m_design_id;
|
||||
std::string m_model_id;
|
||||
int m_profile_id;
|
||||
int m_star_count;
|
||||
bool m_success_printed;
|
||||
std::vector<std::string> m_image_url_paths;
|
||||
StatusCode m_upload_status_code;
|
||||
|
||||
struct ImageMsg
|
||||
{
|
||||
wxString local_image_url; //local image path
|
||||
std::string img_url_paths; // oss url path
|
||||
vector<wxPanel *> image_broad;
|
||||
bool is_selected;
|
||||
bool is_uploaded; // load
|
||||
wxBoxSizer * image_tb_broad = nullptr;
|
||||
};
|
||||
|
||||
std::vector<ScalableButton *> m_score_star;
|
||||
wxTextCtrl * m_comment_text = nullptr;
|
||||
Button * m_button_ok = nullptr;
|
||||
Button * m_button_cancel = nullptr;
|
||||
Label * m_add_photo = nullptr;
|
||||
Label * m_delete_photo = nullptr;
|
||||
wxGridSizer * m_image_sizer = nullptr;
|
||||
wxStaticText * warning_text = nullptr;
|
||||
std::unordered_map<wxStaticBitmap *, ImageMsg> m_image;
|
||||
std::unordered_set<wxStaticBitmap *> m_selected_image_list;
|
||||
|
||||
void init();
|
||||
void update_static_bitmap(wxStaticBitmap *static_bitmap, wxImage image);
|
||||
void create_comment_text(const wxString &comment = "");
|
||||
void load_photo(const std::vector<std::pair<wxString, std::string>> &filePaths);
|
||||
void on_dpi_changed(const wxRect &suggested_rect) override;
|
||||
void OnBitmapClicked(wxMouseEvent &event);
|
||||
|
||||
wxBoxSizer * create_broad_sizer(wxStaticBitmap *bitmap, ImageMsg &cur_image_msg);
|
||||
wxBoxSizer * get_score_sizer();
|
||||
wxBoxSizer * get_star_sizer();
|
||||
wxBoxSizer * get_comment_text_sizer();
|
||||
wxBoxSizer * get_photo_btn_sizer();
|
||||
wxBoxSizer * get_button_sizer();
|
||||
wxBoxSizer * get_main_sizer(const std::vector<std::pair<wxString, std::string>> &images = std::vector<std::pair<wxString, std::string>>(), const wxString &comment = "");
|
||||
|
||||
std::set<std::pair<wxStaticBitmap *, wxString>> add_need_upload_imgs();
|
||||
std::pair<wxStaticBitmap *, ImageMsg> create_local_thumbnail(wxString &local_path);
|
||||
std::pair<wxStaticBitmap *, ImageMsg> create_oss_thumbnail(std::string &oss_path);
|
||||
|
||||
};
|
||||
|
||||
class PrintingTaskPanel : public wxPanel
|
||||
{
|
||||
public:
|
||||
PrintingTaskPanel(wxWindow* parent, PrintingTaskType type);
|
||||
~PrintingTaskPanel();
|
||||
void create_panel(wxWindow* parent);
|
||||
|
||||
|
||||
private:
|
||||
MachineObject* m_obj;
|
||||
|
@ -91,6 +181,7 @@ private:
|
|||
// Orca: show print end time
|
||||
wxStaticText * m_staticText_progress_end;
|
||||
wxStaticText* m_staticText_layers;
|
||||
wxStaticText * m_has_rated_prompt;
|
||||
wxStaticBitmap* m_bitmap_thumbnail;
|
||||
wxStaticBitmap* m_bitmap_static_use_time;
|
||||
wxStaticBitmap* m_bitmap_static_use_weight;
|
||||
|
@ -98,6 +189,12 @@ private:
|
|||
ScalableButton* m_button_abort;
|
||||
Button* m_button_market_scoring;
|
||||
Button* m_button_clean;
|
||||
wxPanel * m_score_subtask_info;
|
||||
wxPanel * m_score_staticline;
|
||||
// score page
|
||||
int m_star_count;
|
||||
std::vector<ScalableButton *> m_score_star;
|
||||
bool m_star_count_dirty = false;
|
||||
|
||||
ProgressBar* m_gauge_progress;
|
||||
Label* m_error_text;
|
||||
|
@ -122,6 +219,8 @@ public:
|
|||
void update_layers_num(bool show, wxString num = wxEmptyString);
|
||||
void show_priting_use_info(bool show, wxString time = wxEmptyString, wxString weight = wxEmptyString);
|
||||
void show_profile_info(bool show, wxString profile = wxEmptyString);
|
||||
void market_scoring_show();
|
||||
void market_scoring_hide();
|
||||
|
||||
public:
|
||||
ScalableButton* get_abort_button() {return m_button_abort;};
|
||||
|
@ -129,6 +228,13 @@ public:
|
|||
Button* get_market_scoring_button() {return m_button_market_scoring;};
|
||||
Button* get_clean_button() {return m_button_clean;};
|
||||
wxStaticBitmap* get_bitmap_thumbnail() {return m_bitmap_thumbnail;};
|
||||
int get_star_count() { return m_star_count; }
|
||||
void set_star_count(int star_count);
|
||||
std::vector<ScalableButton *> &get_score_star() { return m_score_star; }
|
||||
bool get_star_count_dirty() { return m_star_count_dirty; }
|
||||
void set_star_count_dirty(bool dirty) { m_star_count_dirty = dirty; }
|
||||
void set_has_reted_text(bool has_rated);
|
||||
|
||||
};
|
||||
|
||||
class StatusBasePanel : public wxScrolledWindow
|
||||
|
@ -210,7 +316,6 @@ protected:
|
|||
ScalableButton *m_button_pause_resume;
|
||||
ScalableButton *m_button_abort;
|
||||
Button * m_button_clean;
|
||||
Button * m_button_market_scoring;
|
||||
|
||||
wxStaticText * m_text_tasklist_caption;
|
||||
|
||||
|
@ -222,19 +327,22 @@ protected:
|
|||
/* TempInput */
|
||||
wxBoxSizer * m_misc_ctrl_sizer;
|
||||
StaticBox* m_fan_panel;
|
||||
TempInput * m_tempCtrl_nozzle;
|
||||
int m_temp_nozzle_timeout {0};
|
||||
StaticLine * m_line_nozzle;
|
||||
TempInput* m_tempCtrl_nozzle;
|
||||
int m_temp_nozzle_timeout{ 0 };
|
||||
TempInput * m_tempCtrl_bed;
|
||||
int m_temp_bed_timeout {0};
|
||||
TempInput * m_tempCtrl_frame;
|
||||
TempInput * m_tempCtrl_chamber;
|
||||
int m_temp_chamber_timeout {0};
|
||||
bool m_current_support_cham_fan{true};
|
||||
bool m_current_support_aux_fan{true};
|
||||
FanSwitchButton *m_switch_nozzle_fan;
|
||||
int m_switch_nozzle_fan_timeout{0};
|
||||
FanSwitchButton *m_switch_printing_fan;
|
||||
int m_switch_printing_fan_timeout{0};
|
||||
FanSwitchButton *m_switch_cham_fan;
|
||||
int m_switch_cham_fan_timeout{0};
|
||||
wxPanel* m_switch_block_fan;
|
||||
|
||||
float m_fixed_aspect_ratio{1.8};
|
||||
|
||||
|
@ -320,7 +428,7 @@ public:
|
|||
wxBoxSizer *create_ams_group(wxWindow *parent);
|
||||
wxBoxSizer *create_settings_group(wxWindow *parent);
|
||||
|
||||
void show_ams_group(bool show = true, bool support_virtual_tray = true, bool support_extrustion_cali = true);
|
||||
void show_ams_group(bool show = true);
|
||||
};
|
||||
|
||||
|
||||
|
@ -359,10 +467,14 @@ protected:
|
|||
int m_last_vcamera = -1;
|
||||
bool m_is_load_with_temp = false;
|
||||
bool m_print_finish = false;
|
||||
json m_rating_result;
|
||||
json m_last_result;
|
||||
|
||||
wxWebRequest web_request;
|
||||
bool bed_temp_input = false;
|
||||
bool nozzle_temp_input = false;
|
||||
bool cham_temp_input = false;
|
||||
bool request_model_info_flag = false;
|
||||
int speed_lvl = 1; // 0 - 3
|
||||
int speed_lvl_timeout {0};
|
||||
boost::posix_time::ptime speed_dismiss_time;
|
||||
|
@ -372,6 +484,8 @@ protected:
|
|||
std::map<std::string, std::string> m_print_connect_types;
|
||||
std::vector<Button *> m_buttons;
|
||||
int last_status;
|
||||
ScoreData *m_score_data;
|
||||
|
||||
void init_scaled_buttons();
|
||||
void create_tasklist_info();
|
||||
void show_task_list_info(bool show = true);
|
||||
|
@ -384,7 +498,6 @@ protected:
|
|||
void show_error_message(MachineObject* obj, wxString msg, std::string print_error_str = "");
|
||||
void error_info_reset();
|
||||
void show_recenter_dialog();
|
||||
void market_model_scoring_page(int design_id);
|
||||
|
||||
/* axis control */
|
||||
bool check_axis_z_at_home(MachineObject* obj);
|
||||
|
@ -405,9 +518,11 @@ protected:
|
|||
void on_nozzle_temp_kill_focus(wxFocusEvent &event);
|
||||
void on_nozzle_temp_set_focus(wxFocusEvent &event);
|
||||
void on_set_nozzle_temp();
|
||||
void on_set_chamber_temp();
|
||||
|
||||
/* extruder apis */
|
||||
void on_ams_load(SimpleEvent &event);
|
||||
void update_filament_step();
|
||||
void on_ams_load_curr();
|
||||
void on_ams_unload(SimpleEvent &event);
|
||||
void on_ams_filament_backup(SimpleEvent& event);
|
||||
|
@ -422,6 +537,8 @@ protected:
|
|||
void on_print_error_func(wxCommandEvent& event);
|
||||
|
||||
void on_fan_changed(wxCommandEvent& event);
|
||||
void on_cham_temp_kill_focus(wxFocusEvent& event);
|
||||
void on_cham_temp_set_focus(wxFocusEvent& event);
|
||||
void on_switch_speed(wxCommandEvent& event);
|
||||
void on_lamp_switch(wxCommandEvent &event);
|
||||
void on_printing_fan_switch(wxCommandEvent &event);
|
||||
|
@ -455,13 +572,16 @@ protected:
|
|||
void update_misc_ctrl(MachineObject *obj);
|
||||
void update_ams(MachineObject* obj);
|
||||
void update_extruder_status(MachineObject* obj);
|
||||
void update_ams_control_state(bool is_support_virtual_tray, bool is_curr_tray_selected);
|
||||
void update_ams_control_state(bool is_curr_tray_selected);
|
||||
void update_cali(MachineObject* obj);
|
||||
|
||||
void reset_printing_values();
|
||||
void on_webrequest_state(wxWebRequestEvent &evt);
|
||||
bool is_task_changed(MachineObject* obj);
|
||||
|
||||
/* model mall score */
|
||||
bool model_score_is_update();
|
||||
|
||||
/* camera */
|
||||
void update_camera_state(MachineObject* obj);
|
||||
bool show_vcamera = false;
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "Widgets/TabCtrl.hpp"
|
||||
#include "MarkdownTip.hpp"
|
||||
#include "Search.hpp"
|
||||
#include "BedShapeDialog.hpp"
|
||||
|
||||
#include "BedShapeDialog.hpp"
|
||||
// #include "BonjourDialog.hpp"
|
||||
|
@ -2720,8 +2721,6 @@ void TabFilament::build()
|
|||
line.append_option(optgroup->get_option("nozzle_temperature_range_high"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup = page->new_optgroup(L("Recommended temperature range"), L"param_temperature");
|
||||
optgroup->append_single_option_line("bed_temperature_difference");
|
||||
|
||||
optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
|
||||
optgroup->append_single_option_line("chamber_temperature");
|
||||
|
@ -2743,7 +2742,7 @@ void TabFilament::build()
|
|||
line.append_option(optgroup->get_option("eng_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
line = { L("High Temp Plate"), L("Bed temperature when high temperature plate is installed. Value 0 means the filament does not support to print on the High Temp Plate") };
|
||||
line = {L("Smooth PEI Plate / High Temp Plate"), L("Bed temperature when Smooth PEI Plate/High temperature plate is installed. Value 0 means the filament does not support to print on the Smooth PEI Plate/High Temp Plate") };
|
||||
line.append_option(optgroup->get_option("hot_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("hot_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
|
@ -2776,6 +2775,9 @@ void TabFilament::build()
|
|||
else if (opt_key == "nozzle_temperature_initial_layer") {
|
||||
m_config_manipulation.check_nozzle_temperature_initial_layer_range(&filament_config);
|
||||
}
|
||||
else if (opt_key == "chamber_temperatures") {
|
||||
m_config_manipulation.check_chamber_temperature(&filament_config);
|
||||
}
|
||||
|
||||
on_value_change(opt_key, value);
|
||||
};
|
||||
|
@ -2826,6 +2828,18 @@ void TabFilament::build()
|
|||
optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_fan");
|
||||
optgroup->append_single_option_line("additional_cooling_fan_speed");
|
||||
|
||||
optgroup = page->new_optgroup(L("Exhaust fan"),L"param_cooling_fan");
|
||||
|
||||
optgroup->append_single_option_line("activate_air_filtration");
|
||||
|
||||
line = {L("During print"), L("")};
|
||||
line.append_option(optgroup->get_option("during_print_exhaust_fan_speed"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
|
||||
line = {L("Complete print"), L("")};
|
||||
line.append_option(optgroup->get_option("complete_print_exhaust_fan_speed"));
|
||||
optgroup->append_line(line);
|
||||
//BBS
|
||||
add_filament_overrides_page();
|
||||
const int gcode_field_height = 15; // 150
|
||||
|
@ -2987,7 +3001,8 @@ void TabFilament::toggle_options()
|
|||
toggle_line("cool_plate_temp_initial_layer", is_BBL_printer);
|
||||
toggle_line("eng_plate_temp_initial_layer", is_BBL_printer);
|
||||
toggle_line("textured_plate_temp_initial_layer", is_BBL_printer);
|
||||
toggle_option("chamber_temperature", !is_BBL_printer);
|
||||
bool support_chamber_temp_control = this->m_preset_bundle->printers.get_selected_preset().config.opt_bool("support_chamber_temp_control");
|
||||
toggle_option("chamber_temperature", !is_BBL_printer || support_chamber_temp_control);
|
||||
}
|
||||
if (m_active_page->title() == L("Setting Overrides"))
|
||||
update_filament_overrides_page();
|
||||
|
@ -3100,6 +3115,7 @@ void TabPrinter::build_fff()
|
|||
// optgroup->append_single_option_line("printable_area");
|
||||
optgroup->append_single_option_line("printable_height");
|
||||
optgroup->append_single_option_line("nozzle_volume");
|
||||
optgroup->append_single_option_line("best_object_pos");
|
||||
|
||||
#if 0
|
||||
//optgroup->append_single_option_line("z_offset");
|
||||
|
@ -3118,6 +3134,7 @@ void TabPrinter::build_fff()
|
|||
// optgroup->append_single_option_line(option);
|
||||
|
||||
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
|
||||
optgroup->append_single_option_line("printer_structure");
|
||||
optgroup->append_single_option_line("gcode_flavor");
|
||||
option = optgroup->get_option("thumbnails");
|
||||
option.opt.full_width = true;
|
||||
|
@ -3140,11 +3157,13 @@ void TabPrinter::build_fff()
|
|||
optgroup->append_single_option_line("extruder_clearance_radius");
|
||||
optgroup->append_single_option_line("extruder_clearance_height_to_rod");
|
||||
optgroup->append_single_option_line("extruder_clearance_height_to_lid");
|
||||
|
||||
|
||||
optgroup = page->new_optgroup(L("Accessory") /*, L"param_accessory"*/);
|
||||
optgroup->append_single_option_line("nozzle_type");
|
||||
optgroup->append_single_option_line("nozzle_hrc");
|
||||
optgroup->append_single_option_line("auxiliary_fan");
|
||||
optgroup->append_single_option_line("support_chamber_temp_control");
|
||||
optgroup->append_single_option_line("support_air_filtration");
|
||||
|
||||
const int gcode_field_height = 15; // 150
|
||||
const int notes_field_height = 25; // 250
|
||||
|
@ -3188,6 +3207,16 @@ void TabPrinter::build_fff()
|
|||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;//150;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
optgroup = page->new_optgroup(L("Time lapse G-code"), L"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
validate_custom_gcode_cb(this, optgroup, opt_key, value);
|
||||
};
|
||||
option = optgroup->get_option("time_lapse_gcode");
|
||||
option.opt.full_width = true;
|
||||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;//150;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
optgroup = page->new_optgroup(L("Change filament G-code"), L"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
|
@ -3529,6 +3558,8 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
|
|||
optgroup->append_single_option_line("retraction_length", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_restart_extra", "", extruder_idx);
|
||||
optgroup->append_single_option_line("z_hop", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_lift_above", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_lift_below", "", extruder_idx);
|
||||
optgroup->append_single_option_line("z_hop_types", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retraction_speed", "", extruder_idx);
|
||||
optgroup->append_single_option_line("deretraction_speed", "", extruder_idx);
|
||||
|
|
|
@ -1349,6 +1349,10 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig&
|
|||
opt_key == "sparse_infill_pattern",
|
||||
opt_idx);
|
||||
}
|
||||
case coPoint: {
|
||||
Vec2d val = config.opt<ConfigOptionPoint>(opt_key)->value;
|
||||
return from_u8((boost::format("[%1%]") % ConfigOptionPoint(val).serialize()).str());
|
||||
}
|
||||
case coPoints: {
|
||||
//BBS: add bed_exclude_area
|
||||
if (opt_key == "printable_area" || opt_key == "thumbnails") {
|
||||
|
@ -1359,7 +1363,9 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig&
|
|||
else if (opt_key == "bed_exclude_area") {
|
||||
return get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
|
||||
}
|
||||
|
||||
else if (opt_key == "thumbnail_size") {
|
||||
return get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
|
||||
}
|
||||
Vec2d val = config.opt<ConfigOptionPoints>(opt_key)->get_at(opt_idx);
|
||||
return from_u8((boost::format("[%1%]") % ConfigOptionPoint(val).serialize()).str());
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
|
|||
|
||||
wxBoxSizer *m_main_left_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
||||
// ota
|
||||
wxBoxSizer *m_ota_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_printer_img = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(FromDIP(200), FromDIP(200)));
|
||||
|
@ -95,11 +97,10 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
|
|||
m_staticline->Show(false);
|
||||
m_main_left_sizer->Add(m_staticline, 0, wxEXPAND | wxLEFT, FromDIP(40));
|
||||
|
||||
|
||||
// ams
|
||||
m_ams_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_ams_img = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(FromDIP(200), FromDIP(200)));
|
||||
|
||||
|
||||
|
||||
m_ams_img->SetBitmap(m_img_monitor_ams.bmp());
|
||||
m_ams_sizer->Add(m_ams_img, 0, wxALIGN_TOP | wxALL, FromDIP(5));
|
||||
|
||||
|
@ -135,12 +136,31 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
|
|||
//Hide ams
|
||||
show_ams(false, true);
|
||||
|
||||
//
|
||||
m_extra_ams_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_extra_ams_img = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(FromDIP(200), FromDIP(200)));
|
||||
m_extra_ams_img->SetBitmap(m_img_extra_ams.bmp());
|
||||
|
||||
m_extra_ams_sizer->Add(m_extra_ams_img, 0, wxALIGN_TOP | wxALL, FromDIP(5));
|
||||
|
||||
wxBoxSizer* extra_ams_content_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
extra_ams_content_sizer->Add(0, 40, 0, wxEXPAND, FromDIP(5));
|
||||
m_extra_ams_panel = new ExtraAmsPanel(this);
|
||||
m_extra_ams_panel->m_staticText_ams->SetLabel("AMS Lite");
|
||||
extra_ams_content_sizer->Add(m_extra_ams_panel, 0, wxEXPAND, 0);
|
||||
|
||||
m_extra_ams_sizer->Add(extra_ams_content_sizer, 1, wxEXPAND, 0);
|
||||
|
||||
m_main_left_sizer->Add(m_extra_ams_sizer, 0, wxEXPAND, 0);
|
||||
|
||||
show_extra_ams(false, true);
|
||||
|
||||
m_staticline2 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL);
|
||||
m_staticline2->SetBackgroundColour(wxColour(206, 206, 206));
|
||||
//m_staticline2->Show(false);
|
||||
m_main_left_sizer->Add(m_staticline2, 0, wxEXPAND | wxLEFT, FromDIP(40));
|
||||
|
||||
// ext
|
||||
m_ext_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_ext_img = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(FromDIP(200), FromDIP(200)));
|
||||
|
@ -158,6 +178,7 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
|
|||
m_main_left_sizer->Add(m_ext_sizer, 0, wxEXPAND, 0);
|
||||
|
||||
|
||||
|
||||
m_main_sizer->Add(m_main_left_sizer, 1, wxEXPAND, 0);
|
||||
|
||||
wxBoxSizer *m_main_right_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
@ -288,6 +309,7 @@ void MachineInfoPanel::init_bitmaps()
|
|||
m_img_printer = ScalableBitmap(this, "printer_thumbnail", 160);
|
||||
m_img_monitor_ams = ScalableBitmap(this, "monitor_upgrade_ams", 200);
|
||||
m_img_ext = ScalableBitmap(this, "monitor_upgrade_ext", 200);
|
||||
m_img_extra_ams = ScalableBitmap(this, "monitor_upgrade_f1", 160);
|
||||
upgrade_green_icon = ScalableBitmap(this, "monitor_upgrade_online", 5);
|
||||
upgrade_gray_icon = ScalableBitmap(this, "monitor_upgrade_offline", 5);
|
||||
upgrade_yellow_icon = ScalableBitmap(this, "monitor_upgrade_busy", 5);
|
||||
|
@ -451,7 +473,7 @@ void MachineInfoPanel::update_ams_ext(MachineObject *obj)
|
|||
bool has_hub_model = false;
|
||||
|
||||
//hub
|
||||
if (!obj->online_ahb || obj->module_vers.find("ahb") == obj->module_vers.end())
|
||||
if (!obj->online_ahb || obj->module_vers.find("ahb") == obj->module_vers.end())
|
||||
m_ahb_panel->Hide();
|
||||
else {
|
||||
has_hub_model = true;
|
||||
|
@ -531,105 +553,143 @@ void MachineInfoPanel::update_ams_ext(MachineObject *obj)
|
|||
|
||||
//ams
|
||||
if (obj->ams_exist_bits != 0) {
|
||||
show_ams(true);
|
||||
std::map<int, MachineObject::ModuleVersionInfo> ver_list = obj->get_ams_version();
|
||||
std::string extra_ams_str = (boost::format("ams_f1/%1%") % 0).str();
|
||||
auto extra_ams_it = obj->module_vers.find(extra_ams_str);
|
||||
if (extra_ams_it != obj->module_vers.end()) {
|
||||
wxString sn_text = extra_ams_it->second.sn;
|
||||
sn_text = sn_text.MakeUpper();
|
||||
|
||||
AmsPanelHash::iterator iter = m_amspanel_list.begin();
|
||||
wxString ver_text = extra_ams_it->second.sw_ver;
|
||||
|
||||
for (auto i = 0; i < m_amspanel_list.GetCount(); i++) {
|
||||
AmsPanel *amspanel = m_amspanel_list[i];
|
||||
amspanel->Hide();
|
||||
bool has_new_version = false;
|
||||
auto new_extra_ams_ver = obj->new_ver_list.find(extra_ams_str);
|
||||
if (new_extra_ams_ver != obj->new_ver_list.end())
|
||||
has_new_version = true;
|
||||
|
||||
extra_ams_it->second.sw_new_ver;
|
||||
if (has_new_version) {
|
||||
m_extra_ams_panel->m_ams_new_version_img->Show();
|
||||
ver_text = wxString::Format("%s->%s", new_extra_ams_ver->second.sw_ver, new_extra_ams_ver->second.sw_new_ver);
|
||||
}
|
||||
else {
|
||||
m_extra_ams_panel->m_ams_new_version_img->Hide();
|
||||
ver_text = wxString::Format("%s(%s)", extra_ams_it->second.sw_ver, _L("Latest version"));
|
||||
}
|
||||
m_extra_ams_panel->m_staticText_ams_sn_val->SetLabelText(sn_text);
|
||||
m_extra_ams_panel->m_staticText_ams_ver_val->SetLabelText(ver_text);
|
||||
show_ams(false);
|
||||
show_extra_ams(true);
|
||||
}
|
||||
else {
|
||||
show_extra_ams(false);
|
||||
show_ams(true);
|
||||
std::map<int, MachineObject::ModuleVersionInfo> ver_list = obj->get_ams_version();
|
||||
|
||||
AmsPanelHash::iterator iter = m_amspanel_list.begin();
|
||||
|
||||
for (auto i = 0; i < m_amspanel_list.GetCount(); i++) {
|
||||
AmsPanel* amspanel = m_amspanel_list[i];
|
||||
amspanel->Hide();
|
||||
}
|
||||
|
||||
|
||||
auto ams_index = 0;
|
||||
for (std::map<std::string, Ams *>::iterator iter = obj->amsList.begin(); iter != obj->amsList.end(); iter++) {
|
||||
wxString ams_name;
|
||||
wxString ams_sn;
|
||||
wxString ams_ver;
|
||||
auto ams_index = 0;
|
||||
for (std::map<std::string, Ams*>::iterator iter = obj->amsList.begin(); iter != obj->amsList.end(); iter++) {
|
||||
wxString ams_name;
|
||||
wxString ams_sn;
|
||||
wxString ams_ver;
|
||||
|
||||
AmsPanel *amspanel = m_amspanel_list[ams_index];
|
||||
amspanel->Show();
|
||||
AmsPanel* amspanel = m_amspanel_list[ams_index];
|
||||
amspanel->Show();
|
||||
|
||||
auto it = ver_list.find(atoi(iter->first.c_str()));
|
||||
auto ams_id = std::stoi(iter->second->id);
|
||||
auto it = ver_list.find(atoi(iter->first.c_str()));
|
||||
auto ams_id = std::stoi(iter->second->id);
|
||||
|
||||
wxString ams_text = wxString::Format("AMS%s", std::to_string(ams_id + 1));
|
||||
ams_name = ams_text;
|
||||
wxString ams_text = wxString::Format("AMS%s", std::to_string(ams_id + 1));
|
||||
ams_name = ams_text;
|
||||
|
||||
if (it == ver_list.end()) {
|
||||
// hide this ams
|
||||
ams_sn = "-";
|
||||
ams_ver = "-";
|
||||
} else {
|
||||
// update ams img
|
||||
if (m_obj->upgrade_display_state == (int)MachineObject::UpgradingDisplayState::UpgradingInProgress) {
|
||||
if (it == ver_list.end()) {
|
||||
// hide this ams
|
||||
ams_sn = "-";
|
||||
ams_ver = "-";
|
||||
amspanel->m_ams_new_version_img->Hide();
|
||||
}
|
||||
else {
|
||||
if (obj->new_ver_list.empty() && !obj->m_new_ver_list_exist) {
|
||||
if (obj->upgrade_new_version
|
||||
&& obj->ams_new_version_number.compare(it->second.sw_ver) != 0) {
|
||||
amspanel->m_ams_new_version_img->Show();
|
||||
// update ams img
|
||||
if (m_obj->upgrade_display_state == (int)MachineObject::UpgradingDisplayState::UpgradingInProgress) {
|
||||
ams_ver = "-";
|
||||
amspanel->m_ams_new_version_img->Hide();
|
||||
}
|
||||
else {
|
||||
if (obj->new_ver_list.empty() && !obj->m_new_ver_list_exist) {
|
||||
if (obj->upgrade_new_version
|
||||
&& obj->ams_new_version_number.compare(it->second.sw_ver) != 0) {
|
||||
amspanel->m_ams_new_version_img->Show();
|
||||
|
||||
if (obj->ams_new_version_number.empty()) {
|
||||
ams_ver = wxString::Format("%s", it->second.sw_ver);
|
||||
} else {
|
||||
ams_ver = wxString::Format("%s->%s", it->second.sw_ver, obj->ams_new_version_number);
|
||||
if (obj->ams_new_version_number.empty()) {
|
||||
ams_ver = wxString::Format("%s", it->second.sw_ver);
|
||||
}
|
||||
else {
|
||||
ams_ver = wxString::Format("%s->%s", it->second.sw_ver, obj->ams_new_version_number);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
amspanel->m_ams_new_version_img->Hide();
|
||||
if (obj->ams_new_version_number.empty()) {
|
||||
wxString ver_text = wxString::Format("%s", it->second.sw_ver);
|
||||
ams_ver = ver_text;
|
||||
} else {
|
||||
wxString ver_text = wxString::Format("%s(%s)", it->second.sw_ver, _L("Latest version"));
|
||||
ams_ver = ver_text;
|
||||
else {
|
||||
amspanel->m_ams_new_version_img->Hide();
|
||||
if (obj->ams_new_version_number.empty()) {
|
||||
wxString ver_text = wxString::Format("%s", it->second.sw_ver);
|
||||
ams_ver = ver_text;
|
||||
}
|
||||
else {
|
||||
wxString ver_text = wxString::Format("%s(%s)", it->second.sw_ver, _L("Latest version"));
|
||||
ams_ver = ver_text;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
std::string ams_idx = (boost::format("ams/%1%") % ams_id).str();
|
||||
auto ver_item = obj->new_ver_list.find(ams_idx);
|
||||
else {
|
||||
std::string ams_idx = (boost::format("ams/%1%") % ams_id).str();
|
||||
auto ver_item = obj->new_ver_list.find(ams_idx);
|
||||
|
||||
if (ver_item == obj->new_ver_list.end()) {
|
||||
amspanel->m_ams_new_version_img->Hide();
|
||||
wxString ver_text = wxString::Format("%s(%s)", it->second.sw_ver, _L("Latest version"));
|
||||
ams_ver = ver_text;
|
||||
} else {
|
||||
if (ver_item->second.sw_new_ver != ver_item->second.sw_ver) {
|
||||
amspanel->m_ams_new_version_img->Show();
|
||||
wxString ver_text = wxString::Format("%s->%s", ver_item->second.sw_ver, ver_item->second.sw_new_ver);
|
||||
ams_ver = ver_text;
|
||||
} else {
|
||||
if (ver_item == obj->new_ver_list.end()) {
|
||||
amspanel->m_ams_new_version_img->Hide();
|
||||
wxString ver_text = wxString::Format("%s(%s)", ver_item->second.sw_ver, _L("Latest version"));
|
||||
ams_ver = ver_text;
|
||||
wxString ver_text = wxString::Format("%s(%s)", it->second.sw_ver, _L("Latest version"));
|
||||
ams_ver = ver_text;
|
||||
}
|
||||
else {
|
||||
if (ver_item->second.sw_new_ver != ver_item->second.sw_ver) {
|
||||
amspanel->m_ams_new_version_img->Show();
|
||||
wxString ver_text = wxString::Format("%s->%s", ver_item->second.sw_ver, ver_item->second.sw_new_ver);
|
||||
ams_ver = ver_text;
|
||||
}
|
||||
else {
|
||||
amspanel->m_ams_new_version_img->Hide();
|
||||
wxString ver_text = wxString::Format("%s(%s)", ver_item->second.sw_ver, _L("Latest version"));
|
||||
ams_ver = ver_text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update ams sn
|
||||
if (it->second.sn.empty()) {
|
||||
ams_sn = "-";
|
||||
}
|
||||
else {
|
||||
wxString sn_text = it->second.sn;
|
||||
ams_sn = sn_text.MakeUpper();
|
||||
}
|
||||
}
|
||||
|
||||
// update ams sn
|
||||
if (it->second.sn.empty()) {
|
||||
ams_sn = "-";
|
||||
} else {
|
||||
wxString sn_text = it->second.sn;
|
||||
ams_sn = sn_text.MakeUpper();
|
||||
}
|
||||
amspanel->m_staticText_ams->SetLabelText(ams_name);
|
||||
amspanel->m_staticText_ams_sn_val->SetLabelText(ams_sn);
|
||||
amspanel->m_staticText_ams_ver_val->SetLabelText(ams_ver);
|
||||
|
||||
ams_index++;
|
||||
}
|
||||
|
||||
amspanel->m_staticText_ams->SetLabelText(ams_name);
|
||||
amspanel->m_staticText_ams_sn_val->SetLabelText(ams_sn);
|
||||
amspanel->m_staticText_ams_ver_val->SetLabelText(ams_ver);
|
||||
|
||||
ams_index++;
|
||||
}
|
||||
} else {
|
||||
if (!has_hub_model) { show_ams(false); }
|
||||
|
||||
show_extra_ams(false);
|
||||
}
|
||||
|
||||
|
||||
//ext
|
||||
auto ext_module = obj->module_vers.find("ext");
|
||||
if (ext_module == obj->module_vers.end())
|
||||
|
@ -749,6 +809,16 @@ void MachineInfoPanel::show_ext(bool show, bool force_update)
|
|||
m_last_ext_show = show;
|
||||
}
|
||||
|
||||
void MachineInfoPanel::show_extra_ams(bool show, bool force_update) {
|
||||
if (m_last_extra_ams_show != show || force_update) {
|
||||
m_extra_ams_img->Show(show);
|
||||
m_extra_ams_sizer->Show(show);
|
||||
m_staticline->Show(show);
|
||||
BOOST_LOG_TRIVIAL(trace) << "upgrade: show_extra_ams = " << show;
|
||||
}
|
||||
m_last_extra_ams_show = show;
|
||||
}
|
||||
|
||||
void MachineInfoPanel::on_sys_color_changed()
|
||||
{
|
||||
if (m_obj) {
|
||||
|
@ -1154,5 +1224,16 @@ bool UpgradePanel::Show(bool show)
|
|||
m_ext_new_version_img->SetBitmap(upgrade_green_icon.bmp());
|
||||
}
|
||||
|
||||
ExtraAmsPanel::ExtraAmsPanel(wxWindow* parent,
|
||||
wxWindowID id /*= wxID_ANY*/,
|
||||
const wxPoint& pos /*= wxDefaultPosition*/,
|
||||
const wxSize& size /*= wxDefaultSize*/,
|
||||
long style /*= wxTAB_TRAVERSAL*/,
|
||||
const wxString& name /*= wxEmptyString*/)
|
||||
: AmsPanel(parent, id, pos, size, style)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,16 @@ public:
|
|||
void msw_rescale();
|
||||
};
|
||||
|
||||
class ExtraAmsPanel : public AmsPanel
|
||||
{
|
||||
public:
|
||||
ExtraAmsPanel(wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL,
|
||||
const wxString& name = wxEmptyString);
|
||||
};
|
||||
|
||||
WX_DEFINE_ARRAY(AmsPanel*, AmsPanelHash);
|
||||
|
||||
|
@ -74,6 +84,8 @@ protected:
|
|||
wxStaticBitmap *m_ams_img;
|
||||
AmsPanel* m_ahb_panel;
|
||||
wxStaticLine* m_staticline2;
|
||||
ExtraAmsPanel* m_extra_ams_panel;
|
||||
wxStaticBitmap* m_extra_ams_img;
|
||||
wxStaticBitmap* m_ext_img;
|
||||
ExtensionPanel* m_ext_panel;
|
||||
|
||||
|
@ -87,6 +99,10 @@ protected:
|
|||
bool m_last_ext_show = true;
|
||||
wxBoxSizer* m_ext_sizer;
|
||||
|
||||
/* extra_ams info */
|
||||
bool m_last_extra_ams_show = true;
|
||||
wxBoxSizer* m_extra_ams_sizer;
|
||||
|
||||
/* upgrade widgets */
|
||||
wxBoxSizer* m_upgrading_sizer;
|
||||
wxStaticText * m_staticText_upgrading_info;
|
||||
|
@ -97,10 +113,12 @@ protected:
|
|||
Button * m_button_upgrade_firmware;
|
||||
|
||||
wxPanel* create_caption_panel(wxWindow *parent);
|
||||
AmsPanelHash m_amspanel_list;
|
||||
AmsPanelHash m_amspanel_list;
|
||||
std::vector<ExtraAmsPanel*> m_extra_ams_panel_list;
|
||||
|
||||
ScalableBitmap m_img_ext;
|
||||
ScalableBitmap m_img_monitor_ams;
|
||||
ScalableBitmap m_img_extra_ams;
|
||||
ScalableBitmap m_img_printer;
|
||||
ScalableBitmap upgrade_gray_icon;
|
||||
ScalableBitmap upgrade_green_icon;
|
||||
|
@ -134,6 +152,7 @@ public:
|
|||
void show_status(int status, std::string upgrade_status_str = "");
|
||||
void show_ams(bool show = false, bool force_update = false);
|
||||
void show_ext(bool show = false, bool force_update = false);
|
||||
void show_extra_ams(bool show = false, bool force_update = false);
|
||||
|
||||
void on_upgrade_firmware(wxCommandEvent &event);
|
||||
void on_consisitency_upgrade_firmware(wxCommandEvent &event);
|
||||
|
@ -152,12 +171,12 @@ public:
|
|||
}panel_type;
|
||||
};
|
||||
|
||||
enum UpgradeMode {
|
||||
umPushUpgrading,
|
||||
umSelectOtaVerUpgrading,
|
||||
umSelectAmsVerUpgrading,
|
||||
};
|
||||
static UpgradeMode upgrade_mode;
|
||||
//enum UpgradeMode {
|
||||
// umPushUpgrading,
|
||||
// umSelectOtaVerUpgrading,
|
||||
// umSelectAmsVerUpgrading,
|
||||
//};
|
||||
//static UpgradeMode upgrade_mode;
|
||||
|
||||
class UpgradePanel : public wxPanel
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,6 +35,12 @@
|
|||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
enum AMSModel {
|
||||
NO_AMS = 0,
|
||||
GENERIC_AMS = 1,
|
||||
EXTRA_AMS = 2
|
||||
};
|
||||
|
||||
enum ActionButton {
|
||||
ACTION_BTN_CALI = 0,
|
||||
ACTION_BTN_LOAD = 1,
|
||||
|
@ -105,6 +111,7 @@ enum FilamentStep {
|
|||
STEP_PURGE_OLD_FILAMENT,
|
||||
STEP_FEED_FILAMENT,
|
||||
STEP_CONFIRM_EXTRUDED,
|
||||
STEP_CHECK_POSITION,
|
||||
STEP_COUNT,
|
||||
};
|
||||
|
||||
|
@ -118,11 +125,11 @@ enum FilamentStepType {
|
|||
#define AMS_ITEM_SIZE wxSize(FromDIP(82), FromDIP(27))
|
||||
#define AMS_ITEM_HUMIDITY_SIZE wxSize(FromDIP(120), FromDIP(27))
|
||||
#define AMS_CAN_LIB_SIZE wxSize(FromDIP(58), FromDIP(80))
|
||||
#define AMS_CAN_ROAD_SIZE wxSize(FromDIP(66), FromDIP(60))
|
||||
#define AMS_CAN_ROAD_SIZE wxSize(FromDIP(66), FromDIP(70))
|
||||
#define AMS_CAN_ITEM_HEIGHT_SIZE FromDIP(27)
|
||||
#define AMS_CANS_SIZE wxSize(FromDIP(284), FromDIP(186))
|
||||
#define AMS_CANS_WINDOW_SIZE wxSize(FromDIP(264), FromDIP(186))
|
||||
#define AMS_STEP_SIZE wxSize(FromDIP(172), FromDIP(186))
|
||||
#define AMS_CANS_SIZE wxSize(FromDIP(284), FromDIP(196))
|
||||
#define AMS_CANS_WINDOW_SIZE wxSize(FromDIP(264), FromDIP(196))
|
||||
#define AMS_STEP_SIZE wxSize(FromDIP(172), FromDIP(196))
|
||||
#define AMS_REFRESH_SIZE wxSize(FromDIP(30), FromDIP(30))
|
||||
#define AMS_EXTRUDER_SIZE wxSize(FromDIP(86), FromDIP(72))
|
||||
#define AMS_EXTRUDER_BITMAP_SIZE wxSize(FromDIP(36), FromDIP(55))
|
||||
|
@ -161,8 +168,8 @@ class AMSrefresh : public wxWindow
|
|||
{
|
||||
public:
|
||||
AMSrefresh();
|
||||
AMSrefresh(wxWindow *parent, wxWindowID id, wxString number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
AMSrefresh(wxWindow *parent, wxWindowID id, int number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
AMSrefresh(wxWindow *parent, wxString number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
AMSrefresh(wxWindow *parent, int number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
~AMSrefresh();
|
||||
void PlayLoading();
|
||||
void StopLoading();
|
||||
|
@ -243,7 +250,7 @@ public:
|
|||
void has_ams(bool hams) {m_has_vams = hams; Refresh();};
|
||||
void no_ams_mode(bool mode) {m_none_ams_mode = mode; Refresh();};
|
||||
|
||||
bool m_none_ams_mode{false};
|
||||
bool m_none_ams_mode{true};
|
||||
bool m_has_vams{false};
|
||||
bool m_vams_loading{false};
|
||||
bool m_ams_loading{false};
|
||||
|
@ -284,13 +291,15 @@ Description:AMSLib
|
|||
class AMSLib : public wxWindow
|
||||
{
|
||||
public:
|
||||
AMSLib(wxWindow *parent, wxWindowID id, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
AMSLib(wxWindow *parent, Caninfo info);
|
||||
void create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
public:
|
||||
wxColour GetLibColour();
|
||||
Caninfo m_info;
|
||||
MachineObject* m_obj = {nullptr};
|
||||
int m_can_index;
|
||||
int m_can_index = 0;
|
||||
AMSModel m_ams_model;
|
||||
|
||||
void Update(Caninfo info, bool refresh = true);
|
||||
void UnableSelected() { m_unable_selected = true; };
|
||||
void EableSelected() { m_unable_selected = false; };
|
||||
|
@ -303,7 +312,7 @@ public:
|
|||
virtual bool Enable(bool enable = true);
|
||||
void set_disable_mode(bool disable) { m_disable_mode = disable; }
|
||||
void msw_rescale();
|
||||
|
||||
void on_pass_road(bool pass);
|
||||
|
||||
protected:
|
||||
wxStaticBitmap *m_edit_bitmp = {nullptr};
|
||||
|
@ -314,6 +323,15 @@ protected:
|
|||
ScalableBitmap m_bitmap_readonly_light;
|
||||
ScalableBitmap m_bitmap_transparent;
|
||||
|
||||
ScalableBitmap m_bitmap_extra_tray_left;
|
||||
ScalableBitmap m_bitmap_extra_tray_right;
|
||||
|
||||
ScalableBitmap m_bitmap_extra_tray_left_hover;
|
||||
ScalableBitmap m_bitmap_extra_tray_right_hover;
|
||||
|
||||
ScalableBitmap m_bitmap_extra_tray_left_selected;
|
||||
ScalableBitmap m_bitmap_extra_tray_right_selected;
|
||||
|
||||
bool m_unable_selected = {false};
|
||||
bool m_enable = {false};
|
||||
bool m_selected = {false};
|
||||
|
@ -326,13 +344,18 @@ protected:
|
|||
wxColour m_road_def_color;
|
||||
wxColour m_lib_color;
|
||||
bool m_disable_mode{ false };
|
||||
bool m_pass_road{false};
|
||||
|
||||
void on_enter_window(wxMouseEvent &evt);
|
||||
void on_leave_window(wxMouseEvent &evt);
|
||||
void on_left_down(wxMouseEvent &evt);
|
||||
void paintEvent(wxPaintEvent &evt);
|
||||
void render(wxDC &dc);
|
||||
void doRender(wxDC &dc);
|
||||
void render_extra_text(wxDC& dc);
|
||||
void render_generic_text(wxDC& dc);
|
||||
void doRender(wxDC& dc);
|
||||
void render_extra_lib(wxDC& dc);
|
||||
void render_generic_lib(wxDC& dc);
|
||||
};
|
||||
|
||||
/*************************************************
|
||||
|
@ -364,9 +387,11 @@ public:
|
|||
ScalableBitmap ams_humidity_3;
|
||||
ScalableBitmap ams_humidity_4;
|
||||
|
||||
|
||||
int m_humidity = { 0 };
|
||||
bool m_show_humidity = { false };
|
||||
bool m_vams_loading{false};
|
||||
AMSModel m_ams_model;
|
||||
|
||||
void OnVamsLoading(bool load, wxColour col = AMS_CONTROL_GRAY500);
|
||||
void SetPassRoadColour(wxColour col);
|
||||
|
@ -399,9 +424,6 @@ public:
|
|||
void OnLeaveWindow(wxMouseEvent &evt);
|
||||
void OnSelected();
|
||||
void UnSelected();
|
||||
void ShowHumidity();
|
||||
void HideHumidity();
|
||||
void SetHumidity(int humidity);
|
||||
virtual bool Enable(bool enable = true);
|
||||
|
||||
AMSinfo m_amsinfo;
|
||||
|
@ -413,8 +435,6 @@ protected:
|
|||
int m_space = {5};
|
||||
bool m_hover = {false};
|
||||
bool m_selected = {false};
|
||||
bool m_show_humidity = {false};
|
||||
int m_humidity = {0};
|
||||
ScalableBitmap* m_ts_bitmap_cube;
|
||||
|
||||
void paintEvent(wxPaintEvent &evt);
|
||||
|
@ -455,32 +475,45 @@ class AmsCans : public wxWindow
|
|||
{
|
||||
public:
|
||||
AmsCans();
|
||||
AmsCans(wxWindow *parent, wxWindowID id, AMSinfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
AmsCans(wxWindow *parent, AMSinfo info, AMSModel model);
|
||||
|
||||
void Update(AMSinfo info);
|
||||
void create(wxWindow *parent, wxWindowID id, AMSinfo info, const wxPoint &pos, const wxSize &size);
|
||||
void AddCan(Caninfo caninfo, int canindex, int maxcan);
|
||||
void create(wxWindow *parent);
|
||||
void AddCan(Caninfo caninfo, int canindex, int maxcan, wxBoxSizer* sizer);
|
||||
void SetDefSelectCan();
|
||||
void SelectCan(std::string canid);
|
||||
wxColour GetTagColr(wxString canid);
|
||||
void SetAmsStep(wxString canid, AMSPassRoadType type, AMSPassRoadSTEP step);
|
||||
//wxColour GetCanColour(wxString canid);
|
||||
void PlayRridLoading(wxString canid);
|
||||
void StopRridLoading(wxString canid);
|
||||
void msw_rescale();
|
||||
void show_sn_value(bool show);
|
||||
void SetAmsStepExtra(wxString canid, AMSPassRoadType type, AMSPassRoadSTEP step);
|
||||
void SetAmsStep(wxString canid, AMSPassRoadType type, AMSPassRoadSTEP step);
|
||||
void SetAmsStep(std::string can_id);
|
||||
void paintEvent(wxPaintEvent& evt);
|
||||
void render(wxDC& dc);
|
||||
void doRender(wxDC& dc);
|
||||
wxColour GetTagColr(wxString canid);
|
||||
std::string GetCurrentCan();
|
||||
|
||||
public:
|
||||
ScalableBitmap m_bitmap_extra_framework;
|
||||
int m_canlib_selection = { -1 };
|
||||
int m_selection = { 0 };
|
||||
int m_can_count = { 0 };
|
||||
AMSModel m_ams_model;
|
||||
std::string m_canlib_id;
|
||||
int m_canlib_selection = {-1};
|
||||
int m_selection = {0};
|
||||
int m_can_count = {0};
|
||||
|
||||
std::string m_road_canid;
|
||||
wxColour m_road_colour;
|
||||
|
||||
CanLibsHash m_can_lib_list;
|
||||
CansRoadsHash m_can_road_list;
|
||||
CanrefreshsHash m_can_refresh_list;
|
||||
AMSinfo m_info;
|
||||
wxBoxSizer * sizer_can = {nullptr};
|
||||
wxBoxSizer * sizer_can_middle = {nullptr};
|
||||
wxBoxSizer * sizer_can_left = {nullptr};
|
||||
wxBoxSizer * sizer_can_right = {nullptr};
|
||||
AMSPassRoadSTEP m_step = {AMSPassRoadSTEP ::AMS_ROAD_STEP_NONE};
|
||||
};
|
||||
|
||||
|
@ -532,16 +565,16 @@ public:
|
|||
void init_scaled_buttons();
|
||||
|
||||
protected:
|
||||
int m_ams_count = {0};
|
||||
|
||||
std::map<std::string, int> m_ams_selection;
|
||||
std::vector<AMSinfo> m_ams_info;
|
||||
|
||||
std::string m_current_ams;
|
||||
std::string m_current_show_ams;
|
||||
|
||||
std::map<std::string, int> m_ams_selection;
|
||||
|
||||
AmsItemsHash m_ams_item_list;
|
||||
|
||||
std::vector<AMSinfo> m_ams_info;
|
||||
AmsCansHash m_ams_cans_list;
|
||||
AmsCansHash m_ams_generic_cans_list;
|
||||
AmsCansHash m_ams_extra_cans_list;
|
||||
|
||||
AMSextruder *m_extruder = {nullptr};
|
||||
|
||||
|
@ -551,7 +584,10 @@ protected:
|
|||
wxSimplebook *m_simplebook_calibration = {nullptr};
|
||||
wxSimplebook *m_simplebook_amsitems = {nullptr};
|
||||
wxSimplebook *m_simplebook_ams = {nullptr};
|
||||
wxSimplebook *m_simplebook_cans = {nullptr};
|
||||
|
||||
wxSimplebook *m_simplebook_generic_cans= {nullptr};
|
||||
wxSimplebook *m_simplebook_extra_cans = {nullptr};
|
||||
|
||||
wxSimplebook *m_simplebook_bottom = {nullptr};
|
||||
|
||||
wxStaticText *m_tip_right_top = {nullptr};
|
||||
|
@ -564,6 +600,8 @@ protected:
|
|||
wxBoxSizer* m_sizer_vams_tips = {nullptr};
|
||||
|
||||
Label* m_ams_backup_tip = {nullptr};
|
||||
Label* m_ams_tip = {nullptr};
|
||||
|
||||
Caninfo m_vams_info;
|
||||
StaticBox* m_panel_virtual = {nullptr};
|
||||
AMSLib* m_vams_lib = {nullptr};
|
||||
|
@ -584,6 +622,8 @@ protected:
|
|||
Button *m_button_extruder_back = {nullptr};
|
||||
wxStaticBitmap* m_button_ams_setting = {nullptr};
|
||||
wxStaticBitmap* m_img_ams_backup = {nullptr};
|
||||
wxStaticBitmap* m_img_amsmapping_tip = {nullptr};
|
||||
wxStaticBitmap* m_img_vams_tip = {nullptr};
|
||||
ScalableBitmap m_button_ams_setting_normal;
|
||||
ScalableBitmap m_button_ams_setting_hover;
|
||||
ScalableBitmap m_button_ams_setting_press;
|
||||
|
@ -597,16 +637,23 @@ protected:
|
|||
|
||||
std::string m_last_ams_id;
|
||||
std::string m_last_tray_id;
|
||||
|
||||
public:
|
||||
std::string GetCurentAms();
|
||||
std::string GetCurentShowAms();
|
||||
std::string GetCurrentCan(std::string amsid);
|
||||
wxColour GetCanColour(std::string amsid, std::string canid);
|
||||
|
||||
bool m_is_none_ams_mode{false};
|
||||
AMSModel m_ams_model{AMSModel::NO_AMS};
|
||||
AMSModel m_ext_model{AMSModel::NO_AMS};
|
||||
AMSModel m_is_none_ams_mode{AMSModel::NO_AMS};
|
||||
|
||||
void SetAmsModel(AMSModel mode, AMSModel ext_mode) {m_ams_model = mode; m_ext_model = ext_mode;};
|
||||
|
||||
void SetActionState(bool button_status[]);
|
||||
void EnterNoneAMSMode();
|
||||
void ExitNoneAMSMode();
|
||||
void EnterNoneAMSMode(bool support_vt_load = false);
|
||||
void EnterGenericAMSMode();
|
||||
void EnterExtraAMSMode();
|
||||
|
||||
void EnterCalibrationMode(bool read_to_calibration);
|
||||
void ExitcClibrationMode();
|
||||
|
@ -617,15 +664,16 @@ public:
|
|||
void PlayRridLoading(wxString amsid, wxString canid);
|
||||
void StopRridLoading(wxString amsid, wxString canid);
|
||||
|
||||
void SetFilamentStep(int item_idx, FilamentStepType f_type, bool is_extrusion_exist = false);
|
||||
void SetFilamentStep(int item_idx, FilamentStepType f_type);
|
||||
void ShowFilamentTip(bool hasams = true);
|
||||
|
||||
void SetHumidity(std::string amsid, int humidity);
|
||||
void UpdateStepCtrl(bool is_extrusion_exist);
|
||||
void CreateAms();
|
||||
void UpdateAms(std::vector<AMSinfo> info, bool keep_selection = true, bool has_extrusion_cali = true, bool is_reset = false);
|
||||
void AddAms(AMSinfo info, bool refresh = true);
|
||||
void SetExtruder(bool on_off, bool is_vams, wxColour col);
|
||||
void UpdateAms(std::vector<AMSinfo> info, bool keep_selection = true, bool is_reset = false);
|
||||
void AddAms(AMSinfo info);
|
||||
void AddAmsItems(AMSinfo info);
|
||||
void AddExtraAms(AMSinfo info);
|
||||
void SetExtruder(bool on_off, bool is_vams, std::string ams_now, wxColour col);
|
||||
void SetAmsStep(std::string ams_id, std::string canid, AMSPassRoadType type, AMSPassRoadSTEP step);
|
||||
void SwitchAms(std::string ams_id);
|
||||
|
||||
|
@ -639,7 +687,7 @@ public:
|
|||
void on_clibration_cancel_click(wxMouseEvent &event);
|
||||
void Reset();
|
||||
|
||||
void show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali);
|
||||
void show_noams_mode();
|
||||
void show_auto_refill(bool show);
|
||||
void show_vams(bool show);
|
||||
void show_vams_kn_value(bool show);
|
||||
|
|
|
@ -535,7 +535,7 @@ FanControlPopup::FanControlPopup(wxWindow* parent)
|
|||
SetBackgroundColour(*wxWHITE);
|
||||
}
|
||||
|
||||
void FanControlPopup::update_show_mode(bool support_cham_fun)
|
||||
void FanControlPopup::show_cham_fan(bool support_cham_fun)
|
||||
{
|
||||
|
||||
if (support_cham_fun && !m_is_suppt_cham_fun) {
|
||||
|
@ -554,10 +554,30 @@ void FanControlPopup::update_show_mode(bool support_cham_fun)
|
|||
m_is_suppt_cham_fun = support_cham_fun;
|
||||
}
|
||||
|
||||
void FanControlPopup::show_aux_fan(bool support_aux_fun)
|
||||
{
|
||||
|
||||
if (support_aux_fun && !m_is_suppt_aux_fun) {
|
||||
m_aux_fan->Show();
|
||||
m_line_bottom->Show();
|
||||
Layout();
|
||||
Fit();
|
||||
}
|
||||
|
||||
if (!support_aux_fun && m_is_suppt_aux_fun) {
|
||||
m_aux_fan->Hide();
|
||||
m_line_bottom->Hide();
|
||||
Layout();
|
||||
Fit();
|
||||
}
|
||||
m_is_suppt_aux_fun = 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);
|
||||
update_show_mode(m_is_suppt_cham_fun);
|
||||
show_cham_fan(m_is_suppt_cham_fun);
|
||||
|
||||
if (type == MachineObject::FanType::COOLING_FAN && obj->cooling_fan_speed >= 0) {
|
||||
m_part_fan->set_fan_speed(obj->cooling_fan_speed);
|
||||
|
|
|
@ -154,9 +154,11 @@ private:
|
|||
wxWindow* m_line_top;
|
||||
wxWindow* m_line_bottom;
|
||||
bool m_is_suppt_cham_fun{true};
|
||||
bool m_is_suppt_aux_fun{true};
|
||||
|
||||
public:
|
||||
void update_show_mode(bool support_cham_fun);
|
||||
void show_cham_fan(bool support_cham_fun);
|
||||
void show_aux_fan(bool support_aux_fun);
|
||||
void update_fan_data(MachineObject::FanType type, MachineObject* obj);
|
||||
void on_left_down(wxMouseEvent& evt);
|
||||
void paintEvent(wxPaintEvent& evt);
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace Slic3r { namespace GUI {
|
|||
m_wifi_weak_img = ScalableBitmap(this, "monitor_signal_weak", 18);
|
||||
m_wifi_middle_img = ScalableBitmap(this, "monitor_signal_middle", 18);
|
||||
m_wifi_strong_img = ScalableBitmap(this, "monitor_signal_strong", 18);
|
||||
m_network_wired_img = ScalableBitmap(this, "monitor_network_wired", 18);
|
||||
|
||||
m_intetval_timer = new wxTimer();
|
||||
m_intetval_timer->SetOwner(this);
|
||||
|
@ -204,6 +205,7 @@ void SideToolsPanel::doRender(wxDC &dc)
|
|||
if (m_wifi_type == WifiSignal::WEAK) dc.DrawBitmap(m_wifi_weak_img.bmp(), left, (size.y - m_wifi_weak_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::MIDDLE) dc.DrawBitmap(m_wifi_middle_img.bmp(), left, (size.y - m_wifi_middle_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::STRONG) dc.DrawBitmap(m_wifi_strong_img.bmp(), left, (size.y - m_wifi_strong_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::WIRED) dc.DrawBitmap(m_network_wired_img.bmp(), left, (size.y - m_network_wired_img.GetBmpSize().y) / 2);
|
||||
}
|
||||
|
||||
if (m_hover) {
|
||||
|
@ -452,7 +454,10 @@ void SideTools::update_status(MachineObject* obj)
|
|||
m_side_tools->set_current_printer_signal(WifiSignal::NONE);
|
||||
}
|
||||
else {
|
||||
if (!obj->wifi_signal.empty() && boost::ends_with(obj->wifi_signal, "dBm")) {
|
||||
if (obj->network_wired) {
|
||||
m_side_tools->set_current_printer_signal(WifiSignal::WIRED);
|
||||
}
|
||||
else if (!obj->wifi_signal.empty() && boost::ends_with(obj->wifi_signal, "dBm")) {
|
||||
try {
|
||||
wifi_signal_val = std::stoi(obj->wifi_signal.substr(0, obj->wifi_signal.size() - 3));
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ enum WifiSignal {
|
|||
WEAK,
|
||||
MIDDLE,
|
||||
STRONG,
|
||||
WIRED,
|
||||
};
|
||||
|
||||
enum MonitorStatus {
|
||||
|
@ -58,6 +59,7 @@ private:
|
|||
ScalableBitmap m_wifi_weak_img;
|
||||
ScalableBitmap m_wifi_middle_img;
|
||||
ScalableBitmap m_wifi_strong_img;
|
||||
ScalableBitmap m_network_wired_img;
|
||||
|
||||
protected:
|
||||
wxStaticBitmap *m_bitmap_info;
|
||||
|
|
|
@ -87,6 +87,19 @@ wxString StepCtrlBase::GetItemText(unsigned int item) const
|
|||
return item < steps.size() ? steps[item] : wxString{};
|
||||
}
|
||||
|
||||
int StepCtrlBase::GetItemUseText(wxString txt) const
|
||||
{
|
||||
for(int i = 0; i < steps.size(); i++){
|
||||
if (steps[i] == txt) {
|
||||
return i;
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void StepCtrlBase::SetItemText(unsigned int item, wxString const &value)
|
||||
{
|
||||
if (item >= steps.size()) return;
|
||||
|
|
|
@ -53,7 +53,8 @@ public:
|
|||
void Idle();
|
||||
|
||||
wxString GetItemText(unsigned int item) const;
|
||||
void SetItemText(unsigned int item, wxString const &value);
|
||||
int GetItemUseText(wxString txt) const;
|
||||
void SetItemText(unsigned int item, wxString const& value);
|
||||
|
||||
private:
|
||||
// some useful events
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "CalibUtils.hpp"
|
||||
|
||||
#include "../GUI/I18N.hpp"
|
||||
#include "../GUI/GUI_App.hpp"
|
||||
#include "../GUI/DeviceManager.hpp"
|
||||
#include "../GUI/Jobs/ProgressIndicator.hpp"
|
||||
|
@ -28,6 +28,10 @@ static std::string MachineBedTypeString[5] = {
|
|||
std::string get_calib_mode_name(CalibMode cali_mode, int stage)
|
||||
{
|
||||
switch(cali_mode) {
|
||||
case CalibMode::Calib_PA_Line:
|
||||
return "pa_line_calib_mode";
|
||||
case CalibMode::Calib_PA_Pattern:
|
||||
return "pa_pattern_calib_mode";
|
||||
case CalibMode::Calib_Flow_Rate:
|
||||
if (stage == 1)
|
||||
return "flow_rate_coarse_calib_mode";
|
||||
|
@ -51,7 +55,15 @@ std::string get_calib_mode_name(CalibMode cali_mode, int stage)
|
|||
|
||||
CalibMode CalibUtils::get_calib_mode_by_name(const std::string name, int& cali_stage)
|
||||
{
|
||||
if (name == "flow_rate_coarse_calib_mode") {
|
||||
if (name == "pa_line_calib_mode") {
|
||||
cali_stage = 0;
|
||||
return CalibMode::Calib_PA_Line;
|
||||
}
|
||||
else if (name == "pa_pattern_calib_mode") {
|
||||
cali_stage = 1;
|
||||
return CalibMode::Calib_PA_Line;
|
||||
}
|
||||
else if (name == "flow_rate_coarse_calib_mode") {
|
||||
cali_stage = 1;
|
||||
return CalibMode::Calib_Flow_Rate;
|
||||
}
|
||||
|
@ -170,7 +182,7 @@ std::array<Vec3d, 4> get_cut_plane_points(const BoundingBoxf3 &bbox, const doubl
|
|||
return plane_pts;
|
||||
}
|
||||
|
||||
void CalibUtils::calib_PA(const X1CCalibInfos& calib_infos, int mode, std::string& error_message)
|
||||
void CalibUtils::calib_PA(const X1CCalibInfos& calib_infos, int mode, wxString& error_message)
|
||||
{
|
||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev)
|
||||
|
@ -348,7 +360,7 @@ bool CalibUtils::get_flow_ratio_calib_results(std::vector<FlowRatioCalibResult>&
|
|||
return flow_ratio_calib_results.size() > 0;
|
||||
}
|
||||
|
||||
void CalibUtils::calib_flowrate(int pass, const CalibInfo& calib_info, std::string& error_message)
|
||||
void CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
if (pass != 1 && pass != 2)
|
||||
return;
|
||||
|
@ -443,16 +455,78 @@ void CalibUtils::calib_flowrate(int pass, const CalibInfo& calib_info, std::stri
|
|||
send_to_print(calib_info, error_message, pass);
|
||||
}
|
||||
|
||||
void CalibUtils::calib_generic_PA(const CalibInfo &calib_info, std::string &error_message)
|
||||
void CalibUtils::calib_pa_pattern(const CalibInfo &calib_info, Model& model)
|
||||
{
|
||||
DynamicPrintConfig& print_config = calib_info.print_prest->config;
|
||||
DynamicPrintConfig& filament_config = calib_info.filament_prest->config;
|
||||
DynamicPrintConfig& printer_config = calib_info.printer_prest->config;
|
||||
|
||||
DynamicPrintConfig full_config;
|
||||
full_config.apply(FullPrintConfig::defaults());
|
||||
full_config.apply(print_config);
|
||||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
float nozzle_diameter = printer_config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0);
|
||||
|
||||
for (const auto opt : SuggestedConfigCalibPAPattern().float_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloat(opt.second));
|
||||
}
|
||||
|
||||
print_config.set_key_value("outer_wall_speed",
|
||||
new ConfigOptionFloat(CalibPressureAdvance::find_optimal_PA_speed(
|
||||
full_config, print_config.get_abs_value("line_width"),
|
||||
print_config.get_abs_value("layer_height"), 0)));
|
||||
|
||||
for (const auto opt : SuggestedConfigCalibPAPattern().nozzle_ratio_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloat(nozzle_diameter * opt.second / 100));
|
||||
}
|
||||
|
||||
for (const auto opt : SuggestedConfigCalibPAPattern().int_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionInt(opt.second));
|
||||
}
|
||||
|
||||
print_config.set_key_value(SuggestedConfigCalibPAPattern().brim_pair.first,
|
||||
new ConfigOptionEnum<BrimType>(SuggestedConfigCalibPAPattern().brim_pair.second));
|
||||
|
||||
//DynamicPrintConfig full_config;
|
||||
full_config.apply(FullPrintConfig::defaults());
|
||||
full_config.apply(print_config);
|
||||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
Vec3d plate_origin(0, 0, 0);
|
||||
CalibPressureAdvancePattern pa_pattern(calib_info.params, full_config, true, model, plate_origin);
|
||||
|
||||
Pointfs bedfs = full_config.opt<ConfigOptionPoints>("printable_area")->values;
|
||||
double current_width = bedfs[2].x() - bedfs[0].x();
|
||||
double current_depth = bedfs[2].y() - bedfs[0].y();
|
||||
Vec3d half_pattern_size = Vec3d(pa_pattern.print_size_x() / 2, pa_pattern.print_size_y() / 2, 0);
|
||||
Vec3d offset = Vec3d(current_width / 2, current_depth / 2, 0) - half_pattern_size;
|
||||
pa_pattern.set_start_offset(offset);
|
||||
|
||||
pa_pattern.generate_custom_gcodes(full_config, true, model, plate_origin);
|
||||
model.calib_pa_pattern = std::make_unique<CalibPressureAdvancePattern>(pa_pattern);
|
||||
}
|
||||
|
||||
void CalibUtils::calib_generic_PA(const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
const Calib_Params ¶ms = calib_info.params;
|
||||
if (params.mode != CalibMode::Calib_PA_Line)
|
||||
if (params.mode != CalibMode::Calib_PA_Line && params.mode != CalibMode::Calib_PA_Pattern)
|
||||
return;
|
||||
|
||||
Model model;
|
||||
std::string input_file = Slic3r::resources_dir() + "/calib/pressure_advance/pressure_advance_test.stl";
|
||||
std::string input_file;
|
||||
if (params.mode == CalibMode::Calib_PA_Line)
|
||||
input_file = Slic3r::resources_dir() + "/calib/pressure_advance/pressure_advance_test.stl";
|
||||
else if (params.mode == CalibMode::Calib_PA_Pattern)
|
||||
input_file = Slic3r::resources_dir() + "/calib/pressure_advance/pa_pattern.3mf";
|
||||
|
||||
read_model_from_file(input_file, model);
|
||||
|
||||
if (params.mode == CalibMode::Calib_PA_Pattern)
|
||||
calib_pa_pattern(calib_info, model);
|
||||
|
||||
DynamicPrintConfig print_config = calib_info.print_prest->config;
|
||||
DynamicPrintConfig filament_config = calib_info.filament_prest->config;
|
||||
DynamicPrintConfig printer_config = calib_info.printer_prest->config;
|
||||
|
@ -472,7 +546,7 @@ void CalibUtils::calib_generic_PA(const CalibInfo &calib_info, std::string &erro
|
|||
send_to_print(calib_info, error_message);
|
||||
}
|
||||
|
||||
void CalibUtils::calib_temptue(const CalibInfo& calib_info, std::string& error_message)
|
||||
void CalibUtils::calib_temptue(const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
const Calib_Params ¶ms = calib_info.params;
|
||||
if (params.mode != CalibMode::Calib_Temp_Tower)
|
||||
|
@ -542,7 +616,7 @@ void CalibUtils::calib_temptue(const CalibInfo& calib_info, std::string& error_m
|
|||
send_to_print(calib_info, error_message);
|
||||
}
|
||||
|
||||
void CalibUtils::calib_max_vol_speed(const CalibInfo& calib_info, std::string& error_message)
|
||||
void CalibUtils::calib_max_vol_speed(const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
const Calib_Params ¶ms = calib_info.params;
|
||||
if (params.mode != CalibMode::Calib_Vol_speed_Tower)
|
||||
|
@ -621,7 +695,7 @@ void CalibUtils::calib_max_vol_speed(const CalibInfo& calib_info, std::string& e
|
|||
send_to_print(calib_info, error_message);
|
||||
}
|
||||
|
||||
void CalibUtils::calib_VFA(const CalibInfo& calib_info, std::string& error_message)
|
||||
void CalibUtils::calib_VFA(const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
const Calib_Params ¶ms = calib_info.params;
|
||||
if (params.mode != CalibMode::Calib_VFA_Tower)
|
||||
|
@ -662,7 +736,7 @@ void CalibUtils::calib_VFA(const CalibInfo& calib_info, std::string& error_messa
|
|||
cut_model(model, plane_pts, ModelObjectCutAttribute::KeepLower);
|
||||
}
|
||||
else {
|
||||
error_message = L("The start, end or step is not valid value.");
|
||||
error_message = _L("The start, end or step is not valid value.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -679,7 +753,7 @@ void CalibUtils::calib_VFA(const CalibInfo& calib_info, std::string& error_messa
|
|||
send_to_print(calib_info, error_message);
|
||||
}
|
||||
|
||||
void CalibUtils::calib_retraction(const CalibInfo &calib_info, std::string &error_message)
|
||||
void CalibUtils::calib_retraction(const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
const Calib_Params ¶ms = calib_info.params;
|
||||
if (params.mode != CalibMode::Calib_Retraction_tower)
|
||||
|
@ -752,7 +826,7 @@ bool CalibUtils::get_pa_k_n_value_by_cali_idx(const MachineObject *obj, int cali
|
|||
return false;
|
||||
}
|
||||
|
||||
void CalibUtils::process_and_store_3mf(Model* model, const DynamicPrintConfig& full_config, const Calib_Params& params, std::string& error_message)
|
||||
void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &full_config, const Calib_Params ¶ms, wxString &error_message)
|
||||
{
|
||||
Pointfs bedfs = full_config.opt<ConfigOptionPoints>("printable_area")->values;
|
||||
double print_height = full_config.opt_float("printable_height");
|
||||
|
@ -763,8 +837,13 @@ void CalibUtils::process_and_store_3mf(Model* model, const DynamicPrintConfig& f
|
|||
plate_size[1] = bedfs[2].y() - bedfs[0].y();
|
||||
plate_size[2] = print_height;
|
||||
|
||||
// todo: adjust the objects position
|
||||
if (model->objects.size() == 1) {
|
||||
if (params.mode == CalibMode::Calib_PA_Pattern) {
|
||||
ModelInstance *instance = model->objects[0]->instances[0];
|
||||
Vec3d offset = model->calib_pa_pattern->get_start_offset() +
|
||||
Vec3d(model->calib_pa_pattern->handle_xy_size() / 2, -model->calib_pa_pattern->handle_xy_size() / 2 - model->calib_pa_pattern->handle_spacing(), 0);
|
||||
instance->set_offset(offset);
|
||||
}
|
||||
else if (model->objects.size() == 1) {
|
||||
ModelInstance *instance = model->objects[0]->instances[0];
|
||||
instance->set_offset(instance->get_offset() + Vec3d(current_width / 2, current_depth / 2, 0));
|
||||
} else {
|
||||
|
@ -789,7 +868,7 @@ void CalibUtils::process_and_store_3mf(Model* model, const DynamicPrintConfig& f
|
|||
BuildVolume build_volume(bedfs, print_height);
|
||||
unsigned int count = model->update_print_volume_state(build_volume);
|
||||
if (count == 0) {
|
||||
error_message = L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small");
|
||||
error_message = _L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -898,8 +977,25 @@ void CalibUtils::process_and_store_3mf(Model* model, const DynamicPrintConfig& f
|
|||
release_PlateData_list(plate_data_list);
|
||||
}
|
||||
|
||||
void CalibUtils::send_to_print(const CalibInfo &calib_info, std::string &error_message, int flow_ratio_mode)
|
||||
void CalibUtils::send_to_print(const CalibInfo &calib_info, wxString &error_message, int flow_ratio_mode)
|
||||
{
|
||||
{ // before send
|
||||
json j;
|
||||
j["print"]["cali_mode"] = calib_info.params.mode;
|
||||
j["print"]["start"] = calib_info.params.start;
|
||||
j["print"]["end"] = calib_info.params.end;
|
||||
j["print"]["step"] = calib_info.params.step;
|
||||
j["print"]["print_numbers"] = calib_info.params.print_numbers;
|
||||
j["print"]["flow_ratio_mode"] = flow_ratio_mode;
|
||||
j["print"]["tray_id"] = calib_info.select_ams;
|
||||
j["print"]["dev_id"] = calib_info.dev_id;
|
||||
j["print"]["bed_type"] = calib_info.bed_type;
|
||||
j["print"]["printer_prest"] = calib_info.printer_prest ? calib_info.printer_prest->name : "";
|
||||
j["print"]["filament_prest"] = calib_info.filament_prest ? calib_info.filament_prest->name : "";
|
||||
j["print"]["print_prest"] = calib_info.print_prest ? calib_info.print_prest->name : "";
|
||||
BOOST_LOG_TRIVIAL(info) << "send_cali_job - before send: " << j.dump();
|
||||
}
|
||||
|
||||
std::string dev_id = calib_info.dev_id;
|
||||
std::string select_ams = calib_info.select_ams;
|
||||
std::shared_ptr<ProgressIndicator> process_bar = calib_info.process_bar;
|
||||
|
@ -907,35 +1003,35 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, std::string &error_m
|
|||
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) {
|
||||
error_message = L("Need select printer");
|
||||
error_message = _L("Need select printer");
|
||||
return;
|
||||
}
|
||||
|
||||
MachineObject* obj_ = dev->get_selected_machine();
|
||||
if (obj_ == nullptr) {
|
||||
error_message = L("Need select printer");
|
||||
error_message = _L("Need select printer");
|
||||
return;
|
||||
}
|
||||
|
||||
if (obj_->is_in_upgrading()) {
|
||||
error_message = L("Cannot send the print job when the printer is updating firmware");
|
||||
error_message = _L("Cannot send the print job when the printer is updating firmware");
|
||||
return;
|
||||
}
|
||||
else if (obj_->is_system_printing()) {
|
||||
error_message = L("The printer is executing instructions. Please restart printing after it ends");
|
||||
error_message = _L("The printer is executing instructions. Please restart printing after it ends");
|
||||
return;
|
||||
}
|
||||
else if (obj_->is_in_printing()) {
|
||||
error_message = L("The printer is busy on other print job");
|
||||
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)) {
|
||||
error_message = L("An SD card needs to be inserted before printing.");
|
||||
error_message = _L("An SD card needs to be inserted before printing.");
|
||||
return;
|
||||
}
|
||||
if (obj_->is_lan_mode_printer()) {
|
||||
if (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD) {
|
||||
error_message = L("An SD card needs to be inserted before printing via LAN.");
|
||||
error_message = _L("An SD card needs to be inserted before printing via LAN.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -978,23 +1074,19 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, std::string &error_m
|
|||
print_job->task_ams_mapping_info = "";
|
||||
print_job->task_use_ams = select_ams == "[254]" ? false : true;
|
||||
|
||||
CalibMode cali_mode = calib_info.params.mode;
|
||||
CalibMode cali_mode = calib_info.params.mode;
|
||||
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_->has_sdcard();
|
||||
print_job->set_print_config(MachineBedTypeString[bed_type], true, false, false, false, true);
|
||||
print_job->set_print_job_finished_event(wxGetApp().plater()->get_send_calibration_finished_event(), print_job->m_project_name);
|
||||
|
||||
{ // record the print job
|
||||
{ // after send: record the print job
|
||||
json j;
|
||||
j["print"]["cali_type"] = calib_info.params.mode;
|
||||
j["print"]["flow_ratio_mode"] = flow_ratio_mode;
|
||||
j["print"]["tray_id"] = calib_info.select_ams;
|
||||
j["print"]["dev_id"] = calib_info.dev_id;
|
||||
j["print"]["start"] = calib_info.params.start;
|
||||
j["print"]["end"] = calib_info.params.end;
|
||||
j["print"]["step"] = calib_info.params.step;
|
||||
BOOST_LOG_TRIVIAL(trace) << "send_cali_job: " << j.dump();
|
||||
j["print"]["project_name"] = print_job->m_project_name;
|
||||
j["print"]["is_cali_task"] = print_job->m_is_calibration_task;
|
||||
BOOST_LOG_TRIVIAL(info) << "send_cali_job - after send: " << j.dump();
|
||||
}
|
||||
|
||||
print_job->start();
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
|
||||
static CalibMode get_calib_mode_by_name(const std::string name, int &cali_stage);
|
||||
|
||||
static void calib_PA(const X1CCalibInfos& calib_infos, int mode, std::string& error_message);
|
||||
static void calib_PA(const X1CCalibInfos& calib_infos, int mode, wxString& error_message);
|
||||
|
||||
static void emit_get_PA_calib_results(float nozzle_diameter);
|
||||
static bool get_PA_calib_results(std::vector<PACalibResult> &pa_calib_results);
|
||||
|
@ -48,13 +48,15 @@ public:
|
|||
static void calib_flowrate_X1C(const X1CCalibInfos& calib_infos, std::string& error_message);
|
||||
static void emit_get_flow_ratio_calib_results(float nozzle_diameter);
|
||||
static bool get_flow_ratio_calib_results(std::vector<FlowRatioCalibResult> &flow_ratio_calib_results);
|
||||
static void calib_flowrate(int pass, const CalibInfo& calib_info, std::string& error_message);
|
||||
static void calib_flowrate(int pass, const CalibInfo &calib_info, wxString &error_message);
|
||||
|
||||
static void calib_generic_PA(const CalibInfo& calib_info, std::string &error_message);
|
||||
static void calib_temptue(const CalibInfo& calib_info, std::string& error_message);
|
||||
static void calib_max_vol_speed(const CalibInfo& calib_info, std::string& error_message);
|
||||
static void calib_VFA(const CalibInfo& calib_info, std::string& error_message);
|
||||
static void calib_retraction(const CalibInfo &calib_info, std::string &error_message);
|
||||
static void calib_pa_pattern(const CalibInfo &calib_info, Model &model);
|
||||
|
||||
static void calib_generic_PA(const CalibInfo &calib_info, wxString &error_message);
|
||||
static void calib_temptue(const CalibInfo &calib_info, wxString &error_message);
|
||||
static void calib_max_vol_speed(const CalibInfo &calib_info, wxString &error_message);
|
||||
static void calib_VFA(const CalibInfo &calib_info, wxString &error_message);
|
||||
static void calib_retraction(const CalibInfo &calib_info, wxString &error_message);
|
||||
|
||||
//help function
|
||||
static int get_selected_calib_idx(const std::vector<PACalibResult> &pa_calib_values, int cali_idx);
|
||||
|
@ -64,8 +66,8 @@ public:
|
|||
static bool validate_input_flow_ratio(wxString flow_ratio, float* output_value);
|
||||
|
||||
private:
|
||||
static void process_and_store_3mf(Model* model, const DynamicPrintConfig& full_config, const Calib_Params& params, std::string& error_message);
|
||||
static void send_to_print(const CalibInfo &calib_info, std::string& error_message, int flow_ratio_mode = 0); // 0: none 1: coarse 2: fine
|
||||
static void process_and_store_3mf(Model* model, const DynamicPrintConfig& full_config, const Calib_Params& params, wxString& error_message);
|
||||
static void send_to_print(const CalibInfo &calib_info, wxString& error_message, int flow_ratio_mode = 0); // 0: none 1: coarse 2: fine
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ func_get_printer_firmware NetworkAgent::get_printer_firmware_ptr = nul
|
|||
func_get_task_plate_index NetworkAgent::get_task_plate_index_ptr = nullptr;
|
||||
func_get_user_info NetworkAgent::get_user_info_ptr = nullptr;
|
||||
func_request_bind_ticket NetworkAgent::request_bind_ticket_ptr = nullptr;
|
||||
func_get_subtask_info NetworkAgent::get_subtask_info_ptr = nullptr;
|
||||
func_get_slice_info NetworkAgent::get_slice_info_ptr = nullptr;
|
||||
func_query_bind_status NetworkAgent::query_bind_status_ptr = nullptr;
|
||||
func_modify_printer_name NetworkAgent::modify_printer_name_ptr = nullptr;
|
||||
|
@ -107,6 +108,10 @@ func_track_event NetworkAgent::track_event_ptr = nullptr;
|
|||
func_track_header NetworkAgent::track_header_ptr = nullptr;
|
||||
func_track_update_property NetworkAgent::track_update_property_ptr = nullptr;
|
||||
func_track_get_property NetworkAgent::track_get_property_ptr = nullptr;
|
||||
func_put_model_mall_rating_url NetworkAgent::put_model_mall_rating_url_ptr = nullptr;
|
||||
func_get_oss_config NetworkAgent::get_oss_config_ptr = nullptr;
|
||||
func_put_rating_picture_oss NetworkAgent::put_rating_picture_oss_ptr = nullptr;
|
||||
func_get_model_mall_rating_result NetworkAgent::get_model_mall_rating_result_ptr = nullptr;
|
||||
|
||||
|
||||
NetworkAgent::NetworkAgent()
|
||||
|
@ -242,6 +247,7 @@ int NetworkAgent::initialize_network_module(bool using_backup)
|
|||
get_task_plate_index_ptr = reinterpret_cast<func_get_task_plate_index>(get_network_function("bambu_network_get_task_plate_index"));
|
||||
get_user_info_ptr = reinterpret_cast<func_get_user_info>(get_network_function("bambu_network_get_user_info"));
|
||||
request_bind_ticket_ptr = reinterpret_cast<func_request_bind_ticket>(get_network_function("bambu_network_request_bind_ticket"));
|
||||
get_subtask_info_ptr = reinterpret_cast<func_get_subtask_info>(get_network_function("bambu_network_get_subtask_info"));
|
||||
get_slice_info_ptr = reinterpret_cast<func_get_slice_info>(get_network_function("bambu_network_get_slice_info"));
|
||||
query_bind_status_ptr = reinterpret_cast<func_query_bind_status>(get_network_function("bambu_network_query_bind_status"));
|
||||
modify_printer_name_ptr = reinterpret_cast<func_modify_printer_name>(get_network_function("bambu_network_modify_printer_name"));
|
||||
|
@ -259,6 +265,10 @@ int NetworkAgent::initialize_network_module(bool using_backup)
|
|||
track_header_ptr = reinterpret_cast<func_track_header>(get_network_function("bambu_network_track_header"));
|
||||
track_update_property_ptr = reinterpret_cast<func_track_update_property>(get_network_function("bambu_network_track_update_property"));
|
||||
track_get_property_ptr = reinterpret_cast<func_track_get_property>(get_network_function("bambu_network_track_get_property"));
|
||||
put_model_mall_rating_url_ptr = reinterpret_cast<func_put_model_mall_rating_url>(get_network_function("bambu_network_put_model_mall_rating"));
|
||||
get_oss_config_ptr = reinterpret_cast<func_get_oss_config>(get_network_function("bambu_network_get_oss_config"));
|
||||
put_rating_picture_oss_ptr = reinterpret_cast<func_put_rating_picture_oss>(get_network_function("bambu_network_put_rating_picture_oss"));
|
||||
get_model_mall_rating_result_ptr = reinterpret_cast<func_get_model_mall_rating_result>(get_network_function("bambu_network_get_model_mall_rating"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -347,11 +357,12 @@ int NetworkAgent::unload_network_module()
|
|||
get_printer_firmware_ptr = nullptr;
|
||||
get_task_plate_index_ptr = nullptr;
|
||||
get_user_info_ptr = nullptr;
|
||||
get_subtask_info_ptr = nullptr;
|
||||
get_slice_info_ptr = nullptr;
|
||||
query_bind_status_ptr = nullptr;
|
||||
modify_printer_name_ptr = nullptr;
|
||||
get_camera_url_ptr = nullptr;
|
||||
get_design_staffpick_ptr = nullptr;
|
||||
get_design_staffpick_ptr = nullptr;
|
||||
start_publish_ptr = nullptr;
|
||||
get_profile_3mf_ptr = nullptr;
|
||||
get_model_publish_url_ptr = nullptr;
|
||||
|
@ -364,6 +375,10 @@ int NetworkAgent::unload_network_module()
|
|||
track_header_ptr = nullptr;
|
||||
track_update_property_ptr = nullptr;
|
||||
track_get_property_ptr = nullptr;
|
||||
get_oss_config_ptr = nullptr;
|
||||
put_rating_picture_oss_ptr = nullptr;
|
||||
put_model_mall_rating_url_ptr = nullptr;
|
||||
get_model_mall_rating_result_ptr = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -878,33 +893,33 @@ int NetworkAgent::set_user_selected_machine(std::string dev_id)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::start_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn)
|
||||
int NetworkAgent::start_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && start_print_ptr) {
|
||||
ret = start_print_ptr(network_agent, params, update_fn, cancel_fn);
|
||||
ret = start_print_ptr(network_agent, params, update_fn, cancel_fn, wait_fn);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" : network_agent=%1%, ret=%2%, dev_id=%3%, task_name=%4%, project_name=%5%")
|
||||
%network_agent %ret %params.dev_id %params.task_name %params.project_name;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::start_local_print_with_record(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn)
|
||||
int NetworkAgent::start_local_print_with_record(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && start_local_print_with_record_ptr) {
|
||||
ret = start_local_print_with_record_ptr(network_agent, params, update_fn, cancel_fn);
|
||||
ret = start_local_print_with_record_ptr(network_agent, params, update_fn, cancel_fn, wait_fn);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" : network_agent=%1%, ret=%2%, dev_id=%3%, task_name=%4%, project_name=%5%")
|
||||
%network_agent %ret %params.dev_id %params.task_name %params.project_name;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::start_send_gcode_to_sdcard(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn)
|
||||
int NetworkAgent::start_send_gcode_to_sdcard(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && start_send_gcode_to_sdcard_ptr) {
|
||||
ret = start_send_gcode_to_sdcard_ptr(network_agent, params, update_fn, cancel_fn);
|
||||
ret = start_send_gcode_to_sdcard_ptr(network_agent, params, update_fn, cancel_fn, wait_fn);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" : network_agent=%1%, ret=%2%, dev_id=%3%, task_name=%4%, project_name=%5%")
|
||||
% network_agent % ret % params.dev_id % params.task_name % params.project_name;
|
||||
}
|
||||
|
@ -1071,6 +1086,17 @@ int NetworkAgent::request_bind_ticket(std::string* ticket)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::get_subtask_info(std::string subtask_id, std::string* task_json, unsigned int* http_code, std::string* http_body)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && get_subtask_info_ptr) {
|
||||
ret = get_subtask_info_ptr(network_agent, subtask_id, task_json, http_code, http_body);
|
||||
if (ret)
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format("error: network_agent=%1%, ret=%2%") % network_agent % ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::get_slice_info(std::string project_id, std::string profile_id, int plate_index, std::string* slice_json)
|
||||
{
|
||||
int ret;
|
||||
|
@ -1158,11 +1184,11 @@ int NetworkAgent::get_model_publish_url(std::string* url)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::get_subtask(BBLModelTask* task)
|
||||
int NetworkAgent::get_subtask(BBLModelTask* task, OnGetSubTaskFn getsub_fn)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && get_subtask_ptr) {
|
||||
ret = get_subtask_ptr(network_agent, task);
|
||||
ret = get_subtask_ptr(network_agent, task, getsub_fn);
|
||||
if (ret)
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%") % network_agent % ret;
|
||||
}
|
||||
|
@ -1272,4 +1298,44 @@ int NetworkAgent::track_get_property(std::string name, std::string& value, std::
|
|||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::put_model_mall_rating(int rating_id, int score, std::string content, std::vector<std::string> images, unsigned int &http_code, std::string &http_error)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && get_model_publish_url_ptr) {
|
||||
ret = put_model_mall_rating_url_ptr(network_agent, rating_id, score, content, images, http_code, http_error);
|
||||
if (ret) BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%") % network_agent % ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::get_oss_config(std::string &config, std::string country_code, unsigned int &http_code, std::string &http_error)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && get_oss_config_ptr) {
|
||||
ret = get_oss_config_ptr(network_agent, config, country_code, http_code, http_error);
|
||||
if (ret) BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%") % network_agent % ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::put_rating_picture_oss(std::string &config, std::string &pic_oss_path, std::string model_id, int profile_id, unsigned int &http_code, std::string &http_error)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && put_rating_picture_oss_ptr) {
|
||||
ret = put_rating_picture_oss_ptr(network_agent, config, pic_oss_path, model_id, profile_id, http_code, http_error);
|
||||
if (ret) BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%") % network_agent % ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::get_model_mall_rating_result(int job_id, std::string &rating_result, unsigned int &http_code, std::string &http_error)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && get_model_mall_rating_result_ptr) {
|
||||
ret = get_model_mall_rating_result_ptr(network_agent, job_id, rating_result, http_code, http_error);
|
||||
if (ret) BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%") % network_agent % ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
} //namespace
|
||||
|
|
|
@ -8,84 +8,93 @@ using namespace BBL;
|
|||
|
||||
namespace Slic3r {
|
||||
typedef bool (*func_check_debug_consistent)(bool is_debug);
|
||||
typedef std::string (*func_get_version)(void);
|
||||
typedef std::string(*func_get_version)(void);
|
||||
typedef void* (*func_create_agent)(void);
|
||||
typedef int (*func_destroy_agent)(void *agent);
|
||||
typedef int (*func_init_log)(void *agent);
|
||||
typedef int (*func_set_config_dir)(void *agent, std::string config_dir);
|
||||
typedef int (*func_set_cert_file)(void *agent, std::string folder, std::string filename);
|
||||
typedef int (*func_set_country_code)(void *agent, std::string country_code);
|
||||
typedef int (*func_start)(void *agent);
|
||||
typedef int (*func_set_on_ssdp_msg_fn)(void *agent, OnMsgArrivedFn fn);
|
||||
typedef int (*func_set_on_user_login_fn)(void *agent, OnUserLoginFn fn);
|
||||
typedef int (*func_set_on_printer_connected_fn)(void *agent, OnPrinterConnectedFn fn);
|
||||
typedef int (*func_set_on_server_connected_fn)(void *agent, OnServerConnectedFn fn);
|
||||
typedef int (*func_set_on_http_error_fn)(void *agent, OnHttpErrorFn fn);
|
||||
typedef int (*func_set_get_country_code_fn)(void *agent, GetCountryCodeFn fn);
|
||||
typedef int (*func_set_on_message_fn)(void *agent, OnMessageFn fn);
|
||||
typedef int (*func_set_on_local_connect_fn)(void *agent, OnLocalConnectedFn fn);
|
||||
typedef int (*func_set_on_local_message_fn)(void *agent, OnMessageFn fn);
|
||||
typedef int (*func_set_queue_on_main_fn)(void *agent, QueueOnMainFn fn);
|
||||
typedef int (*func_connect_server)(void *agent);
|
||||
typedef bool (*func_is_server_connected)(void *agent);
|
||||
typedef int (*func_refresh_connection)(void *agent);
|
||||
typedef int (*func_start_subscribe)(void *agent, std::string module);
|
||||
typedef int (*func_stop_subscribe)(void *agent, std::string module);
|
||||
typedef int (*func_send_message)(void *agent, std::string dev_id, std::string json_str, int qos);
|
||||
typedef int (*func_connect_printer)(void *agent, std::string dev_id, std::string dev_ip, std::string username, std::string password, bool use_ssl);
|
||||
typedef int (*func_disconnect_printer)(void *agent);
|
||||
typedef int (*func_send_message_to_printer)(void *agent, std::string dev_id, std::string json_str, int qos);
|
||||
typedef bool (*func_start_discovery)(void *agent, bool start, bool sending);
|
||||
typedef int (*func_change_user)(void *agent, std::string user_info);
|
||||
typedef bool (*func_is_user_login)(void *agent);
|
||||
typedef int (*func_user_logout)(void *agent);
|
||||
typedef std::string (*func_get_user_id)(void *agent);
|
||||
typedef std::string (*func_get_user_name)(void *agent);
|
||||
typedef std::string (*func_get_user_avatar)(void *agent);
|
||||
typedef std::string (*func_get_user_nickanme)(void *agent);
|
||||
typedef std::string (*func_build_login_cmd)(void *agent);
|
||||
typedef std::string (*func_build_logout_cmd)(void *agent);
|
||||
typedef std::string (*func_build_login_info)(void *agent);
|
||||
typedef int (*func_bind)(void *agent, std::string dev_ip, std::string dev_id, std::string sec_link, std::string timezone, bool improved, OnUpdateStatusFn update_fn);
|
||||
typedef int (*func_unbind)(void *agent, std::string dev_id);
|
||||
typedef std::string (*func_get_bambulab_host)(void *agent);
|
||||
typedef std::string (*func_get_user_selected_machine)(void *agent);
|
||||
typedef int (*func_set_user_selected_machine)(void *agent, std::string dev_id);
|
||||
typedef int (*func_start_print)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_start_local_print_with_record)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_start_send_gcode_to_sdcard)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_start_local_print)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_get_user_presets)(void *agent, std::map<std::string, std::map<std::string, std::string>>* user_presets);
|
||||
typedef std::string (*func_request_setting_id)(void *agent, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
typedef int (*func_put_setting)(void *agent, std::string setting_id, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
typedef int (*func_get_setting_list)(void *agent, std::string bundle_version, ProgressFn pro_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_delete_setting)(void *agent, std::string setting_id);
|
||||
typedef std::string (*func_get_studio_info_url)(void *agent);
|
||||
typedef int (*func_set_extra_http_header)(void *agent, std::map<std::string, std::string> extra_headers);
|
||||
typedef int (*func_get_my_message)(void *agent, int type, int after, int limit, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_check_user_task_report)(void *agent, int* task_id, bool* printable);
|
||||
typedef int (*func_get_user_print_info)(void *agent, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_get_printer_firmware)(void *agent, std::string dev_id, unsigned* http_code, std::string* http_body);
|
||||
typedef int (*func_get_task_plate_index)(void *agent, std::string task_id, int* plate_index);
|
||||
typedef int (*func_get_user_info)(void *agent, int* identifier);
|
||||
typedef int (*func_request_bind_ticket)(void *agent, std::string* ticket);
|
||||
typedef int (*func_get_slice_info)(void *agent, std::string project_id, std::string profile_id, int plate_index, std::string* slice_json);
|
||||
typedef int (*func_query_bind_status)(void *agent, std::vector<std::string> query_list, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_modify_printer_name)(void *agent, std::string dev_id, std::string dev_name);
|
||||
typedef int (*func_get_camera_url)(void *agent, std::string dev_id, std::function<void(std::string)> callback);
|
||||
typedef int (*func_get_design_staffpick)(void *agent, int offset, int limit, std::function<void(std::string)> callback);
|
||||
typedef int (*func_start_pubilsh)(void *agent, PublishParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, std::string* out);
|
||||
typedef int (*func_get_profile_3mf)(void *agent, BBLProfile* profile);
|
||||
typedef int (*func_get_model_publish_url)(void *agent, std::string* url);
|
||||
typedef int (*func_get_subtask)(void *agent, BBLModelTask* task);
|
||||
typedef int (*func_get_model_mall_home_url)(void *agent, std::string* url);
|
||||
typedef int (*func_get_model_mall_detail_url)(void *agent, std::string* url, std::string id);
|
||||
typedef int (*func_get_my_profile)(void *agent, std::string token, unsigned int *http_code, std::string *http_body);
|
||||
typedef int (*func_track_enable)(void *agent, bool enable);
|
||||
typedef int (*func_track_event)(void *agent, std::string evt_key, std::string content);
|
||||
typedef int (*func_track_header)(void *agent, std::string header);
|
||||
typedef int (*func_track_update_property)(void *agent, std::string name, std::string value, std::string type);
|
||||
typedef int (*func_track_get_property)(void *agent, std::string name, std::string& value, std::string type);
|
||||
typedef int (*func_destroy_agent)(void* agent);
|
||||
typedef int (*func_init_log)(void* agent);
|
||||
typedef int (*func_set_config_dir)(void* agent, std::string config_dir);
|
||||
typedef int (*func_set_cert_file)(void* agent, std::string folder, std::string filename);
|
||||
typedef int (*func_set_country_code)(void* agent, std::string country_code);
|
||||
typedef int (*func_start)(void* agent);
|
||||
typedef int (*func_set_on_ssdp_msg_fn)(void* agent, OnMsgArrivedFn fn);
|
||||
typedef int (*func_set_on_user_login_fn)(void* agent, OnUserLoginFn fn);
|
||||
typedef int (*func_set_on_printer_connected_fn)(void* agent, OnPrinterConnectedFn fn);
|
||||
typedef int (*func_set_on_server_connected_fn)(void* agent, OnServerConnectedFn fn);
|
||||
typedef int (*func_set_on_http_error_fn)(void* agent, OnHttpErrorFn fn);
|
||||
typedef int (*func_set_get_country_code_fn)(void* agent, GetCountryCodeFn fn);
|
||||
typedef int (*func_set_on_message_fn)(void* agent, OnMessageFn fn);
|
||||
typedef int (*func_set_on_local_connect_fn)(void* agent, OnLocalConnectedFn fn);
|
||||
typedef int (*func_set_on_local_message_fn)(void* agent, OnMessageFn fn);
|
||||
typedef int (*func_set_queue_on_main_fn)(void* agent, QueueOnMainFn fn);
|
||||
typedef int (*func_connect_server)(void* agent);
|
||||
typedef bool (*func_is_server_connected)(void* agent);
|
||||
typedef int (*func_refresh_connection)(void* agent);
|
||||
typedef int (*func_start_subscribe)(void* agent, std::string module);
|
||||
typedef int (*func_stop_subscribe)(void* agent, std::string module);
|
||||
typedef int (*func_send_message)(void* agent, std::string dev_id, std::string json_str, int qos);
|
||||
typedef int (*func_connect_printer)(void* agent, std::string dev_id, std::string dev_ip, std::string username, std::string password, bool use_ssl);
|
||||
typedef int (*func_disconnect_printer)(void* agent);
|
||||
typedef int (*func_send_message_to_printer)(void* agent, std::string dev_id, std::string json_str, int qos);
|
||||
typedef bool (*func_start_discovery)(void* agent, bool start, bool sending);
|
||||
typedef int (*func_change_user)(void* agent, std::string user_info);
|
||||
typedef bool (*func_is_user_login)(void* agent);
|
||||
typedef int (*func_user_logout)(void* agent);
|
||||
typedef std::string(*func_get_user_id)(void* agent);
|
||||
typedef std::string(*func_get_user_name)(void* agent);
|
||||
typedef std::string(*func_get_user_avatar)(void* agent);
|
||||
typedef std::string(*func_get_user_nickanme)(void* agent);
|
||||
typedef std::string(*func_build_login_cmd)(void* agent);
|
||||
typedef std::string(*func_build_logout_cmd)(void* agent);
|
||||
typedef std::string(*func_build_login_info)(void* agent);
|
||||
typedef int (*func_bind)(void* agent, std::string dev_ip, std::string dev_id, std::string sec_link, std::string timezone, bool improved, OnUpdateStatusFn update_fn);
|
||||
typedef int (*func_unbind)(void* agent, std::string dev_id);
|
||||
typedef std::string(*func_get_bambulab_host)(void* agent);
|
||||
typedef std::string(*func_get_user_selected_machine)(void* agent);
|
||||
typedef int (*func_set_user_selected_machine)(void* agent, std::string dev_id);
|
||||
typedef int (*func_start_print)(void* agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn);
|
||||
typedef int (*func_start_local_print_with_record)(void* agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn);
|
||||
typedef int (*func_start_send_gcode_to_sdcard)(void* agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn);
|
||||
typedef int (*func_start_local_print)(void* agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_get_user_presets)(void* agent, std::map<std::string, std::map<std::string, std::string>>* user_presets);
|
||||
typedef std::string(*func_request_setting_id)(void* agent, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
typedef int (*func_put_setting)(void* agent, std::string setting_id, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
typedef int (*func_get_setting_list)(void* agent, std::string bundle_version, ProgressFn pro_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_get_setting_list2)(void* agent, std::string bundle_version, CheckFn chk_fn, ProgressFn pro_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_delete_setting)(void* agent, std::string setting_id);
|
||||
typedef std::string(*func_get_studio_info_url)(void* agent);
|
||||
typedef int (*func_set_extra_http_header)(void* agent, std::map<std::string, std::string> extra_headers);
|
||||
typedef int (*func_get_my_message)(void* agent, int type, int after, int limit, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_check_user_task_report)(void* agent, int* task_id, bool* printable);
|
||||
typedef int (*func_check_user_report)(void* agent, int* task_id, bool* printable, std::string* report_url);
|
||||
typedef int (*func_get_user_print_info)(void* agent, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_get_printer_firmware)(void* agent, std::string dev_id, unsigned* http_code, std::string* http_body);
|
||||
typedef int (*func_get_task_plate_index)(void* agent, std::string task_id, int* plate_index);
|
||||
typedef int (*func_get_user_info)(void* agent, int* identifier);
|
||||
typedef int (*func_request_bind_ticket)(void* agent, std::string* ticket);
|
||||
typedef int (*func_get_subtask_info)(void* agent, std::string subtask_id, std::string* task_json, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_get_slice_info)(void* agent, std::string project_id, std::string profile_id, int plate_index, std::string* slice_json);
|
||||
typedef int (*func_query_bind_status)(void* agent, std::vector<std::string> query_list, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_modify_printer_name)(void* agent, std::string dev_id, std::string dev_name);
|
||||
typedef int (*func_get_camera_url)(void* agent, std::string dev_id, std::function<void(std::string)> callback);
|
||||
typedef int (*func_get_design_staffpick)(void* agent, int offset, int limit, std::function<void(std::string)> callback);
|
||||
typedef int (*func_start_pubilsh)(void* agent, PublishParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, std::string* out);
|
||||
typedef int (*func_get_profile_3mf)(void* agent, BBLProfile* profile);
|
||||
typedef int (*func_get_model_publish_url)(void* agent, std::string* url);
|
||||
typedef int (*func_get_subtask)(void* agent, BBLModelTask* task, OnGetSubTaskFn getsub_fn);
|
||||
typedef int (*func_get_model_mall_home_url)(void* agent, std::string* url);
|
||||
typedef int (*func_get_model_mall_detail_url)(void* agent, std::string* url, std::string id);
|
||||
typedef int (*func_get_my_profile)(void* agent, std::string token, unsigned int* http_code, std::string* http_body);
|
||||
typedef int (*func_track_enable)(void* agent, bool enable);
|
||||
typedef int (*func_track_event)(void* agent, std::string evt_key, std::string content);
|
||||
typedef int (*func_track_header)(void* agent, std::string header);
|
||||
typedef int (*func_track_update_property)(void* agent, std::string name, std::string value, std::string type);
|
||||
typedef int (*func_track_get_property)(void* agent, std::string name, std::string& value, std::string type);
|
||||
typedef int (*func_put_model_mall_rating_url)(
|
||||
void* agent, int rating_id, int score, std::string content, std::vector<std::string> images, unsigned int& http_code, std::string& http_error);
|
||||
typedef int (*func_get_oss_config)(void* agent, std::string& config, std::string country_code, unsigned int& http_code, std::string& http_error);
|
||||
typedef int (*func_put_rating_picture_oss)(
|
||||
void* agent, std::string& config, std::string& pic_oss_path, std::string model_id, int profile_id, unsigned int& http_code, std::string& http_error);
|
||||
typedef int (*func_get_model_mall_rating_result)(void* agent, int job_id, std::string& rating_result, unsigned int& http_code, std::string& http_error);
|
||||
|
||||
|
||||
//the NetworkAgent class
|
||||
|
@ -140,29 +149,32 @@ public:
|
|||
std::string build_login_cmd();
|
||||
std::string build_logout_cmd();
|
||||
std::string build_login_info();
|
||||
int bind(std::string dev_ip, std::string dev_id, std::string sec_link, std::string timezone, bool improved, OnUpdateStatusFn update_fn);
|
||||
int bind(std::string dev_ip, std::string dev_id, std::string sec_link, std::string timezone, bool improved, OnUpdateStatusFn update_fn);
|
||||
int unbind(std::string dev_id);
|
||||
std::string get_bambulab_host();
|
||||
std::string get_user_selected_machine();
|
||||
int set_user_selected_machine(std::string dev_id);
|
||||
int start_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int start_local_print_with_record(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int start_send_gcode_to_sdcard(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int start_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn);
|
||||
int start_local_print_with_record(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn);
|
||||
int start_send_gcode_to_sdcard(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn);
|
||||
int start_local_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int get_user_presets(std::map<std::string, std::map<std::string, std::string>>* user_presets);
|
||||
std::string request_setting_id(std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
int put_setting(std::string setting_id, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
int get_setting_list(std::string bundle_version, ProgressFn pro_fn = nullptr, WasCancelledFn cancel_fn = nullptr);
|
||||
int get_setting_list2(std::string bundle_version, CheckFn chk_fn, ProgressFn pro_fn = nullptr, WasCancelledFn cancel_fn = nullptr);
|
||||
int delete_setting(std::string setting_id);
|
||||
std::string get_studio_info_url();
|
||||
int set_extra_http_header(std::map<std::string, std::string> extra_headers);
|
||||
int get_my_message(int type, int after, int limit, unsigned int* http_code, std::string* http_body);
|
||||
int check_user_task_report(int* task_id, bool* printable);
|
||||
int check_user_report(int* task_id, bool* printable, std::string* report_url);
|
||||
int get_user_print_info(unsigned int* http_code, std::string* http_body);
|
||||
int get_printer_firmware(std::string dev_id, unsigned* http_code, std::string* http_body);
|
||||
int get_task_plate_index(std::string task_id, int* plate_index);
|
||||
int get_user_info(int* identifier);
|
||||
int request_bind_ticket(std::string* ticket);
|
||||
int get_subtask_info(std::string subtask_id, std::string* task_json, unsigned int* http_code, std::string* http_body);
|
||||
int get_slice_info(std::string project_id, std::string profile_id, int plate_index, std::string* slice_json);
|
||||
int query_bind_status(std::vector<std::string> query_list, unsigned int* http_code, std::string* http_body);
|
||||
int modify_printer_name(std::string dev_id, std::string dev_name);
|
||||
|
@ -171,8 +183,8 @@ public:
|
|||
int start_publish(PublishParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, std::string* out);
|
||||
int get_profile_3mf(BBLProfile* profile);
|
||||
int get_model_publish_url(std::string* url);
|
||||
int get_subtask(BBLModelTask* task);
|
||||
int get_model_mall_home_url(std::string* url);
|
||||
int get_subtask(BBLModelTask* task, OnGetSubTaskFn getsub_fn);
|
||||
int get_model_mall_home_url(std::string* url);
|
||||
int get_model_mall_detail_url(std::string* url, std::string id);
|
||||
int get_my_profile(std::string token, unsigned int* http_code, std::string* http_body);
|
||||
int track_enable(bool enable);
|
||||
|
@ -180,10 +192,14 @@ public:
|
|||
int track_header(std::string header);
|
||||
int track_update_property(std::string name, std::string value, std::string type = "string");
|
||||
int track_get_property(std::string name, std::string& value, std::string type = "string");
|
||||
int put_model_mall_rating(int design_id, int score, std::string content, std::vector<std::string> images, unsigned int& http_code, std::string& http_error);
|
||||
int get_oss_config(std::string& config, std::string country_code, unsigned int& http_code, std::string& http_error);
|
||||
int put_rating_picture_oss(std::string& config, std::string& pic_oss_path, std::string model_id, int profile_id, unsigned int& http_code, std::string& http_error);
|
||||
int get_model_mall_rating_result(int job_id, std::string& rating_result, unsigned int& http_code, std::string& http_error);
|
||||
bool get_track_enable() { return enable_track; }
|
||||
private:
|
||||
bool enable_track = false;
|
||||
void* network_agent { nullptr };
|
||||
void* network_agent{ nullptr };
|
||||
|
||||
static func_check_debug_consistent check_debug_consistent_ptr;
|
||||
static func_get_version get_version_ptr;
|
||||
|
@ -237,16 +253,19 @@ private:
|
|||
static func_request_setting_id request_setting_id_ptr;
|
||||
static func_put_setting put_setting_ptr;
|
||||
static func_get_setting_list get_setting_list_ptr;
|
||||
static func_get_setting_list2 get_setting_list2_ptr;
|
||||
static func_delete_setting delete_setting_ptr;
|
||||
static func_get_studio_info_url get_studio_info_url_ptr;
|
||||
static func_set_extra_http_header set_extra_http_header_ptr;
|
||||
static func_get_my_message get_my_message_ptr;
|
||||
static func_check_user_task_report check_user_task_report_ptr;
|
||||
static func_check_user_report check_user_report_ptr;
|
||||
static func_get_user_print_info get_user_print_info_ptr;
|
||||
static func_get_printer_firmware get_printer_firmware_ptr;
|
||||
static func_get_task_plate_index get_task_plate_index_ptr;
|
||||
static func_get_user_info get_user_info_ptr;
|
||||
static func_request_bind_ticket request_bind_ticket_ptr;
|
||||
static func_get_subtask_info get_subtask_info_ptr;
|
||||
static func_get_slice_info get_slice_info_ptr;
|
||||
static func_query_bind_status query_bind_status_ptr;
|
||||
static func_modify_printer_name modify_printer_name_ptr;
|
||||
|
@ -264,6 +283,10 @@ private:
|
|||
static func_track_header track_header_ptr;
|
||||
static func_track_update_property track_update_property_ptr;
|
||||
static func_track_get_property track_get_property_ptr;
|
||||
static func_put_model_mall_rating_url put_model_mall_rating_url_ptr;
|
||||
static func_get_oss_config get_oss_config_ptr;
|
||||
static func_put_rating_picture_oss put_rating_picture_oss_ptr;
|
||||
static func_get_model_mall_rating_result get_model_mall_rating_result_ptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1260,8 +1260,14 @@ void PresetUpdater::sync(std::string http_url, std::string language, std::string
|
|||
this->p->sync_version();
|
||||
if (p->cancel)
|
||||
return;
|
||||
if (!vendors.empty())
|
||||
if (!vendors.empty()) {
|
||||
this->p->sync_config(http_url, std::move(vendors));
|
||||
if (p->cancel)
|
||||
return;
|
||||
GUI::wxGetApp().CallAfter([] {
|
||||
GUI::wxGetApp().check_config_updates_from_updater();
|
||||
});
|
||||
}
|
||||
if (p->cancel)
|
||||
return;
|
||||
this->p->sync_plugins(http_url, plugin_version);
|
||||
|
|
|
@ -27,6 +27,11 @@ namespace BBL {
|
|||
#define BAMBU_NETWORK_ERR_CANCELED -18
|
||||
#define BAMBU_NETWORK_ERR_INVALID_RESULT -19
|
||||
#define BAMBU_NETWORK_ERR_FTP_UPLOAD_FAILED -20
|
||||
#define BAMBU_NETWORK_ERR_GET_RATING_ID_FAILED -21
|
||||
#define BAMBU_NETWORK_ERR_OPEN_FILE_FAILED -22
|
||||
#define BAMBU_NETWORK_ERR_PARSE_CONFIG_FAILED -23
|
||||
#define BAMBU_NETWORK_ERR_NO_CORRESPONDING_BUCKET -24
|
||||
#define BAMBU_NETWORK_ERR_GET_INSTANCE_ID_FAILED -25
|
||||
|
||||
//bind error
|
||||
#define BAMBU_NETWORK_ERR_BIND_CREATE_SOCKET_FAILED -1010 //failed to create socket
|
||||
|
@ -50,7 +55,7 @@ namespace BBL {
|
|||
#define BAMBU_NETWORK_ERR_PRINT_WR_PATCH_PROJECT_FAILED -2080 //failed to patch project
|
||||
#define BAMBU_NETWORK_ERR_PRINT_WR_GET_MY_SETTING_FAILED -2090 //failed to get my setting
|
||||
#define BAMBU_NETWORK_ERR_PRINT_WR_FILE_NOT_EXIST -2100 //3mf file is not exists
|
||||
#define BAMBU_NETWORK_ERR_PRINT_WR_UPLOAD_3MF_TO_OSS_FAILED -2110 //failed to upload 3mf to oss
|
||||
#define BAMBU_NETWORK_ERR_PRINT_WR_UPLOAD_3MF_TO_OSS_FAILED -2110 //failed to upload 3mf to oss
|
||||
#define BAMBU_NETWORK_ERR_PRINT_WR_POST_TASK_FAILED -2120 //failed to post task
|
||||
#define BAMBU_NETWORK_ERR_PRINT_WR_UPLOAD_FTP_FAILED -2130 //failed to upload to ftp
|
||||
#define BAMBU_NETWORK_ERR_PRINT_WR_GET_USER_UPLOAD_FAILED -2140 //failed to get_user_upload
|
||||
|
@ -68,6 +73,7 @@ namespace BBL {
|
|||
#define BAMBU_NETWORK_ERR_PRINT_SP_UPLOAD_3MF_TO_OSS_FAILED -3100 //failed to upload 3mf to oss
|
||||
#define BAMBU_NETWORK_ERR_PRINT_SP_PATCH_PROJECT_FAILED -3110 //failed to patch project
|
||||
#define BAMBU_NETWORK_ERR_PRINT_SP_POST_TASK_FAILED -3120 //failed to post task
|
||||
#define BAMBU_NETWORK_ERR_PRINT_SP_WAIT_PRINTER_FAILED -3130 //failed to wait the ack from printer
|
||||
|
||||
//start_local_print error
|
||||
#define BAMBU_NETWORK_ERR_PRINT_LP_FILE_OVER_SIZE -4010 //the size of the uploaded file cannot exceed 1 GB
|
||||
|
@ -78,13 +84,13 @@ namespace BBL {
|
|||
#define BAMBU_NETWORK_ERR_PRINT_SG_UPLOAD_FTP_FAILED -5010 //failed to upload ftp
|
||||
|
||||
//connection to printer failed
|
||||
#define BAMBU_NETWORK_ERR_CONNECTION_TO_PRINTER_FAILED -6010 //Connection to printer failed
|
||||
#define BAMBU_NETWORK_ERR_CONNECTION_TO_SERVER_FAILED -6020 //Connection to server failed
|
||||
#define BAMBU_NETWORK_ERR_CONNECTION_TO_PRINTER_FAILED -6010 //Connection to printer failed
|
||||
#define BAMBU_NETWORK_ERR_CONNECTION_TO_SERVER_FAILED -6020 //Connection to server failed
|
||||
|
||||
|
||||
#define BAMBU_NETWORK_LIBRARY "bambu_networking"
|
||||
#define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent"
|
||||
#define BAMBU_NETWORK_AGENT_VERSION "01.07.04.01"
|
||||
#define BAMBU_NETWORK_AGENT_VERSION "01.07.06.01"
|
||||
|
||||
//iot preset type strings
|
||||
#define IOT_PRINTER_TYPE_STRING "printer"
|
||||
|
@ -114,6 +120,7 @@ typedef std::function<std::string()> GetCountryCodeFn;
|
|||
// print callbacks
|
||||
typedef std::function<void(int status, int code, std::string msg)> OnUpdateStatusFn;
|
||||
typedef std::function<bool()> WasCancelledFn;
|
||||
typedef std::function<bool(int status, std::string job_info)> OnWaitFn;
|
||||
// local callbacks
|
||||
typedef std::function<void(std::string dev_info_json_str)> OnMsgArrivedFn;
|
||||
// queue call to main thread
|
||||
|
@ -123,22 +130,24 @@ typedef std::function<void(int progress)> ProgressFn;
|
|||
typedef std::function<void(int retcode, std::string info)> LoginFn;
|
||||
typedef std::function<void(int result, std::string info)> ResultFn;
|
||||
typedef std::function<bool()> CancelFn;
|
||||
typedef std::function<bool(std::map<std::string, std::string> info)> CheckFn;
|
||||
|
||||
enum SendingPrintJobStage {
|
||||
PrintingStageCreate = 0,
|
||||
PrintingStageUpload = 1,
|
||||
PrintingStageWaiting = 2,
|
||||
PrintingStageSending = 3,
|
||||
PrintingStageRecord = 4,
|
||||
PrintingStageFinished = 5,
|
||||
PrintingStageERROR = 6,
|
||||
PrintingStageRecord = 4,
|
||||
PrintingStageWaitPrinter = 5,
|
||||
PrintingStageFinished = 6,
|
||||
PrintingStageERROR = 7,
|
||||
};
|
||||
|
||||
enum PublishingStage {
|
||||
PublishingCreate = 0,
|
||||
PublishingUpload = 1,
|
||||
PublishingWaiting = 2,
|
||||
PublishingJumpUrl = 3,
|
||||
PublishingCreate = 0,
|
||||
PublishingUpload = 1,
|
||||
PublishingWaiting = 2,
|
||||
PublishingJumpUrl = 3,
|
||||
};
|
||||
|
||||
enum BindJobStage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue