jmri.jmrix.powerline
Class InsteonSequence

java.lang.Object
  extended by jmri.jmrix.powerline.InsteonSequence

public class InsteonSequence
extends Object

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.

Author:
Bob Coleman Copyright (C) 2010, Bob Jacobsen Copyright (C) 2008, Ken Cameron Copyright (C) 2010

Nested Class Summary
static class InsteonSequence.Address
          Represent a single "set address" Insteon command
static interface InsteonSequence.Command
          Represent a single Insteon command, which is either a "set address" or "do function" operation
static class InsteonSequence.ExtData
          Represent a single "Extended Data" Insteon command
static class InsteonSequence.Function
          Represent a single "do function" Insteon command
 
Constructor Summary
InsteonSequence()
           
 
Method Summary
 void addAddress(int idhighbyte, int idmiddlebyte, int idlowbyte)
          Append a new "set address" operation to the sequence
 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
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
 InsteonSequence.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
 

Constructor Detail

InsteonSequence

public InsteonSequence()
Method Detail

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


addAddress

public void addAddress(int idhighbyte,
                       int idmiddlebyte,
                       int idlowbyte)
Append a new "set address" operation to the sequence


reset

public void reset()
Next getCommand will be the first in the sequence


getCommand

public InsteonSequence.Command getCommand()
Retrieve the next command in the sequence


functionName

public static String functionName(int i)
Return a human-readable name for a function code


encode

public static int encode(int i)
For the house (A-P) and device (1-16) codes, get the line-coded value. Argument is from 1 to 16 only.


decode

public static int decode(int i)
Get house (A-P as 1-16) or device (1-16) from line-coded value.


formatAddressByte

public static String formatAddressByte(int b)
Pretty-print an address code


formatCommandByte

public static String formatCommandByte(int b)
Pretty-print a function code


houseValueToText

public static String houseValueToText(int hV)
Translate House Value (1 to 16) to text


houseCodeToText

public static String houseCodeToText(int hC)
Translate House Code to text



Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads