2using System.Diagnostics;
3using System.Diagnostics.CodeAnalysis;
17 [SuppressMessage(
"ReSharper",
"MemberCanBePrivate.Global")]
18 [SuppressMessage(
"ReSharper",
"UnusedAutoPropertyAccessor.Global")]
19 [SuppressMessage(
"ReSharper",
"AutoPropertyCanBeMadeGetOnly.Global")]
29 [SuppressMessage(
"ReSharper",
"UnusedMember.Global")]
39 #region Overrides of Object
43 return $
"Method = {InstrumentMethod}, Instrument = {InstrumentNumber}, WaitForEmptyQueue = {WaitForEmptyQueue}, GetReadyTimeout = {GetReadyTimeout}, SampleType = {SampleType}";
64 #region Implementation of IAcquisitionServiceBase
66 public string Name =>
"MockSimpleAcquisition";
95 public bool Abort {
set =>
TraceLog($
"Abort flag {(value ? "set" : "reset
")}"); }
98 WriteToRunlog?.Invoke($
"Validating command '{cmdAndPars.SomeFakeCommand}' for instrument {cmdAndPars.InstrumentNumber}");
103 WriteToRunlog?.Invoke($
"Running command '{cmdAndPars.SomeFakeCommand}' for instrument {cmdAndPars.InstrumentNumber}");
108 #region Implementation of IAcquisitionService<SimpleParameters>
112 TraceLog($
"Validating simple parameters: {parameters}");
117 TraceLog($
"Running acquisition with parameters: {parameters}");
127 #region Implementation of ITraceLogger
131 private const string RootEl =
"MockServiceConfigRootElement";
140 #region Implementation of IHaveConfigurator
149 var dummy =
new System.Windows.Interop.WindowInteropHelper(dlg) { Owner = owner };
150 if (dlg.ShowDialog() ??
false)
159 #region Implementation of IConfigurableAcquisitionService
169 if (!
string.IsNullOrEmpty(value))
171 var el = XElement.Parse(value);
183 var el =
new XElement(
RootEl) {Value = configParam};
184 return el.ToString();
189 #region Implementation of ISequenceAwareAcquisitionService
193 TraceLog($
"Sequence ${pathToChronosSampleList} was started.");
205 #region Implementation of IPreseveringAcquisitionService
220 public override string ToString() => $
"'{SomeFakeCommand}' (instrument {InstrumentNumber})";
Classes and interfaces that are meant for plugins. The classes and interfaces below this namespace ar...
Enables you to add support for a Chromatography Data System (or similar) to Chronos....
Request retrying if IsAvailable returned false.
Implement this interface if you want to provide an acquisition service that is loaded on program star...
Implement this interface if your acquisition service requires some kind of configuration.
The GUI for the configuration can be managed seperately from the service.
Implement this if your acquisition service has to know when a Chronos sequence starts / ends.
Implement this interface if your acquisition service supports some kind of utility commands that coul...
Implement this interface if you have messages for our run log.
For future extension (categories, priorities...)
Writes some text to the trace log.
Interaktionslogik für ConfigDialog.xaml.
Example parameter set for an acquisition service.
SampleTypeValue SampleType
override string ToString()
An example acquisition service using a fixed list of parameters.
void RunAcquisition(SimpleParameters parameters)
string ConfigToXml(string configParam)
bool? Abort
Will be set to true if you should abort the current acquisition. Will be set to false when everything...
void TraceLog(string txt)
void RunCommand(MockCommandAndParameters cmdAndPars)
string ShowConfigDialog(IntPtr owner, string oldConfig)
Show a configuration dialog for your acquisition service.
void ValidateCommand(MockCommandAndParameters cmdAndPars)
string Configuration
XML Fragment containing the services configuration, if any.
void EndSequence()
The Chronos sequence has ended. Good moment, for example, to export sample information to a list for ...
EventHandler< TraceWriteEventArgs > TraceWrite
string mConfigParam
Some fake configuration parameter.
Action< string > WriteToRunlog
static bool ImmediatelyAvailable
Allows us to bypass the delayed availability for test purposes.
readonly Stopwatch mAvailabilityTimer
We use this timer to pretend the service will only become available after a certain amount of time.
void BeginSequence(string pathToChronosSampleList)
A new Chronos sequence has started. You can use the path to the list file to construct your own seque...
void Validate(SimpleParameters parameters)
string ConfigFromXml(string value)
string Name
Name that is visible to the user in the list of acquisition services. Do not localize.
bool IsAvailable
See above - we pretend the service becomes available only after some time.
TimeSpan RetryInterval
If you are sure the service will not be available, return TimeSpan.Zero. Else return a reasonable int...
Example definition of a command and its parameters that can be called for an AxelSemrau....
override string ToString()