Remove max LED number constraint from Matrix layout (#1805)

This commit is contained in:
LordGrey
2024-12-09 06:21:53 +01:00
committed by GitHub
parent e8e102c25d
commit 179ee316d0
28 changed files with 231 additions and 76 deletions

View File

@@ -13,7 +13,13 @@
// python utils
#include <python/PythonProgram.h>
Effect::Effect(Hyperion* hyperion, int priority, int timeout, const QString& script, const QString& name, const QJsonObject& args, const QString& imageData)
// Constants
namespace {
int DEFAULT_MAX_UPDATE_RATE_HZ { 200 };
} //End of constants
Effect::Effect(Hyperion *hyperion, int priority, int timeout, const QString &script, const QString &name, const QJsonObject &args, const QString &imageData)
: QThread()
, _hyperion(hyperion)
, _priority(priority)
@@ -26,7 +32,8 @@ Effect::Effect(Hyperion* hyperion, int priority, int timeout, const QString& scr
, _endTime(-1)
, _interupt(false)
, _imageSize(hyperion->getLedGridSize())
, _image(_imageSize, QImage::Format_ARGB32_Premultiplied)
, _image(_imageSize,QImage::Format_ARGB32_Premultiplied)
, _lowestUpdateIntervalInSeconds(1/static_cast<double>(DEFAULT_MAX_UPDATE_RATE_HZ))
{
_colors.resize(_hyperion->getLedCount());
_colors.fill(ColorRgb::BLACK);

View File

@@ -184,6 +184,7 @@ PyMethodDef EffectModule::effectMethods[] = {
{"imageCOffset" , EffectModule::wrapImageCOffset , METH_VARARGS, "Add offset to the coordinate system"},
{"imageCShear" , EffectModule::wrapImageCShear , METH_VARARGS, "Shear of coordinate system by the given horizontal/vertical axis"},
{"imageResetT" , EffectModule::wrapImageResetT , METH_NOARGS, "Resets all coords modifications (rotate,offset,shear)"},
{"lowestUpdateInterval" , EffectModule::wrapLowestUpdateInterval , METH_NOARGS, "Gets the lowest permissible interval time in seconds"},
{NULL, NULL, 0, NULL}
};
@@ -1106,3 +1107,10 @@ PyObject* EffectModule::wrapImageResetT(PyObject* self, PyObject* args)
getEffect()->_painter->resetTransform();
Py_RETURN_NONE;
}
PyObject* EffectModule::wrapLowestUpdateInterval(PyObject* self, PyObject* args)
{
qDebug() << "_lowestUpdateIntervalInSeconds: " << getEffect()->_lowestUpdateIntervalInSeconds;
return Py_BuildValue("d", getEffect()->_lowestUpdateIntervalInSeconds);
}