com.jpeterson.x10.module.event
Class CM11AStatusEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.jpeterson.x10.ControlEvent
              |
              +--com.jpeterson.x10.module.event.CM11AStatusEvent

public class CM11AStatusEvent
extends ControlEvent

See Also:
Serialized Form

Field Summary
static int STATUS
          The CM11A received a status event.
 
Fields inherited from class com.jpeterson.x10.ControlEvent
id
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CM11AStatusEvent(CM11A source, int batteryUsage, int seconds, int minutes, int hours, int julianDay, int currentDay, char monitoredHouseCode, java.util.BitSet lastAddressedDevice, java.util.BitSet onOffStatus, java.util.BitSet dimStatus)
           
 
Method Summary
 int getBatteryUsage()
          The CM11A's idea of what the current battery usage is.
 int getCurrentDay()
          Retrieve the CM11A's idea of what the current day is.
 java.util.BitSet getDimStatus()
          Indication of the dim status as the CM11A sees it for the monitored house code.
 int getHours()
          The CM11A's idea of what the current hour is.
 int getJulianDay()
          Retrieve the CM11A's idea of the current day of the year.
 java.util.BitSet getLastAddressedDevice()
          Indication of the last addressed device as the CM11A sees it for the monitored house code.
 int getMinutes()
          The CM11A's idea of what the current minute is.
 char getMonitoredHouseCode()
          Get the house code that the CM11A is configured to monitor.
 java.util.BitSet getOnOffStatus()
          Indication of the On/Off status as the CM11A sees it for the monitored house code.
 int getSeconds()
          The CM11A's idea of what the current second is.
 java.lang.String paramString()
          Returns a parameter string identifying the event.
 
Methods inherited from class com.jpeterson.x10.ControlEvent
getId, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS

public static final int STATUS
The CM11A received a status event.
Constructor Detail

CM11AStatusEvent

public CM11AStatusEvent(CM11A source,
                        int batteryUsage,
                        int seconds,
                        int minutes,
                        int hours,
                        int julianDay,
                        int currentDay,
                        char monitoredHouseCode,
                        java.util.BitSet lastAddressedDevice,
                        java.util.BitSet onOffStatus,
                        java.util.BitSet dimStatus)
Method Detail

getBatteryUsage

public int getBatteryUsage()
The CM11A's idea of what the current battery usage is.
Returns:
The CM11A's idea of what the current battery usage is. Expressed in minutes.

getSeconds

public int getSeconds()
The CM11A's idea of what the current second is.
Returns:
The CM11A's idea of what the current second is.

getMinutes

public int getMinutes()
The CM11A's idea of what the current minute is.
Returns:
The CM11A's idea of what the current minute is.

getHours

public int getHours()
The CM11A's idea of what the current hour is.
Returns:
The CM11A's idea of what the current hour is.

getJulianDay

public int getJulianDay()
Retrieve the CM11A's idea of the current day of the year. The value is zero based; 0 for January 1, 31 for February 1, ... The value is initialized after a call to updateStatus().

The utility methods CM11A.extractMonth() and CM11A.extractDay() have been provided to convert this value into month and day representations.

As far as I can tell, the CM11A has no way of determining leap years. It therefore always uses 366 days in a year. The caller is responsible for determining if the current day has been corrected for a non-leap year.

Returns:
Day of year.

getCurrentDay

public int getCurrentDay()
Retrieve the CM11A's idea of what the current day is.
Returns:
The CM11A's idea of what the current day is. Will be one of Calendar.SUNDAY, Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY.

getMonitoredHouseCode

public char getMonitoredHouseCode()
Get the house code that the CM11A is configured to monitor. The CM11A device will record changes to devices on the monitored house code. It record the on/off status and if a device is dimmed or not. The data can be retrieved from the methods getOnOffStatus, getDimStatus, get last addressed device.
Returns:
The character from 'A' through 'P' that indicates the house code that is being monitored.

getLastAddressedDevice

public java.util.BitSet getLastAddressedDevice()
Indication of the last addressed device as the CM11A sees it for the monitored house code.
Returns:
The bit is set (true) if the device was addressed, not set (false) if the device was not addressed. The bit index indicates the device: bit index 0 = device 1, bit index 1 = device 2, ..., bit index 15 = device 16.

getOnOffStatus

public java.util.BitSet getOnOffStatus()
Indication of the On/Off status as the CM11A sees it for the monitored house code.
Returns:
The bit is set (true) if the device is on, not set (false) if the device is off. The bit index indicates the device: bit index 0 = device 1, bit index 1 = device 2, ..., bit index 15 = device 16.

getDimStatus

public java.util.BitSet getDimStatus()
Indication of the dim status as the CM11A sees it for the monitored house code.
Returns:
The bit is set (true) if the device is dimmed, not set (false) if the device is not dimmed. The bit index indicates the device: bit index 0 = device 1, bit index 1 = device 2, ..., bit index 15 = device 16.
See Also:
updateStatus

paramString

public java.lang.String paramString()
Returns a parameter string identifying the event. This method is useful for event-logging and for debugging.
Overrides:
paramString in class ControlEvent
Returns:
a string identifying the event