From a0dd88e13d879b2b327e46b7075d2949ceda7def Mon Sep 17 00:00:00 2001 From: Bryan Crossman Date: Thu, 24 Oct 2024 16:18:45 +0000 Subject: [PATCH] Fixing association of trig elinks to RX for east vs west wagons --- run_bert.py | 9 ++++++++- static/txrx_east.json | 27 +++++++++++++++++++++++++++ static/txrx_west.json | 27 +++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 static/txrx_east.json create mode 100644 static/txrx_west.json diff --git a/run_bert.py b/run_bert.py index 4f8469e..e10b6b4 100755 --- a/run_bert.py +++ b/run_bert.py @@ -214,7 +214,14 @@ def get_links(self, board_sn="3205WEDBG100001", cfg_path = Path(__file__).parent link_names = {} - with open(Path(__file__).parent / 'static' /'txrx.json') as link_file: + orientation = "" + + if self.subtype[:2] == "WE": + orientation = "_east" + elif self.subtype[:2] == "WW": + orrientation = "_west" + + with open(Path(__file__).parent / 'static' /'txrx{}.json'.format(orientation)) as link_file: txrx = json.load(link_file) diff --git a/static/txrx_east.json b/static/txrx_east.json new file mode 100644 index 0000000..254a4f2 --- /dev/null +++ b/static/txrx_east.json @@ -0,0 +1,27 @@ +{ + "__description__": "This file is used to determine which TXs and RXs correspond to a given wagon elink. This is dependent on firmware version and may need to be updated if the firmware is updated.", + "TX": [ + {"num": 0, "link": "CLK1"}, + {"num": 1, "link": "CLK2"}, + {"num": 2, "link": "CLK3"}, + {"num": 4, "link": "DAQ0"}, + {"num": 5, "link": "DAQ1"}, + {"num": 6, "link": "DAQ2"}, + {"num": 7, "link": "X_DAQ"} + ], + "RX": [ + {"num": 0, "link": "TRIG6"}, + {"num": 1, "link": "TRIG5"}, + {"num": 2, "link": "TRIG4"}, + {"num": 3, "link": "TRIG3"}, + {"num": 4, "link": "TRIG2"}, + {"num": 5, "link": "TRIG1"}, + {"num": 6, "link": "TRIG0"}, + {"num": 7, "link": "CTL1"}, + {"num": 8, "link": "CTL2"}, + {"num": 9, "link": "CTL3"}, + {"num": 10, "link": ""}, + {"num": 11, "link": ""}, + {"num": 12, "link": ""} + ] +} diff --git a/static/txrx_west.json b/static/txrx_west.json new file mode 100644 index 0000000..77a7f1b --- /dev/null +++ b/static/txrx_west.json @@ -0,0 +1,27 @@ +{ + "__description__": "This file is used to determine which TXs and RXs correspond to a given wagon elink. This is dependent on firmware version and may need to be updated if the firmware is updated.", + "TX": [ + {"num": 0, "link": "CLK1"}, + {"num": 1, "link": "CLK2"}, + {"num": 2, "link": "CLK3"}, + {"num": 4, "link": "DAQ0"}, + {"num": 5, "link": "DAQ1"}, + {"num": 6, "link": "DAQ2"}, + {"num": 7, "link": "X_DAQ"} + ], + "RX": [ + {"num": 0, "link": "TRIG0"}, + {"num": 1, "link": "TRIG1"}, + {"num": 2, "link": "TRIG2"}, + {"num": 3, "link": "TRIG3"}, + {"num": 4, "link": "TRIG4"}, + {"num": 5, "link": "TRIG5"}, + {"num": 6, "link": "TRIG6"}, + {"num": 7, "link": "CTL1"}, + {"num": 8, "link": "CTL2"}, + {"num": 9, "link": "CTL3"}, + {"num": 10, "link": ""}, + {"num": 11, "link": ""}, + {"num": 12, "link": ""} + ] +}