Compare commits

..

11 Commits

Author SHA1 Message Date
JayC319 0afbe66229 [update] edc 1.5 library 2022-08-22 13:58:39 +08:00
peterlu14 612785f51a [update] EIS show data 2022-08-16 19:40:27 +08:00
peterlu14 7dbf09e9a5 [update] EIS show data 2022-08-16 19:39:06 +08:00
peterlu14 ee64d43de1 [update] ca instruction b0 -> D3 2022-08-16 19:31:33 +08:00
peterlu14 60b91f0c1e [update] EIS add show data 2022-08-16 19:15:04 +08:00
Roy 8ac01bdf54 [update] update eis library 2022-08-16 19:10:18 +08:00
JayC319 0f90b16b6e [update] library product number 2022-08-16 17:35:06 +08:00
Roy 76e0a150d1 Merge remote-tracking branch 'origin/dev/Cali_mode' into dev/cc_cp_separate 2022-08-15 18:11:20 +08:00
JayC319 ecd4b9325d [update] 2022-08-15 18:09:40 +08:00
peterlu14 978b1254f0 Merge branch 'dev/debug' into dev/cc_cp_separate 2022-08-11 13:53:13 +08:00
Roy 257958768f [update] new ca mode instruvtion 2022-08-05 18:34:33 +08:00
8 changed files with 268 additions and 65 deletions
+27 -25
View File
@@ -1338,7 +1338,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
'_total_time_stamp', '_mode', '_cycle_start_time', '_total_time_stamp', '_mode', '_cycle_start_time',
'_mode_stop', '_last_time_stamp', '_last_delta', '_cali_coeff', '_mode_stop', '_last_time_stamp', '_last_delta', '_cali_coeff',
'cali_coeff', '_ac_amp', '_mode', '_freq_start', '_freq_stop', 'cali_coeff', '_ac_amp', '_mode', '_freq_start', '_freq_stop',
'_freq_direction', '_last_phase', '_first_phase_flag') '_freq_direction', '_last_phase', '_first_phase_flag', '_show_data')
def __init__(self, cali_coeff: bytes = None): def __init__(self, cali_coeff: bytes = None):
super().__init__() super().__init__()
@@ -1362,6 +1362,8 @@ class EISZeroOneDataDecoder(RecDataDecoder):
self._cali_coeff: Optional[bytes] = None self._cali_coeff: Optional[bytes] = None
self.cali_coeff: Optional[List[Tuple[int, int]]] = None self.cali_coeff: Optional[List[Tuple[int, int]]] = None
self._show_data = False
if cali_coeff is not None: if cali_coeff is not None:
self._cali_coeff = cali_coeff self._cali_coeff = cali_coeff
self.cali_coeff = self._decode_cali_coeff(cali_coeff) self.cali_coeff = self._decode_cali_coeff(cali_coeff)
@@ -1546,33 +1548,33 @@ class EISZeroOneDataDecoder(RecDataDecoder):
imag_after_cal = impedance * math.sin(round(phase) * math.pi / 180) imag_after_cal = impedance * math.sin(round(phase) * math.pi / 180)
real_after_cal = impedance * math.cos(round(phase) * math.pi / 180) real_after_cal = impedance * math.cos(round(phase) * math.pi / 180)
if self._show_data:
if (self._mode == 0): if (self._mode == 0):
# print('|', '{:10}'.format(time_stamp), print('|', '{:10}'.format(time_stamp),
# '|', '{:5}'.format(delta), '|', '{:5}'.format(delta),
# '|', '{:6}'.format(ch1), '|', '{:6}'.format(ch1),
# '|', '{:6}'.format(ch2), '|', '{:6}'.format(ch2),
# '|', '{:8}'.format(ch3 / 100), '|', '{:8}'.format(ch3 / 100),
# '|', '{:6}'.format(round(voltage_mag)), '|', '{:6}'.format(round(voltage_mag)),
# '|', '{:5}'.format(int(imag_after_cal)), '|', '{:5}'.format(int(imag_after_cal)),
# '|', '{:5}'.format(int(real_after_cal)), '|', '{:5}'.format(int(real_after_cal)),
# '|', '{:5}'.format(round(impedance)), '|', '{:5}'.format(round(impedance)),
# '|', '{:5}'.format(round(phase, 1)), '|', '{:5}'.format(round(phase, 1)),
# '|', '{:5}'.format(round(current, 3)), '|', '{:5}'.format(round(current, 3)),
# '|', '{:1}'.format(gain), '|', '{:1}'.format(gain),
# '|', '{:1}'.format(finishMode), '|', '{:1}'.format(finishMode),
# '@', str(self.device), '|') '@', str(self.device), '|')
pass pass
else: else:
# print('|', '{:10}'.format(time_stamp), print('|', '{:10}'.format(time_stamp),
# '|', '{:5}'.format(delta), '|', '{:5}'.format(delta),
# '|', '{:5}'.format(ch1), '|', '{:5}'.format(ch1),
# '|', '{:5}'.format(ch2), '|', '{:5}'.format(ch2),
# '|', '{:5}'.format(ch3), '|', '{:5}'.format(ch3),
# '|', '{:5}'.format(cycle_number), '|', '{:5}'.format(cycle_number),
# '|', '{:1}'.format(gain), '|', '{:1}'.format(gain),
# '|', '{:1}'.format(finishMode), '|', '{:1}'.format(finishMode),
# '@', str(self.device), '|') '@', str(self.device), '|')
pass pass
if finishMode == True: if finishMode == True:
@@ -1203,7 +1203,7 @@
"pe": "SAMPLE_RATE" "pe": "SAMPLE_RATE"
}, },
"data": [ "data": [
"X07;", "X0C;",
"B>va;4B>vb;2B>vc;2B>vd;", "B>va;4B>vb;2B>vc;2B>vd;",
"4b>pa;4b>pb;", "4b>pa;4b>pb;",
"4b>pc;4b>pd;", "4b>pc;4b>pd;",
@@ -671,6 +671,17 @@
}, },
"on_change": "set_para_DAC_VOLT" "on_change": "set_para_DAC_VOLT"
}, },
"DAC_VOLT_SCROLL": {
"description": "DAC scroll output Voltage",
"record_meta": true,
"initial": 25000,
"domain": [
65536
],
"value": {
"expression": "VALUE"
}
},
"ADC_VALUE_I": { "ADC_VALUE_I": {
"description": "ADC value current value", "description": "ADC value current value",
"domain": "int" "domain": "int"
@@ -836,6 +847,18 @@
], ],
"on_change": "set_dac_gain_Vout" "on_change": "set_dac_gain_Vout"
}, },
"DAC_VOLT_BUTTON": {
"description": "DAC volt",
"record_meta": true,
"initial": 1,
"value": [
"10000",
"25000",
"50000",
"60000"
],
"on_change": "cali_Vout"
},
"CTRL_HIGH_Z_15": { "CTRL_HIGH_Z_15": {
"description": "ctrl highZ level", "description": "ctrl highZ level",
"record_meta": true, "record_meta": true,
@@ -851,7 +874,8 @@
"initial": 0, "initial": 0,
"value": [ "value": [
"Iin", "Iin",
"Vin" "Vin",
"Vout"
] ]
}, },
"BLE_WRITE": { "BLE_WRITE": {
@@ -912,11 +936,13 @@
"_notify(True)", "_notify(True)",
"set_adc_gain_I", "set_adc_gain_I",
"set_adc_gain_Vin", "set_adc_gain_Vin",
"set_dac_gain_Vout",
{ {
"expression": "ADC_DAC_CHANNEL_15", "expression": "ADC_DAC_CHANNEL_15",
"when": { "when": {
"0": "cali_Iin", "0": "cali_Iin",
"1": "cali_Vin" "1": "cali_Vin",
"2": "cali_Vout"
} }
}, },
"_sync(True)", "_sync(True)",
@@ -1007,12 +1033,6 @@
"XE0;2B>va" "XE0;2B>va"
] ]
}, },
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_adc_gain_I": { "set_adc_gain_I": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -1025,6 +1045,12 @@
"XE1;X01;B>ADC_LEVEL_V_IN_15" "XE1;X01;B>ADC_LEVEL_V_IN_15"
] ]
}, },
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_ctrl_highZ": { "set_ctrl_highZ": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -1052,6 +1078,15 @@
"XF1;B>ADC_DAC_CHANNEL_15;B>ADC_LEVEL_V_IN_15" "XF1;B>ADC_DAC_CHANNEL_15;B>ADC_LEVEL_V_IN_15"
] ]
}, },
"cali_Vout": {
"type": "RIS",
"parameter": {
"v": "DAC_VOLT_BUTTON"
},
"data": [
"XF1;B>ADC_DAC_CHANNEL_15;B>v"
]
},
"curve_iv": { "curve_iv": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
@@ -1203,7 +1238,7 @@
"pe": "SAMPLE_RATE" "pe": "SAMPLE_RATE"
}, },
"data": [ "data": [
"X07;", "X0C;",
"B>va;4B>vb;2B>vc;2B>vd;", "B>va;4B>vb;2B>vc;2B>vd;",
"4b>pa;4b>pb;", "4b>pa;4b>pb;",
"4b>pc;4b>pd;", "4b>pc;4b>pd;",
@@ -671,6 +671,17 @@
}, },
"on_change": "set_para_DAC_VOLT" "on_change": "set_para_DAC_VOLT"
}, },
"DAC_VOLT_SCROLL": {
"description": "DAC scroll output Voltage",
"record_meta": true,
"initial": 25000,
"domain": [
65536
],
"value": {
"expression": "VALUE"
}
},
"ADC_VALUE_I": { "ADC_VALUE_I": {
"description": "ADC value current value", "description": "ADC value current value",
"domain": "int" "domain": "int"
@@ -836,6 +847,18 @@
], ],
"on_change": "set_dac_gain_Vout" "on_change": "set_dac_gain_Vout"
}, },
"DAC_VOLT_BUTTON": {
"description": "DAC volt",
"record_meta": true,
"initial": 1,
"value": [
"10000",
"25000",
"50000",
"60000"
],
"on_change": "cali_Vout"
},
"CTRL_HIGH_Z_15": { "CTRL_HIGH_Z_15": {
"description": "ctrl highZ level", "description": "ctrl highZ level",
"record_meta": true, "record_meta": true,
@@ -851,7 +874,8 @@
"initial": 0, "initial": 0,
"value": [ "value": [
"Iin", "Iin",
"Vin" "Vin",
"Vout"
] ]
}, },
"BLE_WRITE": { "BLE_WRITE": {
@@ -912,11 +936,13 @@
"_notify(True)", "_notify(True)",
"set_adc_gain_I", "set_adc_gain_I",
"set_adc_gain_Vin", "set_adc_gain_Vin",
"set_dac_gain_Vout",
{ {
"expression": "ADC_DAC_CHANNEL_15", "expression": "ADC_DAC_CHANNEL_15",
"when": { "when": {
"0": "cali_Iin", "0": "cali_Iin",
"1": "cali_Vin" "1": "cali_Vin",
"2": "cali_Vout"
} }
}, },
"_sync(True)", "_sync(True)",
@@ -1007,12 +1033,6 @@
"XE0;2B>va" "XE0;2B>va"
] ]
}, },
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_adc_gain_I": { "set_adc_gain_I": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -1025,6 +1045,12 @@
"XE1;X01;B>ADC_LEVEL_V_IN_15" "XE1;X01;B>ADC_LEVEL_V_IN_15"
] ]
}, },
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_ctrl_highZ": { "set_ctrl_highZ": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -1052,6 +1078,15 @@
"XF1;B>ADC_DAC_CHANNEL_15;B>ADC_LEVEL_V_IN_15" "XF1;B>ADC_DAC_CHANNEL_15;B>ADC_LEVEL_V_IN_15"
] ]
}, },
"cali_Vout": {
"type": "RIS",
"parameter": {
"v": "DAC_VOLT_BUTTON"
},
"data": [
"XF1;B>ADC_DAC_CHANNEL_15;B>v"
]
},
"curve_iv": { "curve_iv": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
@@ -1203,7 +1238,7 @@
"pe": "SAMPLE_RATE" "pe": "SAMPLE_RATE"
}, },
"data": [ "data": [
"X07;", "X0C;",
"B>va;4B>vb;2B>vc;2B>vd;", "B>va;4B>vb;2B>vc;2B>vd;",
"4b>pa;4b>pb;", "4b>pa;4b>pb;",
"4b>pc;4b>pd;", "4b>pc;4b>pd;",
@@ -671,6 +671,17 @@
}, },
"on_change": "set_para_DAC_VOLT" "on_change": "set_para_DAC_VOLT"
}, },
"DAC_VOLT_SCROLL": {
"description": "DAC scroll output Voltage",
"record_meta": true,
"initial": 25000,
"domain": [
65536
],
"value": {
"expression": "VALUE"
}
},
"ADC_VALUE_I": { "ADC_VALUE_I": {
"description": "ADC value current value", "description": "ADC value current value",
"domain": "int" "domain": "int"
@@ -836,6 +847,18 @@
], ],
"on_change": "set_dac_gain_Vout" "on_change": "set_dac_gain_Vout"
}, },
"DAC_VOLT_BUTTON": {
"description": "DAC volt",
"record_meta": true,
"initial": 1,
"value": [
"10000",
"25000",
"50000",
"60000"
],
"on_change": "cali_Vout"
},
"CTRL_HIGH_Z_15": { "CTRL_HIGH_Z_15": {
"description": "ctrl highZ level", "description": "ctrl highZ level",
"record_meta": true, "record_meta": true,
@@ -851,7 +874,8 @@
"initial": 0, "initial": 0,
"value": [ "value": [
"Iin", "Iin",
"Vin" "Vin",
"Vout"
] ]
}, },
"BLE_WRITE": { "BLE_WRITE": {
@@ -912,11 +936,13 @@
"_notify(True)", "_notify(True)",
"set_adc_gain_I", "set_adc_gain_I",
"set_adc_gain_Vin", "set_adc_gain_Vin",
"set_dac_gain_Vout",
{ {
"expression": "ADC_DAC_CHANNEL_15", "expression": "ADC_DAC_CHANNEL_15",
"when": { "when": {
"0": "cali_Iin", "0": "cali_Iin",
"1": "cali_Vin" "1": "cali_Vin",
"2": "cali_Vout"
} }
}, },
"_sync(True)", "_sync(True)",
@@ -1007,12 +1033,6 @@
"XE0;2B>va" "XE0;2B>va"
] ]
}, },
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_adc_gain_I": { "set_adc_gain_I": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -1025,6 +1045,12 @@
"XE1;X01;B>ADC_LEVEL_V_IN_15" "XE1;X01;B>ADC_LEVEL_V_IN_15"
] ]
}, },
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_ctrl_highZ": { "set_ctrl_highZ": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -1052,6 +1078,15 @@
"XF1;B>ADC_DAC_CHANNEL_15;B>ADC_LEVEL_V_IN_15" "XF1;B>ADC_DAC_CHANNEL_15;B>ADC_LEVEL_V_IN_15"
] ]
}, },
"cali_Vout": {
"type": "RIS",
"parameter": {
"v": "DAC_VOLT_BUTTON"
},
"data": [
"XF1;B>ADC_DAC_CHANNEL_15;B>v"
]
},
"curve_iv": { "curve_iv": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
@@ -62,6 +62,7 @@
"value": [ "value": [
"EIS CURVE", "EIS CURVE",
"Cyclic Voltammetry", "Cyclic Voltammetry",
"Chronoamperometric",
"Dev Mode" "Dev Mode"
] ]
}, },
@@ -265,6 +266,17 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"BLE_WRITE": { "BLE_WRITE": {
"description": "send msg to elite", "description": "send msg to elite",
"domain": { "domain": {
@@ -295,20 +307,23 @@
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"1": "set_adc_gain_I" "1": "set_adc_gain_I",
"2": "set_adc_gain_I"
} }
}, },
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"1": "set_adc_gain_Vin" "1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
} }
}, },
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"0": "curve_eis", "0": "curve_eis",
"1": "curve_cv3" "1": "curve_cv3",
"2": "curve_const_vscan"
} }
}, },
{ {
@@ -424,6 +439,23 @@
"1XD2;1X02;4B>ve;2B>vf;2B>cn" "1XD2;1X02;4B>ve;2B>vf;2B>cn"
] ]
}, },
"curve_const_vscan": {
"type": "RIS",
"parameter": {
"va": "VOLT_VSCAN",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"1XD3;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"ble_instru_send": [ "ble_instru_send": [
"ble_write", "ble_write",
"_cdr('20X>ADC_VALUE_I')" "_cdr('20X>ADC_VALUE_I')"
@@ -62,6 +62,7 @@
"value": [ "value": [
"EIS CURVE", "EIS CURVE",
"Cyclic Voltammetry", "Cyclic Voltammetry",
"Chronoamperometric",
"Dev Mode" "Dev Mode"
] ]
}, },
@@ -265,6 +266,17 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"BLE_WRITE": { "BLE_WRITE": {
"description": "send msg to elite", "description": "send msg to elite",
"domain": { "domain": {
@@ -295,20 +307,23 @@
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"1": "set_adc_gain_I" "1": "set_adc_gain_I",
"2": "set_adc_gain_I"
} }
}, },
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"1": "set_adc_gain_Vin" "1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
} }
}, },
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"0": "curve_eis", "0": "curve_eis",
"1": "curve_cv3" "1": "curve_cv3",
"2": "curve_const_vscan"
} }
}, },
{ {
@@ -424,6 +439,23 @@
"1XD2;1X02;4B>ve;2B>vf;2B>cn" "1XD2;1X02;4B>ve;2B>vf;2B>cn"
] ]
}, },
"curve_const_vscan": {
"type": "RIS",
"parameter": {
"va": "VOLT_VSCAN",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"1XD3;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"ble_instru_send": [ "ble_instru_send": [
"ble_write", "ble_write",
"_cdr('20X>ADC_VALUE_I')" "_cdr('20X>ADC_VALUE_I')"
@@ -62,6 +62,7 @@
"value": [ "value": [
"EIS CURVE", "EIS CURVE",
"Cyclic Voltammetry", "Cyclic Voltammetry",
"Chronoamperometric",
"Dev Mode" "Dev Mode"
] ]
}, },
@@ -265,6 +266,17 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"BLE_WRITE": { "BLE_WRITE": {
"description": "send msg to elite", "description": "send msg to elite",
"domain": { "domain": {
@@ -295,20 +307,23 @@
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"1": "set_adc_gain_I" "1": "set_adc_gain_I",
"2": "set_adc_gain_I"
} }
}, },
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"1": "set_adc_gain_Vin" "1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
} }
}, },
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"0": "curve_eis", "0": "curve_eis",
"1": "curve_cv3" "1": "curve_cv3",
"2": "curve_const_vscan"
} }
}, },
{ {
@@ -424,6 +439,23 @@
"1XD2;1X02;4B>ve;2B>vf;2B>cn" "1XD2;1X02;4B>ve;2B>vf;2B>cn"
] ]
}, },
"curve_const_vscan": {
"type": "RIS",
"parameter": {
"va": "VOLT_VSCAN",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"1XD3;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"ble_instru_send": [ "ble_instru_send": [
"ble_write", "ble_write",
"_cdr('20X>ADC_VALUE_I')" "_cdr('20X>ADC_VALUE_I')"