Package jisa.experiment.queue
Class MeasurementAction
- java.lang.Object
-
- jisa.experiment.queue.AbstractAction<ResultTable>
-
- jisa.experiment.queue.MeasurementAction
-
- All Implemented Interfaces:
java.io.Serializable
,Action<ResultTable>
public class MeasurementAction extends AbstractAction<ResultTable>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MeasurementAction.NameGenerator
-
Nested classes/interfaces inherited from interface jisa.experiment.queue.Action
Action.Status
-
-
Constructor Summary
Constructors Constructor Description MeasurementAction(java.lang.String name, Measurement measurement)
MeasurementAction(Measurement measurement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MeasurementAction
copy()
Creates a deep copy of this action.java.lang.String
generateFilePath()
java.util.List<Action>
getChildren()
Returns an unmodifiable list of sub-actions that this action contains.ResultTable
getData()
Returns whatever data this action generates.SimpleActionDisplay
getDisplay()
Returns the JavaFX node used to display this action in an ActionQueueDisplay object.java.lang.Exception
getError()
Returns the exception that caused the the action to result in failure.Measurement
getMeasurement()
int
getRetryCount()
boolean
isRunning()
Returns whether the action is currently running or not.void
reset()
Resets the action to the state it was in before being run.void
setAttribute(java.lang.String key, java.lang.String value)
Sets the value of the specified attribute for this action.void
setFileNameGenerator(MeasurementAction.NameGenerator generator)
void
setOnMeasurementFinish(Listener<MeasurementAction> listener)
void
setOnMeasurementStart(Listener<MeasurementAction> listener)
void
setRetryCount(int retryCount)
void
skip()
Marks the action to be skipped next time it is run, or immediately if it is currently running.void
start()
Runs the action.void
stop()
Interrupts and stops the action.void
userEdit()
Performs whatever routine is necessary to allow the user to edit this action.-
Methods inherited from class jisa.experiment.queue.AbstractAction
addAttributeListener, addChildrenListener, addNameListener, addStatusListener, addTag, childrenChanged, clearTags, copyBasicParametersTo, getAttribute, getAttributes, getName, getStatus, getStatusListeners, getTags, hasAttribute, isCritical, onFinish, onStart, removeAttribute, removeListener, removeTag, setCritical, setName, setOnEdit, setOnFinish, setOnStart, setStatus
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jisa.experiment.queue.Action
addListener, getAttributeString, getAttributeString, resume
-
-
-
-
Constructor Detail
-
MeasurementAction
public MeasurementAction(java.lang.String name, Measurement measurement)
-
MeasurementAction
public MeasurementAction(Measurement measurement)
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:Action
Resets the action to the state it was in before being run.- Specified by:
reset
in interfaceAction<ResultTable>
- Specified by:
reset
in classAbstractAction<ResultTable>
-
start
public void start()
Description copied from interface:Action
Runs the action. Should only return once the action is complete/interrupted/failed.- Specified by:
start
in interfaceAction<ResultTable>
- Specified by:
start
in classAbstractAction<ResultTable>
-
generateFilePath
public java.lang.String generateFilePath()
-
getMeasurement
public Measurement getMeasurement()
-
stop
public void stop()
Description copied from interface:Action
Interrupts and stops the action.- Specified by:
stop
in interfaceAction<ResultTable>
- Specified by:
stop
in classAbstractAction<ResultTable>
-
skip
public void skip()
Description copied from interface:Action
Marks the action to be skipped next time it is run, or immediately if it is currently running.- Specified by:
skip
in interfaceAction<ResultTable>
- Specified by:
skip
in classAbstractAction<ResultTable>
-
setOnMeasurementStart
public void setOnMeasurementStart(Listener<MeasurementAction> listener)
-
setOnMeasurementFinish
public void setOnMeasurementFinish(Listener<MeasurementAction> listener)
-
setAttribute
public void setAttribute(java.lang.String key, java.lang.String value)
Description copied from interface:Action
Sets the value of the specified attribute for this action.- Specified by:
setAttribute
in interfaceAction<ResultTable>
- Overrides:
setAttribute
in classAbstractAction<ResultTable>
- Parameters:
key
- Attribute keyvalue
- Attribute value
-
userEdit
public void userEdit()
Description copied from interface:Action
Performs whatever routine is necessary to allow the user to edit this action.- Specified by:
userEdit
in interfaceAction<ResultTable>
- Overrides:
userEdit
in classAbstractAction<ResultTable>
-
setRetryCount
public void setRetryCount(int retryCount)
-
getRetryCount
public int getRetryCount()
-
getError
public java.lang.Exception getError()
Description copied from interface:Action
Returns the exception that caused the the action to result in failure.- Returns:
- Exception
-
isRunning
public boolean isRunning()
Description copied from interface:Action
Returns whether the action is currently running or not.- Specified by:
isRunning
in interfaceAction<ResultTable>
- Specified by:
isRunning
in classAbstractAction<ResultTable>
- Returns:
- Is it running?
-
getData
public ResultTable getData()
Description copied from interface:Action
Returns whatever data this action generates.- Specified by:
getData
in interfaceAction<ResultTable>
- Specified by:
getData
in classAbstractAction<ResultTable>
- Returns:
- Generated data
-
getChildren
public java.util.List<Action> getChildren()
Description copied from interface:Action
Returns an unmodifiable list of sub-actions that this action contains. The exact meaning of a sub-action and how it relates to the running of this action depends on the type of action this is.- Specified by:
getChildren
in interfaceAction<ResultTable>
- Specified by:
getChildren
in classAbstractAction<ResultTable>
- Returns:
- List of sub-actions
-
getDisplay
public SimpleActionDisplay getDisplay()
Description copied from interface:Action
Returns the JavaFX node used to display this action in an ActionQueueDisplay object.- Returns:
- Node
-
copy
public MeasurementAction copy()
Description copied from interface:Action
Creates a deep copy of this action.- Returns:
- Deep copy of this action
-
setFileNameGenerator
public void setFileNameGenerator(MeasurementAction.NameGenerator generator)
-
-