This commit is contained in:
enricoturri1966 2020-11-06 11:03:56 +01:00
commit 411159b5e7
57 changed files with 2971 additions and 2371 deletions

View file

@ -20,6 +20,7 @@ SLIC3R_DERIVE_EXCEPTION(OutOfRange, LogicError);
SLIC3R_DERIVE_EXCEPTION(IOError, CriticalException);
SLIC3R_DERIVE_EXCEPTION(FileIOError, IOError);
SLIC3R_DERIVE_EXCEPTION(HostNetworkError, IOError);
SLIC3R_DERIVE_EXCEPTION(ExportError, CriticalException);
// Runtime exception produced by Slicer. Such exception cancels the slicing process and it shall be shown in notifications.
SLIC3R_DERIVE_EXCEPTION(SlicingError, Exception);
#undef SLIC3R_DERIVE_EXCEPTION

View file

@ -761,7 +761,7 @@ void GCode::do_export(Print* print, const char* path, GCodePreviewData* preview_
#if ENABLE_GCODE_VIEWER
BOOST_LOG_TRIVIAL(debug) << "Start processing gcode, " << log_memory_info();
m_processor.process_file(path_tmp, [print]() { print->throw_if_canceled(); });
m_processor.process_file(path_tmp, true, [print]() { print->throw_if_canceled(); });
DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics);
if (result != nullptr)
*result = std::move(m_processor.extract_result());
@ -1898,7 +1898,7 @@ namespace ProcessLayer
// Color Change or Tool Change as Color Change.
#if ENABLE_GCODE_VIEWER
// add tag for processor
gcode += "; " + GCodeProcessor::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
gcode += ";" + GCodeProcessor::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
#else
// add tag for analyzer
gcode += "; " + GCodeAnalyzer::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
@ -1925,7 +1925,7 @@ namespace ProcessLayer
{
#if ENABLE_GCODE_VIEWER
// add tag for processor
gcode += "; " + GCodeProcessor::Pause_Print_Tag + "\n";
gcode += ";" + GCodeProcessor::Pause_Print_Tag + "\n";
#else
// add tag for analyzer
gcode += "; " + GCodeAnalyzer::Pause_Print_Tag + "\n";
@ -1943,13 +1943,13 @@ namespace ProcessLayer
{
#if ENABLE_GCODE_VIEWER
// add tag for processor
gcode += "; " + GCodeProcessor::Custom_Code_Tag + "\n";
gcode += ";" + GCodeProcessor::Custom_Code_Tag + "\n";
#else
// add tag for analyzer
gcode += "; " + GCodeAnalyzer::Custom_Code_Tag + "\n";
#endif // ENABLE_GCODE_VIEWER
// add tag for time estimator
//gcode += "; " + GCodeTimeEstimator::Custom_Code_Tag + "\n";
//gcode += "; " + GCodeTimeEstimator::Custom_Code_Tag + "\n";
#endif // ENABLE_GCODE_VIEWER
if (gcode_type == CustomGCode::Template) // Template Cistom Gcode
gcode += config.template_custom_gcode;
else // custom Gcode

View file

@ -750,7 +750,7 @@ void GCodeProcessor::reset()
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
}
void GCodeProcessor::process_file(const std::string& filename, std::function<void()> cancel_callback)
void GCodeProcessor::process_file(const std::string& filename, bool apply_postprocess, std::function<void()> cancel_callback)
{
auto last_cancel_callback_time = std::chrono::high_resolution_clock::now();
@ -808,7 +808,8 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
update_estimated_times_stats();
// post-process to add M73 lines into the gcode
m_time_processor.post_process(filename);
if (apply_postprocess)
m_time_processor.post_process(filename);
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
std::cout << "\n";

View file

@ -433,7 +433,7 @@ namespace Slic3r {
// Process the gcode contained in the file with the given filename
// throws CanceledException through print->throw_if_canceled() (sent by the caller as callback).
void process_file(const std::string& filename, std::function<void()> cancel_callback = nullptr);
void process_file(const std::string& filename, bool apply_postprocess, std::function<void()> cancel_callback = nullptr);
float get_time(PrintEstimatedTimeStatistics::ETimeMode mode) const;
std::string get_time_dhm(PrintEstimatedTimeStatistics::ETimeMode mode) const;

View file

@ -957,9 +957,9 @@ void PrintConfigDef::init_fff_params()
def = this->add("first_layer_temperature", coInts);
def->label = L("First layer");
def->full_label = L("First layer extruder temperature");
def->tooltip = L("Extruder temperature for first layer. If you want to control temperature manually "
"during print, set this to zero to disable temperature control commands in the output file.");
def->full_label = L("First layer nozzle temperature");
def->tooltip = L("Nozzle temperature for the first layer. If you want to control temperature manually "
"during print, set this to zero to disable temperature control commands in the output G-code.");
def->sidetext = L("°C");
def->min = 0;
def->max = max_temp;
@ -1170,9 +1170,9 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionFloat(0.1));
def = this->add("ironing_speed", coFloat);
def->label = L("Ironing speed");
def->label = L("Ironing");
def->category = L("Speed");
def->tooltip = L("Ironing speed");
def->tooltip = L("Ironing");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comAdvanced;
@ -1206,7 +1206,7 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionBool(true));
def = this->add("machine_limits_usage", coEnum);
def->label = L("How to apply");
def->label = L("How to apply limits");
def->full_label = L("Purpose of Machine Limits");
def->category = L("Machine limits");
def->tooltip = L("How to apply the Machine Limits");
@ -2195,10 +2195,10 @@ void PrintConfigDef::init_fff_params()
def = this->add("temperature", coInts);
def->label = L("Other layers");
def->tooltip = L("Extruder temperature for layers after the first one. Set this to zero to disable "
"temperature control commands in the output.");
def->tooltip = L("Nozzle temperature for layers after the first one. Set this to zero to disable "
"temperature control commands in the output G-code.");
def->sidetext = L("°C");
def->full_label = L("Extruder temperature");
def->full_label = L("Nozzle temperature");
def->min = 0;
def->max = max_temp;
def->set_default_value(new ConfigOptionInts { 200 });
@ -3686,7 +3686,7 @@ CLIMiscConfigDef::CLIMiscConfigDef()
def->cli = "output|o";
def = this->add("single_instance", coBool);
def->label = L("Single Instance");
def->label = L("Single instance mode");
def->tooltip = L("If enabled, the command line arguments are sent to an existing instance of GUI PrusaSlicer, "
"or an existing PrusaSlicer window is activated. "
"Overrides the \"single_instance\" configuration value from application preferences.");

View file

@ -25,12 +25,12 @@ public:
std::string formatted_errorstr() const
{
return L("Error with zip archive") + " " + m_zipname + ": " +
get_errorstr() + "!";
get_errorstr();
}
SLIC3R_NORETURN void blow_up() const
{
throw Slic3r::RuntimeError(formatted_errorstr());
throw Slic3r::ExportError(formatted_errorstr());
}
bool is_alive()

View file

@ -429,24 +429,20 @@ CopyFileResult copy_file_inner(const std::string& from, const std::string& to, s
// the copy_file() function will fail appropriately and we don't want the permission()
// calls to cause needless failures on permissionless filesystems (ie. FATs on SD cards etc.)
// or when the target file doesn't exist.
//This error code is ignored
boost::system::error_code ec;
boost::filesystem::permissions(target, perms, ec);
//if (ec)
// BOOST_LOG_TRIVIAL(error) << "Copy file permisions before copy error message: " << ec.message();
// This error code is passed up
if (ec)
BOOST_LOG_TRIVIAL(error) << "boost::filesystem::permisions before copy error message (this could be irrelevant message based on file system): " << ec.message();
ec.clear();
boost::filesystem::copy_file(source, target, boost::filesystem::copy_option::overwrite_if_exists, ec);
if (ec) {
error_message = ec.message();
return FAIL_COPY_FILE;
}
//ec.clear();
ec.clear();
boost::filesystem::permissions(target, perms, ec);
//if (ec)
// BOOST_LOG_TRIVIAL(error) << "Copy file permisions after copy error message: " << ec.message();
if (ec)
BOOST_LOG_TRIVIAL(error) << "boost::filesystem::permisions after copy error message (this could be irrelevant message based on file system): " << ec.message();
return SUCCESS;
}