Index: leahi_dialin/fp/modules/alarms.py =================================================================== diff -u -rec8a2600b9e8cf6fe7e02c200a1c24221ca86863 -re60ad12bcc58d5905d7268bbeaae139d8233e023 --- leahi_dialin/fp/modules/alarms.py (.../alarms.py) (revision ec8a2600b9e8cf6fe7e02c200a1c24221ca86863) +++ leahi_dialin/fp/modules/alarms.py (.../alarms.py) (revision e60ad12bcc58d5905d7268bbeaae139d8233e023) @@ -17,7 +17,7 @@ from logging import Logger from .constants import RESET, NO_RESET -from leahi_dialin.common.fp_defs import FPEventDataType +from leahi_dialin.common.fp_defs import fp_enum_repository from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum @@ -67,8 +67,8 @@ self.alarm_data_type = dict() # Loop through the list of the event data type enum and update the dictionary - for data_type in FPEventDataType: - event_data_type = FPEventDataType(data_type).name + for data_type in fp_enum_repository.FPEventDataTypes: + event_data_type = fp_enum_repository.FPEventDataTypes(data_type).name struct_unpack_type = None # If U32 is in the data type enum (i.e. EVENT_DATA_TYPE_U32), then the key is the enum and the value is @@ -97,13 +97,13 @@ data_typ_1 = struct.unpack('i', bytearray(message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2])) # Get the corresponding structure format - struct_data_type_1 = self.alarm_data_type[FPEventDataType(data_typ_1[0]).name] + struct_data_type_1 = self.alarm_data_type[fp_enum_repository.FPEventDataTypes(data_typ_1[0]).name] # Get the data value by unpacking the data type data_1 = struct.unpack(struct_data_type_1, bytearray(message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3])) data_typ_2 = struct.unpack('i', bytearray(message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4])) # Get the corresponding structure format - struct_data_type_2 = self.alarm_data_type[FPEventDataType(data_typ_2[0]).name] + struct_data_type_2 = self.alarm_data_type[fp_enum_repository.FPEventDataTypes(data_typ_2[0]).name] # Get the data value by unpacking the data type data_2 = struct.unpack(struct_data_type_2, bytearray(message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))