Improved constness of the Print / PrintObject / Layer ...

Split the wipe tower and time statistics data into separate objects.
Initial work in synchronizing the Model with the Print.
This commit is contained in:
bubnikv 2018-09-11 14:04:47 +02:00
parent 49697ed6aa
commit 41ce69f327
21 changed files with 1197 additions and 1101 deletions

View file

@ -69,7 +69,7 @@ PlaceholderParser::PlaceholderParser()
this->update_timestamp();
}
void PlaceholderParser::update_timestamp()
void PlaceholderParser::update_timestamp(DynamicConfig &config)
{
time_t rawtime;
time(&rawtime);
@ -84,14 +84,14 @@ void PlaceholderParser::update_timestamp()
ss << std::setw(2) << std::setfill('0') << timeinfo->tm_hour;
ss << std::setw(2) << std::setfill('0') << timeinfo->tm_min;
ss << std::setw(2) << std::setfill('0') << timeinfo->tm_sec;
this->set("timestamp", ss.str());
config.set_key_value("timestamp", new ConfigOptionString(ss.str()));
}
this->set("year", 1900 + timeinfo->tm_year);
this->set("month", 1 + timeinfo->tm_mon);
this->set("day", timeinfo->tm_mday);
this->set("hour", timeinfo->tm_hour);
this->set("minute", timeinfo->tm_min);
this->set("second", timeinfo->tm_sec);
config.set_key_value("year", new ConfigOptionInt(1900 + timeinfo->tm_year));
config.set_key_value("month", new ConfigOptionInt(1 + timeinfo->tm_mon));
config.set_key_value("day", new ConfigOptionInt(timeinfo->tm_mday));
config.set_key_value("hour", new ConfigOptionInt(timeinfo->tm_hour));
config.set_key_value("minute", new ConfigOptionInt(timeinfo->tm_min));
config.set_key_value("second", new ConfigOptionInt(timeinfo->tm_sec));
}
// Scalar configuration values are stored into m_single,