mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
@@ -38,14 +38,10 @@ namespace BlackCore
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief Constructor
|
||||
*/
|
||||
//! \brief Constructor
|
||||
CContextVoice(CCoreRuntime *runtime);
|
||||
|
||||
/*!
|
||||
* \brief Destructor
|
||||
*/
|
||||
//! \brief Destructor
|
||||
virtual ~CContextVoice();
|
||||
|
||||
/*!
|
||||
@@ -57,129 +53,81 @@ namespace BlackCore
|
||||
server->addObject(IContextVoice::ServicePath(), this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Runtime
|
||||
*/
|
||||
//! \brief Runtime
|
||||
const CCoreRuntime *getRuntime() const
|
||||
{
|
||||
return static_cast<CCoreRuntime *>(this->parent());
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Using local objects?
|
||||
*/
|
||||
//! \brief Using local objects?
|
||||
virtual bool usingLocalObjects() const { return true; }
|
||||
|
||||
public slots:
|
||||
/*!
|
||||
* \copydoc IContextVoice::setOwnAircraft
|
||||
*/
|
||||
virtual void setOwnAircraft(const BlackMisc::Aviation::CAircraft &ownAircraft);
|
||||
//! \copydoc IContextVoice::setOwnAircraft
|
||||
virtual void setOwnAircraft(const BlackMisc::Aviation::CAircraft &ownAircraft) override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getComVoiceRooms()
|
||||
*/
|
||||
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRooms() const;
|
||||
//! \copydoc IContextVoice::getComVoiceRooms()
|
||||
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRooms() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getComVoiceRoomsWithAudioStatus()
|
||||
*/
|
||||
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRoomsWithAudioStatus() const;
|
||||
//! \copydoc IContextVoice::getComVoiceRoomsWithAudioStatus()
|
||||
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRoomsWithAudioStatus() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getCom1VoiceRoom
|
||||
*/
|
||||
virtual BlackMisc::Voice::CVoiceRoom getCom1VoiceRoom(bool withAudioStatus) const;
|
||||
//! \copydoc IContextVoice::getCom1VoiceRoom
|
||||
virtual BlackMisc::Voice::CVoiceRoom getCom1VoiceRoom(bool withAudioStatus) const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getCom2VoiceRoom
|
||||
*/
|
||||
virtual BlackMisc::Voice::CVoiceRoom getCom2VoiceRoom(bool withAudioStatus) const;
|
||||
//! \copydoc IContextVoice::getCom2VoiceRoom
|
||||
virtual BlackMisc::Voice::CVoiceRoom getCom2VoiceRoom(bool withAudioStatus) const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::setComVoiceRooms()
|
||||
*/
|
||||
virtual void setComVoiceRooms(const BlackMisc::Voice::CVoiceRoom &voiceRoomCom1, const BlackMisc::Voice::CVoiceRoom &voiceRoomCom2);
|
||||
//! \copydoc IContextVoice::setComVoiceRooms()
|
||||
virtual void setComVoiceRooms(const BlackMisc::Voice::CVoiceRoom &voiceRoomCom1, const BlackMisc::Voice::CVoiceRoom &voiceRoomCom2) override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getCom1RoomCallsigns()
|
||||
*/
|
||||
virtual BlackMisc::Aviation::CCallsignList getCom1RoomCallsigns() const;
|
||||
//! \copydoc IContextVoice::getCom1RoomCallsigns()
|
||||
virtual BlackMisc::Aviation::CCallsignList getCom1RoomCallsigns() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getCom2RoomCallsigns()
|
||||
*/
|
||||
virtual BlackMisc::Aviation::CCallsignList getCom2RoomCallsigns() const;
|
||||
//! \copydoc IContextVoice::getCom2RoomCallsigns()
|
||||
virtual BlackMisc::Aviation::CCallsignList getCom2RoomCallsigns() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getCom1RoomUsers()
|
||||
*/
|
||||
virtual BlackMisc::Network::CUserList getCom1RoomUsers() const;
|
||||
//! \copydoc IContextVoice::getCom1RoomUsers()
|
||||
virtual BlackMisc::Network::CUserList getCom1RoomUsers() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getCom2RoomUsers()
|
||||
*/
|
||||
virtual BlackMisc::Network::CUserList getCom2RoomUsers() const;
|
||||
//! \copydoc IContextVoice::getCom2RoomUsers()
|
||||
virtual BlackMisc::Network::CUserList getCom2RoomUsers() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::leaveAllVoiceRooms
|
||||
*/
|
||||
virtual void leaveAllVoiceRooms();
|
||||
//! \copydoc IContextVoice::leaveAllVoiceRooms
|
||||
virtual void leaveAllVoiceRooms() override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getAudioDevices()
|
||||
*/
|
||||
virtual BlackMisc::Voice::CAudioDeviceList getAudioDevices() const;
|
||||
//! \copydoc IContextVoice::getAudioDevices()
|
||||
virtual BlackMisc::Voice::CAudioDeviceList getAudioDevices() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getCurrentAudioDevices()
|
||||
*/
|
||||
virtual BlackMisc::Voice::CAudioDeviceList getCurrentAudioDevices() const;
|
||||
//! \copydoc IContextVoice::getCurrentAudioDevices()
|
||||
virtual BlackMisc::Voice::CAudioDeviceList getCurrentAudioDevices() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::setCurrentAudioDevice()
|
||||
*/
|
||||
virtual void setCurrentAudioDevice(const BlackMisc::Voice::CAudioDevice &audioDevice);
|
||||
//! \copydoc IContextVoice::setCurrentAudioDevice()
|
||||
virtual void setCurrentAudioDevice(const BlackMisc::Voice::CAudioDevice &audioDevice) override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::setVolumes()
|
||||
*/
|
||||
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2);
|
||||
//! \copydoc IContextVoice::setVolumes()
|
||||
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2) override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::isMuted()
|
||||
*/
|
||||
virtual bool isMuted() const;
|
||||
//! \copydoc IContextVoice::isMuted()
|
||||
virtual bool isMuted() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::playSelcalTone()
|
||||
*/
|
||||
virtual void playSelcalTone(const BlackMisc::Aviation::CSelcal &selcal) const;
|
||||
//! \copydoc IContextVoice::playSelcalTone()
|
||||
virtual void playSelcalTone(const BlackMisc::Aviation::CSelcal &selcal) const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::playNotification()
|
||||
*/
|
||||
virtual void playNotification(uint notification) const;
|
||||
//! \copydoc IContextVoice::playNotification()
|
||||
virtual void playNotification(uint notification) const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::runMicrophoneTest()
|
||||
*/
|
||||
virtual void runMicrophoneTest();
|
||||
//! \copydoc IContextVoice::runMicrophoneTest()
|
||||
virtual void runMicrophoneTest() override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::runSquelchTest()
|
||||
*/
|
||||
virtual void runSquelchTest();
|
||||
//! \copydoc IContextVoice::runSquelchTest()
|
||||
virtual void runSquelchTest() override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getMicrophoneTestResult()
|
||||
*/
|
||||
virtual QString getMicrophoneTestResult() const;
|
||||
//! \copydoc IContextVoice::getMicrophoneTestResult()
|
||||
virtual QString getMicrophoneTestResult() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getSquelchValue()
|
||||
*/
|
||||
virtual double getSquelchValue() const;
|
||||
//! \copydoc IContextVoice::getSquelchValue()
|
||||
virtual double getSquelchValue() const override;
|
||||
|
||||
private:
|
||||
CVoiceVatlib *m_voice; //!< underlying voice lib
|
||||
|
||||
@@ -14,102 +14,102 @@
|
||||
namespace BlackCore
|
||||
{
|
||||
|
||||
/*!
|
||||
* \typedef Plane's orientation
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
BlackMisc::Aviation::CHeading heading; // honestly I think this is a track TODO
|
||||
BlackMisc::PhysicalQuantities::CAngle pitch;
|
||||
BlackMisc::PhysicalQuantities::CAngle bank;
|
||||
|
||||
} TOrientation;
|
||||
|
||||
/*!
|
||||
* \typedef Plane's state
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*!
|
||||
* \brief Reset data
|
||||
* \brief Plane's orientation
|
||||
*/
|
||||
void reset() {}
|
||||
typedef struct
|
||||
{
|
||||
BlackMisc::Aviation::CHeading heading; //!< heading, honestly I think this is a track TODO
|
||||
BlackMisc::PhysicalQuantities::CAngle pitch; //!< pitch
|
||||
BlackMisc::PhysicalQuantities::CAngle bank; //!< bank
|
||||
|
||||
qint64 timestamp;
|
||||
TOrientation orientation;
|
||||
BlackMisc::PhysicalQuantities::CSpeed groundspeed;
|
||||
BlackMisc::Math::CVector3D velocity;
|
||||
BlackMisc::Geo::CCoordinateEcef position;
|
||||
BlackMisc::Geo::CCoordinateNed velNED;
|
||||
|
||||
} TPlaneState;
|
||||
|
||||
/*!
|
||||
* \brief Interpolator, calculation inbetween positions
|
||||
*/
|
||||
class CInterpolator
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
*/
|
||||
CInterpolator();
|
||||
} TOrientation;
|
||||
|
||||
/*!
|
||||
* \brief Virtual destructor
|
||||
* \brief Plane's state
|
||||
*/
|
||||
virtual ~CInterpolator();
|
||||
typedef struct
|
||||
{
|
||||
/*!
|
||||
* \brief Reset data
|
||||
*/
|
||||
void reset() {}
|
||||
|
||||
qint64 timestamp; //!< timestamp
|
||||
TOrientation orientation; //!< orientation
|
||||
BlackMisc::PhysicalQuantities::CSpeed groundspeed; //!< groundspeed
|
||||
BlackMisc::Math::CVector3D velocity; //!< velocity
|
||||
BlackMisc::Geo::CCoordinateEcef position; //!< position
|
||||
BlackMisc::Geo::CCoordinateNed velNED; //!< NED coordinate
|
||||
|
||||
} TPlaneState;
|
||||
|
||||
/*!
|
||||
* \brief Init object
|
||||
* \brief Interpolator, calculation inbetween positions
|
||||
*/
|
||||
void initialize();
|
||||
class CInterpolator
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
*/
|
||||
CInterpolator();
|
||||
|
||||
/*!
|
||||
* \brief Push an update
|
||||
* \param pos
|
||||
* \param groundSpeed
|
||||
* \param heading
|
||||
* \param pitch
|
||||
* \param bank
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Geo::CCoordinateNed pushUpdate(const BlackMisc::Geo::CCoordinateGeodetic &pos,
|
||||
const BlackMisc::PhysicalQuantities::CSpeed &groundSpeed,
|
||||
const BlackMisc::Aviation::CHeading &heading,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &pitch,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &bank);
|
||||
/*!
|
||||
* \brief Virtual destructor
|
||||
*/
|
||||
virtual ~CInterpolator();
|
||||
|
||||
/*!
|
||||
* \brief Valid state?
|
||||
* \return
|
||||
*/
|
||||
bool isValid() const;
|
||||
/*!
|
||||
* \brief Init object
|
||||
*/
|
||||
void initialize();
|
||||
|
||||
/*!
|
||||
* \brief Calculate current state
|
||||
* \param state
|
||||
* \return
|
||||
*/
|
||||
bool stateNow(TPlaneState *state);
|
||||
/*!
|
||||
* \brief Push an update
|
||||
* \param pos
|
||||
* \param groundSpeed
|
||||
* \param heading
|
||||
* \param pitch
|
||||
* \param bank
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Geo::CCoordinateNed pushUpdate(const BlackMisc::Geo::CCoordinateGeodetic &pos,
|
||||
const BlackMisc::PhysicalQuantities::CSpeed &groundSpeed,
|
||||
const BlackMisc::Aviation::CHeading &heading,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &pitch,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &bank);
|
||||
|
||||
private:
|
||||
BlackMisc::Math::CVector3D m_a;
|
||||
BlackMisc::Math::CVector3D m_b;
|
||||
QElapsedTimer m_time;
|
||||
TPlaneState *m_state_begin;
|
||||
TPlaneState *m_state_end;
|
||||
bool m_valid;
|
||||
double m_timeEnd;
|
||||
double m_timeBegin;
|
||||
/*!
|
||||
* \brief Valid state?
|
||||
* \return
|
||||
*/
|
||||
bool isValid() const;
|
||||
|
||||
/*!
|
||||
* \brief Normalize radians
|
||||
* \param angle
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CAngle normalizeRadians(const BlackMisc::PhysicalQuantities::CAngle &angle) const;
|
||||
};
|
||||
/*!
|
||||
* \brief Calculate current state
|
||||
* \param state
|
||||
* \return
|
||||
*/
|
||||
bool stateNow(TPlaneState *state);
|
||||
|
||||
private:
|
||||
BlackMisc::Math::CVector3D m_a;
|
||||
BlackMisc::Math::CVector3D m_b;
|
||||
QElapsedTimer m_time;
|
||||
TPlaneState *m_state_begin;
|
||||
TPlaneState *m_state_end;
|
||||
bool m_valid;
|
||||
double m_timeEnd;
|
||||
double m_timeBegin;
|
||||
|
||||
/*!
|
||||
* \brief Normalize radians
|
||||
* \param angle
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CAngle normalizeRadians(const BlackMisc::PhysicalQuantities::CAngle &angle) const;
|
||||
};
|
||||
|
||||
} // namespace BlackCore
|
||||
|
||||
|
||||
@@ -147,41 +147,49 @@ namespace BlackMisc
|
||||
{
|
||||
static double factor() { return 1; } //!< factor \return
|
||||
};
|
||||
//! \brief 2 (two)
|
||||
template <class Policy>
|
||||
struct Two
|
||||
{
|
||||
static double factor() { return Policy::factor() * 2.0; } //!< factor \return
|
||||
};
|
||||
//! \brief 10^-3
|
||||
template <class Policy>
|
||||
struct Milli
|
||||
{
|
||||
static double factor() { return Policy::factor() / 1000.0; } //!< factor \return
|
||||
};
|
||||
template <class Policy>
|
||||
//! \brief 10^-2
|
||||
struct Centi
|
||||
{
|
||||
static double factor() { return Policy::factor() / 100.0; } //!< factor \return
|
||||
};
|
||||
//! \brief 10^2
|
||||
template <class Policy>
|
||||
struct Hecto
|
||||
{
|
||||
static double factor() { return Policy::factor() * 100.0; } //!< factor \return
|
||||
};
|
||||
//! \brief 10^3
|
||||
template <class Policy>
|
||||
struct Kilo
|
||||
{
|
||||
static double factor() { return Policy::factor() * 1000.0; } //!< factor \return
|
||||
};
|
||||
//! \brief 10^6
|
||||
template <class Policy>
|
||||
struct Mega
|
||||
{
|
||||
static double factor() { return Policy::factor() * 1e+6; } //!< factor \return
|
||||
};
|
||||
//! \brief 10^9
|
||||
template <class Policy>
|
||||
struct Giga
|
||||
{
|
||||
static double factor() { return Policy::factor() * 1e+9; } //!< factor \return
|
||||
};
|
||||
//! \brief in each hundred
|
||||
template <int Subfactor>
|
||||
struct InEachHundred
|
||||
{
|
||||
|
||||
@@ -186,8 +186,8 @@ namespace BlackMisc
|
||||
/*!
|
||||
* \brief Set property by index
|
||||
* \remarks Intentionally not abstract, avoiding all classes need to implement this method
|
||||
* \param variant
|
||||
* \param index as used in Qt table views
|
||||
* \return
|
||||
*/
|
||||
virtual void setPropertyByIndex(const QVariant &variant, int index);
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace BlackSound
|
||||
/*!
|
||||
* \brief Play sound, open device
|
||||
* \param volume 0..100
|
||||
* \param pull, if false push mode
|
||||
* \param pull if false push mode
|
||||
*/
|
||||
void start(int volume, bool pull = true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user