def __init__(self):
        QtGui.QMainWindow.__init__(self)

        pathcandidates = [os.path.curdir, os.path.join(os.path.pardir, "qt"), os.path.join(imp.find_module("mtb")[1], "qt")]

        self.gui = None
        for path in pathcandidates:
            try:
                uifile = os.path.join(path, "visualize_results.ui")
                self.gui = uic.loadUi(uifile)
                print "loaded "+uifile
                break
            except IOError:
                pass
        if self.gui is None:
            raise IOError("could not find visualize_results.ui")        

        self._vars_selected = False

        self.gui.PlotArea.insertLegend(Qwt.QwtLegend())
        self.connect(self.gui.actionLoad, SIGNAL("activated()"), lambda: self.load_results())
        #self.connect(self.gui.actionSave, SIGNAL("activated()"), lambda: self.load_results())
        self.connect(self.gui.ParameterList, SIGNAL("itemSelectionChanged()"), lambda : self._parameter_activated())
        self.connect(self.gui.ExportButton, SIGNAL("clicked()"), lambda: self.export())

        self.rc = result_comprehension()
        self.gui.show()
Example #2
0
    def setUp(self):
        self.taskstring = ""
        self.task = []
        self.range_spec = (0, 1, 100)
        self.ref_task_json = \
        """
{"class_name": "extraction_test_topblock", "module_name": "mtb", "instruction": "run_fg", "sinks": ["blocks_vector_sink_x_0"], "attributes": {"length": {"value_type": "float64", "param_type": "LIST", "value": [1.0, 10.0, 100.0, 1000.0]}, "value": {"value_type": "float64", "param_type": "LIN_RANGE", "value": [1.0, 10.0, 100.0]}}}
        """
        self.task = bt.task.load(self.ref_task_json)
        self.ra = remote_agent.remote_agent()
        self.tempdir = tempfile.mkdtemp("results")
        tempstore = open(os.path.join(self.tempdir, "result.json"), "w")
        results = self.ra.execute_all(self.task, tempstore)
        tempstore.close()
        self.rc1 = result_comprehension()
        self.rc1.load_directory(self.tempdir)
    def setUp(self):
        self.taskstring = ""
        self.task = []
        self.range_spec = (0,1,100)
        self.ref_task_json = \
        """
{"class_name": "extraction_test_topblock", "module_name": "mtb", "instruction": "run_fg", "sinks": ["blocks_vector_sink_x_0"], "attributes": {"length": {"value_type": "float64", "param_type": "LIST", "value": [1.0, 10.0, 100.0, 1000.0]}, "value": {"value_type": "float64", "param_type": "LIN_RANGE", "value": [1.0, 10.0, 100.0]}}}
        """
        self.task = bt.task.load(self.ref_task_json)
        self.ra = remote_agent.remote_agent()
        self.tempdir = tempfile.mkdtemp("results")
        tempstore = open(os.path.join(self.tempdir, "result.json"), "w")
        results = self.ra.execute_all(self.task, tempstore)
        tempstore.close()
        self.rc1 = result_comprehension()
        self.rc1.load_directory(self.tempdir)