Support upload g-code to third-party printers (#2)

* wip

* fix cmake warning

* add UI and config options for Moonraker connection

* wip: copy whole print host UI from PS

* add more needed options

* wip 2

* fix string issue on Mac

* wip3
This commit is contained in:
SoftFever 2022-08-20 15:09:05 +08:00 committed by GitHub
parent 159ff850e4
commit dc5e0eed34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 5543 additions and 19 deletions

View file

@ -124,6 +124,8 @@
#include "libslic3r/Platform.hpp"
#include "nlohmann/json.hpp"
#include "PhysicalPrinterDialog.hpp"
using boost::optional;
namespace fs = boost::filesystem;
using Slic3r::_3DScene;
@ -503,12 +505,26 @@ Sidebar::Sidebar(Plater *parent)
combo_printer->edit_btn = edit_btn;
p->combo_printer = combo_printer;
wxBoxSizer* vsizer_printer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* hsizer_printer = new wxBoxSizer(wxHORIZONTAL);
ScalableButton* connection_btn = new ScalableButton(p->m_panel_printer_content, wxID_ANY, "printer");
connection_btn->SetBackgroundColour(wxColour(255, 255, 255));
connection_btn->SetToolTip(_L("Print connection"));
connection_btn->Bind(wxEVT_BUTTON, [this, combo_printer](wxCommandEvent)
{
auto preset_name = into_u8(combo_printer->GetString(combo_printer->GetSelection()));
auto printer_name = from_u8(PhysicalPrinter::get_short_name(preset_name)+"-printer");
PhysicalPrinterDialog dlg(this->GetParent(),printer_name);
dlg.ShowModal();
// wxMessageBox("Connection support WIP", "INFO", wxOK | wxICON_INFORMATION);
});
wxBoxSizer *vsizer_printer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *hsizer_printer = new wxBoxSizer(wxHORIZONTAL);
hsizer_printer->Add(combo_printer, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3));
hsizer_printer->Add(edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3));
hsizer_printer->Add(FromDIP(8), 0, 0, 0, 0);
hsizer_printer->Add(connection_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3));
hsizer_printer->Add(FromDIP(8), 0, 0, 0, 0);
vsizer_printer->Add(hsizer_printer, 0, wxEXPAND, 0);
// Bed type selection