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.

View File

@@ -22,6 +22,7 @@ enum StringExceptionType {
STRING_EXCEPT_FILAMENTS_DIFFERENT_TEMP = 2,
STRING_EXCEPT_OBJECT_COLLISION_IN_SEQ_PRINT = 3,
STRING_EXCEPT_OBJECT_COLLISION_IN_LAYER_PRINT = 4,
STRING_EXCEPT_LAYER_HEIGHT_EXCEEDS_LIMIT = 5,
STRING_EXCEPT_COUNT
};

View File

@@ -39,6 +39,7 @@
#define CLI_PRINTABLE_SIZE_REDUCED -20
#define CLI_OBJECT_ARRANGE_FAILED -21
#define CLI_OBJECT_ORIENT_FAILED -22
#define CLI_MODIFIED_PARAMS_TO_PRINTER -23
#define CLI_NO_SUITABLE_OBJECTS -50