FIX: The maximum value is not printed in PA line mode

Jira: 5046  4951
Change-Id: Ic81f9a75ce7f088fe950fdde283ff5c942cd6e83
This commit is contained in:
zhimin.zeng 2023-11-30 11:03:43 +08:00 committed by Lane.Wei
parent af69cf1264
commit fd00d28027
2 changed files with 2 additions and 2 deletions

View File

@ -2091,7 +2091,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
pa_test.set_speed(fast_speed, slow_speed);
pa_test.draw_numbers() = print.calib_params().print_numbers;
auto params = print.calib_params();
gcode += pa_test.generate_test(params.start, params.step, std::llround(std::ceil((params.end - params.start) / params.step)));
gcode += pa_test.generate_test(params.start, params.step, std::llround(std::ceil((params.end - params.start) / params.step)) + 1);
file.write(gcode);
}

View File

@ -941,7 +941,7 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
if (params.mode == CalibMode::Calib_PA_Line) {
double space_y = 3.5;
int max_line_nums = int(plate_size[1] - 10) / space_y;
int count = std::llround(std::ceil((params.end - params.start) / params.step));
int count = std::llround(std::ceil((params.end - params.start) / params.step)) + 1;
if (count > max_line_nums) {
error_message = _L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small");
return;