mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
refs #420, simulator status now displayed in GUI (user can see if sim is stopped / paused)
This commit is contained in:
@@ -56,14 +56,14 @@ namespace BlackGui
|
||||
bool CEnableForDockWidgetInfoArea::isParentDockWidgetFloating() const
|
||||
{
|
||||
Q_ASSERT(this->m_parentDockableInfoArea);
|
||||
if (!this->m_parentDockableInfoArea) return false;
|
||||
if (!this->m_parentDockableInfoArea) { return false; }
|
||||
return this->m_parentDockableInfoArea->isFloating();
|
||||
}
|
||||
|
||||
bool CEnableForDockWidgetInfoArea::isVisibleWidget() const
|
||||
{
|
||||
Q_ASSERT(this->m_parentDockableInfoArea);
|
||||
if (!this->m_parentDockableInfoArea) return false;
|
||||
if (!this->m_parentDockableInfoArea) { return false; }
|
||||
return this->m_parentDockableInfoArea->isVisibleWidget();
|
||||
}
|
||||
|
||||
|
||||
@@ -104,10 +104,28 @@ namespace BlackGui
|
||||
|
||||
void CInfoBarStatusComponent::ps_onSimulatorStatusChanged(int status)
|
||||
{
|
||||
if (status > 0)
|
||||
if (status > 0 && (status & ISimulator::Connected))
|
||||
{
|
||||
this->ui->led_Simulator->setOn(true);
|
||||
this->ui->led_Simulator->setOnToolTip(getIContextSimulator()->getSimulatorPluginInfo().getDescription());
|
||||
QString s(
|
||||
getIContextSimulator()->getSimulatorPluginInfo().getDescription() + ": " +
|
||||
ISimulator::statusToString(status));
|
||||
// at least connected
|
||||
if (status & ISimulator::Paused)
|
||||
{
|
||||
// in paused state
|
||||
this->ui->led_Simulator->setTriState();
|
||||
this->ui->led_Simulator->setTriStateToolTip(s);
|
||||
}
|
||||
else if (status & ISimulator::Running)
|
||||
{
|
||||
this->ui->led_Simulator->setOn(true);
|
||||
this->ui->led_Simulator->setOnToolTip(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui->led_Simulator->setTriState();
|
||||
this->ui->led_Simulator->setTriStateToolTip(s);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -383,9 +383,18 @@ namespace BlackGui
|
||||
|
||||
void CMappingComponent::updateSimulatedAircraftView()
|
||||
{
|
||||
Q_ASSERT_X(getIContextNetwork(), "updateSimulatedAircraftView", "missing network context");
|
||||
const CSimulatedAircraftList aircraft = getIContextNetwork()->getAircraftInRange();
|
||||
this->ui->tvp_SimulatedAircraft->updateContainer(aircraft);
|
||||
Q_ASSERT_X(getIContextNetwork(), Q_FUNC_INFO, "missing network context");
|
||||
Q_ASSERT_X(getIContextSimulator(), Q_FUNC_INFO, "missing simulator context");
|
||||
if (this->isVisibleWidget()) { return; }
|
||||
if (getIContextSimulator()->isConnected())
|
||||
{
|
||||
const CSimulatedAircraftList aircraft(getIContextNetwork()->getAircraftInRange());
|
||||
this->ui->tvp_SimulatedAircraft->updateContainer(aircraft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui->tvp_SimulatedAircraft->clear();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user