refs #234, add methods to resolve user names from VATSIM file and display them in voice rooms

This commit is contained in:
Klaus Basan
2014-05-07 23:23:20 +02:00
parent 421d2d5411
commit cbd8f2681a
7 changed files with 123 additions and 9 deletions

View File

@@ -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
*/

View File

@@ -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

View File

@@ -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
*/

View 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);