Add new config values to SL1 zip file config.ini

All requested config values are written into SL1 ini file inside the zip

* TIme.hpp and Time.cpp is now part of libslic3r instead of libslic3r_gui
* Updated time manipulation function: separate timestamp_local_str and timestamp_utc_str
* timestamp_utc_str is used in header_slic3r_generated(). Gcode now contains UTC timestamps
This commit is contained in:
tamasmeszaros 2019-09-11 12:13:59 +02:00
parent af77eca9df
commit c37ec7463f
15 changed files with 273 additions and 213 deletions

View file

@ -6,6 +6,8 @@
#include <cstdarg>
#include <stdio.h>
#include "Time.hpp"
#ifdef WIN32
#include <windows.h>
#include <psapi.h>
@ -29,7 +31,6 @@
#include <boost/locale.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/date_time/local_time/local_time.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/nowide/fstream.hpp>
@ -540,16 +541,9 @@ std::string string_printf(const char *format, ...)
return res;
}
std::string timestamp_str()
std::string header_slic3r_generated()
{
const auto now = boost::posix_time::second_clock::local_time();
char buf[2048];
sprintf(buf, "on %04d-%02d-%02d at %02d:%02d:%02d",
// Local date in an ANSII format.
int(now.date().year()), int(now.date().month()), int(now.date().day()),
int(now.time_of_day().hours()), int(now.time_of_day().minutes()), int(now.time_of_day().seconds()));
return buf;
return std::string("generated by " SLIC3R_APP_NAME " " SLIC3R_VERSION " on " ) + Utils::current_utc_time2str();
}
unsigned get_current_pid()