dea.hc
Class HcManager

java.lang.Object
  extended bydea.hc.HcManager
All Implemented Interfaces:
IDebugLevels

public class HcManager
extends java.lang.Object
implements IDebugLevels

Title: Home Controller Manager class
Description: A collection of methods for the home controler app.
Copyright: Copyright (c) 2004
Company: RMRR

@author David Abigt
@version 1.0


Field Summary
static java.lang.String ANALOG_IN
           
static int CMD_DIA
           
static int CMD_DIB
           
static int CMD_FLAG
           
static int CMD_IR
           
static int CMD_RO
           
static int CMD_TIMER
           
static int CMD_VAR
           
static int CMD_X10
           
static java.lang.String IR_OUT
          There are 254 of these but we do not currently support it since it requires an external device I do not have.
static java.lang.String RELAY_IN
           
static java.lang.String RELAY_OUT
           
static java.lang.String VERSION
           
static int X_MAX
           
static int X_MIN
           
static java.lang.String[] XCODES
           
 
Fields inherited from interface dea.common.IDebugLevels
BASIC, DEBUG_ALL, ERROR, METH_DETAIL, METH_ENTER, METH_EXIT, METH_EXT, METH_GET, METH_SET, METH_VARS, SHOW_PASS
 
Constructor Summary
HcManager()
           
 
Method Summary
static Hc_devices getDev(java.lang.String code, int unit, Db db)
          Get a Hc_devices record from the local cache.
static java.util.HashMap getDevs(Db db)
          Get a HashMap keyed by house code (String) of HasMaps keyed by unit number (Integer) of all the Hc_devices records cached from the DB.
static Hc_echo getLast(int devType, Db db)
          Get the most recent Hc_echo record of a type.
static java.util.ArrayList getNamedVars(Db db)
           
static Hc_vars getVar(java.lang.String code, int unit, Db db)
          Get var that is associated with a device.
static int hexToInt(char c)
          Convert hex char to int.
static int hexToInt(char ca, char cb)
          Convert 2 hex chars to int.
static void main(java.lang.String[] args)
          Populates the Hc_devices table with initial values.
static void populateDevs()
          Deprecated. will be moved to a more logical class once structure is firmed up.
 void test()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

XCODES

public static final java.lang.String[] XCODES

ANALOG_IN

public static final java.lang.String ANALOG_IN
See Also:
Constant Field Values

RELAY_IN

public static final java.lang.String RELAY_IN
See Also:
Constant Field Values

RELAY_OUT

public static final java.lang.String RELAY_OUT
See Also:
Constant Field Values

IR_OUT

public static final java.lang.String IR_OUT
There are 254 of these but we do not currently support it since it requires an external device I do not have.

See Also:
Constant Field Values

X_MIN

public static final int X_MIN
See Also:
Constant Field Values

X_MAX

public static final int X_MAX
See Also:
Constant Field Values

CMD_X10

public static final int CMD_X10
See Also:
Constant Field Values

CMD_TIMER

public static final int CMD_TIMER
See Also:
Constant Field Values

CMD_FLAG

public static final int CMD_FLAG
See Also:
Constant Field Values

CMD_VAR

public static final int CMD_VAR
See Also:
Constant Field Values

CMD_RO

public static final int CMD_RO
See Also:
Constant Field Values

CMD_IR

public static final int CMD_IR
See Also:
Constant Field Values

CMD_DIA

public static final int CMD_DIA
See Also:
Constant Field Values

CMD_DIB

public static final int CMD_DIB
See Also:
Constant Field Values
Constructor Detail

HcManager

public HcManager()
Method Detail

hexToInt

public static int hexToInt(char c)
Convert hex char to int.

Parameters:
c -
Returns:
int - returns 0 if char is not hex digit

hexToInt

public static int hexToInt(char ca,
                           char cb)
Convert 2 hex chars to int.

Parameters:
ca -
cb -
Returns:
int - returns 0 if either char is not hex digit

populateDevs

public static void populateDevs()
                         throws java.sql.SQLException,
                                java.lang.ClassNotFoundException
Deprecated. will be moved to a more logical class once structure is firmed up.

Add missing devices to the devices table. Note IR out is not currently supported. Also this provides devices found on the Time Commander Plus without additional options. As such it should be moved to another class and likely will be in the near future.

Throws:
java.sql.SQLException
java.lang.ClassNotFoundException

getDevs

public static java.util.HashMap getDevs(Db db)
                                 throws java.sql.SQLException
Get a HashMap keyed by house code (String) of HasMaps keyed by unit number (Integer) of all the Hc_devices records cached from the DB.

Parameters:
db -
Returns:
HashMap
Throws:
java.sql.SQLException

getDev

public static Hc_devices getDev(java.lang.String code,
                                int unit,
                                Db db)
Get a Hc_devices record from the local cache.

Parameters:
code -
unit -
db -
Returns:
Hc_devices

getVar

public static Hc_vars getVar(java.lang.String code,
                             int unit,
                             Db db)
Get var that is associated with a device. Mainly for handling Analog Inputs which update vars so we don't have to poll the contoller constantly to get non echoing info

Parameters:
code -
unit -
Returns:
Hc_vars

getNamedVars

public static java.util.ArrayList getNamedVars(Db db)
Parameters:
db -
Returns:

getLast

public static Hc_echo getLast(int devType,
                              Db db)
Get the most recent Hc_echo record of a type. Only really useful for finding the current state of IO mapped values such as Relay Outs and Relay Ins

Parameters:
devType -
db -
Returns:
Hc_echo

main

public static void main(java.lang.String[] args)
Populates the Hc_devices table with initial values.

Parameters:
args -

test

public void test()


Copyright © 2001-2005 Round Mountain Rescue Ranch. All Rights Reserved.