Ejemplo n.º 1
0
 def __init__(self, options=None, name='Empty MS Creator'):
     super(EmptyMSCreator, self).__init__(options, name)
     self._tmp_dir = get_dictionary_value(options, 'tmp_dir',
                                          get_temp_dir())
     self._taxonomy = get_dictionary_value(options, 'taxonomy',
                                           get_taxonomy('GEM'))
     self._parse_modifiers = get_dictionary_value(options,
                                                  'parse_modifiers', True)
     self._parse_order = get_dictionary_value(options, 'attribute.order',
                                              None)
Ejemplo n.º 2
0
    def __init__(self, app_config, taxonomy):
        """ constructor """
        self.temp_dir = get_temp_dir('tmp%s'%get_random_name())
        self.app_config = app_config
        self.operator_options = {
            'tmp_dir': self.temp_dir,
            'taxonomy':taxonomy,    
            'parse_modifiers':app_config.get('options', 'parse_modifier', True, bool),        
        }
        self.reset()

        self.project_file = None
        self.db = None
        self.require_save = False
Ejemplo n.º 3
0
    def __init__(self, app_config, taxonomy):
        """ constructor """
        self.temp_dir = get_temp_dir('tmp%s' % get_random_name())
        self.app_config = app_config
        self.operator_options = {
            'tmp_dir':
            self.temp_dir,
            'taxonomy':
            taxonomy,
            'parse_modifiers':
            app_config.get('options', 'parse_modifier', True, bool),
        }
        self.reset()

        self.project_file = None
        self.db = None
        self.require_save = False
Ejemplo n.º 4
0
    def __init__(self, qtapp, app_config):
        """
        constructor
        - initialize UI elements
        - connect UI elements to callback            
        """
        # create UI
        super(AppMainWindow, self).__init__()
        AppMainWindow.apiCallChecker.setWindow(self)
        
        self.qtapp = qtapp
        self.app_config = app_config
        self.taxonomy = get_taxonomy(app_config.get('options', 'taxonomy', 'gem'))
        self.ui = Ui_mainWindow()
        self.ui.setupUi(self)
        
        self.settings = QSettings(SIDD_COMPANY, '%s %s' %(SIDD_APP_NAME, SIDD_VERSION));
        self.restoreGeometry(self.settings.value(self.UI_WINDOW_GEOM).toByteArray());
        self.restoreState(self.settings.value(self.UI_WINDOW_STATE).toByteArray());
        
        self.lb_map_location = QLabel(self)
        self.lb_map_location.resize(self.ui.statusbar.width()/3, self.ui.statusbar.height())
        self.ui.statusbar.addPermanentWidget(self.lb_map_location)
        
        self.msdb_dao = MSDatabaseDAO(FILE_MS_DB)
        
        self.tab_datainput = WidgetDataInput(self)
        self.ui.mainTabs.addTab(self.tab_datainput, get_ui_string("app.window.tab.input"))

        self.tab_ms = WidgetMappingSchemes(self)
        self.ui.mainTabs.addTab(self.tab_ms, get_ui_string("app.window.tab.ms"))

        self.tab_mod = WidgetSecondaryModifier(self)
        self.ui.mainTabs.addTab(self.tab_mod, get_ui_string("app.window.tab.mod"))

        self.tab_result = WidgetResult(self)
        self.ui.mainTabs.addTab(self.tab_result, get_ui_string("app.window.tab.result"))
        self.previewInput = True
        
        self.about = DialogAbout(self)
        self.about.setModal(True)        
        
        self.dlgAttrRange = DialogAttrRanges()
        self.dlgAttrRange.setModal(True)
        
        self.progress = DialogApply(self)
        self.progress.setModal(True)
        
        self.proc_options = DialogProcessingOptions(self)
        self.proc_options.setModal(True)
        
        # connect menu action to slots (ui events)        
        self.ui.mainTabs.currentChanged.connect(self.tabChanged)
        
        self.ui.actionProject_Blank.triggered.connect(self.createBlank)
        self.ui.actionUsing_Data_Wizard.triggered.connect(self.createWizard)
        self.ui.actionOpen_Existing.triggered.connect(self.loadProj)
        self.ui.actionSave.triggered.connect(self.saveProj)
        self.ui.actionSave_as.triggered.connect(self.saveProjAs)
        self.ui.actionExit.triggered.connect(self.close)
        
        self.ui.actionData_Input.triggered.connect(self.changeTab)
        self.ui.actionMapping_Schemes.triggered.connect(self.changeTab)
        self.ui.actionResult.triggered.connect(self.changeTab)
        
        self.ui.actionProcessing_Options.triggered.connect(self.setProcessingOptions)
        
        self.ui.actionAbout.triggered.connect(self.showAbout)
        
        # set project to None and adjust ui as needed
        self.closeProject()        
        self.ui.statusbar.showMessage(get_ui_string("app.status.ready"))

        # perform clean up from previous runs
        try:
            delete_folders_in_dir(get_temp_dir(), "tmp*")
        except:
            # cleanup is not-critical. no action taken even if fails
            pass

        # hide features 
        if not app_config.get('options', 'parse_modifier', True, bool):
            self.tab_mod.setVisible(False)
            self.ui.mainTabs.removeTab(self.TAB_MOD) 
            self.TAB_MOD = self.TAB_MS
            self.TAB_RESULT -= 1             
            
        # hide view menu
        self.ui.menuView.menuAction().setVisible(False)
        # hide data wizard
        self.ui.actionUsing_Data_Wizard.setVisible(False)
Ejemplo n.º 5
0
    def __init__(self, qtapp, app_config):
        """
        constructor
        - initialize UI elements
        - connect UI elements to callback            
        """
        # create UI
        super(AppMainWindow, self).__init__()
        AppMainWindow.apiCallChecker.setWindow(self)

        self.qtapp = qtapp
        self.app_config = app_config
        self.taxonomy = get_taxonomy(
            app_config.get('options', 'taxonomy', 'gem'))
        self.ui = Ui_mainWindow()
        self.ui.setupUi(self)

        self.settings = QSettings(SIDD_COMPANY,
                                  '%s %s' % (SIDD_APP_NAME, SIDD_VERSION))
        self.restoreGeometry(
            self.settings.value(self.UI_WINDOW_GEOM).toByteArray())
        self.restoreState(
            self.settings.value(self.UI_WINDOW_STATE).toByteArray())

        self.lb_map_location = QLabel(self)
        self.lb_map_location.resize(self.ui.statusbar.width() / 3,
                                    self.ui.statusbar.height())
        self.ui.statusbar.addPermanentWidget(self.lb_map_location)

        self.msdb_dao = MSDatabaseDAO(FILE_MS_DB)

        self.tab_datainput = WidgetDataInput(self)
        self.ui.mainTabs.addTab(self.tab_datainput,
                                get_ui_string("app.window.tab.input"))

        self.tab_ms = WidgetMappingSchemes(self)
        self.ui.mainTabs.addTab(self.tab_ms,
                                get_ui_string("app.window.tab.ms"))

        self.tab_mod = WidgetSecondaryModifier(self)
        self.ui.mainTabs.addTab(self.tab_mod,
                                get_ui_string("app.window.tab.mod"))

        self.tab_result = WidgetResult(self)
        self.ui.mainTabs.addTab(self.tab_result,
                                get_ui_string("app.window.tab.result"))
        self.previewInput = True

        self.about = DialogAbout(self)
        self.about.setModal(True)

        self.dlgAttrRange = DialogAttrRanges()
        self.dlgAttrRange.setModal(True)

        self.progress = DialogApply(self)
        self.progress.setModal(True)

        self.proc_options = DialogProcessingOptions(self)
        self.proc_options.setModal(True)

        # connect menu action to slots (ui events)
        self.ui.mainTabs.currentChanged.connect(self.tabChanged)

        self.ui.actionProject_Blank.triggered.connect(self.createBlank)
        self.ui.actionUsing_Data_Wizard.triggered.connect(self.createWizard)
        self.ui.actionOpen_Existing.triggered.connect(self.loadProj)
        self.ui.actionSave.triggered.connect(self.saveProj)
        self.ui.actionSave_as.triggered.connect(self.saveProjAs)
        self.ui.actionExit.triggered.connect(self.close)

        self.ui.actionData_Input.triggered.connect(self.changeTab)
        self.ui.actionMapping_Schemes.triggered.connect(self.changeTab)
        self.ui.actionResult.triggered.connect(self.changeTab)

        self.ui.actionProcessing_Options.triggered.connect(
            self.setProcessingOptions)

        self.ui.actionAbout.triggered.connect(self.showAbout)

        # set project to None and adjust ui as needed
        self.closeProject()
        self.ui.statusbar.showMessage(get_ui_string("app.status.ready"))

        # perform clean up from previous runs
        try:
            delete_folders_in_dir(get_temp_dir(), "tmp*")
        except:
            # cleanup is not-critical. no action taken even if fails
            pass

        # hide features
        if not app_config.get('options', 'parse_modifier', True, bool):
            self.tab_mod.setVisible(False)
            self.ui.mainTabs.removeTab(self.TAB_MOD)
            self.TAB_MOD = self.TAB_MS
            self.TAB_RESULT -= 1

        # hide view menu
        self.ui.menuView.menuAction().setVisible(False)
        # hide data wizard
        self.ui.actionUsing_Data_Wizard.setVisible(False)
Ejemplo n.º 6
0
 def __init__(self, options=None, name='Empty MS Creator'):
     super(EmptyMSCreator, self).__init__(options, name)
     self._tmp_dir = get_dictionary_value(options, 'tmp_dir', get_temp_dir())
     self._taxonomy = get_dictionary_value(options, 'taxonomy', get_taxonomy('GEM'))  
     self._parse_modifiers = get_dictionary_value(options, 'parse_modifiers', True)
     self._parse_order = get_dictionary_value(options, 'attribute.order', None)