From 2a5b4b384100c9305a87c1f30786aa0f4690ff1f Mon Sep 17 00:00:00 2001 From: jackfiled Date: Tue, 28 Jun 2022 22:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=BD=A6=E9=97=AA?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BusStrategyBase.cpp | 6 +++--- src/mainwindow.cpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/BusStrategyBase.cpp b/src/BusStrategyBase.cpp index e6c4241..dd9d9ef 100644 --- a/src/BusStrategyBase.cpp +++ b/src/BusStrategyBase.cpp @@ -193,11 +193,11 @@ QString BusStrategyBase::PrintState(int remaining_time) const QString str = QString::asprintf("Time:%d\n", bus_tick); 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 += "STATION:\n"; - str = str + "clockwise" + clockwise + "\n"; - str = str + "counterclockwise" + counterclockwise + "\n"; + str = str + "clockwise:" + clockwise + "\n"; + str = str + "counterclockwise:" + counterclockwise + "\n"; return str; } \ No newline at end of file diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 91dc6fa..708e2fe 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -162,5 +162,7 @@ void MainWindow::EndTickTimerSlot() void MainWindow::BeginBusTimerSlot(int direction, int duration) { - bus_timer->start(duration); + // 这里得多计上一段时间 + // 执行动画需要消耗时间 + bus_timer->start(duration + 20); } \ No newline at end of file