mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
* showing simulator 3 states: disconnected, connected, running * using new signal providing all 3 states
This commit is contained in:
committed by
Roland Winklmeier
parent
edea80319d
commit
016537f257
@@ -46,7 +46,7 @@ namespace BlackGui
|
|||||||
CLedWidget::LedShape shape = CLedWidget::Circle;
|
CLedWidget::LedShape shape = CLedWidget::Circle;
|
||||||
this->ui->led_DBus->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "DBus connected", "DBus disconnected", 14);
|
this->ui->led_DBus->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "DBus connected", "DBus disconnected", 14);
|
||||||
this->ui->led_Network->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Network connected", "Network disconnected", 14);
|
this->ui->led_Network->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Network connected", "Network disconnected", 14);
|
||||||
this->ui->led_Simulator->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Simulator connected", "Simulator disconnected", 14);
|
this->ui->led_Simulator->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Simulator running", "Simulator disconnected", "Simulator connected", 14);
|
||||||
|
|
||||||
shape = CLedWidget::Rounded;
|
shape = CLedWidget::Rounded;
|
||||||
this->ui->led_Ptt->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Ptt", "Silence", 18);
|
this->ui->led_Ptt->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Ptt", "Silence", 18);
|
||||||
@@ -74,7 +74,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
if (this->getIContextSimulator())
|
if (this->getIContextSimulator())
|
||||||
{
|
{
|
||||||
connect(this->getIContextSimulator(), &IContextSimulator::connectionChanged, this, &CInfoBarStatusComponent::ps_onSimulatorConnectionChanged);
|
connect(this->getIContextSimulator(), &IContextSimulator::simulatorStatusChanged, this, &CInfoBarStatusComponent::ps_onSimulatorStatusChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->getIContextNetwork())
|
if (this->getIContextNetwork())
|
||||||
@@ -96,9 +96,21 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoBarStatusComponent::ps_onSimulatorConnectionChanged(bool connected)
|
void CInfoBarStatusComponent::ps_onSimulatorStatusChanged(bool connected, bool running, bool paused)
|
||||||
{
|
{
|
||||||
this->ui->led_Simulator->setOn(connected);
|
if (connected && running)
|
||||||
|
{
|
||||||
|
this->ui->led_Simulator->setOn(true);
|
||||||
|
}
|
||||||
|
else if (connected)
|
||||||
|
{
|
||||||
|
this->ui->led_Simulator->setTriState();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->ui->led_Simulator->setOn(false);
|
||||||
|
}
|
||||||
|
Q_UNUSED(paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoBarStatusComponent::ps_onNetworkConnectionChanged(uint from, uint to, const QString &message)
|
void CInfoBarStatusComponent::ps_onNetworkConnectionChanged(uint from, uint to, const QString &message)
|
||||||
@@ -120,7 +132,7 @@ namespace BlackGui
|
|||||||
this->ui->led_Network->setOn(true);
|
this->ui->led_Network->setOn(true);
|
||||||
break;
|
break;
|
||||||
case INetwork::Connecting:
|
case INetwork::Connecting:
|
||||||
this->ui->led_Network->setTemporaryColor(CLedWidget::Yellow);
|
this->ui->led_Network->setTriStateColor(CLedWidget::Yellow);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this->ui->led_Network->setOn(false);
|
this->ui->led_Network->setOn(false);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Simulator connection has been changed
|
//! Simulator connection has been changed
|
||||||
void ps_onSimulatorConnectionChanged(bool connected);
|
void ps_onSimulatorStatusChanged(bool connected, bool running, bool paused);
|
||||||
|
|
||||||
//! Network connection has been changed
|
//! Network connection has been changed
|
||||||
void ps_onNetworkConnectionChanged(uint from, uint to, const QString &message);
|
void ps_onNetworkConnectionChanged(uint from, uint to, const QString &message);
|
||||||
|
|||||||
Reference in New Issue
Block a user