Fixed ATIS bug, ATIS was applyIf as IndexAtisMessage (correct IndexAtis).

Also fixed appending CR.
This commit is contained in:
Klaus Basan
2014-01-18 13:41:11 +01:00
parent b2afdd9860
commit 233bd51bfd
3 changed files with 8 additions and 8 deletions

View File

@@ -251,8 +251,6 @@ namespace BlackCore
/*!
* \brief ATIS received
* \param callsign
* \param atisMessage
*/
void psFsdAtisQueryReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CInformationMessage &atisMessage);

View File

@@ -155,7 +155,7 @@ namespace BlackCore
{
// this->log(Q_FUNC_INFO, callsign.toQString(), atisMessage);
CValueMap vm(CAtcStation::IndexAtisMessage, atisMessage.toQVariant());
CValueMap vm(CAtcStation::IndexAtis, atisMessage.toQVariant());
this->m_atcStationsOnline.applyIf(&CAtcStation::getCallsign, callsign, vm);
this->m_atcStationsBooked.applyIf(&CAtcStation::getCallsign, callsign, vm);
}

View File

@@ -658,7 +658,7 @@ namespace BlackCore
void CNetworkVatlib::onAtisReplyReceived(Cvatlib_Network *, const char *callsign, Cvatlib_Network::atisLineType lineType, const char *data, void *cbvar)
{
auto &atis = cbvar_cast(cbvar)->m_atisParts[cbvar_cast(cbvar)->fromFSD(callsign)];
auto &atis = cbvar_cast(cbvar)->m_atisParts[cbvar_cast(cbvar)->fromFSD(callsign)]; // also inserts in map if not already in
if (lineType == Cvatlib_Network::atisLineType_VoiceRoom)
{
@@ -687,7 +687,9 @@ namespace BlackCore
if (test.startsWith("z") && test.length() == 2) return; // z1, z2, ..
if (test.length() == 1) return; // sometimes just z
atis.appendMessage("\n" + cbvar_cast(cbvar)->fromFSD(data));
// append
if (!atis.isEmpty()) atis.appendMessage("\n");
atis.appendMessage(fixed);
}
}
}