update libslic3r

This commit is contained in:
QIDI TECH
2024-11-28 15:12:18 +08:00
parent 459e7822db
commit a26696f35e
115 changed files with 15117 additions and 4090 deletions

View File

@@ -63,7 +63,7 @@
#define CLI_SLICING_ERROR -100
#define CLI_GCODE_PATH_CONFLICTS -101
#define CLI_FILAMENT_UNPRINTABLE_ON_FIRST_LAYER -103
namespace boost { namespace filesystem { class directory_entry; }}
@@ -354,6 +354,7 @@ inline typename CONTAINER_TYPE::value_type& next_value_modulo(typename CONTAINER
}
extern std::string xml_escape(std::string text, bool is_marked = false);
extern std::string xml_escape_double_quotes_attribute_value(std::string text);
extern std::string xml_unescape(std::string text);
@@ -577,6 +578,45 @@ inline std::string get_qdt_monitor_time_dhm(float time_in_secs)
return buffer;
}
inline std::string get_qdt_finish_time_dhm(float time_in_secs)
{
if (time_in_secs < 1) return "Finished";
time_t finish_time = std::time(nullptr) + static_cast<time_t>(time_in_secs);
std::tm *finish_tm = std::localtime(&finish_time);
int finish_hour = finish_tm->tm_hour;
int finish_minute = finish_tm->tm_min;
int finish_day = finish_tm->tm_yday;
int finish_year = finish_tm->tm_year + 1900;
time_t current_time = std::time(nullptr);
std::tm *current_tm = std::localtime(&current_time);
int current_day = current_tm->tm_yday;
int current_year = current_tm->tm_year + 1900;
int diff_day = 0;
if (current_year != finish_year) {
if ((current_year % 4 == 0 && current_year % 100 != 0) || current_year % 400 == 0)
diff_day = 366 - current_day;
else
diff_day = 365 - current_day;
for (int year = current_year + 1; year < finish_year; year++) {
if ((current_year % 4 == 0 && current_year % 100 != 0) || current_year % 400 == 0)
diff_day += 366;
else
diff_day += 365;
}
diff_day += finish_day;
} else {
diff_day = finish_day - current_day;
}
std::ostringstream formattedTime;
formattedTime << std::setw(2) << std::setfill('0') << finish_hour << ":" << std::setw(2) << std::setfill('0') << finish_minute;
std::string finish_time_str = formattedTime.str();
if (diff_day != 0) finish_time_str += "+" + std::to_string(diff_day);
return finish_time_str;
}
inline std::string get_qdt_remain_time_dhms(float time_in_secs)
{
int days = (int) (time_in_secs / 86400.0f);