*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 8f2a4bdf authored by Schabbauer, Johannes's avatar Schabbauer, Johannes
Browse files

ADwin: Don't save workload and bugfix for runviewer

parent 4391dc39
No related branches found
No related tags found
No related merge requests found
......@@ -182,6 +182,7 @@ class ADwinProIIWorker(Worker):
def transition_to_manual(self):
self.logger.debug("ADwin called transition_to_manual.")
start = time.perf_counter()
# Get AIN measurements from ADwin
with h5py.File(self.h5file,'r+') as f:
AI_count = f[f"devices/{self.device_name}/ANALOG_IN"].attrs["AIN_count"]
......@@ -191,13 +192,13 @@ class ADwinProIIWorker(Worker):
AIN_data = np.ctypeslib.as_array(self.adw.GetData_Long(199,1,int(AI_count))).astype(np.uint16)
group.create_dataset("ADwinAnalogIn_DATA", compression = config.compression, data = AIN_data)
# Workload for Testing
stop_time = self.adw.Get_Par(2)-1
workload_data = np.ctypeslib.as_array(self.adw.GetData_Long(31,1,stop_time))
array = np.empty(stop_time, dtype=[("t",np.int32),("values",np.int32)])
array["t"] = np.arange(stop_time)
array["values"] = workload_data
group.create_dataset("ADwin_Workload", compression = config.compression, data = array)
f['devices/ADwin/ANALOG_IN'].attrs["ADwin_Workload"] = "TEST"
# stop_time = self.adw.Get_Par(2)-1
# workload_data = np.ctypeslib.as_array(self.adw.GetData_Long(31,1,stop_time))
# array = np.empty(stop_time, dtype=[("t",np.int32),("values",np.int32)])
# array["t"] = np.arange(stop_time)
# array["values"] = workload_data
# group.create_dataset("ADwin_Workload", compression = config.compression, data = array)
# f['devices/ADwin/ANALOG_IN'].attrs["ADwin_Workload"] = "TEST"
# Delete h5file from worker, shot is finished
self.h5file = None
# Check if the TiCo processes were running correctly
......@@ -207,6 +208,7 @@ class ADwinProIIWorker(Worker):
# Stop buffered and start manual process in ADwin
self.adw.Stop_Process(self.process_number_buffered)
#self.adw.Start_Process(self.process_number_manual)
print(f"Time for transition_to_manual: {time.perf_counter()-start:.3f}s")
return True
......
......@@ -79,18 +79,11 @@ class ADwinProIIParser(object):
for input_name,input in module.child_list.items():
conn = int(input.parent_port)
i = conn-1+module_idxshift
if input_name in file["data/traces"]:
trace = (
file[f"data/traces/{input_name}"]["t"],
file[f"data/traces/{input_name}"]["values"]
trace = (
[table['start_time'][i]/ CLOCK_T12 * props["PROCESSDELAY"],
table['stop_time'][i] / CLOCK_T12 * props["PROCESSDELAY"]],
[1,0]
)
else: # if data was not yet measured, show just a line during aquisition time
trace = (
[table['start_time'][i]/ CLOCK_T12 * props["PROCESSDELAY"],
table['stop_time'][i] / CLOCK_T12 * props["PROCESSDELAY"]],
[1,0]
)
# TODO: can we add both traces to the plot ?
add_trace(input_name, trace, input_name, input.parent_port)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment