Skip to main content

使用 uDMX 控制 DMX 的 Python 3 模块。具有灯具配置文件、内置效果和网络控制面板。

项目描述

PyDMX 控制

使用 uDMX 控制 DMX 的 Python 3 模块 - 具有灯具配置文件、内置效果和 Web 控制面板。

派皮版本 执照 Python 版本 代码大小 帕特伦 松弛

审查员代码质量 构建状态 Codacy 代码质量

PyDMXControl 图标

安装

通过 pip 安装(推荐)

pip install -U PyDMXControl

通过带有音频支持的pip 安装

pip install -U PyDMXControl[audio]

通过 GitHub 安装(开发版,带音频)

pip install -U git+https://github.com/MattIPv4/PyDMXControl#egg=PyDMXControl[audio]

特征

  • 每个制造商的夹具配置文件(查看所有包含的配置文件

    • 包括通用调光装置,单通道
    • 内置虚拟调光器的 RGB(3 通道)灯具
  • 效果模块/库支持(查看所有打包效果

    • 提供强度暗光追逐,提供可配置的速度和偏移
    • 包括夹具颜色追逐效果,支持无限数量的颜色
    • 效果可以应用于单个灯具或多个作为一个组
    • 演示:tests/effects.py
  • uDMX 开箱即用

    • 在 uDMX 系统上开发和广泛测试的软件包
  • 内部代码支持 CUSTOM 回调

    • 使用回调代码在特定时间自行执行操作
  • 线程允许连续运行

    • 在 PyDMXControl 继续输出数据的同时运行您自己的阻塞脚本
  • WEBSITE 控制面板内置

    • 通过滑块进行全局和单独的灯具强度控制
    • 快速访问全局和每个夹具的回调函数
    • 用于单个灯具的颜色选择器以及特定的通道控制
    • 演示:测试/web.py
  • JSON 夹具配置

    • 将 JSON 文件中的夹具配置加载到控制器中
    • 将您当前的一组固定装置保存到 JSON 文件中以供以后使用
    • 演示:测试/json_config.py
  • 支持可选的音频播放

    • 在 PyDMXControl 继续运行照明控制的同时播放音轨
    • 使用 pygame 获得最佳跨平台和音频格式支持
    • 演示:测试/audio.py

示例用法

一个如何让单个调光器与 PyDMXControl 一起工作的示例,一旦启动就提供 Web 控制面板和控制台调试系统。

# Import the uDMX controller from PyDMXControl,
#  this will be how the data is outputted.
from PyDMXControl.controllers import uDMXController

# Import the fixture profile we will use,
#  the simple Dimmer in this example.
from PyDMXControl.profiles.Generic import Dimmer

# Create an instance of the uDMX controller, 
#  this holds all the fixture information and outputs it.
# This will start outputting data immediately.
dmx = uDMXController()

# Add a new Dimmer fixture to our controller
#  and save it to a variable so we can access it.
# We give it a name so it's easier to identify in the debug control options.
fixture = dmx.add_fixture(Dimmer, name="My_First_Dimmer")

# Next, dim the intensity of the fixture from it's initial value of zero
#  to full, which is represented as 255 in DMX.
# This is done over 5000 milliseconds, or 5 seconds.
fixture.dim(255, 5000)

# We can now start the web control panel built into PyDMXControl.
# This will output the web address in console, but should be http://0.0.0.0:8080
# This runs in the background and so we can continue to do other things still.
dmx.web_control()

# The console debug mode can also be started if required,
#  this provides basic control options in the console of the program.
# This is blocking however and so the script will not continue past here until
#  the debug control is exited. This won't stop DMX output.
dmx.debug_control()

# Once the console debug mode is exited the script will continue, to stop it
#  exiting and stopping DMX output when can use a built-in sleep function.
# This sleep function will wait until enter is pressed in the console before continuing.
dmx.sleep_till_enter()

# With everything done, you can terminate the DMX output and the program by calling
#  the close method of the controller.
# This will cleanly close any threads in use and stop DMX output.
dmx.close()

对于“现实生活”的示例,请查看我在办公室使用的设置tests/home.py 。

测试文件夹中浏览测试以查看库中正在测试的其他功能的示例。

这有什么意义?

只是在使用 Python 来控制/发送 DMX。
支持夹具分析;具有标准灯具和需要虚拟调光器的灯具的默认值。
通用灯具的预置配置文件(单调光器、RGB LED、自定义(设置您自己的通道数))。

有一个调试外壳,允许控制夹具通道值和访问一般回调。此外,还提供了一个高级 Web 控制面板,可以访问全局回调、灯具助手、灯具颜色和对单个灯具通道的控制。

目前仅支持通过 uDMX 进行实际输出。
还包括一个打印控制器,它可以将 DMX 帧以相同的速度打印到控制台,并将它们输出到数据线(这可能会导致其他打印的问题)。

如果有人想给我买一个 Enttec USB DMX Pro,那么我也会试着让它和它一起工作。

感谢 pyudmx 的作者 Dave Hocker 在pyudmx上所做的工作,并通过电子邮件提供了解决使该库与 uDMX 一起运行的一些问题的建议。

贡献

随时欢迎为这个项目做出贡献!
查看此存储库中的任何现有问题,以帮助您为项目做出贡献,或者简单地为项目创建自己的新贡献。

请确保遵循项目中的现有标准,例如代码样式、命名约定和注释/文档。

当你准备好后,只需为你的贡献创建一个拉取请求,我会尽可能地审查它!

捐赠

您还可以通过在 PayPal 上捐款或每月在我的 Patreon 页面上支持我来帮助我和该项目。

帕特伦 贝宝

讨论、支持和问题

需要此项目的支持,发现问题或想与其他人讨论为该项目做出贡献?

请首先检查项目的问题页面以获取支持和错误!

在这里没有找到您需要的东西?

  • 如果您有问题,请在此处创建 GitHub 问题以报告情况,并尽可能详细地提供!
  • 或者,您可以加入我们的 Slack 工作区讨论任何问题、获得项目支持或与贡献者和我自己聊天:
松弛

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

PyDMXControl-1.6.3.tar.gz (113.8 kB 查看哈希

已上传 source

内置发行版

PyDMXControl-1.6.3-py3.6.egg (126.6 kB 查看哈希

已上传 3 6

PyDMXControl-1.6.3-py3-none-any.whl (128.7 kB 查看哈希

已上传 py3