mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refs #441 Rename COriginator to CIdentifier and rename COriginatorAware to CIdentifiable.
This commit is contained in:
@@ -29,7 +29,7 @@ namespace BlackGui
|
||||
{
|
||||
CAtcStationComponent::CAtcStationComponent(QWidget *parent) :
|
||||
QTabWidget(parent),
|
||||
COriginatorAware(this),
|
||||
CIdentifiable(this),
|
||||
ui(new Ui::CAtcStationComponent),
|
||||
m_updateTimer(new CUpdateTimer("CAtcStationComponent", &CAtcStationComponent::update, this))
|
||||
{
|
||||
@@ -257,7 +257,7 @@ namespace BlackGui
|
||||
{
|
||||
if (unit != CComSystem::Com1 && unit != CComSystem::Com2) { return; }
|
||||
if (!CComSystem::isValidComFrequency(frequency)) { return; }
|
||||
this->getIContextOwnAircraft()->updateActiveComFrequency(frequency, static_cast<int>(unit), originator());
|
||||
this->getIContextOwnAircraft()->updateActiveComFrequency(frequency, static_cast<int>(unit), identifier());
|
||||
}
|
||||
|
||||
void CAtcStationComponent::updateTreeView()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "blackgui/components/enableforruntime.h"
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackgui/components/updatetimer.h"
|
||||
#include "blackmisc/originatoraware.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
#include "blackmisc/aviation/atcstation.h"
|
||||
#include <QTabWidget>
|
||||
#include <QModelIndex>
|
||||
@@ -33,7 +33,7 @@ namespace BlackGui
|
||||
public QTabWidget,
|
||||
public CEnableForDockWidgetInfoArea,
|
||||
public CEnableForRuntime,
|
||||
public BlackMisc::COriginatorAware
|
||||
public BlackMisc::CIdentifiable
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackGui
|
||||
{
|
||||
CCockpitComComponent::CCockpitComComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
BlackMisc::COriginatorAware(this),
|
||||
BlackMisc::CIdentifiable(this),
|
||||
ui(new Ui::CCockpitMainComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -63,7 +63,7 @@ namespace BlackGui
|
||||
|
||||
// init from aircraft
|
||||
CAircraft ownAircraft = this->getOwnAircraft();
|
||||
this->ps_updateCockpitFromContext(ownAircraft, COriginator("dummyInitialValues")); // intentionally different name here
|
||||
this->ps_updateCockpitFromContext(ownAircraft, CIdentifier("dummyInitialValues")); // intentionally different name here
|
||||
|
||||
// SELCAL pairs in cockpit
|
||||
this->ui->frp_ComPanelSelcalBottom->clear();
|
||||
@@ -112,12 +112,12 @@ namespace BlackGui
|
||||
|
||||
void CCockpitComComponent::ps_guiChangedSelcal()
|
||||
{
|
||||
this->getIContextOwnAircraft()->updateSelcal(this->getSelcal(), originator());
|
||||
this->getIContextOwnAircraft()->updateSelcal(this->getSelcal(), identifier());
|
||||
}
|
||||
|
||||
void CCockpitComComponent::ps_updateCockpitFromContext(const CAircraft &ownAircraft, const COriginator &originator)
|
||||
void CCockpitComComponent::ps_updateCockpitFromContext(const CAircraft &ownAircraft, const CIdentifier &originator)
|
||||
{
|
||||
if (isMyOriginator(originator)) { return; } // comes from myself
|
||||
if (isMyIdentifier(originator)) { return; } // comes from myself
|
||||
|
||||
// update GUI elements
|
||||
// avoid unnecessary change events as far as possible
|
||||
@@ -183,9 +183,9 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CCockpitComComponent::ps_onChangedSelcal(const CSelcal &selcal, const COriginator &originator)
|
||||
void CCockpitComComponent::ps_onChangedSelcal(const CSelcal &selcal, const CIdentifier &originator)
|
||||
{
|
||||
if (isMyOriginator(originator)) { return; } // comes from myself
|
||||
if (isMyIdentifier(originator)) { return; } // comes from myself
|
||||
this->ui->frp_ComPanelSelcalBottom->setSelcalCode(selcal);
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace BlackGui
|
||||
|
||||
bool CCockpitComComponent::updateOwnCockpitInContext(const CAircraft &ownAircraft)
|
||||
{
|
||||
return this->getIContextOwnAircraft()->updateCockpit(ownAircraft.getCom1System(), ownAircraft.getCom2System(), ownAircraft.getTransponder(), originator());
|
||||
return this->getIContextOwnAircraft()->updateCockpit(ownAircraft.getCom1System(), ownAircraft.getCom2System(), ownAircraft.getTransponder(), identifier());
|
||||
}
|
||||
|
||||
void CCockpitComComponent::updateFrequencyDisplaysFromComSystems(const CComSystem &com1, const CComSystem &com2)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "enablefordockwidgetinfoarea.h"
|
||||
#include "enableforruntime.h"
|
||||
#include "blackmisc/originatoraware.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
#include "blackmisc/aviation/aircraft.h"
|
||||
#include "blackmisc/aviation/transponder.h"
|
||||
#include "blackmisc/audio/voiceroomlist.h"
|
||||
@@ -29,7 +29,7 @@ namespace BlackGui
|
||||
//! The main cockpit area
|
||||
class BLACKGUI_EXPORT CCockpitComComponent :
|
||||
public QFrame,
|
||||
public BlackMisc::COriginatorAware,
|
||||
public BlackMisc::CIdentifiable,
|
||||
public CEnableForDockWidgetInfoArea,
|
||||
public CEnableForRuntime
|
||||
{
|
||||
@@ -68,13 +68,13 @@ namespace BlackGui
|
||||
void ps_guiChangedSelcal();
|
||||
|
||||
//! Update cockpit from context
|
||||
void ps_updateCockpitFromContext(const BlackMisc::Aviation::CAircraft &ownAircraft, const BlackMisc::COriginator &originator);
|
||||
void ps_updateCockpitFromContext(const BlackMisc::Aviation::CAircraft &ownAircraft, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Cockpit values have been changed in GUI
|
||||
void ps_testSelcal();
|
||||
|
||||
//! SELCAL was changed
|
||||
void ps_onChangedSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::COriginator &originator);
|
||||
void ps_onChangedSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Update voice room related information
|
||||
void ps_onChangedVoiceRoomStatus(const BlackMisc::Audio::CVoiceRoomList &selectedVoiceRooms, bool connected);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace BlackGui
|
||||
{
|
||||
CCockpitTransponderModeLedsComponent::CCockpitTransponderModeLedsComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
COriginatorAware(this),
|
||||
CIdentifiable(this),
|
||||
m_ledStandby(new CLedWidget(false, CLedWidget::Blue, CLedWidget::Black, CLedWidget::Rounded, "standby", "", LedWidth, this)),
|
||||
m_ledModes(new CLedWidget(false, CLedWidget::Green, CLedWidget::Black, CLedWidget::Rounded, "mode C", "", LedWidth, this)),
|
||||
m_ledIdent(new CLedWidget(false, CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Rounded, "ident", "", LedWidth, this))
|
||||
@@ -37,9 +37,9 @@ namespace BlackGui
|
||||
this->setMode(getOwnTransponder().getTransponderMode());
|
||||
}
|
||||
|
||||
void CCockpitTransponderModeLedsComponent::ps_onAircraftCockpitChanged(const CAircraft &aircraft, const BlackMisc::COriginator &originator)
|
||||
void CCockpitTransponderModeLedsComponent::ps_onAircraftCockpitChanged(const CAircraft &aircraft, const BlackMisc::CIdentifier &originator)
|
||||
{
|
||||
if (isMyOriginator(originator)) { return; }
|
||||
if (isMyIdentifier(originator)) { return; }
|
||||
this->setMode(aircraft.getTransponderMode());
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace BlackGui
|
||||
this->setMode(mode);
|
||||
CTransponder xpdr = ownAircraft.getTransponder();
|
||||
xpdr.setTransponderMode(mode);
|
||||
this->getIContextOwnAircraft()->updateCockpit(ownAircraft.getCom1System(), ownAircraft.getCom2System(), xpdr, originator());
|
||||
this->getIContextOwnAircraft()->updateCockpit(ownAircraft.getCom1System(), ownAircraft.getCom2System(), xpdr, identifier());
|
||||
}
|
||||
|
||||
void CCockpitTransponderModeLedsComponent::init(bool horizontal)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "enableforruntime.h"
|
||||
#include "../led.h"
|
||||
#include "blackmisc/originatoraware.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
#include "blackmisc/aviation/aircraft.h"
|
||||
#include "blackmisc/aviation/transponder.h"
|
||||
#include <QFrame>
|
||||
@@ -29,7 +29,7 @@ namespace BlackGui
|
||||
class BLACKGUI_EXPORT CCockpitTransponderModeLedsComponent :
|
||||
public QFrame,
|
||||
public CEnableForRuntime,
|
||||
public BlackMisc::COriginatorAware
|
||||
public BlackMisc::CIdentifiable
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace BlackGui
|
||||
|
||||
private slots:
|
||||
//! \copydoc IContextOwnAircraft::changedAircraftCockpit
|
||||
void ps_onAircraftCockpitChanged(const BlackMisc::Aviation::CAircraft &aircraft, const BlackMisc::COriginator &originator);
|
||||
void ps_onAircraftCockpitChanged(const BlackMisc::Aviation::CAircraft &aircraft, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! LED clicked
|
||||
void ps_onLedClicked();
|
||||
|
||||
@@ -324,7 +324,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!this->getIContextOwnAircraft()) return;
|
||||
if (!this->ui->frp_SelcalCode->hasValidCode()) return;
|
||||
this->getIContextOwnAircraft()->updateSelcal(this->ui->frp_SelcalCode->getSelcal(), flightPlanOriginator());
|
||||
this->getIContextOwnAircraft()->updateSelcal(this->ui->frp_SelcalCode->getSelcal(), flightPlanIdentifier());
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::ps_loadFlightPlanFromNetwork()
|
||||
@@ -417,12 +417,12 @@ namespace BlackGui
|
||||
this->setCurrentWidget(this->ui->tb_RemarksGenerator);
|
||||
}
|
||||
|
||||
COriginator CFlightPlanComponent::flightPlanOriginator()
|
||||
CIdentifier CFlightPlanComponent::flightPlanIdentifier()
|
||||
{
|
||||
if (m_originator.getName().isEmpty())
|
||||
m_originator = COriginator(QStringLiteral("FLIGHTPLANCOMPONENT"));
|
||||
if (m_identifier.getName().isEmpty())
|
||||
m_identifier = CIdentifier(QStringLiteral("FLIGHTPLANCOMPONENT"));
|
||||
|
||||
return m_originator;
|
||||
return m_identifier;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/components/enableforruntime.h"
|
||||
#include "blackmisc/originator.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/aviation/aircraft.h"
|
||||
#include "blackmisc/aviation/flightplan.h"
|
||||
|
||||
@@ -66,8 +66,8 @@ namespace BlackGui
|
||||
//! Validate, generates status messages
|
||||
BlackMisc::CStatusMessageList validateAndInitializeFlightPlan(BlackMisc::Aviation::CFlightPlan &fligtPlan);
|
||||
|
||||
//! Flightplan originator
|
||||
BlackMisc::COriginator m_originator;
|
||||
//! Flightplan identifier
|
||||
BlackMisc::CIdentifier m_identifier;
|
||||
|
||||
//! Default value for airport ICAO airports
|
||||
static const QString &defaultIcao() { static QString d("ICAO"); return d; }
|
||||
@@ -75,8 +75,8 @@ namespace BlackGui
|
||||
//! Default value for time
|
||||
static const QString &defaultTime() { static QString t("00:00"); return t; }
|
||||
|
||||
//! Originator
|
||||
BlackMisc::COriginator flightPlanOriginator();
|
||||
//! Identifier
|
||||
BlackMisc::CIdentifier flightPlanIdentifier();
|
||||
|
||||
private slots:
|
||||
//! Call \sa ps_buildRemarksString from combo box signal
|
||||
|
||||
@@ -156,11 +156,11 @@ namespace BlackGui
|
||||
{
|
||||
QString c(this->ui->le_CommandLineInput->text().trimmed().simplified());
|
||||
if (c.isEmpty()) { return; }
|
||||
emit this->commandEntered(c, keypadOriginator());
|
||||
emit this->commandEntered(c, keypadIdentifier());
|
||||
this->ui->le_CommandLineInput->clear();
|
||||
}
|
||||
|
||||
void CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged(const CAircraft &aircraft, const COriginator &originator)
|
||||
void CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged(const CAircraft &aircraft, const CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
bool ident = aircraft.getTransponder().getTransponderMode() == CTransponder::StateIdent;
|
||||
@@ -238,12 +238,12 @@ namespace BlackGui
|
||||
ui->pb_MainWeather->setChecked(false);
|
||||
}
|
||||
|
||||
COriginator CMainKeypadAreaComponent::keypadOriginator()
|
||||
CIdentifier CMainKeypadAreaComponent::keypadIdentifier()
|
||||
{
|
||||
if (m_originator.getName().isEmpty())
|
||||
m_originator = COriginator(QStringLiteral("KEYPADAREACOMPONENT"));
|
||||
if (m_identifier.getName().isEmpty())
|
||||
m_identifier = CIdentifier(QStringLiteral("KEYPADAREACOMPONENT"));
|
||||
|
||||
return m_originator;
|
||||
return m_identifier;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "maininfoareacomponent.h"
|
||||
#include "enableforruntime.h"
|
||||
#include "blackmisc/originator.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/aviation/aircraft.h"
|
||||
|
||||
#include <QFrame>
|
||||
@@ -44,8 +44,8 @@ namespace BlackGui
|
||||
//! Destructor
|
||||
~CMainKeypadAreaComponent();
|
||||
|
||||
//! Originator
|
||||
BlackMisc::COriginator keypadOriginator();
|
||||
//! Identifier
|
||||
BlackMisc::CIdentifier keypadIdentifier();
|
||||
|
||||
signals:
|
||||
//! Button to select main info area has been pressed
|
||||
@@ -56,7 +56,7 @@ namespace BlackGui
|
||||
void changedOpacity(int opacity);
|
||||
|
||||
//! Command was entered
|
||||
void commandEntered(const QString &commandLine, const BlackMisc::COriginator &originator);
|
||||
void commandEntered(const QString &commandLine, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Connect was pressed
|
||||
void connectPressed();
|
||||
@@ -83,7 +83,7 @@ namespace BlackGui
|
||||
void ps_commandEntered();
|
||||
|
||||
//! \copydoc BlackCore::IContextOwnAircraft::changedAircraftCockpit
|
||||
void ps_ownAircraftCockpitChanged(const BlackMisc::Aviation::CAircraft &aircraft, const BlackMisc::COriginator &originator);
|
||||
void ps_ownAircraftCockpitChanged(const BlackMisc::Aviation::CAircraft &aircraft, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! \copydoc BlackCore::IContextAudio::changedMute
|
||||
void ps_muteChanged(bool muted);
|
||||
@@ -102,7 +102,7 @@ namespace BlackGui
|
||||
void unsetInfoAreaButtons();
|
||||
|
||||
QScopedPointer<Ui::CMainKeypadAreaComponent> ui;
|
||||
BlackMisc::COriginator m_originator;
|
||||
BlackMisc::CIdentifier m_identifier;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace BlackGui
|
||||
bool enabled = sa.propertyByIndex(index).toBool();
|
||||
if (saFromBackend.isEnabled() == enabled) { return; }
|
||||
CLogMessage(this).info("Request to %1 aircraft %2") << (enabled ? "enable" : "disable") << saFromBackend.getCallsign().toQString();
|
||||
this->getIContextNetwork()->updateAircraftEnabled(saFromBackend.getCallsign(), enabled, mappingtOriginator());
|
||||
this->getIContextNetwork()->updateAircraftEnabled(saFromBackend.getCallsign(), enabled, mappingIdentifier());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -256,12 +256,12 @@ namespace BlackGui
|
||||
CAircraftModel model(models.front());
|
||||
model.setModelType(CAircraftModel::TypeManuallySet);
|
||||
CLogMessage(this).info("Requesting changes for %1") << callsign.asString();
|
||||
this->getIContextNetwork()->updateAircraftModel(aircraftFromBackend.getCallsign(), model, mappingtOriginator());
|
||||
this->getIContextNetwork()->updateAircraftModel(aircraftFromBackend.getCallsign(), model, mappingIdentifier());
|
||||
changed = true;
|
||||
}
|
||||
if (aircraftFromBackend.isEnabled() != enabled)
|
||||
{
|
||||
this->getIContextNetwork()->updateAircraftEnabled(aircraftFromBackend.getCallsign(), enabled, mappingtOriginator());
|
||||
this->getIContextNetwork()->updateAircraftEnabled(aircraftFromBackend.getCallsign(), enabled, mappingIdentifier());
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -308,21 +308,21 @@ namespace BlackGui
|
||||
this->ui->le_AircraftModel->setCompleter(this->m_modelCompleter);
|
||||
}
|
||||
|
||||
void CMappingComponent::ps_onRemoteAircraftModelChanged(const CSimulatedAircraft &aircraft, const COriginator &originator)
|
||||
void CMappingComponent::ps_onRemoteAircraftModelChanged(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
|
||||
{
|
||||
this->updateSimulatedAircraftView();
|
||||
Q_UNUSED(originator);
|
||||
Q_UNUSED(aircraft);
|
||||
}
|
||||
|
||||
void CMappingComponent::ps_onChangedAircraftEnabled(const CSimulatedAircraft &aircraft, const COriginator &originator)
|
||||
void CMappingComponent::ps_onChangedAircraftEnabled(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
|
||||
{
|
||||
this->updateSimulatedAircraftView();
|
||||
Q_UNUSED(originator);
|
||||
Q_UNUSED(aircraft);
|
||||
}
|
||||
|
||||
void CMappingComponent::ps_onFastPositionUpdatesEnabled(const CSimulatedAircraft &aircraft, const COriginator &originator)
|
||||
void CMappingComponent::ps_onFastPositionUpdatesEnabled(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
|
||||
{
|
||||
this->updateSimulatedAircraftView();
|
||||
Q_UNUSED(originator);
|
||||
@@ -349,7 +349,7 @@ namespace BlackGui
|
||||
{
|
||||
if (getIContextNetwork())
|
||||
{
|
||||
getIContextNetwork()->updateFastPositionEnabled(aircraft.getCallsign(), aircraft.fastPositionUpdates(), mappingtOriginator());
|
||||
getIContextNetwork()->updateFastPositionEnabled(aircraft.getCallsign(), aircraft.fastPositionUpdates(), mappingIdentifier());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace BlackGui
|
||||
{
|
||||
if (getIContextNetwork())
|
||||
{
|
||||
getIContextNetwork()->updateAircraftEnabled(aircraft.getCallsign(), aircraft.isEnabled(), mappingtOriginator());
|
||||
getIContextNetwork()->updateAircraftEnabled(aircraft.getCallsign(), aircraft.isEnabled(), mappingIdentifier());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,12 +378,12 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
COriginator CMappingComponent::mappingtOriginator()
|
||||
CIdentifier CMappingComponent::mappingIdentifier()
|
||||
{
|
||||
if (m_originator.getName().isEmpty())
|
||||
m_originator = COriginator(QStringLiteral("MAPPINGCOMPONENT"));
|
||||
if (m_identifier.getName().isEmpty())
|
||||
m_identifier = CIdentifier(QStringLiteral("MAPPINGCOMPONENT"));
|
||||
|
||||
return m_originator;
|
||||
return m_identifier;
|
||||
}
|
||||
|
||||
void CMappingComponent::updateSimulatedAircraftView(bool forceUpdate)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackgui/components/updatetimer.h"
|
||||
#include "blackgui/views/checkboxdelegate.h"
|
||||
#include "blackmisc/originator.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include <QTabWidget>
|
||||
@@ -95,13 +95,13 @@ namespace BlackGui
|
||||
void ps_onModelsUpdateRequested();
|
||||
|
||||
//! Rendered aircraft changed in backend
|
||||
void ps_onRemoteAircraftModelChanged(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::COriginator &originator);
|
||||
void ps_onRemoteAircraftModelChanged(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Aircraft enabled, disabled in backend
|
||||
void ps_onChangedAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::COriginator &originator);
|
||||
void ps_onChangedAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Fast position updates on/off in backend
|
||||
void ps_onFastPositionUpdatesEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::COriginator &originator);
|
||||
void ps_onFastPositionUpdatesEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Connection status has been changed
|
||||
void ps_onConnectionStatusChanged(uint from, uint to);
|
||||
@@ -122,14 +122,14 @@ namespace BlackGui
|
||||
void ps_onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
private:
|
||||
BlackMisc::COriginator mappingtOriginator();
|
||||
BlackMisc::CIdentifier mappingIdentifier();
|
||||
void updateSimulatedAircraftView(bool forceUpdate = false);
|
||||
QScopedPointer<Ui::CMappingComponent> ui;
|
||||
QScopedPointer<CUpdateTimer> m_updateTimer;
|
||||
QCompleter *m_modelCompleter = nullptr;
|
||||
bool m_missedSimulatedAircraftUpdate = true;
|
||||
BlackGui::Views::CCheckBoxDelegate *m_currentMappingsViewDelegate = nullptr;
|
||||
BlackMisc::COriginator m_originator;
|
||||
BlackMisc::CIdentifier m_identifier;
|
||||
|
||||
private slots:
|
||||
void ps_backgroundUpdate();
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Views::COriginatorView" name="tvp_RegisteredComponents">
|
||||
<widget class="BlackGui::Views::CIdentifierView" name="tvp_RegisteredComponents">
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
@@ -43,9 +43,9 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Views::COriginatorView</class>
|
||||
<class>BlackGui::Views::CIdentifierView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/originatorview.h</header>
|
||||
<header>blackgui/views/identifierview.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
||||
@@ -148,12 +148,12 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
COriginator CTextMessageComponent::componentOriginator()
|
||||
CIdentifier CTextMessageComponent::componentIdentifier()
|
||||
{
|
||||
if (m_originator.getName().isEmpty())
|
||||
m_originator = COriginator(QStringLiteral("TEXTMESSAGECOMPONENT"));
|
||||
if (m_identifier.getName().isEmpty())
|
||||
m_identifier = CIdentifier(QStringLiteral("TEXTMESSAGECOMPONENT"));
|
||||
|
||||
return m_originator;
|
||||
return m_identifier;
|
||||
}
|
||||
|
||||
void CTextMessageComponent::ps_onChangedAircraftCockpit()
|
||||
@@ -366,7 +366,7 @@ namespace BlackGui
|
||||
|
||||
// relay the command
|
||||
if (cl.isEmpty()) { return; }
|
||||
emit commandEntered(cl, componentOriginator());
|
||||
emit commandEntered(cl, componentIdentifier());
|
||||
}
|
||||
|
||||
QString CTextMessageComponent::textMessageToCommand(const QString &enteredLine)
|
||||
@@ -433,9 +433,9 @@ namespace BlackGui
|
||||
this->displayTextMessage(sentMessage);
|
||||
}
|
||||
|
||||
bool CTextMessageComponent::handleGlobalCommandLine(const QString &commandLine, const COriginator &originator)
|
||||
bool CTextMessageComponent::handleGlobalCommandLine(const QString &commandLine, const CIdentifier &originator)
|
||||
{
|
||||
if (originator == componentOriginator()) { return false; }
|
||||
if (originator == componentIdentifier()) { return false; }
|
||||
if (commandLine.isEmpty() || commandLine.startsWith(".")) { return false; }
|
||||
|
||||
// non command input
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "blackgui/components/enableforruntime.h"
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackgui/textmessagetextedit.h"
|
||||
#include "blackmisc/originator.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/network/textmessage.h"
|
||||
#include "blackmisc/aviation/aircraft.h"
|
||||
#include "blackmisc/network/textmessagelist.h"
|
||||
@@ -60,7 +60,7 @@ namespace BlackGui
|
||||
void displayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs) const;
|
||||
|
||||
//! Command line was entered
|
||||
void commandEntered(const QString commandLine, const BlackMisc::COriginator &orignator);
|
||||
void commandEntered(const QString commandLine, const BlackMisc::CIdentifier &orignator);
|
||||
|
||||
public slots:
|
||||
//! Text messages received
|
||||
@@ -70,7 +70,7 @@ namespace BlackGui
|
||||
void onTextMessageSent(const BlackMisc::Network::CTextMessage &sentMessage);
|
||||
|
||||
//! Used to allow direct input from global command line when visible
|
||||
bool handleGlobalCommandLine(const QString &commandLine, const BlackMisc::COriginator &originator);
|
||||
bool handleGlobalCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Display the tab for given callsign
|
||||
void showCorrespondingTab(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
@@ -81,7 +81,7 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CTextMessageComponent> ui;
|
||||
BlackMisc::COriginator m_originator;
|
||||
BlackMisc::CIdentifier m_identifier;
|
||||
|
||||
//! Enum to widget
|
||||
QWidget *getTabWidget(Tab tab) const;
|
||||
@@ -124,8 +124,8 @@ namespace BlackGui
|
||||
//! \copydoc IContextOwnAircraft::parseCommandLine
|
||||
QString textMessageToCommand(const QString &enteredLine);
|
||||
|
||||
//! Originator
|
||||
BlackMisc::COriginator componentOriginator();
|
||||
//! Identifier
|
||||
BlackMisc::CIdentifier componentIdentifier();
|
||||
|
||||
//! Handle a text message entered
|
||||
void handleEnteredTextMessage(const QString &textMessage);
|
||||
|
||||
Reference in New Issue
Block a user