Beispiel #1
0
 def testCreation(self):
     layout = WidgetUtils.addLayout()
     WidgetUtils.addLineEdit(layout, None, self.callback)
     WidgetUtils.addProgressBar(layout, None, callback=self.callback)
     WidgetUtils.addButton(layout, None, "Button", self.callback)
     WidgetUtils.addLabel(layout, None, "Name")
     WidgetUtils.addCheckbox(layout, None, "name", self.callback)
 def testCreation(self):
     layout = WidgetUtils.addLayout()
     WidgetUtils.addLineEdit(layout, None, self.callback)
     WidgetUtils.addProgressBar(layout, None, callback=self.callback)
     WidgetUtils.addButton(layout, None, "Button", self.callback)
     WidgetUtils.addLabel(layout, None, "Name")
     WidgetUtils.addCheckbox(layout, None, "name", self.callback)
Beispiel #3
0
    def __init__(self):
        super(ExecuteRunnerPlugin, self).__init__()
        self.top_layout = WidgetUtils.addLayout(vertical=True)

        self.run_layout = WidgetUtils.addLayout()
        self.run_layout.addStretch()

        self.run_button = WidgetUtils.addButton(self.run_layout,
                                                None,
                                                "Run",
                                                self.runClicked,
                                                enabled=False)
        self.kill_button = WidgetUtils.addButton(self.run_layout,
                                                 None,
                                                 "Kill",
                                                 self.killClicked,
                                                 enabled=False)
        self.clear_button = WidgetUtils.addButton(self.run_layout,
                                                  None,
                                                  "Clear log",
                                                  self.clearLog,
                                                  enabled=True)
        self.save_button = WidgetUtils.addButton(self.run_layout,
                                                 None,
                                                 "Save log",
                                                 self.saveLog,
                                                 enabled=True)

        self.run_layout.addStretch()

        self.progress_layout = WidgetUtils.addLayout()
        self.progress_label = WidgetUtils.addLabel(self.progress_layout, None,
                                                   "Progress: ")
        self.progress_bar = WidgetUtils.addProgressBar(self.progress_layout,
                                                       None)
        self._showProgressBar(False)

        self.setLayout(self.top_layout)
        self.top_layout.addLayout(self.run_layout)
        self.top_layout.addLayout(self.progress_layout)

        self.runner = JobRunner()

        self._total_steps = 0
        self.runner.finished.connect(self.runFinished)
        self.runner.outputAdded.connect(self.outputAdded)
        self.runner.timeStepUpdated.connect(
            lambda t: self.runProgress.emit(t, self._total_steps))
        self.runner.started.connect(
            lambda: self.runProgress.emit(0, self._total_steps))
        self.runner.timeStepUpdated.connect(self._updateProgressBar)
        self.exe_path = None
        self.exe_args = []
        self.has_csv = False

        self.setup()
    def __init__(self):
        super(ExecuteRunnerPlugin, self).__init__()

        self._preferences.addBool("execute/clearLog",
                "Clear log before running",
                False,
                "Clear the output from previous runs before starting a new run",
                )

        self.top_layout = WidgetUtils.addLayout(vertical=True)

        self.run_layout = WidgetUtils.addLayout()
        self.run_layout.addStretch()

        self.run_button = WidgetUtils.addButton(self.run_layout, None, "Run", self.runClicked, enabled=False)
        self.kill_button = WidgetUtils.addButton(self.run_layout, None, "Kill", self.killClicked, enabled=False)
        self.clear_button = WidgetUtils.addButton(self.run_layout, None, "Clear log", self.clearLog, enabled=True)
        self.save_button = WidgetUtils.addButton(self.run_layout, None, "Save log", self.saveLog, enabled=True)

        self.run_layout.addStretch()

        self.progress_layout = WidgetUtils.addLayout()
        self.progress_label = WidgetUtils.addLabel(self.progress_layout, None, "Progress: ")
        self.progress_bar = WidgetUtils.addProgressBar(self.progress_layout, None)
        self._showProgressBar(False)

        self.setLayout(self.top_layout)
        self.top_layout.addLayout(self.run_layout)
        self.top_layout.addLayout(self.progress_layout)

        self.runner = JobRunner()

        self._total_steps = 0
        self.runner.finished.connect(self.runFinished)
        self.runner.outputAdded.connect(self.outputAdded)
        self.runner.timeStepUpdated.connect(lambda t: self.runProgress.emit(t, self._total_steps))
        self.runner.started.connect(lambda : self.runProgress.emit(0, self._total_steps))
        self.runner.timeStepUpdated.connect(self._updateProgressBar)
        self.exe_path = None
        self.exe_args = []
        self.has_csv = False
        self._input_file = ""

        self.setup()