tweak generator info and use local time stamp for better readability

This commit is contained in:
SoftFever 2023-03-14 22:12:33 +08:00
parent f914a36a7f
commit 2895477da4
4 changed files with 15 additions and 10 deletions

View file

@ -1193,6 +1193,9 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
std::string bambuslicer_gcode_header = "; ";
bambuslicer_gcode_header += SLIC3R_APP_NAME;
std::string orcaslicer_gcode_header = std::string("; generated by ");
orcaslicer_gcode_header += Slic3r::header_slic3r_generated();
std::string header;
bool header_found = false;
while (std::getline(ifs, header)) {
@ -1202,7 +1205,8 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
line_c = skip_word(line_c);
line_c = skip_whitespaces(line_c);
// BBS
if (strncmp(bambuslicer_gcode_header.c_str(), line_c, strlen(bambuslicer_gcode_header.c_str())) == 0) {
if (strncmp(bambuslicer_gcode_header.c_str(), line_c, strlen(bambuslicer_gcode_header.c_str())) == 0 ||
strncmp(orcaslicer_gcode_header.c_str(), line_c, strlen(orcaslicer_gcode_header.c_str())) == 0) {
header_found = true;
break;
}