if ToolpathOutside, unable export button

This commit is contained in:
QIDI TECH
2023-06-13 09:40:53 +08:00
parent e39d22cad6
commit bb35958d83
4 changed files with 38 additions and 2 deletions

View File

@@ -87,6 +87,9 @@ static const Slic3r::ColorRGBA DARKMODE_BG_LIGHT_COLOR = {0.145f, 0.149f, 0.165f
static const Slic3r::ColorRGBA ERROR_BG_DARK_COLOR = {0.478f, 0.192f, 0.039f, 1.0f};
static const Slic3r::ColorRGBA ERROR_BG_LIGHT_COLOR = {0.753f, 0.192f, 0.039f, 1.0f};
//Y5
bool isToolpathOutside = false;
// Number of floats
static constexpr const size_t MAX_VERTEX_BUFFER_SIZE = 131072 * 6; // 3.15MB
@@ -1032,6 +1035,8 @@ wxDEFINE_EVENT(EVT_GLCANVAS_FORCE_UPDATE, SimpleEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_WIPETOWER_MOVED, Vec3dEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_WIPETOWER_ROTATED, Vec3dEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, Event<bool>);
//Y5
wxDEFINE_EVENT(EVT_GLCANVAS_ENABLE_EXPORT_BUTTONS, Event<bool>);
wxDEFINE_EVENT(EVT_GLCANVAS_UPDATE_GEOMETRY, Vec3dsEvent<2>);
wxDEFINE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_STARTED, SimpleEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);
@@ -2642,9 +2647,18 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
}
}
//Y5 if ToolpathOutside, unable export button
//post_event(Event<bool>(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS,
// contained_min_one && !m_model->objects.empty() && !partlyOut));
if (isToolpathOutside) {
post_event(Event<bool>(EVT_GLCANVAS_ENABLE_EXPORT_BUTTONS, false));
isToolpathOutside = false;
}
else {
post_event(Event<bool>(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS,
contained_min_one && !m_model->objects.empty() && !partlyOut));
}
}
else {
_set_warning_notification(EWarning::ObjectOutside, false);
_set_warning_notification(EWarning::ObjectClashed, false);
@@ -7468,6 +7482,13 @@ void GLCanvas3D::_set_warning_notification_if_needed(EWarning warning)
}
}
//Y5
if (warning == EWarning::ToolpathOutside) {
isToolpathOutside = show;
}
else {
isToolpathOutside = false;
}
_set_warning_notification(warning, show);
}

View File

@@ -161,6 +161,8 @@ wxDECLARE_EVENT(EVT_GLCANVAS_RESET_SKEW, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_INSTANCE_SCALED, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_WIPETOWER_ROTATED, Vec3dEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, Event<bool>);
//Y5
wxDECLARE_EVENT(EVT_GLCANVAS_ENABLE_EXPORT_BUTTONS, Event<bool>);
wxDECLARE_EVENT(EVT_GLCANVAS_UPDATE_GEOMETRY, Vec3dsEvent<2>);
wxDECLARE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_STARTED, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);

View File

@@ -1503,6 +1503,15 @@ void Sidebar::enable_buttons(bool enable)
p->btn_export_gcode_removable->Enable(enable);
}
//Y5
void Sidebar::enable_export_buttons(bool enable)
{
p->btn_export_gcode->Enable(enable);
p->btn_send_gcode->Enable(enable);
// p->btn_eject_device->Enable(enable);
p->btn_export_gcode_removable->Enable(enable);
}
bool Sidebar::show_reslice(bool show) const { return p->btn_reslice->Show(show); }
bool Sidebar::show_export(bool show) const { return p->btn_export_gcode->Show(show); }
bool Sidebar::show_send(bool show) const { return p->btn_send_gcode->Show(show); }
@@ -2106,6 +2115,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
view3D_canvas->Bind(EVT_GLCANVAS_RESET_SKEW, [this](SimpleEvent&) { update(); });
view3D_canvas->Bind(EVT_GLCANVAS_INSTANCE_SCALED, [this](SimpleEvent&) { update(); });
view3D_canvas->Bind(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, [this](Event<bool>& evt) { this->sidebar->enable_buttons(evt.data); });
//Y5
view3D_canvas->Bind(EVT_GLCANVAS_ENABLE_EXPORT_BUTTONS, [this](Event<bool>& evt) { this->sidebar->enable_export_buttons(evt.data); });
view3D_canvas->Bind(EVT_GLCANVAS_UPDATE_GEOMETRY, &priv::on_update_geometry, this);
view3D_canvas->Bind(EVT_GLCANVAS_MOUSE_DRAGGING_STARTED, &priv::on_3dcanvas_mouse_dragging_started, this);
view3D_canvas->Bind(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, &priv::on_3dcanvas_mouse_dragging_finished, this);

View File

@@ -103,6 +103,8 @@ public:
void show_sliced_info_sizer(const bool show);
void update_sliced_info_sizer();
void enable_buttons(bool enable);
//Y5
void enable_export_buttons(bool enable);
void set_btn_label(const ActionButtonType btn_type, const wxString& label) const;
bool show_reslice(bool show) const;
bool show_export(bool show) const;