X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Mappings.pde;h=1c62ed129a7e4089df1ed2b180cc0c65e66c90df;hb=a922e963a15c0991da5084d44a20b4c3e5980b50;hp=fb80ff1fe164218446ba3d9b2acc63b3b9635229;hpb=84086fa3d2cb987859754986bba3feb92716343d;p=SugarCubes.git diff --git a/_Mappings.pde b/_Mappings.pde index fb80ff1..1c62ed1 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -255,6 +255,11 @@ public PandaMapping[] buildPandaList() { }; } +/** + * Each panda board has an IP address and a fixed number of channels. The channels + * each have a fixed number of pixels on them. Whether or not that many physical + * pixels are connected to the channel, we still send it that much data. + */ class PandaMapping { // How many channels are on the panda board @@ -268,12 +273,27 @@ class PandaMapping { PandaMapping(String ip, ChannelMapping[] rawChannelList) { this.ip = ip; + + // Ensure our array is the right length and has all valid items in it for (int i = 0; i < channelList.length; ++i) { channelList[i] = (i < rawChannelList.length) ? rawChannelList[i] : new ChannelMapping(); + if (channelList[i] == null) { + channelList[i] = new ChannelMapping(); + } } } } +/** + * Each channel on a pandaboard can be mapped in a number of modes. The typial is + * to a series of connected cubes, but we also have special mappings for the bass box, + * the speaker enclosures, and the DJ booth floor. + * + * This class is just the mapping meta-data. It sanitizes the input to make sure + * that the cubes and objects being referenced actually exist in the model. + * + * The logic for how to encode the pixels is contained in the PandaDriver. + */ class ChannelMapping { // How many cubes per channel xc_PB is configured for @@ -336,3 +356,4 @@ class ChannelMapping { } } } +