Beispiel #1
0
    def __init__(self):
        super(MyApp,self).__init__()
        Ui_MainWindow.__init__(self)
        self.setupUi(self)
        self.another =MyApp2()
        self.pushButton.clicked.connect(self.get_login_cookie)

        self.pushButton.clicked.connect(self.another.show)
Beispiel #2
0
    def __init__(self):
        QtWidgets.QMainWindow.__init__(self)  # 创建主界面对象
        Ui_MainWindow.__init__(self)  # 主界面对象初始化
        self.setupUi(self)  # 配置主界面对象

        # 信号与槽函数
        self.pushButton.clicked.connect(self.openFile_1)
        self.pushButton_2.clicked.connect(self.openFile_2)
        self.pushButton_3.clicked.connect(self.tableMarkColor)
        self.comboBox.activated.connect(self.comboboxSelectSheet)

        self.tableWidget_4.itemClicked.connect(self.colLocation)
        self.tableWidget_5.itemClicked.connect(self.rowLocation)
        self.tableWidget_6.itemClicked.connect(self.itemLocation)

        # 设置tableMarkColor()中选中单元格的默认颜色为灰色
        self.tableWidget.setStyleSheet(
            "selection-background-color:rgb(154, 145, 106);")
        self.tableWidget_2.setStyleSheet(
            "selection-background-color:rgb(154, 145, 106);")
        self.tableWidget_4.setStyleSheet(
            "selection-background-color:rgb(154, 145, 106);")
        self.tableWidget_5.setStyleSheet(
            "selection-background-color:rgb(154, 145, 106);")
        self.tableWidget_6.setStyleSheet(
            "selection-background-color:rgb(154, 145, 106);")

        # 初始化tabwidget的名字和属性

        self.tableWidget_4.setRowCount(2)
        self.tableWidget_4.setColumnCount(1)

        newItem = QTableWidgetItem('新增')
        self.tableWidget_4.setItem(0, 0, newItem)
        newItem = QTableWidgetItem('删除')
        self.tableWidget_4.setItem(1, 0, newItem)

        self.tableWidget_5.setRowCount(2)
        self.tableWidget_5.setColumnCount(1)

        newItem = QTableWidgetItem('新增')
        self.tableWidget_5.setItem(0, 0, newItem)
        newItem = QTableWidgetItem('删除')
        self.tableWidget_5.setItem(1, 0, newItem)

        self.tableWidget_6.setRowCount(1)
        self.tableWidget_6.setColumnCount(3)
        newItem = QTableWidgetItem('坐标')
        self.tableWidget_6.setItem(0, 0, newItem)
        newItem = QTableWidgetItem('旧值')
        self.tableWidget_6.setItem(0, 1, newItem)
        newItem = QTableWidgetItem('新值')
        self.tableWidget_6.setItem(0, 2, newItem)
Beispiel #3
0
    def __init__(self):
        QMainWindow.__init__(self)
        Ui_MainWindow.__init__(self)
        self.setupUi(self)
        self.smallSmtMachine = smallsmtconfig.SmallSmtConfig()
        self.smallSmtMachine.smallSmtLog.connect(self.logMessages)
        self.listPorts()
        self.serial = commserial.CommSerial()
        self.openPnp = openpnp.OpenPnp(self.smallSmtMachine, self.serial)
        self.openPnp.openPnpLog.connect(self.logMessages)

        self.dataProgramDir = os.path.dirname(__file__)
        self.dataConfigDir = QStandardPaths.writableLocation(
            QStandardPaths.AppDataLocation)
        # Make sure our data path exists
        os.makedirs(self.dataConfigDir, exist_ok=True)

        self.actionPlayground.setEnabled(False)
        self.statusBar.showMessage(
            QCoreApplication.translate("App",
                                       "Connect to machine serial port first"))
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        Ui_MainWindow.__init__(self)

        self.main_path = sys.path[0]
        if len(self.main_path) == 0:
            self.main_path == os.curdir

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.setWindowIcon(
            QtGui.QIcon(os.path.join(self.main_path,
                                     "icons/centerfinder.png")))
        self.project_path = None
        self.ui.menuTools.setEnabled(True)

        self.ui.tabWidgetFolders.currentChanged.connect(self.update_tree)

        self.ui.actionNew_Project.triggered.connect(self.new_project)
        self.ui.actionScrape_New_Data.triggered.connect(self.scrape_new_data)

        self.ui.treeWidgetDataFolder.itemDoubleClicked.connect(
            self.item_double_clicked)
        self.ui.treeWidgetProjectFolder.itemDoubleClicked.connect(
            self.item_double_clicked)

        self.ui.treeWidgetProjectFolder.setContextMenuPolicy(
            QtCore.Qt.CustomContextMenu)
        self.ui.treeWidgetProjectFolder.customContextMenuRequested.connect(
            self.contextMenuEvent)

        self.ui.actionCenterfinding_All.triggered.connect(
            lambda: self.open_centerfinding_window(mode="all"))
        self.ui.actionCenterfinding_selection.triggered.connect(
            lambda: self.open_centerfinding_window(mode="selection"))

        self.ui.actionParameters_and_Metadata_for_all.triggered.connect(
            lambda: self.calculate_parameters(mode="all"))
        self.ui.actionParameters_for_selection.triggered.connect(
            lambda: self.calculate_parameters(mode="selection"))
        self.ui.actionMissing_Parameter.triggered.connect(
            lambda: self.calculate_parameters(mode="missing"))
        self.ui.actionOnly_Metadata.triggered.connect(self.calculate_metadata)
        self.ui.actionLoad_Project.triggered.connect(self.load_project)
        self.ui.actionLoad_Existing_Dataset.triggered.connect(
            self.load_project_to_add)
        self.ui.actionOpen_Data_Explorer.triggered.connect(
            self.open_data_explorer)
        """
        Actions
        """
        self.delAct = QtWidgets.QAction(
            "&Delete",
            self,
            statusTip=
            "Delete selected folder(s) along with contents from project. This does not delete anything from the raw data folder.",
            triggered=self.delete)
        self.redoCenterAct = QtWidgets.QAction("Redo Center",
                                               self,
                                               triggered=self.redoCenter)
        self.redoParamsAct = QtWidgets.QAction("Redo Parameters",
                                               self,
                                               triggered=self.redoParams)
        self.toCSVAct = QtWidgets.QAction("Convert to CSV",
                                          self,
                                          triggered=self.toCSV)
        self.updateProjectAct = QtWidgets.QAction("Update Project View",
                                                  self,
                                                  triggered=self.update_tree)
Beispiel #5
0
    def __init__(self, dialog):
        Ui_MainWindow.__init__(self)
        self.setupUi(dialog)

        # Connect "add" button with a custom function (addInputTextToListbox)
        self.pushButton.clicked.connect(self.addInputTextToListbox)