mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refs #234, add methods to resolve user names from VATSIM file and display them in voice rooms
This commit is contained in:
@@ -47,6 +47,20 @@ namespace BlackMisc
|
||||
return this->findBy(&CAircraft::getCallsign, callsign);
|
||||
}
|
||||
|
||||
/*
|
||||
* All pilots
|
||||
*/
|
||||
CUserList CAircraftList::getPilots() const
|
||||
{
|
||||
CUserList users;
|
||||
for (auto i = this->begin(); i != this->end(); ++i)
|
||||
{
|
||||
CAircraft aircraft = *i;
|
||||
if (aircraft.getPilot().isValid()) users.push_back(aircraft.getPilot());
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
/*
|
||||
* Aircrafts within range
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define BLACKMISC_AIRCRAFTLIST_H
|
||||
|
||||
#include "avaircraft.h"
|
||||
#include "nwuserlist.h"
|
||||
#include "collection.h"
|
||||
#include "sequence.h"
|
||||
#include <QObject>
|
||||
@@ -43,6 +44,8 @@ namespace BlackMisc
|
||||
CAircraftList findByCallsign(const CCallsign &callsign) const;
|
||||
|
||||
//! All pilots (with valid data)
|
||||
BlackMisc::Network::CUserList getPilots() const;
|
||||
|
||||
/*!
|
||||
* Find 0..n stations within range of given coordinate
|
||||
* \param coordinate other position
|
||||
|
||||
@@ -79,6 +79,21 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* All pilots
|
||||
*/
|
||||
CUserList CAtcStationList::getControllers() const
|
||||
{
|
||||
CUserList users;
|
||||
for (auto i = this->begin(); i != this->end(); ++i)
|
||||
{
|
||||
CAtcStation station = *i;
|
||||
if (station.getController().isValid()) users.push_back(station.getController());
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Merge with booking
|
||||
*/
|
||||
@@ -160,7 +175,6 @@ namespace BlackMisc
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Merge with VATSIM data file
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifndef BLACKMISC_ATCSTATIONLIST_H
|
||||
#define BLACKMISC_ATCSTATIONLIST_H
|
||||
|
||||
#include "nwuserlist.h"
|
||||
#include "avatcstation.h"
|
||||
#include "collection.h"
|
||||
#include "sequence.h"
|
||||
@@ -49,6 +50,8 @@ namespace BlackMisc
|
||||
CAtcStationList findIfComUnitTunedIn25KHz(const BlackMisc::Aviation::CComSystem &comUnit) const;
|
||||
|
||||
//! All controllers (with valid data)
|
||||
BlackMisc::Network::CUserList getControllers() const;
|
||||
|
||||
//! Update distances to coordinate, usually own aircraft's position
|
||||
void calculateDistancesToPlane(const BlackMisc::Geo::CCoordinateGeodetic &position);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user