mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00

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
349 lines
13 KiB
C++
349 lines
13 KiB
C++
#include "PrintOptionsDialog.hpp"
|
|
#include "I18N.hpp"
|
|
#include "GUI_App.hpp"
|
|
#include "libslic3r/Utils.hpp"
|
|
|
|
static const wxColour STATIC_BOX_LINE_COL = wxColour(238, 238, 238);
|
|
static const wxColour STATIC_TEXT_CAPTION_COL = wxColour(100, 100, 100);
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
PrintOptionsDialog::PrintOptionsDialog(wxWindow* parent)
|
|
: DPIDialog(parent, wxID_ANY, _L("Print Options"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
|
|
{
|
|
this->SetDoubleBuffered(true);
|
|
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
|
|
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
|
|
|
|
SetBackgroundColour(*wxWHITE);
|
|
|
|
auto m_options_sizer = create_settings_group(this);
|
|
this->SetSizer(m_options_sizer);
|
|
this->Layout();
|
|
m_options_sizer->Fit(this);
|
|
this->Fit();
|
|
|
|
m_cb_ai_monitoring->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) {
|
|
if (obj) {
|
|
int level = ai_monitoring_level_list->GetSelection();
|
|
std::string lvl = sensitivity_level_to_msg_string((AiMonitorSensitivityLevel) level);
|
|
if (!lvl.empty())
|
|
obj->command_xcam_control_ai_monitoring(m_cb_ai_monitoring->GetValue(), lvl);
|
|
else
|
|
BOOST_LOG_TRIVIAL(warning) << "print_option: lvl = " << lvl;
|
|
}
|
|
evt.Skip();
|
|
});
|
|
|
|
m_cb_first_layer->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) {
|
|
if (obj) {
|
|
obj->command_xcam_control_first_layer_inspector(m_cb_first_layer->GetValue(), false);
|
|
}
|
|
evt.Skip();
|
|
});
|
|
|
|
m_cb_auto_recovery->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) {
|
|
if (obj) {
|
|
obj->command_xcam_control_auto_recovery_step_loss(m_cb_auto_recovery->GetValue());
|
|
}
|
|
evt.Skip();
|
|
});
|
|
|
|
m_cb_plate_mark->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) {
|
|
if (obj) {
|
|
obj->command_xcam_control_buildplate_marker_detector(m_cb_plate_mark->GetValue());
|
|
}
|
|
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);
|
|
}
|
|
|
|
PrintOptionsDialog::~PrintOptionsDialog()
|
|
{
|
|
ai_monitoring_level_list->Disconnect( wxEVT_COMBOBOX, wxCommandEventHandler(PrintOptionsDialog::set_ai_monitor_sensitivity), NULL, this );
|
|
}
|
|
|
|
void PrintOptionsDialog::on_dpi_changed(const wxRect& suggested_rect)
|
|
{
|
|
Fit();
|
|
}
|
|
|
|
void PrintOptionsDialog::update_ai_monitor_status()
|
|
{
|
|
if (m_cb_ai_monitoring->GetValue()) {
|
|
ai_monitoring_level_list->Enable();
|
|
}
|
|
else {
|
|
ai_monitoring_level_list->Disable();
|
|
}
|
|
}
|
|
|
|
void PrintOptionsDialog::update_options(MachineObject* obj_)
|
|
{
|
|
if (!obj_) return;
|
|
if (obj_->is_function_supported(PrinterFunction::FUNC_AI_MONITORING)) {
|
|
text_ai_monitoring->Show();
|
|
m_cb_ai_monitoring->Show();
|
|
text_ai_monitoring_caption->Show();
|
|
ai_monitoring_level_list->Show();
|
|
line1->Show();
|
|
}
|
|
else {
|
|
text_ai_monitoring->Hide();
|
|
m_cb_ai_monitoring->Hide();
|
|
text_ai_monitoring_caption->Hide();
|
|
ai_monitoring_level_list->Hide();
|
|
line1->Hide();
|
|
}
|
|
|
|
if (obj_->is_function_supported(PrinterFunction::FUNC_BUILDPLATE_MARKER_DETECT)) {
|
|
text_plate_mark->Show();
|
|
m_cb_plate_mark->Show();
|
|
text_plate_mark_caption->Show();
|
|
line2->Show();
|
|
}
|
|
else {
|
|
text_plate_mark->Hide();
|
|
m_cb_plate_mark->Hide();
|
|
text_plate_mark_caption->Hide();
|
|
line2->Hide();
|
|
}
|
|
|
|
if (obj_->is_function_supported(PrinterFunction::FUNC_FIRSTLAYER_INSPECT)) {
|
|
text_first_layer->Show();
|
|
m_cb_first_layer->Show();
|
|
line3->Show();
|
|
}
|
|
else {
|
|
text_first_layer->Hide();
|
|
m_cb_first_layer->Hide();
|
|
line3->Hide();
|
|
}
|
|
|
|
if (obj_->is_function_supported(PrinterFunction::FUNC_AUTO_RECOVERY_STEP_LOSS)) {
|
|
text_auto_recovery->Show();
|
|
m_cb_auto_recovery->Show();
|
|
line4->Show();
|
|
}
|
|
else {
|
|
text_auto_recovery->Hide();
|
|
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();
|
|
|
|
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)) {
|
|
if (sensitivity_level_to_msg_string(i) == obj_->xcam_ai_monitoring_sensitivity) {
|
|
ai_monitoring_level_list->SetSelection((int)i);
|
|
break;
|
|
}
|
|
}
|
|
|
|
update_ai_monitor_status();
|
|
this->Thaw();
|
|
Layout();
|
|
}
|
|
|
|
wxBoxSizer* PrintOptionsDialog::create_settings_group(wxWindow* parent)
|
|
{
|
|
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
|
|
wxBoxSizer* line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
auto m_line = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
|
|
m_line->SetBackgroundColour(wxColour(166, 169, 170));
|
|
|
|
sizer->Add(m_line, 0, wxEXPAND, 0);
|
|
|
|
// ai monitoring with levels
|
|
line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
m_cb_ai_monitoring = new CheckBox(parent);
|
|
text_ai_monitoring = new wxStaticText(parent, wxID_ANY, _L("Enable AI monitoring of printing"));
|
|
text_ai_monitoring->SetFont(Label::Body_14);
|
|
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
|
line_sizer->Add(m_cb_ai_monitoring, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
|
line_sizer->Add(text_ai_monitoring, 1, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
|
sizer->Add(0,0,0,wxTOP, FromDIP(18));
|
|
sizer->Add(line_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(18));
|
|
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
|
|
|
line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
text_ai_monitoring_caption = new wxStaticText(parent, wxID_ANY, _L("Sensitivity of pausing is"));
|
|
text_ai_monitoring_caption->SetFont(Label::Body_14);
|
|
text_ai_monitoring_caption->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
|
|
text_ai_monitoring_caption->Wrap(-1);
|
|
|
|
ai_monitoring_level_list = new ComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(100),-1), 0, NULL, wxCB_READONLY );
|
|
for (auto i = AiMonitorSensitivityLevel::LOW; i < LEVELS_NUM; i = (AiMonitorSensitivityLevel) (i + 1)) {
|
|
wxString level_option = sensitivity_level_to_label_string(i);
|
|
ai_monitoring_level_list->Append(level_option);
|
|
}
|
|
|
|
line_sizer->Add(FromDIP(30), 0, 0, 0);
|
|
line_sizer->Add(text_ai_monitoring_caption, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
|
line_sizer->Add( ai_monitoring_level_list, 0, wxEXPAND|wxALL, FromDIP(5) );
|
|
sizer->Add(line_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(18));
|
|
|
|
line1 = new StaticLine(parent, false);
|
|
line1->SetLineColour(STATIC_BOX_LINE_COL);
|
|
sizer->Add(line1, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(18));
|
|
|
|
// detection of build plate position
|
|
line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
m_cb_plate_mark = new CheckBox(parent);
|
|
text_plate_mark = new wxStaticText(parent, wxID_ANY, _L("Enable detection of build plate position"));
|
|
text_plate_mark->SetFont(Label::Body_14);
|
|
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
|
line_sizer->Add(m_cb_plate_mark, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
|
line_sizer->Add(text_plate_mark, 1, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
|
sizer->Add(line_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(18));
|
|
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
|
|
|
line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
wxString caption_text = _L(
|
|
"The localization tag of build plate is detected, and printing is paused if the tag is not in predefined range."
|
|
);
|
|
text_plate_mark_caption = new Label(parent, caption_text);
|
|
text_plate_mark_caption->Wrap(FromDIP(260));
|
|
text_plate_mark_caption->SetFont(Label::Body_14);
|
|
text_plate_mark_caption->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
|
|
line_sizer->Add(FromDIP(30), 0, 0, 0);
|
|
line_sizer->Add(text_plate_mark_caption, 1, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(0));
|
|
sizer->Add(line_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(18));
|
|
|
|
line2 = new StaticLine(parent, false);
|
|
line2->SetLineColour(STATIC_BOX_LINE_COL);
|
|
sizer->Add(line2, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
|
|
|
|
// detection of first layer
|
|
line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
m_cb_first_layer = new CheckBox(parent);
|
|
text_first_layer = new wxStaticText(parent, wxID_ANY, _L("First Layer Inspection"));
|
|
text_first_layer->SetFont(Label::Body_14);
|
|
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
|
line_sizer->Add(m_cb_first_layer, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
|
line_sizer->Add(text_first_layer, 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);
|
|
|
|
line3 = new StaticLine(parent, false);
|
|
line3->SetLineColour(STATIC_BOX_LINE_COL);
|
|
sizer->Add(line3, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
|
|
|
|
// auto-recovery from step loss
|
|
line_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
m_cb_auto_recovery = new CheckBox(parent);
|
|
text_auto_recovery = new wxStaticText(parent, wxID_ANY, _L("Auto-recovery from step loss"));
|
|
text_auto_recovery->SetFont(Label::Body_14);
|
|
line_sizer->Add(FromDIP(5), 0, 0, 0);
|
|
line_sizer->Add(m_cb_auto_recovery, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
|
line_sizer->Add(text_auto_recovery, 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);
|
|
|
|
line4 = new StaticLine(parent, false);
|
|
line4->SetLineColour(wxColour(255,255,255));
|
|
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;
|
|
}
|
|
|
|
wxString PrintOptionsDialog::sensitivity_level_to_label_string(enum AiMonitorSensitivityLevel level) {
|
|
switch (level) {
|
|
case LOW:
|
|
return _L("Low");
|
|
case MEDIUM:
|
|
return _L("Medium");
|
|
case HIGH:
|
|
return _L("High");
|
|
default:
|
|
return "";
|
|
}
|
|
return "";
|
|
}
|
|
|
|
std::string PrintOptionsDialog::sensitivity_level_to_msg_string(enum AiMonitorSensitivityLevel level) {
|
|
switch (level) {
|
|
case LOW:
|
|
return "low";
|
|
case MEDIUM:
|
|
return "medium";
|
|
case HIGH:
|
|
return "high";
|
|
default:
|
|
return "";
|
|
}
|
|
return "";
|
|
}
|
|
|
|
void PrintOptionsDialog::set_ai_monitor_sensitivity(wxCommandEvent& evt)
|
|
{
|
|
int level = ai_monitoring_level_list->GetSelection();
|
|
std::string lvl = sensitivity_level_to_msg_string((AiMonitorSensitivityLevel)level);
|
|
|
|
if (obj && !lvl.empty()) {
|
|
obj->command_xcam_control_ai_monitoring(m_cb_ai_monitoring->GetValue(), lvl);
|
|
} else {
|
|
BOOST_LOG_TRIVIAL(warning) << "print_option: obj is null or lvl = " << lvl;
|
|
}
|
|
}
|
|
|
|
void PrintOptionsDialog::update_machine_obj(MachineObject *obj_)
|
|
{
|
|
obj = obj_;
|
|
}
|
|
|
|
bool PrintOptionsDialog::Show(bool show)
|
|
{
|
|
if (show) {
|
|
wxGetApp().UpdateDlgDarkUI(this);
|
|
CentreOnParent();
|
|
}
|
|
return DPIDialog::Show(show);
|
|
}
|
|
|
|
}} // namespace Slic3r::GUI
|