From c91d21f7c1d7e71c5ab9f8034797a942d6034125 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 15 Mar 2019 12:34:58 +0100 Subject: [PATCH] Remove wxWidgets zipper. --- src/slic3r/GUI/BackgroundSlicingProcess.cpp | 59 ++------------------- 1 file changed, 3 insertions(+), 56 deletions(-) diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index 2b4e0f16a..2601842ef 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -92,65 +92,13 @@ void BackgroundSlicingProcess::process_fff() } } -// Pseudo type for specializing LayerWriter trait class -struct SLAwxZipper {}; - -// The implementation of creating zipped archives with wxWidgets -template<> class LayerWriter { - wxFileName fpath; - wxFFileOutputStream zipfile; - wxZipOutputStream zipstream; - wxStdOutputStream pngstream; - -public: - - inline LayerWriter(const std::string& zipfile_path): - fpath(zipfile_path), - zipfile(zipfile_path), - zipstream(zipfile), - pngstream(zipstream) - { - if(!is_ok()) - throw std::runtime_error("Cannot create zip file."); - } - - ~LayerWriter() { - // In case of an error (disk space full) zipstream destructor would - // crash. - pngstream.clear(); - zipstream.CloseEntry(); - } - - inline void next_entry(const std::string& fname) { - zipstream.PutNextEntry(fname); - } - - inline std::string get_name() const { - return fpath.GetName().ToUTF8().data(); - } - - template inline LayerWriter& operator<<(T&& arg) { - pngstream << std::forward(arg); return *this; - } - - bool is_ok() const { - return pngstream.good() && zipstream.IsOk() && zipfile.IsOk(); - } - - inline void close() { - zipstream.Close(); - zipfile.Close(); - } -}; - void BackgroundSlicingProcess::process_sla() { assert(m_print == m_sla_print); m_print->process(); if (this->set_step_started(bspsGCodeFinalize)) { if (! m_export_path.empty()) { - // m_sla_print->export_raster(m_export_path); - m_sla_print->export_raster(m_export_path); + m_sla_print->export_raster(m_export_path); m_print->set_status(100, "Masked SLA file exported to " + m_export_path); } else if (! m_upload_job.empty()) { prepare_upload(); @@ -450,9 +398,8 @@ void BackgroundSlicingProcess::prepare_upload() } run_post_process_scripts(source_path.string(), m_fff_print->config()); m_upload_job.upload_data.upload_path = m_fff_print->print_statistics().finalize_output_path(m_upload_job.upload_data.upload_path.string()); - } else { - // m_sla_print->export_raster(source_path.string()); - m_sla_print->export_raster(source_path.string()); + } else { + m_sla_print->export_raster(source_path.string()); // TODO: Also finalize upload path like with FFF when there are statistics for SLA print }