def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Miscellaneous') super(MiscellaneousWidget, self).__init__(parent, **params) LabelWidget(self, i18n_def='Data window shift: 1') self.params = Params(**params) self.params.data_accessor.addListener(self, __MiscellaneousVectorListener__(self)) self.__window_size__ = __DataWindowSizeWidget__(self, self.params.data_accessor) self.__unitsWidget__ = TimeUnitsWidget(self, i18n_def='Units', default_unit=self.params.data_accessor.signal_x_unit, change_unit_handler=self.changeUnit, layout=QHBoxLayout()) self.__unitsWidget__.addUnit(OrderUnit) self.__use_parameters__ = CompositeWidget(self, layout=QHBoxLayout()) self.__use_buffer__ = CheckBoxWidget(self.__use_parameters__, i18n_def='Use buffer', checked=True) self.__use_identity_line__ = CheckBoxWidget(self.__use_parameters__, i18n_def='Use identity line', checked=True) self.__sample_step__ = __SampleStepWidget__(self, self.params.data_accessor) self.__stepper_size__ = __StepperSizeWidget__(self, self.params.data_accessor)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) super(FiltersWidget, self).__init__(parent, **params) self.params = Params(**params) self.data_accessor = self.params.data_accessor # alias #if self.params.use_apply_button == True: if 1 == 1: self.data_accessor.addListener(self, __FilterActivatedDataVectorListener__(self)) filtersGroup = GroupBoxWidget(self, layout=QVBoxLayout(), i18n_def=params.get('title', 'Filters')) annotation_widget_class = params.get('annotation_widget_class', False) if annotation_widget_class: self.__annotation_filter__ = annotation_widget_class( filtersGroup, data_accessor=self.data_accessor) else: self.__annotation_filter__ = CommonAnnotationFilterWidget( filtersGroup, data_accessor=self.data_accessor) self.__square_filter__ = SquareFilterWidget(filtersGroup, data_accessor=self.data_accessor, use_apply_button=self.params.use_apply_button) if params.get('restore_button', False): self.__restore_button__ = PushButtonWidget(filtersGroup, i18n_def='Back to unfiltered data', clicked_handler=self.__restore_handler__, enabled=False)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Miscellaneous') super(MiscellaneousWidget, self).__init__(parent, **params) LabelWidget(self, i18n_def='Data window shift: 1') self.params = Params(**params) self.params.data_accessor.addListener( self, __MiscellaneousVectorListener__(self)) self.__window_size__ = __DataWindowSizeWidget__( self, self.params.data_accessor) self.__unitsWidget__ = TimeUnitsWidget( self, i18n_def='Units', default_unit=self.params.data_accessor.signal_x_unit, change_unit_handler=self.changeUnit, layout=QHBoxLayout()) self.__unitsWidget__.addUnit(OrderUnit) self.__use_parameters__ = CompositeWidget(self, layout=QHBoxLayout()) self.__use_buffer__ = CheckBoxWidget(self.__use_parameters__, i18n_def='Use buffer', checked=True) self.__use_identity_line__ = CheckBoxWidget( self.__use_parameters__, i18n_def='Use identity line', checked=True) self.__sample_step__ = __SampleStepWidget__(self, self.params.data_accessor) self.__stepper_size__ = __StepperSizeWidget__( self, self.params.data_accessor)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Statistics') super(StatisticsWidget, self).__init__(parent, **params) self.params = Params(**params) self.data_accessors = [] self.main_data_accessor = None if not self.params.data_vectors_accessor_group == None: self.data_accessors = self.params.data_vectors_accessor_group.data_vectors_accessors # @IgnorePep8 self.main_data_accessor = self.params.data_vectors_accessor_group.group_data_vector_accessor # @IgnorePep8 elif not self.params.data_accessor == None: self.main_data_accessor = self.params.data_accessor self.data_accessors = [self.main_data_accessor] for data_accessor in self.data_accessors: data_accessor.addListener(self, __StatisticsVectorListener__(self)) self.__createButtons__() self.__statistics_widget__ = StatisticsSelectionWidget( self, layout=QVBoxLayout(), i18n_def='', check_handler=self.__change_statistics_handler__) self.__summary_statistics_widget__ = SummaryStatisticsSelectionWidget( self, layout=QVBoxLayout(), i18n_def='Summary statistics', check_handler=self.__change_statistics_handler__)
def __init__(self, parent, **params): get_or_put(params, 'layout', QHBoxLayout()) self.params = Params(**params) self.data_accessor = self.params.data_accessor # alias i18n_def = "Square filter " + self.data_accessor.signal_unit.display_label # @IgnorePep8 super(SquareFilterWidget, self).__init__(parent, i18n_def=i18n_def, **params) self.__filter__ = SquareFilter() LabelWidget(self, i18n_def="Min value") self.__min_value__ = NumberEditWidget( self, text_changed_handler=self.__min_handler__) LabelWidget(self, i18n_def="Max value") self.__max_value__ = NumberEditWidget( self, text_changed_handler=self.__max_handler__) if self.params.use_apply_button: self.__action_button__ = PushButtonWidget( self, i18n_def='Apply', clicked_handler=self.__filter_handler__) else: self.__action_button__ = CheckBoxWidget( self, i18n_def='Use filter', clicked_handler=self.__use_handler__) self.data_accessor.addListener( self, __SquareFilterDataVectorListener__(self)) self.__action_button__.setChecked(False) self.reset()
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Statistics') super(StatisticsWidget, self).__init__(parent, **params) self.params = Params(**params) self.data_accessors = [] self.main_data_accessor = None if not self.params.data_vectors_accessor_group == None: self.data_accessors = self.params.data_vectors_accessor_group.data_vectors_accessors # @IgnorePep8 self.main_data_accessor = self.params.data_vectors_accessor_group.group_data_vector_accessor # @IgnorePep8 elif not self.params.data_accessor == None: self.main_data_accessor = self.params.data_accessor self.data_accessors = [self.main_data_accessor] for data_accessor in self.data_accessors: data_accessor.addListener(self, __StatisticsVectorListener__(self)) self.__createButtons__() self.__statistics_widget__ = StatisticsSelectionWidget(self, layout=QVBoxLayout(), i18n_def='', check_handler=self.__change_statistics_handler__) self.__summary_statistics_widget__ = SummaryStatisticsSelectionWidget( self, layout=QVBoxLayout(), i18n_def='Summary statistics', check_handler=self.__change_statistics_handler__)
def __init__(self, parent, **params): get_or_put(params, 'layout', QHBoxLayout()) self.params = Params(**params) self.data_accessor = self.params.data_accessor # alias i18n_def = "Square filter " + self.data_accessor.signal_unit.display_label # @IgnorePep8 super(SquareFilterWidget, self).__init__(parent, i18n_def=i18n_def, **params) self.__filter__ = SquareFilter() LabelWidget(self, i18n_def="Min value") self.__min_value__ = NumberEditWidget(self, text_changed_handler=self.__min_handler__) LabelWidget(self, i18n_def="Max value") self.__max_value__ = NumberEditWidget(self, text_changed_handler=self.__max_handler__) if self.params.use_apply_button: self.__action_button__ = PushButtonWidget(self, i18n_def='Apply', clicked_handler=self.__filter_handler__) else: self.__action_button__ = CheckBoxWidget(self, i18n_def='Use filter', clicked_handler=self.__use_handler__) self.data_accessor.addListener(self, __SquareFilterDataVectorListener__(self)) self.__action_button__.setChecked(False) self.reset()
def __init__(self, parent, **params): get_or_put(params, 'layout', QHBoxLayout()) super(CommonAnnotationFilterWidget, self).__init__(parent, **params) self.params = Params(**params) self.data_accessor = self.params.data_accessor # alias self.__filter__ = AnnotationFilter() self.__createAnnotationButtons__() self.createActionButton() self.__activateActionButton__(False)
def __init__(self, parent, **params): get_or_put(params, "layout", QVBoxLayout()) get_or_put(params, "i18n_def", "Selected poincare plot datasources") super(PoincarePlotDatasourcesTableWidget, self).__init__(parent, **params) self.params = Params(**params) self.__createTable__() self.__createModel__()
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Selected poincare plot datasources') super(PoincarePlotDatasourcesTableWidget, self).__init__(parent, **params) self.params = Params(**params) self.__createTable__() self.__createModel__()
def __init__(self, parent, **params): get_or_put(params, 'i18n_def', 'Separator') self.params = Params(**params) self.separatorsGroupBox = GroupBoxWidget(parent, i18n="separator.widget.group.title", i18n_def=nvl(self.params.i18n_def, "Separator"), layout=QVBoxLayout()) self.predefinedSeparatorsComposite = CompositeWidget( self.separatorsGroupBox, layout=QHBoxLayout()) self.predefinedSeparatorsButtonsGroup = ButtonGroupWidget( self.predefinedSeparatorsComposite) self.predefinedSeparatorsSpecs = Separator.getSeparatorsSpec( separator_label_handler) for separatorSpec in self.predefinedSeparatorsSpecs: label = separatorSpec.label if not label == Separator.CUSTOM.label: # @UndefinedVariable predefinedSeparatorCheckBox = CheckBoxWidget( self.predefinedSeparatorsComposite) #attach artificially a separatorSpec object used later in #def setSeparator(self, _separator) method predefinedSeparatorCheckBox.separator_spec = separatorSpec predefinedSeparatorCheckBox.setText(label) predefinedSeparatorCheckBox.sep_spec = separatorSpec if self.params.default_separator and \ separatorSpec.id_ == self.params.default_separator.id_: predefinedSeparatorCheckBox.setChecked(True) self.predefinedSeparatorsButtonsGroup.addButton( predefinedSeparatorCheckBox) self.separatorsGroupBox.connect(self.predefinedSeparatorsButtonsGroup, SIGNAL("buttonClicked(QAbstractButton *)"), self.predefinedSeparatorButtonClicked) if not self.params.no_custom_separator == True: self.customSeparatorCheckBox = CheckBoxWidget( self.predefinedSeparatorsComposite, i18n="separator.custom.checkbox", i18n_def="Custom") self.customSeparatorCheckBox.sep_spec = Separator.CUSTOM self.separatorsGroupBox.connect(self.customSeparatorCheckBox, SIGNAL("clicked()"), self.customSeparatorButtonClicked) self.customSeparatorEdit = LineEditWidget( self.predefinedSeparatorsComposite, maxLength=15, width=get_width_of_n_letters(14), text_changed_handler=self.customSeparatorButtonClicked, enabled=False) self.setEnabled(self.params.enabled)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Files') super(FilesTrackerWidget, self).__init__(parent, **params) self.params = Params(**params) self.__create_oper_buttons__() self.__createTable__() self.__createModel__() self.__create_misc_buttons__()
def __init__(self, parent, **params): layout = QHBoxLayout() layout.setAlignment(Qt.AlignLeft) get_or_put(params, "layout", layout) super(DirWidget, self).__init__(parent, **params) LabelWidget(self, i18n_def="Directory:") self.__dir_label__ = LabelWidget( self, i18n_def=__NOT_SET_LABEL__, sizePolicy=QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Minimum) ) PushButtonWidget(self, i18n_def="Browse", clicked_handler=self.__clicked_handler__)
def __init__(self, parent, **params): get_or_put(params, 'orientation', Qt.Horizontal) self.params = Params(**params) QSplitter.__init__(self, self.params.orientation, parent=parent) prepareWidget(parent=parent, widget=self, **params) self.setHandleWidth(self.handleWidth() * 2) if self.params.save_state: SettingsFactory.loadSettings( self, Setter(sizes_list=None, _conv=QVariant.toPyObject, _conv_2level=self.conv2level, objectName=self.params.objectName))
def __init__(self, parent, **params): get_or_put(params, 'orientation', Qt.Horizontal) self.params = Params(**params) QSplitter.__init__(self, self.params.orientation, parent=parent) prepareWidget(parent=parent, widget=self, **params) self.setHandleWidth(self.handleWidth() * 2) if self.params.save_state: SettingsFactory.loadSettings(self, Setter(sizes_list=None, _conv=QVariant.toPyObject, _conv_2level=self.conv2level, objectName=self.params.objectName ))
def __init__(self, parent, **params): layout = QHBoxLayout() layout.setAlignment(Qt.AlignLeft) get_or_put(params, 'layout', layout) super(DirWidget, self).__init__(parent, **params) LabelWidget(self, i18n_def='Directory:') self.__dir_label__ = LabelWidget(self, i18n_def=__NOT_SET_LABEL__, sizePolicy=QSizePolicy( QSizePolicy.MinimumExpanding, QSizePolicy.Minimum)) PushButtonWidget(self, i18n_def="Browse", clicked_handler=self.__clicked_handler__)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Statistics') super(StatisticsSelectionWidget, self).__init__(parent, **params) self.params = Params(**params) if self.params.statistics_base_classes == None: self.params.statistics_base_classes = [Asymmetry] if self.params.data_accessor: self.params.data_accessor.addListener(self, __StatisticsSelectionVectorListener__(self)) self.__createButtons__() self.__createTable__() self.__createModel__() self.__fillStatistics__(self.params.statistics_base_classes)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Statistics') super(StatisticsSelectionWidget, self).__init__(parent, **params) self.params = Params(**params) if self.params.statistics_base_classes == None: self.params.statistics_base_classes = [Asymmetry] if self.params.data_accessor: self.params.data_accessor.addListener( self, __StatisticsSelectionVectorListener__(self)) self.__createButtons__() self.__createTable__() self.__createModel__() self.__fillStatistics__(self.params.statistics_base_classes)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Output specification') super(OutputSpecificationWidget, self).__init__(parent, **params) self.params = Params(**params) if self.params.data_accessor: self.params.data_accessor.addListener(self, __OutputSpecificationDataVectorListener__(self)) self.__output_dir__ = DirWidget(self) precision = self.__get_output_precision__() self.__precision__ = DecimalPrecisionWidget(self, precision=precision[0], scale=precision[1]) self.__separator__ = SeparatorWidget(self, i18n_def='Output separator', no_custom_separator=params.get('no_custom_separator', None), default_separator=Separator.WHITE_SPACE) self.__override_existing__ = CheckBoxWidget(self, i18n_def='Override existing outcomes', checked=False)
def __init__(self, parent, **params): get_or_put(params, 'i18n', 'time.units.group.title') get_or_put(params, 'i18n_def', 'Time units') get_or_put(params, 'layout', QHBoxLayout()) self.default_unit = params.get('default_unit', Millisecond) super(TimeUnitsWidget, self).__init__(parent, **params) self.__unitsButtonsGroup__ = ButtonGroupWidget(self) self.__change_unit_handler__ = params.get('change_unit_handler', None) for time_unit in get_units_for_type(TimeUnit): unitCheckBox = CheckBoxWidget(self, i18n_def="%s [%s]" % (time_unit.name, time_unit.label)) #add artificially property unit for later use in getUnit method unitCheckBox.unit = time_unit if time_unit == self.default_unit: unitCheckBox.setChecked(True) self.__unitsButtonsGroup__.addButton(unitCheckBox) self.connect(self.__unitsButtonsGroup__, SIGNAL("buttonClicked(QAbstractButton *)"), self.__buttonClicked__) self.__old_button_unit__ = None
def __init__(self, parent, **params): layout = QVBoxLayout() layout.setAlignment(Qt.AlignCenter) get_or_put(params, 'layout', layout) super(ChooseColorWidget, self).__init__(parent, **params) get_or_put(params, 'title', 'Color changer') get_or_put(params, 'default_color', Qt.black) self.params = Params(**params) LabelWidget(self, i18n_def=self.params.title) PushButtonWidget(self, i18n_def="Change color", clicked_handler=self.__change_color_handler__) self.__color_area__ = __FrameWidget__(self) PushButtonWidget(self, i18n_def="Restore default", clicked_handler=self.__restore_default_handler__) self.setcolor(self.params.default_color)
def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) get_or_put(params, 'i18n_def', 'Summary statistics') get_or_put(params, 'statistics_base_classes', [Asymmetry]) super(SummaryStatisticsSelectionWidget, self).__init__(parent, **params)