mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
FIX: Modify calibration protocol
jira: none Change-Id: Ib0fdf4fd1ab514c2db4d1731ad0d37d3dc38fce5 (cherry picked from commit d479d1186a63e9432f3b063cc70c9f691cd6214b)
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Slic3r { namespace GUI {
|
||||
|
||||
wxDEFINE_EVENT(EVT_SET_FINISH_MAPPING, wxCommandEvent);
|
||||
|
||||
MaterialItem::MaterialItem(wxWindow *parent, wxColour mcolour, wxString mname)
|
||||
MaterialItem::MaterialItem(wxWindow *parent, wxColour mcolour, wxString mname)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
|
||||
{
|
||||
m_arraw_bitmap_gray = ScalableBitmap(this, "drop_down", 12);
|
||||
@@ -113,17 +113,17 @@ void MaterialItem::on_normal()
|
||||
}
|
||||
|
||||
|
||||
void MaterialItem::paintEvent(wxPaintEvent &evt)
|
||||
{
|
||||
void MaterialItem::paintEvent(wxPaintEvent &evt)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
render(dc);
|
||||
|
||||
//PrepareDC(buffdc);
|
||||
//PrepareDC(dc);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void MaterialItem::render(wxDC &dc)
|
||||
void MaterialItem::render(wxDC &dc)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
wxSize size = GetSize();
|
||||
@@ -309,7 +309,7 @@ AmsMapingPopup::AmsMapingPopup(wxWindow *parent)
|
||||
title_panel->SetBackgroundColour(wxColour(0xF8, 0xF8, 0xF8));
|
||||
title_panel->SetSize(wxSize(-1, FromDIP(30)));
|
||||
title_panel->SetMinSize(wxSize(-1, FromDIP(30)));
|
||||
|
||||
|
||||
|
||||
wxBoxSizer *title_sizer_h= new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *title_sizer_v = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -435,13 +435,13 @@ AmsMapingPopup::AmsMapingPopup(wxWindow *parent)
|
||||
return out_txt;
|
||||
}
|
||||
|
||||
void AmsMapingPopup::update_materials_list(std::vector<std::string> list)
|
||||
{
|
||||
void AmsMapingPopup::update_materials_list(std::vector<std::string> list)
|
||||
{
|
||||
m_materials_list = list;
|
||||
}
|
||||
|
||||
void AmsMapingPopup::set_tag_texture(std::string texture)
|
||||
{
|
||||
void AmsMapingPopup::set_tag_texture(std::string texture)
|
||||
{
|
||||
m_tag_material = texture;
|
||||
}
|
||||
|
||||
@@ -624,7 +624,7 @@ void AmsMapingPopup::update(MachineObject* obj)
|
||||
auto ams_mapping_item_container = new MappingContainer(nozzle_id == 0? m_right_marea_panel:m_left_marea_panel);
|
||||
ams_mapping_item_container->SetSizer(sizer_mapping_list);
|
||||
ams_mapping_item_container->Layout();
|
||||
|
||||
|
||||
m_has_unmatch_filament = false;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams_mapping ams id " << ams_iter->first.c_str();
|
||||
@@ -728,9 +728,9 @@ std::vector<TrayData> AmsMapingPopup::parse_ams_mapping(std::map<std::string, Am
|
||||
}
|
||||
|
||||
void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data, wxWindow* container, wxBoxSizer* sizer)
|
||||
{
|
||||
{
|
||||
sizer->Add(0,0,0,wxLEFT,FromDIP(6));
|
||||
|
||||
|
||||
for (auto i = 0; i < tray_data.size(); i++) {
|
||||
|
||||
// set button
|
||||
@@ -760,7 +760,7 @@ void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data, wxWindow*
|
||||
Dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// temp
|
||||
if (tray_data[i].type == EMPTY) {
|
||||
@@ -832,12 +832,12 @@ void AmsMapingPopup::OnDismiss()
|
||||
|
||||
}
|
||||
|
||||
bool AmsMapingPopup::ProcessLeftDown(wxMouseEvent &event)
|
||||
bool AmsMapingPopup::ProcessLeftDown(wxMouseEvent &event)
|
||||
{
|
||||
return PopupWindow::ProcessLeftDown(event);
|
||||
}
|
||||
|
||||
void AmsMapingPopup::paintEvent(wxPaintEvent &evt)
|
||||
void AmsMapingPopup::paintEvent(wxPaintEvent &evt)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
dc.SetPen(wxColour(0xAC, 0xAC, 0xAC));
|
||||
@@ -845,7 +845,7 @@ void AmsMapingPopup::paintEvent(wxPaintEvent &evt)
|
||||
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
|
||||
}
|
||||
|
||||
MappingItem::MappingItem(wxWindow *parent)
|
||||
MappingItem::MappingItem(wxWindow *parent)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
|
||||
{
|
||||
#ifdef __WINDOWS__
|
||||
@@ -857,27 +857,27 @@ void AmsMapingPopup::paintEvent(wxPaintEvent &evt)
|
||||
Bind(wxEVT_PAINT, &MappingItem::paintEvent, this);
|
||||
}
|
||||
|
||||
MappingItem::~MappingItem()
|
||||
MappingItem::~MappingItem()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void MappingItem::send_event(int fliament_id)
|
||||
void MappingItem::send_event(int fliament_id)
|
||||
{
|
||||
wxCommandEvent event(EVT_SET_FINISH_MAPPING);
|
||||
event.SetInt(m_tray_data.id);
|
||||
|
||||
wxString param = wxString::Format("%d|%d|%d|%d|%s|%d|%d|%d", m_coloul.Red(), m_coloul.Green(), m_coloul.Blue(), m_coloul.Alpha(), m_tray_index, fliament_id,
|
||||
wxString param = wxString::Format("%d|%d|%d|%d|%s|%d|%d|%d", m_coloul.Red(), m_coloul.Green(), m_coloul.Blue(), m_coloul.Alpha(), m_tray_index, fliament_id,
|
||||
m_tray_data.ams_id, m_tray_data.slot_id);
|
||||
event.SetString(param);
|
||||
|
||||
|
||||
if (send_win) {
|
||||
event.SetEventObject(send_win);
|
||||
wxPostEvent(send_win, event);
|
||||
}
|
||||
}
|
||||
|
||||
void MappingItem::msw_rescale()
|
||||
void MappingItem::msw_rescale()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ void MappingItem::doRender(wxDC &dc)
|
||||
}
|
||||
|
||||
|
||||
AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
|
||||
AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
|
||||
:PopupWindow(parent, wxBORDER_NONE)
|
||||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
@@ -1093,7 +1093,7 @@ void AmsMapingTipPopup::paintEvent(wxPaintEvent &evt)
|
||||
|
||||
void AmsMapingTipPopup::OnDismiss() {}
|
||||
|
||||
bool AmsMapingTipPopup::ProcessLeftDown(wxMouseEvent &event) {
|
||||
bool AmsMapingTipPopup::ProcessLeftDown(wxMouseEvent &event) {
|
||||
return PopupWindow::ProcessLeftDown(event); }
|
||||
|
||||
|
||||
@@ -1118,7 +1118,7 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent)
|
||||
m_staticText_note->SetMinSize(wxSize(FromDIP(680), -1));
|
||||
m_staticText_note->SetMaxSize(wxSize(FromDIP(680), -1));
|
||||
m_staticText_note->Wrap(FromDIP(680));
|
||||
|
||||
|
||||
|
||||
Bind(wxEVT_LEFT_UP, [this](auto& e) {
|
||||
|
||||
@@ -1130,7 +1130,7 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent)
|
||||
auto close_bottom = close_top + close_img.GetBmpHeight();
|
||||
|
||||
auto mouse_pos = ClientToScreen(e.GetPosition());
|
||||
if (mouse_pos.x > close_left
|
||||
if (mouse_pos.x > close_left
|
||||
&& mouse_pos.y > close_top
|
||||
&& mouse_pos.x < close_right
|
||||
&& mouse_pos.y < close_bottom
|
||||
@@ -1248,7 +1248,7 @@ AmsTutorialPopup::AmsTutorialPopup(wxWindow* parent)
|
||||
|
||||
tip_top = new wxStaticText(this, wxID_ANY, _L("Filament used in this print job"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
tip_top->SetForegroundColour(wxColour("#686868"));
|
||||
|
||||
|
||||
sizer_tip_top->Add(tip_top, 0, wxALL, 0);
|
||||
|
||||
|
||||
@@ -1274,7 +1274,7 @@ AmsTutorialPopup::AmsTutorialPopup(wxWindow* parent)
|
||||
sizer_top->Add(sizer_top_tips, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
wxBoxSizer* sizer_middle = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
@@ -1366,7 +1366,7 @@ AmsIntroducePopup::AmsIntroducePopup(wxWindow* parent)
|
||||
wxGetApp().UpdateDarkUIWin(this);
|
||||
}
|
||||
|
||||
void AmsIntroducePopup::set_mode(bool enable_ams)
|
||||
void AmsIntroducePopup::set_mode(bool enable_ams)
|
||||
{
|
||||
if (enable_ams) {
|
||||
m_staticText_top->SetLabelText(_L("Enable AMS"));
|
||||
@@ -1499,7 +1499,7 @@ void AmsReplaceMaterialDialog::create()
|
||||
m_scrollview_sizer->Add( m_groups_sizer, 0, wxALIGN_CENTER, 0 );
|
||||
m_scrollview_groups->SetSizer(m_scrollview_sizer);
|
||||
m_scrollview_groups->Layout();
|
||||
|
||||
|
||||
|
||||
|
||||
auto m_button_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
@@ -1527,7 +1527,7 @@ void AmsReplaceMaterialDialog::create()
|
||||
m_main_sizer->Add(0,0,0, wxTOP, FromDIP(20));
|
||||
m_main_sizer->Add(m_button_sizer,0,wxALIGN_CENTER, FromDIP(16));
|
||||
m_main_sizer->Add(0,0,0, wxTOP, FromDIP(20));
|
||||
|
||||
|
||||
|
||||
CenterOnParent();
|
||||
SetSizer(m_main_sizer);
|
||||
@@ -1610,7 +1610,7 @@ void AmsReplaceMaterialDialog::update_machine_obj(MachineObject* obj)
|
||||
if (is_in_tray || m_tray_used.size() <= 0) {
|
||||
m_groups_sizer->Add(create_backup_group(wxString::Format("%s%d", _L("Group"), group_index + 1), group_info, group_material, status_list), 0, wxALL, FromDIP(10));
|
||||
group_index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (group_index > 0) {
|
||||
@@ -1633,14 +1633,14 @@ void AmsReplaceMaterialDialog::update_machine_obj(MachineObject* obj)
|
||||
else {
|
||||
label_txt->SetLabelText(_L("If there are two identical filaments in AMS, AMS filament backup will be enabled.\n"
|
||||
"(Currently supporting automatic supply of consumables with the same brand, material type, and color)"));
|
||||
}
|
||||
}
|
||||
|
||||
label_txt->SetMinSize(wxSize(FromDIP(380), -1));
|
||||
label_txt->SetMaxSize(wxSize(FromDIP(380), -1));
|
||||
label_txt->Wrap(FromDIP(380));
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_scrollview_groups->Layout();
|
||||
Layout();
|
||||
Fit();
|
||||
@@ -1735,7 +1735,7 @@ void AmsRMGroup::on_mouse_move(wxMouseEvent& evt)
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
startAngle += ev_angle;
|
||||
}
|
||||
|
||||
@@ -1779,7 +1779,7 @@ wxPoint AmsRMGroup::CalculateEndpoint(const wxPoint& startPoint, int angle, int
|
||||
void AmsRMGroup::doRender(wxDC& dc)
|
||||
{
|
||||
wxSize size = GetSize();
|
||||
|
||||
|
||||
float center_mask_radius = FromDIP(52);
|
||||
float selected_radius = FromDIP(53);
|
||||
|
||||
@@ -1807,7 +1807,7 @@ void AmsRMGroup::doRender(wxDC& dc)
|
||||
radius = size.x / 2;
|
||||
endAngle += ev_angle;
|
||||
|
||||
|
||||
|
||||
//draw body
|
||||
if (tray_color.Alpha() != 0) {
|
||||
dc.DrawEllipticArc(x - radius, y - radius, radius * 2, radius * 2, startAngle, endAngle);
|
||||
@@ -1959,7 +1959,7 @@ void AmsHumidityLevelList::doRender(wxDC& dc)
|
||||
|
||||
|
||||
//level list
|
||||
|
||||
|
||||
for (int i = 0; i < hum_level_img_light.size(); i++) {
|
||||
if (wxGetApp().dark_mode()) {
|
||||
dc.DrawBitmap(hum_level_img_dark[i].bmp(), left, (GetSize().y - FromDIP(54)) / 2);
|
||||
@@ -1967,7 +1967,7 @@ void AmsHumidityLevelList::doRender(wxDC& dc)
|
||||
else {
|
||||
dc.DrawBitmap(hum_level_img_light[i].bmp(), left, (GetSize().y - FromDIP(54)) / 2);
|
||||
}
|
||||
|
||||
|
||||
left += FromDIP(46) + FromDIP(54);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,26 @@ namespace GUI {
|
||||
#define NEW_HISTORY_DIALOG_INPUT_SIZE wxSize(FromDIP(250), FromDIP(24))
|
||||
#define HISTORY_WINDOW_ITEMS_COUNT 5
|
||||
|
||||
enum CaliColumnType : int {
|
||||
Cali_Name = 0,
|
||||
Cali_Filament,
|
||||
Cali_Nozzle,
|
||||
Cali_K_Value,
|
||||
Cali_Delete,
|
||||
Cali_Edit,
|
||||
Cali_Type_Count
|
||||
};
|
||||
|
||||
int get_colume_idx(CaliColumnType type, MachineObject* obj)
|
||||
{
|
||||
if ((!obj || !obj->is_multi_extruders())
|
||||
&& (type > CaliColumnType::Cali_Nozzle)) {
|
||||
return type - 1;
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static wxString get_preset_name_by_filament_id(std::string filament_id)
|
||||
{
|
||||
auto preset_bundle = wxGetApp().preset_bundle;
|
||||
@@ -87,6 +107,16 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector<PACalibResult>&
|
||||
scroll_sizer->Add(mew_btn, 0, wxLEFT, FromDIP(20));
|
||||
scroll_sizer->AddSpacer(FromDIP(15));
|
||||
|
||||
m_extruder_switch_btn = new SwitchButton(scroll_window);
|
||||
m_extruder_switch_btn->SetBackgroundColour(wxColour(0, 174, 66));
|
||||
m_extruder_switch_btn->SetMinSize(wxSize(FromDIP(120), FromDIP(24)));
|
||||
m_extruder_switch_btn->SetMaxSize(wxSize(FromDIP(120), FromDIP(24)));
|
||||
m_extruder_switch_btn->SetLabels(_L("Left"), _L("Right"));
|
||||
m_extruder_switch_btn->Bind(wxEVT_TOGGLEBUTTON, &HistoryWindow::on_switch_extruder, this);
|
||||
m_extruder_switch_btn->SetValue(false);
|
||||
scroll_sizer->Add(m_extruder_switch_btn, 0, wxCENTER | wxALL, FromDIP(10));
|
||||
scroll_sizer->AddSpacer(10);
|
||||
|
||||
wxPanel* comboBox_panel = new wxPanel(scroll_window);
|
||||
comboBox_panel->SetBackgroundColour(wxColour(238, 238, 238));
|
||||
auto comboBox_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -186,6 +216,11 @@ void HistoryWindow::on_device_connected(MachineObject* obj)
|
||||
}
|
||||
m_comboBox_nozzle_dia->SetSelection(selection);
|
||||
|
||||
if (obj->is_multi_extruders())
|
||||
m_extruder_switch_btn->Show();
|
||||
else
|
||||
m_extruder_switch_btn->Hide();
|
||||
|
||||
// trigger on_select nozzle
|
||||
wxCommandEvent evt(wxEVT_COMBOBOX);
|
||||
evt.SetEventObject(m_comboBox_nozzle_dia);
|
||||
@@ -216,7 +251,12 @@ void HistoryWindow::update(MachineObject* obj)
|
||||
void HistoryWindow::on_select_nozzle(wxCommandEvent& evt)
|
||||
{
|
||||
reqeust_history_result(curr_obj);
|
||||
}
|
||||
|
||||
void HistoryWindow::on_switch_extruder(wxCommandEvent &evt)
|
||||
{
|
||||
evt.Skip();
|
||||
reqeust_history_result(curr_obj);
|
||||
}
|
||||
|
||||
void HistoryWindow::reqeust_history_result(MachineObject* obj)
|
||||
@@ -228,9 +268,11 @@ void HistoryWindow::reqeust_history_result(MachineObject* obj)
|
||||
sync_history_data();
|
||||
|
||||
float nozzle_value = get_nozzle_value();
|
||||
int extruder_id = get_extruder_id();
|
||||
if (nozzle_value > 0) {
|
||||
PACalibExtruderInfo cali_info;
|
||||
cali_info.nozzle_diameter = nozzle_value;
|
||||
cali_info.extruder_id = extruder_id;
|
||||
cali_info.use_nozzle_volume_type = false;
|
||||
CalibUtils::emit_get_PA_calib_infos(cali_info);
|
||||
m_tips->SetLabel(_L("Refreshing the historical Flow Dynamics Calibration records"));
|
||||
@@ -262,15 +304,21 @@ void HistoryWindow::sync_history_data() {
|
||||
|
||||
auto title_name = new Label(m_history_data_panel, _L("Name"));
|
||||
title_name->SetFont(Label::Head_14);
|
||||
gbSizer->Add(title_name, { 0, 0 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(title_name, {0, get_colume_idx(CaliColumnType::Cali_Name, curr_obj) }, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
|
||||
auto title_preset_name = new Label(m_history_data_panel, _L("Filament"));
|
||||
title_preset_name->SetFont(Label::Head_14);
|
||||
gbSizer->Add(title_preset_name, { 0, 1 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(title_preset_name, { 0, get_colume_idx(CaliColumnType::Cali_Filament, curr_obj) }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
|
||||
if (curr_obj && curr_obj->is_multi_extruders()) {
|
||||
auto nozzle_name = new Label(m_history_data_panel, _L("Nozzle"));
|
||||
nozzle_name->SetFont(Label::Head_14);
|
||||
gbSizer->Add(nozzle_name, {0, get_colume_idx(CaliColumnType::Cali_Nozzle, curr_obj)}, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
}
|
||||
|
||||
auto title_k = new Label(m_history_data_panel, _L("Factor K"));
|
||||
title_k->SetFont(Label::Head_14);
|
||||
gbSizer->Add(title_k, { 0, 2 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(title_k, { 0, get_colume_idx(CaliColumnType::Cali_K_Value,curr_obj) }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
|
||||
// Hide
|
||||
//auto title_n = new Label(m_history_data_panel, wxID_ANY, _L("N"));
|
||||
@@ -279,7 +327,7 @@ void HistoryWindow::sync_history_data() {
|
||||
|
||||
auto title_action = new Label(m_history_data_panel, _L("Action"));
|
||||
title_action->SetFont(Label::Head_14);
|
||||
gbSizer->Add(title_action, { 0, 3 }, { 1, 1 });
|
||||
gbSizer->Add(title_action, {0, get_colume_idx(CaliColumnType::Cali_Delete, curr_obj)}, {1, 1});
|
||||
|
||||
int i = 1;
|
||||
for (auto& result : m_calib_results_history) {
|
||||
@@ -288,6 +336,9 @@ void HistoryWindow::sync_history_data() {
|
||||
wxString preset_name = get_preset_name_by_filament_id(result.filament_id);
|
||||
auto preset_name_value = new Label(m_history_data_panel, preset_name);
|
||||
|
||||
wxString nozzle_name = get_nozzle_volume_type_name(result.nozzle_volume_type);
|
||||
auto nozzle_name_label = new Label(m_history_data_panel, nozzle_name);
|
||||
|
||||
auto k_str = wxString::Format("%.3f", result.k_value);
|
||||
auto n_str = wxString::Format("%.3f", result.n_coef);
|
||||
auto k_value = new Label(m_history_data_panel, k_str);
|
||||
@@ -342,12 +393,14 @@ void HistoryWindow::sync_history_data() {
|
||||
}
|
||||
});
|
||||
|
||||
gbSizer->Add(name_value, { i, 0 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(preset_name_value, { i, 1 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(k_value, { i, 2 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(name_value, {i, get_colume_idx(CaliColumnType::Cali_Name, curr_obj)}, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(preset_name_value, {i, get_colume_idx(CaliColumnType::Cali_Filament, curr_obj)}, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
if (curr_obj && curr_obj->is_multi_extruders())
|
||||
gbSizer->Add(nozzle_name_label, {i, get_colume_idx(CaliColumnType::Cali_Nozzle, curr_obj)}, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(k_value, {i, get_colume_idx(CaliColumnType::Cali_K_Value, curr_obj)}, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
//gbSizer->Add(n_value, { i, 3 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(delete_button, { i, 3 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(edit_button, { i, 4 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(delete_button, {i, get_colume_idx(CaliColumnType::Cali_Delete, curr_obj)}, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
gbSizer->Add(edit_button, {i, get_colume_idx(CaliColumnType::Cali_Edit, curr_obj)}, {1, 1}, wxBOTTOM, FromDIP(15));
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -372,6 +425,25 @@ float HistoryWindow::get_nozzle_value()
|
||||
return nozzle_value;
|
||||
}
|
||||
|
||||
int HistoryWindow::get_extruder_id()
|
||||
{
|
||||
if (!curr_obj) {
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
if (!curr_obj->is_multi_extruders() || !m_extruder_switch_btn)
|
||||
return -1;
|
||||
|
||||
bool is_left = !m_extruder_switch_btn->GetValue();
|
||||
bool main_on_left = curr_obj->is_main_extruder_on_left();
|
||||
|
||||
if (is_left == main_on_left) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void HistoryWindow::on_click_new_button(wxCommandEvent& event)
|
||||
{
|
||||
if (curr_obj && curr_obj->get_printer_series() == PrinterSeries::SERIES_P1P && m_calib_results_history.size() >= 16) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Widgets/ComboBox.hpp"
|
||||
#include "DeviceManager.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
class HistoryWindow : public DPIDialog {
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
~HistoryWindow();
|
||||
void on_dpi_changed(const wxRect& suggested_rect) {}
|
||||
void on_select_nozzle(wxCommandEvent& evt);
|
||||
void on_switch_extruder(wxCommandEvent &evt);
|
||||
void reqeust_history_result(MachineObject* obj);
|
||||
void sync_history_result(MachineObject* obj);
|
||||
void on_device_connected(MachineObject* obj);
|
||||
@@ -24,11 +25,13 @@ protected:
|
||||
void sync_history_data();
|
||||
void enbale_action_buttons(bool enable);
|
||||
float get_nozzle_value();
|
||||
int get_extruder_id();
|
||||
|
||||
void on_click_new_button(wxCommandEvent &event);
|
||||
|
||||
wxPanel* m_history_data_panel;
|
||||
ComboBox* m_comboBox_nozzle_dia;
|
||||
SwitchButton* m_extruder_switch_btn;
|
||||
Label* m_tips;
|
||||
|
||||
wxTimer* m_refresh_timer { nullptr };
|
||||
|
||||
Reference in New Issue
Block a user