Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'xs/src/libslic3r/PrintConfig.hpp')
-rw-r--r--xs/src/libslic3r/PrintConfig.hpp130
1 files changed, 120 insertions, 10 deletions
diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp
index 2e36ca665..28d5aa8f4 100644
--- a/xs/src/libslic3r/PrintConfig.hpp
+++ b/xs/src/libslic3r/PrintConfig.hpp
@@ -27,6 +27,10 @@ enum GCodeFlavor {
gcfSmoothie, gcfNoExtrusion,
};
+enum PrintHostType {
+ htOctoPrint, htDuet,
+};
+
enum InfillPattern {
ipRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral,
@@ -61,6 +65,15 @@ template<> inline t_config_enum_values& ConfigOptionEnum<GCodeFlavor>::get_enum_
return keys_map;
}
+template<> inline t_config_enum_values& ConfigOptionEnum<PrintHostType>::get_enum_values() {
+ static t_config_enum_values keys_map;
+ if (keys_map.empty()) {
+ keys_map["octoprint"] = htOctoPrint;
+ keys_map["duet"] = htDuet;
+ }
+ return keys_map;
+}
+
template<> inline t_config_enum_values& ConfigOptionEnum<InfillPattern>::get_enum_values() {
static t_config_enum_values keys_map;
if (keys_map.empty()) {
@@ -155,6 +168,10 @@ public:
// Validate the PrintConfig. Returns an empty string on success, otherwise an error message is returned.
std::string validate();
+ // Remove all keys not in "valid_keys", return number of removed keys and add the list of keys to "removed_keys_message.
+ // valid_keys has to be sorted lexicographically.
+ size_t remove_keys_not_in(const DynamicPrintConfig &default_config, std::string &removed_keys_message);
+
// Verify whether the opt_key has not been obsoleted or renamed.
// Both opt_key and value may be modified by handle_legacy().
// If the opt_key is no more valid in this version of Slic3r, opt_key is cleared by handle_legacy().
@@ -310,6 +327,7 @@ public:
ConfigOptionFloatOrPercent extrusion_width;
ConfigOptionFloatOrPercent first_layer_height;
ConfigOptionBool infill_only_where_needed;
+ // Force the generation of solid shells between adjacent materials/volumes.
ConfigOptionBool interface_shells;
ConfigOptionFloat layer_height;
ConfigOptionInt raft_layers;
@@ -317,6 +335,9 @@ public:
// ConfigOptionFloat seam_preferred_direction;
// ConfigOptionFloat seam_preferred_direction_jitter;
ConfigOptionBool support_material;
+ // Automatic supports (generated based on support_material_threshold).
+ ConfigOptionBool support_material_auto;
+ // Direction of the support pattern (in XY plane).
ConfigOptionFloat support_material_angle;
ConfigOptionBool support_material_buildplate_only;
ConfigOptionFloat support_material_contact_distance;
@@ -326,17 +347,21 @@ public:
ConfigOptionBool support_material_interface_contact_loops;
ConfigOptionInt support_material_interface_extruder;
ConfigOptionInt support_material_interface_layers;
+ // Spacing between interface lines (the hatching distance). Set zero to get a solid interface.
ConfigOptionFloat support_material_interface_spacing;
ConfigOptionFloatOrPercent support_material_interface_speed;
ConfigOptionEnum<SupportMaterialPattern> support_material_pattern;
+ // Spacing between support material lines (the hatching distance).
ConfigOptionFloat support_material_spacing;
ConfigOptionFloat support_material_speed;
ConfigOptionBool support_material_synchronize_layers;
+ // Overhang angle threshold.
ConfigOptionInt support_material_threshold;
ConfigOptionBool support_material_with_sheath;
ConfigOptionFloatOrPercent support_material_xy_spacing;
ConfigOptionFloat xy_size_compensation;
-
+ ConfigOptionBool wipe_into_objects;
+
protected:
void initialize(StaticCacheBase &cache, const char *base_ptr)
{
@@ -353,6 +378,7 @@ protected:
// OPT_PTR(seam_preferred_direction);
// OPT_PTR(seam_preferred_direction_jitter);
OPT_PTR(support_material);
+ OPT_PTR(support_material_auto);
OPT_PTR(support_material_angle);
OPT_PTR(support_material_buildplate_only);
OPT_PTR(support_material_contact_distance);
@@ -372,6 +398,7 @@ protected:
OPT_PTR(support_material_threshold);
OPT_PTR(support_material_with_sheath);
OPT_PTR(xy_size_compensation);
+ OPT_PTR(wipe_into_objects);
}
};
@@ -399,10 +426,12 @@ public:
ConfigOptionInt infill_every_layers;
ConfigOptionFloatOrPercent infill_overlap;
ConfigOptionFloat infill_speed;
+ // Detect bridging perimeters
ConfigOptionBool overhangs;
ConfigOptionInt perimeter_extruder;
ConfigOptionFloatOrPercent perimeter_extrusion_width;
ConfigOptionFloat perimeter_speed;
+ // Total number of perimeters.
ConfigOptionInt perimeters;
ConfigOptionFloatOrPercent small_perimeter_speed;
ConfigOptionFloat solid_infill_below_area;
@@ -410,11 +439,13 @@ public:
ConfigOptionFloatOrPercent solid_infill_extrusion_width;
ConfigOptionInt solid_infill_every_layers;
ConfigOptionFloatOrPercent solid_infill_speed;
+ // Detect thin walls.
ConfigOptionBool thin_walls;
ConfigOptionFloatOrPercent top_infill_extrusion_width;
ConfigOptionInt top_solid_layers;
ConfigOptionFloatOrPercent top_solid_infill_speed;
-
+ ConfigOptionBool wipe_into_infill;
+
protected:
void initialize(StaticCacheBase &cache, const char *base_ptr)
{
@@ -452,6 +483,57 @@ protected:
OPT_PTR(top_infill_extrusion_width);
OPT_PTR(top_solid_infill_speed);
OPT_PTR(top_solid_layers);
+ OPT_PTR(wipe_into_infill);
+ }
+};
+
+class MachineEnvelopeConfig : public StaticPrintConfig
+{
+ STATIC_PRINT_CONFIG_CACHE(MachineEnvelopeConfig)
+public:
+ // M201 X... Y... Z... E... [mm/sec^2]
+ ConfigOptionFloats machine_max_acceleration_x;
+ ConfigOptionFloats machine_max_acceleration_y;
+ ConfigOptionFloats machine_max_acceleration_z;
+ ConfigOptionFloats machine_max_acceleration_e;
+ // M203 X... Y... Z... E... [mm/sec]
+ ConfigOptionFloats machine_max_feedrate_x;
+ ConfigOptionFloats machine_max_feedrate_y;
+ ConfigOptionFloats machine_max_feedrate_z;
+ ConfigOptionFloats machine_max_feedrate_e;
+ // M204 S... [mm/sec^2]
+ ConfigOptionFloats machine_max_acceleration_extruding;
+ // M204 T... [mm/sec^2]
+ ConfigOptionFloats machine_max_acceleration_retracting;
+ // M205 X... Y... Z... E... [mm/sec]
+ ConfigOptionFloats machine_max_jerk_x;
+ ConfigOptionFloats machine_max_jerk_y;
+ ConfigOptionFloats machine_max_jerk_z;
+ ConfigOptionFloats machine_max_jerk_e;
+ // M205 T... [mm/sec]
+ ConfigOptionFloats machine_min_travel_rate;
+ // M205 S... [mm/sec]
+ ConfigOptionFloats machine_min_extruding_rate;
+
+protected:
+ void initialize(StaticCacheBase &cache, const char *base_ptr)
+ {
+ OPT_PTR(machine_max_acceleration_x);
+ OPT_PTR(machine_max_acceleration_y);
+ OPT_PTR(machine_max_acceleration_z);
+ OPT_PTR(machine_max_acceleration_e);
+ OPT_PTR(machine_max_feedrate_x);
+ OPT_PTR(machine_max_feedrate_y);
+ OPT_PTR(machine_max_feedrate_z);
+ OPT_PTR(machine_max_feedrate_e);
+ OPT_PTR(machine_max_acceleration_extruding);
+ OPT_PTR(machine_max_acceleration_retracting);
+ OPT_PTR(machine_max_jerk_x);
+ OPT_PTR(machine_max_jerk_y);
+ OPT_PTR(machine_max_jerk_z);
+ OPT_PTR(machine_max_jerk_e);
+ OPT_PTR(machine_min_travel_rate);
+ OPT_PTR(machine_min_extruding_rate);
}
};
@@ -474,8 +556,16 @@ public:
ConfigOptionFloats filament_cost;
ConfigOptionFloats filament_max_volumetric_speed;
ConfigOptionFloats filament_loading_speed;
+ ConfigOptionFloats filament_loading_speed_start;
+ ConfigOptionFloats filament_load_time;
ConfigOptionFloats filament_unloading_speed;
+ ConfigOptionFloats filament_unloading_speed_start;
ConfigOptionFloats filament_toolchange_delay;
+ ConfigOptionFloats filament_unload_time;
+ ConfigOptionInts filament_cooling_moves;
+ ConfigOptionFloats filament_cooling_initial_speed;
+ ConfigOptionFloats filament_minimal_purge_on_wipe_tower;
+ ConfigOptionFloats filament_cooling_final_speed;
ConfigOptionStrings filament_ramming_parameters;
ConfigOptionBool gcode_comments;
ConfigOptionEnum<GCodeFlavor> gcode_flavor;
@@ -496,6 +586,7 @@ public:
ConfigOptionString start_gcode;
ConfigOptionStrings start_filament_gcode;
ConfigOptionBool single_extruder_multi_material;
+ ConfigOptionBool single_extruder_multi_material_priming;
ConfigOptionString toolchange_gcode;
ConfigOptionFloat travel_speed;
ConfigOptionBool use_firmware_retraction;
@@ -505,7 +596,9 @@ public:
ConfigOptionFloat cooling_tube_retraction;
ConfigOptionFloat cooling_tube_length;
ConfigOptionFloat parking_pos_retraction;
-
+ ConfigOptionBool remaining_times;
+ ConfigOptionBool silent_mode;
+ ConfigOptionFloat extra_loading_move;
std::string get_extrusion_axis() const
{
@@ -531,8 +624,16 @@ protected:
OPT_PTR(filament_cost);
OPT_PTR(filament_max_volumetric_speed);
OPT_PTR(filament_loading_speed);
+ OPT_PTR(filament_loading_speed_start);
+ OPT_PTR(filament_load_time);
OPT_PTR(filament_unloading_speed);
+ OPT_PTR(filament_unloading_speed_start);
+ OPT_PTR(filament_unload_time);
OPT_PTR(filament_toolchange_delay);
+ OPT_PTR(filament_cooling_moves);
+ OPT_PTR(filament_cooling_initial_speed);
+ OPT_PTR(filament_minimal_purge_on_wipe_tower);
+ OPT_PTR(filament_cooling_final_speed);
OPT_PTR(filament_ramming_parameters);
OPT_PTR(gcode_comments);
OPT_PTR(gcode_flavor);
@@ -551,6 +652,7 @@ protected:
OPT_PTR(retract_restart_extra_toolchange);
OPT_PTR(retract_speed);
OPT_PTR(single_extruder_multi_material);
+ OPT_PTR(single_extruder_multi_material_priming);
OPT_PTR(start_gcode);
OPT_PTR(start_filament_gcode);
OPT_PTR(toolchange_gcode);
@@ -562,11 +664,14 @@ protected:
OPT_PTR(cooling_tube_retraction);
OPT_PTR(cooling_tube_length);
OPT_PTR(parking_pos_retraction);
+ OPT_PTR(remaining_times);
+ OPT_PTR(silent_mode);
+ OPT_PTR(extra_loading_move);
}
};
// This object is mapped to Perl as Slic3r::Config::Print.
-class PrintConfig : public GCodeConfig
+class PrintConfig : public MachineEnvelopeConfig, public GCodeConfig
{
STATIC_PRINT_CONFIG_CACHE_DERIVED(PrintConfig)
PrintConfig() : GCodeConfig(0) { initialize_cache(); *this = s_cache_PrintConfig.defaults(); }
@@ -614,6 +719,7 @@ public:
ConfigOptionString output_filename_format;
ConfigOptionFloat perimeter_acceleration;
ConfigOptionStrings post_process;
+ ConfigOptionString printer_model;
ConfigOptionString printer_notes;
ConfigOptionFloat resolution;
ConfigOptionFloats retract_before_travel;
@@ -642,6 +748,7 @@ protected:
PrintConfig(int) : GCodeConfig(1) {}
void initialize(StaticCacheBase &cache, const char *base_ptr)
{
+ this->MachineEnvelopeConfig::initialize(cache, base_ptr);
this->GCodeConfig::initialize(cache, base_ptr);
OPT_PTR(avoid_crossing_perimeters);
OPT_PTR(bed_shape);
@@ -683,6 +790,7 @@ protected:
OPT_PTR(output_filename_format);
OPT_PTR(perimeter_acceleration);
OPT_PTR(post_process);
+ OPT_PTR(printer_model);
OPT_PTR(printer_notes);
OPT_PTR(resolution);
OPT_PTR(retract_before_travel);
@@ -713,18 +821,20 @@ class HostConfig : public StaticPrintConfig
{
STATIC_PRINT_CONFIG_CACHE(HostConfig)
public:
- ConfigOptionString octoprint_host;
- ConfigOptionString octoprint_apikey;
- ConfigOptionString octoprint_cafile;
+ ConfigOptionEnum<PrintHostType> host_type;
+ ConfigOptionString print_host;
+ ConfigOptionString printhost_apikey;
+ ConfigOptionString printhost_cafile;
ConfigOptionString serial_port;
ConfigOptionInt serial_speed;
protected:
void initialize(StaticCacheBase &cache, const char *base_ptr)
{
- OPT_PTR(octoprint_host);
- OPT_PTR(octoprint_apikey);
- OPT_PTR(octoprint_cafile);
+ OPT_PTR(host_type);
+ OPT_PTR(print_host);
+ OPT_PTR(printhost_apikey);
+ OPT_PTR(printhost_cafile);
OPT_PTR(serial_port);
OPT_PTR(serial_speed);
}