mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Ref T259, Ref T243 FSD setup gnd flag handling
This commit is contained in:
@@ -24,6 +24,9 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
namespace Network
|
namespace Network
|
||||||
{
|
{
|
||||||
|
CFsdSetup::CFsdSetup(SendReceiveDetails sendReceive) : m_sendReceive(sendReceive)
|
||||||
|
{ }
|
||||||
|
|
||||||
CFsdSetup::CFsdSetup(const QString &codec, SendReceiveDetails sendReceive)
|
CFsdSetup::CFsdSetup(const QString &codec, SendReceiveDetails sendReceive)
|
||||||
: m_textCodec(codec), m_sendReceive(sendReceive) {}
|
: m_textCodec(codec), m_sendReceive(sendReceive) {}
|
||||||
|
|
||||||
@@ -41,26 +44,30 @@ namespace BlackMisc
|
|||||||
|
|
||||||
QString CFsdSetup::sendReceiveDetailsToString(SendReceiveDetails details)
|
QString CFsdSetup::sendReceiveDetailsToString(SendReceiveDetails details)
|
||||||
{
|
{
|
||||||
static const QString ds("Send parts; %1 interim: %2 Receive parts: %3 interim: %4");
|
static const QString ds("Send parts; %1 gnd: %2 interim: %3 Receive parts: %4 gnd: %5 interim: %6");
|
||||||
return ds.arg(boolToYesNo(details.testFlag(SendAircraftParts)),
|
return ds.arg(boolToYesNo(details.testFlag(SendAircraftParts)),
|
||||||
boolToYesNo(details.testFlag(SendIterimPositions)),
|
boolToYesNo(details.testFlag(SendGndFlag)),
|
||||||
|
boolToYesNo(details.testFlag(SendInterimPositions)),
|
||||||
boolToYesNo(details.testFlag(ReceiveAircraftParts)),
|
boolToYesNo(details.testFlag(ReceiveAircraftParts)),
|
||||||
|
boolToYesNo(details.testFlag(ReceiveGndFlag)),
|
||||||
boolToYesNo(details.testFlag(ReceiveInterimPositions)));
|
boolToYesNo(details.testFlag(ReceiveInterimPositions)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFsdSetup::setSendReceiveDetails(bool partsSend, bool partsReceive, bool interimSend, bool interimReceive)
|
void CFsdSetup::setSendReceiveDetails(bool partsSend, bool partsReceive, bool gndSend, bool gndReceive, bool interimSend, bool interimReceive)
|
||||||
{
|
{
|
||||||
SendReceiveDetails s = Nothing;
|
SendReceiveDetails s = Nothing;
|
||||||
if (partsSend) { s |= SendAircraftParts; }
|
if (partsSend) { s |= SendAircraftParts; }
|
||||||
if (partsReceive) { s |= ReceiveAircraftParts; }
|
if (partsReceive) { s |= ReceiveAircraftParts; }
|
||||||
if (interimSend) { s |= SendIterimPositions; }
|
if (gndSend) { s |= SendGndFlag; }
|
||||||
|
if (gndReceive) { s |= ReceiveGndFlag; }
|
||||||
|
if (interimSend) { s |= SendInterimPositions; }
|
||||||
if (interimReceive) { s |= ReceiveInterimPositions; }
|
if (interimReceive) { s |= ReceiveInterimPositions; }
|
||||||
this->setSendReceiveDetails(s);
|
this->setSendReceiveDetails(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
const CFsdSetup &CFsdSetup::vatsimStandard()
|
const CFsdSetup &CFsdSetup::vatsimStandard()
|
||||||
{
|
{
|
||||||
static const CFsdSetup s;
|
static const CFsdSetup s(AllWithoutGnd);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,27 +33,35 @@ namespace BlackMisc
|
|||||||
//! Properties by index
|
//! Properties by index
|
||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
IndexTextCodec = BlackMisc::CPropertyIndex::GlobalIndexCFsdSetup,
|
IndexTextCodec = CPropertyIndex::GlobalIndexCFsdSetup,
|
||||||
IndexSendReceiveDetails
|
IndexSendReceiveDetails
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Send/receive details
|
//! Send/receive details
|
||||||
enum SendReceiveDetailsFlag
|
enum SendReceiveDetailsFlag
|
||||||
{
|
{
|
||||||
Nothing = 0, //!< nothing
|
Nothing = 0, //!< nothing
|
||||||
SendAircraftParts = 1 << 0, //!< aircraft parts out
|
SendAircraftParts = 1 << 0, //!< aircraft parts out
|
||||||
SendIterimPositions = 1 << 1, //!< interim positions in
|
SendInterimPositions = 1 << 1, //!< interim positions out
|
||||||
ReceiveAircraftParts = 1 << 2, //!< fast position updates out
|
SendGndFlag = 1 << 2, //!< gnd.flag out (position)
|
||||||
ReceiveInterimPositions = 1 << 3, //!< fast position updates in
|
ReceiveAircraftParts = 1 << 3, //!< aircraft parts in
|
||||||
AllSending = SendAircraftParts | SendIterimPositions, //!< all out
|
ReceiveInterimPositions = 1 << 4, //!< fast position updates in
|
||||||
AllReceive = ReceiveAircraftParts | ReceiveInterimPositions, //!< all in
|
ReceiveGndFlag = 1 << 5, //!< gnd.flag in (position)
|
||||||
All = AllReceive | AllSending //!< all
|
AllSending = SendAircraftParts | SendInterimPositions | SendGndFlag, //!< all out
|
||||||
|
AllReceive = ReceiveAircraftParts | ReceiveInterimPositions | ReceiveGndFlag, //!< all in
|
||||||
|
All = AllReceive | AllSending, //!< all
|
||||||
|
AllSendingWithoutGnd = SendAircraftParts | SendInterimPositions, //!< all out, but no gnd.flag
|
||||||
|
AllReceiveWithoutGnd = ReceiveAircraftParts | ReceiveInterimPositions, //!< all in, but no gnd.flag
|
||||||
|
AllWithoutGnd = AllReceiveWithoutGnd | AllSendingWithoutGnd //!< all, but no gnd.flag
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(SendReceiveDetails, SendReceiveDetailsFlag)
|
Q_DECLARE_FLAGS(SendReceiveDetails, SendReceiveDetailsFlag)
|
||||||
|
|
||||||
//! Default constructor.
|
//! Default constructor.
|
||||||
CFsdSetup() {}
|
CFsdSetup() {}
|
||||||
|
|
||||||
|
//! Constructor.
|
||||||
|
CFsdSetup(SendReceiveDetails sendReceive);
|
||||||
|
|
||||||
//! Constructor.
|
//! Constructor.
|
||||||
CFsdSetup(const QString &codec, SendReceiveDetails sendReceive = All);
|
CFsdSetup(const QString &codec, SendReceiveDetails sendReceive = All);
|
||||||
|
|
||||||
@@ -70,16 +78,27 @@ namespace BlackMisc
|
|||||||
void setSendReceiveDetails(SendReceiveDetails sendReceive) { m_sendReceive = sendReceive; }
|
void setSendReceiveDetails(SendReceiveDetails sendReceive) { m_sendReceive = sendReceive; }
|
||||||
|
|
||||||
//! Set send / receive details
|
//! Set send / receive details
|
||||||
void setSendReceiveDetails(bool partsSend, bool partsReceive, bool interimSend, bool interimReceive);
|
void setSendReceiveDetails(bool partsSend, bool partsReceive, bool gndSend, bool gndReceive, bool interimSend, bool interimReceive);
|
||||||
|
|
||||||
|
//! FSD setup flags
|
||||||
|
//! @{
|
||||||
|
bool sendAircraftParts() const { return this->getSendReceiveDetails().testFlag(SendAircraftParts); }
|
||||||
|
bool sendGndFlag() const { return this->getSendReceiveDetails().testFlag(SendGndFlag); }
|
||||||
|
bool sendInterimPositions() const { return this->getSendReceiveDetails().testFlag(SendInterimPositions); }
|
||||||
|
|
||||||
|
bool receiveAircraftParts() const { return this->getSendReceiveDetails().testFlag(ReceiveAircraftParts); }
|
||||||
|
bool receiveGndFlag() const { return this->getSendReceiveDetails().testFlag(ReceiveGndFlag); }
|
||||||
|
bool receiveInterimPositions() const { return this->getSendReceiveDetails().testFlag(ReceiveInterimPositions); }
|
||||||
|
//! @}
|
||||||
|
|
||||||
//! Validate, provide details about issues
|
//! Validate, provide details about issues
|
||||||
BlackMisc::CStatusMessageList validate() const;
|
CStatusMessageList validate() const;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::String::toQString()
|
//! \copydoc BlackMisc::Mixin::String::toQString()
|
||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user