ENH: custom gcode info should be owned by every plate

Change-Id: I5e5b000b7d04354d3c3cc311d089cb591a37501e
This commit is contained in:
liz.li 2023-02-01 17:38:02 +08:00 committed by Lane.Wei
parent 5f71eba979
commit e7ea07944f
16 changed files with 545 additions and 680 deletions

View file

@ -1301,7 +1301,17 @@ public:
}
// Extensions for color print
CustomGCode::Info custom_gcode_per_print_z;
// CustomGCode::Info custom_gcode_per_print_z;
//BBS: replace model custom gcode with current plate custom gcode
int curr_plate_index{ 0 };
std::map<int, CustomGCode::Info> plates_custom_gcodes; //map<plate_index, CustomGCode::Info>
const CustomGCode::Info get_curr_plate_custom_gcodes() const {
if (plates_custom_gcodes.find(curr_plate_index) != plates_custom_gcodes.end()) {
return plates_custom_gcodes.at(curr_plate_index);
}
return CustomGCode::Info();
}
// Default constructor assigns a new ID to the model.
Model() { assert(this->id().valid()); }