From 8c8ad70c587397e0f178044460d0cd89e5e84193 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 12 Nov 2020 15:01:59 +0100 Subject: [PATCH] ENABLE_GCODE_VIEWER set as default in fff_print test and PrusaSlicer.cpp --- src/PrusaSlicer.cpp | 15 --------------- tests/fff_print/test_data.cpp | 4 ---- tests/fff_print/test_model.cpp | 8 ++------ 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 0ed719c99..c181525bd 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -138,7 +138,6 @@ int CLI::run(int argc, char **argv) m_print_config.apply(config); } -#if ENABLE_GCODE_VIEWER // are we starting as gcodeviewer ? for (auto it = m_actions.begin(); it != m_actions.end(); ++it) { if (*it == "gcodeviewer") { @@ -148,10 +147,8 @@ int CLI::run(int argc, char **argv) break; } } -#endif // ENABLE_GCODE_VIEWER // Read input file(s) if any. -#if ENABLE_GCODE_VIEWER for (const std::string& file : m_input_files) { std::string ext = boost::filesystem::path(file).extension().string(); if (ext == ".gcode" || ext == ".g") { @@ -162,7 +159,6 @@ int CLI::run(int argc, char **argv) } } if (!start_as_gcodeviewer) { -#endif // ENABLE_GCODE_VIEWER for (const std::string& file : m_input_files) { if (!boost::filesystem::exists(file)) { boost::nowide::cerr << "No such file: " << file << std::endl; @@ -195,9 +191,7 @@ int CLI::run(int argc, char **argv) } m_models.push_back(model); } -#if ENABLE_GCODE_VIEWER } -#endif // ENABLE_GCODE_VIEWER // Apply command line options to a more specific DynamicPrintConfig which provides normalize() // (command line options override --load files) @@ -504,11 +498,7 @@ int CLI::run(int argc, char **argv) print->process(); if (printer_technology == ptFFF) { // The outfile is processed by a PlaceholderParser. -#if ENABLE_GCODE_VIEWER outfile = fff_print.export_gcode(outfile, nullptr, nullptr); -#else - outfile = fff_print.export_gcode(outfile, nullptr); -#endif // ENABLE_GCODE_VIEWER outfile_final = fff_print.print_statistics().finalize_output_path(outfile); } else { outfile = sla_print.output_filepath(outfile); @@ -559,11 +549,6 @@ int CLI::run(int argc, char **argv) << " (" << print.total_extruded_volume()/1000 << "cm3)" << std::endl; */ } -#if !ENABLE_GCODE_VIEWER - } else if (opt_key == "gcodeviewer") { - start_gui = true; - start_as_gcodeviewer = true; -#endif // !ENABLE_GCODE_VIEWER } else { boost::nowide::cerr << "error: option not supported yet: " << opt_key << std::endl; return 1; diff --git a/tests/fff_print/test_data.cpp b/tests/fff_print/test_data.cpp index 8e5f6bafd..d55f9f061 100644 --- a/tests/fff_print/test_data.cpp +++ b/tests/fff_print/test_data.cpp @@ -244,11 +244,7 @@ std::string gcode(Print & print) boost::filesystem::path temp = boost::filesystem::unique_path(); print.set_status_silent(); print.process(); -#if ENABLE_GCODE_VIEWER print.export_gcode(temp.string(), nullptr, nullptr); -#else - print.export_gcode(temp.string(), nullptr); -#endif // ENABLE_GCODE_VIEWER std::ifstream t(temp.string()); std::string str((std::istreambuf_iterator(t)), std::istreambuf_iterator()); boost::nowide::remove(temp.string().c_str()); diff --git a/tests/fff_print/test_model.cpp b/tests/fff_print/test_model.cpp index 45a080f31..23c4a2d9a 100644 --- a/tests/fff_print/test_model.cpp +++ b/tests/fff_print/test_model.cpp @@ -50,12 +50,8 @@ SCENARIO("Model construction", "[Model]") { print.apply(model, config); print.process(); boost::filesystem::path temp = boost::filesystem::unique_path(); -#if ENABLE_GCODE_VIEWER - print.export_gcode(temp.string(), nullptr, nullptr); -#else - print.export_gcode(temp.string(), nullptr); -#endif // ENABLE_GCODE_VIEWER - REQUIRE(boost::filesystem::exists(temp)); + print.export_gcode(temp.string(), nullptr, nullptr); + REQUIRE(boost::filesystem::exists(temp)); REQUIRE(boost::filesystem::is_regular_file(temp)); REQUIRE(boost::filesystem::file_size(temp) > 0); boost::nowide::remove(temp.string().c_str());