ENH: CLI: add logic to check the max/min layer height

JIRA: no jira
Change-Id: I71ae31b6cb3be9c732ffc1eda4e67092eb5b8666
(cherry picked from commit d5170e15613233685d4806af500df605c73b8525)
This commit is contained in:
lane.wei
2023-10-21 18:09:10 +08:00
committed by Lane.Wei
parent 89c1395f27
commit 1a8bd061d1
4 changed files with 43 additions and 5 deletions

View File

@@ -1238,14 +1238,14 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
if (layer_height > max_layer_height_from_nozzle ||
layer_height < min_layer_height_from_nozzle) {
return { L("Layer height cannot exceed the limit in Printer Settings -> Extruder -> Layer height limits"), object, "layer_height" };
return { L("Layer height cannot exceed the limit in Printer Settings -> Extruder -> Layer height limits"), object, "layer_height", STRING_EXCEPT_LAYER_HEIGHT_EXCEEDS_LIMIT };
}
for (auto range : object->m_model_object->layer_config_ranges) {
double range_layer_height = range.second.opt_float("layer_height");
if (range_layer_height > max_layer_height_from_nozzle ||
range_layer_height < min_layer_height_from_nozzle)
return { L("Layer height cannot exceed the limit in Printer Settings -> Extruder -> Layer height limits"), nullptr, "layer_height" };
return { L("Layer height cannot exceed the limit in Printer Settings -> Extruder -> Layer height limits"), nullptr, "layer_height", STRING_EXCEPT_LAYER_HEIGHT_EXCEEDS_LIMIT };
}
// Validate extrusion widths.