|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.wcb.autohome.AutoHomeSession
This class is a base class that holds most of the common methods that are accessed either via the command line daemon or the gui. Most of the functions handled through this class are for communications between the interface layer and the serial port, although all of the real process handled on the serial port end is done by the HAGateway object.
Field Summary | |
static java.lang.String |
CURRENT_FILENAME
The Current File name loaded into the application. |
protected IDeviceRemote |
deviceFactory
|
protected IHAGateway |
gateway
|
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 | |
AutoHomeSession()
|
Method Summary | |
void |
buildTriggerMacros(boolean bClear)
This builds the macro trigger events for both the timer type triggers and for the macro module initiators. |
void |
clearMacroEventsFromCM11A()
Clears only the event driven macros from the CM11A. |
void |
clearTimerMacrosFromCM11A()
Clears only the timer event driven macros from the CM11A. |
void |
closeSerialPort()
This closes the port that had been opend by the user to the CM11A or CM17A interface module |
void |
connectPortToDevice(int iDeviceType)
Based on the user's select it will set the port to the string variable that is sent. |
void |
connectSerialOnStartup(boolean bVal)
The User may opt to want to automatically connect the serial port to the X10 gateway on subsequent start up of the application. |
boolean |
connectToSerialPortOnStartup()
After reading in jhome.prop if initial.on.start indicates true then return a true to have the application automatically connect serial port up. |
void |
createNewFile(java.lang.String sfilename)
Creates a new file and sets the current file name sets settings to default value. |
void |
deleteMacro(IMacro mac)
Removes the indicated macro from the file system. |
boolean |
disableMonitorCM11A()
Disables the monitoring of the CM11A device. |
void |
enableSpeechEngine(boolean bValue)
This allows the user to enable the speech engine or disable it if it gets irratating when listening to messages. |
java.util.Vector |
getAvailablePorts()
Calls the HAGateway class, which uses the java comm api to enumerate through the serial and parallel ports on the operating system. |
int |
getCM11ABatteryUsage()
Retrieves the CM11A's current battery usage. |
java.util.GregorianCalendar |
getCM11ADate()
Get the current date that the CM11A thinks it is. |
java.lang.String |
getCountry()
Gets the last saved country value for internationalization. |
EmailHeaderBean |
getEmailInformation()
This allows the getting of email configruations from the HASConfig.ini file in a single object bean. |
java.util.ResourceBundle |
getI18n()
Get internationalization resources. |
java.lang.String |
getLookAndFeel()
Gets the Swing ui look and feel for the user. |
SerialPortBean |
getSerialPort()
Returns the string name of the serial port. |
int |
getX10GatewayType()
Gets the x10 interfae type, which is either a CM11A or CM17A serial port device. |
boolean |
isAutoRecoverCM11A()
This returns the value of the HASConfig file which indicates that the user wants to or does not want to auto recover the CM11A on a power failure. |
boolean |
isEventDaemonRunning()
Checks if the events daemon is already running |
boolean |
isSpeechEnabled()
Returns a true if the speech engine is enabled by the user other wise it returns false. |
boolean |
isX10GatwayConnected()
returns a boolean based on if the selected port has been activated or shutdown by the user/application. |
void |
lampIntensity(IX10Module x10Evt,
int cmnd,
int iPercentage)
This controls the lights for only for dim and brighten events |
java.util.Vector |
loadAllAliceEvents()
Loads from file all the IX10Events, which are specific to the Alice system. |
java.util.Vector |
loadAllAliceMonitors()
Gets a vector from the saved file settings all of the monitor events that the user wants to monitor |
java.util.Vector |
loadAllCM11AMacros()
Loads all the macros that have been stored in a file system. |
java.util.Vector |
loadAllX10Devices()
Loads from a file all the X10 devices that have been saved under the modules panel of the gui or website. |
java.util.Vector |
loadCM11AMacroTriggers()
Loads from file all the macro triggers for a set macro. |
protected void |
loadServices(UIDefaultsLoader props)
Deprecated. |
protected void |
loadStandAloneService(java.lang.String sDirectory)
Starts up all the services for the Alice gui or web application. |
void |
loadX10File(java.lang.String sfilename)
Loads the serialized file of objects from the user's operating system. |
boolean |
monitorCM11A()
Enables monitoring of the CM11A device. |
void |
recoverCM11A(boolean bValue)
Indicates that the user either wants the CM11A to autorecover upon detecting a power failure. |
boolean |
runEventsDaemon()
Starts the events daemon which runs the events of times and on off for various modules. |
void |
saveAllAliceEvents(java.util.Vector vEvents)
Saves to a file all the IX10Events, which are specific to the Alice system. |
void |
saveAllAliceMonitors(java.util.Vector vMonitors)
Allows saving of monitor events panel to the file system |
void |
saveAllCM11AMacros(java.util.Vector vMacros)
Saves to the file system all the IMacro objects. |
void |
saveAllX10Devices(java.util.Vector vX10Devices)
Saves to a file all the X10 devices added or modified in the modules tab of the gui or web interface. |
void |
saveCM11AMacroTriggers(java.util.Vector vMacroTrig)
Saves a vector of IMacroTrigger objects to the file system. |
void |
saveFile(java.lang.String sfileName)
Saves all of the module information to the user selected save to file this method is usually called from a save or save as command. |
void |
saveMacro(IMacro mac)
Save the IMacro to the file system in memory. |
void |
saveServerFile()
Saves the server file settings, which are the serial port information, email information, and look and feel for the swing gui. |
void |
sendCommandToSection(char cHouseCode,
int iCmnd)
These are commands that can be sent to the entire house code in a particular section regardless if it is an appliance or light module. |
void |
sendCommandToX10Module(IX10Module x10module,
int iCmd)
This controls the appliance modules for only On/Off events The commands are either X10DeviceConstants.OFF_ACTION = 0 X10DeviceConstants.ON_ACTION = 1 |
void |
setCM11AClock(java.util.Calendar calendar,
char houseCode,
boolean batteryTimer,
boolean clrMonitored,
boolean purgeTimer)
allows the user to set or send commands to set the CM11A clock settings This command needs the hours,minutes, seconds, month, day , day of week, house code character value, whether to reset the battery timer, clear the CM11A from monitoring the house, or purge the macro timer. |
void |
setCountry(int iCountry)
allows setting of country for internationalization 1 is dutch, 2 is german, 3 is GB english, default is US english |
void |
setEmailInformation(EmailHeaderBean bean)
This sets the configuration files settings from a bean object. |
void |
setInterfaceType(int iType)
This is either the CM11A or CM17A devices identified as X10DeviceConstants.CM11A_TRANSMITTER = 1 or X10DeviceConstants.CM17A_TRANSMITER = 2 |
void |
setLookAndFeel(java.lang.String sLF)
Sets the look and feel from the user selected option and saves this to the HAConfig.ini file for subsequent reload of the application. |
void |
setMonitorModel(MonitorTableModel mModel)
This allows the gateway to have reference to the monitor table modle so that when the user decides to monitor the table object events and the table can update each other. |
void |
setSerialPort(SerialPortBean sPortName)
Sets the serial port to the passed in string value. |
protected void |
showMessage(java.lang.String sMessages)
simple method to print messages to gui or console This will also speak the message if the speech plugin has been loaded by the class loader. |
void |
stopEventsDaemon()
Stops the events daemon which is the table of on off and devices and times table. |
void |
updateCM11AStatus()
Update the Status of the CM11A device |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String CURRENT_FILENAME
protected IDeviceRemote deviceFactory
protected IHAGateway gateway
Constructor Detail |
public AutoHomeSession()
Method Detail |
protected void loadServices(UIDefaultsLoader props)
props
- Properties file with key value pairprotected void loadStandAloneService(java.lang.String sDirectory)
sDirectory
- Directory string path where the ini files can be found.public java.util.ResourceBundle getI18n()
public java.lang.String getCountry()
public void setCountry(int iCountry)
iCountry
- Country codepublic java.util.Vector getAvailablePorts()
public boolean isX10GatwayConnected()
public void closeSerialPort() throws HomeException
HomeException
- Caught exception but needs to be reported to user.public boolean runEventsDaemon()
public void stopEventsDaemon()
public boolean isEventDaemonRunning()
public int getX10GatewayType()
public void setInterfaceType(int iType)
iType
- should be a 1 or 2.public int getCM11ABatteryUsage()
public void sendCommandToX10Module(IX10Module x10module, int iCmd) throws HomeException
x10module
- Module that the command is being sent.iCmd
- Numeric value of command to send this is either a 0 or 1.
HomeException
- Caught exception but needs to be reported to user.public void sendCommandToSection(char cHouseCode, int iCmnd) throws HomeException
cHouseCode
- the house code value 'A' through 'P'iCmnd
- 0 is all lights off, 1 all lights on, 2 all x10 devices off.
HomeException
- Caught exception but needs to be reported to user.public void recoverCM11A(boolean bValue)
bValue
- true indicates to recover the CM11A device.public boolean isAutoRecoverCM11A()
public void updateCM11AStatus()
public java.util.GregorianCalendar getCM11ADate()
public void setCM11AClock(java.util.Calendar calendar, char houseCode, boolean batteryTimer, boolean clrMonitored, boolean purgeTimer) throws HomeException
calendar
- Calendar date and time to send to the CM11AhouseCode
- The house code which should be AbatteryTimer
- Reset the battery timer use TrueclrMonitored
- Clear monitored macros use TruepurgeTimer
- Purge timed macros use True.
HomeException
- Caught exception but needs to be reported to user.public void connectPortToDevice(int iDeviceType) throws HomeException
iDeviceType
- either a 1 for CM11A or 2 for CM17A.
HomeException
- Caught exception but needs to be reported to user.public void setSerialPort(SerialPortBean sPortName)
sPortName
- SerialPortBean representation of the port and valuespublic SerialPortBean getSerialPort()
public java.lang.String getLookAndFeel()
public void setLookAndFeel(java.lang.String sLF)
sLF
- Class package name of the look and feel.public EmailHeaderBean getEmailInformation()
public void setEmailInformation(EmailHeaderBean bean)
bean
- contains information to be stored in HASConfig.ini file.public void lampIntensity(IX10Module x10Evt, int cmnd, int iPercentage) throws HomeException
x10Evt
- x10 modulecmnd
- Either 0 for dim 1 for brighteniPercentage
- percentation to change between 1 and 100.
HomeException
- Caught exception but needs to be reported to user.public void saveServerFile()
public void connectSerialOnStartup(boolean bVal)
bVal
- True sets automatic connect to serial portpublic void enableSpeechEngine(boolean bValue)
bValue
- true enables speech false disables.public boolean connectToSerialPortOnStartup()
public boolean isSpeechEnabled()
public void buildTriggerMacros(boolean bClear) throws HomeException
bClear
- true value clears all macros from the interface before uploading.
HomeException
- - Either remote exception or unable to build a macro triggerpublic void clearTimerMacrosFromCM11A() throws HomeException
HomeException
- Caught exception but needs to be reported to user.public void clearMacroEventsFromCM11A() throws HomeException
HomeException
- Caught exception but needs to be reported to user.public boolean monitorCM11A()
public boolean disableMonitorCM11A()
public void setMonitorModel(MonitorTableModel mModel)
mModel
- The monitoring table modelpublic void saveMacro(IMacro mac)
mac
- Macro to save in the file system.public void deleteMacro(IMacro mac)
mac
- Macro to be removedpublic java.util.Vector loadAllX10Devices()
public void saveAllX10Devices(java.util.Vector vX10Devices)
vX10Devices
- Vector of IX10Modulepublic java.util.Vector loadAllAliceEvents()
public void saveAllAliceEvents(java.util.Vector vEvents)
vEvents
- Vector of IX10Eventspublic void saveAllAliceMonitors(java.util.Vector vMonitors)
vMonitors
- Vector of IX10MonitorEvents objectspublic java.util.Vector loadAllAliceMonitors()
public java.util.Vector loadAllCM11AMacros()
public void saveAllCM11AMacros(java.util.Vector vMacros)
vMacros
- Vector of IMacro objectspublic java.util.Vector loadCM11AMacroTriggers()
public void saveCM11AMacroTriggers(java.util.Vector vMacroTrig)
vMacroTrig
- Vector of IMacroTriggerpublic void loadX10File(java.lang.String sfilename)
sfilename
- Full path and file namepublic void createNewFile(java.lang.String sfilename)
sfilename
- The file name for the new file.public void saveFile(java.lang.String sfileName) throws HomeException
sfileName
- Full path and file name
HomeException
- Caught exception but needs to be reported to user.protected void showMessage(java.lang.String sMessages)
sMessages
- text message to print.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |