Be more graceful if DMX isn't available
This commit is contained in:
3
dmx.py
3
dmx.py
@@ -189,7 +189,8 @@ class FixtureOutput:
|
|||||||
def tick(self, dt):
|
def tick(self, dt):
|
||||||
for fixture in self._fixtures:
|
for fixture in self._fixtures:
|
||||||
fixture.tick(dt)
|
fixture.tick(dt)
|
||||||
self._dmx.submit()
|
if self._dmx is not None:
|
||||||
|
self._dmx.submit()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ class MakeSet:
|
|||||||
|
|
||||||
class MakeFixtureTypes:
|
class MakeFixtureTypes:
|
||||||
def __new__(cls, config):
|
def __new__(cls, config):
|
||||||
|
if config is None:
|
||||||
|
config = []
|
||||||
|
|
||||||
def parse_range(src):
|
def parse_range(src):
|
||||||
(a, b) = src.split('-')
|
(a, b) = src.split('-')
|
||||||
@@ -77,6 +79,8 @@ class MakeFixtureTypes:
|
|||||||
class MakeFixtures:
|
class MakeFixtures:
|
||||||
def __new__(cls, config, fixture_types):
|
def __new__(cls, config, fixture_types):
|
||||||
fixtures = {}
|
fixtures = {}
|
||||||
|
if config is None:
|
||||||
|
config = []
|
||||||
for fixture in config:
|
for fixture in config:
|
||||||
dmxch = config[fixture]['dmx']
|
dmxch = config[fixture]['dmx']
|
||||||
type = config[fixture]['type']
|
type = config[fixture]['type']
|
||||||
@@ -88,6 +92,8 @@ class MakeFixtures:
|
|||||||
class MakeGroups:
|
class MakeGroups:
|
||||||
def __new__(cls, config, fixtures):
|
def __new__(cls, config, fixtures):
|
||||||
groups = {}
|
groups = {}
|
||||||
|
if config is None:
|
||||||
|
config = []
|
||||||
for group in config:
|
for group in config:
|
||||||
fobjects = []
|
fobjects = []
|
||||||
for fixture in config[group]:
|
for fixture in config[group]:
|
||||||
@@ -101,6 +107,8 @@ class MakeGroups:
|
|||||||
class MakeScenes:
|
class MakeScenes:
|
||||||
def __new__(cls, config, fixtures, groups):
|
def __new__(cls, config, fixtures, groups):
|
||||||
scenes = {}
|
scenes = {}
|
||||||
|
if config is None:
|
||||||
|
config = []
|
||||||
for scene in config:
|
for scene in config:
|
||||||
objects = {}
|
objects = {}
|
||||||
for name in config[scene].keys():
|
for name in config[scene].keys():
|
||||||
|
|||||||
12
gig.py
12
gig.py
@@ -392,12 +392,12 @@ def main():
|
|||||||
|
|
||||||
audiencecontent = AudienceContent(gigconfig=config, eventrunner=eventrunner)
|
audiencecontent = AudienceContent(gigconfig=config, eventrunner=eventrunner)
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
wrapper = ClientWrapper()
|
wrapper = ClientWrapper()
|
||||||
DMX_DATA_SIZE = DMX_UNIVERSE_SIZE
|
DMX_DATA_SIZE = DMX_UNIVERSE_SIZE
|
||||||
dmx_object = dmx.DMX(args.universe, wrapper, DMX_DATA_SIZE)
|
dmx_object = dmx.DMX(args.universe, wrapper, DMX_DATA_SIZE)
|
||||||
# except Exception:
|
except Exception:
|
||||||
# pass
|
dmx_object = None
|
||||||
|
|
||||||
fixtureoutput = dmx.FixtureOutput(fixtures=[config['fixtures'][x] for x in config['fixtures']], dmx=dmx_object)
|
fixtureoutput = dmx.FixtureOutput(fixtures=[config['fixtures'][x] for x in config['fixtures']], dmx=dmx_object)
|
||||||
pyglet.clock.schedule_interval(fixtureoutput.tick, 1/30.0)
|
pyglet.clock.schedule_interval(fixtureoutput.tick, 1/30.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user