Index: leahi_dialin/dd/modules/alarms.py =================================================================== diff -u -r18c90a1b2b6c7339bdd192a2d2fac32f2b8a35df -rc5bfcf84ed942ca5841bf9de155aa0f495b4d28d --- leahi_dialin/dd/modules/alarms.py (.../alarms.py) (revision 18c90a1b2b6c7339bdd192a2d2fac32f2b8a35df) +++ leahi_dialin/dd/modules/alarms.py (.../alarms.py) (revision c5bfcf84ed942ca5841bf9de155aa0f495b4d28d) @@ -19,7 +19,7 @@ from leahi_dialin.common.alarm_defs import AlarmList from leahi_dialin.common.constants import NO_RESET -from leahi_dialin.common.dd_defs import DDEventDataType +from leahi_dialin.common.dd_defs import dd_enum_repository from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.common.override_templates import cmd_generic_broadcast_interval_override, cmd_generic_override from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels @@ -75,8 +75,8 @@ self.alarm_data_type = dict() # Loop through the list of the event data type enum and update the dictionary - for data_type in DDEventDataType: - event_data_type = DDEventDataType(data_type).name + for data_type in dd_enum_repository.DDEventDataTypes: + event_data_type = dd_enum_repository.DDEventDataTypes(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 @@ -105,13 +105,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[DDEventDataType(data_typ_1[0]).name] + struct_data_type_1 = self.alarm_data_type[dd_enum_repository.DDEventDataTypes(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[DDEventDataType(data_typ_2[0]).name] + struct_data_type_2 = self.alarm_data_type[dd_enum_repository.DDEventDataTypes(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]))