|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mbs.services.cu.generator.DefaultControlUnitModel
org.mbs.services.device.abstractdriver.AbstractDeviceModel
public abstract class AbstractDeviceModel
Base model class for all device models. A model holds the current state of a device.
| Field Summary | |
|---|---|
static java.lang.String |
COMP_NAME
Constant used for logging |
protected java.lang.String |
currentState
id of the current state of the state graph |
protected java.lang.Object |
device
Reference to the underlying device service |
static java.lang.Integer |
INTEGER_MINUS_ONE
a frequent value for state variables |
static java.lang.Integer |
INTEGER_ONE
a frequent value for state variables |
static java.lang.Integer |
INTEGER_ZERO
a frequent value for state variables |
protected DeviceStateGraph |
stateGraph
Device State Graph, may be null |
static java.lang.String |
SVAR_ADDITIONAL_NAME
the id of allowed actions state variable |
static java.lang.String |
SVAR_ALLOWED_ACTIONS
the id of allowed actions state variable |
static java.lang.String |
SVAR_ATTACHMENT_TIME
the id of allowed actions state variable |
| Fields inherited from class org.mbs.services.cu.generator.DefaultControlUnitModel |
|---|
callback, id, stateVarValues, type |
| Constructor Summary | |
|---|---|
AbstractDeviceModel(java.lang.Object device,
java.lang.String type,
java.lang.String id)
Constructs the model |
|
| Method Summary | |
|---|---|
protected java.util.Dictionary |
getStateVariableValues()
|
protected abstract void |
handleInconsistency()
This method is invoked when a device model is found to be inconsistent. |
void |
release()
Free the resources for the model. |
void |
setDeviceStateGraph(DeviceStateGraph stateGraph)
|
boolean |
updateSV(java.lang.String stateVarId,
java.lang.Object stateVarValue)
Check if the old value of the state variable stateVarId is different from the new one and notify all listeners that have registered interest in the stateVar with id stateVarId |
| Methods inherited from class org.mbs.services.cu.generator.DefaultControlUnitModel |
|---|
getControlUnitCallback, getId, getModelInitValues, getType, queryStateVariable, reset, setControlUnitCallback, updateStateVariableList |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Integer INTEGER_ONE
public static final java.lang.Integer INTEGER_ZERO
public static final java.lang.Integer INTEGER_MINUS_ONE
public static java.lang.String COMP_NAME
public static final java.lang.String SVAR_ALLOWED_ACTIONS
public static final java.lang.String SVAR_ADDITIONAL_NAME
public static final java.lang.String SVAR_ATTACHMENT_TIME
protected java.lang.Object device
protected DeviceStateGraph stateGraph
protected java.lang.String currentState
| Constructor Detail |
|---|
public AbstractDeviceModel(java.lang.Object device,
java.lang.String type,
java.lang.String id)
device - the device servicetype - type of the deviceid - id of the device| Method Detail |
|---|
public void setDeviceStateGraph(DeviceStateGraph stateGraph)
public boolean updateSV(java.lang.String stateVarId,
java.lang.Object stateVarValue)
updateSV in interface ControlUnitModelupdateSV in class DefaultControlUnitModelstateVarId - state variable idstateVarValue - the new value for the state variable
protected abstract void handleInconsistency()
protected java.util.Dictionary getStateVariableValues()
public void release()
DefaultControlUnitModel
release in interface ControlUnitModelrelease in class DefaultControlUnitModel
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||