PanelsLayout
Source:
PanelsLayout.h
PanelsLayout¶
src/light/layouts/PanelsLayout.h:29Inherits:
LayoutBase
Layout tiling multiple panels into one grid.
Author: MoonLight, https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Layouts/L_MoonLight.h
Public Attributes¶
lengthType horizontalPanels = 2
: Outer level, the panel grid (MoonLight panels, default 2×2 panels).
lengthType verticalPanels = 2
uint8_t wiringOrderP = 0
: Which axis the panel grid walks first.
bool incXP = true
: Whether the panel grid's x counts up.
bool incYP = true
: Whether its y counts up.
bool snakeP = false
lengthType panelWidth = 16
: Inner level, each panel (MoonLight panel, default 16×16, snake on Y).
lengthType panelHeight = 16
uint8_t wiringOrder = 0
: Which axis a panel walks first.
bool incX = true
: Whether a panel's x counts up.
bool incY = true
: Whether its y counts up.
bool snake = true
Public Methods¶
virtual inline void defineControls() override
: The controls a user sets on the card.
virtual inline const char * tags() const override
: The catalog tags this layout carries.
virtual inline Dim dimensions() const override
: How many axes this layout places lights on.
virtual inline nrOfLightsType lightCount() const override
: How many lights the current settings place.
virtual inline void placeLights(const CoordSink & sink) const override
: Emit every light's coordinate, in wiring order.
More info¶
A tiled grid of full matrix panels: an M×N arrangement of panels, each panel a serpentine matrix in its own right. Two levels of wiring, an OUTER walk over the panel grid (which panel, in what order) and an INNER walk over each panel's lights (PanelLayout's matrix). Both the panel-to-panel order and the light-to-light order inside a panel are independently configurable. Each panel at grid cell (px, py) is offset by px·panelWidth in X and py·panelHeight in Y, so the panels tile edge-to-edge into one large matrix. Every light is at an integer (x, y, 0); this is a 2D layout.
Prior art¶
Prior art: MoonLight PanelsLayout (Node "Panels", tags 🚥), which nests a panel Wiring inside a panels Wiring and walks both with iterate(). We reproduce the geometry, the two-level nesting, the axis-order table shared by both levels, the snake-on-odd-outer serpentine. The per-panel offset (coordsP[axis]·panel.size[axis]), and the control set, but drop MoonLight's pin/wiring plumbing (the Wiring pin count, panelsPerPin, nextPin()): a MoonLight layout emits coordinates only. The driver owns pins. tags 💫 marks the MoonLight lineage. The single-panel case is the sibling PanelLayout (Node "Panel"); this module tiles that panel across a grid.
The MoonLight Wiring/iterate implementation is not in the ported source (only the Panels usage site is). The iteration is reconstructed from that usage plus the control labels/defaults, identically to PanelLayout's already-shipped reconstruction. The reconstructed logic is marked // RECONSTRUCTED and, on the defaults, cross-checks against a plain serpentine tiling.