Exemplo n.º 1
0
Control2 = ControlValue()
Control2.ControlName = 'Fast'
otherDevice.ControlList.append(Control1)
otherDevice.ControlList.append(Control2)
print CheckEquality(otherDevice.DeviceName, 'Sloppy', 'DeviceNameSetTest')

# Extract, Create, and Update Queued Commands
firstCtrl = otherDevice.ControlList[1]
firstCtrl.CurCtrlValue = 40
otherDevice.QueueControl(firstCtrl)
curCtrl = otherDevice.ControlList[0]
curCtrl.CurCtrlValue = 3
otherDevice.QueueControl(curCtrl)
curCtrl.CurCtrlValue = 5
otherDevice.QueueControl(curCtrl)
otherDevice.QueueControlByName('Forge', 210)
print CheckEquality(otherDevice.GetQueuedControlString(), 'Fast,40;Forge,210;',
                    'QueueControlByNameTest')
print CheckEquality(otherDevice.GetQueuedControlString(), '',
                    'GetQueuedControlStringTest')

# Update controls on a device by string
otherDevice.UpdateControlsByString('Fast,20;Forge,30;')
print CheckEquality(otherDevice.ControlList[0].CurCtrlValue, 30,
                    'UpdateControlsByStringTest1')
print CheckEquality(otherDevice.ControlList[1].CurCtrlValue, 20,
                    'UpdateControlsByStringTest2')

# Transfer device information via serialization
controlStr = otherDevice.GetDeviceString()
newDevice = Device()