Best way to map IR functions in NL
I am about to program the AV control portion of my Netlinx system and have what seems to be a REALLY basic, but important, quesion. I have many rooms, with many displays, with many sources in each room. I also have many different panel types (touch, MSPs, IR remotes) to actuate the correct IR functions. My question is, what is the best way to structure a "database" of user-interface device/channels to ir-output device/channels. I want to keep my program easily "modifyable" and structures/arrays of confusing numbers, names, devices, and channels at startup seems archaic. I was wondering if there is some slick way to do this pretty basic function. What is the best way to group all the information elements & reference them? Thanks in advance for any input or insight.
0
Comments
BUTTON_EVENT[dvPanel, iButtonArray] { PUSH : SEND_COMMAND dvDeck, "'SP', BUTTON.INPUT.CHANNEL" ; }If you need more processing than that, branch it out with a SWITCH or SELECT tree, depending on what needs to vary under whatever circumstances (for example, FF transport functions on some devices work on a pulse, some need a steady IR stream as you hold them; for those, and only those, you do an ON for the PUSH handler, and OFF for the RELEASE).The way it was recommended in class was to have a seperate DEVCHAN array for the buttons, and another for the IR functions, then match them up by the array indices. I always found that far to convoluted to set up and maintain. Sometimes, easy does it best.
DEFINE_CONSTANT ZONE_KITCHEN = 1 ZONE_FAMILY_RM = 2 ZONE_BEDROOM = 3 NUMBER_ZONES = 3 PANEL_KITCHEN = 1 PANEL_FAMILY = 2 PANEL_BEDROOM = 3 DEFINE_VARIABLE VOLATILE DEV dvPanels[] = {dvKitchen_TP, dvFamily_TP, dvBedroom_TP} VOLATILE CHAR cZonesByPanel[] = {ZONE_KITCHEN, ZONE_FAMILY_RM, ZONE_BEDROOM} VOLATILE DEV dvDeck[NUMBER_ZONES]You keep track of what room each panel is controlling with cZonesByPanel, and if you want to be able to navigate room-to-room, you change it as you do. If not, you can make it a constant, but the capability is right there. You keep track of what deck is controlled in dvDeck, and the example I posted above becomes:BUTTON_EVENT[dvPanels, iButtonArray] { PUSH : { SEND_COMMAND dvDeck[cZonesByPanel[GET_LAST(dvPanels)]], "'SP', BUTTON.INPUT.CHANNEL" } }Thank you for all your great information. I'm just wondering what the downsides would be to keeping all the button and ir-channel information in a text file or MS database. It could be much easier to modify, but what additional overhead would it add to the system if any?
I guess I'm making this a bigger deal than it really is because in addition to individual room controls & sources, many of my av sources are also modulated into my comcast cable signal onto channels 86-100 and can be accessed from any room. Should I have two seperate variable arrays for each room.....one to track local video output device (volume & source selections on TV or amplifier) and another to select what source is being used & how to activate it? Thanks again.