From 33d587e5d3ce892d3f9c1657dfac1d34abad0b5f Mon Sep 17 00:00:00 2001 From: Seth Robertson Date: Mon, 15 Nov 2021 20:17:02 -0500 Subject: [PATCH 1/2] Add support for printing 1553 sub-channel (A|B) in python Extremely useful for 1553 investigation to know which channel a specific message came in on. --- python/Py106/MsgDecode1553.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/Py106/MsgDecode1553.py b/python/Py106/MsgDecode1553.py index c18b272..a0834c8 100644 --- a/python/Py106/MsgDecode1553.py +++ b/python/Py106/MsgDecode1553.py @@ -228,6 +228,7 @@ def msgs(self): # Initialize counts variables TR = ("R", "T") + AB = ("A", "B") packet_count = 0 msg_count = 0 @@ -254,9 +255,10 @@ def msgs(self): # time_utils.RelInt2IrigTime() WC = decode1553.word_cnt(msg.pCmdWord1.contents.Value) msg_time = time_utils.rel_int_to_irig_time(msg.p1553Hdr.contents.Field.PktTime) - sys.stdout.write("%s Ch %3i %2i-%s-%02i-%02i (%04x) " % ( \ + sys.stdout.write("%s Ch %3i-%s %2i-%s-%02i-%02i (%04x) " % ( \ msg_time, \ pkt_io.header.ch_id, \ + AB[msg.p1553Hdr.contents.Field.BlockStatus.BusID], \ msg.pCmdWord1.contents.Field.RTAddr, \ TR[msg.pCmdWord1.contents.Field.TR], \ msg.pCmdWord1.contents.Field.SubAddr, \ From a05e3430322ee9e02affe67705e6a0ee51f85f6f Mon Sep 17 00:00:00 2001 From: Seth Robertson Date: Wed, 15 Dec 2021 14:51:03 -0500 Subject: [PATCH 2/2] Python debug_action improvements - When doing a debug_action, printing headers just pollutes the output since these are ancillary tasks uninvolved with 1553. - When performing a debug_action of dump_pkt_hdrs, only dump packet headers and not other random stuff that will pollute the output stream since these are ancillary tasks uninvolved with 1553. --- python/irig_1553_csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/irig_1553_csv b/python/irig_1553_csv index 182d36e..2cdfe89 100755 --- a/python/irig_1553_csv +++ b/python/irig_1553_csv @@ -310,7 +310,7 @@ def msg_1553_unpack(msg, decode1553, time_utils, pkt_io): statistics = collections.defaultdict(lambda: 0) headers = headers_1553() -if not args.no_want_headers or args.debug_action: +if not args.no_want_headers and not args.debug_action: print(args.field.join(headers)) for fn in args.filename: @@ -330,6 +330,7 @@ for fn in args.filename: for pkt_hdr in pkt_io.packet_headers(): if args.debug_action == "dump_pkt_hdrs": print("Ch ID %3i %s" % (pkt_io.header.ch_id, irig10.packet.DataType.type_name(pkt_hdr.data_type))) + continue if pkt_hdr.data_type != irig10.packet.DataType.MIL1553_FMT_1: continue