Snapshots extended to capture and restore sla_print, sla_material,

physical_printers.
Updated the snapshots dialog to display sla_print and sla_material.
Updated the snapshots dialog to display physical_printer instead of
printer if the physical_printer key is nonempty.
The "physical_printer" key was moved from [extras] to [presets] section
of PrusaSlicer.ini
This commit is contained in:
Vojtech Bubnik 2020-10-27 12:48:20 +01:00
parent 15a75ec6b0
commit 06c16b085d
6 changed files with 74 additions and 26 deletions

View file

@ -23,8 +23,11 @@ namespace Config {
// Slic3r.ini
// vendor/
// print/
// sla_print/
// filament/
// sla_material
// printer/
// physical_printer/
class Snapshot
{
public:
@ -42,12 +45,12 @@ public:
void load_ini(const std::string &path);
void save_ini(const std::string &path);
// Export the print / filament / printer selections to be activated into the AppConfig.
// Export the print / sla_print / filament / sla_material / printer selections to be activated into the AppConfig.
void export_selections(AppConfig &config) const;
void export_vendor_configs(AppConfig &config) const;
// Perform a deep compare of the active print / filament / printer / vendor directories.
// Return true if the content of the current print / filament / printer / vendor directories
// Perform a deep compare of the active print / sla_print / filament / sla_material / printer / physical_printer / vendor directories.
// Return true if the content of the current print / sla_print / filament / sla_material / printer / physical_printer / vendor directories
// matches the state stored in this snapshot.
bool equal_to_active(const AppConfig &app_config) const;
@ -65,8 +68,11 @@ public:
// Active presets at the time of the snapshot.
std::string print;
std::string sla_print;
std::vector<std::string> filaments;
std::string sla_material;
std::string printer;
std::string physical_printer;
// Annotation of the vendor configuration stored in the snapshot.
// This information is displayed to the user and used to decide compatibility
@ -97,7 +103,7 @@ public:
size_t load_db();
void update_slic3r_versions(std::vector<Index> &index_db);
// Create a snapshot directory, copy the vendor config bundles, user print/filament/printer profiles,
// Create a snapshot directory, copy the vendor config bundles, user print / sla_print / filament / sla_material / printer / physical_printer profiles,
// create an index.
const Snapshot& take_snapshot(const AppConfig &app_config, Snapshot::Reason reason, const std::string &comment = "");
const Snapshot& restore_snapshot(const std::string &id, AppConfig &app_config);