mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
refs #748, add airport completers
* in flight plan * in login * utility functions
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "blackgui/components/selcalcodeselector.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackmisc/aviation/aircrafticaocode.h"
|
||||
#include "blackmisc/aviation/airporticaocode.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/logcategory.h"
|
||||
@@ -76,33 +76,33 @@ namespace BlackGui
|
||||
ui->le_OriginAirport->setValidator(ucv);
|
||||
|
||||
// connect
|
||||
connect(this->ui->pb_Send, &QPushButton::pressed, this, &CFlightPlanComponent::ps_sendFlightPlan);
|
||||
connect(this->ui->pb_Load, &QPushButton::pressed, this, &CFlightPlanComponent::ps_loadFlightPlanFromNetwork);
|
||||
connect(this->ui->pb_Reset, &QPushButton::pressed, this, &CFlightPlanComponent::ps_resetFlightPlan);
|
||||
connect(this->ui->pb_ValidateFlightPlan, &QPushButton::pressed, this, &CFlightPlanComponent::ps_validateFlightPlan);
|
||||
connect(ui->pb_Send, &QPushButton::pressed, this, &CFlightPlanComponent::ps_sendFlightPlan);
|
||||
connect(ui->pb_Load, &QPushButton::pressed, this, &CFlightPlanComponent::ps_loadFlightPlanFromNetwork);
|
||||
connect(ui->pb_Reset, &QPushButton::pressed, this, &CFlightPlanComponent::ps_resetFlightPlan);
|
||||
connect(ui->pb_ValidateFlightPlan, &QPushButton::pressed, this, &CFlightPlanComponent::ps_validateFlightPlan);
|
||||
|
||||
connect(this->ui->cb_VoiceCapabilities, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(this->ui->cb_NavigationEquipment, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(this->ui->cb_PerformanceCategory, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(this->ui->cb_PilotRating, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(this->ui->cb_RequiredNavigationPerformance, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(ui->cb_VoiceCapabilities, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(ui->cb_NavigationEquipment, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(ui->cb_PerformanceCategory, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(ui->cb_PilotRating, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
connect(ui->cb_RequiredNavigationPerformance, &QComboBox::currentTextChanged, this, &CFlightPlanComponent::ps_currentTextChangedToBuildRemarks);
|
||||
|
||||
connect(this->ui->pb_LoadDisk, &QPushButton::clicked, this, &CFlightPlanComponent::ps_loadFromDisk);
|
||||
connect(this->ui->pb_SaveDisk, &QPushButton::clicked, this, &CFlightPlanComponent::ps_saveToDisk);
|
||||
connect(ui->pb_LoadDisk, &QPushButton::clicked, this, &CFlightPlanComponent::ps_loadFromDisk);
|
||||
connect(ui->pb_SaveDisk, &QPushButton::clicked, this, &CFlightPlanComponent::ps_saveToDisk);
|
||||
|
||||
bool c = connect(this->ui->le_AircraftRegistration, SIGNAL(textChanged(QString)), this, SLOT(ps_buildRemarksString()));
|
||||
bool c = connect(ui->le_AircraftRegistration, SIGNAL(textChanged(QString)), this, SLOT(ps_buildRemarksString()));
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "failed connect");
|
||||
c = connect(this->ui->cb_NoSidsStarts, SIGNAL(toggled(bool)), this, SLOT(ps_buildRemarksString()));
|
||||
c = connect(ui->cb_NoSidsStarts, SIGNAL(toggled(bool)), this, SLOT(ps_buildRemarksString()));
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "failed connect");
|
||||
c = connect(this->ui->le_AirlineOperator, SIGNAL(textChanged(QString)), this, SLOT(ps_buildRemarksString()));
|
||||
c = connect(ui->le_AirlineOperator, SIGNAL(textChanged(QString)), this, SLOT(ps_buildRemarksString()));
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "failed connect");
|
||||
Q_UNUSED(c);
|
||||
|
||||
connect(this->ui->pte_AdditionalRemarks, &QPlainTextEdit::textChanged, this, &CFlightPlanComponent::ps_buildRemarksString);
|
||||
connect(this->ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::ps_buildRemarksString);
|
||||
connect(this->ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::ps_setSelcalInOwnAircraft);
|
||||
connect(this->ui->pb_CopyOver, &QPushButton::pressed, this, &CFlightPlanComponent::ps_copyRemarks);
|
||||
connect(this->ui->pb_RemarksGenerator, &QPushButton::clicked, this, &CFlightPlanComponent::ps_currentTabGenerator);
|
||||
connect(ui->pte_AdditionalRemarks, &QPlainTextEdit::textChanged, this, &CFlightPlanComponent::ps_buildRemarksString);
|
||||
connect(ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::ps_buildRemarksString);
|
||||
connect(ui->frp_SelcalCode, &CSelcalCodeSelector::valueChanged, this, &CFlightPlanComponent::ps_setSelcalInOwnAircraft);
|
||||
connect(ui->pb_CopyOver, &QPushButton::pressed, this, &CFlightPlanComponent::ps_copyRemarks);
|
||||
connect(ui->pb_RemarksGenerator, &QPushButton::clicked, this, &CFlightPlanComponent::ps_currentTabGenerator);
|
||||
|
||||
// web services
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::allSwiftDbDataRead, this, &CFlightPlanComponent::ps_swiftDataRead);
|
||||
@@ -127,38 +127,38 @@ namespace BlackGui
|
||||
// only override with valid values
|
||||
if (CCallsign::isValidAircraftCallsign(ownAircraft.getCallsignAsString()))
|
||||
{
|
||||
this->ui->le_Callsign->setText(ownAircraft.getCallsign().asString());
|
||||
ui->le_Callsign->setText(ownAircraft.getCallsign().asString());
|
||||
}
|
||||
if (CAircraftIcaoCode::isValidDesignator(ownAircraft.getAircraftIcaoCodeDesignator()))
|
||||
{
|
||||
this->ui->le_AircraftType->setText(ownAircraft.getAircraftIcaoCodeDesignator());
|
||||
ui->le_AircraftType->setText(ownAircraft.getAircraftIcaoCodeDesignator());
|
||||
}
|
||||
if (ownAircraft.hasValidRealName())
|
||||
{
|
||||
this->ui->le_PilotsName->setText(ownAircraft.getPilot().getRealName());
|
||||
ui->le_PilotsName->setText(ownAircraft.getPilot().getRealName());
|
||||
}
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::fillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan)
|
||||
{
|
||||
this->ui->le_AlternateAirport->setText(flightPlan.getAlternateAirportIcao().asString());
|
||||
this->ui->le_DestinationAirport->setText(flightPlan.getDestinationAirportIcao().asString());
|
||||
this->ui->le_OriginAirport->setText(flightPlan.getOriginAirportIcao().asString());
|
||||
this->ui->pte_Route->setPlainText(flightPlan.getRoute());
|
||||
this->ui->pte_Remarks->setPlainText(flightPlan.getRemarks());
|
||||
this->ui->le_TakeOffTimePlanned->setText(flightPlan.getTakeoffTimePlannedHourMin());
|
||||
this->ui->le_FuelOnBoard->setText(flightPlan.getFuelTimeHourMin());
|
||||
this->ui->le_EstimatedTimeEnroute->setText(flightPlan.getEnrouteTimeHourMin());
|
||||
this->ui->le_CruiseTrueAirspeed->setText(flightPlan.getCruiseTrueAirspeed().valueRoundedWithUnit(BlackMisc::PhysicalQuantities::CSpeedUnit::kts(), 0));
|
||||
ui->le_AlternateAirport->setText(flightPlan.getAlternateAirportIcao().asString());
|
||||
ui->le_DestinationAirport->setText(flightPlan.getDestinationAirportIcao().asString());
|
||||
ui->le_OriginAirport->setText(flightPlan.getOriginAirportIcao().asString());
|
||||
ui->pte_Route->setPlainText(flightPlan.getRoute());
|
||||
ui->pte_Remarks->setPlainText(flightPlan.getRemarks());
|
||||
ui->le_TakeOffTimePlanned->setText(flightPlan.getTakeoffTimePlannedHourMin());
|
||||
ui->le_FuelOnBoard->setText(flightPlan.getFuelTimeHourMin());
|
||||
ui->le_EstimatedTimeEnroute->setText(flightPlan.getEnrouteTimeHourMin());
|
||||
ui->le_CruiseTrueAirspeed->setText(flightPlan.getCruiseTrueAirspeed().valueRoundedWithUnit(BlackMisc::PhysicalQuantities::CSpeedUnit::kts(), 0));
|
||||
|
||||
const CAltitude cruiseAlt = flightPlan.getCruiseAltitude();
|
||||
if (cruiseAlt.isFlightLevel())
|
||||
{
|
||||
this->ui->le_CrusingAltitude->setText(cruiseAlt.toQString());
|
||||
ui->le_CrusingAltitude->setText(cruiseAlt.toQString());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui->le_CrusingAltitude->setText(cruiseAlt.valueRoundedWithUnit(BlackMisc::PhysicalQuantities::CLengthUnit::ft(), 0));
|
||||
ui->le_CrusingAltitude->setText(cruiseAlt.valueRoundedWithUnit(BlackMisc::PhysicalQuantities::CLengthUnit::ft(), 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,11 +173,11 @@ namespace BlackGui
|
||||
QString v;
|
||||
|
||||
CFlightPlan::FlightRules rule = CFlightPlan::IFR;
|
||||
if (this->ui->rb_TypeIfr->isChecked())
|
||||
if (ui->rb_TypeIfr->isChecked())
|
||||
{
|
||||
rule = CFlightPlan::IFR;
|
||||
}
|
||||
else if (this->ui->rb_TypeVfr->isChecked())
|
||||
else if (ui->rb_TypeVfr->isChecked())
|
||||
{
|
||||
rule = CFlightPlan::VFR;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ namespace BlackGui
|
||||
v = ui->le_Callsign->text().trimmed();
|
||||
if (v.isEmpty())
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_Callsign->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << ui->lbl_Callsign->text());
|
||||
}
|
||||
|
||||
v = ui->pte_Route->toPlainText().trimmed();
|
||||
@@ -220,7 +220,7 @@ namespace BlackGui
|
||||
v = ui->le_EstimatedTimeEnroute->text();
|
||||
if (v.isEmpty() || v == defaultTime())
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_EstimatedTimeEnroute->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << ui->lbl_EstimatedTimeEnroute->text());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -230,7 +230,7 @@ namespace BlackGui
|
||||
v = ui->le_FuelOnBoard->text();
|
||||
if (v.isEmpty() || v == defaultTime())
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_FuelOnBorad->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << ui->lbl_FuelOnBorad->text());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -240,7 +240,7 @@ namespace BlackGui
|
||||
v = ui->le_TakeOffTimePlanned->text();
|
||||
if (v.isEmpty() || v == defaultTime())
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_TakeOffTimePlanned->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << ui->lbl_TakeOffTimePlanned->text());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -252,23 +252,23 @@ namespace BlackGui
|
||||
if (!v.isEmpty() && withUnit.indexIn(v) < 0)
|
||||
{
|
||||
v += "ft";
|
||||
this->ui->le_CrusingAltitude->setText(v);
|
||||
ui->le_CrusingAltitude->setText(v);
|
||||
}
|
||||
|
||||
CAltitude cruisingAltitude(v, CPqString::SeparatorsLocale);
|
||||
if (v.isEmpty() || cruisingAltitude.isNull())
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Wrong %1") << this->ui->lbl_CrusingAltitude->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Wrong %1") << ui->lbl_CrusingAltitude->text());
|
||||
}
|
||||
else
|
||||
{
|
||||
flightPlan.setCruiseAltitude(cruisingAltitude);
|
||||
}
|
||||
|
||||
v = this->ui->le_DestinationAirport->text();
|
||||
v = ui->le_DestinationAirport->text();
|
||||
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_DestinationAirport->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << ui->lbl_DestinationAirport->text());
|
||||
flightPlan.setDestinationAirportIcao(QString(""));
|
||||
}
|
||||
else
|
||||
@@ -276,12 +276,12 @@ namespace BlackGui
|
||||
flightPlan.setDestinationAirportIcao(v);
|
||||
}
|
||||
|
||||
v = this->ui->le_CruiseTrueAirspeed->text();
|
||||
v = ui->le_CruiseTrueAirspeed->text();
|
||||
BlackMisc::PhysicalQuantities::CSpeed cruiseTAS;
|
||||
cruiseTAS.parseFromString(v, CPqString::SeparatorsLocale);
|
||||
if (cruiseTAS.isNull())
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Wrong TAS, %1") << this->ui->lbl_CruiseTrueAirspeed->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Wrong TAS, %1") << ui->lbl_CruiseTrueAirspeed->text());
|
||||
flightPlan.setDestinationAirportIcao(defaultIcao());
|
||||
}
|
||||
else
|
||||
@@ -289,10 +289,10 @@ namespace BlackGui
|
||||
flightPlan.setCruiseTrueAirspeed(cruiseTAS);
|
||||
}
|
||||
|
||||
v = this->ui->le_OriginAirport->text();
|
||||
v = ui->le_OriginAirport->text();
|
||||
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
|
||||
{
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_OriginAirport->text());
|
||||
messages.push_back(CLogMessage().validationWarning("Missing %1") << ui->lbl_OriginAirport->text());
|
||||
flightPlan.setOriginAirportIcao(defaultIcao());
|
||||
}
|
||||
else
|
||||
@@ -301,12 +301,12 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
// Optional fields
|
||||
v = this->ui->le_AlternateAirport->text();
|
||||
v = ui->le_AlternateAirport->text();
|
||||
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
|
||||
{
|
||||
if (!messages.hasWarningOrErrorMessages())
|
||||
{
|
||||
messages.push_back(CLogMessage().validationInfo("Missing %1") << this->ui->lbl_AlternateAirport->text());
|
||||
messages.push_back(CLogMessage().validationInfo("Missing %1") << ui->lbl_AlternateAirport->text());
|
||||
}
|
||||
flightPlan.setAlternateAirportIcao(QString(""));
|
||||
}
|
||||
@@ -334,13 +334,13 @@ namespace BlackGui
|
||||
{
|
||||
flightPlan.setWhenLastSentOrLoaded(QDateTime::currentDateTimeUtc());
|
||||
sGui->getIContextNetwork()->sendFlightPlan(flightPlan);
|
||||
this->ui->le_LastSent->setText(flightPlan.whenLastSentOrLoaded().toString());
|
||||
ui->le_LastSent->setText(flightPlan.whenLastSentOrLoaded().toString());
|
||||
CLogMessage(this).info("Sent flight plan");
|
||||
}
|
||||
else
|
||||
{
|
||||
flightPlan.setWhenLastSentOrLoaded(QDateTime()); // empty
|
||||
this->ui->le_LastSent->clear();
|
||||
ui->le_LastSent->clear();
|
||||
CLogMessage(this).error("No errors, but not connected, cannot send flight plan");
|
||||
}
|
||||
this->m_flightPlan = flightPlan; // last valid FP
|
||||
@@ -361,18 +361,18 @@ namespace BlackGui
|
||||
Q_ASSERT(sGui->getIContextNetwork());
|
||||
Q_ASSERT(sGui->getIContextOwnAircraft());
|
||||
if (sGui->getIContextOwnAircraft()) { this->prefillWithAircraftData(sGui->getIContextOwnAircraft()->getOwnAircraft()); }
|
||||
this->ui->le_AircraftRegistration->clear();
|
||||
this->ui->le_AirlineOperator->clear();
|
||||
this->ui->le_CrusingAltitude->setText("FL70");
|
||||
this->ui->le_CruiseTrueAirspeed->setText("100 kts");
|
||||
this->ui->pte_Remarks->clear();
|
||||
this->ui->pte_Route->clear();
|
||||
this->ui->le_AlternateAirport->clear();
|
||||
this->ui->le_DestinationAirport->clear();
|
||||
this->ui->le_OriginAirport->clear();
|
||||
this->ui->le_FuelOnBoard->setText(defaultTime());
|
||||
this->ui->le_EstimatedTimeEnroute->setText(defaultTime());
|
||||
this->ui->le_TakeOffTimePlanned->setText(QDateTime::currentDateTimeUtc().addSecs(30 * 60).toString("hh:mm"));
|
||||
ui->le_AircraftRegistration->clear();
|
||||
ui->le_AirlineOperator->clear();
|
||||
ui->le_CrusingAltitude->setText("FL70");
|
||||
ui->le_CruiseTrueAirspeed->setText("100 kts");
|
||||
ui->pte_Remarks->clear();
|
||||
ui->pte_Route->clear();
|
||||
ui->le_AlternateAirport->clear();
|
||||
ui->le_DestinationAirport->clear();
|
||||
ui->le_OriginAirport->clear();
|
||||
ui->le_FuelOnBoard->setText(defaultTime());
|
||||
ui->le_EstimatedTimeEnroute->setText(defaultTime());
|
||||
ui->le_TakeOffTimePlanned->setText(QDateTime::currentDateTimeUtc().addSecs(30 * 60).toString("hh:mm"));
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::ps_loadFromDisk()
|
||||
@@ -443,8 +443,8 @@ namespace BlackGui
|
||||
void CFlightPlanComponent::ps_setSelcalInOwnAircraft()
|
||||
{
|
||||
if (!sGui->getIContextOwnAircraft()) return;
|
||||
if (!this->ui->frp_SelcalCode->hasValidCode()) return;
|
||||
sGui->getIContextOwnAircraft()->updateSelcal(this->ui->frp_SelcalCode->getSelcal(), flightPlanIdentifier());
|
||||
if (!ui->frp_SelcalCode->hasValidCode()) return;
|
||||
sGui->getIContextOwnAircraft()->updateSelcal(ui->frp_SelcalCode->getSelcal(), flightPlanIdentifier());
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::ps_loadFlightPlanFromNetwork()
|
||||
@@ -476,65 +476,65 @@ namespace BlackGui
|
||||
void CFlightPlanComponent::ps_buildRemarksString()
|
||||
{
|
||||
QString rem;
|
||||
QString v = this->ui->cb_VoiceCapabilities->currentText().toUpper();
|
||||
QString v = ui->cb_VoiceCapabilities->currentText().toUpper();
|
||||
if (v.contains("TEXT")) { rem.append("/T/ "); }
|
||||
else if (v.contains("RECEIVE")) { rem.append("/R/ "); }
|
||||
else if (v.contains("VOICE")) { rem.append("/V/ "); }
|
||||
|
||||
v = this->ui->le_AirlineOperator->text().trimmed();
|
||||
v = ui->le_AirlineOperator->text().trimmed();
|
||||
if (!v.isEmpty()) rem.append("OPR/").append(v).append(" ");
|
||||
|
||||
v = this->ui->le_AircraftRegistration->text().trimmed();
|
||||
v = ui->le_AircraftRegistration->text().trimmed();
|
||||
if (!v.isEmpty()) rem.append("REG/").append(v).append(" ");
|
||||
|
||||
v = this->ui->cb_PilotRating->currentText().toUpper();
|
||||
v = ui->cb_PilotRating->currentText().toUpper();
|
||||
if (v.contains("P1")) { rem.append("PR/P1 "); }
|
||||
else if (v.contains("P2")) { rem.append("PR/P2 "); }
|
||||
else if (v.contains("P3")) { rem.append("PR/P3 "); }
|
||||
else if (v.contains("P4")) { rem.append("PR/P4 "); }
|
||||
else if (v.contains("P5")) { rem.append("PR/P5 "); }
|
||||
|
||||
v = this->ui->cb_RequiredNavigationPerformance->currentText().toUpper();
|
||||
v = ui->cb_RequiredNavigationPerformance->currentText().toUpper();
|
||||
if (v.contains("10")) { rem.append("RNP10 "); }
|
||||
else if (v.contains("4")) { rem.append("RNP4 "); }
|
||||
|
||||
v = this->ui->cb_NavigationEquipment->currentText().toUpper();
|
||||
v = ui->cb_NavigationEquipment->currentText().toUpper();
|
||||
if (v.contains("VORS")) { rem.append("NAV/VORNDB "); }
|
||||
else if (v.contains("SIDS")) { rem.append("NAV/GPSRNAV "); }
|
||||
if (v.contains("DEFAULT")) { rem.append("NAV/GPS "); }
|
||||
else if (v.contains("OCEANIC")) { rem.append("NAV/GPSOCEANIC "); }
|
||||
|
||||
v = this->ui->cb_PerformanceCategory->currentText().toUpper();
|
||||
v = ui->cb_PerformanceCategory->currentText().toUpper();
|
||||
if (v.startsWith("A")) { rem.append("PER/A "); }
|
||||
else if (v.startsWith("B")) { rem.append("PER/B "); }
|
||||
else if (v.startsWith("C")) { rem.append("PER/C "); }
|
||||
else if (v.startsWith("D")) { rem.append("PER/D "); }
|
||||
else if (v.startsWith("E")) { rem.append("PER/E "); }
|
||||
|
||||
if (this->ui->frp_SelcalCode->hasValidCode())
|
||||
if (ui->frp_SelcalCode->hasValidCode())
|
||||
{
|
||||
rem.append("SEL/").append(this->ui->frp_SelcalCode->getSelcalCode());
|
||||
rem.append("SEL/").append(ui->frp_SelcalCode->getSelcalCode());
|
||||
rem.append(" ");
|
||||
}
|
||||
|
||||
if (this->ui->cb_NoSidsStarts->isChecked()) { rem.append("NO SID/STAR "); }
|
||||
if (ui->cb_NoSidsStarts->isChecked()) { rem.append("NO SID/STAR "); }
|
||||
|
||||
v = this->ui->pte_AdditionalRemarks->toPlainText().trimmed();
|
||||
v = ui->pte_AdditionalRemarks->toPlainText().trimmed();
|
||||
if (!v.isEmpty()) { rem.append(v); }
|
||||
|
||||
rem = rem.simplified().trimmed();
|
||||
this->ui->pte_RemarksGenerated->setPlainText(rem);
|
||||
ui->pte_RemarksGenerated->setPlainText(rem);
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::ps_copyRemarks()
|
||||
{
|
||||
this->ui->pte_Remarks->setPlainText(this->ui->pte_RemarksGenerated->toPlainText());
|
||||
ui->pte_Remarks->setPlainText(ui->pte_RemarksGenerated->toPlainText());
|
||||
CLogMessage(this).info("Copied remarks");
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::ps_currentTabGenerator()
|
||||
{
|
||||
this->setCurrentWidget(this->ui->tb_RemarksGenerator);
|
||||
this->setCurrentWidget(ui->tb_RemarksGenerator);
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::ps_swiftDataRead()
|
||||
@@ -551,8 +551,14 @@ namespace BlackGui
|
||||
void CFlightPlanComponent::initCompleters()
|
||||
{
|
||||
if (!sGui || !sGui->getWebDataServices()) { return; }
|
||||
QStringList aircraft = sGui->getWebDataServices()->getAircraftIcaoCodes().allIcaoCodes();
|
||||
const QStringList aircraft = sGui->getWebDataServices()->getAircraftIcaoCodes().allIcaoCodes();
|
||||
ui->le_AircraftType->setCompleter(new QCompleter(aircraft, this));
|
||||
|
||||
const QStringList airports = sGui->getWebDataServices()->getAirports().allIcaoCodes(true);
|
||||
QCompleter *airportCompleter = new QCompleter(airports, this);
|
||||
ui->le_AlternateAirport->setCompleter(airportCompleter);
|
||||
ui->le_DestinationAirport->setCompleter(airportCompleter);
|
||||
ui->le_OriginAirport->setCompleter(airportCompleter);
|
||||
}
|
||||
|
||||
QString CFlightPlanComponent::getDefaultFilename(bool load)
|
||||
|
||||
Reference in New Issue
Block a user