Constructor and Description |
---|
XAffectLibraryControl(LifeCycleManager manager)
Creates a new
XAffectLibraryControl . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
Control component. |
boolean |
configure(Setup setup,
java.util.HashMap<java.lang.String,java.lang.String> parameters)
Configures the study.
|
State |
getState()
Returns xAffect's internal
State . |
boolean |
init(java.lang.String subjectId,
java.lang.String sessionId,
java.lang.String institutionId,
java.lang.String studyId)
Initiates a new study.
|
boolean |
isMeasuringAllowed()
Returns whether xAffect still needs time to train it's
SystemComponent s or if measuring is allowed yet. |
void |
open()
Opens the
Control component. |
void |
registerConfigProgressListener(java.beans.PropertyChangeListener listener)
Register a
PropertyChangeListener to xAffect, listening to the
progress of the configuration-routine. |
void |
registerMeasuringAllowedListener(java.beans.PropertyChangeListener listener)
Register a
PropertyChangeListener to xAffect, listening to
changes to the ability to measure. |
void |
registerStateListener(java.beans.PropertyChangeListener listener)
Register a
PropertyChangeListener to xAffect, listening to
internal status-updates. |
void |
reset()
Resets xAffect to be able to start a new study.
|
boolean |
startMeasuring()
Starts measuring.
|
boolean |
startTraining()
Starts training.
|
void |
stop()
Stops the study.
|
closeController, getLifeCycleManager, openController
public XAffectLibraryControl(LifeCycleManager manager)
XAffectLibraryControl
.manager
- LifeCycleManager
to be controlled.public void open()
Control
Control
component. Normally this should be a GUI or a
network based controller.public boolean init(java.lang.String subjectId, java.lang.String sessionId, java.lang.String institutionId, java.lang.String studyId)
subjectId
- String identifying the subject of the session.sessionId
- String identifying the session of the study.institutionId
- String identifying the institution the study is running for.studyId
- String identifying the study.State.START
).public boolean configure(Setup setup, java.util.HashMap<java.lang.String,java.lang.String> parameters)
setup
- Setup
to be used.parameters
- HashMap
defining the parameters for the setup.State.INIT
, setup or configuration are not
valid, etc).public boolean startTraining()
State.CONFIG
)public boolean startMeasuring()
State.TRAINING
or State.CONFIG
).public void stop()
public void reset()
public State getState()
State
.State
.public boolean isMeasuringAllowed()
SystemComponent
s or if measuring is allowed yet.registerMeasuringAllowedListener(PropertyChangeListener)
public void registerStateListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
to xAffect, listening to
internal status-updates.listener
- PropertyChangeListener
to be registered.public void registerMeasuringAllowedListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
to xAffect, listening to
changes to the ability to measure. Note that measurement is only allowed
if no SystemComponent
needs time to train itself anymore.listener
- PropertyChangeListener
to be registered.isMeasuringAllowed
public void registerConfigProgressListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
to xAffect, listening to the
progress of the configuration-routine. Will be triggered every time a
SystemComponent
is configured and ready to train. The property
PropertyChangeEvent.getNewValue()
will contain a percentage of
how many components are ready to go.listener
- PropertyChangeListener
to be registered.