mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 00:01:09 -06:00
Fixed configuration & validate C++ ports.
This commit is contained in:
parent
5a99e694ce
commit
3bc79e80d5
8 changed files with 36 additions and 37 deletions
|
@ -38,16 +38,24 @@
|
|||
void normalize();
|
||||
%name{setenv} void setenv_();
|
||||
double min_object_distance() %code{% RETVAL = PrintConfig::min_object_distance(THIS); %};
|
||||
%name{_load} void load(std::string file);
|
||||
%name{_load_from_gcode} void load_from_gcode(std::string input_file)
|
||||
static DynamicPrintConfig* load(char *path)
|
||||
%code%{
|
||||
auto config = new DynamicPrintConfig();
|
||||
try {
|
||||
THIS->load_from_gcode(input_file);
|
||||
config->load(path);
|
||||
RETVAL = config;
|
||||
} catch (std::exception& e) {
|
||||
croak("Error extracting configuration from a g-code %s:\n%s\n", input_file.c_str(), e.what());
|
||||
delete config;
|
||||
croak("Error extracting configuration from %s:\n%s\n", path, e.what());
|
||||
}
|
||||
%};
|
||||
void save(std::string file);
|
||||
int validate() %code%{
|
||||
std::string err = THIS->validate();
|
||||
if (! err.empty())
|
||||
croak("Configuration is not valid: %s\n", err.c_str());
|
||||
RETVAL = 1;
|
||||
%};
|
||||
};
|
||||
|
||||
%name{Slic3r::Config::Static} class StaticPrintConfig {
|
||||
|
@ -94,8 +102,18 @@
|
|||
%};
|
||||
%name{setenv} void setenv_();
|
||||
double min_object_distance() %code{% RETVAL = PrintConfig::min_object_distance(THIS); %};
|
||||
%name{_load} void load(std::string file);
|
||||
%name{_load_from_gcode} void load_from_gcode(std::string file);
|
||||
static StaticPrintConfig* load(char *path)
|
||||
%code%{
|
||||
auto config = new FullPrintConfig();
|
||||
try {
|
||||
config->load(path);
|
||||
RETVAL = static_cast<PrintObjectConfig*>(config);
|
||||
} catch (std::exception& e) {
|
||||
delete config;
|
||||
croak("Error extracting configuration from %s:\n%s\n", path, e.what());
|
||||
}
|
||||
%};
|
||||
|
||||
void save(std::string file);
|
||||
};
|
||||
|
||||
|
|
|
@ -215,8 +215,7 @@ _constant()
|
|||
bool has_infinite_skirt();
|
||||
bool has_skirt();
|
||||
std::vector<unsigned int> extruders() const;
|
||||
std::string _validate()
|
||||
%code%{ RETVAL = THIS->validate(); %};
|
||||
void validate() %code%{ std::string err = THIS->validate(); if (! err.empty()) throw std::exception(err.c_str()); %};
|
||||
Clone<BoundingBox> bounding_box();
|
||||
Clone<BoundingBox> total_bounding_box();
|
||||
double skirt_first_layer_height();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue