(*********************************************************************)
(* AMX Corporation *)
(* Copyright (c) 2004-2006 AMX Corporation. All rights reserved. *)
(*********************************************************************)
(* Copyright Notice : *)
(* Copyright, AMX, Inc., 2004-2007 *)
(* Private, proprietary information, the sole property of AMX. *)
(* The contents, ideas, and concepts expressed herein are not to *)
(* be disclosed except within the confines of a confidential *)
(* relationship and only then on a need to know basis. *)
(*********************************************************************)
MODULE_NAME = 'LutronHomeWorksQS LightSystemComponent' (dev vdvDev[], dev dvTP, INTEGER nDevice, INTEGER nPages[], CHAR sLightAddress[][])
(***********************************************************)
(* System Type : NetLinx *)
(* Creation Date: 12/12/2007 11:14:32 AM *)
(***********************************************************)
(* REV HISTORY: *)
(***********************************************************)
#include 'ComponentInclude.axi'
#include 'SNAPI.axi'
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
// Channels
BTN_LIGHT_CYCLE = 1500 // Button: Cycle Light
BTN_LIGHT_GET_LEVEL = 1501 // Button: Query Light Level
BTN_LIGHT_QUERY_STATE = 1502 // Button: Query Light State
BTN_LIGHT_SET_STATE = 9 // Button: Set Light State
BTN_LIGHT_LEVEL_DOWN = 25 // Button: Ramp Down
BTN_LIGHT_LEVEL_UP = 24 // Button: Ramp Up
BTN_LIGHT_SET_OFF = 1503 // Button: Light Off
BTN_LIGHT_SET_ON = 1504 // Button: Light On
#IF_NOT_DEFINED BTN_LIGHT_SEL_LIST
INTEGER BTN_LIGHT_SEL_LIST[] = // Button: Select light
{
3501, 3502, 3503, 3504, 3505,
3506, 3507, 3508, 3509, 3510,
3511, 3512, 3513, 3514, 3515,
3516, 3517, 3518, 3519, 3520
}
#END_IF // BTN_LIGHT_SEL_LIST
BTN_LIGHT_SET_TIME = 1505 // Button: Set Light Level Time
BTN_LIGHT_LEVEL_RELEASE = 3500 // Button: Light Level Release
// Levels
LVL_LIGHT = 1 // Level: Set Light Level
// Variable Text Addresses
TXT_LIGHT_SET_TIME = 1505 // Text: Set Light Level Time
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
INTEGER MAX_LIGHTS = 100
(***********************************************************)
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_DEVICE
(***********************************************************)
(* DATA TYPE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_TYPE
#IF_NOT_DEFINED _uLight
STRUCTURE _uLight
{
CHAR sLightAddress[20]
INTEGER nLevel
INTEGER nTime
INTEGER bState
}
#END_IF
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE
VOLATILE INTEGER nLightCount = 0 // How many addressed light/loads are on this device, to be calculated when the configuration is read in
VOLATILE INTEGER nAdjustType = 0 // Keyboard adjust
VOLATILE INTEGER nBTN_LIGHT_SEL_LIST = 0 // The currently selected light
VOLATILE CHAR sLIGHTSYSTEMRAMP[20] = '' // Stores the current ramp state
VOLATILE _uLight uLight[MAX_LIGHTS] // Stores all address values when read in from the file
VOLATILE INTEGER nActive_Parameter = 0
//---------------------------------------------------------------------------------
//
// FUNCTION NAME: OnDeviceChanged
//
// PURPOSE: This function is used by the device selection BUTTON_EVENT
// to notify the module that a device change has occurred
// allowing updates to the touch panel user interface.
//
//---------------------------------------------------------------------------------
DEFINE_FUNCTION OnDeviceChanged()
{
println ("'OnDeviceChanged'")
}
//---------------------------------------------------------------------------------
//
// FUNCTION NAME: OnPageChanged
//
// PURPOSE: This function is used by the page selection BUTTON_EVENT
// to notify the module that a component change may have occurred
// allowing updates to the touch panel user interface.
//
//---------------------------------------------------------------------------------
DEFINE_FUNCTION OnPageChanged()
{
println ("'OnPageChanged'")
}
//---------------------------------------------------------------------------------
//
// FUNCTION NAME: OnZoneChange
//
// PURPOSE: This function is used by the zone selection BUTTON_EVENT
// to notify the module that a zone change has occurred
// allowing updates to the touch panel user interface.
//
//---------------------------------------------------------------------------------
DEFINE_FUNCTION OnZoneChange()
{
println ("'OnZoneChange'")
}
//*********************************************************************
// Function : initialize
// Purpose : initialize any variables to default values
// Params : none
// Return : none
//*********************************************************************
DEFINE_FUNCTION initialize()
{
stack_var integer nLoop
nLightCount = LENGTH_ARRAY(BTN_LIGHT_SEL_LIST)
for (nLoop = 1; nLoop < MAX_LIGHTS; nLoop++)
{
uLight[nLoop].sLightAddress = ''
uLight[nLoop].nLevel = 0
uLight[nLoop].bState = FALSE
}
}
//*********************************************************************
// Function : loadLightConfig
// Purpose : read in a file with light addresses and store it for use
// Params : none
// Return : none
//*********************************************************************
define_function loadLightConfig()
{
stack_var slong lLightConfigFile
stack_var integer bEOF
stack_var sinteger nBytes
stack_var char sLine[256]
stack_var integer nLights
stack_var char sTempLights[100][20]
nLights = 0
// attempt to open the file
lLightConfigFile = file_open("itoa(vdvDev[1].number),'_LIGHT_CONFIG.TXT'", 1)
// validate and proceed if successful
if (lLightConfigFile > 0)
{
// loop through all entries
while(!bEOF)
{
// read a line from the file
nBytes = file_read_line(lLightConfigFile, sLine, 256)
// we've reached the end of the file
if (nBytes <= 0)
{
bEOF = 1
}
else
{
nLights++
sTempLights[nLights] = sLine
uLight[nLights].sLightAddress = sTempLights[nLights]
}
}
file_close(lLightConfigFile)
nLightCount = nLights
// make sure we stay within the smallest bounds
if (nLightCount > LENGTH_ARRAY(BTN_LIGHT_SEL_LIST))
nLightCount = LENGTH_ARRAY(BTN_LIGHT_SEL_LIST)
}
else
{
stack_var integer nLoop
for (nLoop = 1; nLoop <= nLightCount; nLoop++)
{
// make sure we stay within the smallest bounds
if (nLoop <= LENGTH_ARRAY(sLightAddress))
uLight[nLoop].sLightAddress = sLightAddress[nLoop]
else
set_length_string(uLight[nLoop].sLightAddress, 0)
}
}
}
DEFINE_MUTUALLY_EXCLUSIVE
([dvTp,BTN_LIGHT_SEL_LIST[1]]..[dvTp,BTN_LIGHT_SEL_LIST[LENGTH_ARRAY(BTN_LIGHT_SEL_LIST)]])
(***********************************************************)
(* STARTUP CODE GOES BELOW *)
(***********************************************************)
DEFINE_START
strCompName = 'LightSystemComponent'
initialize()
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
DEFINE_EVENT
(***********************************************************)
(* TOUCHPANEL EVENTS GO BELOW *)
(***********************************************************)
DATA_EVENT [dvTP]
{
ONLINE:
{
bActiveComponent = FALSE
nActiveDevice = 1
nActivePage = 0
nActiveDeviceID = nNavigationBtns[1]
nActivePageID = 0
nCurrentZone = 1
bNoLevelReset = 0
loadLightConfig()
}
OFFLINE:
{
bNoLevelReset = 1
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: DATA_EVENT for vdvDev
// LightSystemComponent: data event
//
// PURPOSE: This data event is used to listen for SNAPI component
// commands and track feedback for the LightSystemComponent.
//
// LOCAL VARIABLES: cHeader : SNAPI command header
// cParameter : SNAPI command parameter
// nParameter : SNAPI command parameter value
// cCmd : received SNAPI command
//
//---------------------------------------------------------------------------------
DATA_EVENT[vdvDev]
{
COMMAND :
{
// local variables
STACK_VAR CHAR cCmd[DUET_MAX_CMD_LEN]
STACK_VAR CHAR cHeader[DUET_MAX_HDR_LEN]
STACK_VAR CHAR cParameter[DUET_MAX_PARAM_LEN]
STACK_VAR INTEGER nParameter
STACK_VAR CHAR cTrash[20]
STACK_VAR INTEGER nZone
nZone = getFeedbackZone(data.device)
// get received SNAPI command
cCmd = DATA.TEXT
// parse command header
cHeader = DuetParseCmdHeader(cCmd)
SWITCH (cHeader)
{
//----------------------------------------------------------
// CODE-BLOCK For LightSystemComponent
//
// The following case statements are used in conjunction
// with the LightSystemComponent code-block.
//----------------------------------------------------------
// SNAPI::LIGHTSYSTEMRAMP-
,
CASE 'LIGHTSYSTEMRAMP' :
{
// get parameter value from SNAPI command and set feeback on user interface
cParameter = DuetParseCmdParam(cCmd)
sLIGHTSYSTEMRAMP = DuetParseCmdParam(cCmd)
}
// SNAPI::LIGHTSYSTEMLEVEL-,
CASE 'LIGHTSYSTEMLEVEL' :
{
stack_var integer nLoop
nActive_Parameter = ATOI(DuetParseCmdParam(cCmd))
// get address parameter value from SNAPI command and set feeback on user interface
cParameter = DuetParseCmdParam(cCmd)
for (nLoop = 1; nLoop <= nLightCount; nLoop++)
{
if (uLight[nLoop].sLightAddress == cParameter)
{
uLight[nLoop].nLevel = ATOI(DuetParseCmdParam(cCmd))
if (nLoop == nBTN_LIGHT_SEL_LIST) // Currently selected?
{
send_level dvTP, LVL_LIGHT, uLight[nLoop].nLevel
}
break;
}
}
}
// SNAPI::LIGHTSYSTEMSTATE-,
CASE 'LIGHTSYSTEMSTATE' :
{
stack_var integer nLoop
// get parameter value from SNAPI command and set feeback on user interface
cParameter = DuetParseCmdParam(cCmd)
for (nLoop = 1; nLoop <= nLightCount; nLoop++)
{
if (uLight[nLoop].sLightAddress == cParameter)
{
if (DuetParseCmdParam(cCmd) == 'ON')
uLight[nLoop].bState = TRUE
else
uLight[nLoop].bState = FALSE
break;
}
}
}
// SNAPI::DEBUG-
CASE 'DEBUG' :
{
// This will toggle debug printing
nDbg = ATOI(DuetParseCmdParam(cCmd))
}
}
}
}
//----------------------------------------------------------
// EXTENDED EVENTS For LightSystemComponent
//
// The following events are used in conjunction
// with the LightSystemComponent code-block.
//----------------------------------------------------------
//---------------------------------------------------------------------------------
//
// EVENT TYPE: DATA_EVENT for dvTP
// LightSystemComponent: Keypad
// on SETUP CHANNEL
//
// PURPOSE: This button event is used to listen for input from the keypad
// on the touch panel and update the LightSystemComponent Text Fields.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
data_event[dvTP.number:1:0]
{
string:
{
if (bActiveComponent)
{
if (nAdjustType)
{
println("'Data from TP: ',data.text")
if (find_string(data.text, 'ABORT', 1))
{
nAdjustType = 0
}
else
{
if (nAdjustType = BTN_LIGHT_SET_TIME)
{
remove_string(data.text, 'KEYP-', 1)
uLight[nBTN_LIGHT_SEL_LIST].nTime = ATOI(data.text)
send_command dvTP, "'^TXT-',itoa(TXT_LIGHT_SET_TIME),',0,',data.text"
nAdjustType = 0
}
}
}
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel range button - command
// on BTN_LIGHT_SEL_LIST
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the .
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
button_event[dvTP, BTN_LIGHT_SEL_LIST]
{
push:
{
nBTN_LIGHT_SEL_LIST = get_last(BTN_LIGHT_SEL_LIST)
ON[dvTP,BTN_LIGHT_SEL_LIST[nBTN_LIGHT_SEL_LIST]]
// Update the light level when a new light is selected
send_level dvTP, LVL_LIGHT, uLight[nBTN_LIGHT_SEL_LIST].nLevel
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - ramping channel
// on BTN_LIGHT_LEVEL_UP
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_LEVEL_UP]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',UP'"
println("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',UP',39")
}
}
release:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',STOP'"
println("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',STOP',39")
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - ramping channel
// on BTN_LIGHT_LEVEL_DOWN
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_LEVEL_DOWN]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',DOWN'"
println("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',DOWN',39")
}
}
release:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',STOP'"
println("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMRAMP-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',STOP',39")
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - command
// on BTN_LIGHT_GET_LEVEL
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_GET_LEVEL]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'?LIGHTSYSTEMLEVEL-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'?LIGHTSYSTEMLEVEL-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,39")
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - command
// on BTN_LIGHT_QUERY_STATE
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_QUERY_STATE]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'?LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'?LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,39")
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - momentary channel
// on BTN_LIGHT_SET_STATE
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_SET_STATE]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
IF (uLight[nBTN_LIGHT_SEL_LIST].bState)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',OFF'"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',OFF',39")
}
ELSE
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',ON'"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',ON',39")
}
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - momentary channel
// on BTN_LIGHT_SET_OFF
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_SET_OFF]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',OFF'"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',OFF',39")
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - discrete channel
// on BTN_LIGHT_SET_ON
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_SET_ON]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',ON'"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',ON',39")
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: momentary button - momentary channel
// on BTN_LIGHT_CYCLE
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_CYCLE]
{
push:
{
if (nBTN_LIGHT_SEL_LIST)
{
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',TOGGLE'"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMSTATE-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',TOGGLE',39")
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - command
// on BTN_LIGHT_SET_TIME
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the .
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
button_event[dvTP, BTN_LIGHT_SET_TIME]
{
push:
{
nAdjustType = button.input.channel
send_command dvTP, "'@AKP-;Enter Ramp Time in seconds'"
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: BUTTON_EVENT for dvTP
// LightSystemComponent: channel button - level
// on BTN_LIGHT_LEVEL_RELEASE
//
// PURPOSE: This button event is used to listen for input
// on the touch panel and update the LightSystemComponent.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
BUTTON_EVENT[dvTP, BTN_LIGHT_LEVEL_RELEASE]
{
release:
{
if (nBTN_LIGHT_SEL_LIST)
{
if (!bNoLevelReset)
{
stack_var integer nLevel
stack_var integer nTime
nLevel = uLight[nBTN_LIGHT_SEL_LIST].nLevel
nTime = uLight[nBTN_LIGHT_SEL_LIST].nTime
send_command vdvDev[nCurrentZone], "'LIGHTSYSTEMLEVEL-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',',itoa(nLevel),',',itoa(nTime)"
println ("'send_command ',dpstoa(vdvDev[nCurrentZone]),', ',39,'LIGHTSYSTEMLEVEL-',uLight[nBTN_LIGHT_SEL_LIST].sLightAddress,',',itoa(nLevel),',',itoa(nTime),39")
}
}
}
}
//---------------------------------------------------------------------------------
//
// EVENT TYPE: LEVEL_EVENT for dvTP
// LightSystemComponent: level event for dvTP
//
// PURPOSE: This level event is used to listen for touch panel changes
// and update the LightSystemComponent
// interface feedback.
//
// LOCAL VARIABLES: {none}
//
//---------------------------------------------------------------------------------
LEVEL_EVENT[dvTP, LVL_LIGHT]
{
if (nBTN_LIGHT_SEL_LIST)
{
if (!bNoLevelReset)
{
uLight[nBTN_LIGHT_SEL_LIST].nLevel = Level.value
}
}
}
(***********************************************************)
(* THE ACTUAL PROGRAM GOES BELOW *)
(***********************************************************)
DEFINE_PROGRAM
[dvTP,BTN_LIGHT_LEVEL_UP] = (sLIGHTSYSTEMRAMP == 'UP')
[dvTP,BTN_LIGHT_LEVEL_DOWN] = (sLIGHTSYSTEMRAMP == 'DOWN')
IF (nBTN_LIGHT_SEL_LIST)
{
[dvTP,BTN_LIGHT_SET_STATE] = (uLight[nBTN_LIGHT_SEL_LIST].bState == TRUE)
[dvTP,BTN_LIGHT_SET_OFF] = (uLight[nBTN_LIGHT_SEL_LIST].bState == FALSE)
[dvTP,BTN_LIGHT_SET_ON] = (uLight[nBTN_LIGHT_SEL_LIST].bState == TRUE)
}
(***********************************************************)
(* END OF PROGRAM *)
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
(***********************************************************)