Campbell 4WPB100 Specifikace Strana 65

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 70
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 64
64
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GFP2toDEC(ValueBytes)
if Value == 8191:
DataLine = DataLine + "NAN"
elif Value == 8190:
DataLine = DataLine + "INF"
elif Value == -8190:
DataLine = DataLine + "-INF"
else:
DataLine = DataLine + str(Value)
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
if MessageFormat[1][ValueNum] == 'l':
try:
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)
DataLine = DataLine + str(Value)
if Value == -2147483648:
DataLine = DataLine + "NAN"
else:
DataLine = DataLine + str(Value)
#print ValueBytes, Value
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
elif MessageFormat[1][ValueNum] == 't':
try:
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)
DataLine = DataLine + time.strftime("%Y-%m-%d
%H:%M:%S", time.gmtime(Value + EpochOffset)) + ',' + str(Value)
#print ValueBytes, Value, time.asctime(time.gmtime(Value +
631148400))
except IndexError:
DataLine = DataLine + '?'
elif MessageFormat[1][ValueNum] == 'g':
try:
Zobrazit stránku 64
1 2 ... 60 61 62 63 64 65 66 67 68 69 70

Komentáře k této Příručce

Žádné komentáře