本文整理汇总了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))