2using System.Collections.Generic;
17 public string Name {
get;
set; }
27 private readonly List<TrainPart>
mAllParts =
new List<TrainPart>();
36 for (
int i = 0; i < 7; ++i)
53 internal void ClosedSomeDoor()
55 if (
mAllParts.All(somePart => !somePart.DoorsOpen))
58 WriteToRunlog?.Invoke($
"Important: Train {Name} has all doors closed.");
89 set { var dummy = value; }
98 public int Num {
get;
set; }
105 return $
"{mTrain.Name}:Diner";
107 return $
"{mTrain.Name}:Locomotive";
109 return $
"{mTrain.Name}:Car{Num}";
Classes and interfaces that are meant for plugins. The classes and interfaces below this namespace ar...
A fake device. This namespace contains the fake device driver and auxiliary classes for settings,...
To be implemented by the "device driver" part of a Chronos plugin.
Implement this interface if you want to keep the user up-to-date about what your device is doing.
Implement this interface if your device consists of multiple parts which can be used in parallel - li...
Implement this interface if you have messages for our run log.
For lack of a better idea, the demonstration for the multipart device is a train consisting of a loco...
void Disconnect()
You may disconnect now.
string Name
User-selected name for the device instance.
readonly List< TrainPart > mAllParts
Action< string > WriteToRunlog
Action< ConnectionState > ConnectionStateChanged
Not used.
string DisplayedTypeName
Text which is displayed in the instruments settings "Autosampler Type" column and in many other place...
string DeviceTypeDescription
Text which is displayed to make clear which kind of device a named sampler is.
IReadOnlyCollection< IDevice > Parts
Collection of all available parts.
Train()
Just adding all parts of the train. The parts keep references to the full train.
void Connect()
You may have connected to the device before this, but make sure you are connected after this.
The device part (well, train part) can't do much, just send status messages when the doors are opened...
void Disconnect()
You may disconnect now.
string DisplayedTypeName
Text which is displayed in the instruments settings "Autosampler Type" column and in many other place...
readonly TrainPartType mMyType
string Name
We have to return a descriptive name that also allows identification of the base device - just do it ...
string DeviceTypeDescription
Text which is displayed to make clear which kind of device a named sampler is.
override string ToString()
Important! Without overriding ToString here, you will not be able to pick the device from an autosamp...
Action< string > SetStatusMessage
Action< ConnectionState > ConnectionStateChanged
Not used.
void Connect()
You may have connected to the device before this, but make sure you are connected after this.