OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::CustomGCode Namespace Reference

Classes

struct  Item
struct  Info

Enumerations

enum  Type {
  ColorChange , PausePrint , ToolChange , Template ,
  Custom , Unknown
}
enum  Mode { Undef , SingleExtruder , MultiAsSingle , MultiExtruder }

Functions

void check_mode_for_custom_gcode_per_print_z (Info &info)
std::vector< std::pair< double, unsigned int > > custom_tool_changes (const Info &custom_gcode_per_print_z, size_t num_extruders)

Variables

static constexpr char SingleExtruderMode [] = "SingleExtruder"
static constexpr char MultiAsSingleMode [] = "MultiAsSingle"
static constexpr char MultiExtruderMode [] = "MultiExtruder"

Enumeration Type Documentation

◆ Mode

Enumerator
Undef 
SingleExtruder 
MultiAsSingle 
MultiExtruder 
54{
55 Undef,
56 SingleExtruder, // Single extruder printer preset is selected
57 MultiAsSingle, // Multiple extruder printer preset is selected, but
58 // this mode works just for Single extruder print
59 // (The same extruder is assigned to all ModelObjects and ModelVolumes).
60 MultiExtruder // Multiple extruder printer preset is selected
61};
@ Undef
Definition CustomGCode.hpp:55
@ MultiAsSingle
Definition CustomGCode.hpp:57
@ SingleExtruder
Definition CustomGCode.hpp:56
@ MultiExtruder
Definition CustomGCode.hpp:60

◆ Type

Enumerator
ColorChange 
PausePrint 
ToolChange 
Template 
Custom 
Unknown 
18{
23 Custom,
24 Unknown,
25};
@ PausePrint
Definition CustomGCode.hpp:20
@ ToolChange
Definition CustomGCode.hpp:21
@ Template
Definition CustomGCode.hpp:22
@ Custom
Definition CustomGCode.hpp:23
@ ColorChange
Definition CustomGCode.hpp:19
@ Unknown
Definition CustomGCode.hpp:24

Function Documentation

◆ check_mode_for_custom_gcode_per_print_z()

void Slic3r::CustomGCode::check_mode_for_custom_gcode_per_print_z ( Info & info)
extern
83{
84 if (info.mode != Undef)
85 return;
86
87 bool is_single_extruder = true;
88 for (auto item : info.gcodes)
89 {
90 if (item.type == ToolChange) {
91 info.mode = MultiAsSingle;
92 return;
93 }
94 if (item.type == ColorChange && item.extruder > 1)
95 is_single_extruder = false;
96 }
97
98 info.mode = is_single_extruder ? SingleExtruder : MultiExtruder;
99}
Mode mode
Definition CustomGCode.hpp:70
std::vector< Item > gcodes
Definition CustomGCode.hpp:71

References ColorChange, Slic3r::CustomGCode::Info::gcodes, Slic3r::CustomGCode::Info::mode, MultiAsSingle, MultiExtruder, SingleExtruder, ToolChange, and Undef.

Referenced by Slic3r::Model::read_from_archive().

Here is the caller graph for this function:

◆ custom_tool_changes()

std::vector< std::pair< double, unsigned int > > Slic3r::CustomGCode::custom_tool_changes ( const Info & custom_gcode_per_print_z,
size_t num_extruders )
104{
105 std::vector<std::pair<double, unsigned int>> custom_tool_changes;
106 for (const Item& custom_gcode : custom_gcode_per_print_z.gcodes)
107 if (custom_gcode.type == ToolChange) {
108 // If extruder count in PrinterSettings was changed, use default (0) extruder for extruders, more than num_extruders
109 assert(custom_gcode.extruder >= 0);
110 custom_tool_changes.emplace_back(custom_gcode.print_z, static_cast<unsigned int>(size_t(custom_gcode.extruder) > num_extruders ? 1 : custom_gcode.extruder));
111 }
112 return custom_tool_changes;
113}
std::vector< std::pair< double, unsigned int > > custom_tool_changes(const Info &custom_gcode_per_print_z, size_t num_extruders)
Definition CustomGCode.cpp:103
static CustomGCode::Info custom_gcode_per_print_z
Definition ToolOrdering.cpp:3253
Definition CustomGCode.hpp:28
double print_z
Definition CustomGCode.hpp:40
int extruder
Definition CustomGCode.hpp:42
Type type
Definition CustomGCode.hpp:41

References Slic3r::custom_gcode_per_print_z, custom_tool_changes(), Slic3r::CustomGCode::Item::extruder, Slic3r::CustomGCode::Item::print_z, ToolChange, and Slic3r::CustomGCode::Item::type.

Referenced by Slic3r::ToolOrdering::ToolOrdering(), and custom_tool_changes().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MultiAsSingleMode

char Slic3r::CustomGCode::MultiAsSingleMode[] = "MultiAsSingle"
staticconstexpr

◆ MultiExtruderMode

char Slic3r::CustomGCode::MultiExtruderMode[] = "MultiExtruder"
staticconstexpr

◆ SingleExtruderMode

char Slic3r::CustomGCode::SingleExtruderMode[] = "SingleExtruder"
staticconstexpr