refs #799, use message settings

This commit is contained in:
Klaus Basan
2016-11-13 00:44:51 +01:00
parent af6dcc6191
commit 8a44774c98
4 changed files with 28 additions and 6 deletions

View File

@@ -351,7 +351,16 @@ namespace BlackMisc
return this->getRelayedTextMessageTypes().testFlag(TextMessagesCom2);
}
bool CSettingsSimulatorMessages::isRelayedTextMessage(const Network::CTextMessage &msg, const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const
bool CSettingsSimulatorMessages::relayThisStatusMessage(const CStatusMessage &message) const
{
if (message.isEmpty()) { return false; }
if (!this->isGloballyEnabled()) { return false; }
if (!this->isRelayedTechnicalMessages()) { return false; }
int s = static_cast<int>(message.getSeverity());
return (s >= this->m_technicalLogLevel);
}
bool CSettingsSimulatorMessages::relayThisTextMessage(const Network::CTextMessage &msg, const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const
{
if (msg.isEmpty()) { return false; }
if (!this->isGloballyEnabled()) { return false; }

View File

@@ -246,15 +246,18 @@ namespace BlackMisc
//! Relay UNICOM messages
bool isRelayedUnicomTextMessages() const;
//! Relay given text message
bool isRelayedTextMessage(const BlackMisc::Network::CTextMessage &msg, const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const;
//! Relay COM1 text message
bool isRelayedCom1TextMessages() const;
//! Relay COM2 text message
bool isRelayedCom2TextMessages() const;
//! Relay given text message
bool relayThisTextMessage(const BlackMisc::Network::CTextMessage &msg, const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const;
//! Relay this particular message
bool relayThisStatusMessage(const BlackMisc::CStatusMessage &message) const;
//! Relayed text messages
CSettingsSimulatorMessages::TextMessageType getRelayedTextMessageTypes() const;