示例#1
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800,600)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setGeometry(QtCore.QRect(286,48,514,383))
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.circuitWidget = CircuitWidget(self.centralwidget)
        self.circuitWidget.setObjectName("circuitWidget")
        self.horizontalLayout.addWidget(self.circuitWidget)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0,0,800,22))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtGui.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setGeometry(QtCore.QRect(0,578,800,22))
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.toolBar = QtGui.QToolBar(MainWindow)
        self.toolBar.setGeometry(QtCore.QRect(0,22,800,26))
        self.toolBar.setObjectName("toolBar")
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea,self.toolBar)
        self.dockWidget = QtGui.QDockWidget(MainWindow)
        self.dockWidget.setGeometry(QtCore.QRect(0,48,280,383))
        self.dockWidget.setFloating(True)
        self.dockWidget.setObjectName("dockWidget")
        self.dockWidgetContents = QtGui.QWidget(self.dockWidget)
        self.dockWidgetContents.setGeometry(QtCore.QRect(0,26,280,357))
        self.dockWidgetContents.setObjectName("dockWidgetContents")
        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.dockWidgetContents)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.objectTree = QtGui.QTreeWidget(self.dockWidgetContents)
        self.objectTree.setDragEnabled(True)
        self.objectTree.setDragDropMode(QtGui.QAbstractItemView.DragOnly)
        self.objectTree.setObjectName("objectTree")
        self.horizontalLayout_2.addWidget(self.objectTree)
        self.dockWidget.setWidget(self.dockWidgetContents)
        MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1),self.dockWidget)
        self.dockWidget_2 = QtGui.QDockWidget(MainWindow)
        self.dockWidget_2.setGeometry(QtCore.QRect(0,437,800,141))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.dockWidget_2.sizePolicy().hasHeightForWidth())
        self.dockWidget_2.setSizePolicy(sizePolicy)
        self.dockWidget_2.setMinimumSize(QtCore.QSize(300,122))
        self.dockWidget_2.setFloating(False)
        self.dockWidget_2.setObjectName("dockWidget_2")
        self.dockWidgetContents_2 = QtGui.QWidget(self.dockWidget_2)
        self.dockWidgetContents_2.setGeometry(QtCore.QRect(0,26,800,115))
        self.dockWidgetContents_2.setObjectName("dockWidgetContents_2")
        self.horizontalLayout_4 = QtGui.QHBoxLayout(self.dockWidgetContents_2)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        spacerItem = QtGui.QSpacerItem(209,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(self.dockWidgetContents_2)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label,0,0,1,1)
        self.analysisCombo = QtGui.QComboBox(self.dockWidgetContents_2)
        self.analysisCombo.setObjectName("analysisCombo")
        self.gridLayout.addWidget(self.analysisCombo,0,1,1,1)
        self.label_2 = QtGui.QLabel(self.dockWidgetContents_2)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2,1,0,1,1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.doSummaryCheck = QtGui.QCheckBox(self.dockWidgetContents_2)
        self.doSummaryCheck.setChecked(True)
        self.doSummaryCheck.setObjectName("doSummaryCheck")
        self.horizontalLayout_3.addWidget(self.doSummaryCheck)
        self.setAttributesCheck = QtGui.QCheckBox(self.dockWidgetContents_2)
        self.setAttributesCheck.setObjectName("setAttributesCheck")
        self.horizontalLayout_3.addWidget(self.setAttributesCheck)
        self.gridLayout.addLayout(self.horizontalLayout_3,1,1,1,1)
        self.beginButton = QtGui.QPushButton(self.dockWidgetContents_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.beginButton.sizePolicy().hasHeightForWidth())
        self.beginButton.setSizePolicy(sizePolicy)
        self.beginButton.setObjectName("beginButton")
        self.gridLayout.addWidget(self.beginButton,2,1,1,1)
        self.horizontalLayout_4.addLayout(self.gridLayout)
        spacerItem1 = QtGui.QSpacerItem(208,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem1)
        self.dockWidget_2.setWidget(self.dockWidgetContents_2)
        MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8),self.dockWidget_2)
        self.actionOpen = QtGui.QAction(MainWindow)
        self.actionOpen.setObjectName("actionOpen")
        self.actionSave = QtGui.QAction(MainWindow)
        self.actionSave.setObjectName("actionSave")
        self.actionQuit = QtGui.QAction(MainWindow)
        self.actionQuit.setObjectName("actionQuit")
        self.actionConnect = QtGui.QAction(MainWindow)
        self.actionConnect.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionConnect.setObjectName("actionConnect")
        self.actionDisconnect = QtGui.QAction(MainWindow)
        self.actionDisconnect.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionDisconnect.setObjectName("actionDisconnect")
        self.actionFlip = QtGui.QAction(MainWindow)
        self.actionFlip.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionFlip.setObjectName("actionFlip")
        self.actionDestroy = QtGui.QAction(MainWindow)
        self.actionDestroy.setShortcutContext(QtCore.Qt.WindowShortcut)
        self.actionDestroy.setObjectName("actionDestroy")
        self.actionCancel = QtGui.QAction(MainWindow)
        self.actionCancel.setEnabled(False)
        self.actionCancel.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionCancel.setObjectName("actionCancel")
        self.menuFile.addAction(self.actionOpen)
        self.menuFile.addAction(self.actionSave)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionQuit)
        self.menubar.addAction(self.menuFile.menuAction())
        self.toolBar.addAction(self.actionOpen)
        self.toolBar.addAction(self.actionSave)
        self.toolBar.addSeparator()
        self.toolBar.addAction(self.actionConnect)
        self.toolBar.addAction(self.actionDisconnect)
        self.toolBar.addAction(self.actionFlip)
        self.toolBar.addAction(self.actionDestroy)
        self.toolBar.addAction(self.actionCancel)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
示例#2
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800,600)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setGeometry(QtCore.QRect(286,48,514,383))
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.circuitWidget = CircuitWidget(self.centralwidget)
        self.circuitWidget.setObjectName("circuitWidget")
        self.horizontalLayout.addWidget(self.circuitWidget)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0,0,800,22))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtGui.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setGeometry(QtCore.QRect(0,578,800,22))
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.toolBar = QtGui.QToolBar(MainWindow)
        self.toolBar.setGeometry(QtCore.QRect(0,22,800,26))
        self.toolBar.setObjectName("toolBar")
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea,self.toolBar)
        self.dockWidget = QtGui.QDockWidget(MainWindow)
        self.dockWidget.setGeometry(QtCore.QRect(0,48,280,383))
        self.dockWidget.setFloating(True)
        self.dockWidget.setObjectName("dockWidget")
        self.dockWidgetContents = QtGui.QWidget(self.dockWidget)
        self.dockWidgetContents.setGeometry(QtCore.QRect(0,26,280,357))
        self.dockWidgetContents.setObjectName("dockWidgetContents")
        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.dockWidgetContents)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.objectTree = QtGui.QTreeWidget(self.dockWidgetContents)
        self.objectTree.setDragEnabled(True)
        self.objectTree.setDragDropMode(QtGui.QAbstractItemView.DragOnly)
        self.objectTree.setObjectName("objectTree")
        self.horizontalLayout_2.addWidget(self.objectTree)
        self.dockWidget.setWidget(self.dockWidgetContents)
        MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1),self.dockWidget)
        self.dockWidget_2 = QtGui.QDockWidget(MainWindow)
        self.dockWidget_2.setGeometry(QtCore.QRect(0,437,800,141))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.dockWidget_2.sizePolicy().hasHeightForWidth())
        self.dockWidget_2.setSizePolicy(sizePolicy)
        self.dockWidget_2.setMinimumSize(QtCore.QSize(300,122))
        self.dockWidget_2.setFloating(False)
        self.dockWidget_2.setObjectName("dockWidget_2")
        self.dockWidgetContents_2 = QtGui.QWidget(self.dockWidget_2)
        self.dockWidgetContents_2.setGeometry(QtCore.QRect(0,26,800,115))
        self.dockWidgetContents_2.setObjectName("dockWidgetContents_2")
        self.horizontalLayout_4 = QtGui.QHBoxLayout(self.dockWidgetContents_2)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        spacerItem = QtGui.QSpacerItem(209,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(self.dockWidgetContents_2)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label,0,0,1,1)
        self.analysisCombo = QtGui.QComboBox(self.dockWidgetContents_2)
        self.analysisCombo.setObjectName("analysisCombo")
        self.gridLayout.addWidget(self.analysisCombo,0,1,1,1)
        self.label_2 = QtGui.QLabel(self.dockWidgetContents_2)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2,1,0,1,1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.doSummaryCheck = QtGui.QCheckBox(self.dockWidgetContents_2)
        self.doSummaryCheck.setChecked(True)
        self.doSummaryCheck.setObjectName("doSummaryCheck")
        self.horizontalLayout_3.addWidget(self.doSummaryCheck)
        self.setAttributesCheck = QtGui.QCheckBox(self.dockWidgetContents_2)
        self.setAttributesCheck.setObjectName("setAttributesCheck")
        self.horizontalLayout_3.addWidget(self.setAttributesCheck)
        self.gridLayout.addLayout(self.horizontalLayout_3,1,1,1,1)
        self.beginButton = QtGui.QPushButton(self.dockWidgetContents_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.beginButton.sizePolicy().hasHeightForWidth())
        self.beginButton.setSizePolicy(sizePolicy)
        self.beginButton.setObjectName("beginButton")
        self.gridLayout.addWidget(self.beginButton,2,1,1,1)
        self.horizontalLayout_4.addLayout(self.gridLayout)
        spacerItem1 = QtGui.QSpacerItem(208,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem1)
        self.dockWidget_2.setWidget(self.dockWidgetContents_2)
        MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8),self.dockWidget_2)
        self.actionOpen = QtGui.QAction(MainWindow)
        self.actionOpen.setObjectName("actionOpen")
        self.actionSave = QtGui.QAction(MainWindow)
        self.actionSave.setObjectName("actionSave")
        self.actionQuit = QtGui.QAction(MainWindow)
        self.actionQuit.setObjectName("actionQuit")
        self.actionConnect = QtGui.QAction(MainWindow)
        self.actionConnect.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionConnect.setObjectName("actionConnect")
        self.actionDisconnect = QtGui.QAction(MainWindow)
        self.actionDisconnect.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionDisconnect.setObjectName("actionDisconnect")
        self.actionFlip = QtGui.QAction(MainWindow)
        self.actionFlip.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionFlip.setObjectName("actionFlip")
        self.actionDestroy = QtGui.QAction(MainWindow)
        self.actionDestroy.setShortcutContext(QtCore.Qt.WindowShortcut)
        self.actionDestroy.setObjectName("actionDestroy")
        self.actionCancel = QtGui.QAction(MainWindow)
        self.actionCancel.setEnabled(False)
        self.actionCancel.setShortcutContext(QtCore.Qt.ApplicationShortcut)
        self.actionCancel.setObjectName("actionCancel")
        self.menuFile.addAction(self.actionOpen)
        self.menuFile.addAction(self.actionSave)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionQuit)
        self.menubar.addAction(self.menuFile.menuAction())
        self.toolBar.addAction(self.actionOpen)
        self.toolBar.addAction(self.actionSave)
        self.toolBar.addSeparator()
        self.toolBar.addAction(self.actionConnect)
        self.toolBar.addAction(self.actionDisconnect)
        self.toolBar.addAction(self.actionFlip)
        self.toolBar.addAction(self.actionDestroy)
        self.toolBar.addAction(self.actionCancel)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Circuit Editor", None, QtGui.QApplication.UnicodeUTF8))
        self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBar.setWindowTitle(QtGui.QApplication.translate("MainWindow", "toolBar", None, QtGui.QApplication.UnicodeUTF8))
        self.dockWidget.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Object Palette", None, QtGui.QApplication.UnicodeUTF8))
        self.objectTree.headerItem().setText(0,QtGui.QApplication.translate("MainWindow", "Circuit Objects", None, QtGui.QApplication.UnicodeUTF8))
        self.objectTree.clear()
        item = QtGui.QTreeWidgetItem(self.objectTree)
        item.setText(0,QtGui.QApplication.translate("MainWindow", "Nodes", None, QtGui.QApplication.UnicodeUTF8))
        item1 = QtGui.QTreeWidgetItem(item)
        item1.setText(0,QtGui.QApplication.translate("MainWindow", "Normal node", None, QtGui.QApplication.UnicodeUTF8))
        item2 = QtGui.QTreeWidgetItem(self.objectTree)
        item2.setText(0,QtGui.QApplication.translate("MainWindow", "Linear", None, QtGui.QApplication.UnicodeUTF8))
        item3 = QtGui.QTreeWidgetItem(item2)
        item3.setText(0,QtGui.QApplication.translate("MainWindow", "Resistor", None, QtGui.QApplication.UnicodeUTF8))
        item4 = QtGui.QTreeWidgetItem(item2)
        item4.setText(0,QtGui.QApplication.translate("MainWindow", "Voltage source", None, QtGui.QApplication.UnicodeUTF8))
        item5 = QtGui.QTreeWidgetItem(item2)
        item5.setText(0,QtGui.QApplication.translate("MainWindow", "Current source", None, QtGui.QApplication.UnicodeUTF8))
        item6 = QtGui.QTreeWidgetItem(self.objectTree)
        item6.setText(0,QtGui.QApplication.translate("MainWindow", "Diodes", None, QtGui.QApplication.UnicodeUTF8))
        item7 = QtGui.QTreeWidgetItem(item6)
        item7.setText(0,QtGui.QApplication.translate("MainWindow", "Shockley diode", None, QtGui.QApplication.UnicodeUTF8))
        self.dockWidget_2.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Analysis", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("MainWindow", "Analysis type:", None, QtGui.QApplication.UnicodeUTF8))
        self.analysisCombo.addItem(QtGui.QApplication.translate("MainWindow", "Operating point", None, QtGui.QApplication.UnicodeUTF8))
        self.analysisCombo.addItem(QtGui.QApplication.translate("MainWindow", "Thevenin equivalent", None, QtGui.QApplication.UnicodeUTF8))
        self.analysisCombo.addItem(QtGui.QApplication.translate("MainWindow", "Norton equivalent", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Outputs:", None, QtGui.QApplication.UnicodeUTF8))
        self.doSummaryCheck.setText(QtGui.QApplication.translate("MainWindow", "Summary table", None, QtGui.QApplication.UnicodeUTF8))
        self.setAttributesCheck.setText(QtGui.QApplication.translate("MainWindow", "Set attributes", None, QtGui.QApplication.UnicodeUTF8))
        self.beginButton.setText(QtGui.QApplication.translate("MainWindow", "Begin", None, QtGui.QApplication.UnicodeUTF8))
        self.actionOpen.setText(QtGui.QApplication.translate("MainWindow", "Open", None, QtGui.QApplication.UnicodeUTF8))
        self.actionOpen.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave.setText(QtGui.QApplication.translate("MainWindow", "Save", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8))
        self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConnect.setText(QtGui.QApplication.translate("MainWindow", "Connect", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConnect.setShortcut(QtGui.QApplication.translate("MainWindow", "C", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDisconnect.setText(QtGui.QApplication.translate("MainWindow", "Disconnect", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDisconnect.setShortcut(QtGui.QApplication.translate("MainWindow", "D", None, QtGui.QApplication.UnicodeUTF8))
        self.actionFlip.setText(QtGui.QApplication.translate("MainWindow", "Flip", None, QtGui.QApplication.UnicodeUTF8))
        self.actionFlip.setShortcut(QtGui.QApplication.translate("MainWindow", "F", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDestroy.setText(QtGui.QApplication.translate("MainWindow", "Destroy", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDestroy.setShortcut(QtGui.QApplication.translate("MainWindow", "Backspace", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCancel.setText(QtGui.QApplication.translate("MainWindow", "Cancel", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCancel.setShortcut(QtGui.QApplication.translate("MainWindow", "Esc", None, QtGui.QApplication.UnicodeUTF8))