mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 06:41:14 -06:00
Display print end time for in BL device page (#1568)
Show progress increase end time Supplementary translation Co-authored-by: ZdDroid <601865048@qq.com>
This commit is contained in:
parent
224e1ea2de
commit
87f6c43784
5 changed files with 305 additions and 214 deletions
|
@ -10,6 +10,9 @@
|
|||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/date_time.hpp>
|
||||
#include "boost/date_time/posix_time/ptime.hpp"
|
||||
|
||||
#include <openssl/md5.h>
|
||||
|
||||
#include "libslic3r.h"
|
||||
|
@ -548,6 +551,21 @@ inline std::string get_bbl_monitor_time_dhm(float time_in_secs)
|
|||
return buffer;
|
||||
}
|
||||
|
||||
inline std::string get_bbl_monitor_end_time_dhm(float time_in_secs)
|
||||
{
|
||||
if (time_in_secs == 0.0f)
|
||||
return {};
|
||||
|
||||
std::stringstream stream;
|
||||
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
|
||||
auto endTime = now + boost::posix_time::seconds(static_cast<int>(time_in_secs));
|
||||
auto facet = new boost::posix_time::time_facet("%H:%M");//%Y-%m-%d %H:%M:%S
|
||||
stream.imbue(std::locale(std::locale::classic(), facet));
|
||||
stream << endTime;
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
inline std::string get_bbl_remain_time_dhms(float time_in_secs)
|
||||
{
|
||||
int days = (int) (time_in_secs / 86400.0f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue