mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Allow to select COM frequencies from ATC view (context menu)
* added functions in component to select COM frequencies * changed views to contain ObjectType in template * function to obtain selected objects in view base class
This commit is contained in:
@@ -14,12 +14,14 @@
|
||||
#include "blackmisc/avinformationmessage.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackcore/context_network.h"
|
||||
#include "blackcore/context_ownaircraft.h"
|
||||
|
||||
using namespace BlackGui;
|
||||
using namespace BlackGui::Models;
|
||||
using namespace BlackGui::Views;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackCore;
|
||||
|
||||
namespace BlackGui
|
||||
@@ -57,6 +59,7 @@ namespace BlackGui
|
||||
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_requestOnlineStationsUpdate);
|
||||
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::countChanged, this, &CAtcStationComponent::ps_countChanged);
|
||||
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::countChanged, this, &CAtcStationComponent::ps_countChanged);
|
||||
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestComFrequency, this, &CAtcStationComponent::ps_setComFrequency);
|
||||
|
||||
connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_reloadAtcStationsBooked);
|
||||
connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::countChanged, this, &CAtcStationComponent::ps_countChanged);
|
||||
@@ -241,6 +244,13 @@ namespace BlackGui
|
||||
this->tabBar()->setTabText(ib, b);
|
||||
}
|
||||
|
||||
void CAtcStationComponent::ps_setComFrequency(const PhysicalQuantities::CFrequency &frequency, CComSystem::ComUnit unit)
|
||||
{
|
||||
if (unit != CComSystem::Com1 && unit != CComSystem::Com2) { return; }
|
||||
if (!CComSystem::isValidComFrequency(frequency)) { return; }
|
||||
this->getIContextOwnAircraft()->updateComFrequency(frequency, static_cast<int>(unit), originator());
|
||||
}
|
||||
|
||||
void CAtcStationComponent::ps_onlineAtcStationSelected(QModelIndex index)
|
||||
{
|
||||
this->ui->te_AtcStationsOnlineInfo->setText(""); // reset
|
||||
|
||||
Reference in New Issue
Block a user