diff --git a/src/blackgui/components/interpolationlogdisplay.cpp b/src/blackgui/components/interpolationlogdisplay.cpp index 6642a9e78..a523e67cf 100644 --- a/src/blackgui/components/interpolationlogdisplay.cpp +++ b/src/blackgui/components/interpolationlogdisplay.cpp @@ -58,6 +58,9 @@ namespace BlackGui connect(ui->pb_ShowInSimulator, &QPushButton::released, this, &CInterpolationLogDisplay::showLogInSimulator); connect(ui->pb_GetLastInterpolation, &QPushButton::released, this, &CInterpolationLogDisplay::displayLastInterpolation); connect(sGui, &CGuiApplication::aboutToShutdown, this, &CInterpolationLogDisplay::onAboutToShutdown); + + // ui->le_Foo->setVisible(false); + // ui->lbl_Foo->setVisible(false); } CInterpolationLogDisplay::~CInterpolationLogDisplay() @@ -122,6 +125,10 @@ namespace BlackGui ui->le_UpdateTimes->home(false); ui->le_UpdateCount->setText(QString::number(m_simulatorCommon->getStatisticsUpdateRuns())); ui->le_UpdateReqTime->setText(msTimeStr.arg(m_simulatorCommon->getStatisticsAircraftUpdatedRequestedDeltaMs())); + ui->le_Limited->setText(m_simulatorCommon->updateAircraftLimitationInfo()); + + ui->le_SimulatorSpecific->setText(m_simulatorCommon->getStatisticsSimulatorSpecific()); + ui->le_SimulatorSpecific->home(false); const CClient client = m_airspaceMonitor->getClientOrDefaultForCallsign(m_callsign); ui->le_GndFlag->setText(boolToYesNo(client.hasGndFlagCapability())); @@ -139,6 +146,7 @@ namespace BlackGui ui->te_LastInterpolatedSituation->setText(sLog.situationCurrent.toQString(true)); ui->te_SituationChange->setText(sLog.change.toQString(true)); ui->le_SceneryOffset->setText(sLog.change.getGuessedSceneryDeviation().valueRoundedWithUnit(CLengthUnit::ft(), 1)); + ui->le_SceneryOffsetCG->setText(sLog.change.getGuessedSceneryDeviationCG().valueRoundedWithUnit(CLengthUnit::ft(), 1)); const PartsLog pLog = m_simulatorCommon->interpolationLogger().getLastPartsLog(); ui->te_LastInterpolatedParts->setText(pLog.parts.toQString(true)); @@ -178,7 +186,10 @@ namespace BlackGui m_callsign = cs; m_simulatorCommon->setLogInterpolation(true, cs); - this->start(); + if (!this->start()) + { + this->initPartsView(); + } } void CInterpolationLogDisplay::toggleStartStop() @@ -197,22 +208,17 @@ namespace BlackGui sGui->getIContextSimulator()->parseCommandLine(cmd, this->identifier()); } - void CInterpolationLogDisplay::start() + bool CInterpolationLogDisplay::start() { - if (m_updateTimer.isActive()) { return; } + if (m_updateTimer.isActive()) { return false; } + const int interval = 1000 * ui->hs_UpdateTime->value(); m_updateTimer.start(interval); ui->pb_StartStop->setText(stopText()); ui->led_Running->setOn(true); - // it can take a while until we receive parts, so we init - QPointer myself(this); - QTimer::singleShot(250, this, [ = ] - { - if (!myself) { return; } - if (m_callsign.isEmpty()) { return; } - myself->onPartsAdded(m_callsign, CAircraftParts()); - }); + this->initPartsView(); + return true; } void CInterpolationLogDisplay::stop() @@ -302,6 +308,7 @@ namespace BlackGui ui->le_Parts->clear(); ui->le_UpdateTimes->clear(); ui->le_UpdateTimes->clear(); + ui->le_Limited->clear(); m_elvReceived = m_elvRequested = 0; } @@ -342,6 +349,18 @@ namespace BlackGui return false; } + void CInterpolationLogDisplay::initPartsView() + { + // it can take a while until we receive parts, so we init + QPointer myself(this); + QTimer::singleShot(250, this, [ = ] + { + if (!myself) { return; } + if (m_callsign.isEmpty()) { return; } + myself->onPartsAdded(m_callsign, CAircraftParts()); + }); + } + void CInterpolationLogDisplay::linkWithAirspaceMonitor() { if (!sGui || sGui->isShuttingDown() || !sGui->supportsContexts()) { return; } diff --git a/src/blackgui/components/interpolationlogdisplay.h b/src/blackgui/components/interpolationlogdisplay.h index c37c9fea1..a6e85aa6e 100644 --- a/src/blackgui/components/interpolationlogdisplay.h +++ b/src/blackgui/components/interpolationlogdisplay.h @@ -81,7 +81,7 @@ namespace BlackGui void showLogInSimulator(); //! Start displaying - void start(); + bool start(); //! Stop displaying void stop(); @@ -119,6 +119,9 @@ namespace BlackGui //! Check if can do logging, otherwise stop and display message bool checkLogPrerequisites(); + //! Init the parts view + void initPartsView(); + QScopedPointer ui; QTimer m_updateTimer; QPointer m_simulatorCommon; //!< related simulator diff --git a/src/blackgui/components/interpolationlogdisplay.ui b/src/blackgui/components/interpolationlogdisplay.ui index bec11eccd..49648ddfc 100644 --- a/src/blackgui/components/interpolationlogdisplay.ui +++ b/src/blackgui/components/interpolationlogdisplay.ui @@ -7,7 +7,7 @@ 0 0 800 - 600 + 800 @@ -27,151 +27,169 @@ 3 - + - Log. callsign + Status and callsign - + + + 2 + - 3 + 2 - 3 + 2 - 3 + 2 - 3 + 2 - - - Qt::StrongFocus - + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + Running + + + + + + + + + + Qt::Horizontal + + + + 352 + 20 + + + + + + + + Situations + + + + + + + + + + Parts + + + + + + + + + + Elevation + + + + + + + - - - true - + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + Qt::StrongFocus + + + + + + + true + + + + + + + 1 + + + 10 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 1 + + + + + + + reset stats. + + + + + + + show in sim. + + + + + + + start + + + + - - - - 1 - - - 10 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 1 - - - - - - - reset stats. - - - - - - - show in sim. - - - - - - - start - - - - - - - - - - Status - - - - 3 - - - 3 - - - 3 - - - 3 - - - - - Running - - - - - - - - - - Qt::Horizontal - - - - 352 - 20 - - - - - - - - Situations - - - - - - - - - - Parts - - - - - - - - - - Elevation - - - - - - @@ -184,35 +202,13 @@ Data flow - - - - - Inbound situations - - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - - - - + + Misc. - + 3 @@ -225,27 +221,28 @@ 3 - - - - true - - - req.time ms + + + + Simulator: - - - - true - - - time min, max, .. + + + + Not used: - + + + + Upd.#: + + + + update aircraft req.time @@ -255,7 +252,180 @@ + + + + true + + + + + + + true + + + limited? + + + + + + + true + + + elevation + + + + + + + true + + + void + + + + + + + elevation received + + + true + + + rec. + + + + + + + true + + + CG + + + + + + + CG: + + + + + + + + + + + + + + Parts: + + + + + + + Req.: + + + + + + + Rec.: + + + + + + + true + + + offset from changes + + + + + + + true + + + offset-CG + + + + + + + Off-CG: + + + + + + true + + + req.time ms + + + + + + + true + + + time min, max, .. + + + + + + + true + + + count + + + + + + + Offset: + + + + + + + Limited + + + + + + + Req. time: + + + + elevation requested @@ -268,6 +438,13 @@ + + + + Elevation: + + + @@ -285,20 +462,6 @@ - - - - CG: - - - - - - - Parts: - - - @@ -309,128 +472,69 @@ - - - - - - - - - - - true - - - CG - - - - - - - Req.: - - - - - - - elevation received - - - true - - - rec. - - - - - - - true - - - offset - - - - - - - Offset: - - - - - - - Rec.: - - - - - - - Req.time: - - - - - - - true - - - elevation - - - - - - - Elevation: - - - - - - - Upd.#: - - - - - - - true - - - count - - - - - - - Inbound parts - - + + + + + 0 + + + 0 + + + 0 + + + 0 + - - - QAbstractItemView::SingleSelection + + + Qt::Vertical - - QAbstractItemView::SelectRows - - - false - + + + Inbound situations + + + + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + + + + + + Inbound parts + + + + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + + + @@ -442,7 +546,7 @@ Interpolation - + 4 @@ -589,20 +693,24 @@ le_CG le_Parts le_GndFlag + le_SceneryOffset + le_SceneryOffsetCG + le_Void le_UpdateReqTime + le_UpdateCount le_UpdateTimes + le_Limited le_ElevationReq le_ElevationRec - le_SceneryOffset - le_UpdateCount le_Elevation + le_SimulatorSpecific tvp_AircraftSituations + tvp_AircraftParts te_LastInterpolatedSituation + te_SituationChange te_TextLog te_LastInterpolatedParts - te_SituationChange pb_GetLastInterpolation - tvp_AircraftParts