From e15b35a9ebb8a605f497f0dc1f9d50bbf9a53445 Mon Sep 17 00:00:00 2001 From: Ewoud Date: Sun, 17 Mar 2024 15:17:08 +0100 Subject: [PATCH] Add Human Shaped Fixtures, some fixes LedEffects: - Make setting contextRowNr mutual exclusive (WIP) - Ripples switch x and y LedFixture - mirroring on all 2D and 3D effect projections LedModFixtureGen: Add Human fixture (WIP) SysModFiles: set ArduinoJson NestingLimit to 20 --- data/model.json | 1836 ++++++++++++++++++++---------------- src/App/LedEffects.h | 12 +- src/App/LedFixture.cpp | 36 +- src/App/LedModEffects.h | 16 +- src/App/LedModFixtureGen.h | 43 +- src/Sys/SysModFiles.cpp | 2 +- 6 files changed, 1091 insertions(+), 854 deletions(-) diff --git a/data/model.json b/data/model.json index ff9d62f4..9875265e 100644 --- a/data/model.json +++ b/data/model.json @@ -1,828 +1,1014 @@ [ - { - "id": "Leds", - "type": "module", - "ro": false, - "o": 1, - "n": [ - { - "id": "on", - "type": "checkbox", - "ro": false, - "o": 2, - "value": false - }, - { - "id": "bri", - "type": "range", - "ro": false, - "o": 3, - "value": "36", - "max": 255, - "log": true - }, - { - "id": "pview", - "type": "canvas", - "ro": false, - "o": 4, - "loopFun": 0, - "value": -1 - }, - { - "id": "fx", - "type": "select", - "ro": false, - "o": 5, - "value": "13", - "n": [ - { - "id": "X frequency", - "type": "range", - "ro": false, - "o": 6, - "value": 64, - "max": 255 - }, - { - "id": "Fade rate", - "type": "range", - "ro": false, - "o": 7, - "value": 128, - "max": 255 - }, - { - "id": "Speed", - "type": "range", - "ro": false, - "o": 8, - "value": 128, - "max": 255 - }, - { - "id": "Smooth", - "type": "checkbox", - "ro": false, - "o": 9, - "value": false + { + "id": "AI", + "type": "appmod", + "ro": true, + "o": 6100, + "max": 255, + "n": [ + { + "id": "aiTbl", + "type": "table", + "ro": true, + "o": 1, + "n": [ + { + "id": "aiIntel", + "type": "text", + "ro": true, + "o": 2, + "max": 32 + }, + { + "id": "aiButton", + "type": "button", + "ro": false, + "o": 3 + } + ] + } + ] + }, + { + "id": "Fixture", + "type": "appmod", + "ro": true, + "o": 2100, + "max": 255, + "n": [ + { + "id": "on", + "type": "checkbox", + "ro": false, + "o": 4, + "value": 1 + }, + { + "id": "bri", + "type": "range", + "ro": false, + "o": 5, + "max": 255, + "value": 10, + "log": true + }, + { + "id": "pview", + "type": "canvas", + "ro": false, + "o": 6, + "interval": 160, + "loopFun": 0 + }, + { + "id": "fixture", + "type": "select", + "ro": false, + "o": 7, + "value": 5 + }, + { + "id": "fixSize", + "type": "coord3D", + "ro": true, + "o": 8, + "max": 4096 + }, + { + "id": "fixCount", + "type": "number", + "ro": true, + "o": 9 + }, + { + "id": "fps", + "type": "number", + "ro": false, + "o": 10, + "min": 1, + "max": 999, + "value": 60 + }, + { + "id": "fShow", + "type": "checkbox", + "ro": false, + "o": 11, + "value": 1 + }, + { + "id": "realFps", + "type": "text", + "ro": true, + "o": 12, + "max": 10 + }, + { + "id": "mHead", + "type": "checkbox", + "ro": false, + "o": 13, + "value": 0 + } + ] + }, + { + "id": "Effects", + "type": "appmod", + "ro": true, + "o": 2200, + "max": 255, + "n": [ + { + "id": "fxTbl", + "type": "table", + "ro": false, + "o": 14, + "n": [ + { + "id": "fx", + "type": "select", + "ro": false, + "o": 15, + "value": [ + 18 + ], + "n": [ + { + "id": "fade", + "type": "range", + "ro": false, + "o": 16, + "max": 32, + "value": [ + 16 + ] + }, + { + "id": "outX", + "type": "range", + "ro": false, + "o": 17, + "max": 32, + "value": [ + 16 + ] + }, + { + "id": "outY", + "type": "range", + "ro": false, + "o": 18, + "max": 32, + "value": [ + 16 + ] + }, + { + "id": "inX", + "type": "range", + "ro": false, + "o": 19, + "max": 32, + "value": [ + 16 + ] + }, + { + "id": "inY", + "type": "range", + "ro": false, + "o": 20, + "max": 32, + "value": [ + 16 + ] + } + ] + }, + { + "id": "pro", + "type": "select", + "ro": false, + "o": 21, + "value": [ + 1 + ], + "n": [ + { + "id": "proMulti", + "type": "coord3D", + "ro": false, + "o": 112, + "max": 10, + "value": [ + { + "x": 2, + "y": 2, + "z": 1 + } + ], + "n": [ + { + "id": "mirror", + "type": "checkbox", + "ro": false, + "o": 113, + "value": [ + 0 + ] + } + ] + } + ] + }, + { + "id": "fxStart", + "type": "coord3D", + "ro": false, + "o": 22, + "max": 4096, + "value": [ + { + "x": 0, + "y": 0, + "z": 0 + } + ] + }, + { + "id": "fxEnd", + "type": "coord3D", + "ro": false, + "o": 23, + "max": 4096, + "value": [ + { + "x": 65535, + "y": 65535, + "z": 65535 + } + ] + }, + { + "id": "fxSize", + "type": "text", + "ro": true, + "o": 24, + "max": 32 + } + ] + }, + { + "id": "Blending", + "type": "range", + "ro": false, + "o": 25, + "max": 255, + "value": 128 + } + ] + }, + { + "id": "Fixture Generator", + "type": "usermod", + "ro": true, + "o": 2300, + "max": 255, + "n": [ + { + "id": "fixtureGen", + "type": "select", + "ro": false, + "o": 26, + "value": 0, + "n": [ + { + "id": "mrxRowEnd", + "type": "coord3D", + "ro": false, + "o": 32, + "max": 4096, + "value": { + "x": 7, + "y": 0, + "z": 0 } - ] - }, - { - "id": "pal", - "type": "select", - "ro": false, - "o": 10, - "value": "2" - }, - { - "id": "pro", - "type": "select", - "ro": false, - "o": 11, - "value": 2 - }, - { - "id": "fixture", - "type": "select", - "ro": false, - "o": 12, - "value": "1" - }, - { - "id": "dimensions", - "type": "text", - "ro": true, - "o": 13, - "max": 32 - }, - { - "id": "nrOfLeds", - "type": "text", - "ro": true, - "o": 14, - "max": 32 - }, - { - "id": "fps", - "type": "number", - "ro": false, - "o": 15, - "value": 61595, - "min": 1, - "max": 999 - }, - { - "id": "realFps", - "type": "text", - "ro": true, - "o": 16, - "max": 10 - }, - { - "id": "dch", - "type": "number", - "ro": false, - "o": 87, - "value": 1, - "min": 1, - "max": 511 - } - ] - }, - { - "id": "FixtureGen", - "type": "module", - "ro": false, - "o": 17, - "n": [ - { - "id": "fixtureGen", - "type": "select", - "ro": false, - "o": 18, - "value": "1", - "n": [ - { - "id": "width", - "type": "number", - "ro": false, - "o": 19, - "value": 8, - "min": 1, - "max": 255 - }, - { - "id": "height", - "type": "number", - "ro": false, - "o": 20, - "value": 8, - "min": 1, - "max": 255 - }, - { - "id": "firstLedX", - "type": "select", - "ro": false, - "o": 21, - "value": 0 - }, - { - "id": "firstLedY", - "type": "select", - "ro": false, - "o": 22, - "value": 0 - }, - { - "id": "serpentine", - "type": "checkbox", - "ro": false, - "o": 23, - "value": false + }, + { + "id": "mrxColEnd", + "type": "coord3D", + "ro": false, + "o": 33, + "max": 4096, + "value": { + "x": 7, + "y": 7, + "z": 0 } - ] - }, - { - "id": "pinList", - "type": "text", - "ro": false, - "o": 24, - "value": "16", - "max": 32 - }, - { - "id": "generate", - "type": "button", - "ro": false, - "o": 25, - "value": "Generate" - } - ] - }, - { - "id": "Files", - "type": "module", - "ro": false, - "o": 26, - "n": [ - { - "id": "fileTbl", - "type": "table", - "ro": false, - "o": 27, - "n": [ - { - "id": "flName", - "type": "text", - "ro": true, - "o": 28, - "max": 32 - }, - { - "id": "flSize", - "type": "number", - "ro": true, - "o": 29, - "value": -1, - "max": 65535 - }, - { - "id": "flLink", - "type": "url", - "ro": true, - "o": 30 - }, - { - "id": "flDel", - "type": "button", - "ro": false, - "o": 31, - "value": "⌫" - } - ] - }, - { - "id": "drsize", - "type": "text", - "ro": true, - "o": 32, - "max": 32 - }, - { - "id": "deleteFiles", - "type": "button", - "ro": false, - "o": 33 - } - ] - }, - { - "id": "Instances", - "type": "module", - "ro": false, - "o": 34, - "n": [ - { - "id": "insTbl", - "type": "table", - "ro": false, - "o": 35, - "n": [ - { - "id": "insName", - "type": "text", - "ro": true, - "o": 36, - "max": 32 - }, - { - "id": "insIp", - "type": "text", - "ro": true, - "o": 37, - "max": 16 - }, - { - "id": "insType", - "type": "text", - "ro": true, - "o": 38, - "max": 16 - }, - { - "id": "insDetail", - "type": "text", - "ro": true, - "o": 42, - "max": 1024 - }, - { - "id": "insLink", - "type": "url", - "ro": true, - "o": 43 - }, - { - "id": "insfx", - "type": "select", - "ro": false, - "o": 39, - "value": 0 - }, - { - "id": "inson", - "type": "checkbox", - "ro": false, - "o": 40, - "value": false - }, - { - "id": "insbri", - "type": "range", - "ro": false, - "o": 41, - "value": 0, - "max": 255 - } - ] - }, - { - "id": "sma", - "type": "number", - "ro": false, - "o": 44, - "value": 0, - "max": 255 - } - ] - }, - { - "id": "System", - "type": "module", - "ro": false, - "o": 45, - "n": [ - { - "id": "serverName", - "type": "text", - "ro": false, - "o": 46, - "value": "StarMod88", - "max": 32 - }, - { - "id": "upTime", - "type": "text", - "ro": true, - "o": 47, - "max": 16 - }, - { - "id": "loops", - "type": "text", - "ro": true, - "o": 48, - "max": 16 - }, - { - "id": "heap", - "type": "text", - "ro": true, - "o": 49, - "max": 32 - }, - { - "id": "stack", - "type": "text", - "ro": true, - "o": 50, - "max": 16 - }, - { - "id": "restart", - "type": "button", - "ro": false, - "o": 51 - }, - { - "id": "reset0", - "type": "select", - "ro": true, - "o": 52, - "value": 1 - }, - { - "id": "reset1", - "type": "select", - "ro": true, - "o": 53, - "value": 14 - }, - { - "id": "restartReason", - "type": "select", - "ro": true, - "o": 54, - "value": 1 - }, - { - "id": "version", - "type": "text", - "ro": true, - "o": 55, - "max": 16 - } - ] - }, - { - "id": "Pins", - "type": "module", - "ro": false, - "o": 56, - "n": [ - { - "id": "pinTbl", - "type": "table", - "ro": false, - "o": 57, - "n": [ - { - "id": "pinNr", - "type": "number", - "ro": true, - "o": 58, - "value": 0, - "max": 50 - }, - { - "id": "pinOwner", - "type": "text", - "ro": true, - "o": 59, - "max": 32 - }, - { - "id": "pinDetails", - "type": "text", - "ro": true, - "o": 60, - "max": 256 - } - ] - }, - { - "id": "board", - "type": "canvas", - "ro": true, - "o": 61, - "loopFun": 1, - "value": -1 - } - ] - }, - { - "id": "Print", - "type": "module", - "ro": false, - "o": 62, - "n": [ - { - "id": "pOut", - "type": "select", - "ro": false, - "o": 63, - "value": 1 - }, - { - "id": "log", - "type": "textarea", - "ro": true, - "o": 64, - "value": "WIP" - } - ] - }, - { - "id": "Web", - "type": "module", - "ro": false, - "o": 65, - "n": [ - { - "id": "clTbl", - "type": "table", - "ro": false, - "o": 66, - "n": [ - { - "id": "clNr", - "type": "number", - "ro": true, - "o": 67, - "value": 0, - "max": 999 - }, - { - "id": "clIp", - "type": "text", - "ro": true, - "o": 68, - "max": 16 - }, - { - "id": "clIsFull", - "type": "checkbox", - "ro": true, - "o": 69, - "value": [ - false, - false - ] - }, - { - "id": "clStatus", - "type": "select", - "ro": true, - "o": 70, - "value": [ - 1, - 1 - ] - }, - { - "id": "clLength", - "type": "number", - "ro": true, - "o": 71, - "value": [ - 0, - 0 - ], - "max": 64 - } - ] - }, - { - "id": "wsSendBytes", - "type": "text", - "ro": true, - "o": 72, - "max": 16 - }, - { - "id": "wsSendJson", - "type": "text", - "ro": true, - "o": 73, - "max": 16 - }, - { - "id": "queueLength", - "type": "number", - "ro": true, - "o": 74, - "value": 32, - "max": 64 - } - ] - }, - { - "id": "Network", - "type": "module", - "ro": false, - "o": 75, - "n": [ - { - "id": "ssid", - "type": "text", - "ro": false, - "o": 76, - "value": "ewtr", - "max": 32 - }, - { - "id": "pw", - "type": "password", - "ro": false, - "o": 77, - "value": "zonledmod" - }, - { - "id": "connect", - "type": "button", - "ro": false, - "o": 78, - "value": "Connect" - }, - { - "id": "nwstatus", - "type": "text", - "ro": true, - "o": 79, - "max": 32 - }, - { - "id": "rssi", - "type": "text", - "ro": true, - "o": 80, - "max": 32 - } - ] - }, - { - "id": "DDP", - "type": "module", - "ro": false, - "o": 81, - "n": [ - { - "id": "ddpInst", - "type": "select", - "ro": false, - "o": 82, - "value": 255 - } - ] - }, - { - "id": "ArtNet", - "type": "module", - "ro": false, - "o": 83, - "n": [ - { - "id": "artInst", - "type": "select", - "ro": false, - "o": 84, - "value": 255 - } - ] - }, - { - "id": "Model", - "type": "module", - "ro": false, - "o": 93, - "n": [ - { - "id": "mSize", - "type": "text", - "ro": true, - "o": 94, - "max": 32 - }, - { - "id": "saveModel", - "type": "button", - "ro": false, - "o": 95, - "value": "SaveModel" - }, - { - "id": "showObsolete", - "type": "checkbox", - "ro": false, - "o": 96, - "value": false - }, - { - "id": "deleteObsolete", - "type": "button", - "ro": false, - "o": 97 - }, - { - "id": "deleteModel", - "type": "button", - "ro": false, - "o": 98 - } - ] - }, - { - "id": "UI", - "type": "module", - "ro": false, - "o": 99, - "n": [ - { - "id": "vlTbl", - "type": "table", - "ro": false, - "o": 100, - "n": [ - { - "id": "vlVar", - "type": "text", - "ro": true, - "o": 101, - "max": 32 - }, - { - "id": "vlLoopps", - "type": "number", - "ro": true, - "o": 102, - "value": 0, - "max": 999 - } - ] - } - ] - }, - { - "id": "Modules", - "type": "module", - "ro": false, - "o": 103, - "n": [ - { - "id": "mdlTbl", - "type": "table", - "ro": false, - "o": 104, - "n": [ - { - "id": "mdlName", - "type": "text", - "ro": true, - "o": 105, - "max": 32 - }, - { - "id": "mdlSuccess", - "type": "checkbox", - "ro": true, - "o": 106, - "value": false - }, - { - "id": "mdlEnabled", - "type": "checkbox", - "ro": false, - "o": 107, - "value": [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - false, - true - ] - } - ] - } - ] - }, - { - "id": "e131-sACN", - "type": "module", - "ro": false, - "o": 85, - "n": [ - { - "id": "dun", - "type": "number", - "ro": false, - "o": 86, - "value": 1, - "max": 7 - }, - { - "id": "e131Tbl", - "type": "table", - "ro": false, - "o": 88, - "n": [ - { - "id": "e131Channel", - "type": "number", - "ro": true, - "o": 89, - "value": -1, - "min": 1, - "max": 512 - }, - { - "id": "e131Name", - "type": "text", - "ro": true, - "o": 90, - "max": 32 - }, - { - "id": "e131Max", - "type": "number", - "ro": true, - "o": 91, - "value": -1, - "max": 65535 - }, - { - "id": "e131Value", - "type": "number", - "ro": true, - "o": 92, - "value": -1, - "max": 255 - } - ] - } - ] - } - ] \ No newline at end of file + }, + { + "id": "fixIP", + "type": "number", + "ro": false, + "o": 34, + "min": 1, + "max": 256, + "value": 0 + }, + { + "id": "fixPin", + "type": "pin", + "ro": false, + "o": 35, + "max": 40, + "value": 2 + } + ] + }, + { + "id": "panels", + "type": "checkbox", + "ro": false, + "o": 31, + "value": 0 + }, + { + "id": "generate", + "type": "button", + "ro": false, + "o": 36 + } + ] + }, + { + "id": "Files", + "type": "sysmod", + "ro": true, + "o": 3000, + "max": 255, + "n": [ + { + "id": "fileTbl", + "type": "table", + "ro": false, + "o": 37, + "n": [ + { + "id": "flName", + "type": "text", + "ro": true, + "o": 38, + "max": 32 + }, + { + "id": "flSize", + "type": "number", + "ro": true, + "o": 39 + }, + { + "id": "flLink", + "type": "url", + "ro": true, + "o": 40 + } + ] + }, + { + "id": "drsize", + "type": "progress", + "ro": true, + "o": 41, + "max": 262144 + } + ] + }, + { + "id": "System", + "type": "sysmod", + "ro": true, + "o": 3100, + "max": 255, + "n": [ + { + "id": "serverName", + "type": "text", + "ro": false, + "o": 42, + "max": 32, + "value": "StarMod16MB" + }, + { + "id": "upTime", + "type": "text", + "ro": true, + "o": 43, + "max": 16 + }, + { + "id": "reboot", + "type": "button", + "ro": false, + "o": 44 + }, + { + "id": "loops", + "type": "text", + "ro": true, + "o": 45, + "max": 16 + }, + { + "id": "chip", + "type": "text", + "ro": true, + "o": 46, + "max": 16 + }, + { + "id": "heap", + "type": "progress", + "ro": true, + "o": 47, + "max": 292 + }, + { + "id": "mainStack", + "type": "progress", + "ro": true, + "o": 48, + "max": 8192 + }, + { + "id": "tcpStack", + "type": "progress", + "ro": true, + "o": 49, + "max": 8192 + }, + { + "id": "reset0", + "type": "select", + "ro": true, + "o": 50 + }, + { + "id": "reset1", + "type": "select", + "ro": true, + "o": 51 + }, + { + "id": "restartReason", + "type": "select", + "ro": true, + "o": 52 + }, + { + "id": "version", + "type": "text", + "ro": true, + "o": 53, + "max": 16 + } + ], + "view": "vAll" + }, + { + "id": "Pins", + "type": "sysmod", + "ro": true, + "o": 3200, + "max": 255, + "n": [ + { + "id": "pinTbl", + "type": "table", + "ro": true, + "o": 54, + "n": [ + { + "id": "pinNr", + "type": "pin", + "ro": true, + "o": 55, + "max": 40 + }, + { + "id": "pinOwner", + "type": "text", + "ro": true, + "o": 56, + "max": 32 + }, + { + "id": "pinDetails", + "type": "text", + "ro": true, + "o": 57, + "max": 256 + } + ] + }, + { + "id": "board", + "type": "canvas", + "ro": true, + "o": 58, + "interval": 1000, + "loopFun": 1 + }, + { + "id": "pin19", + "type": "checkbox", + "ro": false, + "o": 59, + "value": 1 + } + ] + }, + { + "id": "Print", + "type": "sysmod", + "ro": true, + "o": 3300, + "max": 255, + "n": [ + { + "id": "pOut", + "type": "select", + "ro": false, + "o": 60, + "value": 1 + }, + { + "id": "log", + "type": "textarea", + "ro": true, + "o": 61 + } + ] + }, + { + "id": "Web", + "type": "sysmod", + "ro": true, + "o": 3400, + "max": 255, + "n": [ + { + "id": "clTbl", + "type": "table", + "ro": true, + "o": 62, + "n": [ + { + "id": "clNr", + "type": "number", + "ro": true, + "o": 63, + "max": 999 + }, + { + "id": "clIp", + "type": "text", + "ro": true, + "o": 64, + "max": 16 + }, + { + "id": "clIsFull", + "type": "checkbox", + "ro": true, + "o": 65 + }, + { + "id": "clStatus", + "type": "select", + "ro": true, + "o": 66 + }, + { + "id": "clLength", + "type": "number", + "ro": true, + "o": 67, + "max": 64 + } + ] + }, + { + "id": "maxQueue", + "type": "number", + "ro": true, + "o": 68, + "max": 64 + }, + { + "id": "wsSend", + "type": "text", + "ro": true, + "o": 69, + "max": 16 + }, + { + "id": "wsRecv", + "type": "text", + "ro": true, + "o": 70, + "max": 16 + }, + { + "id": "udpSend", + "type": "text", + "ro": true, + "o": 71, + "max": 16 + }, + { + "id": "udpRecv", + "type": "text", + "ro": true, + "o": 72, + "max": 16 + } + ] + }, + { + "id": "Network", + "type": "sysmod", + "ro": true, + "o": 3500, + "max": 255, + "n": [ + { + "id": "ssid", + "type": "text", + "ro": false, + "o": 73, + "max": 32, + "value": "ewtr" + }, + { + "id": "pw", + "type": "password", + "ro": false, + "o": 74, + "value": "zonledmod" + }, + { + "id": "connect", + "type": "button", + "ro": false, + "o": 75 + }, + { + "id": "nwstatus", + "type": "text", + "ro": true, + "o": 76, + "max": 32 + }, + { + "id": "rssi", + "type": "text", + "ro": true, + "o": 77, + "max": 32 + } + ] + }, + { + "id": "DDP", + "type": "usermod", + "ro": true, + "o": 4000, + "max": 255, + "n": [ + { + "id": "ddpInst", + "type": "ip", + "ro": false, + "o": 78, + "max": 255 + } + ] + }, + { + "id": "ArtNet", + "type": "usermod", + "ro": true, + "o": 4100, + "max": 255, + "n": [ + { + "id": "artInst", + "type": "ip", + "ro": false, + "o": 79, + "max": 255 + } + ] + }, + { + "id": "e131-sACN", + "type": "usermod", + "ro": true, + "o": 4200, + "max": 255, + "n": [ + { + "id": "dun", + "type": "number", + "ro": false, + "o": 80, + "max": 7, + "value": 1 + }, + { + "id": "dch", + "type": "number", + "ro": false, + "o": 81, + "min": 1, + "max": 512, + "value": 1 + }, + { + "id": "e131Tbl", + "type": "table", + "ro": true, + "o": 82, + "n": [ + { + "id": "e131Channel", + "type": "number", + "ro": true, + "o": 83, + "min": 1, + "max": 512 + }, + { + "id": "e131Name", + "type": "text", + "ro": true, + "o": 84, + "max": 32 + }, + { + "id": "e131Max", + "type": "number", + "ro": true, + "o": 85 + }, + { + "id": "e131Value", + "type": "number", + "ro": true, + "o": 86, + "max": 255 + } + ] + } + ] + }, + { + "id": "Model", + "type": "sysmod", + "ro": true, + "o": 5000, + "max": 255, + "n": [ + { + "id": "saveModel", + "type": "button", + "ro": false, + "o": 87 + }, + { + "id": "showObsolete", + "type": "checkbox", + "ro": false, + "o": 88, + "value": 0 + }, + { + "id": "deleteObsolete", + "type": "button", + "ro": false, + "o": 89 + } + ] + }, + { + "id": "UI", + "type": "sysmod", + "ro": true, + "o": 5100, + "max": 255, + "n": [ + { + "id": "vlTbl", + "type": "table", + "ro": true, + "o": 90, + "n": [ + { + "id": "vlVar", + "type": "text", + "ro": true, + "o": 91, + "max": 32 + }, + { + "id": "vlLoopps", + "type": "number", + "ro": true, + "o": 92, + "max": 999 + } + ] + } + ] + }, + { + "id": "WLED Audio Sync Receiver", + "type": "usermod", + "ro": true, + "o": 6300, + "max": 255, + "n": [ + { + "id": "wledAudioStatus", + "type": "text", + "ro": true, + "o": 93, + "max": 16 + } + ] + }, + { + "id": "Instances", + "type": "sysmod", + "ro": true, + "o": 5200, + "max": 255, + "n": [ + { + "id": "insTbl", + "type": "table", + "ro": true, + "o": 94, + "n": [ + { + "id": "insName", + "type": "text", + "ro": true, + "o": 95, + "max": 32 + }, + { + "id": "insLink", + "type": "url", + "ro": true, + "o": 96 + }, + { + "id": "insIp", + "type": "text", + "ro": true, + "o": 97, + "max": 16 + }, + { + "id": "insType", + "type": "text", + "ro": true, + "o": 98, + "max": 16 + }, + { + "id": "insVersion", + "type": "number", + "ro": true, + "o": 99, + "max": -1 + }, + { + "id": "insUp", + "type": "number", + "ro": true, + "o": 100, + "max": -1 + }, + { + "id": "inson", + "type": "checkbox", + "ro": false, + "o": 102 + }, + { + "id": "insbri", + "type": "range", + "ro": false, + "o": 103, + "max": 255, + "log": true + }, + { + "id": "insfx", + "type": "select", + "ro": false, + "o": 104 + }, + { + "id": "inspro", + "type": "select", + "ro": false, + "o": 105 + }, + { + "id": "insdch", + "type": "number", + "ro": false, + "o": 106, + "min": 1, + "max": 512 + }, + { + "id": "inssma", + "type": "ip", + "ro": false, + "o": 107, + "max": 255 + } + ] + }, + { + "id": "sma", + "type": "ip", + "ro": false, + "o": 101, + "max": 255, + "value": 0 + } + ] + }, + { + "id": "Modules", + "type": "sysmod", + "ro": true, + "o": 6000, + "max": 255, + "n": [ + { + "id": "mdlTbl", + "type": "table", + "ro": true, + "o": 108, + "n": [ + { + "id": "mdlName", + "type": "text", + "ro": true, + "o": 109, + "max": 32 + }, + { + "id": "mdlSuccess", + "type": "checkbox", + "ro": true, + "o": 110 + }, + { + "id": "mdlEnabled", + "type": "checkbox", + "ro": false, + "o": 111, + "value": [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + true, + true + ] + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/App/LedEffects.h b/src/App/LedEffects.h index a0f86971..acc89d85 100644 --- a/src/App/LedEffects.h +++ b/src/App/LedEffects.h @@ -873,7 +873,7 @@ class Lines: public Effect { } }; // Lines -// dna originally by by ldirko at https://pastebin.com/pCkkkzcs. Updated by Preyy. WLED conversion by Andrew Tuline. +// By: Stepko https://editor.soulmatelights.com/gallery/1012 , Modified by: Andrew Tuline class BlackHole: public Effect { const char * name() {return "BlackHole";} unsigned8 dim() {return _2D;} @@ -904,6 +904,7 @@ class BlackHole: public Effect { } // central white dot leds.setPixelColor(leds.XY(leds.size.x/2, leds.size.y/2), CHSV(0, 0, 255)); + // blur everything a bit leds.blur2d(16); @@ -918,6 +919,7 @@ class BlackHole: public Effect { } }; // BlackHole +// dna originally by by ldirko at https://pastebin.com/pCkkkzcs. Updated by Preyy. WLED conversion by Andrew Tuline. class DNA: public Effect { const char * name() {return "DNA";} unsigned8 dim() {return _2D;} @@ -1457,10 +1459,10 @@ class RipplesEffect: public Effect { Coord3D pos = {0,0,0}; for (pos.z=0; pos.zloop(leds); //do a loop to set sharedData right // leds.sharedData.loop(); + leds.doMap = true; // avoid effects loop to set contextRowNr mdl->varPreDetails(var, rowNr); effect->controls(var); mdl->varPostDetails(var, rowNr); + leds.doMap = false; effect->setup(leds); //if changed then run setup once (like call==0 in WLED) diff --git a/src/App/LedFixture.cpp b/src/App/LedFixture.cpp index c871fb36..b11483e6 100644 --- a/src/App/LedFixture.cpp +++ b/src/App/LedFixture.cpp @@ -140,6 +140,7 @@ void Fixture::projectAndMap() { mapped = pixelAdjusted; + // if mirrored find the indexV of the mirrored pixel if (mirror) { if (mirrors.x %2 != 0) mapped.x = sizeAdjusted.x - 1 - mapped.x; if (mirrors.y %2 != 0) mapped.y = sizeAdjusted.y - 1 - mapped.y; @@ -150,8 +151,6 @@ void Fixture::projectAndMap() { mapped.y = 0; mapped.z = 0; - // if mirrored find the indexV of the mirrored pixel - indexV = leds->XYZNoSpin(mapped); break; case _2D: //effectDimension @@ -165,8 +164,6 @@ void Fixture::projectAndMap() { mapped.x = (pixelAdjusted.x + pixelAdjusted.y + pixelAdjusted.z) % leds->size.x; // only one > 0 mapped.y = (pixelAdjusted.x + pixelAdjusted.y + pixelAdjusted.z) / leds->size.x; // all rows next to each other mapped.z = 0; - - indexV = leds->XYZNoSpin(mapped); break; case _2D: //2D2D //find the 2 axis @@ -190,31 +187,32 @@ void Fixture::projectAndMap() { } mapped.z = 0; - if (mirror) { - if (mirrors.x %2 != 0) mapped.x = sizeAdjusted.x - 1 - mapped.x; - if (mirrors.y %2 != 0) mapped.y = sizeAdjusted.y - 1 - mapped.y; - if (mirrors.z %2 != 0) mapped.z = sizeAdjusted.z - 1 - mapped.z; - } - - indexV = leds->XYZNoSpin(mapped); // USER_PRINTF("2Dto2D %d-%d p:%d,%d,%d m:%d,%d,%d\n", indexV, indexP, pixelAdjusted.x, pixelAdjusted.y, pixelAdjusted.z, mapped.x, mapped.y, mapped.z break; case _3D: //2D3D if (leds->size == Coord3D{0,0,0}) { // first - leds->size.x = sizeAdjusted.x + sizeAdjusted.y; - leds->size.y = sizeAdjusted.z; + leds->size.x = sizeAdjusted.x + sizeAdjusted.y / 2; + leds->size.y = sizeAdjusted.y / 2 + sizeAdjusted.z; leds->size.z = 1; } - mapped.x = pixelAdjusted.x + pixelAdjusted.y; - mapped.y = pixelAdjusted.z; + mapped.x = pixelAdjusted.x + pixelAdjusted.y / 2; + mapped.y = pixelAdjusted.y / 2 + pixelAdjusted.z; mapped.z = 0; - indexV = leds->XYZNoSpin(mapped); // USER_PRINTF("2D to 3D indexV %d %d\n", indexV, size.x); break; } + + if (mirror) { + if (mirrors.x %2 != 0) mapped.x = sizeAdjusted.x - 1 - mapped.x; + if (mirrors.y %2 != 0) mapped.y = sizeAdjusted.y - 1 - mapped.y; + if (mirrors.z %2 != 0) mapped.z = sizeAdjusted.z - 1 - mapped.z; + } + indexV = leds->XYZNoSpin(mapped); break; case _3D: //effectDimension + mapped = pixelAdjusted; + switch(projectionDimension) { case _1D: if (leds->size == Coord3D{0,0,0}) { // first @@ -238,6 +236,12 @@ void Fixture::projectAndMap() { } break; } + if (mirror) { + if (mirrors.x %2 != 0) mapped.x = sizeAdjusted.x - 1 - mapped.x; + if (mirrors.y %2 != 0) mapped.y = sizeAdjusted.y - 1 - mapped.y; + if (mirrors.z %2 != 0) mapped.z = sizeAdjusted.z - 1 - mapped.z; + } + indexV = leds->XYZNoSpin(mapped); break; //effectDimension _3D } //effectDimension diff --git a/src/App/LedModEffects.h b/src/App/LedModEffects.h index d3887378..2bced9e2 100644 --- a/src/App/LedModEffects.h +++ b/src/App/LedModEffects.h @@ -342,13 +342,15 @@ class LedModEffects:public SysModule { // run the next frame of the effect // vector iteration on classes is faster!!! (22 vs 30 fps !!!!) // for (std::vector::iterator leds=fixture.projections.begin(); leds!=fixture.projections.end(); ++leds) { - stackUnsigned8 rowNr = 0; - for (Leds *leds: fixture.projections) { - if (!leds->doMap) { // don't run effect while remapping - // USER_PRINTF(" %d %d,%d,%d - %d,%d,%d (%d,%d,%d)", leds->fx, leds->startPos.x, leds->startPos.y, leds->startPos.z, leds->endPos.x, leds->endPos.y, leds->endPos.z, leds->size.x, leds->size.y, leds->size.z ); - mdl->contextRowNr = rowNr++; - effects.loop(*leds); - mdl->contextRowNr = UINT8_MAX; + if (mdl->contextRowNr == UINT8_MAX) { + stackUnsigned8 rowNr = 0; + for (Leds *leds: fixture.projections) { + if (!leds->doMap) { // don't run effect while remapping + // USER_PRINTF(" %d %d,%d,%d - %d,%d,%d (%d,%d,%d)", leds->fx, leds->startPos.x, leds->startPos.y, leds->startPos.z, leds->endPos.x, leds->endPos.y, leds->endPos.z, leds->size.x, leds->size.y, leds->size.z ); + mdl->contextRowNr = rowNr++; + effects.loop(*leds); + mdl->contextRowNr = UINT8_MAX; + } } } diff --git a/src/App/LedModFixtureGen.h b/src/App/LedModFixtureGen.h index 4f9a93e2..4809627d 100644 --- a/src/App/LedModFixtureGen.h +++ b/src/App/LedModFixtureGen.h @@ -415,6 +415,7 @@ enum Fixtures f_Cone, f_Cloud, f_Wall, + f_Human, f_Globe, f_GeodesicDome, fixtureCount @@ -445,6 +446,7 @@ class LedModFixtureGen:public SysModule { options.add("Cone"); options.add("Cloud"); options.add("Wall"); + options.add("Human"); options.add("Globe WIP"); options.add("GeodesicDome WIP"); return true; @@ -728,6 +730,21 @@ class LedModFixtureGen:public SysModule { default: return false; }}); } + } + else if (fgValue == f_Human) { + + if (panelVar["value"].as()) { + + ui->initSelect(fixtureGenVar, "fixPreset", 0, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun + case f_UIFun: { + ui->setLabel(var, "Preset"); + JsonArray options = ui->setOptions(var); + options.add("Body1"); + options.add("Body2"); + return true; } + default: return false; + }}); + } } else if (fgValue == f_Cone) { @@ -927,7 +944,7 @@ class LedModFixtureGen:public SysModule { } else if (fgValue == f_Wall) { getPanels("F_Wall", [](GenFix * genFix, unsigned8 rowNr) { - genFix->rings241(Coord3D{0,0,0}, 9, true, UINT8_MAX, 2); + genFix->rings241(Coord3D{0,0,0}, 9, true, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); genFix->matrix (Coord3D{19,0,0}, Coord3D{19,8,0}, Coord3D{27,0,0}, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); genFix->matrix (Coord3D{0,19,0}, Coord3D{0,25,0}, Coord3D{50,19,0}, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); @@ -937,6 +954,30 @@ class LedModFixtureGen:public SysModule { // genFix.spiral(240, 0, 0, 48); }); + } else if (fgValue == f_Human) { + + getPanels("F_Human", [](GenFix * genFix, unsigned8 rowNr) { + + //total dimensions width: 10 + 18 + 10 + // height 18 + 5 + + Coord3D headSize = {18, 18, 1}; + Coord3D armSize = {12, 5, 1}; + Coord3D legSize = {5, 20, 1}; + + // head + genFix->rings241({armSize.x-2,0,0}, 9, true, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); + + //arms + genFix->matrix (Coord3D{0,headSize.y + 2,0}, Coord3D{0,headSize.y + 2 + armSize.y,0}, Coord3D{armSize.x,headSize.y + 2,0}, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); + genFix->matrix (Coord3D{armSize.x + 14,headSize.y + 2,0}, Coord3D{armSize.x + 14,headSize.y + 2 + armSize.y,0}, Coord3D{38,headSize.y + 2,0}, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); + + //legs + genFix->matrix (Coord3D{10, 28, 0}, Coord3D{10, 50, 0}, Coord3D{15,28,0}, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); + genFix->matrix (Coord3D{23, 28, 0}, Coord3D{23, 50, 0}, Coord3D{28,28,0}, mdl->getValue("fixIP", rowNr), mdl->getValue("fixPin", rowNr)); + + + }); + } else if (fgValue == f_Globe) { char fileName[32]; print->fFormat(fileName, 31, "F_Globe%d", mdl->getValue("width").as()); diff --git a/src/Sys/SysModFiles.cpp b/src/Sys/SysModFiles.cpp index bfca4e16..d60c9c84 100644 --- a/src/Sys/SysModFiles.cpp +++ b/src/Sys/SysModFiles.cpp @@ -223,7 +223,7 @@ bool SysModFiles::readObjectFromFile(const char* path, JsonDocument* dest) { } else { USER_PRINTF(PSTR("File %s open to read, size %d bytes\n"), path, (int)f.size()); - DeserializationError error = deserializeJson(*dest, f); + DeserializationError error = deserializeJson(*dest, f, DeserializationOption::NestingLimit(20)); //StarMod requires more then 10 if (error) { print->printJDocInfo("readObjectFromFile", *dest); USER_PRINTF("readObjectFromFile deserializeJson failed with code %s\n", error.c_str());