Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
|
An example acquisition service using a fixed list of parameters. More...
Public Member Functions | |
void | ValidateCommand (MockCommandAndParameters cmdAndPars) |
void | RunCommand (MockCommandAndParameters cmdAndPars) |
void | Validate (SimpleParameters parameters) |
void | RunAcquisition (SimpleParameters parameters) |
string | ShowConfigDialog (IntPtr owner, string oldConfig) |
Show a configuration dialog for your acquisition service. | |
void | BeginSequence (string pathToChronosSampleList) |
A new Chronos sequence has started. You can use the path to the list file to construct your own sequence name. | |
void | EndSequence () |
The Chronos sequence has ended. Good moment, for example, to export sample information to a list for further processing. | |
Public Member Functions inherited from AxelSemrau.Chronos.Plugin.IAcquisitionService< SimpleParameters > | |
void | Validate (TParam parameters) |
Check the given parameters and throw an exception if they are invalid. | |
void | RunAcquisition (TParam parameters) |
Send the acquisition parameters to the CDS. | |
Public Member Functions inherited from AxelSemrau.Chronos.Plugin.IHaveConfigurator | |
Public Member Functions inherited from AxelSemrau.Chronos.Plugin.ISequenceAwareAcquisitionService | |
Public Member Functions inherited from AxelSemrau.Chronos.Plugin.ICommandUsingAcquisitionService< MockCommandAndParameters > | |
void | ValidateCommand (TCommandAndParameters cmdAndPars) |
Please check if it is likely that you can actually execute the parameters. | |
void | RunCommand (TCommandAndParameters cmdAndPars) |
Perform the actual command action. | |
Properties | |
string | Name [get] |
Name that is visible to the user in the list of acquisition services. Do not localize. | |
static bool | ImmediatelyAvailable [get, set] |
Allows us to bypass the delayed availability for test purposes. | |
bool | IsAvailable [get] |
See above - we pretend the service becomes available only after some time. | |
bool? | Abort [set] |
Will be set to true if you should abort the current acquisition. Will be set to false when everything is back to normal. | |
string | Configuration [get, set] |
XML Fragment containing the services configuration, if any. | |
TimeSpan | RetryInterval [get] |
If you are sure the service will not be available, return TimeSpan.Zero. Else return a reasonable interval for retrying, depending on how costly the operation is. | |
Properties inherited from AxelSemrau.Chronos.Plugin.IConfigurableAcquisitionService | |
Properties inherited from AxelSemrau.Chronos.Plugin.IAcquisitionServiceBase | |
Properties inherited from AxelSemrau.Chronos.Plugin.IPerseveringAcquisitionService |
Events | |
EventHandler< TraceWriteEventArgs > | TraceWrite |
Action< string > | WriteToRunlog |
Events inherited from AxelSemrau.Chronos.Plugin.ITraceLogger | |
EventHandler< TraceWriteEventArgs > | TraceWrite |
Chronos will subscribe to this event and log the text provided in the event args. | |
Events inherited from AxelSemrau.Chronos.Plugin.IHaveRunlogOutput | |
Action< string > | WriteToRunlog |
Use this event to send output to the Run Control / Runlog page and, if applicable, to the runlog file. | |
Private Member Functions | |
void | TraceLog (string txt) |
string | ConfigFromXml (string value) |
string | ConfigToXml (string configParam) |
Private Attributes | |
readonly Stopwatch | mAvailabilityTimer = Stopwatch.StartNew() |
We use this timer to pretend the service will only become available after a certain amount of time. | |
string | mConfigParam = "Foobar" |
Some fake configuration parameter. | |
Static Private Attributes | |
const string | RootEl = "MockServiceConfigRootElement" |
An example acquisition service using a fixed list of parameters.
For a more complex example, see MockDynamicParAcquisitionService.
Definition at line 55 of file MockSimpleAcquisitionService.cs.
void MockPlugin.AcquisitionService.MockSimpleAcquisitionService.BeginSequence | ( | string | pathToChronosSampleList | ) |
A new Chronos sequence has started. You can use the path to the list file to construct your own sequence name.
pathToChronosSampleList |
Implements AxelSemrau.Chronos.Plugin.ISequenceAwareAcquisitionService.
Definition at line 191 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.TraceLog().
|
private |
Definition at line 167 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.mConfigParam, and MockPlugin.AcquisitionService.MockSimpleAcquisitionService.RootEl.
Referenced by MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ShowConfigDialog().
|
private |
Definition at line 181 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.RootEl.
Referenced by MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ShowConfigDialog().
void MockPlugin.AcquisitionService.MockSimpleAcquisitionService.EndSequence | ( | ) |
The Chronos sequence has ended. Good moment, for example, to export sample information to a list for further processing.
Implements AxelSemrau.Chronos.Plugin.ISequenceAwareAcquisitionService.
Definition at line 196 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.TraceLog().
void MockPlugin.AcquisitionService.MockSimpleAcquisitionService.RunAcquisition | ( | SimpleParameters | parameters | ) |
Definition at line 115 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.TraceLog().
void MockPlugin.AcquisitionService.MockSimpleAcquisitionService.RunCommand | ( | MockCommandAndParameters | cmdAndPars | ) |
Definition at line 101 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.WriteToRunlog.
string MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ShowConfigDialog | ( | IntPtr | owner, |
string | oldConfig ) |
Show a configuration dialog for your acquisition service.
owner | Use this as your window's owner |
oldConfig | Show the dialog based on this configuration, not some internal state of your service. |
Implements AxelSemrau.Chronos.Plugin.IHaveConfigurator.
Definition at line 142 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ConfigFromXml(), and MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ConfigToXml().
|
private |
Definition at line 122 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.TraceWrite.
Referenced by MockPlugin.AcquisitionService.MockSimpleAcquisitionService.BeginSequence(), MockPlugin.AcquisitionService.MockSimpleAcquisitionService.EndSequence(), MockPlugin.AcquisitionService.MockSimpleAcquisitionService.RunAcquisition(), and MockPlugin.AcquisitionService.MockSimpleAcquisitionService.Validate().
void MockPlugin.AcquisitionService.MockSimpleAcquisitionService.Validate | ( | SimpleParameters | parameters | ) |
Definition at line 110 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.TraceLog().
void MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ValidateCommand | ( | MockCommandAndParameters | cmdAndPars | ) |
Definition at line 96 of file MockSimpleAcquisitionService.cs.
References MockPlugin.AcquisitionService.MockSimpleAcquisitionService.WriteToRunlog.
|
private |
We use this timer to pretend the service will only become available after a certain amount of time.
Definition at line 71 of file MockSimpleAcquisitionService.cs.
|
private |
Some fake configuration parameter.
Definition at line 138 of file MockSimpleAcquisitionService.cs.
Referenced by MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ConfigFromXml().
|
staticprivate |
Definition at line 131 of file MockSimpleAcquisitionService.cs.
Referenced by MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ConfigFromXml(), and MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ConfigToXml().
|
set |
Will be set to true if you should abort the current acquisition. Will be set to false when everything is back to normal.
Implements AxelSemrau.Chronos.Plugin.IAcquisitionServiceBase.
Definition at line 95 of file MockSimpleAcquisitionService.cs.
|
getset |
XML Fragment containing the services configuration, if any.
If you have none, just return null.
Implements AxelSemrau.Chronos.Plugin.IConfigurableAcquisitionService.
Definition at line 161 of file MockSimpleAcquisitionService.cs.
|
staticgetset |
Allows us to bypass the delayed availability for test purposes.
Definition at line 76 of file MockSimpleAcquisitionService.cs.
|
get |
See above - we pretend the service becomes available only after some time.
Implements AxelSemrau.Chronos.Plugin.IAcquisitionServiceBase.
Definition at line 81 of file MockSimpleAcquisitionService.cs.
|
get |
Name that is visible to the user in the list of acquisition services. Do not localize.
Implements AxelSemrau.Chronos.Plugin.IAcquisitionServiceBase.
Definition at line 66 of file MockSimpleAcquisitionService.cs.
|
get |
If you are sure the service will not be available, return TimeSpan.Zero. Else return a reasonable interval for retrying, depending on how costly the operation is.
Implements AxelSemrau.Chronos.Plugin.IPerseveringAcquisitionService.
Definition at line 207 of file MockSimpleAcquisitionService.cs.
EventHandler<TraceWriteEventArgs> MockPlugin.AcquisitionService.MockSimpleAcquisitionService.TraceWrite |
Definition at line 129 of file MockSimpleAcquisitionService.cs.
Referenced by MockPlugin.AcquisitionService.MockSimpleAcquisitionService.TraceLog().
Action<string> MockPlugin.AcquisitionService.MockSimpleAcquisitionService.WriteToRunlog |
Definition at line 203 of file MockSimpleAcquisitionService.cs.
Referenced by MockPlugin.AcquisitionService.MockSimpleAcquisitionService.RunCommand(), and MockPlugin.AcquisitionService.MockSimpleAcquisitionService.ValidateCommand().