mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Issue #94 Add server capability flag for VISUPDATE
This commit is contained in:
@@ -67,6 +67,7 @@ namespace BlackMisc::Network
|
||||
if (cap.testFlag(FsdWithAircraftConfig)) sl << "aircraft config";
|
||||
if (cap.testFlag(FsdWithGroundFlag)) sl << "gnd.flag";
|
||||
if (cap.testFlag(FsdModelString)) sl << "modelstring";
|
||||
if (cap.testFlag(FsdWithVisualPositions)) sl << "visual pos.";
|
||||
if (sl.isEmpty()) { return {}; }
|
||||
return sl.join(", ");
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ namespace BlackMisc::Network
|
||||
FsdAtisCanBeReceived = 1 << 2, //!< ATIS
|
||||
FsdWithAircraftConfig = 1 << 3, //!< Aircraft parts
|
||||
FsdWithGroundFlag = 1 << 4, //!< supports gnd. flag (in position)
|
||||
FsdModelString = 1 << 5 //!< model string can be queried
|
||||
FsdModelString = 1 << 5, //!< model string can be queried
|
||||
FsdWithVisualPositions = 1 << 6 //!< visual position updates
|
||||
};
|
||||
Q_DECLARE_FLAGS(Capabilities, Capability)
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace BlackMisc::Network
|
||||
return ds.arg(boolToYesNo(details.testFlag(SendAircraftParts)),
|
||||
boolToYesNo(details.testFlag(SendGndFlag)),
|
||||
boolToYesNo(details.testFlag(SendInterimPositions)),
|
||||
boolToYesNo(details.testFlag(SendVisualPositions)),
|
||||
boolToYesNo(details.testFlag(ReceiveAircraftParts)),
|
||||
boolToYesNo(details.testFlag(ReceiveGndFlag)),
|
||||
boolToYesNo(details.testFlag(ReceiveInterimPositions)),
|
||||
@@ -54,7 +55,7 @@ namespace BlackMisc::Network
|
||||
);
|
||||
}
|
||||
|
||||
void CFsdSetup::setSendReceiveDetails(bool partsSend, bool partsReceive, bool gndSend, bool gndReceive, bool interimSend, bool interimReceive, bool euroscopeSimDataReceive)
|
||||
void CFsdSetup::setSendReceiveDetails(bool partsSend, bool partsReceive, bool gndSend, bool gndReceive, bool interimSend, bool interimReceive, bool visualSend, bool euroscopeSimDataReceive)
|
||||
{
|
||||
SendReceiveDetails s = Nothing;
|
||||
if (partsSend) { s |= SendAircraftParts; }
|
||||
@@ -63,6 +64,7 @@ namespace BlackMisc::Network
|
||||
if (gndReceive) { s |= ReceiveGndFlag; }
|
||||
if (interimSend) { s |= SendInterimPositions; }
|
||||
if (interimReceive) { s |= ReceiveInterimPositions; }
|
||||
if (visualSend) { s |= SendVisualPositions; }
|
||||
if (euroscopeSimDataReceive) { s |= ReceiveEuroscopeSimData; }
|
||||
this->setSendReceiveDetails(s);
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ namespace BlackMisc::Network
|
||||
ReceiveInterimPositions = 1 << 4, //!< fast position updates in
|
||||
ReceiveGndFlag = 1 << 5, //!< gnd.flag in (position)
|
||||
Force3LetterAirlineICAO = 1 << 6, //!< force 3 letter airline ICAO code
|
||||
// bit 7 reserved for VISUPDATE
|
||||
SendVisualPositions = 1 << 7, //!< visual positions out
|
||||
ReceiveEuroscopeSimData = 1 << 8, //!< euroscope SIMDATA in
|
||||
AllSending = SendAircraftParts | SendInterimPositions | SendGndFlag, //!< all out
|
||||
AllSending = SendAircraftParts | SendInterimPositions | SendVisualPositions | SendGndFlag, //!< all out
|
||||
AllReceive = ReceiveAircraftParts | ReceiveInterimPositions | ReceiveGndFlag, //!< all in
|
||||
All = AllReceive | AllSending, //!< all
|
||||
AllParts = SendAircraftParts | ReceiveAircraftParts, //!< send/receive parts
|
||||
@@ -56,7 +56,7 @@ namespace BlackMisc::Network
|
||||
AllReceiveWithoutGnd = AllReceive - ReceiveGndFlag, //!< all in, but no gnd.flag
|
||||
AllInterimPositions = SendInterimPositions | ReceiveInterimPositions, //!< all interim positions
|
||||
AllWithoutGnd = AllReceiveWithoutGnd | AllSendingWithoutGnd, //!< all, but no gnd.flag
|
||||
VATSIMDefault = AllParts | Force3LetterAirlineICAO
|
||||
VATSIMDefault = AllParts | Force3LetterAirlineICAO | SendVisualPositions
|
||||
};
|
||||
Q_DECLARE_FLAGS(SendReceiveDetails, SendReceiveDetailsFlag)
|
||||
|
||||
@@ -95,13 +95,14 @@ namespace BlackMisc::Network
|
||||
void removeSendReceiveDetails(SendReceiveDetails sendReceive) { m_sendReceive &= ~sendReceive; }
|
||||
|
||||
//! Set send / receive details
|
||||
void setSendReceiveDetails(bool partsSend, bool partsReceive, bool gndSend, bool gndReceive, bool interimSend, bool interimReceive, bool euroscopeSimDataReceive);
|
||||
void setSendReceiveDetails(bool partsSend, bool partsReceive, bool gndSend, bool gndReceive, bool interimSend, bool interimReceive, bool visualSend, bool euroscopeSimDataReceive);
|
||||
|
||||
//! 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 sendVisualPositions() const { return this->getSendReceiveDetails().testFlag(SendVisualPositions); }
|
||||
|
||||
bool receiveAircraftParts() const { return this->getSendReceiveDetails().testFlag(ReceiveAircraftParts); }
|
||||
bool receiveGndFlag() const { return this->getSendReceiveDetails().testFlag(ReceiveGndFlag); }
|
||||
|
||||
Reference in New Issue
Block a user