Changeset - 626a79891061
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 7 years ago 2018-06-08 03:36:13
drewp@bigasterisk.com
support for multiple Udmx outputs, according to usb bus numbeR
Ignore-this: e3b8275e6dfc7edb74fd71fdc0595e4d
2 files changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/collector/output.py
Show inline comments
 
@@ -133,11 +133,11 @@ class Udmx(DmxOutput):
 
                              scales.PmfStat('update'),
 
                              scales.PmfStat('write'),
 
                              scales.IntStat('usbErrors'))
 
    def __init__(self, uri, numChannels):
 
    def __init__(self, uri, bus, numChannels):
 
        DmxOutput.__init__(self, uri, numChannels)
 
        
 
        from light9.io.udmx import Udmx
 
        self.dev = Udmx()
 
        self.dev = Udmx(bus)
 
        self.currentBuffer = ''
 
        self.lastSentBuffer = None
 
        self.lastLog = 0
light9/io/udmx.py
Show inline comments
 
@@ -24,8 +24,14 @@ or https://github.com/markusb/uDMX-linux
 
cmd_SetChannelRange = 0x0002
 

	
 
class Udmx(object):
 
    def __init__(self):
 
        self.dev = usb.core.find(idVendor=0x16c0, idProduct=0x05dc)
 
    def __init__(self, bus):
 
        self.dev = None
 
        for dev in usb.core.find(idVendor=0x16c0, idProduct=0x05dc, find_all=True):
 
            print "udmx device at %r" % dev.bus
 
            if bus is None or bus == dev.bus:
 
                self.dev = dev
 
        if not self.dev:
 
            raise IOError('no matching udmx device found for requested bus %r' % bus)
 
        log.info('found udmx at %r', self.dev)
 
        
 
    def SendDMX(self, buf):
0 comments (0 inline, 0 general)