Ejemplo n.º 1
0
def init_lumiverse(rig_path=DEFAULT_RIG_PATH, dummy=False):
    global rig
    if dummy:
        rig = DummyRig()
    else:
        rig = L.Rig(rig_path)
    rig.init()
    rig.run()
    init_game()

    return rig
Ejemplo n.º 2
0
 def __init__(self):
     '''Initialize the Pausch Bridge.'''
     try:
         import lumiversepython as L
     except:
         raise ImportError('Couldn\'t import lumiversepython: ' +
                           'Are you running on pbridge.adm.cs.cmu.edu?')
     self.rig = L.Rig("/home/teacher/Lumiverse/PBridge.rig.json")
     self.rig.init()
     # Cache the panel objects into an array for speedy lookup.
     # Gates side has sequence 1.
     self.top_panels = [
         self.rig.select("$side=top[$sequence={0}]".format(i))
         for i in xrange(Bridge.START_SEQ, Bridge.END_SEQ + 1)
     ]
     self.bottom_panels = [
         self.rig.select("$side=bot[$sequence={0}]".format(i))
         for i in xrange(Bridge.START_SEQ, Bridge.END_SEQ + 1)
     ]
     [panel.setRGBRaw(0, 0, 0) for panel in self.top_panels]
     [panel.setRGBRaw(0, 0, 0) for panel in self.bottom_panels]
Ejemplo n.º 3
0
def init(upload=True, run=True, wipe=True, fire=True):
    rig = L.Rig("/home/teacher/Lumiverse/PBridge.rig.json")
    rig.init()

    # Upload the blank template
    if (upload):
        blank()

    # Run if requested
    if (run):
        rig.run()

    # Wipe if requested
    if (wipe):
        for seq in xrange(SEQ_LIM):
            query(rig, '$sequence=%d' % seq).setRGBRaw(0, 0, 0)

    # Heat up the cache
    if (fire and not wipe):
        fireplace(rig)

    return rig
Ejemplo n.º 4
0
Archivo: goThru.py Proyecto: lixf/psort
## Summer 2014
## Make a white panel go thru the bridge to test
## actual response performance -- python
#################################################################

## set up
import lumiversepython as l
import os
import time

## just get json path as environment var
json = os.environ.get('JSON')
if json == 'None':
    print "Cannot see JSON file, going to use default"

lights = l.Rig(json)
lights.init()
lights.run()

## number of channels on the bridge
num_lights = 57

## rate is frames/sec or packets sent/sec
rate = 60

while True:
    ## ask for rate
    rate = input("rate of change (frames/sec) : ")

    ## error checking
    while rate < 0 or rate > 60:
Ejemplo n.º 5
0
import lumiversepython as L
import time

rig = L.Rig("/home/teacher/Lumiverse/PBridge.rig.json")
rig.init()
rig.run()

count = 0
flag  = 1
judge = "$panel=0"
while (1):
    #devices = rig.getAllDevices()
    #devices = rig.getIds()
    #rig.select("$side=top").setRGBRaw(0,1,0)
    #rig.select("$side=bot").setRGBRaw(1,0,0)
    if flag==1:
        rig.select(judge).setRGBRaw(0,0,0)
        print(count)
        judge = "$panel="+str(count)
        rig.select(judge).setRGBRaw(1,0,0)
        rig.select(judge).setIntensity(0.01)
        count += 1
        if (count==56):
	        flag = 0
    elif (flag==0):
        rig.select(judge).setRGBRaw(0,0,0)
        print(count)
        count -= 1
        judge = "$panel="+str(count)
        rig.select(judge).setRGBRaw(0,1,0)
        rig.select(judge).setIntensity(count*10)
Ejemplo n.º 6
0
from socketIO_client import SocketIO
import lumiversepython
import json

rig = lumiversepython.Rig("../../../data/noDevices.json")
rig.init();
patch = rig.getPatchAsDMXPatch("DMX1")

def on_rcvDMX(*args):
	patch.setRawData(args[0]["universe"], args[0]["data"])

socketIO = SocketIO('localhost', 80)
socketIO.on('rcvDMX', on_rcvDMX)
socketIO.wait()