示例#1
0
//------------------------------------------------------------------------------
// queryIlsByChannel() -- find all ILS records in search area by channel
//------------------------------------------------------------------------------
int AirportLoader::queryIlsByChannel(const int chan)
{
   // find all the airports within the search area
   int oql = getQueryLimit();
   setQueryLimit(nrl);
   queryAirport(Airport::ANY,0.0f);
   setQueryLimit(oql);

   // select the ILS components from these airports with the correct channel#
   if (nql > 0) {
      makeSimpleLinkedList();
      nql = 0;
      for (AirportKey* apk = firstAirport; apk != 0; apk = apk->next) {
         for (RunwayKey* rwk = apk->runways; rwk != 0; rwk = rwk->next) {
            for (IlsKey* ilsk = rwk->ils; ilsk != 0; ilsk = ilsk->next) {
               if (ilsk->chan == chan) {
                  ql[nql++] = ilsk;
                  if (ilsk->type == Ils::LOCALIZER) {
                     findGlideSlope(rwk,ilsk);
                  }
               }
            }
         }
      }
   }

   // limit number of result records
   if (qlimit > 0 && nql > qlimit) nql = qlimit;

   return nql;
}
示例#2
0
//------------------------------------------------------------------------------
// queryRunwayByLength() -- find runway records by min length
//------------------------------------------------------------------------------
int AirportLoader::queryRunwayByLength(const float minRwLen)
{
   int oql = getQueryLimit();
   setQueryLimit(nrl);
   queryAirport(Airport::ANY,minRwLen);
   setQueryLimit(oql);

   // select the ILS components from these airports with the correct frequency.
   if (nql > 0) {
      makeSimpleLinkedList();
      nql = 0;
      for (AirportKey* apk = firstAirport; apk != 0; apk = apk->next) {
         for (RunwayKey* rwk = apk->runways; rwk != 0; rwk = rwk->next) {
            if (rwk->rwlen >= minRwLen) {
               ql[nql++] = rwk;
            }
         }
      }
   }

   // limit number of result records
   if (qlimit > 0 && nql > qlimit) nql = qlimit;

   return nql;
}
示例#3
0
//------------------------------------------------------------------------------
// queryIlsByType() -- find ILS records in search area by type
//------------------------------------------------------------------------------
int AirportLoader::queryIlsByType(const Ils::IlsType type)
{
   // find all the airports within the search area
   int oql = getQueryLimit();
   setQueryLimit(nrl);
   queryAirport(Airport::ANY,0.0f);
   setQueryLimit(oql);

   // select our requested 'type' ILS components from these airports
   if (nql > 0) {
      makeSimpleLinkedList();
      nql = 0;
      for (AirportKey* apk = firstAirport; apk != 0; apk = apk->next) {
         for (RunwayKey* rwk = apk->runways; rwk != 0; rwk = rwk->next) {
            for (IlsKey* ilsk = rwk->ils; ilsk != 0; ilsk = ilsk->next) {
               if (ilsk->type == type || type == Ils::ANY) {
                  ql[nql++] = ilsk;
               }
            }
         }
      }
   }

   // limit number of result records
   if (qlimit > 0 && nql > qlimit) nql = qlimit;

   return nql;
}
示例#4
0
void MainWindow::toTextEdited(const QString& txt)
{
    ui->acTolistWidget->clear();

    CBN1qlResult result = queryAirport(txt);
    for (QList<QJsonObject>::const_iterator it = result.items.cbegin(); it != result.items.cend(); ++it)
    {
        QString name = (*it)["airportname"].toString();
        ui->acTolistWidget->addItem(name);
    }
}
void FmgInputWidget::initUI(){
    //机场(机场和跑道)
    queryAirport();
    airportComboBox = new QComboBox;
    runwayComboBox = new QComboBox;

    QHBoxLayout *airportLayout = new QHBoxLayout;
    airportLayout->addWidget(airportComboBox, 1);
    airportLayout->addWidget(runwayComboBox);

    QGroupBox *airportGroup = new QGroupBox;
    airportGroup->setTitle("机场");
    airportGroup->setLayout(airportLayout);

    //风速
    fspeedEdit = new QLineEdit;
    fspeedEdit->setFixedWidth(70);
    fspeedEdit->setValidator(new QIntValidator(0, 1000, this));
    QLabel *speedLabel = new QLabel;
    speedLabel->setText(" ~ ");
    tspeedEdit = new QLineEdit;
    tspeedEdit->setFixedWidth(70);
    tspeedEdit->setValidator(new QIntValidator(0, 1000, this));

    QHBoxLayout *speedLayout = new QHBoxLayout;
    speedLayout->addWidget(fspeedEdit);
    speedLayout->addStretch(1);
    speedLayout->addWidget(speedLabel);
    speedLayout->addStretch(1);
    speedLayout->addWidget(tspeedEdit);

    QGroupBox *speedGroup = new QGroupBox;
    speedGroup->setTitle("风速");
    speedGroup->setLayout(speedLayout);


    dateLayout = new QGridLayout;

    QGroupBox *dateGroup = new QGroupBox;
    dateGroup->setTitle("日期");
    dateGroup->setLayout(dateLayout);

    //按钮
    executeButton = new QPushButton;
    executeButton->setText("开始");

    exportButton = new QPushButton;
    exportButton->setText("导出");

    QHBoxLayout *executeLayout = new QHBoxLayout;
    executeLayout->addWidget(executeButton);
    executeLayout->addWidget(exportButton);

    //主界面
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(airportGroup);
    mainLayout->addWidget(speedGroup);
    mainLayout->addWidget(dateGroup);
    mainLayout->addLayout(executeLayout);
    mainLayout->addStretch(1);
    this->setLayout(mainLayout);

    //最后执行
    resetAirportComboBox(this->airportList, this->runwayHash, false);
}
示例#6
0
//------------------------------------------------------------------------------
// queryByType() -- find all 'type' airports within search area.
//------------------------------------------------------------------------------
int AirportLoader::queryByType(const Airport::AirportType type)
{
   return queryAirport(type,0.0f);
}
示例#7
0
//------------------------------------------------------------------------------
// queryByLength() -- find all airports within search area with minimum
// runway length.
//------------------------------------------------------------------------------
int AirportLoader::queryByLength(const float minRwLen)
{
   return queryAirport(Airport::ANY,minRwLen);
}
示例#8
0
//------------------------------------------------------------------------------
// queryByRange() -- find all airports within search area.
//------------------------------------------------------------------------------
int AirportLoader::queryByRange()
{
   return queryAirport(Airport::ANY,0.0f);
}