Campbell 4WPB100 Dokumentacja Strona 66

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 70
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 65
65
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)/100.0
DataLine = DataLine + str(Value)
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
elif MessageFormat[1][ValueNum] == 'n':
try:
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)/100000.0
DataLine = DataLine + str(Value)
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
elif MessageFormat[1][ValueNum] == 'e':
try:
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)/100000.0
DataLine = DataLine + str(Value)
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
DataLine = DataLine + ','
DataLine = DataLine[:-1] # to remove the trailing comma character
IsDiagnostics = '!D' in DataLine[-5:-3] or MessageFormatNum % 5 ==
4#FIXME: the stats are wrong because we don't always go through here
IsObservations = '!M' in DataLine[-2:] or IsKnownBinaryFormat
IsSummer = ('!S' in DataLine and '!M' in DataLine[-2:]) or
MessageFormatNum % 5 in (0, 1)
IsWinter = ('!W' in DataLine and '!M' in DataLine[-2:]) or
MessageFormatNum % 5 in (2, 3)
IsWithInstant = '!I' in DataLine[-5:-3] or MessageFormatNum % 5 in (1, 3)
if not IsKnownBinaryFormat:
print '%s-%s' %(IMEI, MOMSN),
if IsDiagnostics: print '(ascii) generic diagnostic message',
elif IsObservations and IsSummer:print '(ascii) generic summer
observations message',
Przeglądanie stron 65
1 2 ... 61 62 63 64 65 66 67 68 69 70

Komentarze do niniejszej Instrukcji

Brak uwag