diff --git a/CMakeLists.txt b/CMakeLists.txt index c4e599f36..4e42e24e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) +if(NOT WIN32) + # Add DEBUG flags for the debug builds in a way the Visual Studio adds these flags. + add_compile_options("$<$:-DDEBUG>") + add_compile_options("$<$:-D_DEBUG>") +endif() + # To be able to link libslic3r with the Perl XS module. # Once we get rid of Perl and libslic3r is linked statically, we can get rid of -fPIC set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 1ef6c7b84..ea2d9b03d 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1908,7 +1908,7 @@ DynamicConfig PrintStatistics::config() const config.set_key_value("print_time", new ConfigOptionString(normal_print_time)); config.set_key_value("normal_print_time", new ConfigOptionString(normal_print_time)); config.set_key_value("silent_print_time", new ConfigOptionString(silent_print_time)); - config.set_key_value("used_filament", new ConfigOptionFloat (this->total_used_filament)); + config.set_key_value("used_filament", new ConfigOptionFloat (this->total_used_filament / 1000.)); config.set_key_value("extruded_volume", new ConfigOptionFloat (this->total_extruded_volume)); config.set_key_value("total_cost", new ConfigOptionFloat (this->total_cost)); config.set_key_value("total_weight", new ConfigOptionFloat (this->total_weight)); @@ -1924,7 +1924,7 @@ DynamicConfig PrintStatistics::placeholders() "print_time", "normal_print_time", "silent_print_time", "used_filament", "extruded_volume", "total_cost", "total_weight", "total_wipe_tower_cost", "total_wipe_tower_filament"}) - config.set_key_value(key, new ConfigOptionString(std::string("{") + key + "}")); + config.set_key_value(key, new ConfigOptionString(std::string("{") + key + "}")); return config; } diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index 4ef020bf8..463be8397 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -437,12 +437,10 @@ void BackgroundSlicingProcess::prepare_upload() if (m_print == m_fff_print) { m_print->set_status(95, "Running post-processing scripts"); - run_post_process_scripts(source_path.string(), m_fff_print->config()); - if (copy_file(m_temp_output_path, source_path.string()) != 0) { throw std::runtime_error("Copying of the temporary G-code to the output G-code failed"); } - + 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()); diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 3dd160432..862f1b107 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -143,9 +143,11 @@ void Field::get_value_by_opt_type(wxString& str) break; } double val; + // Replace the first occurence of comma in decimal number. + str.Replace(",", ".", false); if(!str.ToCDouble(&val)) { - show_error(m_parent, _(L("Input value contains incorrect symbol(s).\nUse, please, only digits"))); + show_error(m_parent, _(L("Invalid numeric input."))); set_value(double_to_string(val), true); } if (m_opt.min > val || val > m_opt.max) @@ -163,10 +165,12 @@ void Field::get_value_by_opt_type(wxString& str) if (m_opt.type == coFloatOrPercent && !str.IsEmpty() && str.Last() != '%') { double val; + // Replace the first occurence of comma in decimal number. + str.Replace(",", ".", false); if (!str.ToCDouble(&val)) { - show_error(m_parent, _(L("Input value contains incorrect symbol(s).\nUse, please, only digits"))); - set_value(double_to_string(val), true); + show_error(m_parent, _(L("Invalid numeric input."))); + set_value(double_to_string(val), true); } else if (m_opt.sidetext.rfind("mm/s") != std::string::npos && val > m_opt.max || m_opt.sidetext.rfind("mm ") != std::string::npos && val > 1) @@ -334,6 +338,7 @@ void TextCtrl::propagate_value() boost::any& TextCtrl::get_value() { wxString ret_str = static_cast(window)->GetValue(); + // modifies ret_string! get_value_by_opt_type(ret_str); return m_value; @@ -727,11 +732,13 @@ boost::any& Choice::get_value() else if (m_opt.gui_type == "f_enum_open") { const int ret_enum = static_cast(window)->GetSelection(); if (ret_enum < 0 || m_opt.enum_values.empty() || m_opt.type == coStrings) + // modifies ret_string! get_value_by_opt_type(ret_str); else m_value = atof(m_opt.enum_values[ret_enum].c_str()); } else + // modifies ret_string! get_value_by_opt_type(ret_str); return m_value;