当前位置: 首页>>代码示例>>Python>>正文


Python Relay.printDetails方法代码示例

本文整理汇总了Python中BAL.Devices.Relay.Relay.printDetails方法的典型用法代码示例。如果您正苦于以下问题:Python Relay.printDetails方法的具体用法?Python Relay.printDetails怎么用?Python Relay.printDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BAL.Devices.Relay.Relay的用法示例。


在下文中一共展示了Relay.printDetails方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MainWindow

# 需要导入模块: from BAL.Devices.Relay import Relay [as 别名]
# 或者: from BAL.Devices.Relay.Relay import printDetails [as 别名]

#.........这里部分代码省略.........
            QMessageBox.critical(self, "PPM Error", "Can't add another PPM to ric board.")
            return
        self.interruptHandler()
        self.newDevMode = True
        self.currentShowDev = Ppm(self.DevFrame, self.data)
        self.currentShowDev.showDetails()
        self.pushButton.clicked.connect(self.addDevToList)

    def addGps(self):
        if self.haveGPS:
            QMessageBox.critical(self, "GPS Error", "Can't add another GPS to ric board.")
            return
        self.interruptHandler()
        self.newDevMode = True
        self.currentShowDev = Gps(self.DevFrame, self.data)
        self.currentShowDev.showDetails()
        self.pushButton.clicked.connect(self.addDevToList)

    def addRelay(self):
        if self.relayPorts.count() == 0:
            QMessageBox.critical(self, "Relay Error", "Out of relay ports.")
            return
        self.interruptHandler()
        self.newDevMode = True
        self.currentShowDev = Relay(self.DevFrame, self.data, self.relayPorts)
        self.currentShowDev.showDetails()
        self.pushButton.clicked.connect(self.addDevToList)

    def clickListEven(self):
        self.interruptHandler()
        index = self.devList.currentRow()
        self.listMode = True
        self.currentShowDev = self.data[index]
        self.currentShowDev.printDetails()

        self.Edit.clicked.connect(self.devEdit)
        self.Delete.clicked.connect(self.devDelete)
        self.saveStatus.clicked.connect(self.changeDevSaveStatus)

    def changeDevSaveStatus(self):
        self.interruptHandler()
        index = self.devList.currentRow()
        self.currentShowDev = self.data[index]

        if self.currentShowDev.getDevType() in [CLOSE_LOP_ONE, CLOSE_LOP_TWO, OPEN_LOP] and self.diffEnable:
            QMessageBox.critical(self, "Error", "Can't disable a motor while differential drive is present")
            return

        motorCount = 0
        if self.currentShowDev.getDevType() in [DIFF_CLOSE, DIFF_OPEN, DIFF_CLOSE_FOUR] and not self.diffEnable:
            for dev in self.data:
                if dev.getDevType() in [CLOSE_LOP_ONE, CLOSE_LOP_TWO, OPEN_LOP] and dev.isToSave():
                    motorCount += 1

            if (motorCount <= 1) or (motorCount < 4 and self.currentShowDev.getDevType() == CLOSE_LOP_ONE):
                QMessageBox.critical(self, "Error", "Can't enable  differential drive motor while motors are disable")
                return

        if self.currentShowDev.getDevType() in [DIFF_CLOSE, DIFF_OPEN, DIFF_CLOSE_FOUR]:
            self.diffEnable = not self.currentShowDev.isToSave()

        if self.currentShowDev.isToSave():
            self.devList.item(index).setForeground(QColor(255, 0, 0))
            self.currentShowDev.setToSave(False)
        else:
            self.devList.item(index).setForeground(QColor(0, 0, 0))
开发者ID:nirlevi5,项目名称:bgumodo_ws,代码行数:70,代码来源:MainWindow.py


注:本文中的BAL.Devices.Relay.Relay.printDetails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。