From e084d78f8d4c98a4853bc71527456093f8a0738e Mon Sep 17 00:00:00 2001 From: jeroenbeijer Date: Sun, 19 Nov 2023 10:57:37 +0100 Subject: [PATCH] check for sublabel and strip if found --- JAERO/arincparse.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/JAERO/arincparse.cpp b/JAERO/arincparse.cpp index 0e19f1f..f728118 100644 --- a/JAERO/arincparse.cpp +++ b/JAERO/arincparse.cpp @@ -65,7 +65,20 @@ void ArincParse::try_acars_apps(ACARSItem &acarsitem, la_msg_dir msg_dir) } else { + // look for a sublabel and if found strip the sublabel(s) from the message before decoding ba = acarsitem.message.toLatin1(); + char sublabel[3]; + char mfi[3]; + int offset = la_acars_extract_sublabel_and_mfi(acarsitem.LABEL.data(), msg_dir, ba.data(),strlen( ba.data()), sublabel, mfi); + + if(offset > 0) + { + ba = "/" + acarsitem.message.right(acarsitem.message.length()-offset).replace("- #" + QString(sublabel),"").trimmed().toLatin1(); + } + else + { + ba = acarsitem.message.toLatin1(); + } } if(ba.isEmpty())return;