org.wcb.autohome.implementations
Class X10Module

java.lang.Object
  extended byorg.wcb.autohome.implementations.X10Module
All Implemented Interfaces:
IX10Module, java.io.Serializable, X10DeviceConstants

public class X10Module
extends java.lang.Object
implements IX10Module, java.io.Serializable, X10DeviceConstants

Filename: $Id: X10Module.java,v 1.6 2004/02/28 00:21:49 wbogaardt Exp $ Abstract: Represents the X10 module which is either an appliance or light controller. There are 16 house codes represented with the characters A-P and 16 section codes represented by integers 1-16. The X10 module stores this and the type of device assigned to the alphanumeric combination so that information to the interfaces can be forwared accordingly. Since certain commands are restricted to certain modules. Such that a Light module is allowed to dim or brighten incrementally where as an appliance module which cares more load can simply be turned on or off.

Version:
1.1 $Log: X10Module.java,v $ Revision 1.6 2004/02/28 00:21:49 wbogaardt fixed formating to be compliant with sun coding convention Revision 1.5 2004/01/16 00:53:43 wbogaardt Fixed a very obscure bug with the Macro Panel that it didn't added new x10 devices to the drop down of available x10 device for the macro. Modified Macro triggers to change the events to integer verses strings cleaner this way. Revision 1.4 2004/01/15 21:05:20 wbogaardt major revamp of Modules and interfaces changes overall structure of how information is stored Revision 1.3 2003/12/13 05:36:52 wbogaardt fixed javadoc comments. Revision 1.2 2003/12/12 23:17:36 wbogaardt javadoc comments refactored methods so they are more descriptive
Author:
wbogaardt
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.wcb.autohome.interfaces.X10DeviceConstants
APPLIANCE_MODULE_OFF, APPLIANCE_MODULE_ON, BAUD, BAUD_RATE_ARRAY, BRIGHT_ACTION, BROWSER, CM11A_TRANSMITTER, CM17A_TRANSMITTER, CONNECT_ON_START, COUNTRY, DATA_BIT, DATA_BITS_ARRAY, DEVICE_ARRAY, DIM_ACTION, EMAIL_AUTHORIZE, EMAIL_FREQUENCY, EMAIL_FROM, EMAIL_PASSWORD, EMAIL_SMTP, EMAIL_TO, EMAIL_USERNAME, FALSE, HOUSE_CODES_ARRAY, INTERFACE_TYPE, LAMP_MODULE_OFF, LAMP_MODULE_ON, LANGUAGE, LAST_FILE, LOCALHOST, LOOK_AND_FEEL, MAC, METAL, MOTIF, OFF_ACTION, ON_ACTION, PARITY, PARITY_ARRAY, RECOVER_CM11A, RMI_HOST, SEPARATOR, SERIAL_PORT, SPEECH_ENGINE, STOP_BIT, STOP_BITS_ARRAY, TEST_TRANSMITTER, TIMER_EVENT, TRIGGER_EVENT, TRUE, USER_HOME, WINDOWS
 
Constructor Summary
X10Module()
          Default constructor that creates a Lamp Module with an A1 identifier
X10Module(char a, int i, java.lang.String sN, java.lang.String desc, int iType)
          Full constructor to create the x10 module
X10Module(IX10Module newO)
          clone constructor using the interface class to create the object
 
Method Summary
 java.lang.String getDescription()
          user defined description of the x10 module.
 int getDeviceCode()
          X10 device code this is the numeric value in the x10 device modules.
 java.lang.String getFullDeviceCode()
          The entire x10 module code, which is a combination of House code and device code.
 char getHouseCode()
          Returns a character of 'A' to 'P' for valid house codes or module grouping of the x10 devices
 java.lang.String getName()
          Get the name of the X10 Module
 int getType()
          X10 module type either lamp or appliance module.
 void print()
          print routine for debugging purpose
 void setDescription(java.lang.String sDesc)
          Description of the X10 module such as location or purpose.
 void setDeviceCode(int iDevice)
          Setter for x10 device code
 void setHouseCode(char cHouse)
          Setter for house code.
 void setName(java.lang.String sNam)
          Set the name of the device
 void setType(int iTyp)
          X10 module type or purpose should be either a X10DeviceConstants.LAMP_MODULE_ON = 1 or X10DeviceConstants.APPLIANCE_MODULE_ON = 2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

X10Module

public X10Module(char a,
                 int i,
                 java.lang.String sN,
                 java.lang.String desc,
                 int iType)
Full constructor to create the x10 module

Parameters:
a - House code A-P
i - Device code 1-16
sN - Identifying name of module
desc - Description of the module
iType - Module type either Lamp - 1 or Appliance - 2

X10Module

public X10Module()
Default constructor that creates a Lamp Module with an A1 identifier


X10Module

public X10Module(IX10Module newO)
clone constructor using the interface class to create the object

Parameters:
newO - The interface to clone an object from
Method Detail

print

public void print()
print routine for debugging purpose


setHouseCode

public void setHouseCode(char cHouse)
Setter for house code.

Specified by:
setHouseCode in interface IX10Module
Parameters:
cHouse - should be a value between 'A' and 'P'

setDeviceCode

public void setDeviceCode(int iDevice)
Setter for x10 device code

Specified by:
setDeviceCode in interface IX10Module
Parameters:
iDevice - Should be a value between 1 and 15

setName

public void setName(java.lang.String sNam)
Set the name of the device

Specified by:
setName in interface IX10Module
Parameters:
sNam - The identifying name of the module

setDescription

public void setDescription(java.lang.String sDesc)
Description of the X10 module such as location or purpose.

Specified by:
setDescription in interface IX10Module
Parameters:
sDesc - Description of the module

setType

public void setType(int iTyp)
X10 module type or purpose should be either a X10DeviceConstants.LAMP_MODULE_ON = 1 or X10DeviceConstants.APPLIANCE_MODULE_ON = 2

Specified by:
setType in interface IX10Module
Parameters:
iTyp - Either 1 or 2

getHouseCode

public char getHouseCode()
Returns a character of 'A' to 'P' for valid house codes or module grouping of the x10 devices

Specified by:
getHouseCode in interface IX10Module
Returns:
between 'A' to 'P'

getDeviceCode

public int getDeviceCode()
X10 device code this is the numeric value in the x10 device modules.

Specified by:
getDeviceCode in interface IX10Module
Returns:
value 1 to 15

getName

public java.lang.String getName()
Get the name of the X10 Module

Specified by:
getName in interface IX10Module
Returns:
Defaults to 'Lamp'.

getDescription

public java.lang.String getDescription()
user defined description of the x10 module.

Specified by:
getDescription in interface IX10Module
Returns:
user defined name description

getType

public int getType()
X10 module type either lamp or appliance module.

Specified by:
getType in interface IX10Module
Returns:
1 for lamp, 2 for appliance

getFullDeviceCode

public java.lang.String getFullDeviceCode()
The entire x10 module code, which is a combination of House code and device code. For example A1.

Specified by:
getFullDeviceCode in interface IX10Module
Returns:
combined house code and device code.


Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.