def main(config): controller = dmx.Controller(config.get('base', 'address'), bpm=60) controller.start() def _runner(scriptname): if(scriptname == 'shell'): log.error("Can't create nested shells.") return with controller.autocycle: from artnet import scripts scripts.run(scriptname, config, controller) def _watch(r): def __watch(fixture, clock): c = clock() while(c['running']): yield fixture.getFrame() c = clock() controller.add(__watch(r.groups['all'], controller.get_clock())) default_rig = rig.get_default_rig() local = dict( run = _runner, ctl = controller, rig = default_rig, watch = _watch, blackout = lambda: _runner('all_channels_blackout'), ) try: import readline except ImportError, e: pass
def main(config): controller = dmx.Controller(config.get('base', 'address'), bpm=60) controller.start() def _runner(scriptname): if (scriptname == 'shell'): log.error("Can't create nested shells.") return with controller.autocycle: from artnet import scripts scripts.run(scriptname, config, controller) def _watch(r): def __watch(fixture, clock): c = clock() while (c['running']): yield fixture.getFrame() c = clock() controller.add(__watch(r.groups['all'], controller.get_clock())) default_rig = rig.get_default_rig() local = dict( run=_runner, ctl=controller, rig=default_rig, watch=_watch, blackout=lambda: _runner('all_channels_blackout'), ) try: import readline except ImportError, e: pass
def main(config, controller=None): log.info("Running script %s" % __name__) controller = dmx.Controller(config.get('base', 'address'), bpm=60) controller.start() def _runner(scriptname): if (scriptname == 'shell'): log.error("Can't create nested shells.") return with controller.autocycle: from artnet import scripts scripts.run(scriptname, config, controller) def _watch(r): def __watch(fixture, clock): c = clock() while (c['running']): yield fixture.getFrame() c = clock() controller.add(__watch(r.groups['all'], controller.get_clock())) default_rig = rig.get_default_rig() local = dict( run=_runner, ctl=controller, rig=default_rig, watch=_watch, blackout=lambda: _runner('all_channels_blackout'), ) # try: # import readline # except ImportError, e: # pass # else: # # We don't have to wrap the following import in a 'try', because # # we already know 'readline' was imported successfully. # import rlcompleter # readline.set_completer(rlcompleter.Completer(local).complete) # if(sys.platform == 'darwin'): # readline.parse_and_bind ("bind ^I rl_complete") # else: # readline.parse_and_bind("tab:complete") code.interact(local=local)
def main(config, controller=None): log.info("Running script %s" % __name__) controller = dmx.Controller(config.get('base', 'address'), bpm=60) controller.start() def _runner(scriptname): if(scriptname == 'shell'): log.error("Can't create nested shells.") return with controller.autocycle: from artnet import scripts scripts.run(scriptname, config, controller) def _watch(r): def __watch(fixture, clock): c = clock() while(c['running']): yield fixture.getFrame() c = clock() controller.add(__watch(r.groups['all'], controller.get_clock())) default_rig = rig.get_default_rig() local = dict( run = _runner, ctl = controller, rig = default_rig, watch = _watch, blackout = lambda: _runner('all_channels_blackout'), ) # try: # import readline # except ImportError, e: # pass # else: # # We don't have to wrap the following import in a 'try', because # # we already know 'readline' was imported successfully. # import rlcompleter # readline.set_completer(rlcompleter.Completer(local).complete) # if(sys.platform == 'darwin'): # readline.parse_and_bind ("bind ^I rl_complete") # else: # readline.parse_and_bind("tab:complete") code.interact(local=local)
import time, logging from artnet import dmx, fixtures, rig from artnet.dmx import fades log = logging.getLogger(__name__) # set up test fixtures r = rig.get_default_rig() g = r.groups['all'] def all_red(): """ Create an all-red frame. """ g.setColor('#ff0000') g.setIntensity(255) return g.getFrame() def all_blue(): """ Create an all-blue frame. """ g.setColor('#0000ff') g.setIntensity(255) return g.getFrame() def main(config, controller=None):
import time, logging from artnet import dmx, fixtures, rig log = logging.getLogger(__name__) # set up test fixtures r = rig.get_default_rig() g = r.groups['all'] def all_red(secs=5.0): """ A simple all-red light generator. """ t = time.time() while(True): g.setColor('#0000ff') g.setIntensity(255) yield g.getFrame() if(secs and time.time() - t >= secs): return def single_white_beat_chase(clock, secs=5.0): """ A simple white chase pattern. """ t = time.time() c = clock() while(c['running']): # Reset to white, but blacked out g.setColor('#ffffff')