diff options
-rw-r--r-- | src/libslic3r/GCodeTimeEstimator.cpp | 31 | ||||
-rw-r--r-- | src/libslic3r/GCodeTimeEstimator.hpp | 8 |
2 files changed, 20 insertions, 19 deletions
diff --git a/src/libslic3r/GCodeTimeEstimator.cpp b/src/libslic3r/GCodeTimeEstimator.cpp index 87f8bca65..8a2e1266a 100644 --- a/src/libslic3r/GCodeTimeEstimator.cpp +++ b/src/libslic3r/GCodeTimeEstimator.cpp @@ -694,38 +694,39 @@ namespace Slic3r { return m_color_times; } - std::vector<std::string> GCodeTimeEstimator::get_color_times_dhms(bool include_absolute) const + std::vector<std::string> GCodeTimeEstimator::get_color_times_dhms(bool include_remaining) const { std::vector<std::string> ret; float total_time = 0.0f; for (float t : m_color_times) { - total_time += t; - std::string time = ""; - if (include_absolute) - time += _get_time_dhms(total_time) + " ("; - time += _get_time_dhms(t); - if (include_absolute) + std::string time = _get_time_dhms(t); + if (include_remaining) + { + time += " ("; + time += _get_time_dhms(m_time - total_time); time += ")"; + } + total_time += t; ret.push_back(time); } return ret; } - std::vector<std::string> GCodeTimeEstimator::get_color_times_minutes(bool include_absolute) const + std::vector<std::string> GCodeTimeEstimator::get_color_times_minutes(bool include_remaining) const { std::vector<std::string> ret; float total_time = 0.0f; for (float t : m_color_times) { - total_time += t; - std::string time = ""; - if (include_absolute) - time += _get_time_minutes(total_time) + " ("; - time += _get_time_minutes(t); - if (include_absolute) + std::string time = _get_time_minutes(t); + if (include_remaining) + { + time += " ("; + time += _get_time_minutes(m_time - total_time); time += ")"; - ret.push_back(time); + } + total_time += t; } return ret; } diff --git a/src/libslic3r/GCodeTimeEstimator.hpp b/src/libslic3r/GCodeTimeEstimator.hpp index 792fb72a5..8d794af1e 100644 --- a/src/libslic3r/GCodeTimeEstimator.hpp +++ b/src/libslic3r/GCodeTimeEstimator.hpp @@ -350,12 +350,12 @@ namespace Slic3r { std::vector<float> get_color_times() const; // Returns the estimated time, in format DDd HHh MMm SSs, for each color - // If include_absolute==true the strings will be formatted as: "absolute time (relative time)" - std::vector<std::string> get_color_times_dhms(bool include_absolute) const; + // If include_remaining==true the strings will be formatted as: "time for color (remaining time at color start)" + std::vector<std::string> get_color_times_dhms(bool include_remaining) const; // Returns the estimated time, in minutes (integer), for each color - // If include_absolute==true the strings will be formatted as: "absolute time (relative time)" - std::vector<std::string> get_color_times_minutes(bool include_absolute) const; + // If include_remaining==true the strings will be formatted as: "time for color (remaining time at color start)" + std::vector<std::string> get_color_times_minutes(bool include_remaining) const; // Return an estimate of the memory consumed by the time estimator. size_t memory_used() const; |