[update] hsrtia_a & hsrtia_b & hsrtia_c receive from elite is 5bytes

This commit is contained in:
Roy
2023-03-22 13:39:14 +08:00
parent 15c15275a7
commit dbd7431124
+13 -13
View File
@@ -1461,27 +1461,27 @@ class EISZeroOneDataDecoder(RecDataDecoder):
#Lv[0] 160k
index = 60
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
hsrtia_a.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+1:index+6])[0])
hsrtia_b.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+6:index+11])[0])
hsrtia_c.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+11:index+16])[0])
#Lv[1] 20k
index = 80
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
hsrtia_a.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+1:index+6])[0])
hsrtia_b.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+6:index+11])[0])
hsrtia_c.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+11:index+16])[0])
#Lv[2] 5k
index = 100
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
hsrtia_a.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+1:index+6])[0])
hsrtia_b.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+6:index+11])[0])
hsrtia_c.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+11:index+16])[0])
#Lv[3] 200R
index = 120
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
hsrtia_a.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+1:index+6])[0])
hsrtia_b.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+6:index+11])[0])
hsrtia_c.append(struct.unpack('>q', b'\x00\x00\x00'+cali_coeff[index+11:index+16])[0])
index = 140
g = 1
@@ -1610,7 +1610,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
# current = hsrtia_a[gain] * math.exp(hsrtia_b[gain] * voltage_mag) + hsrtia_c[gain] * math.exp(hsrtia_d[gain] * voltage_mag)
# else:
current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain]
current = (voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain]) / 1e8 #[nA]
# current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain] + hsrtia_c[gain]