mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 22:24:01 -06:00
Fixed the Perl bindings, made Print::m_placeholder_parser protected,
removed the non-const accessor method to m_placeholder_parser.
This commit is contained in:
parent
34013ad142
commit
86287a28ec
3 changed files with 14 additions and 16 deletions
|
@ -502,7 +502,10 @@ void Print::config_diffs(
|
||||||
const ConfigOption *opt_old = m_config.option(opt_key);
|
const ConfigOption *opt_old = m_config.option(opt_key);
|
||||||
assert(opt_old != nullptr);
|
assert(opt_old != nullptr);
|
||||||
const ConfigOption *opt_new = new_full_config.option(opt_key);
|
const ConfigOption *opt_new = new_full_config.option(opt_key);
|
||||||
assert(opt_new != nullptr);
|
// assert(opt_new != nullptr);
|
||||||
|
if (opt_new == nullptr)
|
||||||
|
//FIXME This may happen when executing some test cases.
|
||||||
|
continue;
|
||||||
const ConfigOption *opt_new_filament = std::binary_search(extruder_retract_keys.begin(), extruder_retract_keys.end(), opt_key) ? new_full_config.option(filament_prefix + opt_key) : nullptr;
|
const ConfigOption *opt_new_filament = std::binary_search(extruder_retract_keys.begin(), extruder_retract_keys.end(), opt_key) ? new_full_config.option(filament_prefix + opt_key) : nullptr;
|
||||||
if (opt_new_filament != nullptr && ! opt_new_filament->is_nil()) {
|
if (opt_new_filament != nullptr && ! opt_new_filament->is_nil()) {
|
||||||
// An extruder retract override is available at some of the filament presets.
|
// An extruder retract override is available at some of the filament presets.
|
||||||
|
@ -575,12 +578,11 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
||||||
// which should be stopped if print_diff is not empty.
|
// which should be stopped if print_diff is not empty.
|
||||||
if (! full_config_diff.empty() || ! placeholder_parser_overrides.empty()) {
|
if (! full_config_diff.empty() || ! placeholder_parser_overrides.empty()) {
|
||||||
update_apply_status(this->invalidate_step(psGCodeExport));
|
update_apply_status(this->invalidate_step(psGCodeExport));
|
||||||
PlaceholderParser &pp = this->placeholder_parser();
|
m_placeholder_parser.apply_config(std::move(placeholder_parser_overrides));
|
||||||
pp.apply_config(std::move(placeholder_parser_overrides));
|
|
||||||
// Set the profile aliases for the PrintBase::output_filename()
|
// Set the profile aliases for the PrintBase::output_filename()
|
||||||
pp.set("print_preset", new_full_config.option("print_settings_id")->clone());
|
m_placeholder_parser.set("print_preset", new_full_config.option("print_settings_id")->clone());
|
||||||
pp.set("filament_preset", new_full_config.option("filament_settings_id")->clone());
|
m_placeholder_parser.set("filament_preset", new_full_config.option("filament_settings_id")->clone());
|
||||||
pp.set("printer_preset", new_full_config.option("printer_settings_id")->clone());
|
m_placeholder_parser.set("printer_preset", new_full_config.option("printer_settings_id")->clone());
|
||||||
// It is also safe to change m_config now after this->invalidate_state_by_config_options() call.
|
// It is also safe to change m_config now after this->invalidate_state_by_config_options() call.
|
||||||
m_config.apply_only(new_full_config, print_diff, true);
|
m_config.apply_only(new_full_config, print_diff, true);
|
||||||
m_config.apply(filament_overrides);
|
m_config.apply(filament_overrides);
|
||||||
|
|
|
@ -327,8 +327,6 @@ protected:
|
||||||
friend class PrintObjectBase;
|
friend class PrintObjectBase;
|
||||||
friend class BackgroundSlicingProcess;
|
friend class BackgroundSlicingProcess;
|
||||||
|
|
||||||
PlaceholderParser& placeholder_parser() { return m_placeholder_parser; }
|
|
||||||
|
|
||||||
tbb::mutex& state_mutex() const { return m_state_mutex; }
|
tbb::mutex& state_mutex() const { return m_state_mutex; }
|
||||||
std::function<void()> cancel_callback() { return m_cancel_callback; }
|
std::function<void()> cancel_callback() { return m_cancel_callback; }
|
||||||
void call_cancel_callback() { m_cancel_callback(); }
|
void call_cancel_callback() { m_cancel_callback(); }
|
||||||
|
@ -344,6 +342,7 @@ protected:
|
||||||
|
|
||||||
Model m_model;
|
Model m_model;
|
||||||
DynamicPrintConfig m_full_print_config;
|
DynamicPrintConfig m_full_print_config;
|
||||||
|
PlaceholderParser m_placeholder_parser;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
tbb::atomic<CancelStatus> m_cancel_status;
|
tbb::atomic<CancelStatus> m_cancel_status;
|
||||||
|
@ -357,8 +356,6 @@ private:
|
||||||
// The mutex will be used to guard the worker thread against entering a stage
|
// The mutex will be used to guard the worker thread against entering a stage
|
||||||
// while the data influencing the stage is modified.
|
// while the data influencing the stage is modified.
|
||||||
mutable tbb::mutex m_state_mutex;
|
mutable tbb::mutex m_state_mutex;
|
||||||
|
|
||||||
PlaceholderParser m_placeholder_parser;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename PrintStepEnum, const size_t COUNT>
|
template<typename PrintStepEnum, const size_t COUNT>
|
||||||
|
|
|
@ -161,7 +161,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig con
|
||||||
t_config_option_keys printer_diff = m_printer_config.diff(config);
|
t_config_option_keys printer_diff = m_printer_config.diff(config);
|
||||||
t_config_option_keys material_diff = m_material_config.diff(config);
|
t_config_option_keys material_diff = m_material_config.diff(config);
|
||||||
t_config_option_keys object_diff = m_default_object_config.diff(config);
|
t_config_option_keys object_diff = m_default_object_config.diff(config);
|
||||||
t_config_option_keys placeholder_parser_diff = this->placeholder_parser().config_diff(config);
|
t_config_option_keys placeholder_parser_diff = m_placeholder_parser.config_diff(config);
|
||||||
|
|
||||||
// Do not use the ApplyStatus as we will use the max function when updating apply_status.
|
// Do not use the ApplyStatus as we will use the max function when updating apply_status.
|
||||||
unsigned int apply_status = APPLY_STATUS_UNCHANGED;
|
unsigned int apply_status = APPLY_STATUS_UNCHANGED;
|
||||||
|
@ -186,12 +186,11 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig con
|
||||||
// only to generate the output file name.
|
// only to generate the output file name.
|
||||||
if (! placeholder_parser_diff.empty()) {
|
if (! placeholder_parser_diff.empty()) {
|
||||||
// update_apply_status(this->invalidate_step(slapsRasterize));
|
// update_apply_status(this->invalidate_step(slapsRasterize));
|
||||||
PlaceholderParser &pp = this->placeholder_parser();
|
m_placeholder_parser.apply_config(config);
|
||||||
pp.apply_config(config);
|
|
||||||
// Set the profile aliases for the PrintBase::output_filename()
|
// Set the profile aliases for the PrintBase::output_filename()
|
||||||
pp.set("print_preset", config.option("sla_print_settings_id")->clone());
|
m_placeholder_parser.set("print_preset", config.option("sla_print_settings_id")->clone());
|
||||||
pp.set("material_preset", config.option("sla_material_settings_id")->clone());
|
m_placeholder_parser.set("material_preset", config.option("sla_material_settings_id")->clone());
|
||||||
pp.set("printer_preset", config.option("printer_settings_id")->clone());
|
m_placeholder_parser.set("printer_preset", config.option("printer_settings_id")->clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
// It is also safe to change m_config now after this->invalidate_state_by_config_options() call.
|
// It is also safe to change m_config now after this->invalidate_state_by_config_options() call.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue