Hey @barclander!
Right now, the output expander config is not accessible or settable from pattern code.
I’m struggling to understand how it makes your workflow easier; is the idea that if you need to swap in a spare on-playa, it’d be nice if the pattern code itself was the thing setting the output expander config?
Without understanding more, my initial approach would be to code my patterns around nodeIDs as you mentioned, and download a separate backup archive of each device once I have things working well. The backup archive includes the map and output expander configs, so swapping in a spare would just involve restoring one of my known-good archives.
If there was something really specific about the number of LEDs in each expander channel that I wanted to access in pattern code, I think the approach I would take is to encode the overall output expander config for all 5 nodes in an array that’s in the shared code. For example, let’s say I’ve assigned a nodeId of 0 through 4 to my 5 controllers. Let’s say they’re configured like this:
- Pixelblaze 1: no output expander, 40 pixels
- Pixelblaze 2: output expander using one channel of 50 pixels
- Pixelblaze 3: output expander using 2 channels, 100 and 200 pixels
- Pixelblaze 4 and 5: output expander using 7 channels, 150 pixels on the first four outputs and 30 on the last three outputs
I might use code like this:
nodeOEChannels = [[40],
[50],
[100, 200],
[150,150,150,150,30,30,30],
[150,150,150,150,30,30,30]
]
// Given a nodeId which is also an index into `nodeOEChannels`,
// and an index for the specific pixel being calculated on this controller,
// return the 0-indexed channel number on the current controller
function getChannelIdx(nodeId, index) {...}
// Given a nodeId which is also an index into `nodeOEChannels`,
// and an index for the specific pixel being calculated on this controller,
// return the number of pixels in the current output expander channel
function getChannelPixelCount(nodeId, index) {...}
I left the implementation of those helper functions to you until I get more clarification that this would help with what you’re trying to do!