You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In tlm.py, the validate() functions declared in the FieldDefinitions and DerivationDefinition classes need to modified to fix the 'else' statement of following block (found in both methods):
if self.enum:
if value not in self.enum.values():
valid = False
flds = (self.name, str(value))
log("%s value '%s' not in allowed enumerated values." % flds)
else:
primitive = int(self.enum.keys()[self.enum.values().index(value)])
The index() method is not a valid method on the enum object.
'self.enum' is a dict:
FieldDefinition(_bytes=0, desc='Distinguishes between core and p...', dntoeu=None, enum={0: 'Core', 1: 'Payload'},
That line will have to be rewritten.
The following script will cause the problem:
import ait.core.tlm as tlm
tlm_dict = tlm.getDefaultDict()
ccsds_pkt_def = tlm_dict['CCSDS_HEADER']
data = bytearray(b'\x01\x02\x03\x04\x05\x06\x07')
ccsds_pkt = tlm.Packet(ccsds_pkt_def, data=data)
test = ccsds_pkt.validate(messages='test validate')
The text was updated successfully, but these errors were encountered:
In tlm.py, the validate() functions declared in the FieldDefinitions and DerivationDefinition classes need to modified to fix the 'else' statement of following block (found in both methods):
The index() method is not a valid method on the enum object.
'self.enum' is a dict:
FieldDefinition(_bytes=0, desc='Distinguishes between core and p...', dntoeu=None, enum={0: 'Core', 1: 'Payload'},
That line will have to be rewritten.
The following script will cause the problem:
import ait.core.tlm as tlm
tlm_dict = tlm.getDefaultDict()
ccsds_pkt_def = tlm_dict['CCSDS_HEADER']
data = bytearray(b'\x01\x02\x03\x04\x05\x06\x07')
ccsds_pkt = tlm.Packet(ccsds_pkt_def, data=data)
test = ccsds_pkt.validate(messages='test validate')
The text was updated successfully, but these errors were encountered: