mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
Renamed sample_blackgui -> swiftgui_standard and sample_blackcore -> swiftcore as discussed
This commit is contained in:
49
src/swiftgui_standard/mainwindow_aircraft.cpp
Normal file
49
src/swiftgui_standard/mainwindow_aircraft.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "blackgui/models/atcstationlistmodel.h"
|
||||
#include "blackcore/dbus_server.h"
|
||||
#include "blackcore/context_network.h"
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackGui;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Settings;
|
||||
using namespace BlackMisc::Audio;
|
||||
|
||||
/*
|
||||
* Load own aircraft
|
||||
*/
|
||||
bool MainWindow::ps_reloadOwnAircraft()
|
||||
{
|
||||
if (!this->isContextNetworkAvailableCheck()) return false;
|
||||
|
||||
// check for changed aircraft
|
||||
bool changed = false;
|
||||
CAircraft loadedAircraft = this->getIContextOwnAircraft()->getOwnAircraft();
|
||||
if (loadedAircraft != this->m_ownAircraft)
|
||||
{
|
||||
this->m_ownAircraft = loadedAircraft;
|
||||
this->ui->comp_MainInfoArea->getFlightPlanComponent()->prefillWithAircraftData(this->m_ownAircraft);
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
/*
|
||||
* Position
|
||||
*/
|
||||
void MainWindow::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude)
|
||||
{
|
||||
CCoordinateGeodetic coordinate(
|
||||
CLatitude::fromWgs84(wgsLatitude),
|
||||
CLongitude::fromWgs84(wgsLongitude),
|
||||
CLength(0, CLengthUnit::m()));
|
||||
|
||||
this->m_ownAircraft.setPosition(coordinate);
|
||||
this->m_ownAircraft.setAltitude(altitude);
|
||||
this->getIContextOwnAircraft()->updateOwnPosition(coordinate, altitude, MainWindow::sampleBlackGuiOriginator());
|
||||
}
|
||||
Reference in New Issue
Block a user