Example #1
0
    def __init__(self, manager):
        ''' See XmlController for documentation '''
        XmlController.__init__(self, manager)

        # Create popup menu actions
        p = ('add', "Create model from template", self._show_dialog_for_template_node)
        self.action_create_model_from_template = self.create_action(*p)
        p = ('estimation', "Run Estimation", self.run_estimation_for_selected)
        self.action_run_estimation = self.create_action(*p)
        p = ('', "Right click the individual groups (specification/<group>) to estimate", lambda: ())
        self.action_show_how_to_estimate_groups = self.create_action(*p)
        p = ('estimation', "Run Estimation Group", self.run_estimation_for_selected_group)
        self.action_run_estimation_group = self.create_action(*p)
        p = ('submodel', "Edit Submodel", self._open_submodel_editor_for_selected)
        self.action_edit_submodel = self.create_action(*p)

        # Create a list of available template nodes
        self.create_from_template_actions = []
        template_nodes = self.project.findall('model_manager/templates/model_template')
        templates = dict((node.get('name'), node) for node in template_nodes)

        for template_name, template_node in templates.items():
            callback = lambda x = template_node: self._show_dialog_for_template_node(x)
            action = self.create_action('clone', template_name, callback)
            self.create_from_template_actions.append(action)

        self.editor = None
    def __init__(self, manager):
        ''' See XmlController for documentation '''
        XmlController.__init__(self, manager)

        # Create popup menu actions
        p = ('add', "Create model from template", self._show_dialog_for_template_node)
        self.action_create_model_from_template = self.create_action(*p)
        p = ('estimation', "Run Estimation", self.run_estimation_for_selected)
        self.action_run_estimation = self.create_action(*p)
        p = ('', "Right click the individual groups (specification/<group>) to estimate", lambda: ())
        self.action_show_how_to_estimate_groups = self.create_action(*p)
        p = ('estimation', "Run Estimation Group", self.run_estimation_for_selected_group)
        self.action_run_estimation_group = self.create_action(*p)
        p = ('submodel', "Edit Submodel", self._open_submodel_editor_for_selected)
        self.action_edit_submodel = self.create_action(*p)
        font = QFont()
        font.setBold(True)
        self.action_edit_submodel.setFont(font)

        # Create a list of available template nodes
        self.create_from_template_actions = []
        template_nodes = self.project.findall('model_manager/templates/model_template')
        templates = dict((node.get('name'), node) for node in template_nodes)

        for template_name, template_node in templates.items():
            callback = lambda x = template_node: self._show_dialog_for_template_node(x)
            action = self.create_action('clone', template_name, callback)
            self.create_from_template_actions.append(action)

        self.editor = None

        self.view.connect(self.view, SIGNAL('doubleClicked(const QModelIndex&)'), self._on_double_click)
    def __init__(self, manager):
        XmlController.__init__(self, manager)

        # Show dialog to execute/config tools
        self.actExecToolFile = self.create_action("execute", "Execute Tool...", self.execToolFile)
        self.actExecToolConfig = self.create_action("execute", "Execute Tool...", self.execToolConfig)

        # Adding tools, groups, sets and configurations
        self.actAddToolFile = self.create_action("add", "Add Tool", self.addToolFile)
        self.actAddToolGroup = self.create_action("add", "Create Tool Group", self.addNewToolGroup)
        self.actAddNewToolSet = self.create_action("add", "Create Tool Set", self.addNewToolSet)
        self.actNewConfig = self.create_action("add", "Add New Tool Configuration", self.newConfig)
        self.actAddParam = self.create_action("add", "Add New Param", self.addParam)
        self.actEditParam = self.create_action("rename", "Edit Param", self.editParam)

        self.actOpenDocumentation = self.create_action(
            "calendar_view_day", "Open Documentation", self.openDocumentation
        )

        self.actChangeClassModule = self.create_action("rename", "Change Module Class Name", self.changeClassModule)
        self.actChangePathToTools = self.create_action("rename", "Change Path to Tools", self.changePathToTools)

        # moving tools up and down
        self.actMoveNodeUp = self.create_action("arrow_up", "Move Up", self.moveNodeUp)
        self.actMoveNodeDown = self.create_action("arrow_down", "Move Down", self.moveNodeDown)
        self.actExecBatch = self.create_action("execute", "Execute Tool Set", self.execBatch)
        self.actExportXMLToFile = self.create_action("export", "Export XML Node To File", self.exportXMLToFile)
        self.actImportXMLFromFile = self.create_action("import", "Import XML Node From File", self.importXMLFromFile)
    def __init__(self, manager):
        ''' See XmlController.__init__ for documentation '''
        XmlController.__init__(self, manager)

        self.actAddModel = self.create_action('make_editable', 'Add Model', self.addModel)
        self.actRunScenario = self.create_action('accept', 'Run This Scenario', self.runScenario)
        self.actMoveNodeUp = self.create_action('arrow_up', "Move Up", self.moveNodeUp)
        self.actMoveNodeDown = self.create_action('arrow_down', "Move Down", self.moveNodeDown)
    def __init__(self, manager):
        ''' See XmlController.__init__ for documentation '''
        XmlController.__init__(self, manager)

        self.actAddModel = self.create_action('make_editable', 'Add Model', self.addModel)
        self.actRunScenario = self.create_action('accept', 'Run This Scenario', self.runScenario)
        self.actMoveNodeUp = self.create_action('arrow_up', "Move Up", self.moveNodeUp)
        self.actMoveNodeDown = self.create_action('arrow_down', "Move Down", self.moveNodeDown)
        self.actExecutable = self.create_action('executable', "Executable", self.toggleExecutable)
        self.actModelsToRun = self.create_action('add', "Add models_to_run node", self.addModelsToRun)
        self.actExecutable.setCheckable(True)
Example #6
0
    def __init__(self, manager):
        ''' See XmlController.__init__ for documentation '''
        XmlController.__init__(self, manager)

        self.actAddModel = self.create_action('make_editable', 'Add Model',
                                              self.addModel)
        self.actRunScenario = self.create_action('accept', 'Run This Scenario',
                                                 self.runScenario)
        self.actMoveNodeUp = self.create_action('arrow_up', "Move Up",
                                                self.moveNodeUp)
        self.actMoveNodeDown = self.create_action('arrow_down', "Move Down",
                                                  self.moveNodeDown)
 def __init__(self, manager):
     XmlController.__init__(self, manager)
     callback = AddIndicatorBatch(callback = self._add_indicator_batch_callback,
                                  parent_widget = self.view).exec_
     p = ('add', "Add new indicator batch...", callback)
     self.actAddNewIndicatorBatch = self.create_action(*p)
     p = ('add', 'Add new indicator visualization...', self._configureNewBatchIndicatorVisualization)
     self.actAddVisualizationToBatch = self.create_action(*p)
     p = ('configure', "Configure visualization", self._configureExistingBatchIndicatorVisualization)
     self.actConfigureExistingBatchIndicatorVis = self.create_action(*p)
     p = ('info_small', "Show details", self._getInfoSimulationRuns)
     self.actGetInfoSimulationRuns = self.create_action(*p)
     p = ('import', "Import run from disk", self._importRun)
     self.actImportRun = self.create_action(*p)
     p = ('delete', "Remove run and delete from hard drive...", self._delete_selected_run)
     self.actDeleteRun = self.create_action(*p)
    def __init__(self, manager):
        XmlController.__init__(self, manager)

        # Show dialog to execute/config tools
        self.actExecToolFile = self.create_action('execute', "Execute Tool...",
                                                  self.execToolFile)
        self.actExecToolConfig = self.create_action('execute',
                                                    "Execute Tool...",
                                                    self.execToolConfig)

        # Adding tools, groups, sets and configurations
        self.actAddToolFile = self.create_action('add', "Add Tool",
                                                 self.addToolFile)
        self.actAddToolGroup = self.create_action('add', "Create Tool Group",
                                                  self.addNewToolGroup)
        self.actAddNewToolSet = self.create_action('add', "Create Tool Set",
                                                   self.addNewToolSet)
        self.actNewConfig = self.create_action('add',
                                               "Add New Tool Configuration",
                                               self.newConfig)
        self.actAddParam = self.create_action('add', "Add New Param",
                                              self.addParam)
        self.actEditParam = self.create_action('rename', "Edit Param",
                                               self.editParam)

        self.actOpenDocumentation = self.create_action('calendar_view_day',
                                                       "Open Documentation",
                                                       self.openDocumentation)

        self.actChangeClassModule = self.create_action(
            'rename', "Change Module Class Name", self.changeClassModule)
        self.actChangePathToTools = self.create_action('rename',
                                                       "Change Path to Tools",
                                                       self.changePathToTools)

        # moving tools up and down
        self.actMoveNodeUp = self.create_action('arrow_up', "Move Up",
                                                self.moveNodeUp)
        self.actMoveNodeDown = self.create_action('arrow_down', "Move Down",
                                                  self.moveNodeDown)
        self.actExecBatch = self.create_action('execute', "Execute Tool Set",
                                               self.execBatch)
        self.actExportXMLToFile = self.create_action(
            'export', "Export XML Node To File", self.exportXMLToFile)
        self.actImportXMLFromFile = self.create_action(
            'import', "Import XML Node From File", self.importXMLFromFile)
Example #9
0
    def __init__(self, manager):
        ''' See XmlController.__init__ for documentation '''
        XmlController.__init__(self, manager)

        self.actAddModel = self.create_action('make_editable', 'Add Model',
                                              self.addModel)
        self.actRunScenario = self.create_action('accept', 'Run This Scenario',
                                                 self.runScenario)
        self.actMoveNodeUp = self.create_action('arrow_up', "Move Up",
                                                self.moveNodeUp)
        self.actMoveNodeDown = self.create_action('arrow_down', "Move Down",
                                                  self.moveNodeDown)
        self.actExecutable = self.create_action('executable', "Executable",
                                                self.toggleExecutable)
        self.actModelsToRun = self.create_action('add',
                                                 "Add models_to_run node",
                                                 self.addModelsToRun)
        self.actExecutable.setCheckable(True)
    def __init__(self, manager):
        XmlController.__init__(self, manager)


# TODO: Adding / removing databases ?

#    def addTree(self):
#        self.model = DatabaseConfigXMLModel(self, self.toolboxbase.doc, self.mainwindow,
#                                   self.toolboxbase.configFile, self.xmlType, True)

#class DatabaseConfigXMLModel(OpusDataModel):
#    def __init__(self, parentTree, document, mainwindow, configFile, xmlType, editable, addIcons=True):
#        OpusDataModel.__init__(self, parentTree, document, mainwindow, configFile, xmlType, editable, addIcons)
#
#    def flags(self, index):
#        default_flags = super(DatabaseConfigXMLModel, self).flags(index)
#        if index.isValid() and self.editable and index.column()==0:
#            return default_flags & ~Qt.ItemIsEditable
#        else: return default_flags
    def __init__(self, manager):
        XmlController.__init__(self, manager)

# TODO: Adding / removing databases ?

#    def addTree(self):
#        self.model = DatabaseConfigXMLModel(self, self.toolboxbase.doc, self.mainwindow,
#                                   self.toolboxbase.configFile, self.xmlType, True)


#class DatabaseConfigXMLModel(OpusDataModel):
#    def __init__(self, parentTree, document, mainwindow, configFile, xmlType, editable, addIcons=True):
#        OpusDataModel.__init__(self, parentTree, document, mainwindow, configFile, xmlType, editable, addIcons)
#
#    def flags(self, index):
#        default_flags = super(DatabaseConfigXMLModel, self).flags(index)
#        if index.isValid() and self.editable and index.column()==0:
#            return default_flags & ~Qt.ItemIsEditable
#        else: return default_flags
 def __init__(self, manager):
     XmlController.__init__(manager)
 def __init__(self, manager):
     XmlController.__init__(manager)