mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 09:45:44 +08:00
Ref T268, allow to preset own aircraft coordinates in form
This commit is contained in:
@@ -8,8 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "coordinateform.h"
|
#include "coordinateform.h"
|
||||||
#include "blackcore/webdataservices.h"
|
#include "blackcore/context/contextownaircraft.h"
|
||||||
#include "blackcore/db/airportdatareader.h"
|
#include "blackcore/db/airportdatareader.h"
|
||||||
|
#include "blackcore/webdataservices.h"
|
||||||
#include "blackgui/guiapplication.h"
|
#include "blackgui/guiapplication.h"
|
||||||
#include "blackmisc/aviation/airport.h"
|
#include "blackmisc/aviation/airport.h"
|
||||||
#include "ui_coordinateform.h"
|
#include "ui_coordinateform.h"
|
||||||
@@ -61,7 +62,9 @@ namespace BlackGui
|
|||||||
connect(ui->le_LngSecFrag, &QLineEdit::editingFinished, this, &CCoordinateForm::lngCombinedEntered);
|
connect(ui->le_LngSecFrag, &QLineEdit::editingFinished, this, &CCoordinateForm::lngCombinedEntered);
|
||||||
|
|
||||||
connect(ui->le_Location, &QLineEdit::returnPressed, this, &CCoordinateForm::locationEntered);
|
connect(ui->le_Location, &QLineEdit::returnPressed, this, &CCoordinateForm::locationEntered);
|
||||||
|
|
||||||
connect(ui->pb_Set, &QPushButton::pressed, this, &CCoordinateForm::changedCoordinate);
|
connect(ui->pb_Set, &QPushButton::pressed, this, &CCoordinateForm::changedCoordinate);
|
||||||
|
connect(ui->pb_OwnAircraft, &QPushButton::pressed, this, &CCoordinateForm::presetOwnAircraftPosition);
|
||||||
|
|
||||||
const CCoordinateGeodetic c;
|
const CCoordinateGeodetic c;
|
||||||
this->setCoordinate(c);
|
this->setCoordinate(c);
|
||||||
@@ -258,7 +261,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CCoordinateForm::elvEntered()
|
void CCoordinateForm::elvEntered()
|
||||||
{
|
{
|
||||||
const QString e = ui->le_Elevation->text();
|
const QString e = ui->le_Elevation->text().trimmed();
|
||||||
CAltitude a;
|
CAltitude a;
|
||||||
a.parseFromString(e);
|
a.parseFromString(e);
|
||||||
ui->lblp_ElvCheck->setTicked(!e.isNull());
|
ui->lblp_ElvCheck->setTicked(!e.isNull());
|
||||||
@@ -266,5 +269,13 @@ namespace BlackGui
|
|||||||
c.setGeodeticHeight(a);
|
c.setGeodeticHeight(a);
|
||||||
this->setCoordinate(c);
|
this->setCoordinate(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCoordinateForm::presetOwnAircraftPosition()
|
||||||
|
{
|
||||||
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
|
if (!sGui->getIContextOwnAircraft()) { return; }
|
||||||
|
const CCoordinateGeodetic coordinate = sGui->getIContextOwnAircraft()->getOwnAircraft().getSituation();
|
||||||
|
this->setCoordinate(coordinate);
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ namespace BlackGui
|
|||||||
void lngEntered();
|
void lngEntered();
|
||||||
void lngCombinedEntered();
|
void lngCombinedEntered();
|
||||||
void elvEntered();
|
void elvEntered();
|
||||||
|
void presetOwnAircraftPosition();
|
||||||
|
|
||||||
BlackMisc::Geo::CCoordinateGeodetic m_coordinate;
|
BlackMisc::Geo::CCoordinateGeodetic m_coordinate;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,13 +14,6 @@
|
|||||||
<string>Frame</string>
|
<string>Frame</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gl_CoordinateSelector">
|
<layout class="QGridLayout" name="gl_CoordinateSelector">
|
||||||
<item row="2" column="5">
|
|
||||||
<widget class="QLineEdit" name="le_LngDeg">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>deg.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
<widget class="BlackGui::CTickLabel" name="lblp_ElvCheck">
|
<widget class="BlackGui::CTickLabel" name="lblp_ElvCheck">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@@ -34,6 +27,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="5">
|
||||||
|
<widget class="QLineEdit" name="le_LngDeg">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>deg.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="8">
|
||||||
|
<widget class="QLineEdit" name="le_LngSecFrag">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>fract.sec</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="2" column="3">
|
<item row="2" column="3">
|
||||||
<widget class="QRadioButton" name="rb_E">
|
<widget class="QRadioButton" name="rb_E">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -67,10 +74,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="8">
|
<item row="3" column="5" colspan="4">
|
||||||
<widget class="QLineEdit" name="le_LngSecFrag">
|
<widget class="QLineEdit" name="le_Location">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>fract.sec</string>
|
<string>ICAO, city</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -81,20 +88,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="5" colspan="4">
|
|
||||||
<widget class="QLineEdit" name="le_Location">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>ICAO, city</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="7">
|
|
||||||
<widget class="QLineEdit" name="le_LngSec">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>sec</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="lbl_Latitude">
|
<widget class="QLabel" name="lbl_Latitude">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -102,30 +95,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2">
|
<item row="2" column="7">
|
||||||
<widget class="BlackGui::CTickLabel" name="lblp_LngCheck">
|
<widget class="QLineEdit" name="le_LngSec">
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_Longitude">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>120</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>WGS 0° 0' 0.000" E/W</string>
|
<string>sec</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_Longitude">
|
|
||||||
<property name="text">
|
|
||||||
<string>Longitude (0°-180°):</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -142,6 +115,33 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="BlackGui::CTickLabel" name="lblp_LngCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_Longitude">
|
||||||
|
<property name="text">
|
||||||
|
<string>Longitude (0°-180°):</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="le_Longitude">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>120</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>WGS 0° 0' 0.000" E/W</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lbl_Elevation">
|
<widget class="QLabel" name="lbl_Elevation">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -194,14 +194,11 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="4">
|
<item row="0" column="6">
|
||||||
<widget class="QRadioButton" name="rb_W">
|
<widget class="QLabel" name="lbl_Min">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>W</string>
|
<string>min</string>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="buttonGroup">
|
|
||||||
<string notr="true">bg_EW</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="4">
|
<item row="1" column="4">
|
||||||
@@ -214,11 +211,14 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="6">
|
<item row="2" column="4">
|
||||||
<widget class="QLabel" name="lbl_Min">
|
<widget class="QRadioButton" name="rb_W">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>min</string>
|
<string>W</string>
|
||||||
</property>
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">bg_EW</string>
|
||||||
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="5">
|
<item row="0" column="5">
|
||||||
@@ -228,13 +228,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="7">
|
|
||||||
<widget class="QLabel" name="lbl_Sec">
|
|
||||||
<property name="text">
|
|
||||||
<string>sec</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="8">
|
<item row="0" column="8">
|
||||||
<widget class="QLabel" name="lbl_FracSec">
|
<widget class="QLabel" name="lbl_FracSec">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -242,7 +235,55 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="8">
|
<item row="0" column="7">
|
||||||
|
<widget class="QLabel" name="lbl_Sec">
|
||||||
|
<property name="text">
|
||||||
|
<string>sec</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="5" colspan="4">
|
||||||
|
<widget class="QFrame" name="fr_Buttons">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="hl_Buttons">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="hs_Buttons">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pb_OwnAircraft">
|
||||||
|
<property name="text">
|
||||||
|
<string> own aircraft </string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="pb_Set">
|
<widget class="QPushButton" name="pb_Set">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>set</string>
|
<string>set</string>
|
||||||
@@ -251,6 +292,9 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>BlackGui::CTickLabel</class>
|
<class>BlackGui::CTickLabel</class>
|
||||||
@@ -275,11 +319,13 @@
|
|||||||
<tabstop>le_LngSecFrag</tabstop>
|
<tabstop>le_LngSecFrag</tabstop>
|
||||||
<tabstop>le_Elevation</tabstop>
|
<tabstop>le_Elevation</tabstop>
|
||||||
<tabstop>le_Location</tabstop>
|
<tabstop>le_Location</tabstop>
|
||||||
|
<tabstop>pb_OwnAircraft</tabstop>
|
||||||
|
<tabstop>pb_Set</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
<buttongroup name="bg_NS"/>
|
|
||||||
<buttongroup name="bg_EW"/>
|
<buttongroup name="bg_EW"/>
|
||||||
|
<buttongroup name="bg_NS"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user