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 interfaceMeasurementAction.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 MeasurementActioncopy()Creates a deep copy of this action.java.lang.StringgenerateFilePath()java.util.List<Action>getChildren()Returns an unmodifiable list of sub-actions that this action contains.ResultTablegetData()Returns whatever data this action generates.SimpleActionDisplaygetDisplay()Returns the JavaFX node used to display this action in an ActionQueueDisplay object.java.lang.ExceptiongetError()Returns the exception that caused the the action to result in failure.MeasurementgetMeasurement()intgetRetryCount()booleanisRunning()Returns whether the action is currently running or not.voidreset()Resets the action to the state it was in before being run.voidsetAttribute(java.lang.String key, java.lang.String value)Sets the value of the specified attribute for this action.voidsetFileNameGenerator(MeasurementAction.NameGenerator generator)voidsetOnMeasurementFinish(Listener<MeasurementAction> listener)voidsetOnMeasurementStart(Listener<MeasurementAction> listener)voidsetRetryCount(int retryCount)voidskip()Marks the action to be skipped next time it is run, or immediately if it is currently running.voidstart()Runs the action.voidstop()Interrupts and stops the action.voiduserEdit()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:ActionResets the action to the state it was in before being run.- Specified by:
resetin interfaceAction<ResultTable>- Specified by:
resetin classAbstractAction<ResultTable>
-
start
public void start()
Description copied from interface:ActionRuns the action. Should only return once the action is complete/interrupted/failed.- Specified by:
startin interfaceAction<ResultTable>- Specified by:
startin classAbstractAction<ResultTable>
-
generateFilePath
public java.lang.String generateFilePath()
-
getMeasurement
public Measurement getMeasurement()
-
stop
public void stop()
Description copied from interface:ActionInterrupts and stops the action.- Specified by:
stopin interfaceAction<ResultTable>- Specified by:
stopin classAbstractAction<ResultTable>
-
skip
public void skip()
Description copied from interface:ActionMarks the action to be skipped next time it is run, or immediately if it is currently running.- Specified by:
skipin interfaceAction<ResultTable>- Specified by:
skipin 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:ActionSets the value of the specified attribute for this action.- Specified by:
setAttributein interfaceAction<ResultTable>- Overrides:
setAttributein classAbstractAction<ResultTable>- Parameters:
key- Attribute keyvalue- Attribute value
-
userEdit
public void userEdit()
Description copied from interface:ActionPerforms whatever routine is necessary to allow the user to edit this action.- Specified by:
userEditin interfaceAction<ResultTable>- Overrides:
userEditin classAbstractAction<ResultTable>
-
setRetryCount
public void setRetryCount(int retryCount)
-
getRetryCount
public int getRetryCount()
-
getError
public java.lang.Exception getError()
Description copied from interface:ActionReturns the exception that caused the the action to result in failure.- Returns:
- Exception
-
isRunning
public boolean isRunning()
Description copied from interface:ActionReturns whether the action is currently running or not.- Specified by:
isRunningin interfaceAction<ResultTable>- Specified by:
isRunningin classAbstractAction<ResultTable>- Returns:
- Is it running?
-
getData
public ResultTable getData()
Description copied from interface:ActionReturns whatever data this action generates.- Specified by:
getDatain interfaceAction<ResultTable>- Specified by:
getDatain classAbstractAction<ResultTable>- Returns:
- Generated data
-
getChildren
public java.util.List<Action> getChildren()
Description copied from interface:ActionReturns 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:
getChildrenin interfaceAction<ResultTable>- Specified by:
getChildrenin classAbstractAction<ResultTable>- Returns:
- List of sub-actions
-
getDisplay
public SimpleActionDisplay getDisplay()
Description copied from interface:ActionReturns the JavaFX node used to display this action in an ActionQueueDisplay object.- Returns:
- Node
-
copy
public MeasurementAction copy()
Description copied from interface:ActionCreates a deep copy of this action.- Returns:
- Deep copy of this action
-
setFileNameGenerator
public void setFileNameGenerator(MeasurementAction.NameGenerator generator)
-
-