usbdmx.com Home of the opto isolated, bus powered, DMX512 interface with both in and out universes. Cheap and simple to build. USBDMX logo

LOButtonTokeniser Class Reference

The button tokeniser takes button presses one at a time, and where needed compiles them into combined tokens (i.e. More...

#import <LOButtonTokeniser.h>


Public Member Functions

(BOOL) - addToken:
 Proces a button custom button press, via a command token.
(BOOL) - digit:
 Process a digit button press.
(BOOL) - dotButton
 Process an dot (Decimal place) button press.
(BOOL) - plus
 Process a + button press.
(BOOL) - minus
 Process a minus button press.
(BOOL) - thru
 Process a THRU button press.
(BOOL) - at
 Process an @ button press.
(BOOL) - on
 Process an ON button press.
(BOOL) - off
 Process an OFF button press.
(BOOL) - solo
 Process a SOLO button press.
(BOOL) - releaseButton
 Process a RELEASE button press.
(BOOL) - lastButton
 Process an LAST button press.
(BOOL) - enter
 If at least one button has been pressed, that has been accepted by the command processor then the command will be sent to the processor for execution.
(void) - clear
 Reset all button presses.
(BOOL) - backSpace
 Remove the last button pressed, this can be called as many times as needed.
(BOOL) - checkTokens
 This is an internal function, called after every button press.
(NSArray *) - tokeniseCommand
 Get the current set of button presses as an array of tokens that can be passed to the command processor.
(BOOL) - submitCommand
 Submit the commnad to the commnad processor.
(NSString *) - currentCommandString
 Get the current equivilant command string for the button presses.
(LOCommandProcessor *) - commandProcessor
 Get the command processor this button tokeniser will use.

Protected Attributes

LOCommandProcessorcommandProcessor
NSMutableArray * tokens


Detailed Description

The button tokeniser takes button presses one at a time, and where needed compiles them into combined tokens (i.e.

for numbers), and passes them into the command processor. Because this is done on each button press errors can be detected immediatly. However it requires specific buttons for THRU, ON, RELEASE etc.


Member Function Documentation

- (BOOL) addToken: (LOCommandToken *)  token  

Proces a button custom button press, via a command token.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

Returns:
YES if the button was accepted

- (BOOL) at  

Process an @ button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) backSpace  

Remove the last button pressed, this can be called as many times as needed.

Returns:
YES if the button was removed

- (BOOL) checkTokens  

This is an internal function, called after every button press.

It checks with the command processor to validate the new command with the last button press

- (void) clear  

Reset all button presses.

- (LOCommandProcessor *) commandProcessor  

Get the command processor this button tokeniser will use.

- (BOOL) digit: (unsigned)  theDigit  

Process a digit button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

Parameters:
theDigit 0 - 9
After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) dotButton  

Process an dot (Decimal place) button press.

Returns:
YES If the button press was accepted.

- (BOOL) enter  

If at least one button has been pressed, that has been accepted by the command processor then the command will be sent to the processor for execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

The return value will be the status of the execution.

Returns:
YES If the button press was accepted.

- (BOOL) lastButton  

Process an LAST button press.

The LAST button is a shortcut to entering the last range of channels that were entered by the user.

Returns:
YES If the button press was accepted.

- (BOOL) minus  

Process a minus button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) off  

Process an OFF button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) on  

Process an ON button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) plus  

Process a + button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) releaseButton  

Process a RELEASE button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) solo  

Process a SOLO button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (BOOL) submitCommand  

Submit the commnad to the commnad processor.

This is an internal function that is called once the correct end of commnad button has been pressed.

- (BOOL) thru  

Process a THRU button press.

If the button press does not complete a command the return value reflects the validity of this button press within the context of the complete command as validated by the command processor.

If the commnad processor itendifies this as the last button to be pressed to comeplete a command then the command will be exectued and the return value will be the status of the the execution.

After a command is executed all button presses are reset, no matter what the return status of the command execution was.

Returns:
YES If the button press was accepted.

- (NSArray *) tokeniseCommand  

Get the current set of button presses as an array of tokens that can be passed to the command processor.

This is an internal function that gets called as needed when the command is due to be processed.


The documentation for this class was generated from the following files: