Example #1
0
 def _new_display_triggered(self):
     """Create a new Data Window to display data broadcasts"""
     if (self.sender() is self._new_plot_action):
         w = PlotWindow(self)
     elif (self.sender() is self._new_image_action):
         w = ImageWindow(self)
     w.show()
     self._data_windows.append(w)
Example #2
0
 def _restore_data_windows(self, settings, data_sources):
     """Restores the geometry and data sources of the data windows."""
     if(settings.contains("dataWindows")):
         data_windows = settings.value("dataWindows")
         if data_windows is None:
             return
         for dw in data_windows:
             try:
                 if(dw['window_type'] == 'ImageWindow'):
                     w = ImageWindow(self)
                 elif(dw['window_type'] == 'PlotWindow'):
                     w = PlotWindow(self)
                 else:
                     raise ValueError(('window_type %s not supported' %(dw['window_type'])))
                 w.restore_from_state(dw, data_sources)
                 self._data_windows.append(w)
                 logging.debug("Loaded %s from settings", type(w).__name__)
             # Try to handle some version incompatibilities
             except KeyError:
                 raise
                 pass
Example #3
0
 def _restore_data_windows(self, settings, data_sources):
     """Restores the geometry and data sources of the data windows."""
     if(settings.contains("dataWindows")):
         data_windows = settings.value("dataWindows")
         if data_windows is None:
             return
         for dw in data_windows:
             try:
                 if(dw['window_type'] == 'ImageWindow'):
                     w = ImageWindow(self)
                 elif(dw['window_type'] == 'PlotWindow'):
                     w = PlotWindow(self)
                 else:
                     raise ValueError(('window_type %s not supported' %(dw['window_type'])))
                 w.restore_from_state(dw, data_sources)
                 self._data_windows.append(w)
                 logging.debug("Loaded %s from settings", type(w).__name__)
             # Try to handle some version incompatibilities
             except KeyError:
                 raise
                 pass
Example #4
0
    def _on_double_click(self, row, column):
        print('Clicked: %d, %d'%(row, column))
        item = self.table.item(row, 1)
        if self.item_is_group_header(item):
            return
        plotdata = item.data(QtCore.Qt.UserRole)
        data_type = plotdata._parent.data_type[plotdata.title]
        mwindow = self.window()
        if data_type in ImageWindow.acceptable_data_types:
            w = ImageWindow(mwindow)
        elif data_type in PlotWindow.acceptable_data_types:
            w = PlotWindow(mwindow)
        else:
            print('Unrecognized data_type:', data_type)
            return

        w.show()
        mwindow._data_windows.append(w)
        w.set_source_title(plotdata._parent, plotdata.title)