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 'src/libslic3r/CustomGCode.hpp')
-rw-r--r--src/libslic3r/CustomGCode.hpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/libslic3r/CustomGCode.hpp b/src/libslic3r/CustomGCode.hpp
index a5ef1cc2e..334b40431 100644
--- a/src/libslic3r/CustomGCode.hpp
+++ b/src/libslic3r/CustomGCode.hpp
@@ -8,38 +8,40 @@ namespace Slic3r {
class DynamicPrintConfig;
-// Additional Codes which can be set by user using DoubleSlider
-static constexpr char ColorChangeCode[] = "M600";
-static constexpr char PausePrintCode[] = "M601";
-static constexpr char ToolChangeCode[] = "tool_change";
+namespace CustomGCode {
-enum CustomGcodeType
+enum Type
{
- cgtColorChange,
- cgtPausePrint,
+ ColorChange,
+ PausePrint,
+ ToolChange,
+ Template,
+ Custom
};
-namespace CustomGCode {
-
struct Item
{
bool operator<(const Item& rhs) const { return this->print_z < rhs.print_z; }
bool operator==(const Item& rhs) const
{
return (rhs.print_z == this->print_z ) &&
- (rhs.gcode == this->gcode ) &&
+ (rhs.type == this->type ) &&
(rhs.extruder == this->extruder ) &&
- (rhs.color == this->color );
+ (rhs.color == this->color ) &&
+ (rhs.extra == this->extra );
}
bool operator!=(const Item& rhs) const { return ! (*this == rhs); }
double print_z;
- std::string gcode;
+ Type type;
int extruder; // Informative value for ColorChangeCode and ToolChangeCode
// "gcode" == ColorChangeCode => M600 will be applied for "extruder" extruder
// "gcode" == ToolChangeCode => for whole print tool will be switched to "extruder" extruder
std::string color; // if gcode is equal to PausePrintCode,
// this field is used for save a short message shown on Printer display
+ std::string extra; // this field is used for the extra data like :
+ // - G-code text for the Type::Custom
+ // - message text for the Type::PausePrint
};
enum Mode