mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +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
|
bool CEnableForDockWidgetInfoArea::isParentDockWidgetFloating() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_parentDockableInfoArea);
|
Q_ASSERT(this->m_parentDockableInfoArea);
|
||||||
if (!this->m_parentDockableInfoArea) return false;
|
if (!this->m_parentDockableInfoArea) { return false; }
|
||||||
return this->m_parentDockableInfoArea->isFloating();
|
return this->m_parentDockableInfoArea->isFloating();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CEnableForDockWidgetInfoArea::isVisibleWidget() const
|
bool CEnableForDockWidgetInfoArea::isVisibleWidget() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_parentDockableInfoArea);
|
Q_ASSERT(this->m_parentDockableInfoArea);
|
||||||
if (!this->m_parentDockableInfoArea) return false;
|
if (!this->m_parentDockableInfoArea) { return false; }
|
||||||
return this->m_parentDockableInfoArea->isVisibleWidget();
|
return this->m_parentDockableInfoArea->isVisibleWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,10 +104,28 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CInfoBarStatusComponent::ps_onSimulatorStatusChanged(int status)
|
void CInfoBarStatusComponent::ps_onSimulatorStatusChanged(int status)
|
||||||
{
|
{
|
||||||
if (status > 0)
|
if (status > 0 && (status & ISimulator::Connected))
|
||||||
{
|
{
|
||||||
this->ui->led_Simulator->setOn(true);
|
QString s(
|
||||||
this->ui->led_Simulator->setOnToolTip(getIContextSimulator()->getSimulatorPluginInfo().getDescription());
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -383,9 +383,18 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CMappingComponent::updateSimulatedAircraftView()
|
void CMappingComponent::updateSimulatedAircraftView()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(getIContextNetwork(), "updateSimulatedAircraftView", "missing network context");
|
Q_ASSERT_X(getIContextNetwork(), Q_FUNC_INFO, "missing network context");
|
||||||
const CSimulatedAircraftList aircraft = getIContextNetwork()->getAircraftInRange();
|
Q_ASSERT_X(getIContextSimulator(), Q_FUNC_INFO, "missing simulator context");
|
||||||
this->ui->tvp_SimulatedAircraft->updateContainer(aircraft);
|
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
|
} // namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user