From 9f1b40be39ff432d34c9d4c9f27d1727fd703272 Mon Sep 17 00:00:00 2001 From: mfioren Date: Tue, 30 Jan 2024 16:22:37 +0000 Subject: [PATCH] Commented out print statements --- simulators/dbesm/__init__.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/simulators/dbesm/__init__.py b/simulators/dbesm/__init__.py index 0fdf2b1..ce4a96b 100644 --- a/simulators/dbesm/__init__.py +++ b/simulators/dbesm/__init__.py @@ -144,7 +144,7 @@ def _init_att(self): return att def parse(self, byte): - print(byte) + # print(byte) if byte == self.tail: msg = self.msg[:-1] self.msg = '' @@ -159,7 +159,7 @@ def _execute(self, msg): :param msg: the received command, comprehensive of its header and tail. """ - print(msg) + # print(msg) args = [x.strip() for x in msg.split(' ')] try: device_code = list(self.devices.keys())[ @@ -470,12 +470,12 @@ def _set_dbeatt(self, params): brd, a = zip(*self.atts_in_boards) for board in selected_boards: b_idx = selected_boards.index(board) - print(brd) - print(board["ATT"]) - print(board["ATT"][a[out_idx[b_idx]]]) + # print(brd) + # print(board["ATT"]) + # print(board["ATT"][a[out_idx[b_idx]]]) if ((params[2] == '+3' or params[2] == '-3') and - not (0 <= (float(board["ATT"][a[out_idx[b_idx]]]) + - float(params[2])) <= 31.5)): + not (0 <= (float(board["ATT"][a[out_idx[b_idx]]]) + + float(params[2])) <= 31.5)): retval += (f'ERR DBE {params[1]} BOARD ' f'{board["Address"]} value out of range\n') elif (params[2] != '+3' and params[2] != '-3' @@ -483,7 +483,7 @@ def _set_dbeatt(self, params): list(numpy.arange(0, 32, 0.5))): retval += (f'ERR DBE {params[1]} BOARD ' f'{board["Address"]} value out of range\n') - elif board["Status"] != 0: + elif ((board["Status"] != 0) or (board["Address"] not in brd)): retval += (f'ERR DBE {params[1]} BOARD ' f'{board["Address"]} unreachable\n') else: @@ -514,11 +514,11 @@ def _get_dbeatt(self, params): brd, a = zip(*self.atts_in_boards) for board in selected_boards: b_idx = selected_boards.index(board) - print(brd) - print(board["ATT"]) - print(board["ATT"][a[out_idx[b_idx]]]) + # print(brd) + # print(board["ATT"]) + # print(board["ATT"][a[out_idx[b_idx]]]) - if board["Status"] != 0: + if ((board["Status"] != 0) or (board["Address"] not in brd)): retval += (f'ERR DBE {params[1]} BOARD ' f'{board["Address"]} unreachable\n') else: