ladisk / LDAQ

MIT License
24 stars 5 forks source link

visualization check function #28

Closed TKosir closed 1 year ago

TKosir commented 1 year ago

It seems that if only a few subplots have subplot configured with config_subplot() , check method for visualization returns an error.


KeyError Traceback (most recent call last) Input In [25], in <cell line: 1>() ----> 1 ldaq.run()

File C:\LADISK\packages\LadiskDAQ\LadiskDAQ\core.py:151, in Core.run(self, measurement_duration, autoclose, autostart, run_name, save_interval, root, verbose) 148 time.sleep(0.2) 150 if self.visualization is not None: --> 151 self.visualization.run(self) 152 else: 153 # Main Loop if no visualization: 154 while self.is_running_global:

File C:\LADISK\packages\LadiskDAQ\LadiskDAQ\visualization.py:418, in Visualization.run(self, core) 415 self.core = core 416 # self.core.is_running_global = False --> 418 self.check() 420 # Create the ring buffers for each acquisition. 421 self.create_ring_buffers()

File C:\LADISK\packages\LadiskDAQ\LadiskDAQ\visualization.py:411, in Visualization.check(self) 408 def check(self): 409 self.check_subplot_options() --> 411 self.check_added_lines()

File C:\LADISK\packages\LadiskDAQ\LadiskDAQ\visualization.py:448, in Visualization.check_added_lines(self) 446 if plot_channel['nth'] == 'auto': 447 pos = plot_channel['pos'] --> 448 t_span = self.subplot_options[pos]['t_span'] 449 self.plots[source][i]['nth'] = compute_nth(self.max_points_to_refresh, t_span, n_lines, sample_rate)

KeyError: (0, 0) Here (0, 0) has not config_subplot() method called, others subplots do.

klemengit commented 1 year ago

Fixed in a4859951b5dee004ef045c6f7c10d70c684f12c6. Closing.