mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 21:05:34 +08:00
refs #335, SELCAL tweaks discovered during refactoring
* better case handling in SELCAL * SELCAL in aircraft * SELCAL selector, improved getter / setters * changed cockpit SELCAL elements to promoted GUI element * synchronized flightplan and cockpit SELCAL codes, used new signal/slot syntacs in flightplan * added SELCAL in own aircraft context
This commit is contained in:
committed by
Roland Winklmeier
parent
dd587207fe
commit
0c6f5f1777
@@ -16,6 +16,7 @@
|
||||
#include "blackmisc/avaircraft.h"
|
||||
#include "blackmisc/avatcstation.h"
|
||||
#include "blackmisc/voiceroomlist.h"
|
||||
#include "blackmisc/avselcal.h"
|
||||
|
||||
//! \addtogroup dbus
|
||||
//! @{
|
||||
@@ -79,6 +80,10 @@ namespace BlackCore
|
||||
//! \remarks DBus and local
|
||||
void changedAircraftCockpit(const BlackMisc::Aviation::CAircraft &aircraft, const QString &originator);
|
||||
|
||||
//! Changed SELCAL code
|
||||
//! \remarks DBus and local
|
||||
void changedSelcal(const BlackMisc::Aviation::CSelcal &selcal, const QString &originator);
|
||||
|
||||
public slots:
|
||||
|
||||
//! Get own aircraft
|
||||
@@ -99,6 +104,9 @@ namespace BlackCore
|
||||
//! Set current pilot
|
||||
virtual bool updatePilot(const BlackMisc::Network::CUser &pilot, const QString &originator) = 0;
|
||||
|
||||
//! Own SELCAL code
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const QString &originator) = 0;
|
||||
|
||||
//! Output volumes, volumes 0..100
|
||||
virtual void setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2) = 0;
|
||||
|
||||
|
||||
@@ -176,12 +176,20 @@ namespace BlackCore
|
||||
|
||||
bool CContextOwnAircraft::updatePilot(const CUser &pilot, const QString &originator)
|
||||
{
|
||||
if (this->m_ownAircraft.getPilot() == pilot) return false;
|
||||
if (this->m_ownAircraft.getPilot() == pilot) { return false; }
|
||||
this->m_ownAircraft.setPilot(pilot);
|
||||
emit this->changedAircraft(this->m_ownAircraft, originator);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CContextOwnAircraft::updateSelcal(const CSelcal &selcal, const QString &originator)
|
||||
{
|
||||
if (this->m_ownAircraft.getSelcal() == selcal) { return false; }
|
||||
this->m_ownAircraft.setSelcal(selcal);
|
||||
emit this->changedSelcal(selcal, originator);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CContextOwnAircraft::setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2)
|
||||
{
|
||||
CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << outputVolumeCom1 << outputVolumeCom2;
|
||||
|
||||
@@ -58,6 +58,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextOwnAircraft::updatePilot()
|
||||
virtual bool updatePilot(const BlackMisc::Network::CUser &pilot, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::updateSelcal
|
||||
virtual bool updateSelcal(const Aviation::CSelcal &selcal, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::setAudioOutputVolumes
|
||||
virtual void setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2) override;
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ namespace BlackCore
|
||||
bool s = connection.connect(serviceName, IContextOwnAircraft::ObjectPath(), IContextOwnAircraft::InterfaceName(),
|
||||
"changedAircraftCockpit", this, SIGNAL(changedAircraftCockpit(BlackMisc::Aviation::CAircraft, QString)));
|
||||
Q_ASSERT(s);
|
||||
s = connection.connect(serviceName, IContextOwnAircraft::ObjectPath(), IContextOwnAircraft::InterfaceName(),
|
||||
"changedSelcal", this, SIGNAL(changedSelcal(BlackMisc::Aviation::CSelcal, QString)));
|
||||
Q_ASSERT(s);
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
|
||||
@@ -63,6 +66,11 @@ namespace BlackCore
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("updatePilot"), pilot, originator);
|
||||
}
|
||||
|
||||
bool CContextOwnAircraftProxy::updateSelcal(const Aviation::CSelcal &selcal, const QString &originator)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("updateSelcal"), selcal, originator);
|
||||
}
|
||||
|
||||
void CContextOwnAircraftProxy::setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2)
|
||||
{
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("updateOwnCockpitOutputVolumes"), outputVolumeCom1, outputVolumeCom2);
|
||||
|
||||
@@ -64,6 +64,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextOwnAircraft::updatePilot()
|
||||
virtual bool updatePilot(const BlackMisc::Network::CUser &pilot, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::updateSelcal
|
||||
virtual bool updateSelcal(const Aviation::CSelcal &selcal, const QString &originator) override;
|
||||
|
||||
//! \copydoc IContextOwnAircraft::setAudioOutputVolumes
|
||||
virtual void setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user