INetwork builds up the ATIS as it is received, line-by-line, keeping this implementation detail more encapsulated

refs #81
This commit is contained in:
Mathew Sutcliffe
2014-01-08 00:08:29 +00:00
parent f3758e5609
commit b475d7eff1
6 changed files with 35 additions and 5 deletions

View File

@@ -594,7 +594,18 @@ namespace BlackCore
void CNetworkVatlib::onAtisReplyReceived(Cvatlib_Network *, const char *callsign, Cvatlib_Network::atisLineType lineType, const char *data, void *cbvar)
{
emit cbvar_cast(cbvar)->atisQueryReplyReceived(cbvar_cast(cbvar)->fromFSD(callsign), cbvar_cast(cbvar)->fromFSD(data));
auto &atis = cbvar_cast(cbvar)->m_atisParts[cbvar_cast(cbvar)->fromFSD(callsign)];
if (lineType == Cvatlib_Network::atisLineType_LineCount)
{
atis.setType(CInformationMessage::ATIS);
emit cbvar_cast(cbvar)->atisQueryReplyReceived(cbvar_cast(cbvar)->fromFSD(callsign), atis);
cbvar_cast(cbvar)->m_atisParts.remove(cbvar_cast(cbvar)->fromFSD(callsign));
}
else
{
atis.appendMessage("\n" + cbvar_cast(cbvar)->fromFSD(data));
}
}
void CNetworkVatlib::onTemperatureDataReceived(Cvatlib_Network *, Cvatlib_Network::TempLayer /** layers **/ [4], INT /** pressure **/, void * /** cbvar **/)