diff --git a/ADwinProII/blacs_workers.py b/ADwinProII/blacs_workers.py index 8271e021803ff47ed8999dee206350c5b6584eb1..74dd07fb0f133a334f8bcb4c044a69b56698c4a1 100644 --- a/ADwinProII/blacs_workers.py +++ b/ADwinProII/blacs_workers.py @@ -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 diff --git a/ADwinProII/runviewer_parsers.py b/ADwinProII/runviewer_parsers.py index a650839d025908d630725fa5650c5f20b1e06d3a..6dbfbef6181eb93529eec0db2159d1ad88e56884 100644 --- a/ADwinProII/runviewer_parsers.py +++ b/ADwinProII/runviewer_parsers.py @@ -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)