From 848fe4750fb4bca13e7789a7210a41da96caca18 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 24 Jan 2020 15:23:59 +0100 Subject: [PATCH] Add prusaslicer.ini to sl1 output zip --- src/libslic3r/SLA/RasterWriter.cpp | 40 ++++++++++++++++++------------ src/libslic3r/SLA/RasterWriter.hpp | 4 ++- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/libslic3r/SLA/RasterWriter.cpp b/src/libslic3r/SLA/RasterWriter.cpp index 79063d9a1..13aef7d8a 100644 --- a/src/libslic3r/SLA/RasterWriter.cpp +++ b/src/libslic3r/SLA/RasterWriter.cpp @@ -14,14 +14,16 @@ namespace Slic3r { namespace sla { -std::string RasterWriter::createIniContent(const std::string& projectname) const +void RasterWriter::write_ini(const std::map &m, std::string &ini) +{ + for (auto ¶m : m) ini += param.first + " = " + param.second + "\n"; +} + +std::string RasterWriter::create_ini_content(const std::string& projectname) const { std::string out("action = print\njobDir = "); out += projectname + "\n"; - - for (auto ¶m : m_config) - out += param.first + " = " + param.second + "\n"; - + write_ini(m_config, out); return out; } @@ -55,7 +57,12 @@ void RasterWriter::save(Zipper &zipper, const std::string &prjname) zipper.add_entry("config.ini"); - zipper << createIniContent(project); + zipper << create_ini_content(project); + + zipper.add_entry("prusaslicer.ini"); + std::string prusaslicer_ini; + write_ini(m_slicer_config, prusaslicer_ini); + zipper << prusaslicer_ini; for(unsigned i = 0; i < m_layers_rst.size(); i++) { @@ -95,7 +102,7 @@ void append_full_config(const DynamicPrintConfig &cfg, std::mapis_nil()) keys[key] = cfg.opt_serialize(key); @@ -117,17 +125,17 @@ void append_full_config(const DynamicPrintConfig &cfg, std::map m_config; + std::map m_slicer_config; - std::string createIniContent(const std::string& projectname) const; + static void write_ini(const std::map &m, std::string &ini); + std::string create_ini_content(const std::string& projectname) const; public: