FIX: modify the printable range error prompt
jira: STUDIO-10116 Change-Id: I489ff742f51ab8883306883ee59c98a31523fd34
This commit is contained in:
parent
677ec9e364
commit
9eee96ead7
|
@ -1473,6 +1473,27 @@ static std::pair<bool, bool> construct_extruder_unprintable_error(ObjectFilament
|
|||
}
|
||||
}
|
||||
|
||||
Preset &preset = GUI::wxGetApp().preset_bundle->printers.get_edited_preset();
|
||||
float left_x_min = 0, left_x_max = 0, left_y_min = 0, left_y_max = 0, left_z_min = 0, left_z_max = 0;
|
||||
float right_x_min = 0, right_x_max = 0, right_y_min = 0, right_y_max = 0, right_z_min = 0, right_z_max = 0;
|
||||
auto printable_height_option = preset.config.option<ConfigOptionFloatsNullable>("extruder_printable_height");
|
||||
if (printable_height_option && printable_height_option->values.size() == 2) {
|
||||
left_z_max = (float) printable_height_option->values[0];
|
||||
right_z_max = (float) printable_height_option->values[1];
|
||||
}
|
||||
std::vector<Pointfs> printable_areas = preset.config.option<ConfigOptionPointsGroups>("extruder_printable_area")->values;
|
||||
if (printable_areas.size() == 2 && printable_areas[0].size() == 4) {
|
||||
left_x_min = printable_areas[0][0][0];
|
||||
left_y_min = printable_areas[0][0][1];
|
||||
left_x_max = printable_areas[0][2][0];
|
||||
left_y_max = printable_areas[0][2][1];
|
||||
|
||||
right_x_min = printable_areas[1][0][0];
|
||||
right_y_min = printable_areas[1][0][1];
|
||||
right_x_max = printable_areas[1][2][0];
|
||||
right_y_max = printable_areas[1][2][1];
|
||||
}
|
||||
|
||||
std::vector<std::string> tips(2);
|
||||
for (size_t idx = 0; idx < tips.size(); ++idx) {
|
||||
const auto& unprintable_objs = idx == 0 ? left_unprintable_objects : right_unprintable_objects;
|
||||
|
@ -1480,15 +1501,19 @@ static std::pair<bool, bool> construct_extruder_unprintable_error(ObjectFilament
|
|||
if (unprintable_objs.empty())
|
||||
continue;
|
||||
std::string nozzle_name = nozzle_name_list[idx];
|
||||
std::string opposite_nozzle_name = nozzle_name_list[1-idx];
|
||||
std::string model_prefix;
|
||||
if (object_result.object_filaments.size() > 1)
|
||||
model_prefix = _u8L("Some models are");
|
||||
if ((idx == 0 && left_unprintable_objects.size() > 1) || (idx == 1 && right_unprintable_objects.size() > 1))
|
||||
model_prefix = (boost::format(_u8L("The position or size of some models exceed the %s's printable range.")) % nozzle_name).str();
|
||||
else
|
||||
model_prefix = (boost::format(_u8L("The model %s is")) % object_result.object_filaments.front().object->name).str();
|
||||
model_prefix = (boost::format(_u8L("The position or size of the model %s exceed the %s's printable range."))
|
||||
%object_result.object_filaments.front().object->name % nozzle_name).str();
|
||||
tips[idx] += model_prefix;
|
||||
tips[idx] += (boost::format(_u8L(" located within the %s only area, making it impossible to print with the filaments assigned to %s.\n"
|
||||
"Please move the model out of the %s only area or adjust the filament grouping.\n")) % opposite_nozzle_name % nozzle_name % opposite_nozzle_name).str();
|
||||
|
||||
tips[idx] += (boost::format(_u8L(" Please check and adjust the part's position or size to fit the printable range:\n"))).str();
|
||||
if (idx == 0)
|
||||
tips[idx] += (boost::format(_u8L("Left nozzle: X:%.0f-%.0f, Y:%.0f-%.0f, Z:%.0f-%.0f\n"))%left_x_min %left_x_max %left_y_min %left_y_max %left_z_min %left_z_max).str();
|
||||
else
|
||||
tips[idx] += (boost::format(_u8L("Right nozzle: X:%.0f-%.0f, Y:%.0f-%.0f, Z:%.0f-%.0f"))%right_x_min %right_x_max %right_y_min %right_y_max %right_z_min %right_z_max).str();
|
||||
output_text = tips[idx];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue