mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge remote-tracking branch 'origin/master' into python
This commit is contained in:
commit
3a5ac53698
@ -710,7 +710,6 @@
|
|||||||
"edt_dev_spec_port_expl": "Service Port [1-65535]",
|
"edt_dev_spec_port_expl": "Service Port [1-65535]",
|
||||||
"edt_dev_spec_port_title": "Port",
|
"edt_dev_spec_port_title": "Port",
|
||||||
"edt_dev_spec_printTimeStamp_title": "Add timestamp",
|
"edt_dev_spec_printTimeStamp_title": "Add timestamp",
|
||||||
"edt_dev_spec_skydimo_mode_title": "Skydimo Mode",
|
|
||||||
"edt_dev_spec_stream_protocol_title": "Streaming protocol",
|
"edt_dev_spec_stream_protocol_title": "Streaming protocol",
|
||||||
"edt_dev_spec_pwmChannel_title": "PWM channel",
|
"edt_dev_spec_pwmChannel_title": "PWM channel",
|
||||||
"edt_dev_spec_razer_device_title": "Razer Chroma Device",
|
"edt_dev_spec_razer_device_title": "Razer Chroma Device",
|
||||||
|
@ -23,7 +23,7 @@ var devFTDI = ['apa102_ftdi', 'sk6812_ftdi', 'ws2812_ftdi'];
|
|||||||
var devRPiPWM = ['ws281x'];
|
var devRPiPWM = ['ws281x'];
|
||||||
var devRPiGPIO = ['piblaster'];
|
var devRPiGPIO = ['piblaster'];
|
||||||
var devNET = ['atmoorb', 'cololight', 'fadecandy', 'homeassistant', 'philipshue', 'nanoleaf', 'razer', 'tinkerforge', 'tpm2net', 'udpe131', 'udpartnet', 'udpddp', 'udph801', 'udpraw', 'wled', 'yeelight'];
|
var devNET = ['atmoorb', 'cololight', 'fadecandy', 'homeassistant', 'philipshue', 'nanoleaf', 'razer', 'tinkerforge', 'tpm2net', 'udpe131', 'udpartnet', 'udpddp', 'udph801', 'udpraw', 'wled', 'yeelight'];
|
||||||
var devSerial = ['adalight', 'dmx', 'atmo', 'sedu', 'tpm2', 'karate'];
|
var devSerial = ['adalight', 'dmx', 'atmo', 'sedu', 'skydimo', 'tpm2', 'karate'];
|
||||||
var devHID = ['hyperionusbasp', 'lightpack', 'paintpack', 'rawhid'];
|
var devHID = ['hyperionusbasp', 'lightpack', 'paintpack', 'rawhid'];
|
||||||
|
|
||||||
var infoTextDefault = '<span>' + $.i18n("conf_leds_device_info_log") + ' </span><a href="" onclick="SwitchToMenuItem(\'MenuItemLogging\')" style="cursor:pointer">' + $.i18n("main_menu_logging_token") + '</a>';
|
var infoTextDefault = '<span>' + $.i18n("conf_leds_device_info_log") + ' </span><a href="" onclick="SwitchToMenuItem(\'MenuItemLogging\')" style="cursor:pointer">' + $.i18n("main_menu_logging_token") + '</a>';
|
||||||
@ -1122,6 +1122,7 @@ $(document).ready(function () {
|
|||||||
case "dmx":
|
case "dmx":
|
||||||
case "karate":
|
case "karate":
|
||||||
case "sedu":
|
case "sedu":
|
||||||
|
case "skydimo":
|
||||||
case "tpm2":
|
case "tpm2":
|
||||||
|
|
||||||
//FTDI devices
|
//FTDI devices
|
||||||
@ -1231,6 +1232,7 @@ $(document).ready(function () {
|
|||||||
case "karate":
|
case "karate":
|
||||||
case "dmx":
|
case "dmx":
|
||||||
case "sedu":
|
case "sedu":
|
||||||
|
case "skydimo":
|
||||||
case "tpm2": {
|
case "tpm2": {
|
||||||
let currentDeviceType = window.serverConfig.device.type;
|
let currentDeviceType = window.serverConfig.device.type;
|
||||||
if ($.inArray(currentDeviceType, devSerial) === -1) {
|
if ($.inArray(currentDeviceType, devSerial) === -1) {
|
||||||
@ -1462,6 +1464,7 @@ $(document).ready(function () {
|
|||||||
case "adalight":
|
case "adalight":
|
||||||
case "dmx":
|
case "dmx":
|
||||||
case "sedu":
|
case "sedu":
|
||||||
|
case "skydimo":
|
||||||
case "tpm2":
|
case "tpm2":
|
||||||
case "apa102":
|
case "apa102":
|
||||||
case "apa104":
|
case "apa104":
|
||||||
@ -1801,6 +1804,7 @@ $(document).ready(function () {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "adalight":
|
case "adalight":
|
||||||
|
case "skydimo":
|
||||||
var currentLedCount = conf_editor.getEditor("root.generalOptions.hardwareLedCount").getValue();
|
var currentLedCount = conf_editor.getEditor("root.generalOptions.hardwareLedCount").getValue();
|
||||||
params = Object.assign(conf_editor.getEditor("root.generalOptions").getValue(),
|
params = Object.assign(conf_editor.getEditor("root.generalOptions").getValue(),
|
||||||
conf_editor.getEditor("root.specificOptions").getValue(),
|
conf_editor.getEditor("root.specificOptions").getValue(),
|
||||||
@ -1942,6 +1946,7 @@ function saveLedConfig(genDefLayout = false) {
|
|||||||
case "dmx":
|
case "dmx":
|
||||||
case "karate":
|
case "karate":
|
||||||
case "sedu":
|
case "sedu":
|
||||||
|
case "skydimo":
|
||||||
case "tpm2":
|
case "tpm2":
|
||||||
case "apa102":
|
case "apa102":
|
||||||
case "apa104":
|
case "apa104":
|
||||||
@ -1976,7 +1981,7 @@ function saveLedConfig(genDefLayout = false) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Rewrite whole LED & Layout configuration, in case changes were done accross tabs and no default layout
|
//Rewrite whole LED & Layout configuration, in case changes were done across tabs and no default layout
|
||||||
if (genDefLayout !== true) {
|
if (genDefLayout !== true) {
|
||||||
result.ledConfig = getLedConfig();
|
result.ledConfig = getLedConfig();
|
||||||
result.leds = JSON.parse(aceEdt.getText());
|
result.leds = JSON.parse(aceEdt.getText());
|
||||||
@ -2105,6 +2110,7 @@ var updateOutputSelectList = function (ledType, discoveryInfo) {
|
|||||||
case "dmx":
|
case "dmx":
|
||||||
case "karate":
|
case "karate":
|
||||||
case "sedu":
|
case "sedu":
|
||||||
|
case "skydimo":
|
||||||
case "tpm2":
|
case "tpm2":
|
||||||
for (const device of discoveryInfo.devices) {
|
for (const device of discoveryInfo.devices) {
|
||||||
if (device.udev) {
|
if (device.udev) {
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
"rewriteTime": {
|
"rewriteTime": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"enum": [ "file", "apa102", "apa104", "ws2801", "lpd6803", "lpd8806", "p9813", "sk6812spi", "sk6822spi", "sk9822", "ws2812spi", "ws281x", "piblaster", "adalight", "dmx", "atmo", "hyperionusbasp", "lightpack", "multilightpack", "paintpack", "rawhid", "sedu", "tpm2", "karate" ]
|
"enum": [ "file", "apa102", "apa104", "ws2801", "lpd6803", "lpd8806", "p9813", "sk6812spi", "sk6822spi", "sk9822", "ws2812spi", "ws281x", "piblaster", "adalight", "dmx", "atmo", "hyperionusbasp", "lightpack", "multilightpack", "paintpack", "rawhid", "sedu", "tpm2", "karate", "skydimo" ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": true
|
"additionalProperties": true
|
||||||
|
@ -42,5 +42,6 @@
|
|||||||
<file alias="schema-ws2812_ftdi">schemas/schema-ws2812_ftdi.json</file>
|
<file alias="schema-ws2812_ftdi">schemas/schema-ws2812_ftdi.json</file>
|
||||||
<file alias="schema-apa102_ftdi">schemas/schema-apa102_ftdi.json</file>
|
<file alias="schema-apa102_ftdi">schemas/schema-apa102_ftdi.json</file>
|
||||||
<file alias="schema-sk6812_ftdi">schemas/schema-sk6812_ftdi.json</file>
|
<file alias="schema-sk6812_ftdi">schemas/schema-sk6812_ftdi.json</file>
|
||||||
|
<file alias="schema-skydimo">schemas/schema-skydimo.json</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -59,10 +59,6 @@ bool LedDeviceAdalight::init(const QJsonObject &deviceConfig)
|
|||||||
Debug( _log, "Adalight driver uses standard Adalight protocol");
|
Debug( _log, "Adalight driver uses standard Adalight protocol");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Adalight::SKYDIMO:
|
|
||||||
Debug( _log, "Adalight driver uses Skydimo protocol");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Error( _log, "Adalight driver - unsupported protocol");
|
Error( _log, "Adalight driver - unsupported protocol");
|
||||||
return false;
|
return false;
|
||||||
@ -92,18 +88,6 @@ void LedDeviceAdalight::prepareHeader()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Adalight::SKYDIMO:
|
|
||||||
{
|
|
||||||
_bufferLength = static_cast<qint64>(HEADER_SIZE + _ledRGBCount);
|
|
||||||
_ledBuffer.resize(static_cast<size_t>(_bufferLength), 0x00);
|
|
||||||
_ledBuffer[0] = 'A';
|
|
||||||
_ledBuffer[1] = 'd';
|
|
||||||
_ledBuffer[2] = 'a';
|
|
||||||
_ledBuffer[3] = 0;
|
|
||||||
_ledBuffer[4] = 0;
|
|
||||||
_ledBuffer[5] = static_cast<quint8>(_ledCount);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Adalight::AWA:
|
case Adalight::AWA:
|
||||||
{
|
{
|
||||||
_bufferLength = static_cast<qint64>(HEADER_SIZE + _ledRGBCount + 8);
|
_bufferLength = static_cast<qint64>(HEADER_SIZE + _ledRGBCount + 8);
|
||||||
|
@ -10,8 +10,7 @@ typedef enum ProtocolType
|
|||||||
{
|
{
|
||||||
ADA = 0,
|
ADA = 0,
|
||||||
LBAPA,
|
LBAPA,
|
||||||
AWA,
|
AWA
|
||||||
SKYDIMO
|
|
||||||
} PROTOCOLTYPE;
|
} PROTOCOLTYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
72
libsrc/leddevice/dev_serial/LedDeviceSkydimo.cpp
Normal file
72
libsrc/leddevice/dev_serial/LedDeviceSkydimo.cpp
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
#include "LedDeviceSkydimo.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
|
#include <QtEndian>
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
constexpr int HEADER_SIZE {6};
|
||||||
|
|
||||||
|
} //End of constants
|
||||||
|
|
||||||
|
LedDeviceSkydimo::LedDeviceSkydimo(const QJsonObject &deviceConfig)
|
||||||
|
: ProviderRs232(deviceConfig)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
LedDevice* LedDeviceSkydimo::construct(const QJsonObject &deviceConfig)
|
||||||
|
{
|
||||||
|
return new LedDeviceSkydimo(deviceConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LedDeviceSkydimo::init(const QJsonObject &deviceConfig)
|
||||||
|
{
|
||||||
|
bool isInitOK = false;
|
||||||
|
|
||||||
|
// Initialise sub-class
|
||||||
|
if ( ProviderRs232::init(deviceConfig) )
|
||||||
|
{
|
||||||
|
prepareHeader();
|
||||||
|
isInitOK = true;
|
||||||
|
}
|
||||||
|
return isInitOK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LedDeviceSkydimo::prepareHeader()
|
||||||
|
{
|
||||||
|
_bufferLength = static_cast<qint64>(HEADER_SIZE + _ledRGBCount);
|
||||||
|
_ledBuffer.resize(static_cast<size_t>(_bufferLength), 0x00);
|
||||||
|
_ledBuffer[0] = 'A';
|
||||||
|
_ledBuffer[1] = 'd';
|
||||||
|
_ledBuffer[2] = 'a';
|
||||||
|
_ledBuffer[3] = 0;
|
||||||
|
_ledBuffer[4] = 0;
|
||||||
|
_ledBuffer[5] = static_cast<quint8>(_ledCount);
|
||||||
|
|
||||||
|
Debug( _log, "Skydimo header for %d leds (size: %d): %c%c%c 0x%02x 0x%02x 0x%02x", _ledCount, _ledBuffer.size(),
|
||||||
|
_ledBuffer[0], _ledBuffer[1], _ledBuffer[2], _ledBuffer[3], _ledBuffer[4], _ledBuffer[5] );
|
||||||
|
}
|
||||||
|
|
||||||
|
int LedDeviceSkydimo::write(const std::vector<ColorRgb> & ledValues)
|
||||||
|
{
|
||||||
|
if (_ledCount != ledValues.size())
|
||||||
|
{
|
||||||
|
Warning(_log, "Skydimo LED count has changed (old: %d, new: %d). Rebuilding header.", _ledCount, ledValues.size());
|
||||||
|
_ledCount = static_cast<uint>(ledValues.size());
|
||||||
|
_ledRGBCount = _ledCount * 3;
|
||||||
|
prepareHeader();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_bufferLength > static_cast<qint64>(_ledBuffer.size()))
|
||||||
|
{
|
||||||
|
Warning(_log, "Skydimo buffer's size has changed. Skipping refresh.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(HEADER_SIZE + ledValues.size() * sizeof(ColorRgb) <= _ledBuffer.size());
|
||||||
|
|
||||||
|
memcpy(HEADER_SIZE + _ledBuffer.data(), ledValues.data(), ledValues.size() * sizeof(ColorRgb));
|
||||||
|
|
||||||
|
return writeBytes(_bufferLength, _ledBuffer.data());
|
||||||
|
}
|
56
libsrc/leddevice/dev_serial/LedDeviceSkydimo.h
Normal file
56
libsrc/leddevice/dev_serial/LedDeviceSkydimo.h
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#ifndef LEDEVICESKYDIMO_H
|
||||||
|
#define LEDEVICESKYDIMO_H
|
||||||
|
|
||||||
|
// hyperion includes
|
||||||
|
#include "ProviderRs232.h"
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Implementation of the LedDevice interface for writing to a Skydimo LED-device.
|
||||||
|
///
|
||||||
|
class LedDeviceSkydimo : public ProviderRs232
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
///
|
||||||
|
/// @brief Constructs a Skydimo LED-device
|
||||||
|
///
|
||||||
|
/// @param deviceConfig Device's configuration as JSON-Object
|
||||||
|
///
|
||||||
|
explicit LedDeviceSkydimo(const QJsonObject &deviceConfig);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// @brief Constructs the LED-device
|
||||||
|
///
|
||||||
|
/// @param[in] deviceConfig Device's configuration as JSON-Object
|
||||||
|
/// @return LedDevice constructed
|
||||||
|
static LedDevice* construct(const QJsonObject &deviceConfig);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
///
|
||||||
|
/// @brief Initialise the device's configuration
|
||||||
|
///
|
||||||
|
/// @param[in] deviceConfig the JSON device configuration
|
||||||
|
/// @return True, if success
|
||||||
|
///
|
||||||
|
bool init(const QJsonObject &deviceConfig) override;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// @brief Prepare the protocol's header
|
||||||
|
///
|
||||||
|
void prepareHeader();
|
||||||
|
|
||||||
|
///
|
||||||
|
/// @brief Writes the RGB-Color values to the LEDs.
|
||||||
|
///
|
||||||
|
/// @param[in] ledValues The RGB-color per LED
|
||||||
|
/// @return Zero on success, else negative
|
||||||
|
///
|
||||||
|
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||||
|
|
||||||
|
qint64 _bufferLength;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // LEDEVICESKYDIMO_H
|
@ -11,10 +11,10 @@
|
|||||||
"streamProtocol": {
|
"streamProtocol": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_dev_spec_stream_protocol_title",
|
"title": "edt_dev_spec_stream_protocol_title",
|
||||||
"enum": [ "0", "1", "2", "3" ],
|
"enum": [ "0", "1", "2" ],
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"options": {
|
"options": {
|
||||||
"enum_titles": [ "edt_dev_spec_ada_mode_title", "edt_dev_spec_LBap102Mode_title","edt_dev_spec_awa_mode_title", "edt_dev_spec_skydimo_mode_title" ]
|
"enum_titles": [ "edt_dev_spec_ada_mode_title", "edt_dev_spec_LBap102Mode_title","edt_dev_spec_awa_mode_title"]
|
||||||
},
|
},
|
||||||
"propertyOrder": 2
|
"propertyOrder": 2
|
||||||
},
|
},
|
||||||
|
61
libsrc/leddevice/schemas/schema-skydimo.json
Normal file
61
libsrc/leddevice/schemas/schema-skydimo.json
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"type":"object",
|
||||||
|
"required":true,
|
||||||
|
"properties":{
|
||||||
|
"output": {
|
||||||
|
"type": "string",
|
||||||
|
"title":"edt_dev_spec_outputPath_title",
|
||||||
|
"default":"auto",
|
||||||
|
"propertyOrder" : 1
|
||||||
|
},
|
||||||
|
"rateList": {
|
||||||
|
"type": "string",
|
||||||
|
"title":"edt_dev_spec_baudrate_title",
|
||||||
|
"enum": [ "CUSTOM","9600","14400","19200","28800","33600","38400","56000","57600","76800","115200","128000","153600","230400","256000","307200","460800","921600","1000000","1500000","2000000","3000000","4000000" ],
|
||||||
|
"options": {
|
||||||
|
"enum_titles": [ "edt_conf_enum_custom" ]
|
||||||
|
},
|
||||||
|
"default": "115200",
|
||||||
|
"access": "advanced",
|
||||||
|
"propertyOrder" : 3
|
||||||
|
},
|
||||||
|
"rate": {
|
||||||
|
"type": "integer",
|
||||||
|
"title":"",
|
||||||
|
"default": 115200,
|
||||||
|
"access": "advanced",
|
||||||
|
"propertyOrder" : 4
|
||||||
|
},
|
||||||
|
"delayAfterConnect": {
|
||||||
|
"type": "integer",
|
||||||
|
"title":"edt_dev_spec_delayAfterConnect_title",
|
||||||
|
"default": 0,
|
||||||
|
"append" : "ms",
|
||||||
|
"access" : "expert",
|
||||||
|
"propertyOrder" : 5
|
||||||
|
},
|
||||||
|
"latchTime": {
|
||||||
|
"type": "integer",
|
||||||
|
"title": "edt_dev_spec_latchtime_title",
|
||||||
|
"default": 30,
|
||||||
|
"append": "edt_append_ms",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 1000,
|
||||||
|
"access": "expert",
|
||||||
|
"options": {
|
||||||
|
"infoText": "edt_dev_spec_latchtime_title_info"
|
||||||
|
},
|
||||||
|
"propertyOrder": 6
|
||||||
|
},
|
||||||
|
"rewriteTime": {
|
||||||
|
"type": "integer",
|
||||||
|
"title":"edt_dev_general_rewriteTime_title",
|
||||||
|
"default": 1000,
|
||||||
|
"append" : "edt_append_ms",
|
||||||
|
"minimum": 0,
|
||||||
|
"access" : "expert",
|
||||||
|
"propertyOrder" : 7
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": true
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user