Index: leahi_dialin/common/__init__.py =================================================================== diff -u -r126c206228086fbd13e820980c2fbb2fb58131bb -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/common/__init__.py (.../__init__.py) (revision 126c206228086fbd13e820980c2fbb2fb58131bb) +++ leahi_dialin/common/__init__.py (.../__init__.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -8,7 +8,7 @@ sw_key = "SW" config = {} ok: bool = False -module_name = os.path.basename(os.getcwd()) +module_name = os.path.basename(os.path.dirname(__file__)) try: with open(file_name, 'r') as file: config = json.load(file); ok = config[sw_key] @@ -17,7 +17,7 @@ except Exception as e : print(f"Error ({module_name}): An unexpected error occurred: {e}" ) if ok: - print(f"{sw_key} is set to bypass the auto imports.") + print(f"{sw_key} is set to bypass the auto imports in '{module_name}' module.") else: from .alarm_defs import * from .alarm_priorities import * Index: leahi_dialin/dd/__init__.py =================================================================== diff -u -r2cfe3b26afa7d5ebdb1df6a7fdfd06532880713c -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/dd/__init__.py (.../__init__.py) (revision 2cfe3b26afa7d5ebdb1df6a7fdfd06532880713c) +++ leahi_dialin/dd/__init__.py (.../__init__.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -1 +1,22 @@ -from .dialysate_delivery import DD \ No newline at end of file +import os +import json + +# mandatory import +# none + +file_name = "config.json" +sw_key = "SW" +config = {} +ok: bool = False +module_name = os.path.basename(os.path.dirname(__file__)) + +try: + with open(file_name, 'r') as file: config = json.load(file); ok = config[sw_key] +except FileNotFoundError: print(f"Error ({module_name}): The file '{file_name}' was not found." ) +except KeyError : print(f"Error ({module_name}): The key '{sw_key}' was not found." ) +except Exception as e : print(f"Error ({module_name}): An unexpected error occurred: {e}" ) + +if ok: + print(f"{sw_key} is set to bypass the auto imports in '{module_name}' module.") +else: + from .dialysate_delivery import DD \ No newline at end of file Index: leahi_dialin/protocols/CAN.py =================================================================== diff -u -r151f2ea1e956e89141f6eb66fb0b5f8aac74e6d7 -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/protocols/CAN.py (.../CAN.py) (revision 151f2ea1e956e89141f6eb66fb0b5f8aac74e6d7) +++ leahi_dialin/protocols/CAN.py (.../CAN.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -286,9 +286,9 @@ DenaliChannels.td_to_dd_ch_id: DenaliChannels.dialin_to_td_ch_id, DenaliChannels.dd_to_td_ch_id: DenaliChannels.dialin_to_dd_ch_id, DenaliChannels.td_to_ui_ch_id: DenaliChannels.dialin_to_td_ch_id, - DenaliChannels.td_sync_broadcast_ch_id: None, - DenaliChannels.dg_to_ui_ch_id: DenaliChannels.dialin_to_dd_ch_id, - DenaliChannels.dd_sync_broadcast_ch_id: None, + DenaliChannels.td_sync_broadcast_ch_id: DenaliChannels.dialin_to_td_ch_id, + DenaliChannels.dd_sync_broadcast_ch_id: DenaliChannels.dialin_to_dd_ch_id, + DenaliChannels.ro_sync_broadcast_ch_id: DenaliChannels.dialin_to_ro_ch_id, DenaliChannels.ui_to_td_ch_id: DenaliChannels.dialin_to_ui_ch_id, DenaliChannels.ui_sync_broadcast_ch_id: DenaliChannels.dialin_to_ui_ch_id, DenaliChannels.td_to_dialin_ch_id: DenaliChannels.dialin_to_td_ch_id, @@ -697,8 +697,8 @@ @return: true, if the channel is the ui channel. """ if channel_id in { - DenaliChannels.ui_to_hd_ch_id, - DenaliChannels.ui_to_dg_ch_id, + DenaliChannels.ui_to_td_ch_id, + # DenaliChannels.ui_to_dd_ch_id, DenaliChannels.ui_to_dialin_ch_id, DenaliChannels.ui_sync_broadcast_ch_id, DenaliChannels.ui_alarm_broadcast_ch_id Index: leahi_dialin/protocols/__init__.py =================================================================== diff -u -r126c206228086fbd13e820980c2fbb2fb58131bb -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/protocols/__init__.py (.../__init__.py) (revision 126c206228086fbd13e820980c2fbb2fb58131bb) +++ leahi_dialin/protocols/__init__.py (.../__init__.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -5,7 +5,7 @@ sw_key = "SW" config = {} ok: bool = False -module_name = os.path.basename(os.getcwd()) +module_name = os.path.basename(os.path.dirname(__file__)) try: with open(file_name, 'r') as file: config = json.load(file); ok = config[sw_key] @@ -14,7 +14,7 @@ except Exception as e : print(f"Error ({module_name}): An unexpected error occurred: {e}" ) if ok: - print(f"{sw_key} is set to bypass the auto imports.") + print(f"{sw_key} is set to bypass the auto imports in '{module_name}' module.") else: from .CAN import DenaliCanMessenger from .CAN import DenaliChannels Index: leahi_dialin/ro/__init__.py =================================================================== diff -u -r2cfe3b26afa7d5ebdb1df6a7fdfd06532880713c -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/ro/__init__.py (.../__init__.py) (revision 2cfe3b26afa7d5ebdb1df6a7fdfd06532880713c) +++ leahi_dialin/ro/__init__.py (.../__init__.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -1 +1,22 @@ -from .reverse_osmosis import RO \ No newline at end of file +import os +import json + +# mandatory import +# none + +file_name = "config.json" +sw_key = "SW" +config = {} +ok: bool = False +module_name = os.path.basename(os.path.dirname(__file__)) + +try: + with open(file_name, 'r') as file: config = json.load(file); ok = config[sw_key] +except FileNotFoundError: print(f"Error ({module_name}): The file '{file_name}' was not found." ) +except KeyError : print(f"Error ({module_name}): The key '{sw_key}' was not found." ) +except Exception as e : print(f"Error ({module_name}): An unexpected error occurred: {e}" ) + +if ok: + print(f"{sw_key} is set to bypass the auto imports in '{module_name}' module.") +else: + from .reverse_osmosis import RO \ No newline at end of file Index: leahi_dialin/td/__init__.py =================================================================== diff -u -r2cfe3b26afa7d5ebdb1df6a7fdfd06532880713c -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/td/__init__.py (.../__init__.py) (revision 2cfe3b26afa7d5ebdb1df6a7fdfd06532880713c) +++ leahi_dialin/td/__init__.py (.../__init__.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -1 +1,22 @@ -from .treatment_delivery import TD \ No newline at end of file +import os +import json + +# mandatory import +# none + +file_name = "config.json" +sw_key = "SW" +config = {} +ok: bool = False +module_name = os.path.basename(os.path.dirname(__file__)) + +try: + with open(file_name, 'r') as file: config = json.load(file); ok = config[sw_key] +except FileNotFoundError: print(f"Error ({module_name}): The file '{file_name}' was not found." ) +except KeyError : print(f"Error ({module_name}): The key '{sw_key}' was not found." ) +except Exception as e : print(f"Error ({module_name}): An unexpected error occurred: {e}" ) + +if ok: + print(f"{sw_key} is set to bypass the auto imports in '{module_name}' module.") +else: + from .treatment_delivery import TD \ No newline at end of file Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r401291cef3d703088cdd8367d3ec6b3c50c39734 -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 401291cef3d703088cdd8367d3ec6b3c50c39734) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -1,9 +1,9 @@ #!/bin/python3 -from dialin.ui.utils import singleton_threadsafe -from dialin.utils import conversions -from dialin.protocols import CAN -from dialin.common import msg_ids +from leahi_dialin.ui.utils import singleton_threadsafe +from leahi_dialin.utils import conversions +from leahi_dialin.protocols import CAN +from leahi_dialin.common import msg_ids @singleton_threadsafe Index: leahi_dialin/utils/__init__.py =================================================================== diff -u -r126c206228086fbd13e820980c2fbb2fb58131bb -rbe6aa30cfb37a47935f3c114ecece9ee75809909 --- leahi_dialin/utils/__init__.py (.../__init__.py) (revision 126c206228086fbd13e820980c2fbb2fb58131bb) +++ leahi_dialin/utils/__init__.py (.../__init__.py) (revision be6aa30cfb37a47935f3c114ecece9ee75809909) @@ -9,7 +9,7 @@ sw_key = "SW" config = {} ok: bool = False -module_name = os.path.basename(os.getcwd()) +module_name = os.path.basename(os.path.dirname(__file__)) try: with open(file_name, 'r') as file: config = json.load(file); ok = config[sw_key] @@ -18,7 +18,7 @@ except Exception as e : print(f"Error ({module_name}): An unexpected error occurred: {e}" ) if ok: - print(f"{sw_key} is set to bypass the auto imports.") + print(f"{sw_key} is set to bypass the auto imports in '{module_name}' module.") else: from .conversions import * from .data_logger import DataLogger