diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 14f1bc91a7..0c372e8662 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -46,6 +46,7 @@ #include "libslic3r.h" #include "LocalesUtils.hpp" #include "format.hpp" +#include "Time.hpp" #include #include @@ -950,6 +951,7 @@ void GCodeGenerator::_do_export(Print& print, GCodeOutputStream &file, Thumbnail // file data binary_data.file_metadata.raw_data.emplace_back("Producer", std::string(SLIC3R_APP_NAME) + " " + std::string(SLIC3R_VERSION)); + binary_data.file_metadata.raw_data.emplace_back("Produced on", Utils::utc_timestamp()); // config data encode_full_config(*m_print, binary_data.slicer_metadata.raw_data); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 885d126e23..1d6aef73ce 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -491,6 +491,20 @@ void PrintConfigDef::init_common_params() def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionEnum(atKeyPassword)); + def = this->add("profile_vendor", coString); + def->label = L("Profile vendor"); + def->tooltip = L("Name of profile vendor"); + def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; + def->set_default_value(new ConfigOptionString("")); + + def = this->add("profile_version", coString); + def->label = L("Profile version"); + def->tooltip = L("Version of profile"); + def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; + def->set_default_value(new ConfigOptionString("")); + // temporary workaround for compatibility with older Slicer { def = this->add("preset_name", coString); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 249e99bda7..45d6eaded8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2106,15 +2106,26 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool const Preset &selected_printer = wxGetApp().preset_bundle->printers.get_selected_preset(); std::string printer_model_serialized = full_config.option("printer_model")->serialize(); + + const VendorProfile* vendor = nullptr; std::string vendor_repo_prefix; if (selected_printer.vendor) { - vendor_repo_prefix = selected_printer.vendor->repo_prefix; + vendor = selected_printer.vendor; + } else if (std::string inherits = selected_printer.inherits(); !inherits.empty()) { const Preset *parent = wxGetApp().preset_bundle->printers.find_preset(inherits); if (parent && parent->vendor) { vendor_repo_prefix = parent->vendor->repo_prefix; } } + + if (vendor) { + vendor_repo_prefix = vendor->repo_prefix; + // Passing extra info about preset vendor and version, so these can be inserted as metadata to GCode + full_config.set("profile_vendor", vendor->name, true); + full_config.set("profile_version", vendor->config_version.to_string(), true); + } + if (printer_model_serialized.find(vendor_repo_prefix) == 0) { printer_model_serialized = printer_model_serialized.substr(vendor_repo_prefix.size()); boost::trim_left(printer_model_serialized);