Example #1
0
 def __createTachogramTab__(self, file_specification, object_name):
     tachogramTabWidget = TachogramPlotCompositeWidget(
         self, file_specification=file_specification)
     tachogramTabWidget.setObjectName(object_name)
     self.addTab(tachogramTabWidget, self.getNextTitle(object_name))
     SignalDispatcher.broadcastSignal(TAB_WIDGET_ADDED_SIGNAL)
     return tachogramTabWidget
 def __createTachogramTab__(self, file_specification, object_name):
     tachogramTabWidget = TachogramPlotCompositeWidget(self,
                                 file_specification=file_specification)
     tachogramTabWidget.setObjectName(object_name)
     self.addTab(tachogramTabWidget,
                 self.getNextTitle(object_name))
     SignalDispatcher.broadcastSignal(TAB_WIDGET_ADDED_SIGNAL)
     return tachogramTabWidget
Example #3
0
    def __init__(self, *params):
        super(ApplicationWidget, self).__init__(*params)
        #set up main dispatcher as a QApplication object
        SignalDispatcher.setMainDispatcher(self)

        SignalDispatcher.addSignalSubscriber(self, EXIT_APPLICATION_SIGNAL,
                                             self.quit)

        #set up USE_NUMPY_EQUIVALENT property
        if not Globals.USE_NUMPY_EQUIVALENT == None:
            NUMPY_UTILS = get_object("hra_math.utils.utils")
            if NUMPY_UTILS:
                if hasattr(NUMPY_UTILS, 'USE_NUMPY_EQUIVALENT'):
                    setattr(NUMPY_UTILS, 'USE_NUMPY_EQUIVALENT',
                            Globals.USE_NUMPY_EQUIVALENT)
    def __init__(self, parent, **params):
        super(TachogramPlotSummaryCompositeWidget, self).__init__(parent, **params)
        set_temporary_settings_id(self)
        self.params = Params(**params)

        self.addToolBar(OperationalToolBarWidget(self, excluded_buttons=[CloseToolButton]))
        self.addToolBar(PoincareToolBarWidget(self, reload_button=True))

        self.__central_widget__ = CompositeWidget(self, not_add_widget_to_parent_layout=True)
        layout = QVBoxLayout()
        self.__central_widget__.setLayout(layout)
        self.setCentralWidget(self.__central_widget__)
        self.__file_specifications__ = []
        self.__selected_files_specifications_handler__ = None
        SignalDispatcher.addSignalSubscriber(self, CLOSE_TACHOGRAM_PLOT_SIGNAL, self.__removeFileSpecification__)
Example #5
0
    def __init__(self, *params):
        super(ApplicationWidget, self).__init__(*params)
        #set up main dispatcher as a QApplication object
        SignalDispatcher.setMainDispatcher(self)

        SignalDispatcher.addSignalSubscriber(self,
                                             EXIT_APPLICATION_SIGNAL,
                                             self.quit)

        #set up USE_NUMPY_EQUIVALENT property
        if not Globals.USE_NUMPY_EQUIVALENT == None:
            NUMPY_UTILS = get_object("hra_math.utils.utils")
            if NUMPY_UTILS:
                if hasattr(NUMPY_UTILS, 'USE_NUMPY_EQUIVALENT'):
                    setattr(NUMPY_UTILS, 'USE_NUMPY_EQUIVALENT',
                            Globals.USE_NUMPY_EQUIVALENT)
Example #6
0
    def __init__(self, parent, **params):
        super(TachogramPlotSummaryCompositeWidget,
              self).__init__(parent, **params)
        set_temporary_settings_id(self)
        self.params = Params(**params)

        self.addToolBar(
            OperationalToolBarWidget(self, excluded_buttons=[CloseToolButton]))
        self.addToolBar(PoincareToolBarWidget(self, reload_button=True))

        self.__central_widget__ = CompositeWidget(
            self, not_add_widget_to_parent_layout=True)
        layout = QVBoxLayout()
        self.__central_widget__.setLayout(layout)
        self.setCentralWidget(self.__central_widget__)
        self.__file_specifications__ = []
        self.__selected_files_specifications_handler__ = None
        SignalDispatcher.addSignalSubscriber(self, CLOSE_TACHOGRAM_PLOT_SIGNAL,
                                             self.__removeFileSpecification__)
Example #7
0
    def __init__(self, parent, **params):
        super(ActivityDockWidget, self).__init__(parent,
                                    title=params.get('title', 'Activities'),
                                    **params)
        self.setObjectName("ActivityDockWidget")
        self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea |
                             Qt.TopDockWidgetArea | Qt.BottomDockWidgetArea)
        layout = QVBoxLayout()
        layout.setMargin(0)  # no margin for internal layout
        self.dockComposite = CompositeWidget(self, layout=layout,
                                        not_add_widget_to_parent_layout=True)
        self.listWidget = ListWidgetWidget(self.dockComposite,
                list_item_double_clicked_handler=self.__list_item_handler__,
                selectionMode=QAbstractItemView.MultiSelection,
                sizePolicy=QSizePolicy(QSizePolicy.Expanding,
                                       QSizePolicy.Expanding))
        for activity in ActivityManager.getActivities(PLUGIN_ACTIVITY_TYPE):
            if activity:
                ListWidgetItemWidget(self.listWidget,
                                 text=activity.label,
                                 data=activity)

        self.clearAll = PushButtonWidget(self.dockComposite,
                            i18n="clear.all.activity.button",
                            i18n_def="Clear all activities",
                            clicked_handler=self.__clear_list__)

        self.setWidget(self.dockComposite)
        parent.addDockWidget(Qt.RightDockWidgetArea, self)

        SignalDispatcher.addSignalSubscriber(self,
                                             ADD_ACTIVITY_SIGNAL,
                                             self.__add_activity__)
        SignalDispatcher.addSignalSubscriber(self,
                                             CLEAR_ACTIVITIES_SIGNAL,
                                             self.__clear_list__)
Example #8
0
    def __init__(self, parent, **params):
        super(ActivityDockWidget,
              self).__init__(parent,
                             title=params.get('title', 'Activities'),
                             **params)
        self.setObjectName("ActivityDockWidget")
        self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea
                             | Qt.TopDockWidgetArea | Qt.BottomDockWidgetArea)
        layout = QVBoxLayout()
        layout.setMargin(0)  # no margin for internal layout
        self.dockComposite = CompositeWidget(
            self, layout=layout, not_add_widget_to_parent_layout=True)
        self.listWidget = ListWidgetWidget(
            self.dockComposite,
            list_item_double_clicked_handler=self.__list_item_handler__,
            selectionMode=QAbstractItemView.MultiSelection,
            sizePolicy=QSizePolicy(QSizePolicy.Expanding,
                                   QSizePolicy.Expanding))
        for activity in ActivityManager.getActivities(PLUGIN_ACTIVITY_TYPE):
            if activity:
                ListWidgetItemWidget(self.listWidget,
                                     text=activity.label,
                                     data=activity)

        self.clearAll = PushButtonWidget(self.dockComposite,
                                         i18n="clear.all.activity.button",
                                         i18n_def="Clear all activities",
                                         clicked_handler=self.__clear_list__)

        self.setWidget(self.dockComposite)
        parent.addDockWidget(Qt.RightDockWidgetArea, self)

        SignalDispatcher.addSignalSubscriber(self, ADD_ACTIVITY_SIGNAL,
                                             self.__add_activity__)
        SignalDispatcher.addSignalSubscriber(self, CLEAR_ACTIVITIES_SIGNAL,
                                             self.__clear_list__)
    def __createTachogramPlotManager__(self):
        self.__tachogramsManager__ = TachogramPlotManager(self.__splitter__,
                                                     add_widget_to_parent=True)
        self.__initial_tachogram_plot__ = \
                        self.__tachogramsManager__.createInitialPlot()
        self.__initial_tachogram_plot__.setSelectedFilesSpecificationsHandler(
                            self.__selected_files_specifications_handler__)

        if self.__splitter__.sizesLoaded() == False:
            idx = self.__splitter__.indexOf(self.__tachogramsManager__)
            self.__splitter__.setStretchFactor(idx, 20)
        SignalDispatcher.addSignalSubscriber(self, CLOSE_TACHOGRAM_PLOT_SIGNAL,
                                            self.__closeTachogramPlot__)
        SignalDispatcher.addSignalSubscriber(self, TAB_WIDGET_ADDED_SIGNAL,
                                            self.__tachogramPlotAdded__)
        SignalDispatcher.addSignalSubscriber(self,
                                             MAXIMIZE_TACHOGRAM_PLOT_SIGNAL,
                                             self.__maximizeTachogramPlot__)
        SignalDispatcher.addSignalSubscriber(self,
                                             RESTORE_TACHOGRAM_PLOT_SIGNAL,
                                             self.__restoreTachogramPlot__)
    def __createTachogramPlotManager__(self):
        self.__tachogramsManager__ = TachogramPlotManager(
            self.__splitter__, add_widget_to_parent=True)
        self.__initial_tachogram_plot__ = \
                        self.__tachogramsManager__.createInitialPlot()
        self.__initial_tachogram_plot__.setSelectedFilesSpecificationsHandler(
            self.__selected_files_specifications_handler__)

        if self.__splitter__.sizesLoaded() == False:
            idx = self.__splitter__.indexOf(self.__tachogramsManager__)
            self.__splitter__.setStretchFactor(idx, 20)
        SignalDispatcher.addSignalSubscriber(self, CLOSE_TACHOGRAM_PLOT_SIGNAL,
                                             self.__closeTachogramPlot__)
        SignalDispatcher.addSignalSubscriber(self, TAB_WIDGET_ADDED_SIGNAL,
                                             self.__tachogramPlotAdded__)
        SignalDispatcher.addSignalSubscriber(self,
                                             MAXIMIZE_TACHOGRAM_PLOT_SIGNAL,
                                             self.__maximizeTachogramPlot__)
        SignalDispatcher.addSignalSubscriber(self,
                                             RESTORE_TACHOGRAM_PLOT_SIGNAL,
                                             self.__restoreTachogramPlot__)
 def toolbar_close_handler(self):
     SignalDispatcher.broadcastSignal(CLOSE_TACHOGRAM_PLOT_SIGNAL, self)
 def toolbar_restore_handler(self):
     SignalDispatcher.broadcastSignal(RESTORE_TACHOGRAM_PLOT_SIGNAL)
 def toolbar_maximum_handler(self):
     SignalDispatcher.broadcastSignal(MAXIMIZE_TACHOGRAM_PLOT_SIGNAL)
Example #14
0
 def saveActivity(activity):
     SettingsFactory.saveObject(activity.activity_id, activity)
     SignalDispatcher.broadcastSignal(ADD_ACTIVITY_SIGNAL, activity)
 def toolbar_close_handler(self):
     SignalDispatcher.broadcastSignal(CLOSE_TACHOGRAM_PLOT_SIGNAL, self)
 def toolbar_restore_handler(self):
     SignalDispatcher.broadcastSignal(RESTORE_TACHOGRAM_PLOT_SIGNAL)
 def toolbar_maximum_handler(self):
     SignalDispatcher.broadcastSignal(MAXIMIZE_TACHOGRAM_PLOT_SIGNAL)
Example #18
0
 def __init__(self, parent, **params):
     super(TachogramPlotManager, self).__init__(parent, **params)
     SignalDispatcher.addSignalSubscriber(self, CLOSE_TACHOGRAM_PLOT_SIGNAL,
                                          self.__closeTachogramPlotTab__)
 def __init__(self, parent, **params):
     super(TachogramPlotManager, self).__init__(parent, **params)
     SignalDispatcher.addSignalSubscriber(self,
                                          CLOSE_TACHOGRAM_PLOT_SIGNAL,
                                          self.__closeTachogramPlotTab__)
Example #20
0
def exitApplication(dargs):
    parent = dargs.get('parent', None)
    if AreYouSureWindow(parent, title='Exit application ?'):
        SignalDispatcher.broadcastSignal(EXIT_APPLICATION_SIGNAL)
Example #21
0
def clearActivities(dargs):
    parent = dargs.get('parent', None)
    if AreYouSureWindow(parent, title='Clearing activities'):
        SignalDispatcher.broadcastSignal(CLEAR_ACTIVITIES_SIGNAL)
        InformationWindow(message="Activities cleared !")
Example #22
0
 def saveActivity(activity):
     SettingsFactory.saveObject(activity.activity_id, activity)
     SignalDispatcher.broadcastSignal(ADD_ACTIVITY_SIGNAL, activity)