mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
Style
This commit is contained in:
committed by
Mat Sutcliffe
parent
c7b90ae439
commit
19c9a51c38
@@ -63,7 +63,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
bool IContextSimulator::isSimulatorAvailable() const
|
bool IContextSimulator::isSimulatorAvailable() const
|
||||||
{
|
{
|
||||||
return CBuildConfig::isCompiledWithFlightSimulatorSupport() && !getSimulatorPluginInfo().isUnspecified();
|
return CBuildConfig::isCompiledWithFlightSimulatorSupport() && !this->getSimulatorPluginInfo().isUnspecified();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IContextSimulator::isSimulatorSimulating() const
|
bool IContextSimulator::isSimulatorSimulating() const
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ namespace BlackGui
|
|||||||
if (sGui && sGui->supportsContexts() && sGui->getIContextSimulator())
|
if (sGui && sGui->supportsContexts() && sGui->getIContextSimulator())
|
||||||
{
|
{
|
||||||
const CSimulatorPluginInfo pluginInfo = sGui->getIContextSimulator()->getSimulatorPluginInfo();
|
const CSimulatorPluginInfo pluginInfo = sGui->getIContextSimulator()->getSimulatorPluginInfo();
|
||||||
if (!this->isSingleSelection()) { this->setMode(RadioButtons); }
|
if (!this->isSingleSelection()) { this->setMode(RadioButtons); } // only one sim can be connected
|
||||||
|
|
||||||
if (pluginInfo.isValid())
|
if (pluginInfo.isValid())
|
||||||
{
|
{
|
||||||
@@ -319,12 +319,14 @@ namespace BlackGui
|
|||||||
if (this->isSingleSelection())
|
if (this->isSingleSelection())
|
||||||
{
|
{
|
||||||
// single
|
// single
|
||||||
m_currentSimulator.set(this->getValue());
|
const CSimulatorInfo sim = this->getValue();
|
||||||
|
m_currentSimulator.set(sim);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// multiple
|
// multiple
|
||||||
m_currentSimulators.set(this->getValue());
|
const CSimulatorInfo sim = this->getValue();
|
||||||
|
m_currentSimulators.set(sim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ namespace BlackGui
|
|||||||
CStatusMessageList CAircraftIcaoForm::validate(bool nested) const
|
CStatusMessageList CAircraftIcaoForm::validate(bool nested) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(nested);
|
Q_UNUSED(nested);
|
||||||
CAircraftIcaoCode code(getValue());
|
const CAircraftIcaoCode code(this->getValue());
|
||||||
CStatusMessageList msgs(code.validate());
|
const CStatusMessageList msgs(code.validate());
|
||||||
ui->val_Indicator->setState(msgs);
|
ui->val_Indicator->setState(msgs);
|
||||||
return msgs;
|
return msgs;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
#ifndef BLACKGUI_EDITORS_AIRCRAFTICAOFORM_H
|
#ifndef BLACKGUI_EDITORS_AIRCRAFTICAOFORM_H
|
||||||
#define BLACKGUI_EDITORS_AIRCRAFTICAOFORM_H
|
#define BLACKGUI_EDITORS_AIRCRAFTICAOFORM_H
|
||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
|
||||||
#include "blackgui/editors/form.h"
|
#include "blackgui/editors/form.h"
|
||||||
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackmisc/aviation/aircrafticaocode.h"
|
#include "blackmisc/aviation/aircrafticaocode.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
#include "blackmisc/variant.h"
|
#include "blackmisc/variant.h"
|
||||||
@@ -20,8 +20,6 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace Ui { class CAircraftIcaoForm; }
|
namespace Ui { class CAircraftIcaoForm; }
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ namespace BlackGui
|
|||||||
if (coordinate == m_coordinate) { return false; }
|
if (coordinate == m_coordinate) { return false; }
|
||||||
m_coordinate = coordinate;
|
m_coordinate = coordinate;
|
||||||
|
|
||||||
|
|
||||||
const CLatitude lat = coordinate.latitude();
|
const CLatitude lat = coordinate.latitude();
|
||||||
const QString latWgs = lat.toWgs84();
|
const QString latWgs = lat.toWgs84();
|
||||||
ui->le_Latitude->setText(latWgs);
|
ui->le_Latitude->setText(latWgs);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace BlackGui
|
|||||||
explicit CForm(QWidget *parent = nullptr);
|
explicit CForm(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CForm();
|
virtual ~CForm() override;
|
||||||
|
|
||||||
//! Set editable
|
//! Set editable
|
||||||
virtual void setReadOnly(bool readOnly) = 0;
|
virtual void setReadOnly(bool readOnly) = 0;
|
||||||
|
|||||||
@@ -205,9 +205,9 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
void CSimulatorEmulated::setCombinedStatus(bool connected, bool simulating, bool paused)
|
void CSimulatorEmulated::setCombinedStatus(bool connected, bool simulating, bool paused)
|
||||||
{
|
{
|
||||||
m_connected = connected;
|
m_connected = connected;
|
||||||
m_simulating = simulating;
|
m_simulating = simulating;
|
||||||
m_paused = paused;
|
m_paused = paused;
|
||||||
this->emitSimulatorCombinedStatus();
|
this->emitSimulatorCombinedStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,19 +161,19 @@ namespace BlackSimPlugin
|
|||||||
//! \remarks basically does the same as a real driver, obtains data from the interpolator
|
//! \remarks basically does the same as a real driver, obtains data from the interpolator
|
||||||
void updateRemoteAircraft();
|
void updateRemoteAircraft();
|
||||||
|
|
||||||
bool m_log = false; //!< from settings
|
bool m_log = false; //!< from settings
|
||||||
bool m_paused = false;
|
bool m_paused = false;
|
||||||
bool m_connected = true;
|
bool m_connected = true;
|
||||||
bool m_simulating = true;
|
bool m_simulating = true;
|
||||||
bool m_timeSyncronized = false;
|
bool m_timeSyncronized = false;
|
||||||
int m_countInterpolatedSituations = 0;
|
int m_countInterpolatedSituations = 0;
|
||||||
int m_countInterpolatedParts = 0;
|
int m_countInterpolatedParts = 0;
|
||||||
QTimer m_interpolatorFetchTimer; //!< fetch data from interpolator
|
QTimer m_interpolatorFetchTimer; //!< fetch data from interpolator
|
||||||
BlackMisc::PhysicalQuantities::CTime m_offsetTime;
|
BlackMisc::PhysicalQuantities::CTime m_offsetTime;
|
||||||
BlackMisc::Simulation::CSimulatedAircraft m_myAircraft; //!< represents own aircraft of simulator
|
BlackMisc::Simulation::CSimulatedAircraft m_myAircraft; //!< represents own aircraft of simulator
|
||||||
BlackMisc::Simulation::CSimulatedAircraftList m_renderedAircraft; //!< represents remote aircraft in simulator
|
BlackMisc::Simulation::CSimulatedAircraftList m_renderedAircraft; //!< represents remote aircraft in simulator
|
||||||
QScopedPointer<CSimulatorEmulatedMonitorDialog> m_monitorWidget; //!< parent will be main window, so we need to destroy widget when destroyed
|
QScopedPointer<CSimulatorEmulatedMonitorDialog> m_monitorWidget; //!< parent will be main window, so we need to destroy widget when destroyed
|
||||||
BlackMisc::CConnectionGuard m_connectionGuard; //!< connected with provider
|
BlackMisc::CConnectionGuard m_connectionGuard; //!< connected with provider
|
||||||
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TSwiftPlugin> m_pluginSettings { this, &CSimulatorEmulated::onSettingsChanged };
|
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TSwiftPlugin> m_pluginSettings { this, &CSimulatorEmulated::onSettingsChanged };
|
||||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolatorMultiWrapper> m_interpolators; //!< interpolators per callsign
|
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolatorMultiWrapper> m_interpolators; //!< interpolators per callsign
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace BlackSimPlugin
|
|||||||
explicit CSimulatorEmulatedMonitorDialog(CSimulatorEmulated *simulator, QWidget *parent = nullptr);
|
explicit CSimulatorEmulatedMonitorDialog(CSimulatorEmulated *simulator, QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Dtor
|
//! Dtor
|
||||||
virtual ~CSimulatorEmulatedMonitorDialog();
|
virtual ~CSimulatorEmulatedMonitorDialog() override;
|
||||||
|
|
||||||
//! \copydoc BlackGui::Components::CLogComponent::appendStatusMessageToList
|
//! \copydoc BlackGui::Components::CLogComponent::appendStatusMessageToList
|
||||||
void appendStatusMessageToList(const BlackMisc::CStatusMessage &statusMessage);
|
void appendStatusMessageToList(const BlackMisc::CStatusMessage &statusMessage);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tw_SwiftMonitorDialog">
|
<widget class="QTabWidget" name="tw_SwiftMonitorDialog">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tb_AircraftSituation">
|
<widget class="QWidget" name="tb_AircraftSituation">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
if (trace.isValid())
|
if (trace.isValid())
|
||||||
{
|
{
|
||||||
// it can happen the object is not yet
|
// it can happen the object is not yet existing
|
||||||
CSimConnectObject simObject = simulatorFsxP3D->getSimObjectForTrace(trace);
|
CSimConnectObject simObject = simulatorFsxP3D->getSimObjectForTrace(trace);
|
||||||
if (simObject.isInvalid()) { simObject = trace.simObject; } // take the one in the trace
|
if (simObject.isInvalid()) { simObject = trace.simObject; } // take the one in the trace
|
||||||
if (simObject.isValid())
|
if (simObject.isValid())
|
||||||
|
|||||||
Reference in New Issue
Block a user