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
+31 -29
View File
@@ -1338,7 +1338,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
'_total_time_stamp', '_mode', '_cycle_start_time',
'_mode_stop', '_last_time_stamp', '_last_delta', '_cali_coeff',
'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):
super().__init__()
@@ -1362,6 +1362,8 @@ class EISZeroOneDataDecoder(RecDataDecoder):
self._cali_coeff: Optional[bytes] = None
self.cali_coeff: Optional[List[Tuple[int, int]]] = None
self._show_data = False
if cali_coeff is not None:
self._cali_coeff = cali_coeff
self.cali_coeff = self._decode_cali_coeff(cali_coeff)
@@ -1546,34 +1548,34 @@ class EISZeroOneDataDecoder(RecDataDecoder):
imag_after_cal = impedance * math.sin(round(phase) * math.pi / 180)
real_after_cal = impedance * math.cos(round(phase) * math.pi / 180)
if (self._mode == 0):
# print('|', '{:10}'.format(time_stamp),
# '|', '{:5}'.format(delta),
# '|', '{:6}'.format(ch1),
# '|', '{:6}'.format(ch2),
# '|', '{:8}'.format(ch3 / 100),
# '|', '{:6}'.format(round(voltage_mag)),
# '|', '{:5}'.format(int(imag_after_cal)),
# '|', '{:5}'.format(int(real_after_cal)),
# '|', '{:5}'.format(round(impedance)),
# '|', '{:5}'.format(round(phase, 1)),
# '|', '{:5}'.format(round(current, 3)),
# '|', '{:1}'.format(gain),
# '|', '{:1}'.format(finishMode),
# '@', str(self.device), '|')
pass
else:
# print('|', '{:10}'.format(time_stamp),
# '|', '{:5}'.format(delta),
# '|', '{:5}'.format(ch1),
# '|', '{:5}'.format(ch2),
# '|', '{:5}'.format(ch3),
# '|', '{:5}'.format(cycle_number),
# '|', '{:1}'.format(gain),
# '|', '{:1}'.format(finishMode),
# '@', str(self.device), '|')
pass
if self._show_data:
if (self._mode == 0):
print('|', '{:10}'.format(time_stamp),
'|', '{:5}'.format(delta),
'|', '{:6}'.format(ch1),
'|', '{:6}'.format(ch2),
'|', '{:8}'.format(ch3 / 100),
'|', '{:6}'.format(round(voltage_mag)),
'|', '{:5}'.format(int(imag_after_cal)),
'|', '{:5}'.format(int(real_after_cal)),
'|', '{:5}'.format(round(impedance)),
'|', '{:5}'.format(round(phase, 1)),
'|', '{:5}'.format(round(current, 3)),
'|', '{:1}'.format(gain),
'|', '{:1}'.format(finishMode),
'@', str(self.device), '|')
pass
else:
print('|', '{:10}'.format(time_stamp),
'|', '{:5}'.format(delta),
'|', '{:5}'.format(ch1),
'|', '{:5}'.format(ch2),
'|', '{:5}'.format(ch3),
'|', '{:5}'.format(cycle_number),
'|', '{:1}'.format(gain),
'|', '{:1}'.format(finishMode),
'@', str(self.device), '|')
pass
if finishMode == True:
print("finishMode full data:", list(data), datetime.now())
@@ -1203,7 +1203,7 @@
"pe": "SAMPLE_RATE"
},
"data": [
"X07;",
"X0C;",
"B>va;4B>vb;2B>vc;2B>vd;",
"4b>pa;4b>pb;",
"4b>pc;4b>pd;",
@@ -671,6 +671,17 @@
},
"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": {
"description": "ADC value current value",
"domain": "int"
@@ -836,6 +847,18 @@
],
"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": {
"description": "ctrl highZ level",
"record_meta": true,
@@ -851,7 +874,8 @@
"initial": 0,
"value": [
"Iin",
"Vin"
"Vin",
"Vout"
]
},
"BLE_WRITE": {
@@ -912,11 +936,13 @@
"_notify(True)",
"set_adc_gain_I",
"set_adc_gain_Vin",
"set_dac_gain_Vout",
{
"expression": "ADC_DAC_CHANNEL_15",
"when": {
"0": "cali_Iin",
"1": "cali_Vin"
"1": "cali_Vin",
"2": "cali_Vout"
}
},
"_sync(True)",
@@ -1007,12 +1033,6 @@
"XE0;2B>va"
]
},
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_adc_gain_I": {
"type": "RIS",
"data": [
@@ -1025,6 +1045,12 @@
"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": {
"type": "RIS",
"data": [
@@ -1052,6 +1078,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": {
"type": "RIS",
"parameter": {
@@ -1203,7 +1238,7 @@
"pe": "SAMPLE_RATE"
},
"data": [
"X07;",
"X0C;",
"B>va;4B>vb;2B>vc;2B>vd;",
"4b>pa;4b>pb;",
"4b>pc;4b>pd;",
@@ -671,6 +671,17 @@
},
"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": {
"description": "ADC value current value",
"domain": "int"
@@ -836,6 +847,18 @@
],
"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": {
"description": "ctrl highZ level",
"record_meta": true,
@@ -851,7 +874,8 @@
"initial": 0,
"value": [
"Iin",
"Vin"
"Vin",
"Vout"
]
},
"BLE_WRITE": {
@@ -912,11 +936,13 @@
"_notify(True)",
"set_adc_gain_I",
"set_adc_gain_Vin",
"set_dac_gain_Vout",
{
"expression": "ADC_DAC_CHANNEL_15",
"when": {
"0": "cali_Iin",
"1": "cali_Vin"
"1": "cali_Vin",
"2": "cali_Vout"
}
},
"_sync(True)",
@@ -1007,12 +1033,6 @@
"XE0;2B>va"
]
},
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_adc_gain_I": {
"type": "RIS",
"data": [
@@ -1025,6 +1045,12 @@
"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": {
"type": "RIS",
"data": [
@@ -1052,6 +1078,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": {
"type": "RIS",
"parameter": {
@@ -1203,7 +1238,7 @@
"pe": "SAMPLE_RATE"
},
"data": [
"X07;",
"X0C;",
"B>va;4B>vb;2B>vc;2B>vd;",
"4b>pa;4b>pb;",
"4b>pc;4b>pd;",
@@ -671,6 +671,17 @@
},
"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": {
"description": "ADC value current value",
"domain": "int"
@@ -836,6 +847,18 @@
],
"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": {
"description": "ctrl highZ level",
"record_meta": true,
@@ -851,7 +874,8 @@
"initial": 0,
"value": [
"Iin",
"Vin"
"Vin",
"Vout"
]
},
"BLE_WRITE": {
@@ -912,11 +936,13 @@
"_notify(True)",
"set_adc_gain_I",
"set_adc_gain_Vin",
"set_dac_gain_Vout",
{
"expression": "ADC_DAC_CHANNEL_15",
"when": {
"0": "cali_Iin",
"1": "cali_Vin"
"1": "cali_Vin",
"2": "cali_Vout"
}
},
"_sync(True)",
@@ -1007,12 +1033,6 @@
"XE0;2B>va"
]
},
"set_dac_gain_Vout": {
"type": "RIS",
"data": [
"XE1;X02;B>DAC_LEVEL_V_OUT_15"
]
},
"set_adc_gain_I": {
"type": "RIS",
"data": [
@@ -1025,6 +1045,12 @@
"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": {
"type": "RIS",
"data": [
@@ -1052,6 +1078,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": {
"type": "RIS",
"parameter": {
@@ -62,6 +62,7 @@
"value": [
"EIS CURVE",
"Cyclic Voltammetry",
"Chronoamperometric",
"Dev Mode"
]
},
@@ -265,6 +266,17 @@
"expression": "VALUE"
}
},
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"BLE_WRITE": {
"description": "send msg to elite",
"domain": {
@@ -295,20 +307,23 @@
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_I"
"1": "set_adc_gain_I",
"2": "set_adc_gain_I"
}
},
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin"
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
}
},
{
"expression": "MODE",
"when": {
"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"
]
},
"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_write",
"_cdr('20X>ADC_VALUE_I')"
@@ -62,6 +62,7 @@
"value": [
"EIS CURVE",
"Cyclic Voltammetry",
"Chronoamperometric",
"Dev Mode"
]
},
@@ -265,6 +266,17 @@
"expression": "VALUE"
}
},
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"BLE_WRITE": {
"description": "send msg to elite",
"domain": {
@@ -295,20 +307,23 @@
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_I"
"1": "set_adc_gain_I",
"2": "set_adc_gain_I"
}
},
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin"
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
}
},
{
"expression": "MODE",
"when": {
"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"
]
},
"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_write",
"_cdr('20X>ADC_VALUE_I')"
@@ -62,6 +62,7 @@
"value": [
"EIS CURVE",
"Cyclic Voltammetry",
"Chronoamperometric",
"Dev Mode"
]
},
@@ -265,6 +266,17 @@
"expression": "VALUE"
}
},
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"BLE_WRITE": {
"description": "send msg to elite",
"domain": {
@@ -295,20 +307,23 @@
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_I"
"1": "set_adc_gain_I",
"2": "set_adc_gain_I"
}
},
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin"
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
}
},
{
"expression": "MODE",
"when": {
"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"
]
},
"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_write",
"_cdr('20X>ADC_VALUE_I')"