mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
FP style
This commit is contained in:
committed by
Mat Sutcliffe
parent
0e03e7baf0
commit
e31fa91052
@@ -661,23 +661,23 @@ namespace BlackCore
|
||||
// const QString alt = flightPlan.getCruiseAltitude().asFpAltitudeString();
|
||||
|
||||
QByteArray acTypeTemp, altAptTemp, cruiseAltTemp, depAptTemp, destAptTemp, routeTemp, remarksTemp;
|
||||
vatlibFP.aircraftType = acTypeTemp = toFSDnoColon(flightPlan.getCombinedPrefixIcaoSuffix());
|
||||
vatlibFP.alternateAirport = altAptTemp = toFSDnoColon(flightPlan.getAlternateAirportIcao().asString());
|
||||
vatlibFP.cruiseAltitude = cruiseAltTemp = toFSDnoColon(alt);
|
||||
vatlibFP.departAirport = depAptTemp = toFSDnoColon(flightPlan.getOriginAirportIcao().asString());
|
||||
vatlibFP.aircraftType = acTypeTemp = toFSDnoColon(flightPlan.getCombinedPrefixIcaoSuffix());
|
||||
vatlibFP.alternateAirport = altAptTemp = toFSDnoColon(flightPlan.getAlternateAirportIcao().asString());
|
||||
vatlibFP.cruiseAltitude = cruiseAltTemp = toFSDnoColon(alt);
|
||||
vatlibFP.departAirport = depAptTemp = toFSDnoColon(flightPlan.getOriginAirportIcao().asString());
|
||||
vatlibFP.destAirport = destAptTemp = toFSDnoColon(flightPlan.getDestinationAirportIcao().asString());
|
||||
vatlibFP.departTimeActual = flightPlan.getTakeoffTimeActual().toUTC().toString("hhmm").toInt();
|
||||
vatlibFP.departTime = flightPlan.getTakeoffTimePlanned().toUTC().toString("hhmm").toInt();
|
||||
vatlibFP.destAirport = destAptTemp = toFSDnoColon(flightPlan.getDestinationAirportIcao().asString());
|
||||
vatlibFP.departTime = flightPlan.getTakeoffTimePlanned().toUTC().toString("hhmm").toInt();
|
||||
|
||||
QList<int> timeParts = flightPlan.getEnrouteTime().getHrsMinSecParts();
|
||||
vatlibFP.enrouteHrs = timeParts[CTime::Hours];
|
||||
vatlibFP.enrouteHrs = timeParts[CTime::Hours];
|
||||
vatlibFP.enrouteMins = timeParts[CTime::Minutes];
|
||||
|
||||
timeParts = flightPlan.getFuelTime().getHrsMinSecParts();
|
||||
vatlibFP.fuelHrs = timeParts[CTime::Hours];
|
||||
vatlibFP.fuelHrs = timeParts[CTime::Hours];
|
||||
vatlibFP.fuelMins = timeParts[CTime::Minutes];
|
||||
vatlibFP.remarks = remarksTemp = toFSDnoColon(remarks);
|
||||
vatlibFP.route = routeTemp = toFSDnoColon(route);
|
||||
vatlibFP.remarks = remarksTemp = toFSDnoColon(remarks);
|
||||
vatlibFP.route = routeTemp = toFSDnoColon(route);
|
||||
vatlibFP.trueCruisingSpeed = flightPlan.getCruiseTrueAirspeed().valueInteger(CSpeedUnit::kts());
|
||||
switch (flightPlan.getFlightRules())
|
||||
{
|
||||
|
||||
@@ -98,8 +98,8 @@ namespace BlackGui
|
||||
ui->le_EquipmentSuffix->setCompleter(completer);
|
||||
|
||||
// connect
|
||||
connect(ui->pb_Send, &QPushButton::pressed, this, &CFlightPlanComponent::sendFlightPlan, Qt::QueuedConnection);
|
||||
connect(ui->pb_Load, &QPushButton::pressed, this, &CFlightPlanComponent::loadFlightPlanFromNetwork, Qt::QueuedConnection);
|
||||
connect(ui->pb_Send, &QPushButton::pressed, this, &CFlightPlanComponent::sendFlightPlan, Qt::QueuedConnection);
|
||||
connect(ui->pb_Load, &QPushButton::pressed, this, &CFlightPlanComponent::loadFlightPlanFromNetwork, Qt::QueuedConnection);
|
||||
connect(ui->pb_Reset, &QPushButton::pressed, this, &CFlightPlanComponent::resetFlightPlan, Qt::QueuedConnection);
|
||||
connect(ui->pb_ValidateFlightPlan, &QPushButton::pressed, this, &CFlightPlanComponent::validateFlightPlan, Qt::QueuedConnection);
|
||||
connect(ui->tb_SyncWithSimulator, &QPushButton::released, this, &CFlightPlanComponent::syncWithSimulator, Qt::QueuedConnection);
|
||||
@@ -117,23 +117,23 @@ namespace BlackGui
|
||||
connect(ui->pb_SaveDisk, &QPushButton::clicked, this, &CFlightPlanComponent::saveToDisk);
|
||||
|
||||
connect(ui->le_AircraftRegistration, &QLineEdit::textChanged, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
connect(ui->le_AirlineOperator, &QLineEdit::textChanged, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
connect(ui->cb_NoSidsStarts, &QCheckBox::released, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
connect(ui->le_AirlineOperator, &QLineEdit::textChanged, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
connect(ui->cb_NoSidsStarts, &QCheckBox::released, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
|
||||
connect(ui->pte_AdditionalRemarks, &QPlainTextEdit::textChanged, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
connect(ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
connect(ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::setSelcalInOwnAircraft, Qt::QueuedConnection);
|
||||
connect(ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::buildRemarksString, Qt::QueuedConnection);
|
||||
connect(ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::setSelcalInOwnAircraft, Qt::QueuedConnection);
|
||||
connect(ui->pb_CopyOver, &QPushButton::pressed, this, &CFlightPlanComponent::copyRemarksConfirmed, Qt::QueuedConnection);
|
||||
connect(ui->pb_GetFromGenerator, &QPushButton::pressed, this, &CFlightPlanComponent::copyRemarksConfirmed, Qt::QueuedConnection);
|
||||
connect(ui->pb_RemarksGenerator, &QPushButton::clicked, this, &CFlightPlanComponent::currentTabGenerator, Qt::QueuedConnection);
|
||||
connect(ui->pb_RemarksGenerator, &QPushButton::clicked, this, &CFlightPlanComponent::currentTabGenerator, Qt::QueuedConnection);
|
||||
|
||||
connect(ui->tb_HelpEquipment, &QToolButton::clicked, this, &CFlightPlanComponent::showEquipmentCodesTab, Qt::QueuedConnection);
|
||||
connect(ui->tb_AltitudeDialog, &QToolButton::clicked, this, &CFlightPlanComponent::altitudeDialog, Qt::QueuedConnection);
|
||||
connect(ui->tb_HelpEquipment, &QToolButton::clicked, this, &CFlightPlanComponent::showEquipmentCodesTab, Qt::QueuedConnection);
|
||||
connect(ui->tb_AltitudeDialog, &QToolButton::clicked, this, &CFlightPlanComponent::altitudeDialog, Qt::QueuedConnection);
|
||||
|
||||
connect(ui->le_AircraftType, &QLineEdit::editingFinished, this, &CFlightPlanComponent::aircraftTypeChanged, Qt::QueuedConnection);
|
||||
connect(ui->le_AircraftType, &QLineEdit::editingFinished, this, &CFlightPlanComponent::aircraftTypeChanged, Qt::QueuedConnection);
|
||||
connect(ui->le_EquipmentSuffix, &QLineEdit::editingFinished, this, &CFlightPlanComponent::buildPrefixIcaoSuffix, Qt::QueuedConnection);
|
||||
connect(ui->cb_Heavy, &QCheckBox::released, this, &CFlightPlanComponent::prefixCheckBoxChanged, Qt::QueuedConnection);
|
||||
connect(ui->cb_Tcas, &QCheckBox::released, this, &CFlightPlanComponent::prefixCheckBoxChanged, Qt::QueuedConnection);
|
||||
connect(ui->cb_Tcas, &QCheckBox::released, this, &CFlightPlanComponent::prefixCheckBoxChanged, Qt::QueuedConnection);
|
||||
|
||||
// web services
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this, &CFlightPlanComponent::swiftWebDataRead, Qt::QueuedConnection);
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace BlackMisc
|
||||
else if (this->hasValidCombinedType())
|
||||
{
|
||||
if (this->getEnginesCount() == otherCode.getEnginesCount()) { score += 2; }
|
||||
if (this->getEngineType() == otherCode.getEngineType()) { score += 2; }
|
||||
if (this->getEngineType() == otherCode.getEngineType()) { score += 2; }
|
||||
if (this->getAircraftType() == otherCode.getAircraftType()) { score += 2; }
|
||||
CMatchingUtils::addLogDetailsToList(log, *this, QStringLiteral("Added combined code parts: %1").arg(score));
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace BlackMisc
|
||||
CAircraftIcaoCode CAircraftIcaoCodeList::findFirstByDesignatorAndRank(const QString &designator) const
|
||||
{
|
||||
if (!CAircraftIcaoCode::isValidDesignator(designator)) { return CAircraftIcaoCode(); }
|
||||
CAircraftIcaoCodeList codes(findByDesignator(designator));
|
||||
CAircraftIcaoCodeList codes(this->findByDesignator(designator));
|
||||
if (codes.isEmpty()) { return CAircraftIcaoCode(); }
|
||||
if (codes.size() < 2) { return codes.front(); }
|
||||
codes.sortBy(&CAircraftIcaoCode::getRank, &CAircraftIcaoCode::getDbKey);
|
||||
|
||||
Reference in New Issue
Block a user