mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 15:51:10 -06:00
Improved error reporting of the PlaceholderParser.
The PlaceholderParser is currently used by the GCode.cpp and by Printer.cpp to generate a new name for the exported G-code or SVG file. The PlaceholderParser::process() will throw a runtime_error with a comprehensive error message. The G-code export will include these error messages into the G-code text with !!!!!! separators, and the GUI will inform the user, that the G-code export failed.
This commit is contained in:
parent
1244fd09eb
commit
8746f84fa2
11 changed files with 190 additions and 141 deletions
|
@ -17,7 +17,14 @@
|
|||
%name{Slic3r::GCode} class GCode {
|
||||
GCode();
|
||||
~GCode();
|
||||
std::string do_export(Print *print, const char *path);
|
||||
void do_export(Print *print, const char *path)
|
||||
%code%{
|
||||
try {
|
||||
THIS->do_export(print, path);
|
||||
} catch (std::exception& e) {
|
||||
croak(e.what());
|
||||
}
|
||||
%};
|
||||
|
||||
Ref<Pointf> origin()
|
||||
%code{% RETVAL = &(THIS->origin()); %};
|
||||
|
|
|
@ -14,5 +14,11 @@
|
|||
%code%{ THIS->apply_config(*config); %};
|
||||
void set(std::string key, int value);
|
||||
std::string process(std::string str) const
|
||||
%code%{ RETVAL = THIS->process(str, 0); %};
|
||||
%code%{
|
||||
try {
|
||||
RETVAL = THIS->process(str, 0);
|
||||
} catch (std::exception& e) {
|
||||
croak(e.what());
|
||||
}
|
||||
%};
|
||||
};
|
||||
|
|
|
@ -206,8 +206,14 @@ _constant()
|
|||
double max_allowed_layer_height() const;
|
||||
bool has_support_material() const;
|
||||
void auto_assign_extruders(ModelObject* model_object);
|
||||
std::string output_filename();
|
||||
std::string output_filepath(std::string path = "");
|
||||
std::string output_filepath(std::string path = "")
|
||||
%code%{
|
||||
try {
|
||||
RETVAL = THIS->output_filepath(path);
|
||||
} catch (std::exception& e) {
|
||||
croak(e.what());
|
||||
}
|
||||
%};
|
||||
|
||||
void add_model_object(ModelObject* model_object, int idx = -1);
|
||||
bool apply_config(DynamicPrintConfig* config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue