public class SerialValue extends AbstractValue implements DriverDepending, Reloadable
#KEY_SWITCHON and #KEY_SWITCHOFF.#KEY_BIND is true.DriverDepending interface.#KEY_INITOFF key. #turnOnTimeout method switches on, but switches off again after the
stated period.| Modifier and Type | Class and Description |
|---|---|
static class |
SerialValue.DewarPressure
Dewar pressure conversion function.
|
static class |
SerialValue.Test
Test class.
|
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private Double |
cache
The old value, if reading fails.
|
private Function |
convert
The function to calculate the true value out of the reading.
|
private static boolean |
DEFALLOWCACHE
Default cache is allowed.
|
static String |
KEY_ALLOWCACHE
If true we allow cached returns in case of read failures.
|
static String |
KEY_FUNCTIONCLASS
The conversion function class.
|
static String |
KEY_FUNCTIONINIT
The conversion function init.
|
static String |
KEY_SERIAL
The name of the serial server to use.
|
static String |
KEY_WRITE
The command we write to the serial server to read in the value.
|
private boolean |
lastread
True, if last read was successful.
|
private AbstractSerialDriver |
serial
The serial server to send commands to.
|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
SerialValue(Map<String,String> prop)
Constructs a new light switch trigger.
|
| Modifier and Type | Method and Description |
|---|---|
Number |
getValue()
Getting the value is writing to the server and reading in the response.
|
void |
init()
Initializes the light 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.
|
Number |
setValue(Number w)
Setting the value is not allowed.
|
get, setcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreloadgetFormatted, getName, getStringdefaultBoolean, 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, stringPropertiespublic static final String KEY_SERIAL
public static final String KEY_WRITE
public static final String KEY_ALLOWCACHE
public static final String KEY_FUNCTIONCLASS
public static final String KEY_FUNCTIONINIT
private static final boolean DEFALLOWCACHE
private AbstractSerialDriver serial
private Function convert
private Double cache
private boolean lastread
public void init()
init in interface Initializableinit in class AbstractParameterpublic double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class AbstractParameterpublic boolean registerDriver(Driver rs485)
PollingRS485Server. If so, it's name is check to match the
KEY_SERIAL name. If this, too, is fulfilled, the server is
passed to the super-method, which does the necessary cache change
registration. Additionally an instance of this server is stored locally
to allow sending of commands to the serial server.registerDriver in interface DriverDepending