Chronos Plugins 5.4.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockConfigUsingTask.cs
Go to the documentation of this file.
1using System;
2using System.Text;
4
5namespace MockPlugin.Tasks
6{
10 // ReSharper disable once UnusedMember.Global
12 {
13 #region Implementation of ITask
14
15 public void PreValidate()
16 {
17 // nothing
18 }
19
20 public void PostValidate()
21 {
22 // nothing
23 }
24
25 public void Execute()
26 {
27 var info = Helpers.Config;
28 var sb = new StringBuilder();
29 sb.AppendLine($"Path to methods: {info.PathToMethods}");
30 sb.AppendLine($"Default sample lists location: {info.PathToSampleLists}");
31 sb.AppendLine($"Location of instrument configuration: {info.PathToInstrumentConfig}");
32 sb.AppendLine();
33 sb.AppendLine("Trays:");
34 foreach (var tray in info.Trays)
35 {
36 sb.AppendLine($"{tray.Name} on sampler {tray.Sampler?.ToString() ?? "N/A"}, valid indices {tray.FirstIndex} - {tray.LastIndex} ({tray.NoOfPositions} total)");
37 }
38 WriteToRunlog?.Invoke(sb.ToString());
39 }
40
41 public string GetTaskAction() => "Dump some configuration information to the runlog";
42
43 #endregion
44
45 #region Implementation of IHaveRunlogOutput
46
47 public event Action<string> WriteToRunlog;
48
49 #endregion
50 }
51}
Classes and interfaces that are meant for plugins. The classes and interfaces below this namespace ar...
Example task implementations. Since there are lots of things that can be done from a task,...
Static instance for access to utility functions and resources.
Definition: Helpers.cs:78
static IConfigInfo Config
Information about general program configuration, standard folders and similar.
Definition: Helpers.cs:102
Implement this interface if you have messages for our run log.
To be implemented by the "task" part of a Chronos plugin. Public properties of the implementing type ...
This tasks uses the config helper to access some information about the instrument configuration and j...
void PostValidate()
Called after the schedule construction is completed.
string GetTaskAction()
Description of the tasks's action (for hints/time table)
void PreValidate()
Called before the schedule construction is completed.
void Execute()
Do whatever you have to do with your parameters.