本文整理汇总了Python中BAL.Devices.Relay.Relay.add方法的典型用法代码示例。如果您正苦于以下问题:Python Relay.add方法的具体用法?Python Relay.add怎么用?Python Relay.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.Devices.Relay.Relay
的用法示例。
在下文中一共展示了Relay.add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from BAL.Devices.Relay import Relay [as 别名]
# 或者: from BAL.Devices.Relay.Relay import add [as 别名]
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.setupUi(self)
self.data = []
self.motors = []
self.currentShowDev = None
self.root = Element("launch")
self.actionAbout_RIC.triggered.connect(self.about)
self.actionServo.triggered.connect(self.addServo)
self.actionBattery_Monitor.triggered.connect(self.addBattery)
self.actionSwitch.triggered.connect(self.addSwitch)
self.actionIMU.triggered.connect(self.addImu)
self.actionPPM.triggered.connect(self.addPpm)
self.actionGPS.triggered.connect(self.addGps)
self.actionRelay.triggered.connect(self.addRelay)
self.actionURF.triggered.connect(self.addURF)
self.actionMotor_with_one_encoder.triggered.connect(self.addCloseMotorOne)
self.actionMotor_with_two_encoder.triggered.connect(self.addCloseMotorTwo)
self.actionOpen_Loop.triggered.connect(self.addOpenMotor)
self.actionWith_two_motors.triggered.connect(self.addDiffClose)
self.actionWith_four_motors.triggered.connect(self.addDiffCloseFour)
self.actionOpen_Loop_Drive.triggered.connect(self.addDiffOpen)
self.actionUSB_Camera.triggered.connect(self.addUsbCam)
self.actionOPENNI.triggered.connect(self.addOpenni)
self.actionHakoyo.triggered.connect(self.addOHokuyo)
self.actionSave.triggered.connect(self.save)
self.actionOpen.triggered.connect(self.load)
self.actionNew.triggered.connect(self.new)
self.actionReconfig_RiC_Board.triggered.connect(self.configRiCBoard)
self.actionRobot_Model.triggered.connect(self.addRobotModel)
self.actionAbout_RiC_Board.triggered.connect(self.aboutRiCBoard)
self.actionSLAM.triggered.connect(self.addSLAM)
self.actionRemote_robot_launch.triggered.connect(self.launchRemote)
self.actionPPM_Reader.triggered.connect(self.addPPmReader)
self.actionSet_parameters.triggered.connect(self.paramManager)
self.actionKeyboard.triggered.connect(self.addKeyboard)
self.actionJoystick.triggered.connect(self.addJoystick)
self.actionDifferential_Drive_smoother.triggered.connect(self.addDiffSmooth)
self.fileName.textChanged.connect(self.fileNameEven)
self.nameSpace.textChanged.connect(self.namespaceEven)
self.devList.itemPressed.connect(self.clickListEven)
self.devList.doubleClicked.connect(self.devEdit)
self.servoPorts = QComboBox()
self.servoPorts.addItems([self.tr("1"), self.tr("2")])
self.switchPorts = QComboBox()
self.switchPorts.addItems([self.tr("1"), self.tr("2")])
self.relayPorts = QComboBox()
self.relayPorts.addItems([self.tr("1"), self.tr("2")])
self.urfPorts = QComboBox()
self.urfPorts.addItems([self.tr("1"), self.tr("2"), self.tr("3")])
self.encoders = QComboBox()
self.encoders.addItems([self.tr("1"), self.tr("2"), self.tr("3"), self.tr("4")])
self._ns = ""
self._fileName = ""
self.haveBattery = False
self.haveIMU = False
self.havePPM = False
self.haveGPS = False
self.haveCloseLoop = False
self.haveOpenLoop = False
self.haveDiff = False
self.haveReader = False
self.diffEnable = False
self.editMode = False
self.listMode = False
self.newDevMode = False
self.override = True
self.pushButton_2.setEnabled(False)
self.pushButton_2.clicked.connect(self.launch)
allDev = subprocess.check_output(shlex.split("ls /dev"))
conDevs = re.findall("ttyUSB.*", allDev) + re.findall("ttyACM.*", allDev) + re.findall("RiCBoard", allDev)
for dev in conDevs:
self.ConPortList.addItem(self.tr(dev))
self.ConPortList.setCurrentIndex(self.ConPortList.count() - 1)
def launchRemote(self):
dialog = RemoteLaunch(self)
dialog.show()
dialog.exec_()
def paramManager(self):
subprocess.Popen(shlex.split("roslaunch ric_board startParamMsg.launch"))
#.........这里部分代码省略.........