trigger
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
trigger [2020/02/03 15:57] – oliver | trigger [2021/02/09 15:23] (aktuell) – [Trigger SPI] oliver | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | The **Trigger-API** | + | ====== Trigger ====== |
+ | The original | ||
- | The general | + | Furthermore there are additional methods to control external systems in a more complex process, e.g. waiting that an external system is ready (nextCycle()). |
+ | |||
+ | ===== Trigger SPI ===== | ||
+ | Multiple implementations of the following SPI are possible and can be used to adjust to external systems: | ||
+ | |||
+ | <code java> | ||
+ | package de.orat.dataaquisition.measurementsystem.spi; | ||
+ | |||
+ | import de.orat.motionData.PropertyGroup; | ||
+ | import java.util.concurrent.ExecutionException; | ||
+ | |||
+ | /** | ||
+ | * @author Oliver Rettig | ||
+ | */ | ||
+ | public interface iTrigger { | ||
+ | |||
+ | /** | ||
+ | * Initialisation of the trigger implementation functionality. | ||
+ | * | ||
+ | * This method is invoked, befor recording is started with the trial type the trigger | ||
+ | * is configured and | ||
+ | * - if the trigger functionality is activated in the trigger options panel | ||
+ | * - maybe further explicitly by an init-button in the trigger options panel. | ||
+ | * | ||
+ | * @param configuration | ||
+ | * @return false, if the initialisation failed | ||
+ | */ | ||
+ | public boolean init(PropertyGroup configuration); | ||
+ | |||
+ | /** | ||
+ | * Get the name of the trigger. | ||
+ | * | ||
+ | * This name is also used as a configuration property group name. | ||
+ | * | ||
+ | * @return name of the trigger implementation | ||
+ | */ | ||
+ | public String getName(); | ||
+ | |||
+ | public void dispose(); | ||
+ | |||
+ | /** | ||
+ | * Set the signal, which is used to control start triggering. | ||
+ | * | ||
+ | * Generally this method is used to create a signal with a defined duration | ||
+ | * and slope. To do this this method is invoked twice in a short distance | ||
+ | * with the oppositite parameter value.< | ||
+ | * | ||
+ | * But a specific implementation e.g. ROSTrigger can implement this method to | ||
+ | * do something else, e.g. using the first invocation to invoke an RPC and ignoring | ||
+ | * the second invocation.< | ||
+ | * | ||
+ | * @param on true, to set the signals bit to 1, else 0. | ||
+ | */ | ||
+ | public void startTriggerSignal(boolean on); | ||
+ | |||
+ | /** | ||
+ | * Set the signal, which is used to control stop triggering. | ||
+ | * | ||
+ | * Can be used to define the end of a measurement process for variable length | ||
+ | * recording. | ||
+ | * | ||
+ | * Currently only used by the QuancomIOTrigger implementation as WORKAROUND. | ||
+ | * | ||
+ | * @param on | ||
+ | */ | ||
+ | public void stopTriggerSignal(boolean on); | ||
+ | |||
+ | /** | ||
+ | * Waiting until starting next cycle is possible. | ||
+ | * | ||
+ | * @return properties of the next cycle or null if waiting is failed. | ||
+ | * @throws ExcecutionExceptin if nextCycle fails fatal an the recording must be stopped. | ||
+ | */ | ||
+ | public PropertyGroup nextCycle() throws ExecutionException; | ||
+ | |||
+ | /** | ||
+ | * | ||
+ | * Used to close a robot program before loading a new one. | ||
+ | * | ||
+ | * @return | ||
+ | * | ||
+ | */ | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Implementing the **nextCycle()**-method allows to ask for an external system to be ready before starting the measurement of the next trial in multicycle recordings. | ||
+ | |||
+ | ===== Configuration of trigger implementations ===== | ||
+ | A trigger implementation is used only, if it is included in a trial type. To do this a property group with the name of the trigger must be included into the trial type configuration. This property group can include implementation specific properties to config the trigger. | ||
+ | |||
+ | <code xml> | ||
+ | ... | ||
+ | < | ||
+ | labelset=" | ||
+ | < | ||
+ | <!-- ROS trigger specific properties--> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | It is possible to use more than one trigger for a trial type. | ||
+ | ===== Generic Options of the triggering functionality ===== | ||
+ | Generic | ||
{{ : | {{ : | ||
- | Furthermore there is an API to adjust to an external system. Implementing | + | ^ Property name ^ Description ^ Unity^ |
+ | ^ Duration | If startTrigger | ||
+ | ^ Slope | If startTrigger is used to create a signal | ||
+ | ^ Offset | Can be used to delay the start of the trigger. | [ms] | |
trigger.1580741840.txt.gz · Zuletzt geändert: 2020/02/03 15:57 von oliver