Beispiel #1
0
name = 'My Tracker'
period = 0.01
configuration = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'configClaronMicronTracker.xml')

manager = mts.mtsManagerLocal.GetInstance()
manager.CreateAllAndWait(5.0)
manager.StartAllAndWait(5.0)

proxy = mts.mtsComponentWithManagement('{}Proxy'.format(name))
manager.AddComponent(proxy)
proxy.CreateAndWait(5.0)
time.sleep(0.5)

services = proxy.GetManagerComponentServices()
result = services.Load('sawClaronMicronTracker')
assert result, 'Failed to load {} using component services'.format('sawClaronMicronTracker')

args = mts.mtsTaskPeriodicConstructorArg(name, period)
result = services.ComponentCreate('mtsMicronTracker', args)
assert result, 'Failed to create {} of type {}'.format(name, 'mtsMicronTracker')

component = manager.GetComponent(name)
# component.Configure(configuration)

controller = proxy.AddInterfaceRequiredAndConnect((name, 'Controller'))

component.CreateAndWait(5.0)
component.StartAndWait(5.0)

print controller.IsTracking()
name = "My Tracker"
period = 0.01
configuration = os.path.join(os.path.dirname(os.path.abspath(__file__)), "configClaronMicronTracker.xml")

manager = mts.mtsManagerLocal.GetInstance()
manager.CreateAllAndWait(5.0)
manager.StartAllAndWait(5.0)

proxy = mts.mtsComponentWithManagement("{}Proxy".format(name))
manager.AddComponent(proxy)
proxy.CreateAndWait(5.0)
time.sleep(0.5)

services = proxy.GetManagerComponentServices()
result = services.Load("sawClaronMicronTracker")
assert result, "Failed to load {} using component services".format("sawClaronMicronTracker")

args = mts.mtsTaskPeriodicConstructorArg(name, period)
result = services.ComponentCreate("mtsMicronTracker", args)
assert result, "Failed to create {} of type {}".format(name, "mtsMicronTracker")

component = manager.GetComponent(name)
# component.Configure(configuration)

controller = proxy.AddInterfaceRequiredAndConnect((name, "Controller"))

component.CreateAndWait(5.0)
component.StartAndWait(5.0)

print controller.IsTracking()
manager = mts.mtsManagerLocal.GetInstance()
stealth = mts.mtsComponentWithManagement("stealthProxy")
manager.AddComponent(stealth)
print "added stealthProxy Component to local manager"
manager.CreateAll()
manager.StartAll()
print "starting sawMedtronicStealthlinkClientComponent.py..."
services = stealth.GetManagerComponentServices()
valid = services.Load("libsawMedtronicStealthlink.so")
if bool(valid):
    print "loaded libsawMedtronicStealthlink.so"
else:
    print "ERROR services unable to load libsawMedtronicStealthlink.so"
    ctypes.CDLL("libsawMedtronicStealthlink.so")
    print "CDLL loaded libsawMedtronicStealthlink.so"
ctorArg = mts.mtsTaskPeriodicConstructorArg("Stealthlink", 50.0)
print "created ctorArg"
valid = services.ComponentCreate("mtsMedtronicStealthlink", ctorArg)
if bool(valid):
    print "Created stealthlink component!!!"
else:
    print "ERROR Could not create stealthlink component"

stealthComponent = manager.GetComponent("Stealthlink")

stealthComponent.Configure("config.xml")
print "configured stealthlink component"

stealth.AddInterfaceRequiredAndConnect(("Stealthlink", "Pointer"))
stealth.AddInterfaceRequiredAndConnect(("Stealthlink", "Frame"))
stealth.AddInterfaceRequiredAndConnect(("Stealthlink", "Registration"))
Beispiel #4
0
manager = mts.mtsManagerLocal.GetInstance()
stealth = mts.mtsComponentWithManagement('stealthProxy')
manager.AddComponent(stealth)
print 'added stealthProxy Component to local manager'
manager.CreateAll()
manager.StartAll()
print 'starting sawMedtronicStealthlinkClientComponent.py...'
services = stealth.GetManagerComponentServices()
valid = services.Load('libsawMedtronicStealthlink.so')
if(bool(valid)):
    print 'loaded libsawMedtronicStealthlink.so'
else:
    print 'ERROR services unable to load libsawMedtronicStealthlink.so'
    ctypes.CDLL('libsawMedtronicStealthlink.so')
    print 'CDLL loaded libsawMedtronicStealthlink.so'
ctorArg = mts.mtsTaskPeriodicConstructorArg("Stealthlink", 50.0)
print 'created ctorArg'
valid = services.ComponentCreate('mtsMedtronicStealthlink',ctorArg)
if(bool(valid)):
    print 'Created stealthlink component!!!'
else:
    print 'ERROR Could not create stealthlink component'

stealthComponent = manager.GetComponent('Stealthlink')

stealthComponent.Configure('config.xml')
print 'configured stealthlink component'

stealth.AddInterfaceRequiredAndConnect(('Stealthlink', 'Pointer'))
stealth.AddInterfaceRequiredAndConnect(('Stealthlink', 'Frame'))
stealth.AddInterfaceRequiredAndConnect(('Stealthlink', 'Registration'))