|
@@ -382,7 +382,7 @@ state = {
|
|
"wf_len": 200,
|
|
"wf_len": 200,
|
|
"N": 1,
|
|
"N": 1,
|
|
"step_max": 200,
|
|
"step_max": 200,
|
|
- "Gain": 10,
|
|
|
|
|
|
+ "Gain": 1.0,
|
|
"auto_set_pga": 1,
|
|
"auto_set_pga": 1,
|
|
"input_gain": 1,
|
|
"input_gain": 1,
|
|
"offset": 2000,
|
|
"offset": 2000,
|
|
@@ -390,13 +390,14 @@ state = {
|
|
}
|
|
}
|
|
|
|
|
|
def update_state():
|
|
def update_state():
|
|
|
|
+ print(state)
|
|
state["n_boards"] = len(chips)
|
|
state["n_boards"] = len(chips)
|
|
state["box_address"] = adresses[state["selected_board"]]
|
|
state["box_address"] = adresses[state["selected_board"]]
|
|
chip = chips[state["selected_board"]]
|
|
chip = chips[state["selected_board"]]
|
|
|
|
+ state["enab_gnd"] = chip.get_enab_gnd()
|
|
state["mode"] = chip.get_mode()
|
|
state["mode"] = chip.get_mode()
|
|
state["out_of_lock"] = chip.get_out_of_lock()
|
|
state["out_of_lock"] = chip.get_out_of_lock()
|
|
- state["remote_trigg"] = chip.get_remote_trigg()
|
|
|
|
- state["enab_gnd"] = chip.get_enab_gnd()
|
|
|
|
|
|
+ state["remote_trigg"] = chip.get_remote_trigg()
|
|
state["Vlearn"] = chip.get_Vlearn()
|
|
state["Vlearn"] = chip.get_Vlearn()
|
|
state["start"] = chip.get_start()
|
|
state["start"] = chip.get_start()
|
|
state["stop"] = chip.get_stop()
|
|
state["stop"] = chip.get_stop()
|
|
@@ -410,7 +411,15 @@ def update_state():
|
|
state["input_gain"] = chip.get_input_gain()
|
|
state["input_gain"] = chip.get_input_gain()
|
|
state["offset"] = chip.get_offset()
|
|
state["offset"] = chip.get_offset()
|
|
state["coarse_fine_ratio"] = chip.get_coarse_fine_ratio()
|
|
state["coarse_fine_ratio"] = chip.get_coarse_fine_ratio()
|
|
-
|
|
|
|
|
|
+ for l in state:
|
|
|
|
+ if isinstance(state[l], np.uint16) or isinstance(state[l], np.int32):
|
|
|
|
+ state[l] = int(state[l])
|
|
|
|
+ if isinstance(state[l], np.float32):
|
|
|
|
+ state[l] = float(state[l])
|
|
|
|
+ print(type(state[l]))
|
|
|
|
+ for l in state:
|
|
|
|
+ print(type(state[l]))
|
|
|
|
+ print(state)
|
|
eel.renderUI(state)
|
|
eel.renderUI(state)
|
|
|
|
|
|
|
|
|
|
@@ -442,21 +451,22 @@ p = subprocess.Popen(['i2cdetect', '-y','1'],stdout=subprocess.PIPE,)
|
|
p.stdout.readline()
|
|
p.stdout.readline()
|
|
for i in range(0,8):
|
|
for i in range(0,8):
|
|
line = str(p.stdout.readline())[4:]
|
|
line = str(p.stdout.readline())[4:]
|
|
- print(line)
|
|
|
|
for match in re.finditer("[0-9a-f]+", line):
|
|
for match in re.finditer("[0-9a-f]+", line):
|
|
- print(match)
|
|
|
|
adresses.append(int(match.group(0), 16))
|
|
adresses.append(int(match.group(0), 16))
|
|
chips.append(ADUCv2p1(int(match.group(0), 16),True))
|
|
chips.append(ADUCv2p1(int(match.group(0), 16),True))
|
|
-print('Found boards', chips)
|
|
|
|
|
|
+print('Found boards', adresses, chips)
|
|
|
|
+#update_state()
|
|
|
|
+eel.renderUI(state)
|
|
|
|
+eel.sleep(5)
|
|
update_state()
|
|
update_state()
|
|
-
|
|
|
|
|
|
+eel.renderUI(state)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-eel.renderUI(state)
|
|
|
|
i = 0
|
|
i = 0
|
|
while(True):
|
|
while(True):
|
|
|
|
+ print(state)
|
|
eel.renderUI(state) # TO DO
|
|
eel.renderUI(state) # TO DO
|
|
# save_waveform() # TO DO
|
|
# save_waveform() # TO DO
|
|
eel.sleep(1/state["pi_freq"])
|
|
eel.sleep(1/state["pi_freq"])
|