mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
FIX: fix calibration bug
Change-Id: I522d7b4bca878f0bcb2d142ec7fda08f33d386d5
This commit is contained in:
parent
1aa51e9a99
commit
8c9fa51f3d
2 changed files with 32 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Slic3r { namespace GUI {
|
namespace Slic3r { namespace GUI {
|
||||||
|
|
||||||
//#define CALIBRATION_DEBUG
|
#define CALIBRATION_DEBUG
|
||||||
|
|
||||||
#define PRESET_GAP FromDIP(25)
|
#define PRESET_GAP FromDIP(25)
|
||||||
#define CALIBRATION_COMBOX_SIZE wxSize(FromDIP(500), FromDIP(24))
|
#define CALIBRATION_COMBOX_SIZE wxSize(FromDIP(500), FromDIP(24))
|
||||||
|
@ -836,13 +836,14 @@ void CalibrationWizard::show_page(CalibrationWizardPage* page) {
|
||||||
|
|
||||||
void CalibrationWizard::on_click_btn_prev(IntEvent& event)
|
void CalibrationWizard::on_click_btn_prev(IntEvent& event)
|
||||||
{
|
{
|
||||||
|
bool recalibration = false;
|
||||||
ButtonType button_type = static_cast<ButtonType>(event.get_data());
|
ButtonType button_type = static_cast<ButtonType>(event.get_data());
|
||||||
switch (button_type)
|
switch (button_type)
|
||||||
{
|
{
|
||||||
case Slic3r::GUI::Back:
|
case Slic3r::GUI::Back:
|
||||||
show_page(get_curr_page()->get_prev_page());
|
show_page(get_curr_page()->get_prev_page());
|
||||||
break;
|
break;
|
||||||
case Slic3r::GUI::Recalibrate:
|
case Slic3r::GUI::Recalibrate: {
|
||||||
if (!curr_obj ||
|
if (!curr_obj ||
|
||||||
curr_obj->is_system_printing() ||
|
curr_obj->is_system_printing() ||
|
||||||
curr_obj->is_in_printing()) {
|
curr_obj->is_in_printing()) {
|
||||||
|
@ -850,7 +851,20 @@ void CalibrationWizard::on_click_btn_prev(IntEvent& event)
|
||||||
msg_dlg.ShowModal();
|
msg_dlg.ShowModal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
MessageDialog msg_dlg(nullptr, _L("It will restart to get the results. Do you confirm to recalibrate?"), wxEmptyString, wxICON_WARNING | wxYES | wxNO);
|
||||||
|
auto answer = msg_dlg.ShowModal();
|
||||||
|
if (answer == wxID_NO)
|
||||||
|
return;
|
||||||
|
recalibration = true;
|
||||||
|
}
|
||||||
case Slic3r::GUI::Restart:
|
case Slic3r::GUI::Restart:
|
||||||
|
if (!recalibration) {
|
||||||
|
MessageDialog msg_dlg(nullptr, _L("It will restart to get the results. Do you confirm to restart?"), wxEmptyString, wxICON_WARNING | wxYES | wxNO);
|
||||||
|
auto answer = msg_dlg.ShowModal();
|
||||||
|
if (answer == wxID_NO)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
init_presets_selections();
|
init_presets_selections();
|
||||||
change_ams_select_mode();
|
change_ams_select_mode();
|
||||||
wxGetApp().preset_bundle->set_calibrate_printer("");
|
wxGetApp().preset_bundle->set_calibrate_printer("");
|
||||||
|
@ -917,6 +931,15 @@ void CalibrationWizard::on_click_btn_next(IntEvent& event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string nozzle_temp_str = m_nozzle_temp->GetTextCtrl()->GetValue().ToStdString();
|
||||||
|
std::string bed_temp_str = m_bed_temp->GetTextCtrl()->GetValue().ToStdString();
|
||||||
|
std::string max_volumetric_speed_str = m_max_volumetric_speed->GetTextCtrl()->GetValue().ToStdString();
|
||||||
|
if (nozzle_temp_str.empty() || bed_temp_str.empty() || max_volumetric_speed_str.empty()) {
|
||||||
|
MessageDialog msg_dlg(nullptr, _L("The printing parameters is empty, please reselect nozzle and plate type."), wxEmptyString, wxICON_WARNING | wxOK);
|
||||||
|
msg_dlg.ShowModal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<int> tray_ids = get_selected_tray();
|
std::vector<int> tray_ids = get_selected_tray();
|
||||||
if (start_calibration(tray_ids)) {
|
if (start_calibration(tray_ids)) {
|
||||||
is_between_start_and_runing = true;
|
is_between_start_and_runing = true;
|
||||||
|
@ -1066,7 +1089,8 @@ void CalibrationWizard::update_print_progress()
|
||||||
#ifdef CALIBRATION_DEBUG
|
#ifdef CALIBRATION_DEBUG
|
||||||
if (m_curr_page->get_page_type() == PageType::Calibration)
|
if (m_curr_page->get_page_type() == PageType::Calibration)
|
||||||
#endif
|
#endif
|
||||||
if (curr_obj->print_status == "FINISH" && m_curr_page->get_page_type() == PageType::Calibration)
|
// todo: the printer status is not correct
|
||||||
|
if (/*curr_obj->print_status == "FINISH" &&*/ m_curr_page->get_page_type() == PageType::Calibration)
|
||||||
{
|
{
|
||||||
m_button_abort->Enable(false);
|
m_button_abort->Enable(false);
|
||||||
m_button_abort->SetBitmap(m_bitmap_abort_disable.bmp());
|
m_button_abort->SetBitmap(m_bitmap_abort_disable.bmp());
|
||||||
|
|
|
@ -3616,6 +3616,11 @@ int MachineObject::parse_json(std::string payload)
|
||||||
vt_tray.color = "";
|
vt_tray.color = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jj["vt_tray"].contains("cali_idx"))
|
||||||
|
vt_tray.cali_idx = jj["vt_tray"]["cali_idx"].get<int>();
|
||||||
|
else
|
||||||
|
vt_tray.cali_idx = -1;
|
||||||
|
|
||||||
vt_tray.cols.clear();
|
vt_tray.cols.clear();
|
||||||
if (jj["vt_tray"].contains("cols")) {
|
if (jj["vt_tray"].contains("cols")) {
|
||||||
if (jj["vt_tray"].is_array()) {
|
if (jj["vt_tray"].is_array()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue