python-archieve-projects/6.1 DatReader/legacy/UHFDataReaderDat.py

36 lines
828 B
Python
Executable File

import struct
xiangweis = []
fuzhis = []
geshus = []
typeid = 0
def readData(f):
total = struct.unpack("i", f.read(4))[0]
print("组数:", total)
for i in range(total):
xiangwei = struct.unpack("f", f.read(4))[0]
xiangweis.append(xiangwei)
for i in range(total):
fuzhi = struct.unpack("f", f.read(4))[0]
fuzhis.append(fuzhi)
for i in range(total):
geshu = struct.unpack("f", f.read(4))[0]
geshus.append(geshu)
def divideData():
print()
with open("../prpd/1645713227385_CH3__A_2022-02-24 161556_360d914c09d241c1a5898563fd83d3ef_沿面正极10kV.prpd", 'rb') as f:
if '沿面' in f.name:
typeid = 1
elif '气隙' in f.name:
typeid = 2
elif '电晕' in f.name:
typeid = 3
else:
typeid = 4
readData(f)