|
||||||||||
| 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.OneWireSwitch
public class OneWireSwitch
A class providing access to a one-wire switch. This means the following:
#KEY_BIND is true.DriverDepending
interface.KEY_INITOFF key.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static boolean |
DEFINITOFF
The initial state of the switch. |
private static String |
DEFSWITCHOFF
The default switch on command. |
private static String |
DEFSWITCHON
The default switch on command. |
static String |
KEY_INITOFF
The key defining initial off. |
static String |
KEY_ONEWIRE
The name of the one-wire driver to use. |
static String |
KEY_PATH
The path to the switch board plus channel, e.g '/12.(add)/PIO.A'. |
static String |
KEY_SWITCHOFF
The string to switch the 1-wire chanel off. |
static String |
KEY_SWITCHON
The string to switch the 1-wire chanel on. |
private OneWireDriver |
serial
The serial server to send commands to. |
| 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 | |
|---|---|
OneWireSwitch(Map prop)
Constructs a new light switch trigger. |
|
| Method Summary | |
|---|---|
void |
init()
Initializes the one wire switch switch. |
protected boolean |
off()
Turn the light off. |
protected boolean |
on()
Turns the switch on. |
String |
readSwitch()
Reads the switch. |
boolean |
registerDriver(Driver rs485)
Registers the driver. |
double |
rescanned(String key,
String old,
String newval)
As any parameter depending instance we fail if the parameter we depend on is now a different one. |
| Methods inherited from class stella.parameter.AbstractSwitch |
|---|
turnOff, turnOn |
| 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, exit, 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 util.Reloadable |
|---|
reload |
| Methods inherited from interface stella.Trigger |
|---|
getElapsedToggleTime, getLastToggleTime, getTrigger, isTrue, setTrigger, toggleTrigger |
| 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.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_ONEWIRE
public static final String KEY_PATH
public static final String KEY_SWITCHON
public static final String KEY_SWITCHOFF
public static final String KEY_INITOFF
private static final String DEFSWITCHON
private static final String DEFSWITCHOFF
private static final boolean DEFINITOFF
private OneWireDriver serial
| Constructor Detail |
|---|
public OneWireSwitch(Map prop)
| Method Detail |
|---|
public double rescanned(String key,
String old,
String newval)
rescanned in interface Reloadablerescanned in class SimpleTriggerpublic void init()
init in interface Initializableinit in class SimpleTriggerpublic boolean registerDriver(Driver rs485)
OneWireDriver. If so, it's name is check to match the
KEY_ONEWIRE name. If this, too, is fulfilled,
an instance of this server is stored locally
to allow sending of commands to the serial server.
registerDriver in interface DriverDependingprotected boolean on()
on in class AbstractSwitchprotected boolean off()
off in class AbstractSwitchpublic String readSwitch()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||