Пример #1
0
    def __init__(self):
        matrix = OPCMatrix(M_WIDTH, M_HEIGHT, "echo", fliplr=True)
        arts = ImportPlugins("art", ["template.py"], [], None, matrix,
                             config.config)

        if len(arts) == 0:
            matrix.terminate()
            print("Couldn't find any art to execute")
            exit(1)

        self.generator = self._frameGenerator(arts, matrix)
        self.packet = None
Пример #2
0
def initialize():
    global generator

    matrix = OPCMatrix(M_WIDTH, M_HEIGHT, "raw")

    arts = ImportPlugins("art", ["template.py"], [], matrix)
    if len(arts) == 0:
        matrix.terminate()
        print "Couldn't find any art to execute"
        exit(1)

    generator = frameGenerator(arts, matrix)
Пример #3
0
    def __init__(self):
        matrix = OPCMatrix(M_WIDTH, M_HEIGHT, "echo", fliplr=True)
        arts = ImportPlugins("art", ["template.py"], [], None, matrix,
                             config.config)

        if len(arts) == 0:
            matrix.terminate()
            print "Couldn't find any art to execute"
            exit(1)

        self.generator = self._frameGenerator(arts, matrix)
        self.packet = None
Пример #4
0
def initialize():
    global generator

    matrix = OPCMatrix(M_WIDTH, M_HEIGHT, "raw")

    arts = ImportPlugins("art", ["template.py"], [], matrix)
    if len(arts) == 0:
        matrix.terminate()
        print("Couldn't find any art to execute")
        exit(1)

    generator = frameGenerator(arts, matrix)
Пример #5
0
def main():
    global matrix

    parser = argparse.ArgumentParser()
    parser.add_argument("-c",
                        "--count",
                        type=int,
                        help="run for count cycles through all of the art",
                        default=DFLT_CYCLE_COUNT)
    parser.add_argument("-f",
                        "--fliptime",
                        type=int,
                        help="run art for FLIPTIME secs before transitioning",
                        default=DFLT_FLIPTIME_SECS)
    parser.add_argument("-p",
                        "--profile",
                        help="switch on and report profiling detail",
                        action="store_true")
    parser.add_argument("art", help="Optional list of arts", nargs="*")
    args = parser.parse_args()

    if args.profile:
        if args.count:
            prof.on()
        else:
            logging.error("Will not profile without --count being set")

    matrix = OPCMatrix(_v("WIDTH", 16), _v("HEIGHT", 16), _v("DRIVER", "ansi"),
                       _v("ZIGZAG", False), _v("FLIPUP", False),
                       _v("FLIPLR", False))

    progress(0, 10)

    arts = ImportPlugins("art", [], args.art, progress, matrix, config.config)
    if len(arts) == 0:
        matrix.terminate()
        print("Couldn't find any art to execute")
        exit(1)

    run(arts, args)
    matrixDone()

    if args.profile:
        prof.dumptimings()
Пример #6
0
Файл: art.py Проект: ak15199/rop
def main():
    global matrix

    parser = argparse.ArgumentParser()
    parser.add_argument("-c", "--count", type=int,
                        help="run for count cycles through all of the art",
                        default=DFLT_CYCLE_COUNT)
    parser.add_argument("-f", "--fliptime", type=int,
                        help="run art for FLIPTIME secs before transitioning",
                        default=DFLT_FLIPTIME_SECS)
    parser.add_argument("-p", "--profile",
                        help="switch on and report profiling detail",
                        action="store_true")
    parser.add_argument("art", help="Optional list of arts",
                        nargs="*")
    args = parser.parse_args()

    if args.profile:
        if args.count:
            prof.on()
        else:
            logging.error("Will not profile without --count being set")

    matrix = OPCMatrix(
        _v("WIDTH", 16), _v("HEIGHT", 16),
        _v("DRIVER", "ansi"), _v("ZIGZAG", False),
        _v("FLIPUP", False), _v("FLIPLR", False)
        )

    progress(0, 10)

    arts = ImportPlugins("art", [], args.art, progress,
                         matrix, config.config)
    if len(arts) == 0:
        matrix.terminate()
        print("Couldn't find any art to execute")
        exit(1)

    run(arts, args)
    matrixDone()

    if args.profile:
        prof.dumptimings()
Пример #7
0
def main():
    global matrix

    parser = argparse.ArgumentParser()
    parser.add_argument("-c", "--count", type=int,
                        help="run for count cycles through all of the art",
                        default=DFLT_CYCLE_COUNT)
    parser.add_argument("-f", "--fliptime", type=int,
                        help="run art for FLIPTIME secs before transitioning",
                        default=DFLT_FLIPTIME_SECS)
    parser.add_argument("-p", "--profile",
                        help="switch on and report profiling detail",
                        action="store_true")
    parser.add_argument("art", help="Optional list of arts",
                        nargs="*")
    args = parser.parse_args()

    if args.profile:
        prof.on()

    matrix = OPCMatrix(
        _v("WIDTH", 16), _v("HEIGHT", 16),
        _v("ADDRESS", "ansi"), _v("ZIGZAG", False),
        _v("FLIPUP", False), _v("FLIPLR", False)
        )

    arts = ImportPlugins("art", ["template.py"], args.art, matrix)
    if len(arts) == 0:
        matrix.terminate()
        print "Couldn't find any art to execute"
        exit(1)

    run(arts, args)

    matrix.terminate()

    if args.profile:
        prof.dumptimings()