mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-29 13:52:07 +00:00
feature open tag for export gcode.3mf
This commit is contained in:
@@ -1745,165 +1745,123 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||||||
|
|
||||||
m_print_option_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
m_print_option_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
SidePopup* p = new SidePopup(this);
|
SidePopup* p = new SidePopup(this);
|
||||||
|
|
||||||
if (wxGetApp().preset_bundle
|
// if (wxGetApp().preset_bundle && !wxGetApp().preset_bundle->is_bbl_vendor())
|
||||||
&& !wxGetApp().preset_bundle->is_bbl_vendor()) {
|
if (0) {
|
||||||
// ThirdParty Buttons
|
// ThirdParty Buttons
|
||||||
SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), "");
|
SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), "");
|
||||||
export_gcode_btn->SetCornerRadius(0);
|
export_gcode_btn->SetCornerRadius(0);
|
||||||
export_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
export_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||||
m_print_btn->SetLabel(_L("Export G-code file"));
|
m_print_btn->SetLabel(_L("Export G-code file"));
|
||||||
m_print_select = eExportGcode;
|
m_print_select = eExportGcode;
|
||||||
m_print_enable = get_enable_print_status();
|
m_print_enable = get_enable_print_status();
|
||||||
m_print_btn->Enable(m_print_enable);
|
m_print_btn->Enable(m_print_enable);
|
||||||
this->Layout();
|
this->Layout();
|
||||||
p->Dismiss();
|
p->Dismiss();
|
||||||
});
|
});
|
||||||
|
|
||||||
// upload and print
|
// upload and print
|
||||||
SideButton* send_gcode_btn = new SideButton(p, _L("Print"), "");
|
SideButton* send_gcode_btn = new SideButton(p, _L("Print"), "");
|
||||||
send_gcode_btn->SetCornerRadius(0);
|
send_gcode_btn->SetCornerRadius(0);
|
||||||
send_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
send_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||||
m_print_btn->SetLabel(_L("Print"));
|
m_print_btn->SetLabel(_L("Print"));
|
||||||
m_print_select = eSendGcode;
|
m_print_select = eSendGcode;
|
||||||
m_print_enable = get_enable_print_status();
|
m_print_enable = get_enable_print_status();
|
||||||
m_print_btn->Enable(m_print_enable);
|
m_print_btn->Enable(m_print_enable);
|
||||||
this->Layout();
|
this->Layout();
|
||||||
p->Dismiss();
|
p->Dismiss();
|
||||||
});
|
});
|
||||||
|
|
||||||
p->append_button(send_gcode_btn);
|
p->append_button(send_gcode_btn);
|
||||||
p->append_button(export_gcode_btn);
|
p->append_button(export_gcode_btn);
|
||||||
|
} else {
|
||||||
|
SideButton* print_plate_btn = new SideButton(p, _L("Print"), "");
|
||||||
|
print_plate_btn->SetCornerRadius(0);
|
||||||
|
|
||||||
|
SideButton* export_sliced_file_btn = new SideButton(p, _L("Export plate sliced file"), "");
|
||||||
|
export_sliced_file_btn->SetCornerRadius(0);
|
||||||
|
|
||||||
|
SideButton* export_all_sliced_file_btn = new SideButton(p, _L("Export all sliced file"), "");
|
||||||
|
export_all_sliced_file_btn->SetCornerRadius(0);
|
||||||
|
|
||||||
|
print_plate_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||||
|
m_print_btn->SetLabel(_L("Print"));
|
||||||
|
m_print_select = eSendGcode;
|
||||||
|
m_print_enable = get_enable_print_status();
|
||||||
|
m_print_btn->Enable(m_print_enable);
|
||||||
|
this->Layout();
|
||||||
|
p->Dismiss();
|
||||||
|
});
|
||||||
|
|
||||||
|
export_sliced_file_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||||
|
m_print_btn->SetLabel(_L("Export plate sliced file"));
|
||||||
|
m_print_select = eExportSlicedFile;
|
||||||
|
m_print_enable = get_enable_print_status();
|
||||||
|
m_print_btn->Enable(m_print_enable);
|
||||||
|
this->Layout();
|
||||||
|
p->Dismiss();
|
||||||
|
});
|
||||||
|
|
||||||
|
export_all_sliced_file_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||||
|
m_print_btn->SetLabel(_L("Export all sliced file"));
|
||||||
|
m_print_select = eExportAllSlicedFile;
|
||||||
|
m_print_enable = get_enable_print_status();
|
||||||
|
m_print_btn->Enable(m_print_enable);
|
||||||
|
this->Layout();
|
||||||
|
p->Dismiss();
|
||||||
|
});
|
||||||
|
|
||||||
|
bool support_send = true;
|
||||||
|
bool support_print_all = true;
|
||||||
|
|
||||||
|
const auto preset_bundle = wxGetApp().preset_bundle;
|
||||||
|
if (preset_bundle) {
|
||||||
|
if (preset_bundle->use_bbl_network()) {
|
||||||
|
// BBL network support everything
|
||||||
|
} else {
|
||||||
|
support_send = false; // All 3rd print hosts do not have the send options
|
||||||
|
|
||||||
|
auto cfg = preset_bundle->printers.get_edited_preset().config;
|
||||||
|
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
|
||||||
|
|
||||||
|
// Only simply print support uploading all plates
|
||||||
|
support_print_all = host_type == PrintHostType::htSimplyPrint;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
//Snapmaker Orca Buttons
|
|
||||||
SideButton* print_plate_btn = new SideButton(p, _L("Print plate"), "");
|
|
||||||
print_plate_btn->SetCornerRadius(0);
|
|
||||||
|
|
||||||
SideButton* send_to_printer_btn = new SideButton(p, _L("Send"), "");
|
p->append_button(print_plate_btn);
|
||||||
send_to_printer_btn->SetCornerRadius(0);
|
|
||||||
|
|
||||||
SideButton* export_sliced_file_btn = new SideButton(p, _L("Export plate sliced file"), "");
|
if (enable_multi_machine) {
|
||||||
export_sliced_file_btn->SetCornerRadius(0);
|
SideButton* print_multi_machine_btn = new SideButton(p, _L("Send to Multi-device"), "");
|
||||||
|
print_multi_machine_btn->SetCornerRadius(0);
|
||||||
SideButton* export_all_sliced_file_btn = new SideButton(p, _L("Export all sliced file"), "");
|
print_multi_machine_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||||
export_all_sliced_file_btn->SetCornerRadius(0);
|
m_print_btn->SetLabel(_L("Send to Multi-device"));
|
||||||
|
m_print_select = ePrintMultiMachine;
|
||||||
print_plate_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Print plate"));
|
|
||||||
m_print_select = ePrintPlate;
|
|
||||||
m_print_enable = get_enable_print_status();
|
|
||||||
m_print_btn->Enable(m_print_enable);
|
|
||||||
this->Layout();
|
|
||||||
p->Dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
SideButton* print_all_btn = new SideButton(p, _L("Print all"), "");
|
|
||||||
print_all_btn->SetCornerRadius(0);
|
|
||||||
print_all_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Print all"));
|
|
||||||
m_print_select = ePrintAll;
|
|
||||||
m_print_enable = get_enable_print_status();
|
|
||||||
m_print_btn->Enable(m_print_enable);
|
|
||||||
this->Layout();
|
|
||||||
p->Dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
send_to_printer_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Send"));
|
|
||||||
m_print_select = eSendToPrinter;
|
|
||||||
m_print_enable = get_enable_print_status();
|
|
||||||
m_print_btn->Enable(m_print_enable);
|
|
||||||
this->Layout();
|
|
||||||
p->Dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
SideButton* send_to_printer_all_btn = new SideButton(p, _L("Send all"), "");
|
|
||||||
send_to_printer_all_btn->SetCornerRadius(0);
|
|
||||||
send_to_printer_all_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Send all"));
|
|
||||||
m_print_select = eSendToPrinterAll;
|
|
||||||
m_print_enable = get_enable_print_status();
|
|
||||||
m_print_btn->Enable(m_print_enable);
|
|
||||||
this->Layout();
|
|
||||||
p->Dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
export_sliced_file_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Export plate sliced file"));
|
|
||||||
m_print_select = eExportSlicedFile;
|
|
||||||
m_print_enable = get_enable_print_status();
|
|
||||||
m_print_btn->Enable(m_print_enable);
|
|
||||||
this->Layout();
|
|
||||||
p->Dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
export_all_sliced_file_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Export all sliced file"));
|
|
||||||
m_print_select = eExportAllSlicedFile;
|
|
||||||
m_print_enable = get_enable_print_status();
|
|
||||||
m_print_btn->Enable(m_print_enable);
|
|
||||||
this->Layout();
|
|
||||||
p->Dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
bool support_send = true;
|
|
||||||
bool support_print_all = true;
|
|
||||||
|
|
||||||
const auto preset_bundle = wxGetApp().preset_bundle;
|
|
||||||
if (preset_bundle) {
|
|
||||||
if (preset_bundle->use_bbl_network()) {
|
|
||||||
// BBL network support everything
|
|
||||||
} else {
|
|
||||||
support_send = false; // All 3rd print hosts do not have the send options
|
|
||||||
|
|
||||||
auto cfg = preset_bundle->printers.get_edited_preset().config;
|
|
||||||
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
|
|
||||||
|
|
||||||
// Only simply print support uploading all plates
|
|
||||||
support_print_all = host_type == PrintHostType::htSimplyPrint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p->append_button(print_plate_btn);
|
|
||||||
if (support_print_all) {
|
|
||||||
p->append_button(print_all_btn);
|
|
||||||
}
|
|
||||||
if (support_send) {
|
|
||||||
p->append_button(send_to_printer_btn);
|
|
||||||
p->append_button(send_to_printer_all_btn);
|
|
||||||
}
|
|
||||||
if (enable_multi_machine) {
|
|
||||||
SideButton* print_multi_machine_btn = new SideButton(p, _L("Send to Multi-device"), "");
|
|
||||||
print_multi_machine_btn->SetCornerRadius(0);
|
|
||||||
print_multi_machine_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Send to Multi-device"));
|
|
||||||
m_print_select = ePrintMultiMachine;
|
|
||||||
m_print_enable = get_enable_print_status();
|
|
||||||
m_print_btn->Enable(m_print_enable);
|
|
||||||
this->Layout();
|
|
||||||
p->Dismiss();
|
|
||||||
});
|
|
||||||
p->append_button(print_multi_machine_btn);
|
|
||||||
}
|
|
||||||
p->append_button(export_sliced_file_btn);
|
|
||||||
p->append_button(export_all_sliced_file_btn);
|
|
||||||
SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), "");
|
|
||||||
export_gcode_btn->SetCornerRadius(0);
|
|
||||||
export_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
|
||||||
m_print_btn->SetLabel(_L("Export G-code file"));
|
|
||||||
m_print_select = eExportGcode;
|
|
||||||
m_print_enable = get_enable_print_status();
|
m_print_enable = get_enable_print_status();
|
||||||
m_print_btn->Enable(m_print_enable);
|
m_print_btn->Enable(m_print_enable);
|
||||||
this->Layout();
|
this->Layout();
|
||||||
p->Dismiss();
|
p->Dismiss();
|
||||||
});
|
});
|
||||||
p->append_button(export_gcode_btn);
|
p->append_button(print_multi_machine_btn);
|
||||||
}
|
}
|
||||||
|
p->append_button(export_sliced_file_btn);
|
||||||
p->Popup(m_print_btn);
|
p->append_button(export_all_sliced_file_btn);
|
||||||
|
SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), "");
|
||||||
|
export_gcode_btn->SetCornerRadius(0);
|
||||||
|
export_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||||
|
m_print_btn->SetLabel(_L("Export G-code file"));
|
||||||
|
m_print_select = eExportGcode;
|
||||||
|
m_print_enable = get_enable_print_status();
|
||||||
|
m_print_btn->Enable(m_print_enable);
|
||||||
|
this->Layout();
|
||||||
|
p->Dismiss();
|
||||||
|
});
|
||||||
|
p->append_button(export_gcode_btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p->Popup(m_print_btn);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user