예제 #1
0
def pipelineTest():
    import sys
    n = node.Node("pycauv-pl",sys.argv[1:])
    model = pipeline.Model(n)
    print 'Setting debug level to -3'
    n.send(messaging.DebugLevelMessage(-3), "debug")
    
    print 'Adding stuff to the pipeline...'
    n.send(messaging.ClearPipelineMessage(), "pipeline")
    n.send(messaging.AddNodeMessage(messaging.NodeType.FileInput,
                                    messaging.NodeInputArcVec(),
                                    messaging.NodeOutputArcVec()), "pipeline")
    n.send(messaging.AddNodeMessage(messaging.NodeType.GuiOutput,
                                    messaging.NodeInputArcVec(),
                                    messaging.NodeOutputArcVec()), "pipeline")

    print 'Getting pipeline state...'
    saved = model.get()
    print 'before:', saved
    print 'Clearing pipeline state...'
    model.clear()
    print 'Setting pipeline state...'
    model.set(saved)
    print 'after:', model.get()
p_SonarControlMessage.setParseAction(lambda x: messaging.SonarControlMessage(*x[0]))
p_GeminiControlMessage = pp.Group(l \
    + p_float + c \
    + p_float + c \
    + p_int + c \
    + p_bool + c \
    + p_float \
    + r).streamline()
p_GeminiControlMessage.setParseAction(lambda x: messaging.GeminiControlMessage(*x[0]))
p_AddNodeMessage = pp.Group(l \
    + p_str + c \
    + p_NodeType + c \
    + p_NodeInputArcVec + c \
    + p_NodeOutputArcVec \
    + r).streamline()
p_AddNodeMessage.setParseAction(lambda x: messaging.AddNodeMessage(*x[0]))
p_RemoveNodeMessage = pp.Group(l \
    + p_str + c \
    + p_int \
    + r).streamline()
p_RemoveNodeMessage.setParseAction(lambda x: messaging.RemoveNodeMessage(*x[0]))
p_ClearPipelineMessage = pp.Group(l \
    + p_str \
    + r).streamline()
p_ClearPipelineMessage.setParseAction(lambda x: messaging.ClearPipelineMessage(*x[0]))
p_SetNodeParameterMessage = pp.Group(l \
    + p_str + c \
    + p_int + c \
    + p_str + c \
    + p_ParamValue \
    + r).streamline()
예제 #3
0
    print "created debug message:", msg

    for i in xrange(1, 11):
        try:
            print "setting message string"
            msg.msg = "msg string %d" % i
            print "Sending message", i, msg
            n.send(msg, "test")
            #print n.mailbox.receive(1000)
        except Exception, e:
            print e

    time.sleep(3)
    n.send(messaging.ClearPipelineMessage("default"), "pipeline")
    n.send(messaging.AddNodeMessage("default",
                                    messaging.NodeType.FileInput,
                                    messaging.NodeInputArcVec(),
                                    messaging.NodeOutputArcVec()), "pipeline")
    n.send(messaging.AddNodeMessage("default",
                                    messaging.NodeType.GuiOutput,
                                    messaging.NodeInputArcVec(),
                                    messaging.NodeOutputArcVec()), "pipeline")

    print "deleting dmo", dmo
    del dmo
    print "deleting o", o
    del o
    print "deleting m", m
    del m
    print "deleting msg", msg
    del msg
    print "deleting n", n