Compare commits

...

45 Commits

Author SHA1 Message Date
Roy 789d9b3a81 [update] fix hstia gain 2022-11-15 11:51:16 +08:00
Roy 0d0427ed14 [update] receive hsrtia & lprtia gain level 2022-11-09 17:19:48 +08:00
Roy d434509c5b [update] new hsrtia function 2022-11-09 16:03:45 +08:00
Roy 787d76d48c [update] update eis instruction 2022-11-08 17:55:20 +08:00
Roy 50f2432088 [update] update number of mode 2022-11-08 17:28:03 +08:00
Roy 1cff19ac58 [update] update GENERAL_HS_RTIA parameter 2022-11-08 16:13:20 +08:00
Roy baef447c0e [update] update EIS_AVERAGE_NUM parameter 2022-11-08 15:57:52 +08:00
Roy ee9c13d4c5 [update] update EIS_DELAY parameter 2022-11-08 15:44:57 +08:00
Roy 9076f2f10b [update] update EIS_SCALE parameter 2022-11-08 15:36:22 +08:00
Roy 9b2e2964b0 [update] update EIS_PPD parameter 2022-11-08 14:49:07 +08:00
Roy 2622109c89 [update] update EIS_FREQ parameter 2022-11-08 14:35:32 +08:00
Roy a3fe6b87af [update] update EIS_AC_AMP parameter 2022-11-08 14:24:07 +08:00
Roy 64419ca1c5 [update] update EIS_DC_BIAS parameter 2022-11-08 14:17:31 +08:00
Roy 7d77c44741 [update] update EIS_FREQ parameter 2022-11-08 12:09:42 +08:00
Roy 29b4dd5cc7 [update] update EIS_FREQ parameter 2022-11-08 12:07:49 +08:00
Roy f151ae6fce [update] delete FREQ_START & FREQ_STOP parameter 2022-11-08 11:08:01 +08:00
peterlu14 e535e3d2b1 Merge remote-tracking branch 'origin/EIS_10test' into release/v1.7.0/fix_EIS_freq-RT 2022-11-08 09:38:19 +08:00
10 06c36aa737 Merge remote-tracking branch 'origin/dev/RT_mode' into EIS_10test 2022-11-07 16:54:28 +08:00
10 402022c451 cutoff freq 2022-11-07 16:44:54 +08:00
Roy 4daff72d39 [update] update RT mode 2022-10-27 17:43:16 +08:00
Roy f99719832a [update] short instruction for RT mode 2022-10-27 17:13:38 +08:00
Roy 58e09bfcda [update] hide mem board message 2022-10-26 10:23:50 +08:00
Roy 55780514b9 [update] new RT mode 2022-10-26 10:23:12 +08:00
peterlu14 936514871f [update] timeout 3 -> 5 2022-10-18 11:23:53 +08:00
peterlu14 f25d9221c6 Merge branch 'release/v1.6.9/fix_phase_90ToN90' into release/v1.6.7/scheduler_debug 2022-10-14 10:53:40 +08:00
peterlu14 2ee9fa6b19 [update] project device change 2022-10-14 10:52:41 +08:00
10 fcc39dbfed Merge branch 'release/v1.6.9/fix_phase_90ToN90' into EIS_10test 2022-10-13 15:28:39 +08:00
10 e2f7bba961 fix phase in PEIS mode 2022-10-13 15:27:27 +08:00
10 1174d54bc0 fix phase in PEIS mode 2022-10-13 15:13:00 +08:00
peterlu14 bff75dc49e Merge commit '35912f614e7283bb4b8df5355952162fea9a9395' into release/v1.6.9/fix_phase_90ToN90 2022-10-12 17:18:49 +08:00
peterlu14 35912f614e [update] EIS Mini vt mode add 2022-10-12 17:18:14 +08:00
10 cfc4e39c8a force raw phase and raw phase - ideal phase stay in [90, -90) in PEIS mode 2022-10-12 16:41:55 +08:00
10 8c4916d1e8 fix phase calibration 2022-10-11 17:19:40 +08:00
Roy e3c252f204 [update] FREQ 133333 2022-10-05 11:58:37 +08:00
Roy c2164da48b [update] new vt mode on EIS 2022-10-05 11:16:09 +08:00
Roy ab2d746afb Merge branch 'release/v1.6.7/scheduler_cycle' into release/v1.6.7/scheduler_debug 2022-10-05 10:57:53 +08:00
Roy 8a870a860a [update] socket listen 3 -> 20 2022-10-05 10:57:30 +08:00
Roy f4c5cf0135 [update] socket timeout 1s -> 3s 2022-10-04 13:53:53 +08:00
Roy 1f01fd3b9b [update] count +1 when start 2022-10-04 13:53:30 +08:00
Roy d1fe388c27 [debug] fix multi device in one project stop problem 2022-10-04 13:42:03 +08:00
Roy 91d5e73c5e [debug] fix after task run equal error 2022-10-04 13:41:37 +08:00
Roy d1b6c2892f [debug] configurations key error 2022-10-04 13:18:38 +08:00
Roy 4243a13536 Merge remote-tracking branch 'origin/dev/fix_no_data' into release/v1.6.7/scheduler_debug 2022-09-30 10:58:41 +08:00
Roy 97188abff8 [update] uart write timeout 0.01 -> 1 2022-09-30 10:56:47 +08:00
Roy 9d8178d11a [update] add project cycle 2022-09-30 10:56:37 +08:00
17 changed files with 739 additions and 473 deletions
+3
View File
@@ -1589,6 +1589,9 @@ class ControlAPI(metaclass=Router):
def set_project(self, project, content) -> bool: def set_project(self, project, content) -> bool:
raise NotImplementedError() raise NotImplementedError()
def set_project_cycle(self, project, index, content) -> bool:
raise NotImplementedError()
def show_device_data(self, device) -> bool: def show_device_data(self, device) -> bool:
raise NotImplementedError() raise NotImplementedError()
+30 -32
View File
@@ -1346,8 +1346,8 @@ class EISZeroOneDataDecoder(RecDataDecoder):
__slots__ = ('_message', '_cycle_number', '_start_return_data', '_time_stamp', __slots__ = ('_message', '_cycle_number', '_start_return_data', '_time_stamp',
'_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_direction', '_last_phase', '_first_phase_flag', '_show_data') '_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,9 +1362,6 @@ class EISZeroOneDataDecoder(RecDataDecoder):
self._cycle_start_time = [] self._cycle_start_time = []
self._ac_amp: int = 0 self._ac_amp: int = 0
self._mode: int = 0 self._mode: int = 0
self._freq_start: int = 0
self._freq_stop: int = 0
self._freq_direction = 0
self._last_phase = 0 self._last_phase = 0
self._first_phase_flag = 1 self._first_phase_flag = 1
@@ -1429,25 +1426,25 @@ class EISZeroOneDataDecoder(RecDataDecoder):
index = 60 index = 60
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8) 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_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_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
#Lv[1] 20k #Lv[1] 20k
index = 80 index = 80
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8) 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_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_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
#Lv[2] 5k #Lv[2] 5k
index = 100 index = 100
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8) 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_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_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
#Lv[3] 200R #Lv[3] 200R
index = 120 index = 120
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8) 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_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_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
index = 140 index = 140
g = 1 g = 1
@@ -1530,7 +1527,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
time_stamp: float = struct.unpack('<I', data[13+3:17+3])[0] # unit: ms time_stamp: float = struct.unpack('<I', data[13+3:17+3])[0] # unit: ms
cycle_number = struct.unpack('>H', data[17+3:19+3])[0] cycle_number = struct.unpack('>H', data[17+3:19+3])[0]
d19 = data[19+3] d19 = data[19+3]
gain = (d19 & 0x0F) gain = data[20+3]
finishMode = (d19 & 0x80) >> 7 finishMode = (d19 & 0x80) >> 7
if time_stamp == 0: if time_stamp == 0:
@@ -1557,10 +1554,6 @@ class EISZeroOneDataDecoder(RecDataDecoder):
cutoff_freq, phase_coeff, phase_offset, hsrtia_a, hsrtia_b, hsrtia_c, hsrtia_d = self.cali_coeff[0] cutoff_freq, phase_coeff, phase_offset, hsrtia_a, hsrtia_b, hsrtia_c, hsrtia_d = self.cali_coeff[0]
voltage_amp = round(self._ac_amp * 800 / 2047) # use UI value voltage_amp = round(self._ac_amp * 800 / 2047) # use UI value
if (self._freq_start > self._freq_stop):
self._freq_direction = 0
else:
self._freq_direction = 1
if (self._mode == 0): if (self._mode == 0):
img = ch1 img = ch1
@@ -1568,12 +1561,17 @@ class EISZeroOneDataDecoder(RecDataDecoder):
freq = ch3 freq = ch3
fre_idx = 0 fre_idx = 0
voltage_mag = math.sqrt(img ** 2 + real ** 2) * (1 + freq ** 2 / cutoff_freq ** 2) rolloff_cali = cutoff_freq/1e5
voltage_mag = math.sqrt(img ** 2 + real ** 2) * (1 + freq ** 2 / rolloff_cali ** 2 / 1e4)
# if (gain == 3): # if (gain == 3):
# current = hsrtia_a[gain] * math.exp(hsrtia_b[gain] * voltage_mag) + hsrtia_c[gain] * math.exp(hsrtia_d[gain] * voltage_mag) # current = hsrtia_a[gain] * math.exp(hsrtia_b[gain] * voltage_mag) + hsrtia_c[gain] * math.exp(hsrtia_d[gain] * voltage_mag)
# else: # else:
current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain] + hsrtia_c[gain]
current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain]
# current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain] + hsrtia_c[gain]
# print(current) # print(current)
# print(voltage_mag) # print(voltage_mag)
# print(hsrtia_a[gain]) # print(hsrtia_a[gain])
@@ -1586,12 +1584,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
else: else:
impedance = 0 impedance = 0
if (real > 0): raw_phase = math.atan2(img , real) * 180 / math.pi
raw_phase = math.atan(img / real) * 180 / math.pi
elif (real == 0):
raw_phase = 90
else:
raw_phase = math.atan(img / real) * 180 / math.pi + 180
if (freq >= 1000000): # 10000 Hz if (freq >= 1000000): # 10000 Hz
fre_idx = 0 fre_idx = 0
@@ -1602,16 +1595,21 @@ class EISZeroOneDataDecoder(RecDataDecoder):
elif (freq >= 1): # 0.01 Hz elif (freq >= 1): # 0.01 Hz
fre_idx = 3 fre_idx = 3
ideal_raw_phase = phase_coeff[fre_idx][gain] /1e10 * freq + phase_offset[fre_idx][gain] / 1e6 ideal_raw_phase = phase_coeff[gain][fre_idx] /1e10 * freq + phase_offset[gain][fre_idx] / 1e6
phase = raw_phase - ideal_raw_phase phase = raw_phase - ideal_raw_phase
phase = phase % 180 if phase % 180<=90 else phase % 180-180
if (self._first_phase_flag): # last_phase_to90 = self._last_phase % 180 if self._last_phase % 180<=90 else self._last_phase % 180-180
self._last_phase = phase # diff = phase - last_phase_to90
self._first_phase_flag = 0
elif (abs(phase - self._last_phase) >= 90): # if (self._first_phase_flag):
phase -= 360 # # self._last_phase = phase
self._last_phase = phase # self._first_phase_flag = 0
# elif (abs(diff) >= 90):
# phase = self._last_phase + diff + (180 if diff<0 else-180)
# else:
# phase = self._last_phase + diff
# self._last_phase = phase
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)
@@ -1631,7 +1629,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
'|', '{: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), '|', flush = True)
pass pass
else: else:
print('|', '{:10}'.format(time_stamp), print('|', '{:10}'.format(time_stamp),
@@ -1642,7 +1640,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
'|', '{: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), '|', flush = True)
pass pass
if finishMode == True: if finishMode == True:
+1 -1
View File
@@ -1032,7 +1032,7 @@ class CompletedDevice(Device):
@property @property
def mac_address_in_str(self) -> str: def mac_address_in_str(self) -> str:
return ':'.join('{:02x}'.format(b) for b in self._device.mac_address) return ':'.join('{:02x}'.format(b) for b in self._device.mac_address).upper()
@property @property
def device(self) -> Device: def device(self) -> Device:
+2 -2
View File
@@ -227,7 +227,7 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
def recv_memory(self, device: int) -> Optional[bytes]: def recv_memory(self, device: int) -> Optional[bytes]:
# self.pin_busy.output(False) # self.pin_busy.output(False)
print('mem_req==ram_sel,[', self._pin_mem_req_value[device], ',', self._pin_ram_sel_value[device], ']') # print('mem_req==ram_sel,[', self._pin_mem_req_value[device], ',', self._pin_ram_sel_value[device], ']')
rx = [] rx = []
@@ -312,7 +312,7 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
return None return None
# print('data=', list(data)) # print('data=', list(data))
print('Ram:', data[62]) # print('Ram:', data[62])
if (length >= 4000): if (length >= 4000):
flag_print = True flag_print = True
+1 -1
View File
@@ -28,7 +28,7 @@ class UARTInterface(LowLevelHardwareInterface):
self._serial = serial.Serial(self._port, self._serial = serial.Serial(self._port,
baudrate=self._baudrate, baudrate=self._baudrate,
timeout=0, timeout=0,
writeTimeout=0.01) writeTimeout=1)
# deprecate function name which change at version 3.0 # deprecate function name which change at version 3.0
self._serial.flushInput() self._serial.flushInput()
self._serial.flushOutput() self._serial.flushOutput()
+13 -4
View File
@@ -45,8 +45,8 @@ class Condition():
# print(operator, x, y) # print(operator, x, y)
cases = { cases = {
"equal": lambda a, b: a == b, "equal": lambda a, b: a == b,
"bigger": lambda a, b: a > b, "bigger": lambda a, b: a >= b,
"smaller": lambda a, b: a < b, "smaller": lambda a, b: a <= b,
} }
return cases[operator](x, y) return cases[operator](x, y)
@@ -71,14 +71,23 @@ class Condition():
return self.compareWith(self.comparsion, time_diff, round(int(self._value), 1)) return self.compareWith(self.comparsion, time_diff, round(int(self._value), 1))
def after_task_run(self, **kwargs): def after_task_run(self, **kwargs):
# print('relative_time_from_task', kwargs,kwargs['task_start_time'],kwargs['delay_time']) # print('relative_time_from_task', kwargs['task_start_time'],kwargs['delay_time'])
if len(kwargs['task_start_time']) == 0: if len(kwargs['task_start_time']) == 0:
return False return False
task = kwargs['self_task']
running_task = kwargs['running_task']
task_start_time = kwargs['task_start_time'][-1] task_start_time = kwargs['task_start_time'][-1]
delay_time = kwargs['delay_time'] delay_time = kwargs['delay_time']
time_diff = round(time() - task_start_time - delay_time, 1) time_diff = round(time() - task_start_time - delay_time, 1)
return self.compareWith(self.comparsion, time_diff, round(int(self._value), 1)) # print('real_diff', time() - task_start_time - delay_time)
# print(task.name, task.uuid, time_diff, round(int(self._value), 1), running_task.name, running_task.uuid)
# if round(int(self._value), 1) == 0 and time_diff == 0.1:
# return True
if task.uuid != running_task.uuid:
return False
return self.compareWith('bigger', time_diff, round(int(self._value), 1))
# return self.compareWith(self.comparsion, time_diff, round(int(self._value), 1))
def device(self, **kwargs): def device(self, **kwargs):
print('device') print('device')
+100 -38
View File
@@ -19,7 +19,7 @@ key_list = {
} }
class Project(threading.Thread): class Project(threading.Thread):
def __init__(self, project, device_manager: DeviceManager, mqttThread = None, name="project"): def __init__(self, project, device_manager: DeviceManager, mqttThread = None, log_verbose = None, name="project"):
super(Project, self).__init__(name = name) super(Project, self).__init__(name = name)
self._project = project self._project = project
self._device_manager = device_manager self._device_manager = device_manager
@@ -33,7 +33,7 @@ class Project(threading.Thread):
self._name = None self._name = None
self._desc = None self._desc = None
self._device = None self._device = None
self._complete_device = [] self._complete_device = {}
self._status = 0 self._status = 0
self._instruction_set = Instruction() self._instruction_set = Instruction()
@@ -41,6 +41,12 @@ class Project(threading.Thread):
self._task_manager = None self._task_manager = None
self._cycle = []
self._count = 1 #流水號
self.log_verbose = log_verbose
self.setup_project(project) self.setup_project(project)
self.setup_device(self._device) self.setup_device(self._device)
@@ -50,7 +56,7 @@ class Project(threading.Thread):
key = key_list[key] key = key_list[key]
if key == 'task': if key == 'task':
self._task_manager = TaskManager(project['task']) self._task_manager = TaskManager(project['task'], project['cycle'])
elif key == 'uuid': elif key == 'uuid':
pass pass
else: else:
@@ -58,8 +64,9 @@ class Project(threading.Thread):
def setup_device(self, device_list): def setup_device(self, device_list):
for device in device_list: for device in device_list:
complete_device = self._device_manager.get_device(device['connectDevice']['device_address']) mac_address = device_list[device]['pair']
self._complete_device.append(complete_device) complete_device = self._device_manager.get_device(mac_address)
self._complete_device[device] = complete_device
@property @property
def id(self) -> int: def id(self) -> int:
@@ -85,6 +92,14 @@ class Project(threading.Thread):
def name(self, new_name): def name(self, new_name):
self._name = new_name self._name = new_name
@property
def cycle(self) -> list:
return self._cycle
@cycle.setter
def cycle(self, new_cycle):
self._cycle = new_cycle
@property @property
def desc(self) -> str: def desc(self) -> str:
return self._desc return self._desc
@@ -124,6 +139,7 @@ class Project(threading.Thread):
def run(self): def run(self):
self._status = 1 self._status = 1
self._start_time = time() self._start_time = time()
self.log_verbose('Project ' + self.name + ' start')
self.mqtt_thread.broadcast_command('project:' + self._name + ' start at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]) self.mqtt_thread.broadcast_command('project:' + self._name + ' start at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
while not self._stop_flag : while not self._stop_flag :
@@ -134,10 +150,6 @@ class Project(threading.Thread):
for task in check_list: for task in check_list:
if task != None: if task != None:
now = time() now = time()
# print('round task', task.name)
# print('running task', self._task_manager.running_task.name, self._task_manager.running_task.status)
# if self._task_manager.prev_task != None:
# print('previous_task', self._task_manager.prev_task.name, self._task_manager.prev_task.status)
match_condition_list = task.check_condition( match_condition_list = task.check_condition(
project_start_time = self._start_time, project_start_time = self._start_time,
@@ -146,51 +158,87 @@ class Project(threading.Thread):
previous_task = self._task_manager.prev_task, previous_task = self._task_manager.prev_task,
self_task = task self_task = task
) )
# print('match_condition_list', match_condition_list)
for condition in match_condition_list: for condition in match_condition_list:
# print('\ncondition.type: ', condition.type)
match_action_list = task.get_match_action(condition.id) match_action_list = task.get_match_action(condition.id)
# print('match_action_list', match_action_list)
for action in match_action_list: for action in match_action_list:
# print('action type', action.type) if action.type == 'cycle' and condition.type == 'previous_task_done':
# print('match_action_list len: ', len(match_action_list))
if action.type == 'start' and task.status != 1:
self._task_manager.set_running_task(task)
# Trace
self.mqtt_thread.broadcast_command('project:task ' + task.name + ' start at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]) self.mqtt_thread.broadcast_command('project:task ' + task.name + ' start at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
elif action.type == 'cycle' and task.status != 1:
# TODO: directly goto next without swich cycle as running task
""" if task._cycle_count < task._cycle - 1:
task._cycle_count += 1
cycle_target = self._task_manager.task_list[task._cycle_next - 1] # TODO: not sure deep or shallow
cycle_target.reset()
task = cycle_target """
self._task_manager.set_running_task(task) self._task_manager.set_running_task(task)
elif action.type == 'stop' and len(self._task_manager.running_task.parameter_set) == 0: if action.type == 'cycle' and condition.type == 'until_button_trigger':
self.mqtt_thread.broadcast_command('project:task ' + str(self._task_manager.running_task.name) + ' stop at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
self._task_manager.running_task.stop() self._task_manager.running_task.stop()
if self._task_manager.running_task != None:
if self._task_manager.running_task.uuid == task.uuid and action.type == 'cycle' and condition.type == 'after_task_run':
self._task_manager.running_task.stop()
if action.type == 'start':
if task.status != 1:
self._task_manager.set_running_task(task)
self.mqtt_thread.broadcast_command('project:task ' + task.name + ' start at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
# elif action.type == 'stop':
# self.mqtt_thread.broadcast_command('project:task ' + str(self._task_manager.running_task.name) + ' stop at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
# self._count += 1
# if self.check_running_task_not_run() == True:
# self._task_manager.running_task.stop()
elif action.type == 'idle': elif action.type == 'idle':
self._task_manager.running_task.stop() self._task_manager.running_task.stop()
device = self._complete_device[action.target] instruction_set = None
task_info = task.get_task_info(action)
instruction_set = getattr(self._instruction_set, action.type, None) if action.target is not None:
# print('instruction_set', instruction_set, '\n', action.type) device = self._complete_device[action.target]
# if instruction_set != None and task.cycle == -1: if ((action.type == 'start' and device.status == 0) or (action.type == 'stop' and device.status == 1)):
if instruction_set != None and len(task.parameter_set) > 0: self.log_verbose('Project' + self.name + 'Task ' + task.name + ' match_condition ' + condition.type + ' trigger_action ' + action.type + ' ' + str(action.target))
for instruction in instruction_set: task_info = task.get_task_info(action)
args = list(map(lambda arg: task_info[arg], instruction['arguments'])) instruction_set = getattr(self._instruction_set, action.type, None)
threading.Thread(target=getattr(device, instruction['method'])(*args))
# 檔名修正
# device
task_info['file_name'] += '#' + device.mac_address_in_str[12:].upper()
# 流水號
task_info['file_name'] += '#' + str(self._count)
# 添加cycle資訊
if len(self.cycle) > 0:
index = self._task_manager.get_index_by_task(task)
# get list of cycle determine by index of task
filtered = list(filter(lambda info: self._task_manager.get_index_by_uuid(info['range'][0]) < index and self._task_manager.get_index_by_uuid(info['range'][1]) > index, self.cycle))
if len(filtered) == 0:
pass
elif len(filtered) == 1:
if filtered[0]['useID'] == True:
task_info['file_name'] += '#' + str(filtered[0]['id'])
else:
task_info['file_name'] += '#' + str(filtered[0]['name']) + '-' + str(filtered[0]['count'])
else:
# if multi cycle, then sort by range from task index to cycle start index, then loop concat filename
filtered.sort(key=lambda info: abs(self._task_manager.get_index_by_uuid(info['range'][0]) - index))
for cycle_info in filtered:
if cycle_info['useID'] == True:
task_info['file_name'] += '#' + str(cycle_info['id'])
else:
task_info['file_name'] += '#' + str(cycle_info['name']) + '-' + str(cycle_info['count'])
self.log_verbose('file name ' + task_info['file_name'])
if instruction_set != None and len(task.parameter_set) > 0:
if action.type == 'start':
self._count += 1
for instruction in instruction_set:
print('instruction 1', device, instruction, datetime.now())
args = list(map(lambda arg: task_info[arg], instruction['arguments']))
target=getattr(device, instruction['method'])(*args)
print('instruction 2', device, instruction, datetime.now())
delay_time += (time() - now) delay_time += (time() - now)
# check task not running then stop # check task not running then stop
if self.check_running_task_not_run() == True: if self.check_running_task_not_run() == True:
if self._task_manager.running_task.cycle == -1: if self._task_manager.running_task.type == '':
self.mqtt_thread.broadcast_command('project:task ' + str(self._task_manager.running_task.name) + ' stop at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]) self.mqtt_thread.broadcast_command('project:task ' + str(self._task_manager.running_task.name) + ' stop at ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
self._task_manager.running_task.stop() self._task_manager.running_task.stop()
# self._task_manager.set_running_task(task)
# check project done then close project # check project done then close project
if self.check_project_done() == True: if self.check_project_done() == True:
@@ -228,11 +276,24 @@ class Project(threading.Thread):
def set_content(self, content): def set_content(self, content):
self.running_task.button_trigger = True self.running_task.button_trigger = True
def set_cycle(self, index, content):
# change cycle name
for key in content:
self.cycle[index][key] = content[key]
# change task name
# self._task_manager.get_task_by_uuid(self.cycle[index]['range'][0]).name = content['name']
# self._task_manager.get_task_by_uuid(self.cycle[index]['range'][1]).name = content['name']
def check_running_task_not_run(self): def check_running_task_not_run(self):
# if no running task # if no running task
if self._task_manager.running_task == None: if self._task_manager.running_task == None:
return False return False
# if running is cycle then no need to stop by device
if self._task_manager.running_task.type == 'cycle':
return False
for key in self._task_manager.running_task.action: for key in self._task_manager.running_task.action:
# print('action key', key, self._task_manager.running_task, self._task_manager.running_task.action[key]) # print('action key', key, self._task_manager.running_task, self._task_manager.running_task.action[key])
if len(self._task_manager.running_task.parameter_set) == 0 and self._task_manager.running_task.action[key]['type'] == 'stop': if len(self._task_manager.running_task.parameter_set) == 0 and self._task_manager.running_task.action[key]['type'] == 'stop':
@@ -257,6 +318,7 @@ class Project(threading.Thread):
'status': self._status, 'status': self._status,
'device': self._device, 'device': self._device,
'task': self.task_list, 'task': self.task_list,
'running_task': running_task 'running_task': running_task,
'cycle': self._cycle
} }
return data return data
+7 -2
View File
@@ -9,13 +9,14 @@ def json_stringify(o: Any) -> str:
return _json_stringify(o, separators=(',', ':')) return _json_stringify(o, separators=(',', ':'))
class ProjectManager(): class ProjectManager():
def __init__(self, device_manager: DeviceManager, mqtt_thread=None) : def __init__(self, device_manager: DeviceManager, mqtt_thread=None, log_verbose = None) :
self._project_list = [] self._project_list = []
self._mqtt_thread = mqtt_thread self._mqtt_thread = mqtt_thread
self._device_manager = device_manager self._device_manager = device_manager
self.log_verbose = log_verbose
def create(self, project): def create(self, project):
new_project = Project(project, self._device_manager, self._mqtt_thread) new_project = Project(project, self._device_manager, self._mqtt_thread, self.log_verbose)
self._project_list.append(new_project) self._project_list.append(new_project)
return new_project return new_project
@@ -41,3 +42,7 @@ class ProjectManager():
def set_project(self, project_uuid, content): def set_project(self, project_uuid, content):
_project = self.get(project_uuid) _project = self.get(project_uuid)
_project.set_content(content) _project.set_content(content)
def set_project_cycle(self, project_uuid, index, content):
_project = self.get(project_uuid)
_project.set_cycle(index, content)
+13 -1
View File
@@ -12,6 +12,8 @@ key_list = {
class Task: class Task:
def __init__(self, task): def __init__(self, task):
self._id = None self._id = None
self._uuid = None
self._type = None
self._name = None self._name = None
self._parent = None self._parent = None
self._cycle = None self._cycle = None
@@ -83,6 +85,14 @@ class Task:
def uuid(self, new_uuid): def uuid(self, new_uuid):
self._uuid = new_uuid self._uuid = new_uuid
@property
def type(self):
return self._type
@type.setter
def type(self, new_type):
self._type = new_type
@property @property
def name(self): def name(self):
return self._name return self._name
@@ -275,7 +285,7 @@ class Task:
return { return {
'device': action.target, 'device': action.target,
'parameter': self.get_parameter_set_by_device(action.target), 'parameter': self.get_parameter_set_by_device(action.target),
'file_name': self._name + '-' + str(action.target), 'file_name': self._name,
'parent': self.parent, 'parent': self.parent,
'instruction': _type 'instruction': _type
} }
@@ -285,6 +295,8 @@ class Task:
'id': self.id, 'id': self.id,
'name': self.name, 'name': self.name,
'parent': self.parent, 'parent': self.parent,
'type': self.type,
'uuid': self.uuid,
'cycle': self.cycle, 'cycle': self.cycle,
'cycle_count': self.cycle_count, 'cycle_count': self.cycle_count,
'cycle_next': self.cycle_next, 'cycle_next': self.cycle_next,
+41 -16
View File
@@ -12,11 +12,12 @@ def json_stringify(o: Any) -> str:
return _json_stringify(o, separators=(',', ':')) return _json_stringify(o, separators=(',', ':'))
class TaskManager(): class TaskManager():
def __init__(self, task_list): def __init__(self, task_list, cycle_list):
self._task_list = [] self._task_list = []
self._next_task = [] self._next_task = []
self._prev_task = None self._prev_task = None
self._running_task = None self._running_task = None
self._cycle_list = cycle_list
self.load_task_list(task_list) self.load_task_list(task_list)
@@ -44,6 +45,23 @@ class TaskManager():
def next_task(self): def next_task(self):
return self._next_task return self._next_task
def get_task_by_index(self, index):
return self._task_list[index]
def get_task_by_uuid(self, uuid):
return next((x for x in self.task_list if x.uuid == uuid), None)
def get_index_by_task(self, task):
return next((i for i, x in enumerate(self.task_list) if x.uuid == task.uuid), None)
def get_index_by_uuid(self, uuid):
return next((i for i, x in enumerate(self.task_list) if x.uuid == uuid), None)
def check_task_is_cycle_end(self, task):
for index, cycle in enumerate(self._cycle_list):
if cycle['range'][1] == task.uuid:
return index
@property @property
def check_list(self): def check_list(self):
return [self._running_task, *self._next_task] return [self._running_task, *self._next_task]
@@ -88,37 +106,44 @@ class TaskManager():
try: try:
# if there is task running & same task active ,then reject # if there is task running & same task active ,then reject
if self._running_task != None and self._running_task.uuid == task.uuid: if self._running_task != None and self._running_task.uuid == task.uuid:
# print('set_running_task return false: ', self._running_task.name)
return False return False
# save running task # save task
self._prev_task = self._running_task self._prev_task = self._running_task
# clear next task list # clear next task list
self._next_task.clear() self._next_task.clear()
# set task to running_task
self._running_task = task self._running_task = task
self._running_task.run() self._running_task.run()
# if previous task is still running, then need to close
if self._prev_task != None: if self._prev_task != None:
# if previous task is still running, then need to close
if self._prev_task.status == 1: if self._prev_task.status == 1:
self._prev_task.stop() self._prev_task.stop()
print('prev', 'run', self._prev_task.name, self._running_task.name) # if reach cycle end, count < max, then go to cycle start
cycle_index = self.check_task_is_cycle_end(task)
# print(f'!!@#!set_running_task\n\n\n{task._cycle_count}\n{task._cycle}\n\n\n') if cycle_index is None:
if task._cycle_count < task._cycle - 1: # print('next', self._running_task.name, self._running_task.next)
task._cycle_count += 1
# use uuid to get the cycle next task
cycle_target = [_task_next for _task_next in self._task_list if _task_next.uuid == task._cycle_next_uuid]
# cycle_target = self._task_list[task._cycle_next - 1] # original use index version
cycle_target[0].reset()
self._next_task.append(cycle_target[0])
else:
task._cycle_count = 0
for task_uuid in self._running_task.next: for task_uuid in self._running_task.next:
_task = next((task for task in self._task_list if task.uuid == task_uuid), None) _task = next((task for task in self._task_list if task.uuid == task_uuid), None)
if _task != None: if _task != None:
_task.reset() _task.reset()
self._next_task.append(_task) self._next_task.append(_task)
# print('self._next_task', self._next_task)
else:
# print('cycle', self._cycle_list[cycle_index])
cycle = self._cycle_list[cycle_index]
if int(cycle['count']) < int(cycle['max']):
self._next_task.append(self.get_task_by_uuid(cycle['range'][0]))
cycle['count'] += 1
else:
for task_uuid in self._running_task.next:
_task = next((task for task in self._task_list if task.uuid == task_uuid), None)
if _task != None:
_task.reset()
self._next_task.append(_task)
cycle['count'] = 1
except RuntimeError as e: except RuntimeError as e:
print(e) print(e)
+10 -8
View File
@@ -65,7 +65,7 @@ class DataServer(SocketServer, DataAPI):
""" """
global _FLAG_DATA_LOST_STATS_ global _FLAG_DATA_LOST_STATS_
super().__init__(DataAPI, 'DataServer', self.ADDR, socket_listen=3) super().__init__(DataAPI, 'DataServer', self.ADDR, socket_listen=20)
data_options = DataServerOptions.get_options(*options) data_options = DataServerOptions.get_options(*options)
@@ -656,7 +656,7 @@ class DataServer(SocketServer, DataAPI):
sync = self.get_spi_obj() sync = self.get_spi_obj()
busy = sync.get_pin_busy() busy = sync.get_pin_busy()
print('pin_busy=', busy, device, datetime.now()) # print('pin_busy=', busy, device, datetime.now())
if sync.get_pin_mem_req() == sync.get_pin_ram_sel(): if sync.get_pin_mem_req() == sync.get_pin_ram_sel():
spi_data = sync.recv_memory(device) spi_data = sync.recv_memory(device)
@@ -669,13 +669,15 @@ class DataServer(SocketServer, DataAPI):
print('data=None, mem_req!=ram_sel, [', sync.get_pin_mem_req(), ', ', sync.get_pin_ram_sel(), ']', device, datetime.now()) print('data=None, mem_req!=ram_sel, [', sync.get_pin_mem_req(), ', ', sync.get_pin_ram_sel(), ']', device, datetime.now())
if data is not None: if data is not None:
if self._configurations[device].queue_flag: if self._configurations.get(device, None) != None:
self._configurations[device].queue_flag = False if self._configurations[device].queue_flag:
print("q size= ", self._configurations[device]._queue_rec.qsize()) self._configurations[device].queue_flag = False
print("q size= ", self._configurations[device]._queue_rec.qsize())
self._configurations[device].put_rec_queue(data) if self._configurations.get(device, None) != None:
# self._no_data_total_duration = 0 self._configurations[device].put_rec_queue(data)
ret = True # self._no_data_total_duration = 0
ret = True
# else: # else:
# time_diff = time() - self._recv_memory_cost_time # time_diff = time() - self._recv_memory_cost_time
# self._no_data_total_duration += time_diff # self._no_data_total_duration += time_diff
+7 -1
View File
@@ -105,7 +105,7 @@ class ControlServer(SocketServer, ControlServerAPI):
# device detect # device detect
self._detect_device_thread = RoutineConnectDeviceThread(self._device_manager, self.mqtt_thread, self.led_thread, 3) self._detect_device_thread = RoutineConnectDeviceThread(self._device_manager, self.mqtt_thread, self.led_thread, 3)
self._project_manager = ProjectManager(self.device_manager, self.mqtt_thread) self._project_manager = ProjectManager(self.device_manager, self.mqtt_thread, self.log_verbose)
if not c.flag_disable_led_control: if not c.flag_disable_led_control:
self.led_thread.set_state(LED.COLOR_RED) self.led_thread.set_state(LED.COLOR_RED)
@@ -1038,6 +1038,12 @@ class ControlServer(SocketServer, ControlServerAPI):
self._project_manager.set_project(project, content) self._project_manager.set_project(project, content)
return True return True
@logging_info
def set_project_cycle(self, project, index, content) -> bool:
if project is not None:
self._project_manager.set_project_cycle(project, index, content)
return True
@logging_info @logging_info
def get_running_project(self) -> bool: def get_running_project(self) -> bool:
return self._project_manager.get() return self._project_manager.get()
+1 -3
View File
@@ -155,9 +155,7 @@ class RecordingProcess(Process):
elif isinstance(decoder, EISZeroOneDataDecoder): elif isinstance(decoder, EISZeroOneDataDecoder):
# get amp_gain from meta file # get amp_gain from meta file
decoder._mode = self._meta_file.configuration.get_parameter('MODE') decoder._mode = self._meta_file.configuration.get_parameter('MODE')
decoder._ac_amp = self._meta_file.configuration.get_parameter('AC_AMP') decoder._ac_amp = self._meta_file.configuration.get_parameter('EIS_AC_AMP')
decoder._freq_start = self._meta_file.configuration.get_parameter('FREQ_START')
decoder._freq_stop = self._meta_file.configuration.get_parameter('FREQ_STOP')
return decoder return decoder
+7 -5
View File
@@ -93,13 +93,15 @@ class SocketClient(metaclass=abc.ABCMeta):
if self._socket is None: if self._socket is None:
try: try:
self._socket = Socket(AF_UNIX, SOCK_STREAM) self._socket = Socket(AF_UNIX, SOCK_STREAM)
self._socket.settimeout(1) self._socket.settimeout(5)
self._socket.connect(self._socket_file) self._socket.connect(self._socket_file)
except FileNotFoundError as e: except Exception as e:
raise RuntimeError('server not available') from e print('open_socket error:', e)
# except FileNotFoundError as e:
# raise RuntimeError('server not available') from e
except ConnectionRefusedError as e: # except ConnectionRefusedError as e:
raise RuntimeError('server crash') from e # raise RuntimeError('server crash') from e
def close_socket(self): def close_socket(self):
if self._socket is not None: if self._socket is not None:
+167 -119
View File
@@ -9,7 +9,7 @@
"minor_version_number": 0 "minor_version_number": 0
}, },
"constant": { "constant": {
"FREQ_MAX": 4294967296, "FREQ_MAX": 13333334,
"VOLT_MAX": 65536, "VOLT_MAX": 65536,
"BLE_WRITE_MAX": 255, "BLE_WRITE_MAX": 255,
"TIME_MAX": 100000 "TIME_MAX": 100000
@@ -32,12 +32,6 @@
"domain": "property", "domain": "property",
"value": "[0, 1, 2]" "value": "[0, 1, 2]"
}, },
"CHANNEL_LABEL": {
"description": "channel label",
"record_meta": true,
"domain": "property",
"value": "['current', 'voltage', 'impedance']"
},
"SAMPLE_RATE": { "SAMPLE_RATE": {
"description": "data sampling rate", "description": "data sampling rate",
"record_meta": true, "record_meta": true,
@@ -63,14 +57,48 @@
"EIS CURVE", "EIS CURVE",
"Cyclic Voltammetry", "Cyclic Voltammetry",
"Chronoamperometric", "Chronoamperometric",
"V-T Graph",
"R-T Graph",
"Dev Mode" "Dev Mode"
] ]
}, },
"FREQ": { "GENERAL_HS_RTIA": {
"description": "DPV current recording period start", "description": "High speed rtia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
],
"on_change": "set_general_hs_rtia"
},
"EIS_DC_BIAS": {
"description": "DC voltage bias",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"EIS_AC_AMP": {
"description": "AC Amplitude",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"EIS_FREQ": {
"description": "[start, stop] of frequency scan",
"record_meta": true, "record_meta": true,
"initial": [ "initial": [
13422819, 13333333,
7 7
], ],
"domain": { "domain": {
@@ -80,29 +108,24 @@
}, },
"value": "VALUE" "value": "VALUE"
}, },
"FREQ_START": { "EIS_PPD": {
"description": "Start of Freq Scan", "description": "Point per decades",
"record_meta": true, "record_meta": true,
"initial": 13422819, "initial": 10,
"domain": [ "domain": [
"FREQ_MAX" 11
], ]
"value": {
"expression": "VALUE"
}
}, },
"FREQ_STOP": { "EIS_SCALE": {
"description": "End of Freq Scan", "description": "Point spacing pattern",
"record_meta": true, "record_meta": true,
"initial": 7, "initial": 0,
"domain": [ "value": [
"FREQ_MAX" 0,
], 1
"value": { ]
"expression": "VALUE"
}
}, },
"DELAY": { "EIS_DELAY": {
"description": "Wait x peroid before start taking measurements", "description": "Wait x peroid before start taking measurements",
"record_meta": true, "record_meta": true,
"initial": 0, "initial": 0,
@@ -113,65 +136,18 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"AVERAGE_NUM": { "EIS_AVERAGE_NUM": {
"description": "Number of sample used for average funciton", "description": "Number of sample used for average funciton",
"record_meta": true, "record_meta": true,
"initial": 8, "initial": 8,
"value": [ "value": [
2, 2,
4, 4,
8, 6,
16 8
]
},
"DC_BIAS": {
"description": "DC voltage bias in mV",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"AC_AMP": {
"description": "AC Amplitude in mV",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 0,
"value": [
0,
1
]
},
"PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 10,
"domain": [
11
]
},
"RTIA": {
"description": "High speed tia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
] ]
}, },
"ADC_VALUE_I": { "ADC_VALUE_I": {
"description": "ADC value current value", "description": "ADC value current value",
"domain": "int" "domain": "int"
@@ -219,8 +195,7 @@
"1", "1",
"2", "2",
"auto" "auto"
], ]
"on_change": "set_adc_gain_Vin"
}, },
"VOLT_INITIAL": { "VOLT_INITIAL": {
"description": "Initial Voltage of Scan", "description": "Initial Voltage of Scan",
@@ -277,6 +252,29 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"MEASURE_VIN_RANGE": {
"description": "measure range of Vin",
"record_meta": true,
"initial": 0,
"value": [
"0",
"1",
"2",
"auto"
]
},
"RT_VOLT_SET": {
"description": "DAC output Voltage",
"record_meta": true,
"initial": 37500,
"domain": [
65536
],
"value": {
"expression": "VALUE"
},
"on_change": "set_para_RT_VOLT_SET"
},
"BLE_WRITE": { "BLE_WRITE": {
"description": "send msg to elite", "description": "send msg to elite",
"domain": { "domain": {
@@ -307,15 +305,11 @@
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"0": "set_general_hs_rtia",
"1": "set_adc_gain_I", "1": "set_adc_gain_I",
"2": "set_adc_gain_I" "2": "set_adc_gain_I",
} "3": "set_adc_gain_I",
}, "4": "set_adc_gain_I"
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
} }
}, },
{ {
@@ -323,7 +317,9 @@
"when": { "when": {
"0": "curve_eis", "0": "curve_eis",
"1": "curve_cv3", "1": "curve_cv3",
"2": "curve_const_vscan" "2": "curve_const_vscan",
"3": "curve_vt",
"4": "curve_rt"
} }
}, },
{ {
@@ -333,6 +329,12 @@
"1": "curve_cv3_para2" "1": "curve_cv3_para2"
} }
}, },
{
"expression": "MODE",
"when": {
"0": "curve_eis_mode"
}
},
"_sync(True)", "_sync(True)",
"VIS_STI" "VIS_STI"
], ],
@@ -350,6 +352,12 @@
"data_format_cali": [ "data_format_cali": [
"_data_format_cali('EISZeroOne')" "_data_format_cali('EISZeroOne')"
], ],
"set_general_hs_rtia": {
"type": "RIS",
"data": [
"1XFF;1X70;1B>GENERAL_HS_RTIA"
]
},
"set_sample_rate": { "set_sample_rate": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
@@ -365,12 +373,6 @@
"XE1;X05;B>ADC_LEVEL_I_15" "XE1;X05;B>ADC_LEVEL_I_15"
] ]
}, },
"set_adc_gain_Vin": {
"type": "RIS",
"data": [
"XE1;X06;B>ADC_LEVEL_V_IN_15"
]
},
"set_ctrl_highZ": { "set_ctrl_highZ": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -380,35 +382,41 @@
"curve_eis": { "curve_eis": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
"fa": "FREQ[0]", "fa": "EIS_FREQ[0]",
"fb": "FREQ[1]", "fb": "EIS_FREQ[1]",
"dp": "DELAY", "dp": "EIS_DELAY",
"dc": "DC_BIAS", "dc": "EIS_DC_BIAS",
"am": "AC_AMP", "am": "EIS_AC_AMP",
"an": "AVERAGE_NUM", "an": "EIS_AVERAGE_NUM",
"rt": "RTIA", "rt": "GENERAL_HS_RTIA",
"pp": "PPD", "pp": "EIS_PPD",
"sp": "SCALE" "sp": "EIS_SCALE"
}, },
"data": [ "data": [
"1XD1;1X01;4B>fa;4B>fb;2B>dp" "1X12;1X01;4B>fa;4B>fb;2B>dp"
] ]
}, },
"curve_eis_para2": { "curve_eis_para2": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
"fa": "FREQ[0]", "fa": "EIS_FREQ[0]",
"fb": "FREQ[1]", "fb": "EIS_FREQ[1]",
"dp": "DELAY", "dp": "EIS_DELAY",
"dc": "DC_BIAS", "dc": "EIS_DC_BIAS",
"am": "AC_AMP", "am": "EIS_AC_AMP",
"an": "AVERAGE_NUM", "an": "EIS_AVERAGE_NUM",
"rt": "RTIA", "rt": "GENERAL_HS_RTIA",
"pp": "PPD", "pp": "EIS_PPD",
"sp": "SCALE" "sp": "EIS_SCALE"
}, },
"data": [ "data": [
"1XD1;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp" "1X12;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp"
]
},
"curve_eis_mode": {
"type": "RIS",
"data": [
"1X12;1XFF"
] ]
}, },
"curve_cv3": { "curve_cv3": {
@@ -422,7 +430,7 @@
"cn": "CYCLE_NUMBER" "cn": "CYCLE_NUMBER"
}, },
"data": [ "data": [
"1XD2;1X01;2B>va;2B>vb;2B>vc;" "1X09;1X01;2B>va;2B>vb;2B>vc;"
] ]
}, },
"curve_cv3_para2": { "curve_cv3_para2": {
@@ -436,7 +444,7 @@
"cn": "CYCLE_NUMBER" "cn": "CYCLE_NUMBER"
}, },
"data": [ "data": [
"1XD2;1X02;4B>ve;2B>vf;2B>cn" "1X09;1X02;4B>ve;2B>vf;2B>cn"
] ]
}, },
"curve_const_vscan": { "curve_const_vscan": {
@@ -449,13 +457,53 @@
"pe": "SAMPLE_RATE" "pe": "SAMPLE_RATE"
}, },
"data": [ "data": [
"1XD3;", "1X0B;",
"2B>va;", "2B>va;",
"4b>pa;4b>pb;", "4b>pa;4b>pb;",
"4b>0;4b>pd;", "4b>0;4b>pd;",
"2B>pe" "2B>pe"
] ]
}, },
"curve_rt": {
"type": "RIS",
"parameter": {
"va": "RT_VOLT_SET",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"X04;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_vt": {
"type": "RIS",
"parameter": {
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE",
"va": "MEASURE_VIN_RANGE"
},
"data": [
"X05;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe;",
"1B>va"
]
},
"set_para_RT_VOLT_SET": {
"type": "RIS",
"data": [
"XE2;X01;2B>RT_VOLT_SET"
]
},
"ble_instru_send": [ "ble_instru_send": [
"ble_write", "ble_write",
"_cdr('20X>ADC_VALUE_I')" "_cdr('20X>ADC_VALUE_I')"
+166 -118
View File
@@ -9,7 +9,7 @@
"minor_version_number": 1 "minor_version_number": 1
}, },
"constant": { "constant": {
"FREQ_MAX": 4294967296, "FREQ_MAX": 13333334,
"VOLT_MAX": 65536, "VOLT_MAX": 65536,
"BLE_WRITE_MAX": 255, "BLE_WRITE_MAX": 255,
"TIME_MAX": 100000 "TIME_MAX": 100000
@@ -32,12 +32,6 @@
"domain": "property", "domain": "property",
"value": "[0, 1, 2]" "value": "[0, 1, 2]"
}, },
"CHANNEL_LABEL": {
"description": "channel label",
"record_meta": true,
"domain": "property",
"value": "['current', 'voltage', 'impedance']"
},
"SAMPLE_RATE": { "SAMPLE_RATE": {
"description": "data sampling rate", "description": "data sampling rate",
"record_meta": true, "record_meta": true,
@@ -63,11 +57,45 @@
"EIS CURVE", "EIS CURVE",
"Cyclic Voltammetry", "Cyclic Voltammetry",
"Chronoamperometric", "Chronoamperometric",
"V-T Graph",
"R-T Graph",
"Dev Mode" "Dev Mode"
] ]
}, },
"FREQ": { "GENERAL_HS_RTIA": {
"description": "DPV current recording period start", "description": "High speed rtia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
],
"on_change": "set_general_hs_rtia"
},
"EIS_DC_BIAS": {
"description": "DC voltage bias",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"EIS_AC_AMP": {
"description": "AC Amplitude",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"EIS_FREQ": {
"description": "[start, stop] of frequency scan",
"record_meta": true, "record_meta": true,
"initial": [ "initial": [
13333333, 13333333,
@@ -80,29 +108,24 @@
}, },
"value": "VALUE" "value": "VALUE"
}, },
"FREQ_START": { "EIS_PPD": {
"description": "Start of Freq Scan", "description": "Point per decades",
"record_meta": true, "record_meta": true,
"initial": 13422819, "initial": 10,
"domain": [ "domain": [
"FREQ_MAX" 11
], ]
"value": {
"expression": "VALUE"
}
}, },
"FREQ_STOP": { "EIS_SCALE": {
"description": "End of Freq Scan", "description": "Point spacing pattern",
"record_meta": true, "record_meta": true,
"initial": 7, "initial": 0,
"domain": [ "value": [
"FREQ_MAX" 0,
], 1
"value": { ]
"expression": "VALUE"
}
}, },
"DELAY": { "EIS_DELAY": {
"description": "Wait x peroid before start taking measurements", "description": "Wait x peroid before start taking measurements",
"record_meta": true, "record_meta": true,
"initial": 0, "initial": 0,
@@ -113,65 +136,18 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"AVERAGE_NUM": { "EIS_AVERAGE_NUM": {
"description": "Number of sample used for average funciton", "description": "Number of sample used for average funciton",
"record_meta": true, "record_meta": true,
"initial": 8, "initial": 8,
"value": [ "value": [
2, 2,
4, 4,
8, 6,
16 8
]
},
"DC_BIAS": {
"description": "DC voltage bias in mV",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"AC_AMP": {
"description": "AC Amplitude in mV",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 0,
"value": [
0,
1
]
},
"PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 10,
"domain": [
11
]
},
"RTIA": {
"description": "High speed tia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
] ]
}, },
"ADC_VALUE_I": { "ADC_VALUE_I": {
"description": "ADC value current value", "description": "ADC value current value",
"domain": "int" "domain": "int"
@@ -219,8 +195,7 @@
"1", "1",
"2", "2",
"auto" "auto"
], ]
"on_change": "set_adc_gain_Vin"
}, },
"VOLT_INITIAL": { "VOLT_INITIAL": {
"description": "Initial Voltage of Scan", "description": "Initial Voltage of Scan",
@@ -277,6 +252,29 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"MEASURE_VIN_RANGE": {
"description": "measure range of Vin",
"record_meta": true,
"initial": 0,
"value": [
"0",
"1",
"2",
"auto"
]
},
"RT_VOLT_SET": {
"description": "DAC output Voltage",
"record_meta": true,
"initial": 37500,
"domain": [
65536
],
"value": {
"expression": "VALUE"
},
"on_change": "set_para_RT_VOLT_SET"
},
"BLE_WRITE": { "BLE_WRITE": {
"description": "send msg to elite", "description": "send msg to elite",
"domain": { "domain": {
@@ -307,15 +305,11 @@
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"0": "set_general_hs_rtia",
"1": "set_adc_gain_I", "1": "set_adc_gain_I",
"2": "set_adc_gain_I" "2": "set_adc_gain_I",
} "3": "set_adc_gain_I",
}, "4": "set_adc_gain_I"
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
} }
}, },
{ {
@@ -323,7 +317,9 @@
"when": { "when": {
"0": "curve_eis", "0": "curve_eis",
"1": "curve_cv3", "1": "curve_cv3",
"2": "curve_const_vscan" "2": "curve_const_vscan",
"3": "curve_vt",
"4": "curve_rt"
} }
}, },
{ {
@@ -333,6 +329,12 @@
"1": "curve_cv3_para2" "1": "curve_cv3_para2"
} }
}, },
{
"expression": "MODE",
"when": {
"0": "curve_eis_mode"
}
},
"_sync(True)", "_sync(True)",
"VIS_STI" "VIS_STI"
], ],
@@ -350,6 +352,12 @@
"data_format_cali": [ "data_format_cali": [
"_data_format_cali('EISZeroOne')" "_data_format_cali('EISZeroOne')"
], ],
"set_general_hs_rtia": {
"type": "RIS",
"data": [
"1XFF;1X70;1B>GENERAL_HS_RTIA"
]
},
"set_sample_rate": { "set_sample_rate": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
@@ -365,12 +373,6 @@
"XE1;X05;B>ADC_LEVEL_I_15" "XE1;X05;B>ADC_LEVEL_I_15"
] ]
}, },
"set_adc_gain_Vin": {
"type": "RIS",
"data": [
"XE1;X06;B>ADC_LEVEL_V_IN_15"
]
},
"set_ctrl_highZ": { "set_ctrl_highZ": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -380,35 +382,41 @@
"curve_eis": { "curve_eis": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
"fa": "FREQ[0]", "fa": "EIS_FREQ[0]",
"fb": "FREQ[1]", "fb": "EIS_FREQ[1]",
"dp": "DELAY", "dp": "EIS_DELAY",
"dc": "DC_BIAS", "dc": "EIS_DC_BIAS",
"am": "AC_AMP", "am": "EIS_AC_AMP",
"an": "AVERAGE_NUM", "an": "EIS_AVERAGE_NUM",
"rt": "RTIA", "rt": "GENERAL_HS_RTIA",
"pp": "PPD", "pp": "EIS_PPD",
"sp": "SCALE" "sp": "EIS_SCALE"
}, },
"data": [ "data": [
"1XD1;1X01;4B>fa;4B>fb;2B>dp" "1X12;1X01;4B>fa;4B>fb;2B>dp"
] ]
}, },
"curve_eis_para2": { "curve_eis_para2": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
"fa": "FREQ[0]", "fa": "EIS_FREQ[0]",
"fb": "FREQ[1]", "fb": "EIS_FREQ[1]",
"dp": "DELAY", "dp": "EIS_DELAY",
"dc": "DC_BIAS", "dc": "EIS_DC_BIAS",
"am": "AC_AMP", "am": "EIS_AC_AMP",
"an": "AVERAGE_NUM", "an": "EIS_AVERAGE_NUM",
"rt": "RTIA", "rt": "GENERAL_HS_RTIA",
"pp": "PPD", "pp": "EIS_PPD",
"sp": "SCALE" "sp": "EIS_SCALE"
}, },
"data": [ "data": [
"1XD1;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp" "1X12;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp"
]
},
"curve_eis_mode": {
"type": "RIS",
"data": [
"1X12;1XFF"
] ]
}, },
"curve_cv3": { "curve_cv3": {
@@ -422,7 +430,7 @@
"cn": "CYCLE_NUMBER" "cn": "CYCLE_NUMBER"
}, },
"data": [ "data": [
"1XD2;1X01;2B>va;2B>vb;2B>vc;" "1X09;1X01;2B>va;2B>vb;2B>vc;"
] ]
}, },
"curve_cv3_para2": { "curve_cv3_para2": {
@@ -436,7 +444,7 @@
"cn": "CYCLE_NUMBER" "cn": "CYCLE_NUMBER"
}, },
"data": [ "data": [
"1XD2;1X02;4B>ve;2B>vf;2B>cn" "1X09;1X02;4B>ve;2B>vf;2B>cn"
] ]
}, },
"curve_const_vscan": { "curve_const_vscan": {
@@ -449,13 +457,53 @@
"pe": "SAMPLE_RATE" "pe": "SAMPLE_RATE"
}, },
"data": [ "data": [
"1XD3;", "1X0B;",
"2B>va;", "2B>va;",
"4b>pa;4b>pb;", "4b>pa;4b>pb;",
"4b>0;4b>pd;", "4b>0;4b>pd;",
"2B>pe" "2B>pe"
] ]
}, },
"curve_rt": {
"type": "RIS",
"parameter": {
"va": "RT_VOLT_SET",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"X04;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_vt": {
"type": "RIS",
"parameter": {
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE",
"va": "MEASURE_VIN_RANGE"
},
"data": [
"X05;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe;",
"1B>va"
]
},
"set_para_RT_VOLT_SET": {
"type": "RIS",
"data": [
"XE2;X01;2B>RT_VOLT_SET"
]
},
"ble_instru_send": [ "ble_instru_send": [
"ble_write", "ble_write",
"_cdr('20X>ADC_VALUE_I')" "_cdr('20X>ADC_VALUE_I')"
@@ -9,7 +9,7 @@
"minor_version_number": 2 "minor_version_number": 2
}, },
"constant": { "constant": {
"FREQ_MAX": 4294967296, "FREQ_MAX": 13333334,
"VOLT_MAX": 65536, "VOLT_MAX": 65536,
"BLE_WRITE_MAX": 255, "BLE_WRITE_MAX": 255,
"TIME_MAX": 100000 "TIME_MAX": 100000
@@ -32,12 +32,6 @@
"domain": "property", "domain": "property",
"value": "[0, 1, 2]" "value": "[0, 1, 2]"
}, },
"CHANNEL_LABEL": {
"description": "channel label",
"record_meta": true,
"domain": "property",
"value": "['current', 'voltage', 'impedance']"
},
"SAMPLE_RATE": { "SAMPLE_RATE": {
"description": "data sampling rate", "description": "data sampling rate",
"record_meta": true, "record_meta": true,
@@ -63,14 +57,48 @@
"EIS CURVE", "EIS CURVE",
"Cyclic Voltammetry", "Cyclic Voltammetry",
"Chronoamperometric", "Chronoamperometric",
"V-T Graph",
"R-T Graph",
"Dev Mode" "Dev Mode"
] ]
}, },
"FREQ": { "GENERAL_HS_RTIA": {
"description": "DPV current recording period start", "description": "High speed rtia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
],
"on_change": "set_general_hs_rtia"
},
"EIS_DC_BIAS": {
"description": "DC voltage bias",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"EIS_AC_AMP": {
"description": "AC Amplitude",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"EIS_FREQ": {
"description": "[start, stop] of frequency scan",
"record_meta": true, "record_meta": true,
"initial": [ "initial": [
13422819, 13333333,
7 7
], ],
"domain": { "domain": {
@@ -80,29 +108,24 @@
}, },
"value": "VALUE" "value": "VALUE"
}, },
"FREQ_START": { "EIS_PPD": {
"description": "Start of Freq Scan", "description": "Point per decades",
"record_meta": true, "record_meta": true,
"initial": 13422819, "initial": 10,
"domain": [ "domain": [
"FREQ_MAX" 11
], ]
"value": {
"expression": "VALUE"
}
}, },
"FREQ_STOP": { "EIS_SCALE": {
"description": "End of Freq Scan", "description": "Point spacing pattern",
"record_meta": true, "record_meta": true,
"initial": 7, "initial": 0,
"domain": [ "value": [
"FREQ_MAX" 0,
], 1
"value": { ]
"expression": "VALUE"
}
}, },
"DELAY": { "EIS_DELAY": {
"description": "Wait x peroid before start taking measurements", "description": "Wait x peroid before start taking measurements",
"record_meta": true, "record_meta": true,
"initial": 0, "initial": 0,
@@ -113,65 +136,18 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"AVERAGE_NUM": { "EIS_AVERAGE_NUM": {
"description": "Number of sample used for average funciton", "description": "Number of sample used for average funciton",
"record_meta": true, "record_meta": true,
"initial": 8, "initial": 8,
"value": [ "value": [
2, 2,
4, 4,
8, 6,
16 8
]
},
"DC_BIAS": {
"description": "DC voltage bias in mV",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"AC_AMP": {
"description": "AC Amplitude in mV",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 0,
"value": [
0,
1
]
},
"PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 10,
"domain": [
11
]
},
"RTIA": {
"description": "High speed tia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
] ]
}, },
"ADC_VALUE_I": { "ADC_VALUE_I": {
"description": "ADC value current value", "description": "ADC value current value",
"domain": "int" "domain": "int"
@@ -219,8 +195,7 @@
"1", "1",
"2", "2",
"auto" "auto"
], ]
"on_change": "set_adc_gain_Vin"
}, },
"VOLT_INITIAL": { "VOLT_INITIAL": {
"description": "Initial Voltage of Scan", "description": "Initial Voltage of Scan",
@@ -277,6 +252,29 @@
"expression": "VALUE" "expression": "VALUE"
} }
}, },
"MEASURE_VIN_RANGE": {
"description": "measure range of Vin",
"record_meta": true,
"initial": 0,
"value": [
"0",
"1",
"2",
"auto"
]
},
"RT_VOLT_SET": {
"description": "DAC output Voltage",
"record_meta": true,
"initial": 37500,
"domain": [
65536
],
"value": {
"expression": "VALUE"
},
"on_change": "set_para_RT_VOLT_SET"
},
"BLE_WRITE": { "BLE_WRITE": {
"description": "send msg to elite", "description": "send msg to elite",
"domain": { "domain": {
@@ -307,15 +305,11 @@
{ {
"expression": "MODE", "expression": "MODE",
"when": { "when": {
"0": "set_general_hs_rtia",
"1": "set_adc_gain_I", "1": "set_adc_gain_I",
"2": "set_adc_gain_I" "2": "set_adc_gain_I",
} "3": "set_adc_gain_I",
}, "4": "set_adc_gain_I"
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
} }
}, },
{ {
@@ -323,7 +317,9 @@
"when": { "when": {
"0": "curve_eis", "0": "curve_eis",
"1": "curve_cv3", "1": "curve_cv3",
"2": "curve_const_vscan" "2": "curve_const_vscan",
"3": "curve_vt",
"4": "curve_rt"
} }
}, },
{ {
@@ -333,6 +329,12 @@
"1": "curve_cv3_para2" "1": "curve_cv3_para2"
} }
}, },
{
"expression": "MODE",
"when": {
"0": "curve_eis_mode"
}
},
"_sync(True)", "_sync(True)",
"VIS_STI" "VIS_STI"
], ],
@@ -350,6 +352,12 @@
"data_format_cali": [ "data_format_cali": [
"_data_format_cali('EISZeroOne')" "_data_format_cali('EISZeroOne')"
], ],
"set_general_hs_rtia": {
"type": "RIS",
"data": [
"1XFF;1X70;1B>GENERAL_HS_RTIA"
]
},
"set_sample_rate": { "set_sample_rate": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
@@ -365,12 +373,6 @@
"XE1;X05;B>ADC_LEVEL_I_15" "XE1;X05;B>ADC_LEVEL_I_15"
] ]
}, },
"set_adc_gain_Vin": {
"type": "RIS",
"data": [
"XE1;X06;B>ADC_LEVEL_V_IN_15"
]
},
"set_ctrl_highZ": { "set_ctrl_highZ": {
"type": "RIS", "type": "RIS",
"data": [ "data": [
@@ -380,35 +382,41 @@
"curve_eis": { "curve_eis": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
"fa": "FREQ[0]", "fa": "EIS_FREQ[0]",
"fb": "FREQ[1]", "fb": "EIS_FREQ[1]",
"dp": "DELAY", "dp": "EIS_DELAY",
"dc": "DC_BIAS", "dc": "EIS_DC_BIAS",
"am": "AC_AMP", "am": "EIS_AC_AMP",
"an": "AVERAGE_NUM", "an": "EIS_AVERAGE_NUM",
"rt": "RTIA", "rt": "GENERAL_HS_RTIA",
"pp": "PPD", "pp": "EIS_PPD",
"sp": "SCALE" "sp": "EIS_SCALE"
}, },
"data": [ "data": [
"1XD1;1X01;4B>fa;4B>fb;2B>dp" "1X12;1X01;4B>fa;4B>fb;2B>dp"
] ]
}, },
"curve_eis_para2": { "curve_eis_para2": {
"type": "RIS", "type": "RIS",
"parameter": { "parameter": {
"fa": "FREQ[0]", "fa": "EIS_FREQ[0]",
"fb": "FREQ[1]", "fb": "EIS_FREQ[1]",
"dp": "DELAY", "dp": "EIS_DELAY",
"dc": "DC_BIAS", "dc": "EIS_DC_BIAS",
"am": "AC_AMP", "am": "EIS_AC_AMP",
"an": "AVERAGE_NUM", "an": "EIS_AVERAGE_NUM",
"rt": "RTIA", "rt": "GENERAL_HS_RTIA",
"pp": "PPD", "pp": "EIS_PPD",
"sp": "SCALE" "sp": "EIS_SCALE"
}, },
"data": [ "data": [
"1XD1;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp" "1X12;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp"
]
},
"curve_eis_mode": {
"type": "RIS",
"data": [
"1X12;1XFF"
] ]
}, },
"curve_cv3": { "curve_cv3": {
@@ -422,7 +430,7 @@
"cn": "CYCLE_NUMBER" "cn": "CYCLE_NUMBER"
}, },
"data": [ "data": [
"1XD2;1X01;2B>va;2B>vb;2B>vc;" "1X09;1X01;2B>va;2B>vb;2B>vc;"
] ]
}, },
"curve_cv3_para2": { "curve_cv3_para2": {
@@ -436,7 +444,7 @@
"cn": "CYCLE_NUMBER" "cn": "CYCLE_NUMBER"
}, },
"data": [ "data": [
"1XD2;1X02;4B>ve;2B>vf;2B>cn" "1X09;1X02;4B>ve;2B>vf;2B>cn"
] ]
}, },
"curve_const_vscan": { "curve_const_vscan": {
@@ -449,13 +457,53 @@
"pe": "SAMPLE_RATE" "pe": "SAMPLE_RATE"
}, },
"data": [ "data": [
"1XD3;", "1X0B;",
"2B>va;", "2B>va;",
"4b>pa;4b>pb;", "4b>pa;4b>pb;",
"4b>0;4b>pd;", "4b>0;4b>pd;",
"2B>pe" "2B>pe"
] ]
}, },
"curve_rt": {
"type": "RIS",
"parameter": {
"va": "RT_VOLT_SET",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"X04;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_vt": {
"type": "RIS",
"parameter": {
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE",
"va": "MEASURE_VIN_RANGE"
},
"data": [
"X05;",
"4b>pa;4b>pb;",
"4b>0;4b>pd;",
"2B>pe;",
"1B>va"
]
},
"set_para_RT_VOLT_SET": {
"type": "RIS",
"data": [
"XE2;X01;2B>RT_VOLT_SET"
]
},
"ble_instru_send": [ "ble_instru_send": [
"ble_write", "ble_write",
"_cdr('20X>ADC_VALUE_I')" "_cdr('20X>ADC_VALUE_I')"