Package jmri.jmrix.powerline
Class InsteonSequence
java.lang.Object
jmri.jmrix.powerline.InsteonSequence
Represent a sequence of one or more Insteon commands (addresses and
functions).
These are Insteon specific, but not device/interface specific.
A sequence should consist of addressing (1 or more), and then one or more commands. It can address multiple devices.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresent a single "set address" Insteon commandstatic interfaceRepresent a single Insteon command, which is either a "set address" or "do function" operationstatic classRepresent a single "Extended Data" Insteon commandstatic classRepresent a single "do function" Insteon command -
Field Summary
FieldsModifier and TypeFieldDescription(package private) InsteonSequence.Command[](package private) int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAddress(int idhighbyte, int idmiddlebyte, int idlowbyte) Append a new "set address" operation to the sequencevoidaddFunction(int idhighbyte, int idmiddlebyte, int idlowbyte, int function, int flag, int command1, int command2) Append a new "do function" operation to the sequencestatic intdecode(int i) Get house (A-P as 1-16) or device (1-16) from line-coded value.static intencode(int i) For the house (A-P) and device (1-16) codes, get the line-coded value.static StringformatAddressByte(int b) Pretty-print an address codestatic StringformatCommandByte(int b) Pretty-print a function codestatic StringfunctionName(int i) Return a human-readable name for a function codeRetrieve the next command in the sequencestatic StringhouseCodeToText(int hC) Translate House Code to textstatic StringhouseValueToText(int hV) Translate House Value (1 to 16) to textvoidreset()Next getCommand will be the first in the sequence
-
Field Details
-
index
int index -
cmds
-
-
Constructor Details
-
InsteonSequence
public InsteonSequence()
-
-
Method Details
-
addFunction
public void addFunction(int idhighbyte, int idmiddlebyte, int idlowbyte, int function, int flag, int command1, int command2) Append a new "do function" operation to the sequence- Parameters:
idhighbyte- 1st id valueidmiddlebyte- 2nd id valueidlowbyte- 3rd id valuefunction- functionflag- option flagcommand1- cmd1command2- cmd2
-
addAddress
Append a new "set address" operation to the sequence- Parameters:
idhighbyte- 1st addridmiddlebyte- 2nd addridlowbyte- 3rd addr
-
reset
Next getCommand will be the first in the sequence -
getCommand
Retrieve the next command in the sequence- Returns:
- single Insteon cmd
-
functionName
Return a human-readable name for a function code- Parameters:
i- function value- Returns:
- text of the fuction
-
encode
For the house (A-P) and device (1-16) codes, get the line-coded value. Argument is from 1 to 16 only.- Parameters:
i- code to convert- Returns:
- converted code
-
decode
Get house (A-P as 1-16) or device (1-16) from line-coded value.- Parameters:
i- encoded value- Returns:
- int value
-
formatAddressByte
Pretty-print an address code- Parameters:
b- address as value- Returns:
- text of address explained
-
formatCommandByte
Pretty-print a function code- Parameters:
b- function code value- Returns:
- text of function code
-
houseValueToText
Translate House Value (1 to 16) to text- Parameters:
hV- value for housecode- Returns:
- text for housecode
-
houseCodeToText
Translate House Code to text- Parameters:
hC- housecode value- Returns:
- text for the housecode
-