mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
COM audio did not tune in (voice room) if channel was already selected at startup
Reason was: hardcoded channel spacing to 8.33kHz As a result changed to channel spacing based on COM unit, which could also be changed at runtime * the issue itself was in own aircraft context * added functions for channel spacing * changed to COM unit channel spacing (instead of hardcoded spacing)
This commit is contained in:
@@ -58,8 +58,7 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
|
||||
// init from aircraft
|
||||
const CSimulatedAircraft ownAircraft = this->getOwnAircraft();
|
||||
this->updateCockpitFromContext(ownAircraft, CIdentifier("dummyInitialValues")); // intentionally different name here
|
||||
this->forceCockpitUpdateFromOwnAircraftContext();
|
||||
|
||||
// COM form
|
||||
connect(ui->editor_Com, &CCockpitComForm::testSelcal, this, &CCockpitComComponent::testSelcal);
|
||||
@@ -75,11 +74,15 @@ namespace BlackGui
|
||||
// hook up with changes from own aircraft context
|
||||
if (sGui)
|
||||
{
|
||||
// own aircraft
|
||||
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);
|
||||
|
||||
// network
|
||||
connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationsOnlineDigest, this, &CCockpitComComponent::onAtcStationsChanged, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +174,18 @@ namespace BlackGui
|
||||
ui->editor_Com->setVoiceRoomStatus(selectedVoiceRooms);
|
||||
}
|
||||
|
||||
void CCockpitComComponent::forceCockpitUpdateFromOwnAircraftContext()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
const CSimulatedAircraft ownAircraft = this->getOwnAircraft();
|
||||
this->updateCockpitFromContext(ownAircraft, CIdentifier("dummyInitialValues")); // intentionally different name here
|
||||
}
|
||||
|
||||
void CCockpitComComponent::onAtcStationsChanged()
|
||||
{
|
||||
// void
|
||||
}
|
||||
|
||||
void CCockpitComComponent::updateSelcalInContext(const CSelcal &selcal)
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return; }
|
||||
|
||||
Reference in New Issue
Block a user