GCodeViewer -> Estimated printing time dialog hidden by defaul

This commit is contained in:
enricoturri1966 2020-07-20 12:25:00 +02:00
parent 51f0fd8912
commit 4700579589
4 changed files with 36 additions and 22 deletions

View file

@ -495,6 +495,14 @@ void GCodeViewer::set_layers_z_range(const std::array<double, 2>& layers_z_range
wxGetApp().plater()->update_preview_moves_slider();
}
void GCodeViewer::enable_time_estimate(bool enable)
{
m_time_estimate_enabled = enable;
wxGetApp().update_ui_from_settings();
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
wxGetApp().plater()->get_current_canvas3D()->request_extra_frame();
}
void GCodeViewer::export_toolpaths_to_obj(const char* filename) const
{
if (filename == nullptr)

View file

@ -341,7 +341,7 @@ private:
Shells m_shells;
EViewType m_view_type{ EViewType::FeatureType };
bool m_legend_enabled{ true };
bool m_time_estimate_enabled{ true };
bool m_time_estimate_enabled{ false };
#if ENABLE_GCODE_VIEWER_STATISTICS
mutable Statistics m_statistics;
#endif // ENABLE_GCODE_VIEWER_STATISTICS
@ -398,7 +398,7 @@ public:
void enable_legend(bool enable) { m_legend_enabled = enable; }
bool is_time_estimate_enabled() const { return m_time_estimate_enabled; }
void enable_time_estimate(bool enable) { m_time_estimate_enabled = enable; }
void enable_time_estimate(bool enable);
void export_toolpaths_to_obj(const char* filename) const;

View file

@ -558,6 +558,7 @@ public:
void reset_gcode_toolpaths() { m_gcode_viewer.reset(); }
const GCodeViewer::SequentialView& get_gcode_sequential_view() const { return m_gcode_viewer.get_sequential_view(); }
void update_gcode_sequential_view_current(unsigned int first, unsigned int last) { m_gcode_viewer.update_sequential_view_current(first, last); }
bool is_time_estimate_enabled() const { return m_gcode_viewer.is_time_estimate_enabled(); }
#endif // ENABLE_GCODE_VIEWER
void toggle_sla_auxiliaries_visibility(bool visible, const ModelObject* mo = nullptr, int instance_idx = -1);

View file

@ -1323,8 +1323,9 @@ void Sidebar::update_sliced_info_sizer()
p->sliced_info->SetTextAndShow(siCost, info_text, new_label);
#if ENABLE_GCODE_VIEWER
if (ps.estimated_normal_print_time_str == "N/A" && ps.estimated_silent_print_time_str == "N/A")
if (p->plater->get_current_canvas3D()->is_time_estimate_enabled() || (ps.estimated_normal_print_time_str == "N/A" && ps.estimated_silent_print_time_str == "N/A"))
#else
if (ps.estimated_normal_print_time == "N/A" && ps.estimated_silent_print_time == "N/A")
#endif // ENABLE_GCODE_VIEWER
p->sliced_info->SetTextAndShow(siEstimatedTime, "N/A");
@ -2180,6 +2181,10 @@ void Plater::priv::select_view_3D(const std::string& name)
set_current_panel(view3D);
else if (name == "Preview")
set_current_panel(preview);
#if ENABLE_GCODE_VIEWER
wxGetApp().update_ui_from_settings();
#endif // ENABLE_GCODE_VIEWER
}
void Plater::priv::select_next_view_3D()