Example #1
0
class OptionsWidget(QWidget):

    file_att = CurrentComboDataProperty('ui.combo_file_attribute')

    def __init__(self, parent=None, data_viewer=None):

        super(OptionsWidget, self).__init__(parent=parent)

        self.ui = load_ui('viewer_options.ui',
                          self,
                          directory=os.path.dirname(__file__))

        self.file_helper = ComponentIDComboHelper(self.ui.combo_file_attribute,
                                                  data_viewer._data)

        self._data_viewer = data_viewer

        self._data = None

    def set_data(self, data):
        self.file_helper.clear()

        if isinstance(data, Subset):
            self.file_helper.append_data(data.data)
        else:
            self.file_helper.append_data(data)
class ScatterOptionsWidget(QtGui.QWidget):

    def __init__(self, viewer_state, session, parent=None):

        super(ScatterOptionsWidget, self).__init__(parent=parent)

        self.ui = load_ui('options_widget.ui', self,
                          directory=os.path.dirname(__file__))

        self.viewer_state = viewer_state
        autoconnect_qt(self.viewer_state, self)

        self.viewer_state.connect('layers', self._update_combo_data)

        self.xatt_helper = ComponentIDComboHelper(self.ui.combo_xatt,
                                                  session.data_collection)
        self.yatt_helper = ComponentIDComboHelper(self.ui.combo_yatt,
                                                  session.data_collection)

    def _update_combo_data(self, *args):
        # TODO: we need to make it possible to set all the data in one go
        #       to avoid this inefficiency which will also cause the current
        #       value to not be selected anymore.
        self.xatt_helper.clear()
        self.yatt_helper.clear()
        for data in self.viewer_state.layers:
            self.xatt_helper.append(data)
            self.yatt_helper.append(data)
Example #3
0
class OptionsWidget(QWidget):

    file_att = CurrentComboDataProperty('ui.combo_file_attribute')

    def __init__(self, parent=None, data_viewer=None):

        super(OptionsWidget, self).__init__(parent=parent)

        self.ui = load_ui('viewer_options.ui', self,
                          directory=os.path.dirname(__file__))

        self.file_helper = ComponentIDComboHelper(self.ui.combo_file_attribute,
                                                  data_viewer._data, categorical=True, numeric=False)

        self._data_viewer = data_viewer

        self._data = None

    def set_data(self, data):
        self.file_helper.clear()

        if isinstance(data, Subset):
            self.file_helper.append_data(data.data)
        else:
            self.file_helper.append_data(data)
        print(self.file_att)