コード例 #1
0
ファイル: KamaeliaKids.py プロジェクト: thangduong/kamaelia
    Backplane("RAWINPUT").activate()
    Backplane("PARSEDINPUT").activate()
    Backplane("DISPLAYCONSOLE").activate()

    Image(
        image="kamaelia_logo.png",
        bgcolour=(255, 255, 255),
        position=(20, 20),
        size=(64, 64),
        maxpect=(64, 64),
    ).activate()

    Pipeline(
        SubscribeTo("RAWINPUT"),
        text_to_tokenlists(),
        Memory(),  # These two can be mutually exclusive at times
        Repeater(
        ),  # Which is interesting. Probably want a TPipe with some interesting control.
        PublishTo("PARSEDINPUT"),
    ).activate()

    Pipeline(
        SubscribeTo("RAWINPUT"),
        PublishTo("DISPLAYCONSOLE"),
    ).activate()

    Pipeline(
        SubscribeTo("PARSEDINPUT"),
        DrawingCanvas(
            background=0xD0D0D0,  # Grey!
コード例 #2
0
            ("CANVAS", "eventsOut"): ("PAINTER", "inbox"),
            ("PALETTE", "outbox"): ("PAINTER", "colour"),
            ("ERASER", "outbox"): ("PAINTER", "erase"),
            ("LOAD", "outbox"): ("CANVAS", "inbox"),
            ("SAVE", "outbox"): ("CANVAS", "inbox"),
            ("PAINTER", "outbox"): ("SPLIT", "inbox"),
            ("SPLIT", "outbox"): ("CANVAS", "inbox"),
            ("self", "inbox"): ("CANVAS", "inbox"),
            ("SPLIT", "outbox2"): ("self", "outbox"),
            ("CANVAS", "outbox"): ("self", "outbox"),
        },
    )

mainsketcher = \
    Graphline( SKETCHER = makeBasicSketcher(width=1024,height=768),
               CONSOLE = Pipeline(ConsoleReader(),text_to_tokenlists(),parseCommands()),

               linkages = { ('self','inbox'):('SKETCHER','inbox'),
                            ('SKETCHER','outbox'):('self','outbox'),
                            ('CONSOLE','outbox'):('SKETCHER','inbox'),
                          }
                 )

# primary whiteboard
Pipeline(subscribeTo("WHITEBOARD"), TagAndFilterWrapper(mainsketcher),
         publishTo("WHITEBOARD")).activate()

if __name__ == "__main__":
    import sys, getopt, re

    rhost, rport, serveport = parseOptions()
コード例 #3
0
ファイル: Whiteboard.py プロジェクト: casibbald/kamaelia
                          ("PAINTER", "outbox")    : ("SPLIT", "inbox"),
                          ("SPLIT", "outbox")      : ("CANVAS", "inbox"),
                          ("SPLIT", "outbox2")     : ("self", "outbox"), # send to network

                          ("self", "inbox")        : ("PREFILTER", "inbox"),
                          ("PREFILTER", "outbox")  : ("CANVAS", "inbox"),
                          ("PREFILTER", "history_event")  : ("HISTORY", "inbox"),
                          ("CANVAS", "outbox")     : ("self", "outbox"),

                          ("CANVAS","surfacechanged") : ("HISTORY", "inbox"),
                          },
                    )

mainsketcher = \
    Graphline( SKETCHER = makeBasicSketcher(width=1024,height=768),
               CONSOLE = pipeline(ConsoleReader(),text_to_tokenlists(),parseCommands()),

               linkages = { ('self','inbox'):('SKETCHER','inbox'),
                            ('SKETCHER','outbox'):('self','outbox'),
                            ('CONSOLE','outbox'):('SKETCHER','inbox'),
                          }
                 )

# primary whiteboard
pipeline( subscribeTo("WHITEBOARD"),
          TagAndFilterWrapper(mainsketcher),
          publishTo("WHITEBOARD")
        ).activate()

if __name__=="__main__":
    import sys, getopt, re
コード例 #4
0
ファイル: CommandConsole.py プロジェクト: thangduong/kamaelia
def CommandConsole():
    return Pipeline(ConsoleReader(),
                 text_to_tokenlists(),
                 parseCommands())
コード例 #5
0
ファイル: KamaeliaKids.py プロジェクト: casibbald/kamaelia
    from Kamaelia.Util.PureTransformer import PureTransformer as Transform

    Backplane("RAWINPUT").activate()
    Backplane("PARSEDINPUT").activate()
    Backplane("DISPLAYCONSOLE").activate()

    Image(image="kamaelia_logo.png",
          bgcolour=(255,255,255),
          position=(20, 20),
          size = (64,64),
          maxpect = (64,64),
          ).activate()

    Pipeline(
        SubscribeTo("RAWINPUT"),
        text_to_tokenlists(),
        Memory(),    # These two can be mutually exclusive at times
        Repeater(),  # Which is interesting. Probably want a TPipe with some interesting control.
        PublishTo("PARSEDINPUT"),
    ).activate()

    Pipeline(
        SubscribeTo("RAWINPUT"),
        PublishTo("DISPLAYCONSOLE"),
    ).activate()

    Pipeline(
        SubscribeTo("PARSEDINPUT"),
        DrawingCanvas(background = 0xD0D0D0, # Grey!
                      surfacesize = (570, 650),
                      surfaceposition=(430,90)),