Ref T609, tristate LED showing if synced with simulator com

This commit is contained in:
Klaus Basan
2019-04-20 01:03:53 +02:00
parent 90373c3a34
commit 2d654e2fef
7 changed files with 51 additions and 13 deletions

View File

@@ -8,6 +8,7 @@
#include "blackcore/context/contextaudio.h"
#include "blackcore/context/contextnetwork.h"
#include "blackcore/context/contextsimulator.h"
#include "blackcore/context/contextownaircraft.h"
#include "blackgui/components/cockpitcomcomponent.h"
#include "blackgui/components/selcalcodeselector.h"
@@ -72,11 +73,14 @@ namespace BlackGui
connect(ui->editor_Com, &CCockpitComForm::transponderStateIdentEnded, this, &CCockpitComComponent::transponderStateIdentEnded);
// hook up with changes from own aircraft context
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CCockpitComComponent::updateCockpitFromContext, Qt::QueuedConnection);
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedSelcal, this, &CCockpitComComponent::updateSelcalFromContext, Qt::QueuedConnection);
if (sGui)
{
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CCockpitComComponent::updateCockpitFromContext, Qt::QueuedConnection);
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedSelcal, this, &CCockpitComComponent::updateSelcalFromContext, Qt::QueuedConnection);
// hook up with audio context
connect(sGui->getIContextAudio(), &IContextAudio::changedVoiceRooms, this, &CCockpitComComponent::updateVoiceRoomStatusFromContext, Qt::QueuedConnection);
// hook up with audio context
connect(sGui->getIContextAudio(), &IContextAudio::changedVoiceRooms, this, &CCockpitComComponent::updateVoiceRoomStatusFromContext, Qt::QueuedConnection);
}
}
CCockpitComComponent::~CCockpitComComponent()
@@ -110,10 +114,13 @@ namespace BlackGui
ui->editor_Com->setTransponder(transponder);
// selected stations
if (sGui && sGui->getIContextNetwork())
if (sGui)
{
const CAtcStationList selectedStations = sGui->getIContextNetwork()->getSelectedAtcStations();
ui->editor_Com->setSelectedAtcStations(selectedStations);
if (sGui->getIContextNetwork())
{
const CAtcStationList selectedStations = sGui->getIContextNetwork()->getSelectedAtcStations();
ui->editor_Com->setSelectedAtcStations(selectedStations);
}
}
}