当前位置: 首页>>代码示例>>Python>>正文


Python Output.factory方法代码示例

本文整理汇总了Python中output.Output.factory方法的典型用法代码示例。如果您正苦于以下问题:Python Output.factory方法的具体用法?Python Output.factory怎么用?Python Output.factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在output.Output的用法示例。


在下文中一共展示了Output.factory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SubMaster

# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import factory [as 别名]
import sys
sys.path.append('../vendors/usbdmx/')

from control import ControlServer, Controllable
from universe import Universe
from output import Output
from fixture import FixtureManager, RGBFixture, StairvillePAR
from module import SubMaster
from filter import AlphaFilter
from show import ShowManager

if __name__ == '__main__':
    subMaster = SubMaster(['red', 'green', 'blue'], 3)
    universe = Universe()
    output = Output.factory('WS2801Output', channels=150)
    output.addFilter(AlphaFilter())
    universe.setOutput(output)
    for i in range(50):
        fixture = RGBFixture(channelSequence='RGB')
        fixture.mapToUniverse(universe, i * 3)
        fixture.addTags(['ws2801', 'pixel'])

    universe = Universe()
    universe.setOutput(Output.factory('DEOutput', '0000000000001337'))
    for i in range(2):
        fixture = StairvillePAR()
        fixture.mapToUniverse(universe, i * 5)
        fixture.addTags(['dmx'])

    for i in reversed(range(2)):
        fixture = RGBFixture(channelSequence='RGB')
开发者ID:jketterl,项目名称:pilight,代码行数:33,代码来源:standalone.py

示例2: Universe

# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import factory [as 别名]
import sys
sys.path.append('../vendors/adafruit/Adafruit_PWM_Servo_Driver/')

from output import Output
from filter import ScalingAlphaFilter
from input import SocketInput
from universe import Universe

if __name__ == '__main__':

    output = Output.factory('AdafruitPWMOutput', address=0x40, bus=1)
    output.addFilter(ScalingAlphaFilter(4095))

    universe = Universe(16)
    universe.setOutput(output)

    input = SocketInput(universe, '192.168.4.2', 'pwm')
开发者ID:jketterl,项目名称:pilight,代码行数:19,代码来源:pwmslave.py

示例3: getattr

# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import factory [as 别名]
            if 'args' in config: args = config['args'][:]
            getattr(self.modules[config['module']], config['method'])(*tuple(args))

if __name__ == '__main__':
    Messenger.addOutput(ConsoleOutput())
    Messenger.addOutput(LCDOutput())
    Messenger.addOutput(Messaging())

    receiver = UDPReceiver()
    receiver.start()

    remoteServer = RemoteServer()
    remoteServer.start()

    universe = Universe()
    output = Output.factory('LPD8806Output', 180)
    output.addFilter(AlphaFilter())
    #output = Output.factory('WebsocketOutput')
    universe.setOutput(output)

    for i in range(60):
        fixture = RGBFixture()
        fixture.mapToUniverse(universe, i * 3)
        fixture.addTags(['lpd8806', 'strip'])
    
    universe = Universe()
    universe.setOutput(Output.factory('SerialOutput', 0, 32))

    for i in range(4):
        fixture = RGBFixture()
        fixture.mapToUniverse(universe, i * 3)
开发者ID:jketterl,项目名称:pilight,代码行数:33,代码来源:main.py

示例4: Universe

# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import factory [as 别名]
import sys
sys.path.append('../vendors/python-artnet/src/')

from output import Output
from filter import ScalingAlphaFilter
from input import SocketInput
from universe import Universe

if __name__ == '__main__':

    output = Output.factory('WS2801Output', channels=150)
    output.addFilter(ScalingAlphaFilter(255))

    universe = Universe(150)
    universe.setOutput(output)

    input = SocketInput(universe, '192.168.4.2', 'ws2801')
开发者ID:jketterl,项目名称:pilight,代码行数:19,代码来源:pixelslave.py


注:本文中的output.Output.factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。