def addPeriodicConf(macadr, reactor):

    # get the actor
    stage = AriStage(reactor)
    try :
        act = yield stage.getActorFor(macadr, STATUS_ACTOR)
        if (act!=None):
            spa = act.FindAction("TSnCommActSendPeriodic")
            if (spa!=None):
                act.Remove("TSnCommActSendPeriodic")
                # save changes
                act.Write(act.GetName(), ROOT.TObject.kOverwrite)
                act.Print()
                stage.doneWithActor()
                print 'done'
                reactor.stop()
    except Exception as e:
        print 'exception {0}'.format(e)
        print 'unable to do it'
        reactor.stop()
def addLocalMbedFileToQueue(mlfn, macadr, reactor, stop=True):
    
    # get the mbed local file
    mlf = ROOT.TSnCommMbedLocalFile(mlfn)
    
    # get the actor
    stage = AriStage(reactor)
    try :
        act = yield stage.getActorFor(macadr, STATUS_ACTOR)
        if (act!=None):
            act.AddComm(mlf)
            act.Write(act.GetName(), ROOT.TObject.kOverwrite)
            act.Print()
            stage.doneWithActor()
            if (stop):
                print 'done'
                reactor.stop()
    except Exception as e:
        print 'exception {0}'.format(e)
        print 'unable to do it'
        reactor.stop()
Example #3
0
def printStationActors(macadr, actors, reactor,
                       popts="queue action label",
                       stop=True):

     # get the stage
    stage = AriStage(reactor)
    for actnm in actors:
        try :
            act = yield stage.getActorFor(macadr, actnm, False)
            if (act!=None):
                print '\n\n\n'
                act.Print(popts)
                stage.doneWithActor()
            else:
                print "Could not get actor named [{0} for [{1}]"\
                    .format(actnm, macadr)
        except Exception as e:
            print 'exception {0}'.format(e)
            print 'unable to do it'
    if (stop):
        print 'done'
        reactor.stop()