Compare commits

...

57 Commits

Author SHA1 Message Date
Roy c540013d19 [update] new cf mode 2022-11-16 11:51:15 +08:00
Roy 7f0b00a323 [update] update highz instruction 2022-11-15 17:28:51 +08:00
Roy 4828c85668 [update] clean up eis parameter 2022-11-15 16:08:43 +08:00
Roy 4ce9fe5b8d [update] remove ADC_LEVEL_V_IN_15 parameter 2022-11-15 16:08:09 +08:00
Roy d74f09254e [update] update high z status 2022-11-15 16:07:58 +08:00
Roy 79ecff69cc [update] update VT_MEASURE_VIN_RANGE parameter 2022-11-15 16:03:06 +08:00
Roy df45126ead [update] update CA_VOLT parameter 2022-11-15 16:00:53 +08:00
Roy 9fade3469a [update] update CV_SCAN_RATE parameter 2022-11-15 15:51:42 +08:00
Roy a77331176c [update] update CV_E2 parameter 2022-11-15 15:47:49 +08:00
Roy 8f98337267 [update] update CV_E1 parameter 2022-11-15 15:44:42 +08:00
Roy 205d39cb11 [update] update CV_E_INITIAL parameter 2022-11-15 15:41:38 +08:00
Roy a5ea3243fa [update] new lprtia function 2022-11-15 15:39:31 +08:00
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 1264 additions and 656 deletions
+3
View File
@@ -1589,6 +1589,9 @@ class ControlAPI(metaclass=Router):
def set_project(self, project, content) -> bool:
raise NotImplementedError()
def set_project_cycle(self, project, index, content) -> bool:
raise NotImplementedError()
def show_device_data(self, device) -> bool:
raise NotImplementedError()
+35 -37
View File
@@ -1346,8 +1346,8 @@ class EISZeroOneDataDecoder(RecDataDecoder):
__slots__ = ('_message', '_cycle_number', '_start_return_data', '_time_stamp',
'_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', '_show_data')
'cali_coeff', '_ac_amp', '_mode',
'_last_phase', '_first_phase_flag', '_show_data')
def __init__(self, cali_coeff: bytes = None):
super().__init__()
@@ -1362,9 +1362,6 @@ class EISZeroOneDataDecoder(RecDataDecoder):
self._cycle_start_time = []
self._ac_amp: 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._first_phase_flag = 1
@@ -1429,25 +1426,25 @@ class EISZeroOneDataDecoder(RecDataDecoder):
index = 60
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0]/1e4)
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[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_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[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_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[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_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
index = 140
g = 1
@@ -1530,7 +1527,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
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]
d19 = data[19+3]
gain = (d19 & 0x0F)
gain = data[20+3]
finishMode = (d19 & 0x80) >> 7
if time_stamp == 0:
@@ -1540,7 +1537,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
return None
if time_stamp != 0 and self._start_return_data == True:
if (self._mode == 0):
if (self._mode == 0 or self._mode == 5):
time_stamp, delta, ret_get_time_stamp = self.eis_get_time_stamp(time_stamp)
else:
time_stamp, delta, ret_get_time_stamp = self.get_time_stamp(time_stamp)
@@ -1549,7 +1546,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
print("error timeStamp full data:", list(data), datetime.now(), '\n')
return None
else:
if self.cali_coeff is not None and self._mode == 0:
if self.cali_coeff is not None and (self._mode == 0 or self._mode == 5):
hsrtia_a = []
hsrtia_b = []
hsrtia_c = []
@@ -1557,23 +1554,24 @@ class EISZeroOneDataDecoder(RecDataDecoder):
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
if (self._freq_start > self._freq_stop):
self._freq_direction = 0
else:
self._freq_direction = 1
if (self._mode == 0):
if (self._mode == 0 or self._mode == 5):
img = ch1
real = ch2
freq = ch3
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):
# current = hsrtia_a[gain] * math.exp(hsrtia_b[gain] * voltage_mag) + hsrtia_c[gain] * math.exp(hsrtia_d[gain] * voltage_mag)
# else:
current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain] + 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(voltage_mag)
# print(hsrtia_a[gain])
@@ -1586,12 +1584,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
else:
impedance = 0
if (real > 0):
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
raw_phase = math.atan2(img , real) * 180 / math.pi
if (freq >= 1000000): # 10000 Hz
fre_idx = 0
@@ -1602,22 +1595,27 @@ class EISZeroOneDataDecoder(RecDataDecoder):
elif (freq >= 1): # 0.01 Hz
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 = phase % 180 if phase % 180<=90 else phase % 180-180
if (self._first_phase_flag):
self._last_phase = phase
self._first_phase_flag = 0
elif (abs(phase - self._last_phase) >= 90):
phase -= 360
self._last_phase = phase
# last_phase_to90 = self._last_phase % 180 if self._last_phase % 180<=90 else self._last_phase % 180-180
# diff = phase - last_phase_to90
# if (self._first_phase_flag):
# # 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)
real_after_cal = impedance * math.cos(round(phase) * math.pi / 180)
if self._show_data:
if (self._mode == 0):
if (self._mode == 0 or self._mode == 5):
print('|', '{:10}'.format(time_stamp),
'|', '{:5}'.format(delta),
'|', '{:6}'.format(ch1),
@@ -1631,7 +1629,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
'|', '{:5}'.format(round(current, 3)),
'|', '{:1}'.format(gain),
'|', '{:1}'.format(finishMode),
'@', str(self.device), '|')
'@', str(self.device), '|', flush = True)
pass
else:
print('|', '{:10}'.format(time_stamp),
@@ -1642,7 +1640,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
'|', '{:5}'.format(cycle_number),
'|', '{:1}'.format(gain),
'|', '{:1}'.format(finishMode),
'@', str(self.device), '|')
'@', str(self.device), '|', flush = True)
pass
if finishMode == True:
@@ -1652,7 +1650,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
self._mode_stop = 0
ret = RecordingData(self.device, int(time_stamp * 1000 / 2), 0)
if (self._mode == 0): #EIS Mode
if self._mode == 0 or self._mode == 5: #EIS Mode
ret.append_data(0, ch1) #Raw Imag
ret.append_data(1, ch2) #Raw Real
ret.append_data(2, ch3 * 10) #Frequency [mHz]
+2 -2
View File
@@ -1032,7 +1032,7 @@ class CompletedDevice(Device):
@property
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
def device(self) -> Device:
@@ -1131,7 +1131,7 @@ class CompletedDevice(Device):
# raise RuntimeError('illegal parameter value : ' + value) from e
else:
if name == 'MODE':
if self.library_name.startswith('Elite_EDC'):
if self.library_name.startswith('Elite_EDC') or 'EIS' in self.library_name:
self.set_parameter('CTRL_HIGH_Z_15', self.get_parameter('HIGHZ_TABLE')[value])
self.set_parameter('TIME_DURATION', 0)
+2 -2
View File
@@ -227,7 +227,7 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
def recv_memory(self, device: int) -> Optional[bytes]:
# 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 = []
@@ -312,7 +312,7 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
return None
# print('data=', list(data))
print('Ram:', data[62])
# print('Ram:', data[62])
if (length >= 4000):
flag_print = True
+1 -1
View File
@@ -28,7 +28,7 @@ class UARTInterface(LowLevelHardwareInterface):
self._serial = serial.Serial(self._port,
baudrate=self._baudrate,
timeout=0,
writeTimeout=0.01)
writeTimeout=1)
# deprecate function name which change at version 3.0
self._serial.flushInput()
self._serial.flushOutput()
+14 -5
View File
@@ -45,8 +45,8 @@ class Condition():
# print(operator, x, y)
cases = {
"equal": lambda a, b: a == b,
"bigger": lambda a, b: a > b,
"smaller": lambda a, b: a < b,
"bigger": lambda a, b: a >= b,
"smaller": lambda a, b: a <= b,
}
return cases[operator](x, y)
@@ -71,14 +71,23 @@ class Condition():
return self.compareWith(self.comparsion, time_diff, round(int(self._value), 1))
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:
return False
task = kwargs['self_task']
running_task = kwargs['running_task']
task_start_time = kwargs['task_start_time'][-1]
delay_time = kwargs['delay_time']
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):
print('device')
+100 -38
View File
@@ -19,7 +19,7 @@ key_list = {
}
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)
self._project = project
self._device_manager = device_manager
@@ -33,7 +33,7 @@ class Project(threading.Thread):
self._name = None
self._desc = None
self._device = None
self._complete_device = []
self._complete_device = {}
self._status = 0
self._instruction_set = Instruction()
@@ -41,6 +41,12 @@ class Project(threading.Thread):
self._task_manager = None
self._cycle = []
self._count = 1 #流水號
self.log_verbose = log_verbose
self.setup_project(project)
self.setup_device(self._device)
@@ -50,7 +56,7 @@ class Project(threading.Thread):
key = key_list[key]
if key == 'task':
self._task_manager = TaskManager(project['task'])
self._task_manager = TaskManager(project['task'], project['cycle'])
elif key == 'uuid':
pass
else:
@@ -58,8 +64,9 @@ class Project(threading.Thread):
def setup_device(self, device_list):
for device in device_list:
complete_device = self._device_manager.get_device(device['connectDevice']['device_address'])
self._complete_device.append(complete_device)
mac_address = device_list[device]['pair']
complete_device = self._device_manager.get_device(mac_address)
self._complete_device[device] = complete_device
@property
def id(self) -> int:
@@ -84,6 +91,14 @@ class Project(threading.Thread):
@name.setter
def name(self, 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
def desc(self) -> str:
@@ -124,6 +139,7 @@ class Project(threading.Thread):
def run(self):
self._status = 1
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])
while not self._stop_flag :
@@ -134,10 +150,6 @@ class Project(threading.Thread):
for task in check_list:
if task != None:
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(
project_start_time = self._start_time,
@@ -146,51 +158,87 @@ class Project(threading.Thread):
previous_task = self._task_manager.prev_task,
self_task = task
)
# print('match_condition_list', match_condition_list)
for condition in match_condition_list:
# print('\ncondition.type: ', condition.type)
match_action_list = task.get_match_action(condition.id)
# print('match_action_list', match_action_list)
for action in match_action_list:
# print('action type', action.type)
# 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
if action.type == 'cycle' and condition.type == 'previous_task_done':
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)
elif action.type == 'stop' and len(self._task_manager.running_task.parameter_set) == 0:
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])
if action.type == 'cycle' and condition.type == 'until_button_trigger':
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':
self._task_manager.running_task.stop()
device = self._complete_device[action.target]
task_info = task.get_task_info(action)
instruction_set = getattr(self._instruction_set, action.type, None)
# print('instruction_set', instruction_set, '\n', action.type)
# if instruction_set != None and task.cycle == -1:
if instruction_set != None and len(task.parameter_set) > 0:
for instruction in instruction_set:
args = list(map(lambda arg: task_info[arg], instruction['arguments']))
threading.Thread(target=getattr(device, instruction['method'])(*args))
instruction_set = None
if action.target is not None:
device = self._complete_device[action.target]
if ((action.type == 'start' and device.status == 0) or (action.type == 'stop' and device.status == 1)):
self.log_verbose('Project' + self.name + 'Task ' + task.name + ' match_condition ' + condition.type + ' trigger_action ' + action.type + ' ' + str(action.target))
task_info = task.get_task_info(action)
instruction_set = getattr(self._instruction_set, action.type, None)
# 檔名修正
# 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)
# check task not running then stop
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._task_manager.running_task.stop()
# self._task_manager.set_running_task(task)
# check project done then close project
if self.check_project_done() == True:
@@ -228,11 +276,24 @@ class Project(threading.Thread):
def set_content(self, content):
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):
# if no running task
if self._task_manager.running_task == None:
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:
# 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':
@@ -257,6 +318,7 @@ class Project(threading.Thread):
'status': self._status,
'device': self._device,
'task': self.task_list,
'running_task': running_task
'running_task': running_task,
'cycle': self._cycle
}
return data
+7 -2
View File
@@ -9,13 +9,14 @@ def json_stringify(o: Any) -> str:
return _json_stringify(o, separators=(',', ':'))
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._mqtt_thread = mqtt_thread
self._device_manager = device_manager
self.log_verbose = log_verbose
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)
return new_project
@@ -41,3 +42,7 @@ class ProjectManager():
def set_project(self, project_uuid, content):
_project = self.get(project_uuid)
_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:
def __init__(self, task):
self._id = None
self._uuid = None
self._type = None
self._name = None
self._parent = None
self._cycle = None
@@ -82,6 +84,14 @@ class Task:
@uuid.setter
def uuid(self, 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
def name(self):
@@ -275,7 +285,7 @@ class Task:
return {
'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,
'instruction': _type
}
@@ -285,6 +295,8 @@ class Task:
'id': self.id,
'name': self.name,
'parent': self.parent,
'type': self.type,
'uuid': self.uuid,
'cycle': self.cycle,
'cycle_count': self.cycle_count,
'cycle_next': self.cycle_next,
+42 -17
View File
@@ -12,11 +12,12 @@ def json_stringify(o: Any) -> str:
return _json_stringify(o, separators=(',', ':'))
class TaskManager():
def __init__(self, task_list):
def __init__(self, task_list, cycle_list):
self._task_list = []
self._next_task = []
self._prev_task = None
self._running_task = None
self._cycle_list = cycle_list
self.load_task_list(task_list)
@@ -44,6 +45,23 @@ class TaskManager():
def next_task(self):
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
def check_list(self):
return [self._running_task, *self._next_task]
@@ -83,42 +101,49 @@ class TaskManager():
self._next_task.append(_task)
except RuntimeError as e:
print(e) """
def set_running_task(self, task):
try:
# if there is task running & same task active ,then reject
if self._running_task != None and self._running_task.uuid == task.uuid:
# print('set_running_task return false: ', self._running_task.name)
return False
# save running task
# save task
self._prev_task = self._running_task
# clear next task list
self._next_task.clear()
# set task to running_task
self._running_task = task
self._running_task.run()
# if previous task is still running, then need to close
if self._prev_task != None:
# if previous task is still running, then need to close
if self._prev_task.status == 1:
self._prev_task.stop()
print('prev', 'run', self._prev_task.name, self._running_task.name)
# print(f'!!@#!set_running_task\n\n\n{task._cycle_count}\n{task._cycle}\n\n\n')
if task._cycle_count < task._cycle - 1:
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
# if reach cycle end, count < max, then go to cycle start
cycle_index = self.check_task_is_cycle_end(task)
if cycle_index is None:
# print('next', self._running_task.name, 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)
if _task != None:
_task.reset()
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:
print(e)
+11 -9
View File
@@ -65,7 +65,7 @@ class DataServer(SocketServer, DataAPI):
"""
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)
@@ -656,7 +656,7 @@ class DataServer(SocketServer, DataAPI):
sync = self.get_spi_obj()
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():
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())
if data is not None:
if self._configurations[device].queue_flag:
self._configurations[device].queue_flag = False
print("q size= ", self._configurations[device]._queue_rec.qsize())
self._configurations[device].put_rec_queue(data)
# self._no_data_total_duration = 0
ret = True
if self._configurations.get(device, None) != None:
if self._configurations[device].queue_flag:
self._configurations[device].queue_flag = False
print("q size= ", self._configurations[device]._queue_rec.qsize())
if self._configurations.get(device, None) != None:
self._configurations[device].put_rec_queue(data)
# self._no_data_total_duration = 0
ret = True
# else:
# time_diff = time() - self._recv_memory_cost_time
# self._no_data_total_duration += time_diff
+7 -1
View File
@@ -105,7 +105,7 @@ class ControlServer(SocketServer, ControlServerAPI):
# device detect
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:
self.led_thread.set_state(LED.COLOR_RED)
@@ -1037,6 +1037,12 @@ class ControlServer(SocketServer, ControlServerAPI):
if project is not None:
self._project_manager.set_project(project, content)
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
def get_running_project(self) -> bool:
+1 -3
View File
@@ -155,9 +155,7 @@ class RecordingProcess(Process):
elif isinstance(decoder, EISZeroOneDataDecoder):
# get amp_gain from meta file
decoder._mode = self._meta_file.configuration.get_parameter('MODE')
decoder._ac_amp = self._meta_file.configuration.get_parameter('AC_AMP')
decoder._freq_start = self._meta_file.configuration.get_parameter('FREQ_START')
decoder._freq_stop = self._meta_file.configuration.get_parameter('FREQ_STOP')
decoder._ac_amp = self._meta_file.configuration.get_parameter('EIS_AC_AMP')
return decoder
+7 -5
View File
@@ -93,13 +93,15 @@ class SocketClient(metaclass=abc.ABCMeta):
if self._socket is None:
try:
self._socket = Socket(AF_UNIX, SOCK_STREAM)
self._socket.settimeout(1)
self._socket.settimeout(5)
self._socket.connect(self._socket_file)
except FileNotFoundError as e:
raise RuntimeError('server not available') from e
except Exception as e:
print('open_socket error:', e)
# except FileNotFoundError as e:
# raise RuntimeError('server not available') from e
except ConnectionRefusedError as e:
raise RuntimeError('server crash') from e
# except ConnectionRefusedError as e:
# raise RuntimeError('server crash') from e
def close_socket(self):
if self._socket is not None:
+340 -178
View File
@@ -9,7 +9,7 @@
"minor_version_number": 0
},
"constant": {
"FREQ_MAX": 4294967296,
"FREQ_MAX": 13333334,
"VOLT_MAX": 65536,
"BLE_WRITE_MAX": 255,
"TIME_MAX": 100000
@@ -26,17 +26,43 @@
"expression": "VALUE"
}
},
"CHANNEL": {
"derzteription": "record channels",
"record_meta": true,
"domain": "property",
"value": "[0, 1, 2]"
"HIGHZ_TABLE": {
"initial": [
1,
1,
1,
0,
1,
1,
1
],
"domain": {
"list": [
100
]
},
"value": "VALUE"
},
"CHANNEL_LABEL": {
"description": "channel label",
"CTRL_HIGH_Z_15": {
"description": "ctrl highZ level",
"record_meta": true,
"domain": "property",
"value": "['current', 'voltage', 'impedance']"
"initial": 1,
"value": [
"On",
"Off"
],
"on_change": "set_ctrl_highZ"
},
"CYCLE_NUMBER": {
"description": "CV cycle number",
"record_meta": true,
"initial": 1,
"domain": [
65536
],
"value": {
"expression": "VALUE"
}
},
"SAMPLE_RATE": {
"description": "data sampling rate",
@@ -50,6 +76,12 @@
},
"on_change": "set_sample_rate"
},
"CHANNEL": {
"derzteription": "record channels",
"record_meta": true,
"domain": "property",
"value": "[0, 1, 2]"
},
"AMP_GAIN": {
"description": "amp gain",
"record_meta": true,
@@ -63,14 +95,62 @@
"EIS CURVE",
"Cyclic Voltammetry",
"Chronoamperometric",
"V-T Graph",
"R-T Graph",
"EIS constant frequency",
"Dev Mode"
]
},
"FREQ": {
"description": "DPV current recording period start",
"GENERAL_HS_RTIA": {
"description": "High speed rtia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
],
"on_change": "set_general_hs_rtia"
},
"GENERAL_LP_RTIA": {
"description": "Low power rtia gain",
"record_meta": true,
"initial": 4,
"value": [
"0",
"1",
"2",
"3",
"auto"
],
"on_change": "set_general_lp_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,
"initial": [
13422819,
13333333,
7
],
"domain": {
@@ -80,29 +160,24 @@
},
"value": "VALUE"
},
"FREQ_START": {
"description": "Start of Freq Scan",
"EIS_PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 13422819,
"initial": 10,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
11
]
},
"FREQ_STOP": {
"description": "End of Freq Scan",
"EIS_SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 7,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
"initial": 0,
"value": [
0,
1
]
},
"DELAY": {
"EIS_DELAY": {
"description": "Wait x peroid before start taking measurements",
"record_meta": true,
"initial": 0,
@@ -113,19 +188,19 @@
"expression": "VALUE"
}
},
"AVERAGE_NUM": {
"EIS_AVERAGE_NUM": {
"description": "Number of sample used for average funciton",
"record_meta": true,
"initial": 8,
"value": [
2,
4,
8,
16
6,
8
]
},
"DC_BIAS": {
"description": "DC voltage bias in mV",
"CF_DC_BIAS": {
"description": "DC voltage bias",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -135,15 +210,34 @@
"expression": "VALUE"
}
},
"AC_AMP": {
"description": "AC Amplitude in mV",
"CF_AC_AMP": {
"description": "AC Amplitude",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"SCALE": {
"CF_FREQ": {
"description": "frequency of cf",
"record_meta": true,
"initial": 13333333,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
},
"CF_PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 10,
"domain": [
11
]
},
"CF_SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 0,
@@ -152,77 +246,29 @@
1
]
},
"PPD": {
"description": "Point per decades",
"CF_DELAY": {
"description": "Wait x peroid before start taking measurements",
"record_meta": true,
"initial": 10,
"initial": 0,
"domain": [
11
]
},
"RTIA": {
"description": "High speed tia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
]
},
"ADC_VALUE_I": {
"description": "ADC value current value",
"domain": "int"
},
"Scan_Rate": {
"description": "Voltage Scan Rate",
"record_meta": true,
"initial": 10000,
"domain": [
100001
101
],
"value": {
"expression": "VALUE"
}
},
"CTRL_HIGH_Z_15": {
"description": "ctrl highZ level",
"CF_AVERAGE_NUM": {
"description": "Number of sample used for average funciton",
"record_meta": true,
"initial": 1,
"initial": 8,
"value": [
"On",
"Off"
],
"on_change": "set_ctrl_highZ"
2,
4,
6,
8
]
},
"ADC_LEVEL_I_15": {
"description": "ADC level",
"record_meta": true,
"initial": 4,
"value": [
"0",
"1",
"2",
"3",
"auto"
],
"on_change": "set_adc_gain_I"
},
"ADC_LEVEL_V_IN_15": {
"description": "ADC level",
"record_meta": true,
"initial": 3,
"value": [
"0",
"1",
"2",
"auto"
],
"on_change": "set_adc_gain_Vin"
},
"VOLT_INITIAL": {
"CV_E_INITIAL": {
"description": "Initial Voltage of Scan",
"record_meta": true,
"initial": 25000,
@@ -233,8 +279,8 @@
"expression": "VALUE"
}
},
"VOLT_MAX": {
"description": "Max Voltage of Scan",
"CV_E1": {
"description": "First voltage of Scan",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -244,8 +290,8 @@
"expression": "VALUE"
}
},
"VOLT_MIN": {
"description": "Min Voltage of Scan",
"CV_E2": {
"description": "Second voltage of Scan",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -255,27 +301,54 @@
"expression": "VALUE"
}
},
"CYCLE_NUMBER": {
"description": "CV cycle number",
"CV_SCAN_RATE": {
"description": "Voltage scan rate",
"record_meta": true,
"initial": 1,
"initial": 10000,
"domain": [
100001
],
"value": {
"expression": "VALUE"
}
},
"CA_VOLT": {
"description": "Voltage of ca",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"VT_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"
},
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
"ADC_VALUE_I": {
"description": "ADC value current value",
"domain": "int"
},
"BLE_WRITE": {
"description": "send msg to elite",
@@ -307,15 +380,12 @@
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_I",
"2": "set_adc_gain_I"
}
},
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
"0": "set_general_hs_rtia",
"1": "set_general_lp_rtia",
"2": "set_general_lp_rtia",
"3": "set_general_lp_rtia",
"4": "set_general_lp_rtia",
"5": "set_general_hs_rtia"
}
},
{
@@ -323,14 +393,25 @@
"when": {
"0": "curve_eis",
"1": "curve_cv3",
"2": "curve_const_vscan"
"2": "curve_ca",
"3": "curve_vt",
"4": "curve_rt",
"5": "curve_cf"
}
},
{
"expression": "MODE",
"when": {
"0": "curve_eis_para2",
"1": "curve_cv3_para2"
"1": "curve_cv3_para2",
"5": "curve_cf_para2"
}
},
{
"expression": "MODE",
"when": {
"0": "curve_eis_mode",
"5": "curve_cf_mode"
}
},
"_sync(True)",
@@ -350,6 +431,18 @@
"data_format_cali": [
"_data_format_cali('EISZeroOne')"
],
"set_general_hs_rtia": {
"type": "RIS",
"data": [
"1XFF;1X70;1B>GENERAL_HS_RTIA"
]
},
"set_general_lp_rtia": {
"type": "RIS",
"data": [
"1XFF;1X71;1B>GENERAL_LP_RTIA"
]
},
"set_sample_rate": {
"type": "RIS",
"parameter": {
@@ -359,103 +452,172 @@
"XE0;2B>va"
]
},
"set_adc_gain_I": {
"type": "RIS",
"data": [
"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": {
"type": "RIS",
"data": [
"XE1;X03;B>CTRL_HIGH_Z_15"
"1XFF;1X72;1B>CTRL_HIGH_Z_15"
]
},
"curve_eis": {
"type": "RIS",
"parameter": {
"fa": "FREQ[0]",
"fb": "FREQ[1]",
"dp": "DELAY",
"dc": "DC_BIAS",
"am": "AC_AMP",
"an": "AVERAGE_NUM",
"rt": "RTIA",
"pp": "PPD",
"sp": "SCALE"
"fa": "EIS_FREQ[0]",
"fb": "EIS_FREQ[1]",
"dp": "EIS_DELAY",
"dc": "EIS_DC_BIAS",
"am": "EIS_AC_AMP",
"an": "EIS_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "EIS_PPD",
"sp": "EIS_SCALE"
},
"data": [
"1XD1;1X01;4B>fa;4B>fb;2B>dp"
"1X12;1X01;4B>fa;4B>fb;2B>dp"
]
},
"curve_eis_para2": {
"type": "RIS",
"parameter": {
"fa": "FREQ[0]",
"fb": "FREQ[1]",
"dp": "DELAY",
"dc": "DC_BIAS",
"am": "AC_AMP",
"an": "AVERAGE_NUM",
"rt": "RTIA",
"pp": "PPD",
"sp": "SCALE"
"fa": "EIS_FREQ[0]",
"fb": "EIS_FREQ[1]",
"dp": "EIS_DELAY",
"dc": "EIS_DC_BIAS",
"am": "EIS_AC_AMP",
"an": "EIS_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "EIS_PPD",
"sp": "EIS_SCALE"
},
"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_cf": {
"type": "RIS",
"parameter": {
"fa": "CF_FREQ",
"dp": "CF_DELAY",
"dc": "CF_DC_BIAS",
"am": "CF_AC_AMP",
"an": "CF_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "CF_PPD",
"sp": "CF_SCALE"
},
"data": [
"1X13;1X01;4B>fa;4B>0;2B>dp"
]
},
"curve_cf_para2": {
"type": "RIS",
"parameter": {
"fa": "CF_FREQ",
"dp": "CF_DELAY",
"dc": "CF_DC_BIAS",
"am": "CF_AC_AMP",
"an": "CF_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "CF_PPD",
"sp": "CF_SCALE"
},
"data": [
"1X13;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp"
]
},
"curve_cf_mode": {
"type": "RIS",
"data": [
"1X13;1XFF"
]
},
"curve_cv3": {
"type": "RIS",
"parameter": {
"va": "VOLT_INITIAL",
"vb": "VOLT_MAX",
"vc": "VOLT_MIN",
"ve": "Scan_Rate",
"va": "CV_E_INITIAL",
"vb": "CV_E1",
"vc": "CV_E2",
"ve": "CV_SCAN_RATE",
"vf": "SAMPLE_RATE",
"cn": "CYCLE_NUMBER"
},
"data": [
"1XD2;1X01;2B>va;2B>vb;2B>vc;"
"1X09;1X01;2B>va;2B>vb;2B>vc;"
]
},
"curve_cv3_para2": {
"type": "RIS",
"parameter": {
"va": "VOLT_INITIAL",
"vb": "VOLT_MAX",
"vc": "VOLT_MIN",
"ve": "Scan_Rate",
"va": "CV_E_INITIAL",
"vb": "CV_E1",
"vc": "CV_E2",
"ve": "CV_SCAN_RATE",
"vf": "SAMPLE_RATE",
"cn": "CYCLE_NUMBER"
},
"data": [
"1XD2;1X02;4B>ve;2B>vf;2B>cn"
"1X09;1X02;4B>ve;2B>vf;2B>cn"
]
},
"curve_const_vscan": {
"curve_ca": {
"type": "RIS",
"parameter": {
"va": "VOLT_VSCAN",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"va": "CA_VOLT",
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"1XD3;",
"1X0B;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>pa;4b>0;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_rt": {
"type": "RIS",
"parameter": {
"va": "RT_VOLT_SET",
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"X04;",
"2B>va;",
"4b>pa;4b>0;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_vt": {
"type": "RIS",
"parameter": {
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE",
"va": "VT_MEASURE_VIN_RANGE"
},
"data": [
"X05;",
"4b>pa;4b>0;",
"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_write",
"_cdr('20X>ADC_VALUE_I')"
+339 -177
View File
@@ -9,7 +9,7 @@
"minor_version_number": 1
},
"constant": {
"FREQ_MAX": 4294967296,
"FREQ_MAX": 13333334,
"VOLT_MAX": 65536,
"BLE_WRITE_MAX": 255,
"TIME_MAX": 100000
@@ -26,17 +26,43 @@
"expression": "VALUE"
}
},
"CHANNEL": {
"derzteription": "record channels",
"record_meta": true,
"domain": "property",
"value": "[0, 1, 2]"
"HIGHZ_TABLE": {
"initial": [
1,
1,
1,
0,
1,
1,
1
],
"domain": {
"list": [
100
]
},
"value": "VALUE"
},
"CHANNEL_LABEL": {
"description": "channel label",
"CTRL_HIGH_Z_15": {
"description": "ctrl highZ level",
"record_meta": true,
"domain": "property",
"value": "['current', 'voltage', 'impedance']"
"initial": 1,
"value": [
"On",
"Off"
],
"on_change": "set_ctrl_highZ"
},
"CYCLE_NUMBER": {
"description": "CV cycle number",
"record_meta": true,
"initial": 1,
"domain": [
65536
],
"value": {
"expression": "VALUE"
}
},
"SAMPLE_RATE": {
"description": "data sampling rate",
@@ -50,6 +76,12 @@
},
"on_change": "set_sample_rate"
},
"CHANNEL": {
"derzteription": "record channels",
"record_meta": true,
"domain": "property",
"value": "[0, 1, 2]"
},
"AMP_GAIN": {
"description": "amp gain",
"record_meta": true,
@@ -63,11 +95,59 @@
"EIS CURVE",
"Cyclic Voltammetry",
"Chronoamperometric",
"V-T Graph",
"R-T Graph",
"EIS constant frequency",
"Dev Mode"
]
},
"FREQ": {
"description": "DPV current recording period start",
"GENERAL_HS_RTIA": {
"description": "High speed rtia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
],
"on_change": "set_general_hs_rtia"
},
"GENERAL_LP_RTIA": {
"description": "Low power rtia gain",
"record_meta": true,
"initial": 4,
"value": [
"0",
"1",
"2",
"3",
"auto"
],
"on_change": "set_general_lp_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,
"initial": [
13333333,
@@ -80,29 +160,24 @@
},
"value": "VALUE"
},
"FREQ_START": {
"description": "Start of Freq Scan",
"EIS_PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 13422819,
"initial": 10,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
11
]
},
"FREQ_STOP": {
"description": "End of Freq Scan",
"EIS_SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 7,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
"initial": 0,
"value": [
0,
1
]
},
"DELAY": {
"EIS_DELAY": {
"description": "Wait x peroid before start taking measurements",
"record_meta": true,
"initial": 0,
@@ -113,19 +188,19 @@
"expression": "VALUE"
}
},
"AVERAGE_NUM": {
"EIS_AVERAGE_NUM": {
"description": "Number of sample used for average funciton",
"record_meta": true,
"initial": 8,
"value": [
2,
4,
8,
16
6,
8
]
},
"DC_BIAS": {
"description": "DC voltage bias in mV",
"CF_DC_BIAS": {
"description": "DC voltage bias",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -135,15 +210,34 @@
"expression": "VALUE"
}
},
"AC_AMP": {
"description": "AC Amplitude in mV",
"CF_AC_AMP": {
"description": "AC Amplitude",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"SCALE": {
"CF_FREQ": {
"description": "frequency of cf",
"record_meta": true,
"initial": 13333333,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
},
"CF_PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 10,
"domain": [
11
]
},
"CF_SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 0,
@@ -152,77 +246,29 @@
1
]
},
"PPD": {
"description": "Point per decades",
"CF_DELAY": {
"description": "Wait x peroid before start taking measurements",
"record_meta": true,
"initial": 10,
"initial": 0,
"domain": [
11
]
},
"RTIA": {
"description": "High speed tia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
]
},
"ADC_VALUE_I": {
"description": "ADC value current value",
"domain": "int"
},
"Scan_Rate": {
"description": "Voltage Scan Rate",
"record_meta": true,
"initial": 10000,
"domain": [
100001
101
],
"value": {
"expression": "VALUE"
}
},
"CTRL_HIGH_Z_15": {
"description": "ctrl highZ level",
"CF_AVERAGE_NUM": {
"description": "Number of sample used for average funciton",
"record_meta": true,
"initial": 1,
"initial": 8,
"value": [
"On",
"Off"
],
"on_change": "set_ctrl_highZ"
2,
4,
6,
8
]
},
"ADC_LEVEL_I_15": {
"description": "ADC level",
"record_meta": true,
"initial": 4,
"value": [
"0",
"1",
"2",
"3",
"auto"
],
"on_change": "set_adc_gain_I"
},
"ADC_LEVEL_V_IN_15": {
"description": "ADC level",
"record_meta": true,
"initial": 3,
"value": [
"0",
"1",
"2",
"auto"
],
"on_change": "set_adc_gain_Vin"
},
"VOLT_INITIAL": {
"CV_E_INITIAL": {
"description": "Initial Voltage of Scan",
"record_meta": true,
"initial": 25000,
@@ -233,8 +279,8 @@
"expression": "VALUE"
}
},
"VOLT_MAX": {
"description": "Max Voltage of Scan",
"CV_E1": {
"description": "First voltage of Scan",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -244,8 +290,8 @@
"expression": "VALUE"
}
},
"VOLT_MIN": {
"description": "Min Voltage of Scan",
"CV_E2": {
"description": "Second voltage of Scan",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -255,27 +301,54 @@
"expression": "VALUE"
}
},
"CYCLE_NUMBER": {
"description": "CV cycle number",
"CV_SCAN_RATE": {
"description": "Voltage scan rate",
"record_meta": true,
"initial": 1,
"initial": 10000,
"domain": [
100001
],
"value": {
"expression": "VALUE"
}
},
"CA_VOLT": {
"description": "Voltage of ca",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"VT_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"
},
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
"ADC_VALUE_I": {
"description": "ADC value current value",
"domain": "int"
},
"BLE_WRITE": {
"description": "send msg to elite",
@@ -307,15 +380,12 @@
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_I",
"2": "set_adc_gain_I"
}
},
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
"0": "set_general_hs_rtia",
"1": "set_general_lp_rtia",
"2": "set_general_lp_rtia",
"3": "set_general_lp_rtia",
"4": "set_general_lp_rtia",
"5": "set_general_hs_rtia"
}
},
{
@@ -323,14 +393,25 @@
"when": {
"0": "curve_eis",
"1": "curve_cv3",
"2": "curve_const_vscan"
"2": "curve_ca",
"3": "curve_vt",
"4": "curve_rt",
"5": "curve_cf"
}
},
{
"expression": "MODE",
"when": {
"0": "curve_eis_para2",
"1": "curve_cv3_para2"
"1": "curve_cv3_para2",
"5": "curve_cf_para2"
}
},
{
"expression": "MODE",
"when": {
"0": "curve_eis_mode",
"5": "curve_cf_mode"
}
},
"_sync(True)",
@@ -350,6 +431,18 @@
"data_format_cali": [
"_data_format_cali('EISZeroOne')"
],
"set_general_hs_rtia": {
"type": "RIS",
"data": [
"1XFF;1X70;1B>GENERAL_HS_RTIA"
]
},
"set_general_lp_rtia": {
"type": "RIS",
"data": [
"1XFF;1X71;1B>GENERAL_LP_RTIA"
]
},
"set_sample_rate": {
"type": "RIS",
"parameter": {
@@ -359,103 +452,172 @@
"XE0;2B>va"
]
},
"set_adc_gain_I": {
"type": "RIS",
"data": [
"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": {
"type": "RIS",
"data": [
"XE1;X03;B>CTRL_HIGH_Z_15"
"1XFF;1X72;1B>CTRL_HIGH_Z_15"
]
},
"curve_eis": {
"type": "RIS",
"parameter": {
"fa": "FREQ[0]",
"fb": "FREQ[1]",
"dp": "DELAY",
"dc": "DC_BIAS",
"am": "AC_AMP",
"an": "AVERAGE_NUM",
"rt": "RTIA",
"pp": "PPD",
"sp": "SCALE"
"fa": "EIS_FREQ[0]",
"fb": "EIS_FREQ[1]",
"dp": "EIS_DELAY",
"dc": "EIS_DC_BIAS",
"am": "EIS_AC_AMP",
"an": "EIS_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "EIS_PPD",
"sp": "EIS_SCALE"
},
"data": [
"1XD1;1X01;4B>fa;4B>fb;2B>dp"
"1X12;1X01;4B>fa;4B>fb;2B>dp"
]
},
"curve_eis_para2": {
"type": "RIS",
"parameter": {
"fa": "FREQ[0]",
"fb": "FREQ[1]",
"dp": "DELAY",
"dc": "DC_BIAS",
"am": "AC_AMP",
"an": "AVERAGE_NUM",
"rt": "RTIA",
"pp": "PPD",
"sp": "SCALE"
"fa": "EIS_FREQ[0]",
"fb": "EIS_FREQ[1]",
"dp": "EIS_DELAY",
"dc": "EIS_DC_BIAS",
"am": "EIS_AC_AMP",
"an": "EIS_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "EIS_PPD",
"sp": "EIS_SCALE"
},
"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_cf": {
"type": "RIS",
"parameter": {
"fa": "CF_FREQ",
"dp": "CF_DELAY",
"dc": "CF_DC_BIAS",
"am": "CF_AC_AMP",
"an": "CF_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "CF_PPD",
"sp": "CF_SCALE"
},
"data": [
"1X13;1X01;4B>fa;4B>0;2B>dp"
]
},
"curve_cf_para2": {
"type": "RIS",
"parameter": {
"fa": "CF_FREQ",
"dp": "CF_DELAY",
"dc": "CF_DC_BIAS",
"am": "CF_AC_AMP",
"an": "CF_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "CF_PPD",
"sp": "CF_SCALE"
},
"data": [
"1X13;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp"
]
},
"curve_cf_mode": {
"type": "RIS",
"data": [
"1X13;1XFF"
]
},
"curve_cv3": {
"type": "RIS",
"parameter": {
"va": "VOLT_INITIAL",
"vb": "VOLT_MAX",
"vc": "VOLT_MIN",
"ve": "Scan_Rate",
"va": "CV_E_INITIAL",
"vb": "CV_E1",
"vc": "CV_E2",
"ve": "CV_SCAN_RATE",
"vf": "SAMPLE_RATE",
"cn": "CYCLE_NUMBER"
},
"data": [
"1XD2;1X01;2B>va;2B>vb;2B>vc;"
"1X09;1X01;2B>va;2B>vb;2B>vc;"
]
},
"curve_cv3_para2": {
"type": "RIS",
"parameter": {
"va": "VOLT_INITIAL",
"vb": "VOLT_MAX",
"vc": "VOLT_MIN",
"ve": "Scan_Rate",
"va": "CV_E_INITIAL",
"vb": "CV_E1",
"vc": "CV_E2",
"ve": "CV_SCAN_RATE",
"vf": "SAMPLE_RATE",
"cn": "CYCLE_NUMBER"
},
"data": [
"1XD2;1X02;4B>ve;2B>vf;2B>cn"
"1X09;1X02;4B>ve;2B>vf;2B>cn"
]
},
"curve_const_vscan": {
"curve_ca": {
"type": "RIS",
"parameter": {
"va": "VOLT_VSCAN",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"va": "CA_VOLT",
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"1XD3;",
"1X0B;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>pa;4b>0;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_rt": {
"type": "RIS",
"parameter": {
"va": "RT_VOLT_SET",
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"X04;",
"2B>va;",
"4b>pa;4b>0;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_vt": {
"type": "RIS",
"parameter": {
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE",
"va": "VT_MEASURE_VIN_RANGE"
},
"data": [
"X05;",
"4b>pa;4b>0;",
"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_write",
"_cdr('20X>ADC_VALUE_I')"
@@ -9,7 +9,7 @@
"minor_version_number": 2
},
"constant": {
"FREQ_MAX": 4294967296,
"FREQ_MAX": 13333334,
"VOLT_MAX": 65536,
"BLE_WRITE_MAX": 255,
"TIME_MAX": 100000
@@ -26,17 +26,43 @@
"expression": "VALUE"
}
},
"CHANNEL": {
"derzteription": "record channels",
"record_meta": true,
"domain": "property",
"value": "[0, 1, 2]"
"HIGHZ_TABLE": {
"initial": [
1,
1,
1,
0,
1,
1,
1
],
"domain": {
"list": [
100
]
},
"value": "VALUE"
},
"CHANNEL_LABEL": {
"description": "channel label",
"CTRL_HIGH_Z_15": {
"description": "ctrl highZ level",
"record_meta": true,
"domain": "property",
"value": "['current', 'voltage', 'impedance']"
"initial": 1,
"value": [
"On",
"Off"
],
"on_change": "set_ctrl_highZ"
},
"CYCLE_NUMBER": {
"description": "CV cycle number",
"record_meta": true,
"initial": 1,
"domain": [
65536
],
"value": {
"expression": "VALUE"
}
},
"SAMPLE_RATE": {
"description": "data sampling rate",
@@ -50,6 +76,12 @@
},
"on_change": "set_sample_rate"
},
"CHANNEL": {
"derzteription": "record channels",
"record_meta": true,
"domain": "property",
"value": "[0, 1, 2]"
},
"AMP_GAIN": {
"description": "amp gain",
"record_meta": true,
@@ -63,14 +95,62 @@
"EIS CURVE",
"Cyclic Voltammetry",
"Chronoamperometric",
"V-T Graph",
"R-T Graph",
"EIS constant frequency",
"Dev Mode"
]
},
"FREQ": {
"description": "DPV current recording period start",
"GENERAL_HS_RTIA": {
"description": "High speed rtia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
],
"on_change": "set_general_hs_rtia"
},
"GENERAL_LP_RTIA": {
"description": "Low power rtia gain",
"record_meta": true,
"initial": 4,
"value": [
"0",
"1",
"2",
"3",
"auto"
],
"on_change": "set_general_lp_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,
"initial": [
13422819,
13333333,
7
],
"domain": {
@@ -80,29 +160,24 @@
},
"value": "VALUE"
},
"FREQ_START": {
"description": "Start of Freq Scan",
"EIS_PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 13422819,
"initial": 10,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
11
]
},
"FREQ_STOP": {
"description": "End of Freq Scan",
"EIS_SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 7,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
"initial": 0,
"value": [
0,
1
]
},
"DELAY": {
"EIS_DELAY": {
"description": "Wait x peroid before start taking measurements",
"record_meta": true,
"initial": 0,
@@ -113,19 +188,19 @@
"expression": "VALUE"
}
},
"AVERAGE_NUM": {
"EIS_AVERAGE_NUM": {
"description": "Number of sample used for average funciton",
"record_meta": true,
"initial": 8,
"value": [
2,
4,
8,
16
6,
8
]
},
"DC_BIAS": {
"description": "DC voltage bias in mV",
"CF_DC_BIAS": {
"description": "DC voltage bias",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -135,15 +210,34 @@
"expression": "VALUE"
}
},
"AC_AMP": {
"description": "AC Amplitude in mV",
"CF_AC_AMP": {
"description": "AC Amplitude",
"record_meta": true,
"initial": 25,
"domain": [
2048
]
},
"SCALE": {
"CF_FREQ": {
"description": "frequency of cf",
"record_meta": true,
"initial": 13333333,
"domain": [
"FREQ_MAX"
],
"value": {
"expression": "VALUE"
}
},
"CF_PPD": {
"description": "Point per decades",
"record_meta": true,
"initial": 10,
"domain": [
11
]
},
"CF_SCALE": {
"description": "Point spacing pattern",
"record_meta": true,
"initial": 0,
@@ -152,77 +246,29 @@
1
]
},
"PPD": {
"description": "Point per decades",
"CF_DELAY": {
"description": "Wait x peroid before start taking measurements",
"record_meta": true,
"initial": 10,
"initial": 0,
"domain": [
11
]
},
"RTIA": {
"description": "High speed tia gain",
"record_meta": true,
"initial": 4,
"value": [
0,
1,
2,
3,
4
]
},
"ADC_VALUE_I": {
"description": "ADC value current value",
"domain": "int"
},
"Scan_Rate": {
"description": "Voltage Scan Rate",
"record_meta": true,
"initial": 10000,
"domain": [
100001
101
],
"value": {
"expression": "VALUE"
}
},
"CTRL_HIGH_Z_15": {
"description": "ctrl highZ level",
"CF_AVERAGE_NUM": {
"description": "Number of sample used for average funciton",
"record_meta": true,
"initial": 1,
"initial": 8,
"value": [
"On",
"Off"
],
"on_change": "set_ctrl_highZ"
2,
4,
6,
8
]
},
"ADC_LEVEL_I_15": {
"description": "ADC level",
"record_meta": true,
"initial": 4,
"value": [
"0",
"1",
"2",
"3",
"auto"
],
"on_change": "set_adc_gain_I"
},
"ADC_LEVEL_V_IN_15": {
"description": "ADC level",
"record_meta": true,
"initial": 3,
"value": [
"0",
"1",
"2",
"auto"
],
"on_change": "set_adc_gain_Vin"
},
"VOLT_INITIAL": {
"CV_E_INITIAL": {
"description": "Initial Voltage of Scan",
"record_meta": true,
"initial": 25000,
@@ -233,8 +279,8 @@
"expression": "VALUE"
}
},
"VOLT_MAX": {
"description": "Max Voltage of Scan",
"CV_E1": {
"description": "First voltage of Scan",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -244,8 +290,8 @@
"expression": "VALUE"
}
},
"VOLT_MIN": {
"description": "Min Voltage of Scan",
"CV_E2": {
"description": "Second voltage of Scan",
"record_meta": true,
"initial": 25000,
"domain": [
@@ -255,27 +301,54 @@
"expression": "VALUE"
}
},
"CYCLE_NUMBER": {
"description": "CV cycle number",
"CV_SCAN_RATE": {
"description": "Voltage scan rate",
"record_meta": true,
"initial": 1,
"initial": 10000,
"domain": [
100001
],
"value": {
"expression": "VALUE"
}
},
"CA_VOLT": {
"description": "Voltage of ca",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
},
"VT_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"
},
"VOLT_VSCAN": {
"description": "Voltage of VScan",
"record_meta": true,
"initial": 25000,
"domain": [
"VOLT_MAX"
],
"value": {
"expression": "VALUE"
}
"ADC_VALUE_I": {
"description": "ADC value current value",
"domain": "int"
},
"BLE_WRITE": {
"description": "send msg to elite",
@@ -307,15 +380,12 @@
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_I",
"2": "set_adc_gain_I"
}
},
{
"expression": "MODE",
"when": {
"1": "set_adc_gain_Vin",
"2": "set_adc_gain_Vin"
"0": "set_general_hs_rtia",
"1": "set_general_lp_rtia",
"2": "set_general_lp_rtia",
"3": "set_general_lp_rtia",
"4": "set_general_lp_rtia",
"5": "set_general_hs_rtia"
}
},
{
@@ -323,14 +393,25 @@
"when": {
"0": "curve_eis",
"1": "curve_cv3",
"2": "curve_const_vscan"
"2": "curve_ca",
"3": "curve_vt",
"4": "curve_rt",
"5": "curve_cf"
}
},
{
"expression": "MODE",
"when": {
"0": "curve_eis_para2",
"1": "curve_cv3_para2"
"1": "curve_cv3_para2",
"5": "curve_cf_para2"
}
},
{
"expression": "MODE",
"when": {
"0": "curve_eis_mode",
"5": "curve_cf_mode"
}
},
"_sync(True)",
@@ -350,6 +431,18 @@
"data_format_cali": [
"_data_format_cali('EISZeroOne')"
],
"set_general_hs_rtia": {
"type": "RIS",
"data": [
"1XFF;1X70;1B>GENERAL_HS_RTIA"
]
},
"set_general_lp_rtia": {
"type": "RIS",
"data": [
"1XFF;1X71;1B>GENERAL_LP_RTIA"
]
},
"set_sample_rate": {
"type": "RIS",
"parameter": {
@@ -359,103 +452,172 @@
"XE0;2B>va"
]
},
"set_adc_gain_I": {
"type": "RIS",
"data": [
"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": {
"type": "RIS",
"data": [
"XE1;X03;B>CTRL_HIGH_Z_15"
"1XFF;1X72;1B>CTRL_HIGH_Z_15"
]
},
"curve_eis": {
"type": "RIS",
"parameter": {
"fa": "FREQ[0]",
"fb": "FREQ[1]",
"dp": "DELAY",
"dc": "DC_BIAS",
"am": "AC_AMP",
"an": "AVERAGE_NUM",
"rt": "RTIA",
"pp": "PPD",
"sp": "SCALE"
"fa": "EIS_FREQ[0]",
"fb": "EIS_FREQ[1]",
"dp": "EIS_DELAY",
"dc": "EIS_DC_BIAS",
"am": "EIS_AC_AMP",
"an": "EIS_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "EIS_PPD",
"sp": "EIS_SCALE"
},
"data": [
"1XD1;1X01;4B>fa;4B>fb;2B>dp"
"1X12;1X01;4B>fa;4B>fb;2B>dp"
]
},
"curve_eis_para2": {
"type": "RIS",
"parameter": {
"fa": "FREQ[0]",
"fb": "FREQ[1]",
"dp": "DELAY",
"dc": "DC_BIAS",
"am": "AC_AMP",
"an": "AVERAGE_NUM",
"rt": "RTIA",
"pp": "PPD",
"sp": "SCALE"
"fa": "EIS_FREQ[0]",
"fb": "EIS_FREQ[1]",
"dp": "EIS_DELAY",
"dc": "EIS_DC_BIAS",
"am": "EIS_AC_AMP",
"an": "EIS_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "EIS_PPD",
"sp": "EIS_SCALE"
},
"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_cf": {
"type": "RIS",
"parameter": {
"fa": "CF_FREQ",
"dp": "CF_DELAY",
"dc": "CF_DC_BIAS",
"am": "CF_AC_AMP",
"an": "CF_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "CF_PPD",
"sp": "CF_SCALE"
},
"data": [
"1X13;1X01;4B>fa;4B>0;2B>dp"
]
},
"curve_cf_para2": {
"type": "RIS",
"parameter": {
"fa": "CF_FREQ",
"dp": "CF_DELAY",
"dc": "CF_DC_BIAS",
"am": "CF_AC_AMP",
"an": "CF_AVERAGE_NUM",
"rt": "GENERAL_HS_RTIA",
"pp": "CF_PPD",
"sp": "CF_SCALE"
},
"data": [
"1X13;1X02;2B>dc;2B>am;B>an;B>rt;2B>pp;B>sp"
]
},
"curve_cf_mode": {
"type": "RIS",
"data": [
"1X13;1XFF"
]
},
"curve_cv3": {
"type": "RIS",
"parameter": {
"va": "VOLT_INITIAL",
"vb": "VOLT_MAX",
"vc": "VOLT_MIN",
"ve": "Scan_Rate",
"va": "CV_E_INITIAL",
"vb": "CV_E1",
"vc": "CV_E2",
"ve": "CV_SCAN_RATE",
"vf": "SAMPLE_RATE",
"cn": "CYCLE_NUMBER"
},
"data": [
"1XD2;1X01;2B>va;2B>vb;2B>vc;"
"1X09;1X01;2B>va;2B>vb;2B>vc;"
]
},
"curve_cv3_para2": {
"type": "RIS",
"parameter": {
"va": "VOLT_INITIAL",
"vb": "VOLT_MAX",
"vc": "VOLT_MIN",
"ve": "Scan_Rate",
"va": "CV_E_INITIAL",
"vb": "CV_E1",
"vc": "CV_E2",
"ve": "CV_SCAN_RATE",
"vf": "SAMPLE_RATE",
"cn": "CYCLE_NUMBER"
},
"data": [
"1XD2;1X02;4B>ve;2B>vf;2B>cn"
"1X09;1X02;4B>ve;2B>vf;2B>cn"
]
},
"curve_const_vscan": {
"curve_ca": {
"type": "RIS",
"parameter": {
"va": "VOLT_VSCAN",
"pa": "ADC_LEVEL_I_15",
"pb": "ADC_LEVEL_V_IN_15",
"va": "CA_VOLT",
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"1XD3;",
"1X0B;",
"2B>va;",
"4b>pa;4b>pb;",
"4b>pa;4b>0;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_rt": {
"type": "RIS",
"parameter": {
"va": "RT_VOLT_SET",
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE"
},
"data": [
"X04;",
"2B>va;",
"4b>pa;4b>0;",
"4b>0;4b>pd;",
"2B>pe"
]
},
"curve_vt": {
"type": "RIS",
"parameter": {
"pa": "GENERAL_LP_RTIA",
"pd": "CTRL_HIGH_Z_15",
"pe": "SAMPLE_RATE",
"va": "VT_MEASURE_VIN_RANGE"
},
"data": [
"X05;",
"4b>pa;4b>0;",
"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_write",
"_cdr('20X>ADC_VALUE_I')"