当前位置: 首页>>代码示例>>C++>>正文


C++ Airport类代码示例

本文整理汇总了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;
}
开发者ID:icanhazbroccoli,项目名称:mercator_routes,代码行数:35,代码来源:Route.cpp

示例2: main

int main()
{
	Airport test;
	test.Run();
	cout<<endl;
	return 0;
}
开发者ID:3588,项目名称:au-cs230,代码行数:7,代码来源:8.cpp

示例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);
         }

      }

   }
}
开发者ID:AFIT-Hodson,项目名称:OpenEaagles,代码行数:30,代码来源:AirportLoader.cpp

示例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]);
}
开发者ID:skypanda100,项目名称:airportevaluation,代码行数:9,代码来源:weatherparamsetupwidget.cpp

示例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);
}
开发者ID:skypanda100,项目名称:airportevaluation,代码行数:53,代码来源:weatherparamsetupwidget.cpp

示例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);
		}

	}
开发者ID:paulanthonywilson,项目名称:airtrafficcontrol,代码行数:53,代码来源:RADARSCR.CPP

示例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;
}
开发者ID:AFIT-Hodson,项目名称:OpenEaagles,代码行数:16,代码来源:AirportLoader.cpp

示例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());
    }
}
开发者ID:skypanda100,项目名称:airportevaluation,代码行数:14,代码来源:weatherparamsetupwidget.cpp

示例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;
}
开发者ID:Rodeo314,项目名称:vasFMC-Krolock85,代码行数:28,代码来源:chart.elem.navaids.cpp

示例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());
		}
	}
开发者ID:paulanthonywilson,项目名称:airtrafficcontrol,代码行数:47,代码来源:IN1.CPP

示例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;
}
开发者ID:andrefreitas,项目名称:feup-cal-flightadvisor,代码行数:18,代码来源:LoadData.cpp

示例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();

	}
开发者ID:paulanthonywilson,项目名称:airtrafficcontrol,代码行数:39,代码来源:CMNDINPU.CPP

示例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())
开发者ID:sdzharkov,项目名称:ECS40,代码行数:39,代码来源:airport.cpp

示例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;
}
开发者ID:volnyja1,项目名称:FDEB,代码行数:6,代码来源:airports.cpp

示例15: fly

void ModelA::fly(const Airport &destination)//子类必须实现父类的pure virtual函数.
{
	cout<<"ModelA::fly to"<<destination.getPortName()<<endl;
}
开发者ID:kungeplay,项目名称:C_Practice,代码行数:4,代码来源:Interface_Implementation.cpp


注:本文中的Airport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。