Class Plan
java.lang.Object
gda.factory.FindableBase
uk.ac.diamond.daq.experiment.plan.Plan
- All Implemented Interfaces:
Findable,ConveniencePlanFactory,IPlan,IPlanFactory,IPlanRegistrar
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Stop the plan wherever it is, aborting the experiment driver also (if configured)addSegment(String name, double duration, ITrigger... triggers) Creates the next time-based segment with the given durationaddSegment(String name, ISampleEnvironmentVariable sev, double duration, ITrigger... triggers) Creates the next time-based segment with the given durationaddSegment(String name, ISampleEnvironmentVariable sev, LimitCondition limit, ITrigger... triggers) Creates the next segment in the experiment (segments are executed in order of creation).addSegment(String name, LimitCondition limit, ITrigger... triggers) Creates the next segment in the experiment (segments are executed in order of creation).Creates anISampleEnvironmentVariablewhich samples the specifiedScannable.addSEV(DoubleSupplier signalSource) Creates anISampleEnvironmentVariablewhich samples the specifiedDoubleSupplier.addTimer()Gets a timer to use as anISampleEnvironmentVariable.addTrigger(String name, Object payload, double interval) Creates a trigger which will execute the given operation in specified intervals of signal from sample environment variable providedaddTrigger(String name, Object payload, double target, double tolerance) Create a trigger that will perform an operation only once, when signal fromsev=target±toleranceaddTrigger(String name, Object payload, ISampleEnvironmentVariable sev, double interval) Creates a trigger which will execute the given operation in specified intervals of signal from sample environment variable providedaddTrigger(String name, Object payload, ISampleEnvironmentVariable sev, double target, double tolerance) Create a trigger that will perform an operation only once, when signal fromsev=target±toleranceaddTrigger(String name, Payload payload, double interval) Creates a trigger which will execute the given operation in specified intervals of signal from sample environment variable providedaddTrigger(String name, Payload payload, double target, double tolerance) Create a trigger that will perform an operation only once, when signal fromsev=target±toleranceaddTrigger(String name, Payload payload, ISampleEnvironmentVariable sev, double interval) Creates a trigger which will execute the given operation in specified intervals of signal from sample environment variable providedaddTrigger(String name, Payload payload, ISampleEnvironmentVariable sev, double target, double tolerance) Create a trigger that will perform an operation only once, when signal fromsev=target±toleranceGets the ExperimentRecord once the experiment is complete.booleanTest whether the plan is still runningvoidsegmentActivated(ISegment segment, String sampleEnvironmentName) Called to report that the specifiedISegmenthas become activevoidsegmentComplete(ISegment completedSegment, double terminatingSignal) Called to report that the specifiedISegmenthas completed due to the specified signalvoidsetDriver(ExperimentDriver experimentDriver) We can optionally set an experiment driver to the plan, which is started when the plan startsvoidsetFactory(IPlanFactory factory) Sets the factory which creates the plan componentsvoidsetRegistrar(IPlanRegistrar registrar) The registrar is used for creating components which need to report their events.protected voidsetSegments(List<ISegment> segments) Used instead ofaddSegment(String, double, ITrigger...)etc.voidstart()Once the entire plan is defined, this method will initiate it by activating the firstISegmenttoString()voidtriggerComplete(ITrigger trigger, TriggerEvent event, String sampleEnvironmentName) Complementary method tocalled when a trigger ends either successfully or unsuccessfullyinvalid reference
#triggerOccurred(ITrigger, double)voidtriggerOccurred(ITrigger trigger) Called to report that the specifiedITriggerfired due to the specified signalMethods inherited from class gda.factory.FindableBase
equals, getName, hashCode, setName
-
Field Details
-
experimentController
-
-
Constructor Details
-
Plan
-
-
Method Details
-
start
public void start()Description copied from interface:IPlanOnce the entire plan is defined, this method will initiate it by activating the firstISegment -
abort
public void abort()Description copied from interface:IPlanStop the plan wherever it is, aborting the experiment driver also (if configured) -
isRunning
public boolean isRunning()Description copied from interface:IPlanTest whether the plan is still running -
triggerOccurred
Description copied from interface:IPlanRegistrarCalled to report that the specifiedITriggerfired due to the specified signal- Specified by:
triggerOccurredin interfaceIPlanRegistrar- Parameters:
trigger-
-
triggerComplete
Description copied from interface:IPlanRegistrarComplementary method tocalled when a trigger ends either successfully or unsuccessfullyinvalid reference
#triggerOccurred(ITrigger, double)- Specified by:
triggerCompletein interfaceIPlanRegistrar- Parameters:
trigger-event-
-
segmentActivated
Description copied from interface:IPlanRegistrarCalled to report that the specifiedISegmenthas become active- Specified by:
segmentActivatedin interfaceIPlanRegistrar- Parameters:
segment-sampleEnvironmentName- the name of the sample environment this segment depends on
-
segmentComplete
Description copied from interface:IPlanRegistrarCalled to report that the specifiedISegmenthas completed due to the specified signal- Specified by:
segmentCompletein interfaceIPlanRegistrar- Parameters:
completedSegment-terminatingSignal-
-
setFactory
Description copied from interface:IPlanSets the factory which creates the plan components- Specified by:
setFactoryin interfaceIPlan- Parameters:
factory-
-
setRegistrar
Description copied from interface:IPlanFactoryThe registrar is used for creating components which need to report their events.- Specified by:
setRegistrarin interfaceIPlanFactory- Parameters:
registrar-
-
setDriver
Description copied from interface:IPlanWe can optionally set an experiment driver to the plan, which is started when the plan starts -
addSEV
Description copied from interface:IPlanFactoryCreates anISampleEnvironmentVariablewhich samples the specifiedScannable.- Specified by:
addSEVin interfaceIPlanFactory- Parameters:
scannable-- Returns:
- reference to created sev
-
addSEV
Description copied from interface:IPlanFactoryCreates anISampleEnvironmentVariablewhich samples the specifiedDoubleSupplier.- Specified by:
addSEVin interfaceIPlanFactory- Returns:
- reference to the created sev
-
addTimer
Description copied from interface:IPlanFactoryGets a timer to use as anISampleEnvironmentVariable.- Specified by:
addTimerin interfaceIPlanFactory
-
addSegment
public ISegment addSegment(String name, ISampleEnvironmentVariable sev, LimitCondition limit, ITrigger... triggers) Description copied from interface:IPlanFactoryCreates the next segment in the experiment (segments are executed in order of creation).- Specified by:
addSegmentin interfaceIPlanFactory- Parameters:
name- The name of this segment.sev- TheISampleEnvironmentVariableacting as source for the limiting signallimit- TheLimitConditionwhich will terminate this segment once met.triggers- The triggers which should be enabled during this segment- Returns:
- Reference to the created segment
-
addSegment
public ISegment addSegment(String name, ISampleEnvironmentVariable sev, double duration, ITrigger... triggers) Description copied from interface:IPlanFactoryCreates the next time-based segment with the given duration- Specified by:
addSegmentin interfaceIPlanFactory- Parameters:
name- The name of this segment.sev- TheISampleEnvironmentVariableacting as source for the limiting signalduration- The duration in seconds of this segmenttriggers- The triggers which should be enabled during this segment- Returns:
- Reference to the created segment
-
getExperimentRecord
Description copied from interface:IPlanRegistrarGets the ExperimentRecord once the experiment is complete.- Specified by:
getExperimentRecordin interfaceIPlanRegistrar
-
toString
-
addTrigger
public ITrigger addTrigger(String name, Payload payload, ISampleEnvironmentVariable sev, double target, double tolerance) Description copied from interface:IPlanFactoryCreate a trigger that will perform an operation only once, when signal fromsev=target±tolerance- Specified by:
addTriggerin interfaceIPlanFactory- Parameters:
name- Name of this triggerpayload- Request to handle upon triggeringsev- TheISampleEnvironmentVariableused as triggering signal sourcetarget- The optimal triggering signaltolerance- The acceptable tolerance around the target signal- Returns:
- Reference to the created trigger
-
addTrigger
public ITrigger addTrigger(String name, Object payload, ISampleEnvironmentVariable sev, double target, double tolerance) Description copied from interface:IPlanFactoryCreate a trigger that will perform an operation only once, when signal fromsev=target±tolerance- Specified by:
addTriggerin interfaceIPlanFactory- Parameters:
name- Name of this triggerpayload- Request to handle upon triggeringsev- TheISampleEnvironmentVariableused as triggering signal sourcetarget- The optimal triggering signaltolerance- The acceptable tolerance around the target signal- Returns:
- Reference to the created trigger
-
addTrigger
public ITrigger addTrigger(String name, Payload payload, ISampleEnvironmentVariable sev, double interval) Description copied from interface:IPlanFactoryCreates a trigger which will execute the given operation in specified intervals of signal from sample environment variable provided- Specified by:
addTriggerin interfaceIPlanFactory- Parameters:
name- of this triggerpayload- to handle upon triggeringsev- theISampleEnvironmentVariablethis trigger will listen tointerval- or period between triggers- Returns:
- reference to the created trigger
-
addTrigger
public ITrigger addTrigger(String name, Object payload, ISampleEnvironmentVariable sev, double interval) Description copied from interface:IPlanFactoryCreates a trigger which will execute the given operation in specified intervals of signal from sample environment variable provided- Specified by:
addTriggerin interfaceIPlanFactory- Parameters:
name- of this triggerpayload- to handle upon triggeringsev- theISampleEnvironmentVariablethis trigger will listen tointerval- or period between triggers- Returns:
- reference to the created trigger
-
addTrigger
Description copied from interface:ConveniencePlanFactoryCreate a trigger that will perform an operation only once, when signal fromsev=target±tolerance- Specified by:
addTriggerin interfaceConveniencePlanFactory- Parameters:
name- Name of this triggerpayload- Request to handle upon triggeringtarget- The optimal triggering signaltolerance- The acceptable tolerance around the target signal- Returns:
- Reference to the created trigger
-
addTrigger
Description copied from interface:ConveniencePlanFactoryCreate a trigger that will perform an operation only once, when signal fromsev=target±tolerance- Specified by:
addTriggerin interfaceConveniencePlanFactory- Parameters:
name- Name of this triggerpayload- Request to handle upon triggeringtarget- The optimal triggering signaltolerance- The acceptable tolerance around the target signal- Returns:
- Reference to the created trigger
-
addTrigger
Description copied from interface:ConveniencePlanFactoryCreates a trigger which will execute the given operation in specified intervals of signal from sample environment variable provided- Specified by:
addTriggerin interfaceConveniencePlanFactory- Parameters:
name- of this triggerpayload- to handle upon triggeringinterval- or period between triggers- Returns:
- reference to the created trigger
-
addTrigger
Description copied from interface:ConveniencePlanFactoryCreates a trigger which will execute the given operation in specified intervals of signal from sample environment variable provided- Specified by:
addTriggerin interfaceConveniencePlanFactory- Parameters:
name- of this triggerpayload- to handle upon triggeringinterval- or period between triggers- Returns:
- reference to the created trigger
-
addSegment
Description copied from interface:ConveniencePlanFactoryCreates the next segment in the experiment (segments are executed in order of creation).- Specified by:
addSegmentin interfaceConveniencePlanFactory- Parameters:
name- The name of this segment.limit- TheLimitConditionwhich will terminate this segment once met.triggers- The triggers which should be enabled during this segment- Returns:
- Reference to the created segment
-
addSegment
Description copied from interface:ConveniencePlanFactoryCreates the next time-based segment with the given duration- Specified by:
addSegmentin interfaceConveniencePlanFactory- Parameters:
name- The name of this segment.duration- The duration in seconds of this segmenttriggers- The triggers which should be enabled during this segment- Returns:
- Reference to the created segment
-
setSegments
Used instead ofaddSegment(String, double, ITrigger...)etc.- See Also:
-