From 9a114c903c9a165123db36866bd26240033036f0 Mon Sep 17 00:00:00 2001 From: "David S. Beach" Date: Mon, 14 Dec 2015 11:53:04 -0500 Subject: [PATCH] Changes to send ASpd as knots --- companion/src/simulation/telemetrysimu.cpp | 6 +++++- companion/src/simulation/telemetrysimu.h | 1 + companion/src/simulation/telemetrysimu.ui | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/companion/src/simulation/telemetrysimu.cpp b/companion/src/simulation/telemetrysimu.cpp index bea1c64d8..4bdd493ba 100644 --- a/companion/src/simulation/telemetrysimu.cpp +++ b/companion/src/simulation/telemetrysimu.cpp @@ -314,7 +314,7 @@ void TelemetrySimulator::generateTelemetryFrame() case 17: if (ui->aspeed->value() > 0) - generateSportPacket(buffer, ui->aspd_inst->text().toInt(&ok, 0) - 1, DATA_FRAME, AIR_SPEED_FIRST_ID, LIMIT(0, ui->aspeed->value() * 10.0, 0xFFFFFFFF)); + generateSportPacket(buffer, ui->aspd_inst->text().toInt(&ok, 0) - 1, DATA_FRAME, AIR_SPEED_FIRST_ID, LIMIT(0, ui->aspeed->value() * 5.39957, 0xFFFFFFFF)); break; case 18: @@ -587,6 +587,7 @@ TelemetrySimulator::LogPlaybackController::LogPlaybackController(Ui::TelemetrySi colToFuncMap.insert("VFAS(V)", FASV); colToFuncMap.insert("Curr(A)", FASC); colToFuncMap.insert("Cels(gRe)", CELS_GRE); + colToFuncMap.insert("ASpd(kts)", ASPD_KTS); colToFuncMap.insert("ASpd(kmh)", ASPD_KMH); colToFuncMap.insert("ASpd(mph)", ASPD_MPH); colToFuncMap.insert("GAlt(ft)", GALT_FEET); @@ -894,6 +895,9 @@ void TelemetrySimulator::LogPlaybackController::setUiDataValues() case CELS_GRE: ui->cell1->setValue(columnData[info.dataIndex].toDouble()); break; + case ASPD_KTS: + ui->aspeed->setValue(columnData[info.dataIndex].toDouble() * 1.8520008892119); + break; case ASPD_KMH: ui->aspeed->setValue(columnData[info.dataIndex].toDouble()); break; diff --git a/companion/src/simulation/telemetrysimu.h b/companion/src/simulation/telemetrysimu.h index 96191d050..9582e3d32 100644 --- a/companion/src/simulation/telemetrysimu.h +++ b/companion/src/simulation/telemetrysimu.h @@ -66,6 +66,7 @@ class TelemetrySimulator : public QDialog FASV, FASC, CELS_GRE, + ASPD_KTS, ASPD_KMH, ASPD_MPH, GALT_FEET, diff --git a/companion/src/simulation/telemetrysimu.ui b/companion/src/simulation/telemetrysimu.ui index b2cf2264c..5317f2b97 100644 --- a/companion/src/simulation/telemetrysimu.ui +++ b/companion/src/simulation/telemetrysimu.ui @@ -940,7 +940,7 @@ Timestamp - knots + km/h