本文整理汇总了C++中Airport类的典型用法代码示例。如果您正苦于以下问题:C++ Airport类的具体用法?C++ Airport怎么用?C++ Airport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Airport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fabs
Route::Route( Airport from, Airport to ) {
this->from = from.getPoint();
this->from_id = from.getId();
this->to = to.getPoint();
this->to_id = to.getId();
this->complete = false;
this->parity = true;
this->current = this->from;
this->via_pacific = false;
this->lon_range = fabs( this->from.y - this->to.y );
this->sign = ( ( this->from.y - this->to.y ) > 0 ) ? -1 : 1;
this->step_lon = 1.0f;
this->lat1 = this->from.x * M_PI / 180;
this->lat2 = this->to.x * M_PI / 180;
// маршрут надо строить через тихий океан
if ( ( ( this->lon_range ) > ( 360 - this->lon_range ) ) && ( this->from.y * this->to.y < 0 ) ) {
this->via_pacific = true;
this->sign *= -1;
this->lon_range = 360 - this->lon_range;
this->lon1 = ( ( this->from.y > 0 ) ? ( -180 + this->from.y ) : ( 180 + this->from.y ) ) * M_PI / 180;
this->lon2 = ( ( this->to.y > 0 ) ? ( -180 + this->to.y ) : ( 180 + this->to.y ) ) * M_PI / 180;
this->current = Vec2f( this->from.x, this->lon1 * 180 / M_PI );
} else {
this->lon1 = this->from.y * M_PI / 180;
this->lon2 = this->to.y * M_PI / 180;
}
this->step_parity = 0;
this->max_steps = round( lon_range / step_lon );
this->steps = 0;
this->step_cycle = 0;
}
示例2: main
int main()
{
Airport test;
test.Run();
cout<<endl;
return 0;
}
示例3: printResults
void AirportLoader::printResults(std::ostream& sout)
{
Airport airport;
Runway runway;
Ils ils;
for (int i = 0; i < nql; i++) {
// print the AIRPORT record
AirportKey* apk = static_cast<AirportKey*>(ql[i]);
airport.setRecord( db->getRecord( apk->idx ) ) ;
airport.printRecord(sout);
// print the airport's RUNWAY records
for (RunwayKey* rwk = apk->runways; rwk != 0; rwk = rwk->next) {
runway.setRecord( dbGetRecord( rwk ) );
sout << "Runway: ";
runway.printRecord(sout);
// print the runway's ILS records
for (IlsKey* ilsk = rwk->ils; ilsk != 0; ilsk = ilsk->next) {
ils.setRecord( dbGetRecord( ilsk ) );
sout << "ILS: ";
ils.printRecord(sout);
}
}
}
}
示例4: disconnect
void WeatherParamSetupWidget::onAirportChanged(int index){
disconnect(planeNameComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onPlaneNameChanged(QString)));
planeNameComboBox->clear();
Airport airport = airportList[index];
QStringList planeNameList = airport.planeName().split(",", QString::SkipEmptyParts);
planeNameComboBox->addItems(planeNameList);
connect(planeNameComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onPlaneNameChanged(QString)));
this->onPlaneNameChanged(planeNameList[0]);
}
示例5: initUI
void WeatherParamSetupWidget::initUI(){
this->setWindowFlags(Qt::WindowCloseButtonHint);
this->setFixedWidth(440);
this->setFixedHeight(500);
this->setWindowIcon(QIcon(":/images/weather_setup.png"));
this->setWindowTitle("阀值设置");
//设置机场
airportComboBox = new QComboBox;
airportComboBox->addItems(apNameList);
//设置机型
planeNameComboBox = new QComboBox;
if(airportList.size() > 0){
Airport airport = airportList[airportComboBox->currentIndex()];
QStringList planeNameList = airport.planeName().split(",", QString::SkipEmptyParts);
planeNameComboBox->addItems(planeNameList);
}
//设置标签
tabWidget = new QTabWidget;
tabWidget->setContentsMargins(5, 5, 5, 5);
if(apNameList.size() > 0){
multiWeatherParamWidget = new MultiWeatherParamWidget;
multiWeatherParamWidget->onAirportChanged(apCodeList[airportComboBox->currentIndex()], planeNameComboBox->currentText());
tabWidget->addTab(multiWeatherParamWidget, "多要素");
singleWeatherParamWidget = new SingleWeatherParamWidget;
singleWeatherParamWidget->onAirportChanged(apCodeList[airportComboBox->currentIndex()], planeNameComboBox->currentText());
tabWidget->addTab(singleWeatherParamWidget, "单要素");
}
//布局
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(airportComboBox);
mainLayout->addWidget(planeNameComboBox);
mainLayout->addWidget(tabWidget);
//设置上一步下一步按钮
if(SharedMemory::isWelcome){
previousButton = new QPushButton;
previousButton->setText("上一步");
nextButton = new QPushButton;
nextButton->setText("下一步");
QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->addWidget(previousButton);
hlayout->addStretch();
hlayout->addWidget(nextButton);
mainLayout->addLayout(hlayout);
}
this->setLayout(mainLayout);
}
示例6: AtLandmarks_c
RadarScreen::RadarScreen(Landmarks *Lands_i) :
ATCScreen
(
RADAR_LEFT,
RADAR_TOP,
RADAR_LEFT + (MAX_FIELD_X * POSITION_WIDTH),
RADAR_TOP + (MAX_FIELD_Y * POSITION_HEIGHT) - 1,
ATC_TEXT_MODE,
RADAR_TEXT_COLOUR,
RADAR_BACK_COLOUR
),
AtLandmarks_c (True, 2),
Gates_c (True, 2),
FlightPaths_c (True, 2),
AirportLights_c (True, 2)
{
int BeaconIx, AirportIx, GateIx, FltPthIx;
AtLandmark *CrntAtLand;
Airport *CrntAirport;
Gate *CrntGate;
FlightPath *CrntFltPth;
for (BeaconIx = 0; BeaconIx < Lands_i->NoOfBeacons(); BeaconIx++) {
CrntAtLand = Lands_i->AllBeacons()[BeaconIx];
AtLandmarks_c.Add (CrntAtLand, CrntAtLand->GrndPos());
}
for (AirportIx = 0; AirportIx < Lands_i->NoOfAirports(); AirportIx++){
CrntAirport = Lands_i->AllAirports()[AirportIx];
AtLandmarks_c.Add (CrntAirport, CrntAirport->GrndPos());
AirportLights_c.Add (CrntAirport->GrndPos().NextMove
(CrntAirport->Dir()));
}
for (GateIx = 0; GateIx < Lands_i->NoOfGates(); GateIx++) {
CrntGate = Lands_i->AllGates()[GateIx];
Gates_c.Add (CrntGate);
}
for (FltPthIx = 0; FltPthIx < Lands_i->NoOfFlightPaths(); FltPthIx++){
CrntFltPth = Lands_i->AllFlightPaths()[FltPthIx];
FlightPaths_c.Add (CrntFltPth);
}
}
示例7: Key
//------------------------------------------------------------------------------
// AirportLoader::AirportKey
//------------------------------------------------------------------------------
AirportLoader::AirportKey::AirportKey(const long idx,
const Airport& airport) : Key(idx)
{
size = AIRPORT_RECORD_LEN;
airport.icaoCode(icao);
airport.key(key);
lat = airport.latitude();
lon = airport.longitude();
type = airport.airportType();
runways = 0;
}
示例8: initData
void WeatherParamSetupWidget::initData(){
//初始化DB
pgDb = new PgDataBase;
//机场
apCodeList.clear();
apNameList.clear();
airportList = SharedMemory::getInstance()->getAirportList();
int airportCount = airportList.size();
for(int i = 0;i < airportCount;i++){
Airport airport = airportList[i];
apCodeList.append(airport.code());
apNameList.append(airport.name());
}
}
示例9: getLeafID
bool ChartElemNavaids::addAirport(const Airport& airport,
QDomElement& element,
QDomDocument& dom_doc,
QString& err_msg)
{
QString leaf_id = getLeafID(airport);
// check for double entries
if (containsLeaf(leaf_id))
{
err_msg = QString("Double Aiport entry detected: (%1)").arg(airport.getId());
return false;
}
// process the AIRPORT
ChartElemAirport* chart_elem_airport = new ChartElemAirport(this, m_chart_model, airport);
MYASSERT(chart_elem_airport);
if (!chart_elem_airport->loadFromDomElement(element, dom_doc, err_msg))
{
delete chart_elem_airport;
return false;
}
addLeaf(leaf_id, chart_elem_airport);
return true;
}
示例10: CrntColumn_c
ATCInput::ATCInput (Traffic *Traff_i, Landmarks *Lmarks_i) :
//Screen initialisations
ATCScreen
(
1,
46,
60,
50,
ATC_TEXT_MODE,
BLACK,
WHITE
),
CrntColumn_c (1),
Traff_c (Traff_i),
Gates_c (True),
Airports_c (True),
Beacons_c (True),
NextProcess_c (&GetPlane),
IsCmndToCollect_c (False),
LastCmnd_c (NULL)
{
int GateIx, AirportIx, BeaconIx;
Gate *CrntGate;
Airport *CrntAirport;
Beacon *CrntBeacon;
for (GateIx = 0; GateIx < Lmarks_i->NoOfGates(); GateIx++) {
CrntGate = Lmarks_i->AllGates() [GateIx];
Gates_c.Add (CrntGate, CrntGate->ID());
}
for (AirportIx = 0; AirportIx < Lmarks_i->NoOfAirports(); AirportIx++) {
CrntAirport = Lmarks_i->AllAirports() [AirportIx];
Airports_c.Add (CrntAirport, CrntAirport->ID());
}
for (BeaconIx = 0; BeaconIx < Lmarks_i->NoOfBeacons(); BeaconIx++) {
CrntBeacon = Lmarks_i->AllBeacons() [BeaconIx];
Beacons_c.Add (CrntBeacon, CrntBeacon->ID());
}
}
示例11: Airport
vector<Airport> LoadData::loadAirports(string nameFile) {
// (1) fetch the waypoint vector of lines
vector<vector<string> > airport = LoadData::loadFile(nameFile);
// (2) add to the vector
airports.clear();
for (int unsigned i = 0; i < airport.size(); i++) {
Airport *p;
p = new Airport();
try {
p->setByStrings(airport[i]);
} catch (InvalidStringsSizeException &a) {
cout << nameFile << ", line " << i + 1 << ": invalid airport!";
}
LoadData::airports.push_back(*p);
}
return airports;
}
示例12: Traff_c
CmndInput::CmndInput
(
Landmarks *Lmarks_i,
Traffic *Traff_i
) :
Traff_c (Traff_i),
IsCmndToCollect_c (False),
LastCmnd_c (NULL)
{
int GateIx, AirportIx, BeaconIx;
Gate *CrntGate;
Airport *CrntAirport;
Beacon *CrntBeacon;
Out_c.Refresh();
for (GateIx = 0; GateIx < Lmarks_i->NoOfGates(); GateIx++) {
CrntGate = Lmarks_i->AllGates() [GateIx];
Landmarks_c.Gates.Add (CrntGate, CrntGate->ID());
}
for (AirportIx = 0; AirportIx < Lmarks_i->NoOfAirports(); AirportIx++) {
CrntAirport = Lmarks_i->AllAirports() [AirportIx];
Landmarks_c.Airports.Add (CrntAirport, CrntAirport->ID());
}
for (BeaconIx = 0; BeaconIx < Lmarks_i->NoOfBeacons(); BeaconIx++) {
CrntBeacon = Lmarks_i->AllBeacons() [BeaconIx];
Landmarks_c.Beacons.Add (CrntBeacon, CrntBeacon->ID());
}
SetForNewCmnd();
}
示例13: strcpy
void Airport::findRoute(const List <Airport> &cities, List <Flight> &route,
const char *airline, const char *destination,
bool *found) const
{
int index;
Flight flight;
if (strcmp(airport, destination) == 0)
{
strcpy(flight.airline, airline);
strcpy(flight.destination, destination);
route += flight;
*found = true;
} // if reach destination
else // haven't reached destination yet
{
for (int i = 0; i < flights.getCount(); i++)
{
if (strcmp(flights[i].airline, airline) == 0)
{
Airport city;
city.setAirport(flights[i].destination);
for (index = 0; index < cities.getCount(); index++)
if (cities[index] == city)
break;
cities[index].findRoute(cities, route, airline, destination, found);
if (*found)
{
strcpy(flight.destination, airport);
strcpy(flight.airline, airline);
route += flight;
} // if found destination
} // if found match of airline
} // for each flight from the airport
} // else haven't reached destination yet
} // findRoute())
示例14: normalize
Airport normalize(Airport a){
double q = 3.0;
Airport normalized = Airport(a.getID(), (a.getX()-avgX)/q, (a.getY()-avgY)/q, a.getZ(), a.getName());
normalized.setDegree(a.getDegree());
return normalized;
}
示例15: fly
void ModelA::fly(const Airport &destination)//子类必须实现父类的pure virtual函数.
{
cout<<"ModelA::fly to"<<destination.getPortName()<<endl;
}