Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenricoturri1966 <enricoturri@seznam.cz>2020-08-11 12:12:30 +0300
committerenricoturri1966 <enricoturri@seznam.cz>2020-08-11 12:12:30 +0300
commit5882c121cc2aca8fc85f1106a624d85330b3b968 (patch)
tree47b44a8e7531e6227da3bea6376a60dcfccef6ab /src/slic3r/GUI
parentdea641183cdf00921888689c00153cf365e72aab (diff)
GCodeProcessor -> Fixed time estimate for stealth mode
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r--src/slic3r/GUI/GCodeViewer.cpp14
-rw-r--r--src/slic3r/GUI/Plater.cpp2
2 files changed, 12 insertions, 4 deletions
diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp
index ad8418401..bbd357e98 100644
--- a/src/slic3r/GUI/GCodeViewer.cpp
+++ b/src/slic3r/GUI/GCodeViewer.cpp
@@ -9,7 +9,7 @@
#include "GUI_App.hpp"
#include "MainFrame.hpp"
#include "Plater.hpp"
-#include "PresetBundle.hpp"
+#include "libslic3r/PresetBundle.hpp"
#include "Camera.hpp"
#include "I18N.hpp"
#include "GUI_Utils.hpp"
@@ -1498,7 +1498,7 @@ void GCodeViewer::render_legend() const
imgui.text(time);
ImGui::SameLine(offsets[1]);
pos = ImGui::GetCursorScreenPos();
- float width = percent_bar_size * percent / max_percent;
+ float width = std::max(1.0f, percent_bar_size * percent / max_percent);
draw_list->AddRectFilled({ pos.x, pos.y + 2.0f }, { pos.x + width, pos.y + icon_size - 2.0f },
ImGui::GetColorU32(ImGuiWrapper::COL_ORANGE_LIGHT));
ImGui::Dummy({ percent_bar_size, icon_size });
@@ -1649,7 +1649,15 @@ void GCodeViewer::render_legend() const
imgui.text(short_time(get_time_dhms(time_mode.time)));
auto show_mode_button = [this, &imgui](const std::string& label, PrintEstimatedTimeStatistics::ETimeMode mode) {
- if (m_time_statistics.modes[static_cast<size_t>(mode)].roles_times.size() > 0) {
+ bool show = false;
+ for (size_t i = 0; i < m_time_statistics.modes.size(); ++i) {
+ if (i != static_cast<size_t>(mode) &&
+ short_time(get_time_dhms(m_time_statistics.modes[static_cast<size_t>(mode)].time)) != short_time(get_time_dhms(m_time_statistics.modes[i].time))) {
+ show = true;
+ break;
+ }
+ }
+ if (show && m_time_statistics.modes[static_cast<size_t>(mode)].roles_times.size() > 0) {
ImGui::SameLine(0.0f, 10.0f);
if (imgui.button(label)) {
m_time_estimate_mode = mode;
diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp
index 0b9f88451..dac3f6fae 100644
--- a/src/slic3r/GUI/Plater.cpp
+++ b/src/slic3r/GUI/Plater.cpp
@@ -4577,8 +4577,8 @@ void Plater::load_gcode(const wxString& filename)
// process gcode
GCodeProcessor processor;
-// processor.apply_config(config);
processor.enable_producers(true);
+ processor.enable_machine_envelope_processing(true);
processor.process_file(filename.ToUTF8().data());
p->gcode_result = std::move(processor.extract_result());