From 2b60e68197db4fc4cb023ff6e9caa8dd085e17d7 Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 22 Jun 2022 13:11:57 +0800 Subject: [PATCH] [update] update eis decoder code --- python/biopro/devlib/data.py | 10 ++-------- python/biopro/devlib/device.py | 8 -------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/python/biopro/devlib/data.py b/python/biopro/devlib/data.py index 105e706..1d017fd 100644 --- a/python/biopro/devlib/data.py +++ b/python/biopro/devlib/data.py @@ -1401,39 +1401,33 @@ class EISZeroOneDataDecoder(RecDataDecoder): 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]/1e4) - hsrtia_d.append(struct.unpack('>B', cali_coeff[index+13:index+14])[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]/1e4) - hsrtia_d.append(struct.unpack('>B', cali_coeff[index+13:index+14])[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]/1e4) - hsrtia_d.append(struct.unpack('>B', cali_coeff[index+13:index+14])[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]/1e4) - hsrtia_d.append(struct.unpack('>B', cali_coeff[index+13:index+14])[0]) # hsrtia_a.append(struct.unpack('>I', cali_coeff[index+1:index+5])[0]) # hsrtia_b.append(struct.unpack('>I', cali_coeff[index+5:index+9])[0]/1e6) # hsrtia_c.append(struct.unpack('>I', cali_coeff[index+9:index+13])[0]/1e5) - # hsrtia_d.append(struct.unpack('>I', cali_coeff[index+13:index+17])[0]/1e6) # print('cutoff_freq', cutoff_freq) # print('hsrtia_a', hsrtia_a) # print('hsrtia_b', hsrtia_b) # print('hsrtia_c', hsrtia_c) - # print('hsrtia_d', hsrtia_d) # print('phase_para_a', phase_para_a) # print('phase_para_b', phase_para_b) @@ -1590,10 +1584,10 @@ class EISZeroOneDataDecoder(RecDataDecoder): ret = RecordingData(self.device, int(time_stamp * 1000 / 2), 0) if (self._mode == 0): #EIS Mode - ret.append_data(3, cycle_number) ret.append_data(0, ch1) #Raw Imag ret.append_data(1, ch2) #Raw Real ret.append_data(2, ch3 * 10) #Frequency [mHz] + ret.append_data(3, cycle_number) ret.append_data(4, round(imag_after_cal)) #Z_imag [Ohm] ret.append_data(5, round(real_after_cal)) #Z_real [Ohm] ret.append_data(6, round(impedance)) #Impedance [Ohm] @@ -1602,10 +1596,10 @@ class EISZeroOneDataDecoder(RecDataDecoder): ret.append_data(9, gain) #Gain Level else: #CV Mode - ret.append_data(3, cycle_number) ret.append_data(0, ch1) #Iin [nA] ret.append_data(1, ch2) #Vset [nV] ret.append_data(2, ch3) #Vout [nV] + ret.append_data(3, cycle_number) if cycle_number != self._cycle_number: # notify cycle_number change diff --git a/python/biopro/devlib/device.py b/python/biopro/devlib/device.py index 07bb27b..b4ee622 100644 --- a/python/biopro/devlib/device.py +++ b/python/biopro/devlib/device.py @@ -653,15 +653,9 @@ class DeviceInstruction: VIS_CC_ZERO = 0x40 - VIS_ASK = 0x30 - """ask in virtual instruction""" - VIS_STI = 0xC0 """stimulation on virtual instruction""" - VIS_FUH = 0x90 - """flush virtual instruction""" - VIS_INT = 0x60 """interrupt virtual instruction""" @@ -750,8 +744,6 @@ class DeviceCommonInstruction: return '_sync(False)', '_notify(False)', 'VIS_INT' elif instruction == cls.CLOSE: return '_sync(False)', '_notify(False)', 'VIS_INT' - elif instruction == cls.FLUSH: - return 'VIS_FUH', elif instruction == cls.CALL: return 'VIS_CAL', elif instruction == cls.VIS_DEVICE_DETECT: