mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
More incomplete work
This commit is contained in:
@@ -131,6 +131,13 @@ ConfigBase::set(t_config_option_key opt_key, SV* value) {
|
||||
ConfigOption* opt = this->option(opt_key, true);
|
||||
if (opt == NULL) CONFESS("Trying to set non-existing option");
|
||||
|
||||
ConfigOptionDef* optdef = &(*this->def)[opt_key];
|
||||
if (!optdef->shortcut.empty()) {
|
||||
for (std::vector<t_config_option_key>::iterator it = optdef->shortcut.begin(); it != optdef->shortcut.end(); ++it)
|
||||
this->set(*it, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ConfigOptionFloat* optv = dynamic_cast<ConfigOptionFloat*>(opt)) {
|
||||
optv->value = SvNV(value);
|
||||
} else if (ConfigOptionFloats* optv = dynamic_cast<ConfigOptionFloats*>(opt)) {
|
||||
|
||||
@@ -576,6 +576,14 @@ class PrintConfig : public StaticConfig
|
||||
Options["extra_perimeters"].cli = "extra-perimeters!";
|
||||
Options["extra_perimeters"].scope = "object";
|
||||
|
||||
Options["extruder"].type = coInt;
|
||||
Options["extruder"].label = "Extruder";
|
||||
Options["extruder"].cli = "extruder=i";
|
||||
Options["extruder"].shortcut.push_back("perimeter_extruder");
|
||||
Options["extruder"].shortcut.push_back("infill_extruder");
|
||||
Options["extruder"].shortcut.push_back("support_material_extruder");
|
||||
Options["extruder"].shortcut.push_back("support_material_interface_extruder");
|
||||
|
||||
Options["extruder_clearance_height"].type = coFloat;
|
||||
Options["extruder_clearance_height"].label = "Height";
|
||||
Options["extruder_clearance_height"].tooltip = "Set this to the vertical distance between your nozzle tip and (usually) the X carriage rods. In other words, this is the height of the clearance cylinder around your extruder, and it represents the maximum depth the extruder can peek before colliding with other printed objects.";
|
||||
@@ -761,7 +769,6 @@ class PrintConfig : public StaticConfig
|
||||
Options["infill_extruder"].label = "Infill extruder";
|
||||
Options["infill_extruder"].tooltip = "The extruder to use when printing infill.";
|
||||
Options["infill_extruder"].cli = "infill-extruder=i";
|
||||
Options["infill_extruder"].shortcut.push_back("extruder");
|
||||
|
||||
Options["infill_extrusion_width"].type = coFloatOrPercent;
|
||||
Options["infill_extrusion_width"].label = "Infill";
|
||||
@@ -879,7 +886,6 @@ class PrintConfig : public StaticConfig
|
||||
Options["perimeter_extruder"].tooltip = "The extruder to use when printing perimeters.";
|
||||
Options["perimeter_extruder"].cli = "perimeter-extruder=i";
|
||||
Options["perimeter_extruder"].aliases.push_back("perimeters_extruder");
|
||||
Options["perimeter_extruder"].shortcut.push_back("extruder");
|
||||
|
||||
Options["perimeter_extrusion_width"].type = coFloatOrPercent;
|
||||
Options["perimeter_extrusion_width"].label = "Perimeters";
|
||||
@@ -1141,7 +1147,6 @@ class PrintConfig : public StaticConfig
|
||||
Options["support_material_extruder"].label = "Support material extruder";
|
||||
Options["support_material_extruder"].tooltip = "The extruder to use when printing support material. This affects brim and raft too.";
|
||||
Options["support_material_extruder"].cli = "support-material-extruder=i";
|
||||
Options["support_material_extruder"].shortcut.push_back("extruder");
|
||||
|
||||
Options["support_material_extrusion_width"].type = coFloatOrPercent;
|
||||
Options["support_material_extrusion_width"].label = "Support material";
|
||||
@@ -1153,7 +1158,6 @@ class PrintConfig : public StaticConfig
|
||||
Options["support_material_interface_extruder"].label = "Support material interface extruder";
|
||||
Options["support_material_interface_extruder"].tooltip = "The extruder to use when printing support material interface. This affects raft too.";
|
||||
Options["support_material_interface_extruder"].cli = "support-material-interface-extruder=i";
|
||||
Options["support_material_interface_extruder"].shortcut.push_back("extruder");
|
||||
|
||||
Options["support_material_interface_layers"].type = coInt;
|
||||
Options["support_material_interface_layers"].label = "Interface layers";
|
||||
|
||||
@@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 78;
|
||||
use Test::More tests => 79;
|
||||
|
||||
foreach my $config (Slic3r::Config->new, Slic3r::Config::Print->new) {
|
||||
$config->set('layer_height', 0.3);
|
||||
@@ -88,6 +88,8 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Print->new) {
|
||||
{
|
||||
my $config = Slic3r::Config->new;
|
||||
$config->set('perimeters', 2);
|
||||
$config->set('solid_layers', 2);
|
||||
is $config->get('top_solid_layers'), 2, 'shortcut';
|
||||
|
||||
# test that no crash happens when using set_deserialize() with a key that hasn't been set() yet
|
||||
$config->set_deserialize('filament_diameter', '3');
|
||||
|
||||
Reference in New Issue
Block a user