Information from DoubleSlider is saved to Model

GCode creating can work with that values.
This commit is contained in:
YuSanka 2019-10-10 16:03:58 +02:00
parent 6ac53aa4f3
commit 70ef0f25ef
10 changed files with 193 additions and 43 deletions

View file

@ -745,6 +745,32 @@ public:
ModelObjectPtrs objects;
// Wipe tower object.
ModelWipeTower wipe_tower;
// Extensions for
struct CustomGCode
{
CustomGCode(double height, const std::string& code, int extruder) :
height(height), gcode(code), extruder(extruder) {}
bool operator<(const CustomGCode& other) const { return other.height > this->height; }
bool operator==(const CustomGCode& other) const
{
return (other.height == this->height) &&
(other.gcode == this->gcode) &&
(other.extruder == this->extruder );
}
bool operator!=(const CustomGCode& other) const
{
return (other.height != this->height) ||
(other.gcode != this->gcode) ||
(other.extruder != this->extruder );
}
double height;
std::string gcode;
int extruder;
};
std::vector<CustomGCode> custom_gcode_per_height;
// Default constructor assigns a new ID to the model.
Model() { assert(this->id().valid()); }