This commit is contained in:
Klaus Basan
2019-09-10 22:35:57 +02:00
parent 028cf032d7
commit 6352f088ab
11 changed files with 24 additions and 25 deletions

View File

@@ -63,7 +63,7 @@ namespace BlackCore
bool IContextSimulator::isSimulatorAvailable() const
{
return CBuildConfig::isCompiledWithFlightSimulatorSupport() && !getSimulatorPluginInfo().isUnspecified();
return CBuildConfig::isCompiledWithFlightSimulatorSupport() && !this->getSimulatorPluginInfo().isUnspecified();
}
bool IContextSimulator::isSimulatorSimulating() const

View File

@@ -126,7 +126,7 @@ namespace BlackGui
if (sGui && sGui->supportsContexts() && sGui->getIContextSimulator())
{
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())
{
@@ -319,12 +319,14 @@ namespace BlackGui
if (this->isSingleSelection())
{
// single
m_currentSimulator.set(this->getValue());
const CSimulatorInfo sim = this->getValue();
m_currentSimulator.set(sim);
}
else
{
// multiple
m_currentSimulators.set(this->getValue());
const CSimulatorInfo sim = this->getValue();
m_currentSimulators.set(sim);
}
}

View File

@@ -154,8 +154,8 @@ namespace BlackGui
CStatusMessageList CAircraftIcaoForm::validate(bool nested) const
{
Q_UNUSED(nested);
CAircraftIcaoCode code(getValue());
CStatusMessageList msgs(code.validate());
const CAircraftIcaoCode code(this->getValue());
const CStatusMessageList msgs(code.validate());
ui->val_Indicator->setState(msgs);
return msgs;
}

View File

@@ -11,8 +11,8 @@
#ifndef BLACKGUI_EDITORS_AIRCRAFTICAOFORM_H
#define BLACKGUI_EDITORS_AIRCRAFTICAOFORM_H
#include "blackgui/blackguiexport.h"
#include "blackgui/editors/form.h"
#include "blackgui/blackguiexport.h"
#include "blackmisc/aviation/aircrafticaocode.h"
#include "blackmisc/statusmessagelist.h"
#include "blackmisc/variant.h"
@@ -20,8 +20,6 @@
#include <QObject>
#include <QScopedPointer>
class QWidget;
namespace Ui { class CAircraftIcaoForm; }
namespace BlackGui
{

View File

@@ -77,7 +77,6 @@ namespace BlackGui
if (coordinate == m_coordinate) { return false; }
m_coordinate = coordinate;
const CLatitude lat = coordinate.latitude();
const QString latWgs = lat.toWgs84();
ui->le_Latitude->setText(latWgs);

View File

@@ -35,7 +35,7 @@ namespace BlackGui
explicit CForm(QWidget *parent = nullptr);
//! Destructor
virtual ~CForm();
virtual ~CForm() override;
//! Set editable
virtual void setReadOnly(bool readOnly) = 0;

View File

@@ -205,9 +205,9 @@ namespace BlackSimPlugin
void CSimulatorEmulated::setCombinedStatus(bool connected, bool simulating, bool paused)
{
m_connected = connected;
m_connected = connected;
m_simulating = simulating;
m_paused = paused;
m_paused = paused;
this->emitSimulatorCombinedStatus();
}

View File

@@ -161,19 +161,19 @@ namespace BlackSimPlugin
//! \remarks basically does the same as a real driver, obtains data from the interpolator
void updateRemoteAircraft();
bool m_log = false; //!< from settings
bool m_paused = false;
bool m_connected = true;
bool m_log = false; //!< from settings
bool m_paused = false;
bool m_connected = true;
bool m_simulating = true;
bool m_timeSyncronized = false;
int m_countInterpolatedSituations = 0;
int m_countInterpolatedParts = 0;
int m_countInterpolatedParts = 0;
QTimer m_interpolatorFetchTimer; //!< fetch data from interpolator
BlackMisc::PhysicalQuantities::CTime m_offsetTime;
BlackMisc::Simulation::CSimulatedAircraft m_myAircraft; //!< represents own aircraft of 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
BlackMisc::CConnectionGuard m_connectionGuard; //!< connected with provider
BlackMisc::PhysicalQuantities::CTime m_offsetTime;
BlackMisc::Simulation::CSimulatedAircraft m_myAircraft; //!< represents own aircraft of 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
BlackMisc::CConnectionGuard m_connectionGuard; //!< connected with provider
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TSwiftPlugin> m_pluginSettings { this, &CSimulatorEmulated::onSettingsChanged };
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolatorMultiWrapper> m_interpolators; //!< interpolators per callsign
};

View File

@@ -42,7 +42,7 @@ namespace BlackSimPlugin
explicit CSimulatorEmulatedMonitorDialog(CSimulatorEmulated *simulator, QWidget *parent = nullptr);
//! Dtor
virtual ~CSimulatorEmulatedMonitorDialog();
virtual ~CSimulatorEmulatedMonitorDialog() override;
//! \copydoc BlackGui::Components::CLogComponent::appendStatusMessageToList
void appendStatusMessageToList(const BlackMisc::CStatusMessage &statusMessage);

View File

@@ -68,7 +68,7 @@
<item>
<widget class="QTabWidget" name="tw_SwiftMonitorDialog">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tb_AircraftSituation">
<attribute name="title">

View File

@@ -80,7 +80,7 @@ namespace BlackSimPlugin
{
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);
if (simObject.isInvalid()) { simObject = trace.simObject; } // take the one in the trace
if (simObject.isValid())