|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractTrigger
stella.parameter.SimpleTrigger
stella.parameter.AbstractSwitch
stella.parameter.RS485Switch
stella.sensor.HumiditySwitch
public class HumiditySwitch
A switch that listens to a sensor and, based on the reading, switches an RS485-relay on and off. This switch implements dehumidification of the STELLA bay. The humidity switch has the following properties:
KEY_HUMIDITY, the RS485 commands for
turning the dehumidifier on and off RS485Switch.KEY_SWITCHON and
RS485Switch.KEY_SWITCHOFF. The roof-closed trigger is a special one that
must be present in the environment master.
KEY_BIND is true.stella.io.DriverDepending,
ParameterDepending, and the WeatherDependingParameter
interfaces.Toggling instance id bound to this switch to make
reaction independent from weather casting, i.e. the KEY_JUDGE
key points to a triggering class name, normally a
SchmidtTrigger.
The parameters for the Toggling instance are raw-values of the
humidity sensor and given in KEY_JUDGEPARAMETERS.KEY_RETARDON and
KEY_RETARDOFF that retard proper switching after a toggle event
has been registered.KEY_TIMEOUT points to a value above zero, then the
dehumidifier is turned off automatically after the stated time.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private DataCaster |
bayhumidity
The data caster that delivers the humidity measurements. |
private static boolean |
DEFBIND
The default auto-binding as a RemoteParameter. |
private static String |
DEFBINDNAME
Default bind name. |
private static String |
DEFHUMIDITY
The default humidity sensor to watch. |
private static String |
DEFJUDGE
The class name of the default toggling instance. |
private static String |
DEFJUDGEPARAMETERS
The default toggling instance parameters. |
static String |
DEFNAME
The default parameter name. |
private static long |
DEFRETARDOFF
The default time-out after which turn-off is again allowed. |
private static long |
DEFRETARDON
The default time-out after which turn-on is again allowed. |
private static String |
DEFSERIAL
The default serial driver name. |
private static String |
DEFSWITCHOFF
The default serial command to switch on the light. |
private static String |
DEFSWITCHON
The default serial command to switch on the light. |
private static long |
DEFTIMEOUT
The default time out after which dehumidifier is turned off again. |
static String |
KEY_BIND
The default binding behaviour. |
static String |
KEY_HUMIDITY
The name of the humidity switch. |
static String |
KEY_JUDGE
The class-name of the Toggling instance. |
static String |
KEY_JUDGEPARAMETERS
The parameters to the Toggling instance. |
static String |
KEY_RETARDOFF
The retard time for switching on again. |
static String |
KEY_RETARDON
The retard time for switching on again. |
static String |
KEY_TIMEOUT
The default time out for light switch off. |
private long |
lastoff
The last time we successfully switched the dehumidifier off. |
private long |
laston
The last time we successfully switched the dehumidifier on. |
private double |
lastraw
The last valid raw humidity received. |
private Trigger |
shut
The status of the roof. |
private Toggling |
toggle
The Toggling instance to judge for dehumidification-on. |
| Fields inherited from class stella.parameter.RS485Switch |
|---|
KEY_INITOFF, KEY_SERIAL, KEY_SWITCHOFF, KEY_SWITCHON |
| Fields inherited from class stella.parameter.SimpleTrigger |
|---|
KEY_INITBOOLEAN |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
HumiditySwitch(Map prop)
Constructs a new living reference of a cabinet switch. |
|
| Method Summary | |
|---|---|
boolean |
bindToRegistry()
Binds to registry. |
void |
dataAvailable(DataEvent de)
Registers a new data event. |
void |
exit()
We deregister from the humidity sensor prior to exiting. |
Object |
getForWeather(WeatherSurveying weather)
Defined by the weather-depending interface, but not used here. |
void |
init()
Initializes the Toggling instance. |
Object |
provideStatus()
As a stust, we provide also info on current weather etc. |
void |
registerParameter(Parameter roof)
Registers the roof. |
void |
registerWeather(WeatherSurveying sensors)
Registers a weather surveyor permanently to this parameter. |
Object |
rmiProvideStatus()
As a stust, we provide also info on current weather etc. |
boolean |
turnOff()
Additionally to turning the switch off, we must record the time for proper retarding. |
boolean |
turnOn(long timeout)
Additionally to turning the switch on, we must record the time for proper retarding. |
boolean |
unbindFromRegistry()
Unbinds from registry. |
| Methods inherited from class stella.parameter.RS485Switch |
|---|
off, on, registerDriver, rescanned |
| Methods inherited from class stella.parameter.SimpleTrigger |
|---|
getLastToggleTime, getTrigger, setTrigger |
| Methods inherited from class stella.parameter.AbstractTrigger |
|---|
get, getElapsedToggleTime, isTrue, set, toggleTrigger |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Parameter |
|---|
get, getFormatted, getName, getString, set |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.Reloadable |
|---|
reload |
| Methods inherited from interface stella.Trigger |
|---|
getElapsedToggleTime, getLastToggleTime, getTrigger, isTrue, setTrigger, toggleTrigger |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_HUMIDITY
public static final String KEY_JUDGE
Toggling instance.
public static final String KEY_JUDGEPARAMETERS
Toggling instance.
public static final String KEY_RETARDON
public static final String KEY_RETARDOFF
public static final String KEY_TIMEOUT
public static final String KEY_BIND
public static final String DEFNAME
private static final String DEFSERIAL
private static final String DEFSWITCHON
private static final String DEFSWITCHOFF
private static final String DEFHUMIDITY
private static final String DEFJUDGE
private static final String DEFJUDGEPARAMETERS
private static final long DEFRETARDON
private static final long DEFRETARDOFF
private static final long DEFTIMEOUT
private static final boolean DEFBIND
RemoteParameter.
private static final String DEFBINDNAME
private Toggling toggle
Toggling instance to judge for dehumidification-on.
private Trigger shut
private DataCaster bayhumidity
private double lastraw
private long laston
private long lastoff
| Constructor Detail |
|---|
public HumiditySwitch(Map prop)
throws RemoteException
RemoteException| Method Detail |
|---|
public void init()
Toggling instance.
init in interface Initializableinit in class RS485Switchpublic void registerParameter(Parameter roof)
registerParameter in interface ParameterDependingpublic Object getForWeather(WeatherSurveying weather)
getForWeather in interface WeatherDependingParameterpublic void registerWeather(WeatherSurveying sensors)
KEY_HUMIDITY
registerWeather in interface WeatherDependingParameterpublic void dataAvailable(DataEvent de)
dataAvailable in interface DataListener
public boolean bindToRegistry()
throws RemoteException
RemoteException
public boolean unbindFromRegistry()
throws RemoteException
RemoteExceptionpublic boolean turnOn(long timeout)
turnOn in interface SwitchturnOn in class AbstractSwitchtimeout - The maximum time the switch should be on (ms), zero for
unlimited.
public boolean turnOff()
turnOff in interface SwitchturnOff in class AbstractSwitchpublic void exit()
exit in interface ExitCleaningexit in class AbstractParameterpublic Object provideStatus()
provideStatus in interface StatusProviding
public Object rmiProvideStatus()
throws RemoteException
rmiProvideStatus in interface RmiStatusProvidingRemoteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||