|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.powerline.X10Sequence
public class X10Sequence
Represent a sequence of one or more X10 commands (addresses and functions).
These are X10 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, but not more than one house-code.
House codes and devices within this class are sequential numbers
(1-16 for house code, 1-16 for device code).
These must be translated to line coding by other code that converts
the sequence to adapter-specific messages. The encode(int) and
decode(int) functions are provided to make that easier
by converting to and from the standard line-code sequences, but
you should check the coding of your new specific adapter before using them.
| Nested Class Summary | |
|---|---|
static class |
X10Sequence.Address
Represent a single "set address" X10 command |
static interface |
X10Sequence.Command
Represent a single X10 command, which is either a "set address" or "do function" operation |
static class |
X10Sequence.ExtData
Represent a single "Extended Data" X10 command |
static class |
X10Sequence.Function
Represent a single "do function" X10 command |
| Field Summary | |
|---|---|
static int |
EXTCMD_DIM
|
static int |
FUNCTION_ALL_LIGHTS_OFF
|
static int |
FUNCTION_ALL_LIGHTS_ON
|
static int |
FUNCTION_ALL_UNITS_OFF
|
static int |
FUNCTION_BRIGHT
|
static int |
FUNCTION_DIM
|
static int |
FUNCTION_EXTENDED_CODE
|
static int |
FUNCTION_EXTENDED_DATA_TRANSFER
|
static int |
FUNCTION_HAIL_ACKNOWLEDGE
|
static int |
FUNCTION_HAIL_REQUEST
|
static int |
FUNCTION_OFF
|
static int |
FUNCTION_ON
|
static int |
FUNCTION_PRESET_DIM_1
|
static int |
FUNCTION_PRESET_DIM_2
|
static int |
FUNCTION_STATUS_OFF
|
static int |
FUNCTION_STATUS_ON
|
static int |
FUNCTION_STATUS_REQUEST
|
| Constructor Summary | |
|---|---|
X10Sequence()
|
|
| Method Summary | |
|---|---|
void |
addAddress(int house,
int device)
Append a new "set address" operation to the sequence |
void |
addExtData(int house,
int device,
int cmd,
int data)
Append a new "do function" operation to the sequence |
void |
addFunction(int house,
int function,
int dimcount)
Append a new "do function" operation to the sequence |
static int |
decode(int i)
Get house (A-P as 1-16) or device (1-16) from line-coded value. |
static int |
encode(int i)
For the house (A-P) and device (1-16) codes, get the line-coded value. |
static String |
formatAddressByte(int b)
Pretty-print an address code |
static String |
formatCommandByte(int b)
Pretty-print a function code |
static String |
functionName(int i)
Return a human-readable name for a function code |
X10Sequence.Command |
getCommand()
Retrieve the next command in the sequence |
static String |
houseCodeToText(int hC)
Translate House Code to text |
static String |
houseValueToText(int hV)
Translate House Value (1 to 16) to text |
void |
reset()
Next getCommand will be the first in the sequence |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FUNCTION_ALL_UNITS_OFF
public static final int FUNCTION_ALL_LIGHTS_ON
public static final int FUNCTION_ON
public static final int FUNCTION_OFF
public static final int FUNCTION_DIM
public static final int FUNCTION_BRIGHT
public static final int FUNCTION_ALL_LIGHTS_OFF
public static final int FUNCTION_EXTENDED_CODE
public static final int FUNCTION_HAIL_REQUEST
public static final int FUNCTION_HAIL_ACKNOWLEDGE
public static final int FUNCTION_PRESET_DIM_1
public static final int FUNCTION_PRESET_DIM_2
public static final int FUNCTION_EXTENDED_DATA_TRANSFER
public static final int FUNCTION_STATUS_ON
public static final int FUNCTION_STATUS_OFF
public static final int FUNCTION_STATUS_REQUEST
public static final int EXTCMD_DIM
| Constructor Detail |
|---|
public X10Sequence()
| Method Detail |
|---|
public void addFunction(int house,
int function,
int dimcount)
public void addAddress(int house,
int device)
public void addExtData(int house,
int device,
int cmd,
int data)
public void reset()
public X10Sequence.Command getCommand()
public static String functionName(int i)
public static int encode(int i)
public static int decode(int i)
public static String formatAddressByte(int b)
public static String formatCommandByte(int b)
public static String houseValueToText(int hV)
public static String houseCodeToText(int hC)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||