mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Ref T778, allow to re-calculate all aircraft from the log.display
This commit is contained in:
committed by
Mat Sutcliffe
parent
373e45e958
commit
09a2377197
@@ -83,6 +83,7 @@ namespace BlackGui
|
||||
connect(ui->pb_GetLastInterpolation, &QPushButton::released, this, &CInterpolationLogDisplay::getLogAmdDisplayLastInterpolation);
|
||||
connect(ui->pb_InjectElevation, &QPushButton::released, this, &CInterpolationLogDisplay::onInjectElevation);
|
||||
connect(ui->pb_ElvClear, &QPushButton::released, this, &CInterpolationLogDisplay::clearElevationResults);
|
||||
connect(ui->pb_RecalcAllAircraft, &QPushButton::released, this, &CInterpolationLogDisplay::requestRecalculateAll);
|
||||
connect(ui->pb_ClearLog, &QPushButton::released, this, &CInterpolationLogDisplay::clearLogCommand);
|
||||
connect(ui->pb_ClearLog2, &QPushButton::released, this, &CInterpolationLogDisplay::clearLogCommand);
|
||||
connect(ui->pb_WriteLogToFile, &QPushButton::released, this, &CInterpolationLogDisplay::writeLogCommand);
|
||||
@@ -184,7 +185,7 @@ namespace BlackGui
|
||||
|
||||
void CInterpolationLogDisplay::getLogAmdDisplayLastInterpolation()
|
||||
{
|
||||
if (!m_simulator) { return; }
|
||||
if (!this->canLog()) { return; }
|
||||
const SituationLog sLog = m_simulator->interpolationLogger().getLastSituationLog();
|
||||
this->displayLastInterpolation(sLog);
|
||||
}
|
||||
@@ -218,7 +219,7 @@ namespace BlackGui
|
||||
|
||||
void CInterpolationLogDisplay::onCallsignEntered()
|
||||
{
|
||||
if (!m_simulator)
|
||||
if (!this->canLog())
|
||||
{
|
||||
this->stop();
|
||||
CLogMessage(this).warning(u"Stopping logging (log.display), no simulator");
|
||||
@@ -256,7 +257,7 @@ namespace BlackGui
|
||||
|
||||
void CInterpolationLogDisplay::onPseudoElevationToggled(bool checked)
|
||||
{
|
||||
if (!m_simulator) { return; }
|
||||
if (!this->canLog()) { return; }
|
||||
m_simulator->setTestEnablePseudoElevation(checked);
|
||||
|
||||
CAltitude elvTest = CAltitude::null();
|
||||
@@ -291,7 +292,7 @@ namespace BlackGui
|
||||
void CInterpolationLogDisplay::followInSimulator()
|
||||
{
|
||||
if (m_callsign.isEmpty()) { return; }
|
||||
if (!m_simulator) { return; }
|
||||
if (!this->canLog()) { return; }
|
||||
m_simulator->followAircraft(m_callsign);
|
||||
}
|
||||
|
||||
@@ -416,7 +417,7 @@ namespace BlackGui
|
||||
|
||||
void CInterpolationLogDisplay::onInjectElevation()
|
||||
{
|
||||
if (!m_simulator) { return; }
|
||||
if (!this->canLog()) { return; }
|
||||
const QString elv = ui->le_InjectElevation->text().trimmed();
|
||||
if (elv.isEmpty()) { return; }
|
||||
|
||||
@@ -584,13 +585,13 @@ namespace BlackGui
|
||||
|
||||
void CInterpolationLogDisplay::requestElevation(const CAircraftSituation &situation)
|
||||
{
|
||||
if (!m_simulator) { return; }
|
||||
if (!this->canLog()) { return; }
|
||||
m_simulator->requestElevationBySituation(situation);
|
||||
}
|
||||
|
||||
void CInterpolationLogDisplay::requestElevationAtPosition()
|
||||
{
|
||||
if (!m_simulator) { return; }
|
||||
if (!this->canLog()) { return; }
|
||||
const CCoordinateGeodetic coordinate = ui->editor_ElevationCoordinate->getCoordinate();
|
||||
const bool ok = m_simulator->requestElevation(coordinate, CInterpolationLogDisplay::pseudoCallsignElevation());
|
||||
if (ok)
|
||||
@@ -605,6 +606,17 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CInterpolationLogDisplay::requestRecalculateAll()
|
||||
{
|
||||
if (!this->canLog()) { return; }
|
||||
sApp->getIContextSimulator()->recalculateAllAircraft();
|
||||
}
|
||||
|
||||
bool CInterpolationLogDisplay::canLog() const
|
||||
{
|
||||
return (sApp && !sApp->isShuttingDown() && sApp->getIContextSimulator() && m_simulator);
|
||||
}
|
||||
|
||||
const CCallsign &CInterpolationLogDisplay::pseudoCallsignElevation()
|
||||
{
|
||||
static const CCallsign cs("SW1LOX");
|
||||
|
||||
@@ -177,6 +177,12 @@ namespace BlackGui
|
||||
//! Request arbitrary elevation
|
||||
void requestElevationAtPosition();
|
||||
|
||||
//! Do a full interpolation cycle for a while
|
||||
void requestRecalculateAll();
|
||||
|
||||
//! Can use the log. display?
|
||||
bool canLog() const;
|
||||
|
||||
//! Pseudo callsign for CInterpolationLogDisplay::requestElevationAtPosition
|
||||
static const BlackMisc::Aviation::CCallsign &pseudoCallsignElevation();
|
||||
|
||||
|
||||
@@ -351,16 +351,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="11">
|
||||
<widget class="QLineEdit" name="le_SimulatorSpecific">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>simulator specific information</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_CG">
|
||||
<property name="toolTip">
|
||||
@@ -523,6 +513,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="10">
|
||||
<widget class="QLineEdit" name="le_SimulatorSpecific">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>simulator specific information</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="11">
|
||||
<widget class="QPushButton" name="pb_RecalcAllAircraft">
|
||||
<property name="text">
|
||||
<string>re-calc</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user