Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockPlugin.Device.TrainPart Class Reference

The device part (well, train part) can't do much, just send status messages when the doors are opened/closed. More...

+ Inheritance diagram for MockPlugin.Device.TrainPart:
+ Collaboration diagram for MockPlugin.Device.TrainPart:

Public Member Functions

override string ToString ()
 Important! Without overriding ToString here, you will not be able to pick the device from an autosampler column in the sample list.
 
void Connect ()
 You may have connected to the device before this, but make sure you are connected after this.
 
void Disconnect ()
 You may disconnect now.
 
- Public Member Functions inherited from AxelSemrau.Chronos.Plugin.IDevice

Properties

string DisplayedTypeName [get]
 Text which is displayed in the instruments settings "Autosampler Type" column and in many other places.
 
string DeviceTypeDescription [get]
 Text which is displayed to make clear which kind of device a named sampler is.
 
string Name [get, set]
 We have to return a descriptive name that also allows identification of the base device - just do it like the PAL3 and return BaseName + ":" + PartName.
 
int Num [get, set]
 
bool? DoorsOpen [get, set]
 
- Properties inherited from AxelSemrau.Chronos.Plugin.IDevice

Events

Action< ConnectionStateConnectionStateChanged [add, remove]
 Not used.
 
Action< string > SetStatusMessage
 
- Events inherited from AxelSemrau.Chronos.Plugin.IDevice
Action< ConnectionStateConnectionStateChanged
 Raise this event when your connection state has changed.
 
- Events inherited from AxelSemrau.Chronos.Plugin.IProvideStatusMessages
Action< string > SetStatusMessage
 Raise this event to set your current status while doing something on the device. Messages passed to this event will be shown in the "Autosampler status" line.
 

Private Member Functions

string BuildName ()
 

Private Attributes

readonly Train mTrain
 
readonly TrainPartType mMyType
 
bool mDoorsAreOpen
 

Detailed Description

The device part (well, train part) can't do much, just send status messages when the doors are opened/closed.

Definition at line 76 of file Train.cs.

Member Function Documentation

◆ BuildName()

string MockPlugin.Device.TrainPart.BuildName ( )
private

Definition at line 100 of file Train.cs.

101 {
102 switch (mMyType)
103 {
104 case TrainPartType.DiningCar:
105 return $"{mTrain.Name}:Diner";
106 case TrainPartType.Locomotive:
107 return $"{mTrain.Name}:Locomotive";
108 default:
109 return $"{mTrain.Name}:Car{Num}";
110 }
111 }
readonly TrainPartType mMyType
Definition Train.cs:79

References MockPlugin.Device.TrainPart.mMyType.

◆ Connect()

void MockPlugin.Device.TrainPart.Connect ( )

You may have connected to the device before this, but make sure you are connected after this.

Implements AxelSemrau.Chronos.Plugin.IDevice.

Definition at line 113 of file Train.cs.

114 {
115
116 }

◆ Disconnect()

void MockPlugin.Device.TrainPart.Disconnect ( )

You may disconnect now.

Implements AxelSemrau.Chronos.Plugin.IDevice.

Definition at line 118 of file Train.cs.

119 {
120
121 }

◆ ToString()

override string MockPlugin.Device.TrainPart.ToString ( )

Important! Without overriding ToString here, you will not be able to pick the device from an autosampler column in the sample list.

Returns

Member Data Documentation

◆ mDoorsAreOpen

bool MockPlugin.Device.TrainPart.mDoorsAreOpen
private

Definition at line 129 of file Train.cs.

◆ mMyType

readonly TrainPartType MockPlugin.Device.TrainPart.mMyType
private

Definition at line 79 of file Train.cs.

Referenced by MockPlugin.Device.TrainPart.BuildName().

◆ mTrain

readonly Train MockPlugin.Device.TrainPart.mTrain
private

Definition at line 78 of file Train.cs.

Property Documentation

◆ DeviceTypeDescription

string MockPlugin.Device.TrainPart.DeviceTypeDescription
get

Text which is displayed to make clear which kind of device a named sampler is.

Implements AxelSemrau.Chronos.Plugin.IDevice.

Definition at line 81 of file Train.cs.

◆ DisplayedTypeName

string MockPlugin.Device.TrainPart.DisplayedTypeName
get

Text which is displayed in the instruments settings "Autosampler Type" column and in many other places.

Implements AxelSemrau.Chronos.Plugin.IDevice.

Definition at line 80 of file Train.cs.

◆ DoorsOpen

bool? MockPlugin.Device.TrainPart.DoorsOpen
getset

Definition at line 130 of file Train.cs.

131 {
132 get => mDoorsAreOpen;
133 set
134 {
135 if (value != mDoorsAreOpen)
136 {
137 mDoorsAreOpen = value;
138 SetStatusMessage?.Invoke($"Doors are {(value ? "open" : "closed")}");
139 if (!value)
140 {
141 mTrain.ClosedSomeDoor();
142 }
143 }
144 }
145 }
readonly Train mTrain
Definition Train.cs:78
Action< string > SetStatusMessage
Definition Train.cs:156

◆ Name

string MockPlugin.Device.TrainPart.Name
getset

We have to return a descriptive name that also allows identification of the base device - just do it like the PAL3 and return BaseName + ":" + PartName.

Implements AxelSemrau.Chronos.Plugin.IDevice.

Definition at line 86 of file Train.cs.

87 {
88 get => BuildName();
89 set { var dummy = value; }
90 }

◆ Num

int MockPlugin.Device.TrainPart.Num
getset

Definition at line 98 of file Train.cs.

98{ get; set; }

Event Documentation

◆ ConnectionStateChanged

Action<ConnectionState> MockPlugin.Device.TrainPart.ConnectionStateChanged
addremove

Not used.

Definition at line 150 of file Train.cs.

151 {
152 add { }
153 remove { }
154 }

◆ SetStatusMessage

Action<string> MockPlugin.Device.TrainPart.SetStatusMessage

Definition at line 156 of file Train.cs.


The documentation for this class was generated from the following file: