修复了车闪现的问题

This commit is contained in:
jackfiled 2022-06-28 22:42:48 +08:00
parent ccf82dd0f5
commit 2a5b4b3841
2 changed files with 6 additions and 4 deletions

View File

@ -193,11 +193,11 @@ QString BusStrategyBase::PrintState(int remaining_time) const
QString str = QString::asprintf("Time:%d\n", bus_tick); QString str = QString::asprintf("Time:%d\n", bus_tick);
str += "BUS:\n"; str += "BUS:\n";
str += QString::asprintf("position:%lf\n", bus_model->GetBusPosition(remaining_time)); str += QString::asprintf("position:%.3lf\n", bus_model->GetBusPosition(remaining_time));
str = str + "target:" + target + "\n"; str = str + "target:" + target + "\n";
str += "STATION:\n"; str += "STATION:\n";
str = str + "clockwise" + clockwise + "\n"; str = str + "clockwise:" + clockwise + "\n";
str = str + "counterclockwise" + counterclockwise + "\n"; str = str + "counterclockwise:" + counterclockwise + "\n";
return str; return str;
} }

View File

@ -162,5 +162,7 @@ void MainWindow::EndTickTimerSlot()
void MainWindow::BeginBusTimerSlot(int direction, int duration) void MainWindow::BeginBusTimerSlot(int direction, int duration)
{ {
bus_timer->start(duration); // 这里得多计上一段时间
// 执行动画需要消耗时间
bus_timer->start(duration + 20);
} }