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

@ -25,6 +25,7 @@
#include "ProgressStatusBar.hpp"
#include "3DScene.hpp"
#include "ParamsDialog.hpp"
#include "PrintHostDialogs.hpp"
#include "wxExtensions.hpp"
#include "GUI_ObjectList.hpp"
#include "Mouse3DController.hpp"
@ -149,6 +150,7 @@ wxDEFINE_EVENT(EVT_SYNC_CLOUD_PRESET, SimpleEvent);
MainFrame::MainFrame() :
DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_STYLE, "mainframe")
, m_printhost_queue_dlg(new PrintHostQueueDialog(this))
// BBS
, m_recent_projects(9)
, m_settings_dialog(this)
@ -399,6 +401,10 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< "cancelled by close_with_confirm selection";
return;
}
if (event.CanVeto() && !wxGetApp().check_print_host_queue()) {
event.Veto();
return;
}
#if 0 // BBS
//if (m_plater != nullptr) {
@ -1105,6 +1111,15 @@ bool MainFrame::can_export_gcode() const
return true;
}
bool MainFrame::can_send_gcode() const
{
if (m_plater && ! m_plater->model().objects.empty())
if (const DynamicPrintConfig *cfg = wxGetApp().preset_bundle->physical_printers.get_selected_printer_config(); cfg)
if (const auto *print_host_opt = cfg->option<ConfigOptionString>("print_host"); print_host_opt)
return ! print_host_opt->value.empty();
return false;
}
/*bool MainFrame::can_export_gcode_sd() const
{
if (m_plater == nullptr)