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