mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	ENH: edit calibration history
Change-Id: Iec854d820dbaf456d3ae75789161dcac2a979981
This commit is contained in:
		
							parent
							
								
									dd4e6face1
								
							
						
					
					
						commit
						7fc261e644
					
				
					 5 changed files with 272 additions and 18 deletions
				
			
		|  | @ -396,10 +396,12 @@ set(SLIC3R_GUI_SOURCES | ||||||
|     GUI/CalibrationPanel.cpp |     GUI/CalibrationPanel.cpp | ||||||
|     GUI/CalibrationWizard.hpp |     GUI/CalibrationWizard.hpp | ||||||
|     GUI/CalibrationWizard.cpp |     GUI/CalibrationWizard.cpp | ||||||
|  |     GUI/EditCalibrationHistoryDialog.cpp | ||||||
|  |     GUI/EditCalibrationHistoryDialog.hpp | ||||||
|     GUI/CalibrationWizardPage.cpp |     GUI/CalibrationWizardPage.cpp | ||||||
|     GUI/CalibrationWizardPage.hpp |     GUI/CalibrationWizardPage.hpp | ||||||
| 	GUI/calib_dlg.cpp |     GUI/calib_dlg.cpp | ||||||
| 	GUI/calib_dlg.hpp |     GUI/calib_dlg.hpp | ||||||
|     GUI/Calibration.hpp |     GUI/Calibration.hpp | ||||||
|     GUI/Calibration.cpp |     GUI/Calibration.cpp | ||||||
|     GUI/PrintOptionsDialog.hpp |     GUI/PrintOptionsDialog.hpp | ||||||
|  |  | ||||||
|  | @ -1009,6 +1009,7 @@ void CalibrationWizard::on_click_btn_next(IntEvent& event) | ||||||
|         show_page(get_curr_page()->get_next_page()); |         show_page(get_curr_page()->get_next_page()); | ||||||
|         break; |         break; | ||||||
|     case Slic3r::GUI::Next: |     case Slic3r::GUI::Next: | ||||||
|  |         set_save_name(); | ||||||
|         show_page(get_curr_page()->get_next_page()); |         show_page(get_curr_page()->get_next_page()); | ||||||
|         save_to_printer_calib_info(m_curr_page->get_page_type()); |         save_to_printer_calib_info(m_curr_page->get_page_type()); | ||||||
|         break; |         break; | ||||||
|  | @ -1720,7 +1721,6 @@ void CalibrationWizard::on_select_tray(SimpleEvent& evt) { | ||||||
|         Layout(); |         Layout(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     set_save_name(); |  | ||||||
|     recommend_input_value(); |     recommend_input_value(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -1995,8 +1995,8 @@ void HistoryWindow::create() { | ||||||
|     SetSizer(main_sizer); |     SetSizer(main_sizer); | ||||||
|     Layout(); |     Layout(); | ||||||
|     Fit(); |     Fit(); | ||||||
|     SetMinSize(wxSize(FromDIP(800), FromDIP(600))); |     SetMinSize(wxSize(FromDIP(960), FromDIP(720))); | ||||||
|     SetSize(wxSize(FromDIP(800), FromDIP(600))); |     SetSize(wxSize(FromDIP(960), FromDIP(720))); | ||||||
|     CenterOnParent(); |     CenterOnParent(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -2222,7 +2222,7 @@ void PressureAdvanceWizard::sync_history_window_data() { | ||||||
|     history_data_panel->DestroyChildren(); |     history_data_panel->DestroyChildren(); | ||||||
| 
 | 
 | ||||||
|     wxGridBagSizer* gbSizer; |     wxGridBagSizer* gbSizer; | ||||||
|     gbSizer = new wxGridBagSizer(FromDIP(0), FromDIP(80)); |     gbSizer = new wxGridBagSizer(FromDIP(15), FromDIP(0)); | ||||||
|     gbSizer->SetFlexibleDirection(wxBOTH); |     gbSizer->SetFlexibleDirection(wxBOTH); | ||||||
|     gbSizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); |     gbSizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); | ||||||
| 
 | 
 | ||||||
|  | @ -2230,23 +2230,24 @@ void PressureAdvanceWizard::sync_history_window_data() { | ||||||
| 
 | 
 | ||||||
|     auto title_nozzle = new wxStaticText(history_data_panel, wxID_ANY, _L("Nozzle Diameter")); |     auto title_nozzle = new wxStaticText(history_data_panel, wxID_ANY, _L("Nozzle Diameter")); | ||||||
|     title_nozzle->SetFont(Label::Head_14); |     title_nozzle->SetFont(Label::Head_14); | ||||||
|     gbSizer->Add(title_nozzle, { 0, 0 }, {1, 1}, wxBOTTOM, FromDIP(25)); |     gbSizer->Add(title_nozzle, { 0, 0 }, {1, 1}, wxRIGHT, FromDIP(80)); | ||||||
| 
 | 
 | ||||||
|     auto title_material = new wxStaticText(history_data_panel, wxID_ANY, _L("Material")); |     auto title_material = new wxStaticText(history_data_panel, wxID_ANY, _L("Material")); | ||||||
|     title_material->SetFont(Label::Head_14); |     title_material->SetFont(Label::Head_14); | ||||||
|     gbSizer->Add(title_material, { 0, 1 }, { 1, 1 }, wxBOTTOM, FromDIP(25)); |     gbSizer->Add(title_material, { 0, 1 }, { 1, 1 }, wxRIGHT, FromDIP(80)); | ||||||
| 
 | 
 | ||||||
|     auto title_k = new wxStaticText(history_data_panel, wxID_ANY, _L("K")); |     auto title_k = new wxStaticText(history_data_panel, wxID_ANY, _L("K")); | ||||||
|     title_k->SetFont(Label::Head_14); |     title_k->SetFont(Label::Head_14); | ||||||
|     gbSizer->Add(title_k, { 0, 2 }, { 1, 1 }, wxBOTTOM, FromDIP(25)); |     gbSizer->Add(title_k, { 0, 2 }, { 1, 1 }, wxRIGHT, FromDIP(80)); | ||||||
| 
 | 
 | ||||||
|     auto title_n = new wxStaticText(history_data_panel, wxID_ANY, _L("N")); |     // Hide
 | ||||||
|     title_n->SetFont(Label::Head_14); |     //auto title_n = new wxStaticText(history_data_panel, wxID_ANY, _L("N"));
 | ||||||
|     gbSizer->Add(title_n, { 0, 3 }, { 1, 1 }, wxBOTTOM, FromDIP(25)); |     //title_n->SetFont(Label::Head_14);
 | ||||||
|  |     //gbSizer->Add(title_n, { 0, 3 }, { 1, 1 }, wxRIGHT, FromDIP(80));
 | ||||||
| 
 | 
 | ||||||
|     auto title_action = new wxStaticText(history_data_panel, wxID_ANY, _L("Action")); |     auto title_action = new wxStaticText(history_data_panel, wxID_ANY, _L("Action")); | ||||||
|     title_action->SetFont(Label::Head_14); |     title_action->SetFont(Label::Head_14); | ||||||
|     gbSizer->Add(title_action, { 0, 4 }, { 1, 1 }, wxBOTTOM, FromDIP(25)); |     gbSizer->Add(title_action, { 0, 3 }, { 1, 1 }); | ||||||
| 
 | 
 | ||||||
|     int i = 1; |     int i = 1; | ||||||
|     for (auto& result : m_calib_results_history) { |     for (auto& result : m_calib_results_history) { | ||||||
|  | @ -2259,6 +2260,7 @@ void PressureAdvanceWizard::sync_history_window_data() { | ||||||
|         auto n_str = wxString::Format("%.3f", result.n_coef); |         auto n_str = wxString::Format("%.3f", result.n_coef); | ||||||
|         auto k_value = new wxStaticText(history_data_panel, wxID_ANY, k_str); |         auto k_value = new wxStaticText(history_data_panel, wxID_ANY, k_str); | ||||||
|         auto n_value = new wxStaticText(history_data_panel, wxID_ANY, n_str); |         auto n_value = new wxStaticText(history_data_panel, wxID_ANY, n_str); | ||||||
|  |         n_value->Hide(); | ||||||
|         auto delete_button = new PageButton(history_data_panel, _L("Delete"), ButtonType::Back); |         auto delete_button = new PageButton(history_data_panel, _L("Delete"), ButtonType::Back); | ||||||
|         delete_button->Bind(wxEVT_BUTTON, [gbSizer, i, history_data_panel, &result](auto &e) { |         delete_button->Bind(wxEVT_BUTTON, [gbSizer, i, history_data_panel, &result](auto &e) { | ||||||
|             for (int j = 0; j < 5; j++) { |             for (int j = 0; j < 5; j++) { | ||||||
|  | @ -2270,12 +2272,32 @@ void PressureAdvanceWizard::sync_history_window_data() { | ||||||
|             history_data_panel->Fit(); |             history_data_panel->Fit(); | ||||||
|             CalibUtils::delete_PA_calib_result({result.tray_id, result.cali_idx, result.nozzle_diameter, result.filament_id}); |             CalibUtils::delete_PA_calib_result({result.tray_id, result.cali_idx, result.nozzle_diameter, result.filament_id}); | ||||||
|             }); |             }); | ||||||
|  |         auto edit_button = new PageButton(history_data_panel, _L("Edit"), ButtonType::Next); | ||||||
|  |         edit_button->Bind(wxEVT_BUTTON, [this, &result, nozzle_dia_str, k_value, n_value, material_name_value](auto& e) { | ||||||
|  |             EditCalibrationHistoryDialog dlg(m_history_page, k_value->GetLabel(), n_value->GetLabel(), material_name_value->GetLabel(), nozzle_dia_str); | ||||||
|  |             if (dlg.ShowModal() == wxID_OK) { | ||||||
|  |                 float k = 0.0f; | ||||||
|  |                 k = dlg.get_k_value(); | ||||||
|  |                 wxString new_k_str = wxString::Format("%.3f", k); | ||||||
| 
 | 
 | ||||||
|         gbSizer->Add(nozzle_dia_value, { i, 0 }, { 1, 1 }, wxBOTTOM, FromDIP(10)); |                 wxString new_material_name = dlg.get_material_name_value(); | ||||||
|         gbSizer->Add(material_name_value, { i, 1 }, { 1, 1 }, wxBOTTOM, FromDIP(10)); | 
 | ||||||
|         gbSizer->Add(k_value, { i, 2 }, { 1, 1 }, wxBOTTOM, FromDIP(10)); |                 k_value->SetLabel(new_k_str); | ||||||
|         gbSizer->Add(n_value, { i, 3 }, { 1, 1 }, wxBOTTOM, FromDIP(10)); |                 material_name_value->SetLabel(new_material_name); | ||||||
|         gbSizer->Add(delete_button, { i, 4 }, { 1, 1 }, wxBOTTOM, FromDIP(10)); |                 PACalibResult new_result = result; | ||||||
|  |                 new_result.tray_id = -1; | ||||||
|  |                 new_result.name = new_material_name.ToStdString(); | ||||||
|  |                 new_result.k_value = k; | ||||||
|  |                 CalibUtils::set_PA_calib_result({ new_result }); | ||||||
|  |             } | ||||||
|  |             }); | ||||||
|  | 
 | ||||||
|  |         gbSizer->Add(nozzle_dia_value, { i, 0 }, { 1, 1 }, wxRIGHT, FromDIP(80)); | ||||||
|  |         gbSizer->Add(material_name_value, { i, 1 }, { 1, 1 }, wxRIGHT, FromDIP(80)); | ||||||
|  |         gbSizer->Add(k_value, { i, 2 }, { 1, 1 }, wxRIGHT, FromDIP(80)); | ||||||
|  |         //gbSizer->Add(n_value, { i, 3 }, { 1, 1 }, wxRIGHT, FromDIP(80));
 | ||||||
|  |         gbSizer->Add(delete_button, { i, 3 }, { 1, 1 }, wxRIGHT, FromDIP(25)); | ||||||
|  |         gbSizer->Add(edit_button, { i, 4 }, { 1, 1 }); | ||||||
|         i++; |         i++; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -9,6 +9,7 @@ | ||||||
| #include "Widgets/ProgressBar.hpp" | #include "Widgets/ProgressBar.hpp" | ||||||
| #include "SavePresetDialog.hpp" | #include "SavePresetDialog.hpp" | ||||||
| #include "PresetComboBoxes.hpp" | #include "PresetComboBoxes.hpp" | ||||||
|  | #include "EditCalibrationHistoryDialog.hpp" | ||||||
| #include "../slic3r/Utils/CalibUtils.hpp" | #include "../slic3r/Utils/CalibUtils.hpp" | ||||||
| 
 | 
 | ||||||
| namespace Slic3r { namespace GUI { | namespace Slic3r { namespace GUI { | ||||||
|  |  | ||||||
							
								
								
									
										198
									
								
								src/slic3r/GUI/EditCalibrationHistoryDialog.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								src/slic3r/GUI/EditCalibrationHistoryDialog.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,198 @@ | ||||||
|  | #include "EditCalibrationHistoryDialog.hpp" | ||||||
|  | #include "MsgDialog.hpp" | ||||||
|  | #include "GUI_App.hpp" | ||||||
|  | 
 | ||||||
|  | namespace Slic3r { namespace GUI { | ||||||
|  | 
 | ||||||
|  | #define EDIT_HISTORY_DIALOG_INPUT_SIZE     wxSize(FromDIP(160), FromDIP(24)) | ||||||
|  | 
 | ||||||
|  | static bool validate_input_k_value(wxString k_text, float* output_value) | ||||||
|  | { | ||||||
|  |     float default_k = 0.0f; | ||||||
|  |     if (k_text.IsEmpty()) { | ||||||
|  |         *output_value = default_k; | ||||||
|  |         MessageDialog msg_dlg(nullptr, _L("Please input a valid value (K in 0~0.5)"), wxEmptyString, wxICON_WARNING | wxOK); | ||||||
|  |         msg_dlg.ShowModal(); | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     double k_value = 0.0; | ||||||
|  |     try { | ||||||
|  |         k_text.ToDouble(&k_value); | ||||||
|  |     } | ||||||
|  |     catch (...) { | ||||||
|  |         ; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (k_value < 0 || k_value > 0.5) { | ||||||
|  |         *output_value = default_k; | ||||||
|  |         MessageDialog msg_dlg(nullptr, _L("Please input a valid value (K in 0~0.5)"), wxEmptyString, wxICON_WARNING | wxOK); | ||||||
|  |         msg_dlg.ShowModal(); | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     *output_value = k_value; | ||||||
|  |     return true; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | static bool validate_input_n_value(wxString n_text, float* output_value) { | ||||||
|  |     float default_n = 1.0f; | ||||||
|  |     if (n_text.IsEmpty()) { | ||||||
|  |         *output_value = default_n; | ||||||
|  |         MessageDialog msg_dlg(nullptr, _L("Please input a valid value (N in 0.6~2.0)"), wxEmptyString, wxICON_WARNING | wxOK); | ||||||
|  |         msg_dlg.ShowModal(); | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     double n_value = 0.0; | ||||||
|  |     try { | ||||||
|  |         n_text.ToDouble(&n_value); | ||||||
|  |     } | ||||||
|  |     catch (...) { | ||||||
|  |         ; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (n_value < 0.6 || n_value > 2.0) { | ||||||
|  |         *output_value = default_n; | ||||||
|  |         MessageDialog msg_dlg(nullptr, _L("Please input a valid value (N in 0.6~2.0)"), wxEmptyString, wxICON_WARNING | wxOK); | ||||||
|  |         msg_dlg.ShowModal(); | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     *output_value = n_value; | ||||||
|  |     return true; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow* parent, wxString k, wxString n, wxString material_name, wxString nozzle_dia) | ||||||
|  |     : DPIDialog(parent, wxID_ANY, _L("Edit Pressure Advance"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) | ||||||
|  | { | ||||||
|  |     create(k, n, material_name, nozzle_dia); | ||||||
|  |     wxGetApp().UpdateDlgDarkUI(this); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | EditCalibrationHistoryDialog::~EditCalibrationHistoryDialog() { | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void EditCalibrationHistoryDialog::create(const wxString& k, const wxString& n, const wxString& material_name, const wxString& nozzle_dia) | ||||||
|  | { | ||||||
|  |     this->SetBackgroundColour(*wxWHITE); | ||||||
|  |     auto main_sizer = new wxBoxSizer(wxVERTICAL); | ||||||
|  | 
 | ||||||
|  |     auto top_panel = new wxPanel(this); | ||||||
|  |     auto panel_sizer = new wxBoxSizer(wxVERTICAL); | ||||||
|  |     top_panel->SetSizer(panel_sizer); | ||||||
|  | 
 | ||||||
|  |     auto flex_sizer = new wxFlexGridSizer(0, 2, FromDIP(15), FromDIP(30)); | ||||||
|  |     flex_sizer->SetFlexibleDirection(wxBOTH); | ||||||
|  |     flex_sizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); | ||||||
|  | 
 | ||||||
|  |     wxStaticText* nozzle_title = new wxStaticText(top_panel, wxID_ANY, _L("Nozzle Diameter")); | ||||||
|  |     wxStaticText* nozzle_value = new wxStaticText(top_panel, wxID_ANY, nozzle_dia); | ||||||
|  |     flex_sizer->Add(nozzle_title); | ||||||
|  |     flex_sizer->Add(nozzle_value); | ||||||
|  | 
 | ||||||
|  |     wxStaticText* material_name_title = new wxStaticText(top_panel, wxID_ANY, _L("Material")); | ||||||
|  |     TextInput* material_name_value = new TextInput(top_panel, material_name, "", "", wxDefaultPosition, EDIT_HISTORY_DIALOG_INPUT_SIZE, wxTE_PROCESS_ENTER); | ||||||
|  |     m_material_name = material_name.ToStdString(); | ||||||
|  |     material_name_value->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this, material_name_value](auto& e) { | ||||||
|  |         if (!material_name_value->GetTextCtrl()->GetValue().IsEmpty()) | ||||||
|  |             m_material_name = material_name_value->GetTextCtrl()->GetValue().ToStdString(); | ||||||
|  |         }); | ||||||
|  |     material_name_value->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [this, material_name_value](auto& e) { | ||||||
|  |         if (!material_name_value->GetTextCtrl()->GetValue().IsEmpty()) | ||||||
|  |             m_material_name = material_name_value->GetTextCtrl()->GetValue().ToStdString(); | ||||||
|  |         e.Skip(); | ||||||
|  |         }); | ||||||
|  |     flex_sizer->Add(material_name_title); | ||||||
|  |     flex_sizer->Add(material_name_value); | ||||||
|  | 
 | ||||||
|  |     wxStaticText* k_title = new wxStaticText(top_panel, wxID_ANY, _L("K Factor")); | ||||||
|  |     TextInput* k_value = new TextInput(top_panel, k, "", "", wxDefaultPosition, EDIT_HISTORY_DIALOG_INPUT_SIZE, wxTE_PROCESS_ENTER); | ||||||
|  |     double double_k = 0.0; | ||||||
|  |     k_value->GetTextCtrl()->GetValue().ToDouble(&double_k); | ||||||
|  |     m_k_value = double_k; | ||||||
|  |     k_value->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this, k_value](auto& e) { | ||||||
|  |         float k = 0.0f; | ||||||
|  |         validate_input_k_value(k_value->GetTextCtrl()->GetValue(), &k); | ||||||
|  |         wxString k_str = wxString::Format("%.3f", k); | ||||||
|  |         k_value->GetTextCtrl()->SetValue(k_str); | ||||||
|  |         m_k_value = k; | ||||||
|  |         }); | ||||||
|  |     k_value->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [this, k_value](auto& e) { | ||||||
|  |         float k = 0.0f; | ||||||
|  |         validate_input_k_value(k_value->GetTextCtrl()->GetValue(), &k); | ||||||
|  |         wxString k_str = wxString::Format("%.3f", k); | ||||||
|  |         k_value->GetTextCtrl()->SetValue(k_str); | ||||||
|  |         m_k_value = k; | ||||||
|  |         e.Skip(); | ||||||
|  |         }); | ||||||
|  |     flex_sizer->Add(k_title); | ||||||
|  |     flex_sizer->Add(k_value); | ||||||
|  | 
 | ||||||
|  |     // Hide:
 | ||||||
|  |     //wxStaticText* n_title = new wxStaticText(top_panel, wxID_ANY, _L("N Factor"));
 | ||||||
|  |     //TextInput* n_value = new TextInput(top_panel, n, "", "", wxDefaultPosition, EDIT_HISTORY_DIALOG_INPUT_SIZE, wxTE_PROCESS_ENTER);
 | ||||||
|  |     //flex_sizer->Add(n_title);
 | ||||||
|  |     //flex_sizer->Add(n_value);
 | ||||||
|  |      | ||||||
|  |     panel_sizer->Add(flex_sizer); | ||||||
|  | 
 | ||||||
|  |     panel_sizer->AddSpacer(FromDIP(25)); | ||||||
|  | 
 | ||||||
|  |     auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); | ||||||
|  |     Button* save_btn = new Button(top_panel, _L("Save")); | ||||||
|  |     StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), | ||||||
|  |         std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered), | ||||||
|  |         std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal)); | ||||||
|  |     save_btn->SetBackgroundColour(*wxWHITE); | ||||||
|  |     save_btn->SetBackgroundColor(btn_bg_green); | ||||||
|  |     save_btn->SetBorderColor(wxColour(0, 174, 66)); | ||||||
|  |     save_btn->SetTextColor(wxColour("#FFFFFE")); | ||||||
|  |     save_btn->SetMinSize(wxSize(-1, FromDIP(24))); | ||||||
|  |     save_btn->SetCornerRadius(FromDIP(12)); | ||||||
|  |     Button* cancel_btn = new Button(top_panel, _L("Cancel")); | ||||||
|  |     cancel_btn->SetBackgroundColour(*wxWHITE); | ||||||
|  |     cancel_btn->SetMinSize(wxSize(-1, FromDIP(24))); | ||||||
|  |     cancel_btn->SetCornerRadius(FromDIP(12)); | ||||||
|  |     save_btn->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_save, this); | ||||||
|  |     cancel_btn->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_cancel, this); | ||||||
|  |     btn_sizer->AddStretchSpacer(); | ||||||
|  |     btn_sizer->Add(save_btn); | ||||||
|  |     btn_sizer->AddSpacer(FromDIP(20)); | ||||||
|  |     btn_sizer->Add(cancel_btn); | ||||||
|  |     panel_sizer->Add(btn_sizer, 0, wxEXPAND, 0); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20)); | ||||||
|  | 
 | ||||||
|  |     SetSizer(main_sizer); | ||||||
|  |     Layout(); | ||||||
|  |     Fit(); | ||||||
|  |     CenterOnParent(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float EditCalibrationHistoryDialog::get_k_value(){ | ||||||
|  |     return m_k_value; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float EditCalibrationHistoryDialog::get_n_value(){ | ||||||
|  |     return m_n_value; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | wxString EditCalibrationHistoryDialog::get_material_name_value() { | ||||||
|  |     return m_material_name; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void EditCalibrationHistoryDialog::on_save(wxCommandEvent& event) { | ||||||
|  |     EndModal(wxID_OK); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void EditCalibrationHistoryDialog::on_cancel(wxCommandEvent& event) { | ||||||
|  |     EndModal(wxID_CANCEL); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void EditCalibrationHistoryDialog::on_dpi_changed(const wxRect& suggested_rect)  | ||||||
|  | { | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | }} // namespace Slic3r::GUI
 | ||||||
							
								
								
									
										31
									
								
								src/slic3r/GUI/EditCalibrationHistoryDialog.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								src/slic3r/GUI/EditCalibrationHistoryDialog.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | ||||||
|  | #ifndef slic3r_EditCalibrationHistoryDialog_hpp_ | ||||||
|  | #define slic3r_EditCalibrationHistoryDialog_hpp_ | ||||||
|  | 
 | ||||||
|  | #include "GUI_Utils.hpp" | ||||||
|  | 
 | ||||||
|  | namespace Slic3r { namespace GUI { | ||||||
|  | 
 | ||||||
|  | class EditCalibrationHistoryDialog : public DPIDialog | ||||||
|  | { | ||||||
|  | public: | ||||||
|  |     EditCalibrationHistoryDialog(wxWindow* parent, wxString k, wxString n, wxString material_name, wxString nozzle_dia); | ||||||
|  |     ~EditCalibrationHistoryDialog(); | ||||||
|  |     void on_dpi_changed(const wxRect& suggested_rect) override; | ||||||
|  |     float get_k_value(); | ||||||
|  |     float get_n_value(); | ||||||
|  |     wxString get_material_name_value(); | ||||||
|  | 
 | ||||||
|  | protected: | ||||||
|  | 	void create(const wxString& k, const wxString& n, const wxString& material_name, const wxString& nozzle_dia); | ||||||
|  | 	virtual void on_save(wxCommandEvent& event); | ||||||
|  | 	virtual void on_cancel(wxCommandEvent& event); | ||||||
|  | 
 | ||||||
|  | protected: | ||||||
|  |     float m_k_value; | ||||||
|  |     float m_n_value; | ||||||
|  |     std::string m_material_name; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | }} // namespace Slic3r::GUI
 | ||||||
|  | 
 | ||||||
|  | #endif | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 liz.li
						liz.li