mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-02 09:58:41 +03:00
update slic3r
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
#include "ConfigWizard.hpp"
|
||||
#include "Widgets/WebView.hpp"
|
||||
#include "DailyTips.hpp"
|
||||
#include "FilamentMapDialog.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <dbt.h>
|
||||
@@ -185,7 +186,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
||||
set_miniaturizable(GetHandle());
|
||||
#endif
|
||||
|
||||
if (!wxGetApp().app_config->has("user_mode")) {
|
||||
if (!wxGetApp().app_config->has("user_mode")) {
|
||||
wxGetApp().app_config->set("user_mode", "simple");
|
||||
wxGetApp().app_config->set_bool("developer_mode", false);
|
||||
wxGetApp().app_config->save();
|
||||
@@ -244,7 +245,12 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
||||
m_reset_title_text_colour_timer->Stop();
|
||||
m_reset_title_text_colour_timer->Start(500);
|
||||
}
|
||||
}
|
||||
m_mac_fullscreen = false;
|
||||
} else {
|
||||
m_mac_fullscreen = true;
|
||||
}
|
||||
auto int_event = new IntEvent(EVT_NOTICE_FULL_SCREEN_CHANGED, e.IsFullScreen() ? 1 : 0);
|
||||
wxQueueEvent(wxGetApp().plater(), int_event);
|
||||
e.Skip();
|
||||
});
|
||||
#endif
|
||||
@@ -344,6 +350,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
||||
#endif
|
||||
Refresh();
|
||||
Layout();
|
||||
wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_NOTICE_CHILDE_SIZE_CHANGED));
|
||||
});
|
||||
|
||||
//QDS
|
||||
@@ -683,6 +690,19 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
||||
evt.Skip();
|
||||
});
|
||||
|
||||
Bind(wxEVT_SHOW, [this](wxShowEvent &evt) {
|
||||
DeviceManager *manger = wxGetApp().getDeviceManager();
|
||||
if (manger) {
|
||||
evt.IsShown() ? manger->start_refresher() : manger->stop_refresher();
|
||||
}
|
||||
});
|
||||
Bind(wxEVT_IDLE, ([this](wxIdleEvent &e) {
|
||||
if (m_topbar && m_plater) {
|
||||
m_topbar->EnableSaveItem(can_save());
|
||||
m_topbar->EnableUndoItem(m_plater->can_undo());
|
||||
m_topbar->EnableRedoItem(m_plater->can_redo());
|
||||
}
|
||||
}));
|
||||
#ifdef _MSW_DARK_MODE
|
||||
wxGetApp().UpdateDarkUIWin(this);
|
||||
#endif // _MSW_DARK_MODE
|
||||
@@ -846,6 +866,13 @@ void MainFrame::update_layout()
|
||||
{
|
||||
// jump to 3deditor under preview_only mode
|
||||
if (evt.GetId() == tp3DEditor){
|
||||
Sidebar& sidebar = GUI::wxGetApp().sidebar();
|
||||
if (sidebar.need_auto_sync_after_connect_printer()) {
|
||||
sidebar.set_need_auto_sync_after_connect_printer(false);
|
||||
//y60
|
||||
// sidebar.sync_extruder_list();
|
||||
}
|
||||
|
||||
m_plater->update(true);
|
||||
|
||||
if (!preview_only_hint())
|
||||
@@ -867,7 +894,7 @@ void MainFrame::update_layout()
|
||||
{
|
||||
m_main_sizer->Add(m_plater, 1, wxEXPAND);
|
||||
//QDS: add bed exclude area
|
||||
m_plater->set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, {}, 0.0, {}, {}, true);
|
||||
m_plater->set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, {}, 0.0, {}, {}, {}, {}, true);
|
||||
m_plater->get_collapse_toolbar().set_enabled(false);
|
||||
m_plater->collapse_sidebar(true);
|
||||
m_plater->Show();
|
||||
@@ -1062,31 +1089,32 @@ void MainFrame::init_tabpanel()
|
||||
if (wxGetApp().preset_bundle &&
|
||||
wxGetApp().preset_bundle->printers.get_edited_preset().is_qdt_vendor_preset(wxGetApp().preset_bundle) &&
|
||||
new_sel == tpMonitor) {
|
||||
if (!wxGetApp().getAgent()) {
|
||||
e.Veto();
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("skipped tab switch from %1% to %2%, lack of network plugins") %
|
||||
old_sel % new_sel;
|
||||
if (m_plater) {
|
||||
wxCommandEvent* evt = new wxCommandEvent(EVT_INSTALL_PLUGIN_HINT);
|
||||
wxQueueEvent(m_plater, evt);
|
||||
}
|
||||
if (m_confirm_download_plugin_dlg == nullptr){
|
||||
m_confirm_download_plugin_dlg = new SecondaryCheckDialog(this, wxID_ANY, _L("Install network plug-in"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM);
|
||||
m_confirm_download_plugin_dlg->SetSize(wxSize(FromDIP(270), FromDIP(158)));
|
||||
m_confirm_download_plugin_dlg->update_text(_L("Please Install network plug-in before log in."));
|
||||
m_confirm_download_plugin_dlg->update_btn_label(_L("Install Network Plug-in"), _L(""));
|
||||
//y58
|
||||
// if (!wxGetApp().getAgent()) {
|
||||
// e.Veto();
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("skipped tab switch from %1% to %2%, lack of network plugins") %
|
||||
// old_sel % new_sel;
|
||||
// if (m_plater) {
|
||||
// wxCommandEvent* evt = new wxCommandEvent(EVT_INSTALL_PLUGIN_HINT);
|
||||
// wxQueueEvent(m_plater, evt);
|
||||
// }
|
||||
// if (m_confirm_download_plugin_dlg == nullptr){
|
||||
// m_confirm_download_plugin_dlg = new SecondaryCheckDialog(this, wxID_ANY, _L("Install network plug-in"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM);
|
||||
// m_confirm_download_plugin_dlg->SetSize(wxSize(FromDIP(270), FromDIP(158)));
|
||||
// m_confirm_download_plugin_dlg->update_text(_L("Please Install network plug-in before log in."));
|
||||
// m_confirm_download_plugin_dlg->update_btn_label(_L("Install Network Plug-in"), "");
|
||||
|
||||
m_confirm_download_plugin_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
|
||||
this->m_confirm_download_plugin_dlg->Close();
|
||||
wxGetApp().ShowDownNetPluginDlg();
|
||||
return;
|
||||
});
|
||||
}
|
||||
int xPos = GetRect().GetX() + (GetSize().x - m_confirm_download_plugin_dlg->GetSize().x) / 2;
|
||||
int yPos = GetRect().GetY() + (GetSize().y - m_confirm_download_plugin_dlg->GetSize().y) / 2;
|
||||
m_confirm_download_plugin_dlg->SetPosition(wxPoint(xPos, yPos));
|
||||
m_confirm_download_plugin_dlg->on_show();
|
||||
}
|
||||
// m_confirm_download_plugin_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
|
||||
// this->m_confirm_download_plugin_dlg->Close();
|
||||
// wxGetApp().ShowDownNetPluginDlg();
|
||||
// return;
|
||||
// });
|
||||
// }
|
||||
// int xPos = GetRect().GetX() + (GetSize().x - m_confirm_download_plugin_dlg->GetSize().x) / 2;
|
||||
// int yPos = GetRect().GetY() + (GetSize().y - m_confirm_download_plugin_dlg->GetSize().y) / 2;
|
||||
// m_confirm_download_plugin_dlg->SetPosition(wxPoint(xPos, yPos));
|
||||
// m_confirm_download_plugin_dlg->on_show();
|
||||
// }
|
||||
}
|
||||
else if (new_sel == tpMonitor && wxGetApp().preset_bundle != nullptr) {
|
||||
//y53
|
||||
@@ -1162,10 +1190,10 @@ void MainFrame::init_tabpanel()
|
||||
m_topbar->DisableUndoRedoItems();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __WXGTK__
|
||||
if (panel)
|
||||
panel->SetFocus();
|
||||
|
||||
#endif
|
||||
/*switch (sel) {
|
||||
case TabPosition::tpHome:
|
||||
show_option(false);
|
||||
@@ -1257,7 +1285,7 @@ void MainFrame::init_tabpanel()
|
||||
// nozzle_diameter is undefined when SLA printer is selected
|
||||
// QDS
|
||||
if (full_config.has("filament_colour")) {
|
||||
m_plater->on_filaments_change(full_config.option<ConfigOptionStrings>("filament_colour")->values.size());
|
||||
m_plater->on_filament_count_change(full_config.option<ConfigOptionStrings>("filament_colour")->values.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1544,8 +1572,7 @@ bool MainFrame::can_export_all_gcode() const
|
||||
bool MainFrame::can_print_3mf() const
|
||||
{
|
||||
if (m_plater && !m_plater->model().objects.empty()) {
|
||||
if (wxGetApp().preset_bundle->printers.get_edited_preset().is_custom_defined())
|
||||
return false;
|
||||
//
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1645,35 +1672,125 @@ wxBoxSizer* MainFrame::create_side_tools()
|
||||
m_slice_select = eSlicePlate;
|
||||
m_print_select = ePrintPlate;
|
||||
|
||||
m_slice_btn = new SideButton(this, _L("Slice plate"), "");
|
||||
m_slice_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14));
|
||||
m_print_btn = new SideButton(this, _L("Print plate"), "");
|
||||
m_print_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14));
|
||||
auto slice_panel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTRANSPARENT_WINDOW);
|
||||
auto print_panel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTRANSPARENT_WINDOW);
|
||||
|
||||
m_slice_btn = new SideButton(slice_panel, _L("Slice plate"), "");
|
||||
m_slice_option_btn = new SideButton(slice_panel, "", "sidebutton_dropdown", 0, FromDIP(14));
|
||||
m_print_btn = new SideButton(print_panel, _L("Print plate"), "");
|
||||
m_print_option_btn = new SideButton(print_panel, "", "sidebutton_dropdown", 0, FromDIP(14));
|
||||
|
||||
auto slice_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
slice_sizer->Add(m_slice_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
slice_sizer->Add(m_slice_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
slice_panel->SetSizer(slice_sizer);
|
||||
|
||||
auto print_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
print_sizer->Add(m_print_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
print_sizer->Add(m_print_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
print_panel->SetSizer(print_sizer);
|
||||
|
||||
update_side_button_style();
|
||||
m_slice_option_btn->Enable();
|
||||
m_print_option_btn->Enable();
|
||||
sizer->Add(FromDIP(15), 0, 0, 0, 0);
|
||||
sizer->Add(m_slice_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
sizer->Add(m_slice_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
sizer->Add(slice_panel);
|
||||
sizer->Add(FromDIP(15), 0, 0, 0, 0);
|
||||
sizer->Add(m_print_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
sizer->Add(m_print_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
sizer->Add(print_panel);
|
||||
sizer->Add(FromDIP(19), 0, 0, 0, 0);
|
||||
|
||||
sizer->Layout();
|
||||
|
||||
m_filament_group_popup = new FilamentGroupPopup(m_slice_btn);
|
||||
|
||||
auto try_hover_pop_up = [this]() {
|
||||
wxPoint pos = m_slice_btn->ClientToScreen(wxPoint(0, 0));
|
||||
pos.y += m_slice_btn->GetRect().height * 1.25;
|
||||
pos.x -= (m_slice_option_btn->GetRect().width + FromDIP(380) * 0.6);
|
||||
auto curr_plate = this->m_plater->get_partplate_list().get_curr_plate();
|
||||
m_filament_group_popup->SetPosition(pos);
|
||||
m_filament_group_popup->tryPopup(m_plater, curr_plate, m_slice_select == eSliceAll);
|
||||
};
|
||||
|
||||
#ifndef __linux__
|
||||
// in linux plateform, the pop up will taker over the mouse event and make the slice button cannot handle click event
|
||||
// this pannel is used to trigger hover when button is disabled
|
||||
slice_panel->Bind(wxEVT_ENTER_WINDOW, [this,try_hover_pop_up](auto& event) {
|
||||
if(!m_slice_option_pop_up || !m_slice_option_pop_up->IsShown())
|
||||
try_hover_pop_up();
|
||||
});
|
||||
|
||||
slice_panel->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
|
||||
m_filament_group_popup->tryClose();
|
||||
});
|
||||
|
||||
m_slice_btn->Bind(wxEVT_ENTER_WINDOW, [this, try_hover_pop_up](auto& event) {
|
||||
if (!m_slice_option_pop_up || !m_slice_option_pop_up->IsShown())
|
||||
try_hover_pop_up();
|
||||
});
|
||||
|
||||
m_slice_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
|
||||
m_filament_group_popup->tryClose();
|
||||
});
|
||||
#endif
|
||||
|
||||
m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||
{
|
||||
m_plater->reset_check_status();
|
||||
if (!m_plater->check_ams_status(m_slice_select == eSliceAll))
|
||||
return;
|
||||
|
||||
//this->m_plater->select_view_3D("Preview");
|
||||
m_plater->exit_gizmo();
|
||||
m_plater->update(true, true);
|
||||
if (m_slice_select == eSliceAll)
|
||||
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_ALL));
|
||||
else
|
||||
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
|
||||
|
||||
this->m_tabpanel->SetSelection(tpPreview);
|
||||
bool slice = true;
|
||||
|
||||
auto curr_plate = m_plater->get_partplate_list().get_curr_plate();
|
||||
#ifdef __linux__
|
||||
slice = try_pop_up_before_slice(m_slice_select == eSliceAll, m_plater, curr_plate, true);
|
||||
#else
|
||||
slice = try_pop_up_before_slice(m_slice_select == eSliceAll, m_plater, curr_plate, false);
|
||||
#endif
|
||||
|
||||
if (slice) {
|
||||
std::string printer_model = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_string("printer_model");
|
||||
if (printer_model == "H2D") {
|
||||
if (wxGetApp().app_config->get("play_slicing_video") == "true") {
|
||||
MessageDialog dlg(this, _L("This is your first time slicing with the H2D machine.\nWould you like to watch a quick tutorial video?"), _L("First Guide"), wxYES_NO);
|
||||
auto res = dlg.ShowModal();
|
||||
if (res == wxID_YES) {
|
||||
play_dual_extruder_slice_video();
|
||||
slice = false;
|
||||
}
|
||||
wxGetApp().app_config->set("play_slicing_video", "false");
|
||||
}
|
||||
|
||||
if ((wxGetApp().app_config->get("play_tpu_printing_video") == "true") ) {
|
||||
auto used_filaments = curr_plate->get_extruders();
|
||||
std::transform(used_filaments.begin(), used_filaments.end(), used_filaments.begin(), [](auto i) {return i - 1; });
|
||||
auto full_config = wxGetApp().preset_bundle->full_config();
|
||||
auto filament_types = full_config.option<ConfigOptionStrings>("filament_type")->values;
|
||||
if (std::any_of(used_filaments.begin(), used_filaments.end(), [filament_types](int idx) { return filament_types[idx] == "TPU"; })) {
|
||||
MessageDialog dlg(this, _L("This is your first time printing tpu filaments with the H2D machine.\nWould you like to watch a quick tutorial video?"), _L("First Guide"), wxYES_NO);
|
||||
auto res = dlg.ShowModal();
|
||||
if (res == wxID_YES) {
|
||||
play_dual_extruder_print_tpu_video();
|
||||
slice = false;
|
||||
}
|
||||
wxGetApp().app_config->set("play_tpu_printing_video", "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (slice) {
|
||||
if (m_slice_select == eSliceAll)
|
||||
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_ALL));
|
||||
else
|
||||
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
|
||||
this->m_tabpanel->SetSelection(tpPreview);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
m_print_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||
@@ -1720,98 +1837,49 @@ wxBoxSizer* MainFrame::create_side_tools()
|
||||
|
||||
m_slice_option_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||
{
|
||||
SidePopup* p = new SidePopup(this);
|
||||
SideButton* slice_all_btn = new SideButton(p, _L("Slice all"), "");
|
||||
if(m_slice_option_pop_up)
|
||||
delete m_slice_option_pop_up;
|
||||
m_slice_option_pop_up = new SidePopup(this);
|
||||
SideButton* slice_all_btn = new SideButton(m_slice_option_pop_up, _L("Slice all"), "");
|
||||
slice_all_btn->SetCornerRadius(0);
|
||||
SideButton* slice_plate_btn = new SideButton(p, _L("Slice plate"), "");
|
||||
SideButton* slice_plate_btn = new SideButton(m_slice_option_pop_up, _L("Slice plate"), "");
|
||||
slice_plate_btn->SetCornerRadius(0);
|
||||
|
||||
slice_all_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||
slice_all_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
|
||||
m_slice_btn->SetLabel(_L("Slice all"));
|
||||
m_slice_select = eSliceAll;
|
||||
m_slice_enable = get_enable_slice_status();
|
||||
m_slice_btn->Enable(m_slice_enable);
|
||||
this->Layout();
|
||||
p->Dismiss();
|
||||
if(m_slice_option_pop_up)
|
||||
m_slice_option_pop_up->Dismiss();
|
||||
});
|
||||
|
||||
slice_plate_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||
slice_plate_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
|
||||
m_slice_btn->SetLabel(_L("Slice plate"));
|
||||
m_slice_select = eSlicePlate;
|
||||
m_slice_enable = get_enable_slice_status();
|
||||
m_slice_btn->Enable(m_slice_enable);
|
||||
this->Layout();
|
||||
p->Dismiss();
|
||||
if(m_slice_option_pop_up)
|
||||
m_slice_option_pop_up->Dismiss();
|
||||
});
|
||||
p->append_button(slice_all_btn);
|
||||
p->append_button(slice_plate_btn);
|
||||
p->Popup(m_slice_btn);
|
||||
m_slice_option_pop_up->append_button(slice_all_btn);
|
||||
m_slice_option_pop_up->append_button(slice_plate_btn);
|
||||
m_slice_option_pop_up->Popup(m_slice_btn);
|
||||
}
|
||||
);
|
||||
|
||||
m_print_option_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||
{
|
||||
SidePopup* p = new SidePopup(this);
|
||||
//w43
|
||||
bool qidi_3mf = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_bool("is_support_3mf");
|
||||
|
||||
if (wxGetApp().preset_bundle
|
||||
&& wxGetApp().preset_bundle->printers.get_edited_preset().is_qdt_vendor_preset(wxGetApp().preset_bundle)) {
|
||||
// ThirdParty Buttons
|
||||
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();
|
||||
});
|
||||
|
||||
// upload and print
|
||||
SideButton* send_gcode_btn = new SideButton(p, _L("Print"), "");
|
||||
send_gcode_btn->SetCornerRadius(0);
|
||||
send_gcode_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();
|
||||
});
|
||||
|
||||
// y11
|
||||
SideButton* upload_gcode_to_multimachine_btn = new SideButton(p, _L("Send to multimachine"), "");
|
||||
upload_gcode_to_multimachine_btn->SetCornerRadius(0);
|
||||
upload_gcode_to_multimachine_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||
m_print_btn->SetLabel(_L("multimachine"));
|
||||
m_print_select = eSendMultiGcode;
|
||||
m_print_enable = get_enable_print_status();
|
||||
m_print_btn->Enable(m_print_enable);
|
||||
this->Layout();
|
||||
p->Dismiss();
|
||||
});
|
||||
|
||||
p->append_button(send_gcode_btn);
|
||||
// y11
|
||||
p->append_button(upload_gcode_to_multimachine_btn);
|
||||
p->append_button(export_gcode_btn);
|
||||
}
|
||||
else {
|
||||
//QIDI Studio Buttons
|
||||
if (wxGetApp().preset_bundle && !qidi_3mf) {
|
||||
// incompatible 3mf 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"), "");
|
||||
send_to_printer_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);
|
||||
//y
|
||||
export_all_sliced_file_btn->Hide();
|
||||
|
||||
print_plate_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||
m_print_btn->SetLabel(_L("Print plate"));
|
||||
m_print_select = ePrintPlate;
|
||||
@@ -1819,19 +1887,10 @@ wxBoxSizer* MainFrame::create_side_tools()
|
||||
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();
|
||||
// });
|
||||
});
|
||||
|
||||
SideButton* send_to_printer_btn = new SideButton(p, _L("Send"), "");
|
||||
send_to_printer_btn->SetCornerRadius(0);
|
||||
send_to_printer_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||
m_print_btn->SetLabel(_L("Send"));
|
||||
m_print_select = eSendToPrinter;
|
||||
@@ -1839,19 +1898,10 @@ wxBoxSizer* MainFrame::create_side_tools()
|
||||
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();
|
||||
// });
|
||||
});
|
||||
|
||||
SideButton* export_sliced_file_btn = new SideButton(p, _L("Export plate sliced file"), "");
|
||||
export_sliced_file_btn->SetCornerRadius(0);
|
||||
export_sliced_file_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
|
||||
m_print_btn->SetLabel(_L("Export plate sliced file"));
|
||||
m_print_select = eExportGcode;
|
||||
@@ -1860,39 +1910,116 @@ wxBoxSizer* MainFrame::create_side_tools()
|
||||
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();
|
||||
// });
|
||||
});
|
||||
|
||||
p->append_button(print_plate_btn);
|
||||
// p->append_button(print_all_btn);
|
||||
p->append_button(send_to_printer_btn);
|
||||
// p->append_button(send_to_printer_all_btn);
|
||||
p->append_button(export_sliced_file_btn);
|
||||
// p->append_button(export_all_sliced_file_btn);
|
||||
|
||||
//y
|
||||
// if (check_qdt_farm_client_installed()) {
|
||||
// SideButton *send_to_multi_app_btn = new SideButton(p, _L("Send to QIDI Farm Manager Client"), "");
|
||||
// send_to_multi_app_btn->SetCornerRadius(0);
|
||||
// p->append_button(send_to_multi_app_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);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//QIDI Studio Buttons
|
||||
SideButton* print_plate_btn = new SideButton(p, _L("Print plate"), "");
|
||||
print_plate_btn->SetCornerRadius(0);
|
||||
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();
|
||||
});
|
||||
|
||||
SideButton* send_to_printer_btn = new SideButton(p, _L("Send"), "");
|
||||
send_to_printer_btn->SetCornerRadius(0);
|
||||
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();
|
||||
});
|
||||
|
||||
SideButton* export_sliced_file_btn = new SideButton(p, _L("Export plate sliced file"), "");
|
||||
export_sliced_file_btn->SetCornerRadius(0);
|
||||
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();
|
||||
});
|
||||
|
||||
SideButton* export_all_sliced_file_btn = new SideButton(p, _L("Export all sliced file"), "");
|
||||
export_all_sliced_file_btn->SetCornerRadius(0);
|
||||
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();
|
||||
});
|
||||
|
||||
p->append_button(print_plate_btn);
|
||||
p->append_button(print_all_btn);
|
||||
p->append_button(send_to_printer_btn);
|
||||
p->append_button(send_to_printer_all_btn);
|
||||
p->append_button(export_sliced_file_btn);
|
||||
p->append_button(export_all_sliced_file_btn);
|
||||
|
||||
if (check_qdt_farm_client_installed()) {
|
||||
SideButton *send_to_multi_app_btn = new SideButton(p, _L("Send to QIDI Farm Manager Client"), "");
|
||||
send_to_multi_app_btn->SetCornerRadius(0);
|
||||
p->append_button(send_to_multi_app_btn);
|
||||
|
||||
send_to_multi_app_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent &) {
|
||||
m_print_btn->SetLabel(_L("Send to BFMC"));
|
||||
m_print_select = eSendMultiApp;
|
||||
m_print_enable = get_enable_print_status();
|
||||
m_print_btn->Enable(m_print_enable);
|
||||
this->Layout();
|
||||
p->Dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
// send_to_multi_app_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent &) {
|
||||
// m_print_btn->SetLabel(_L("Send to BFMC"));
|
||||
// m_print_select = eSendMultiApp;
|
||||
// m_print_enable = get_enable_print_status();
|
||||
// m_print_btn->Enable(m_print_enable);
|
||||
// this->Layout();
|
||||
// p->Dismiss();
|
||||
// });
|
||||
// }
|
||||
|
||||
if (enable_multi_machine) {
|
||||
SideButton* print_multi_machine_btn = new SideButton(p, _L("Send to Multi-device"), "");
|
||||
@@ -2142,11 +2269,16 @@ void MainFrame::update_slice_print_status(SlicePrintEventType event, bool can_sl
|
||||
enable_slice = get_enable_slice_status();
|
||||
}
|
||||
|
||||
bool old_slice_status = m_slice_btn->IsEnabled();
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" m_slice_select %1%: can_slice= %2%, can_print %3%, enable_slice %4%, enable_print %5% ")%m_slice_select % can_slice %can_print %enable_slice %enable_print;
|
||||
m_print_btn->Enable(enable_print);
|
||||
m_slice_btn->Enable(enable_slice);
|
||||
m_slice_enable = enable_slice;
|
||||
m_print_enable = enable_print;
|
||||
|
||||
if (!old_slice_status && enable_slice)
|
||||
m_plater->reset_check_status();
|
||||
}
|
||||
|
||||
|
||||
@@ -2445,9 +2577,9 @@ static void add_common_view_menu_items(wxMenu* view_menu, MainFrame* mainFrame,
|
||||
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
|
||||
append_menu_item(view_menu, wxID_ANY, _L("Rear") + "\t" + ctrl + "4", _L("Rear View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("rear"); },
|
||||
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
|
||||
append_menu_item(view_menu, wxID_ANY, _L("Left") + "\t" + ctrl + "5", _L("Left View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("left"); },
|
||||
append_menu_item(view_menu, wxID_ANY, _CTX(L_CONTEXT("Left", "Camera"), "Camera") + "\t" + ctrl + "5", _L("Left View"),[mainFrame](wxCommandEvent &) {mainFrame->select_view("left"); },
|
||||
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
|
||||
append_menu_item(view_menu, wxID_ANY, _L("Right") + "\t" + ctrl + "6", _L("Right View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("right"); },
|
||||
append_menu_item(view_menu, wxID_ANY, _CTX(L_CONTEXT("Right", "Camera"), "Camera") + "\t" + ctrl + "6", _L("Right View"),[mainFrame](wxCommandEvent &) { mainFrame->select_view("right"); },
|
||||
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
|
||||
}
|
||||
|
||||
@@ -2656,11 +2788,11 @@ void MainFrame::init_menubar_as_editor()
|
||||
_L("Paste clipboard"), [this](wxCommandEvent&) { m_plater->paste_from_clipboard(); },
|
||||
"menu_paste", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this);
|
||||
// QDS Delete selected
|
||||
append_menu_item(editMenu, wxID_ANY, _L("Delete selected") + "\t" + _L("Del"),
|
||||
append_menu_item(editMenu, wxID_ANY, _L("Delete selected") + "\tDelete",
|
||||
_L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); },
|
||||
"menu_remove", nullptr, [this](){return can_delete(); }, this);
|
||||
//QDS: delete all
|
||||
append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + ctrl + "D",
|
||||
append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + ctrl + _L("Shift+") + "D",
|
||||
_L("Deletes all objects"),[this](wxCommandEvent&) { m_plater->delete_all_objects_from_model(); },
|
||||
"menu_remove", nullptr, [this](){return can_delete_all(); }, this);
|
||||
editMenu->AppendSeparator();
|
||||
@@ -2742,10 +2874,11 @@ void MainFrame::init_menubar_as_editor()
|
||||
"", nullptr, [this](){return can_delete(); }, this);
|
||||
#endif
|
||||
//QDS: delete all
|
||||
append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + ctrl + "D",
|
||||
append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + ctrl + _L("Shift+") + "D",
|
||||
_L("Deletes all objects"),[this, handle_key_event](wxCommandEvent&) {
|
||||
wxKeyEvent e;
|
||||
e.SetEventType(wxEVT_KEY_DOWN);
|
||||
e.SetShiftDown(true);
|
||||
e.SetControlDown(true);
|
||||
e.m_keyCode = 'D';
|
||||
if (handle_key_event(e)) {
|
||||
@@ -2843,7 +2976,15 @@ void MainFrame::init_menubar_as_editor()
|
||||
viewMenu->Check(wxID_CAMERA_PERSPECTIVE + camera_id_base, true);
|
||||
else
|
||||
viewMenu->Check(wxID_CAMERA_ORTHOGONAL + camera_id_base, true);
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
append_menu_check_item(
|
||||
viewMenu, wxID_ANY, _L("Show 3D Navigator"), _L("Show 3D navigator in Prepare and Preview scene"),
|
||||
[this](wxCommandEvent &) {
|
||||
wxGetApp().toggle_show_3d_navigator();
|
||||
m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
|
||||
},
|
||||
this, [this]() { return m_tabpanel->GetSelection() == TabPosition::tp3DEditor || m_tabpanel->GetSelection() == TabPosition::tpPreview; },
|
||||
[this]() { return wxGetApp().show_3d_navigator(); }, this);
|
||||
viewMenu->AppendSeparator();
|
||||
append_menu_check_item(viewMenu, wxID_ANY, _L("Show Labels") + "\t" + ctrl + "E", _L("Show object labels in 3D scene"),
|
||||
[this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT)); }, this,
|
||||
@@ -3300,7 +3441,7 @@ void MainFrame::init_menubar_as_editor()
|
||||
|
||||
void MainFrame::set_max_recent_count(int max)
|
||||
{
|
||||
max = max < 0 ? 0 : max > 10000 ? 10000 : max;
|
||||
max = max < 0 ? 0 : max > 999 ? 999 : max;
|
||||
size_t count = m_recent_projects.GetCount();
|
||||
m_recent_projects.SetMaxFiles(max);
|
||||
if (count != m_recent_projects.GetCount()) {
|
||||
@@ -3756,7 +3897,7 @@ void MainFrame::on_value_changed(wxCommandEvent& event)
|
||||
m_plater->on_config_change(*tab->get_config()); // propagate config change events to the plater
|
||||
if (opt_key == "extruders_count") {
|
||||
auto value = event.GetInt();
|
||||
m_plater->on_filaments_change(value);
|
||||
m_plater->on_filament_count_change(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user