mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T215, FP component using the altitude line edit
This commit is contained in:
@@ -40,7 +40,6 @@
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
#include <QRadioButton>
|
||||
#include <QRegularExpression>
|
||||
#include <QTabBar>
|
||||
#include <QCompleter>
|
||||
#include <QStringBuilder>
|
||||
@@ -220,14 +219,7 @@ namespace BlackGui
|
||||
ui->le_CruiseTrueAirspeed->setText(flightPlan.getCruiseTrueAirspeed().valueRoundedWithUnit(CSpeedUnit::kts(), 0));
|
||||
|
||||
const CAltitude cruiseAlt = flightPlan.getCruiseAltitude();
|
||||
if (cruiseAlt.isFlightLevel())
|
||||
{
|
||||
ui->le_CrusingAltitude->setText(cruiseAlt.toQString());
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->le_CrusingAltitude->setText(cruiseAlt.valueRoundedWithUnit(CLengthUnit::ft(), 0));
|
||||
}
|
||||
ui->lep_CrusingAltitude->setAltitude(cruiseAlt);
|
||||
|
||||
switch (flightPlan.getFlightRulesAsVFRorIFR())
|
||||
{
|
||||
@@ -263,6 +255,7 @@ namespace BlackGui
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Invalid callsign '%1'") << v);
|
||||
}
|
||||
flightPlan.setCallsign(CCallsign(v));
|
||||
|
||||
// aircraft ICAO / aircraft type
|
||||
v = ui->le_AircraftType->text().trimmed().toUpper();
|
||||
@@ -445,7 +438,7 @@ namespace BlackGui
|
||||
this->prefillWithOwnAircraftData();
|
||||
ui->le_AircraftRegistration->clear();
|
||||
ui->le_AirlineOperator->clear();
|
||||
ui->le_CrusingAltitude->setText("FL70");
|
||||
ui->lep_CrusingAltitude->setText("FL70");
|
||||
ui->le_CruiseTrueAirspeed->setText("100 kts");
|
||||
ui->pte_Remarks->clear();
|
||||
ui->pte_Route->clear();
|
||||
@@ -543,12 +536,7 @@ namespace BlackGui
|
||||
|
||||
void CFlightPlanComponent::loadFlightPlanFromNetwork()
|
||||
{
|
||||
if (!sGui->getIContextNetwork())
|
||||
{
|
||||
CLogMessage(this).info("Cannot load flight plan, network not available");
|
||||
return;
|
||||
}
|
||||
if (!sGui->getIContextNetwork()->isConnected())
|
||||
if (!sGui->getIContextNetwork() || !sGui->getIContextNetwork()->isConnected())
|
||||
{
|
||||
CLogMessage(this).warning("Cannot load flight plan, network not connected");
|
||||
return;
|
||||
@@ -558,6 +546,8 @@ namespace BlackGui
|
||||
const CFlightPlan loadedPlan = sGui->getIContextNetwork()->loadFlightPlanFromNetwork(ownAircraft.getCallsign());
|
||||
if (loadedPlan.wasSentOrLoaded())
|
||||
{
|
||||
const int r = QMessageBox::warning(this, "Override current data?", "Loaded FP", QMessageBox::Yes | QMessageBox::No);
|
||||
if (r != QMessageBox::Yes) { return; }
|
||||
this->fillWithFlightPlanData(loadedPlan);
|
||||
CLogMessage(this).info("Updated with loaded flight plan");
|
||||
}
|
||||
@@ -617,10 +607,10 @@ namespace BlackGui
|
||||
ui->pte_RemarksGenerated->setPlainText(rem);
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::copyRemarks()
|
||||
void CFlightPlanComponent::copyRemarks(bool confirm)
|
||||
{
|
||||
const QString generated = ui->pte_RemarksGenerated->toPlainText().trimmed();
|
||||
if (!this->overrideRemarks()) { return; }
|
||||
if (confirm && !this->overrideRemarks()) { return; }
|
||||
ui->pte_Remarks->setPlainText(generated);
|
||||
CLogMessage(this).info("Copied remarks");
|
||||
}
|
||||
|
||||
@@ -424,14 +424,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLineEdit" name="le_CrusingAltitude">
|
||||
<property name="maxLength">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>e.g. FL70</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="BlackGui::CAltitudeEdit" name="lep_CrusingAltitude"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lbl_Callsign">
|
||||
@@ -1137,6 +1130,11 @@ p, li { white-space: pre-wrap; }
|
||||
<header>blackgui/components/selcalcodeselector.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::CAltitudeEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>blackgui/altitudeedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>sa_FlightPlanTabMain</tabstop>
|
||||
@@ -1151,7 +1149,7 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstop>tb_HelpEquipment</tabstop>
|
||||
<tabstop>le_OriginAirport</tabstop>
|
||||
<tabstop>le_TakeOffTimePlanned</tabstop>
|
||||
<tabstop>le_CrusingAltitude</tabstop>
|
||||
<tabstop>lep_CrusingAltitude</tabstop>
|
||||
<tabstop>pte_Route</tabstop>
|
||||
<tabstop>le_DestinationAirport</tabstop>
|
||||
<tabstop>le_EstimatedTimeEnroute</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user