Exemple #1
0
    def __init__(self, parent, options):
        super(SimulationResultsTab, self).__init__(parent)

        self.__results = None
        """:type: SimulationSetsPayload"""

        self.__control_layout = QtGui.QHBoxLayout()

        self.__metric_label = QtGui.QLabel("Metric: ", self)
        self.__metric_combobox = QtGui.QComboBox(self)
        self.__metric_combobox.setMaximumWidth(300)
        connect(self.__metric_combobox.currentIndexChanged, self.__onItemChanged)
        self.__button_exchange = QtGui.QPushButton("Exchange", self)
        self.__button_exchange.setEnabled(False)
        connect(self.__button_exchange.clicked, self.__onButtonExchangeClicked)
        self.__button_export = QtGui.QPushButton("Clipboard", self)
        connect(self.__button_export.clicked, self.__onButtonExportClicked)

        self.__sequence = [0, 1]

        self.__control_layout.addWidget(self.__metric_label)
        self.__control_layout.addWidget(self.__metric_combobox)
        self.__control_layout.addSpacing(10)
        self.__control_layout.addWidget(self.__button_exchange)
        self.__control_layout.addWidget(self.__button_export)
        self.__control_layout.setAlignment(QtCore.Qt.AlignLeft)

        self.__graph = SimulationSetsGraph(self, options)
        self.__toolbar = NavigationToolbar(self.__graph, self)

        self.__control_layout.addWidget(self.__toolbar)

        self.__layout = QtGui.QVBoxLayout(self)
        self.__layout.addLayout(self.__control_layout)
        self.__layout.addWidget(self.__graph)
Exemple #2
0
    def __init__(self, parent, appdb):
        """
        Initializer of ResistDevelopmentTab class

        :type parent: QtGui.QWidget
        :type appdb: ApplicationDatabase
        """
        AbstractResistTab.__init__(self, parent)

        self.__appdb = appdb
        self.__resist = None
        """:type: options.structures.Resist"""

        # -- Header --

        self.__dev_name_combobox = QtGui.QComboBox(self)
        self.__dev_name_combobox.setFixedWidth(300)
        connect(self.__dev_name_combobox.currentIndexChanged,
                self.__onIndexChanged)

        self.__save_button = QtGui.QPushButton("Save Developer")
        self.__save_button.setFixedWidth(120)
        self.__save_button.setEnabled(False)
        connect(self.__save_button.clicked, self._save_developer)

        self.__save_button_as = QtGui.QPushButton("Save Developer As...")
        self.__save_button_as.setFixedWidth(120)
        self.__save_button_as.setEnabled(False)
        connect(self.__save_button_as.clicked, self._save_developer_as)

        self.__header_layout = QtGui.QHBoxLayout()
        self.__header_layout.addWidget(self.__dev_name_combobox)
        self.__header_layout.addStretch()
        self.__header_layout.addWidget(self.__save_button)
        self.__header_layout.addWidget(self.__save_button_as)

        # -- Body --

        self.__parameters_widgets = QtGui.QStackedWidget(self)
        self.__views = {
            orm.DeveloperSheet:
            ResistDevelopmentTab.DevRateSheetView(self),
            orm.DeveloperExpr:
            ResistDevelopmentTab.DevRateExprView(self, self.__appdb),
            None:
            ResistDevelopmentTab.DevRateNone(self)
        }
        for widget in self.__views.values():
            self.__parameters_widgets.addWidget(widget)

        # -- Tab --

        self.__vlayout = QtGui.QVBoxLayout(self)
        self.__vlayout.addLayout(self.__header_layout)
        self.__vlayout.addWidget(self.__parameters_widgets)
        self.__vlayout.addStretch()
Exemple #3
0
    def __init__(self, parent, simulation):
        """
        :param QtGui.QWidget parent: Diffraction pattern view widget parent
        :param core.Core simulation: Simulation Core
        """
        super(DiffractionPatternView, self).__init__(parent)
        self.__simulation = simulation

        self.__type_label = QtGui.QLabel("Display:", self)
        self.__type_combo = QtGui.QComboBox(self)
        for type_index in sorted(DiffractionPatternGraph.type_map):
            self.__type_combo.addItem(
                DiffractionPatternGraph.type_map[type_index])
        self.__show_zero_chkbox = QtGui.QCheckBox("Draw (0, 0) order term",
                                                  self)
        self.__show_zero_chkbox.setChecked(True)
        self.__kx_spinbox = QtGui.QSpinBox(self)
        self.__kx_spinbox.setFixedWidth(80)
        self.__ky_spinbox = QtGui.QSpinBox(self)
        self.__ky_spinbox.setFixedWidth(80)

        self.__graph = DiffractionPatternGraph(self, simulation.options)

        self.__options_layout = QtGui.QVBoxLayout()
        self.__options_layout.addWidget(self.__type_label)
        self.__options_layout.addWidget(self.__type_combo)

        self.__options_layout.addSpacing(15)

        self.__options_layout.addWidget(self.__show_zero_chkbox)

        self.__options_layout.addSpacing(15)

        self.__kxy_layout = QtGui.QFormLayout()
        self.__kxy_layout.addRow("X-Axis at:", self.__kx_spinbox)
        self.__kxy_layout.addRow("Y-Axis at:", self.__ky_spinbox)
        self.__options_layout.addLayout(self.__kxy_layout)

        self.__options_layout.addStretch()

        self.__graph_layout = QtGui.QVBoxLayout()
        self.__graph_layout.addWidget(self.__graph)

        self.__layout = QtGui.QHBoxLayout(self)
        self.__layout.addLayout(self.__options_layout)
        self.__layout.addLayout(self.__graph_layout)

        connect(self.__type_combo.currentIndexChanged,
                self.on_combobox_changed)
        connect(self.__show_zero_chkbox.stateChanged, self.on_chkbox_toggled)
        connect(self.__kx_spinbox.valueChanged, self.on_kx_spin_changed)
        connect(self.__ky_spinbox.valueChanged, self.on_ky_spin_changed)
Exemple #4
0
    def __init__(self, unaryops, binaryops, text_list):
        super(OperationList, self).__init__()

        self.unaryops = unaryops
        self.binaryops = binaryops

        #        self.addItems(text_list)
        self.combobox = qg.QComboBox()
        self.combobox.addItems(text_list)
        layout = qg.QVBoxLayout()
        layout.addWidget(qg.QLabel('Operation Type'))
        layout.addWidget(self.combobox)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)
        self.combobox.currentIndexChanged.connect(self.testchange)
Exemple #5
0
        def __init__(self, parent, appdb):
            """
            :type parent: QtGui.QWidget
            :type appdb: ApplicationDatabase
            """
            QStackWidgetTab.__init__(self, parent)

            self.__appdb = appdb
            self.__resist = None
            """:type: options.structures.Resist"""

            self.__dev_rate_graph = DevelopmentGraph(self)

            self.__group = QtGui.QGroupBox("Parameters", self)

            self.__views = dict()
            self.__parameters_widgets = QtGui.QStackedWidget(self.__group)
            self.__dev_models = QtGui.QComboBox(self.__group)

            for model in self.__appdb[orm.DevelopmentModel]:
                self.__dev_models.addItem(model.name)
                self.__views[
                    model.
                    name] = ResistDevelopmentTab.DevRateExprView.ModelView(
                        self, model, self.__dev_rate_graph)
                self.__parameters_widgets.addWidget(self.__views[model.name])
            self.__dev_models.setFixedWidth(200)
            connect(self.__dev_models.currentIndexChanged,
                    self.__onIndexChanged)

            self.__temporary_check_box = QtGui.QCheckBox(
                "Coupled", self.__group)
            connect(self.__temporary_check_box.stateChanged,
                    self._temporary_box_unchecked)

            self.__group_layout = QtGui.QVBoxLayout(self.__group)
            self.__group_layout.addWidget(self.__dev_models)
            self.__group_layout.addWidget(self.__temporary_check_box)
            self.__group_layout.addWidget(self.__parameters_widgets)
            self.__group_layout.addStretch()

            self.__layout = QtGui.QHBoxLayout(self)
            self.__layout.addWidget(self.__group)
            self.__layout.addStretch()
            self.__layout.addWidget(self.__dev_rate_graph)
Exemple #6
0
    def __init__(self, debug=False):
        QtGui.QMainWindow.__init__(self)

        ### Command box ###
        self.cmdbox = QtGui.QComboBox()
        self.cmdbox.setEditable(True)
        self.cmdbox.addItem('')
        self.cmdbox.setCurrentIndex(self.cmdbox.count() - 1)
        # @TODO: complete
        #self.entry.populate_popup.connect(self.on_populate_popup)

        self.cmdbutton = QtGui.QPushButton('Run')
        self.cmdbutton.clicked.connect(self.execute)

        lineedit = self.cmdbox.lineEdit()
        lineedit.returnPressed.connect(self.cmdbutton.clicked[''])

        hLayout = QtGui.QHBoxLayout()
        hLayout.addWidget(QtGui.QLabel('cmd > '))
        hLayout.addWidget(self.cmdbox, 1)
        hLayout.addWidget(self.cmdbutton)

        ### Output plane ###
        outputplane = Qt4OutputPlane()
        outputplane.setReadOnly(True)
        outputplane.actions.removeAction(outputplane.actionHide)
        vLayout = QtGui.QVBoxLayout()
        vLayout.addLayout(hLayout)
        vLayout.addWidget(outputplane)

        ### Main window ###
        centralWidget = QtGui.QWidget()
        centralWidget.setLayout(vLayout)
        self.setCentralWidget(centralWidget)

        # @TODO: complete
        #~ accelgroup = gtk.AccelGroup()
        #~ accelgroup.connect_group(ord('d'), gtk.gdk.CONTROL_MASK,
        #~ gtk.ACCEL_VISIBLE, self.quit)

        self.setWindowTitle('Qt4 Shell')
        self.setGeometry(0, 0, 800, 600)
        #~ self.mainwin.add_accel_group(accelgroup)
        #~ self.mainwin.destroy.connect(self.quit)

        ### Setup the log system ###
        if debug:
            level = logging.DEBUG
            logging.basicConfig(level=level)
        else:
            level = logging.INFO

        self.logger = logging.getLogger()

        formatter = logging.Formatter('%(levelname)s: %(message)s')
        handler = Qt4LoggingHandler(outputplane)
        handler.setLevel(level)
        handler.setFormatter(formatter)
        self.logger.addHandler(handler)

        formatter = logging.Formatter('%(message)s')
        handler = Qt4DialogLoggingHandler(parent=self, dialog=None)
        handler.setLevel(logging.WARNING)
        handler.setFormatter(formatter)
        self.logger.addHandler(handler)

        self.logger.setLevel(level)

        ### Setup high level components and initialize the parent classes ###
        handler = Qt4OutputHandler(self.logger, self.statusBar())
        self.tool = exectools.ToolDescriptor('', stdout_handler=handler)
        self.controller = Qt4ToolController(self.logger, parent=self)
        self.controller.finished.connect(lambda returncode: self.reset())

        ###
        #self.shell = True
        self._state = 'ready'  # or maybe __state

        self.logger.debug('qt4shell session started at %s.' % time.asctime())
        self.load_history()