LineSetAlias |
Top Previous Next |
Message
LineSetAlias <line_number>|<existing_alias> <new_alias>
Originator
Client
Response
No response (implies success) or an error message:
SyntaxError: insufficient parameters to LineSetAlias SyntaxError: invalid parameters to LineSetAlias Error: invalid line or alias
Response (immediate socket)
Success Failure
Details
You can define aliases for lines. If you issue the command 'LineSetAlias 5 leftlever', you can then use 'leftlever' in place of the line number in subsequent commands (meaning you can do 'LineClaim leftlever', 'LineSetEvent leftlever on LEFT_LEVER_PRESSED').
Restrictions: there can be no spaces in the alias. Aliases cannot begin with a number (to distinguish them from ordinary line numbers). It is not case-sensitive.
Aliases can be used with any command that takes a line number, except LineClaim (for which you obviously have to know the actual line number!). Note: you can claim and alias a line in one step (see LineClaim).
Aliases are designed to make programs independent of the box (chamber) number. Once you've defined your houselight (which might be line 5 in box 1, or line 28 in box 3) you shouldn't need to know its actual number again. Aliases also help to simplify counterbalancing and task design. For example,
LineClaim 8 –alias LeftLever LineClaim 9 –alias RightLever ... L/R counterbalancing determined by client program at this point ... LineSetAlias LeftLever ACTIVELEVER LineSetAlias RightLever INACTIVELEVER LineSetEvent ACTIVELEVER on active_lever_pressed LineSetEvent ACTIVELEVER off active_lever_released LineSetEvent INACTIVELEVER on inactive_lever_pressed LineSetEvent INACTIVELEVER off inactive_lever_released
Before you ask, there is no need to set aliases for timers, as timers have names anyway and you define the names. Aliases for timers are not supported.
Revision history
Implemented in WhiskerServer version 1 as SetLineAlias. Renamed in WhiskerServer version 2.3.
See also
|