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

Parameter class for an acquisition service that has a variable number of properties. More...

+ Inheritance diagram for MockPlugin.AcquisitionService.DynamicAcqPars:
+ Collaboration diagram for MockPlugin.AcquisitionService.DynamicAcqPars:

Classes

class  StringListPropertyDescriptor
 Maps a property to an entry in our string list. More...
 

Public Member Functions

 DynamicAcqPars ()
 
override PropertyDescriptorCollection GetProperties ()
 
override string ToString ()
 

Properties

uint NoOfFakePars [get, set]
 

Private Member Functions

void UpdateParlist ()
 
IEnumerable< PropertyDescriptor > GetFakePropDescriptors ()
 

Private Attributes

int mNoOfFakePars = 3
 
readonly List< PropertyDescriptor > mPropList = new List<PropertyDescriptor>()
 
readonly List< string > mFakePars = new List<string>()
 

Detailed Description

Parameter class for an acquisition service that has a variable number of properties.

Definition at line 15 of file MockDynamicParAcquisitionService.cs.

Constructor & Destructor Documentation

◆ DynamicAcqPars()

MockPlugin.AcquisitionService.DynamicAcqPars.DynamicAcqPars ( )

Member Function Documentation

◆ GetFakePropDescriptors()

IEnumerable< PropertyDescriptor > MockPlugin.AcquisitionService.DynamicAcqPars.GetFakePropDescriptors ( )
private

Definition at line 67 of file MockDynamicParAcquisitionService.cs.

68 {
69 for(var index = 0; index < mFakePars.Count; ++index)
70 {
71 yield return new StringListPropertyDescriptor(mFakePars, index);
72 }
73 }

References MockPlugin.AcquisitionService.DynamicAcqPars.mFakePars.

Referenced by MockPlugin.AcquisitionService.DynamicAcqPars.GetProperties().

◆ GetProperties()

override PropertyDescriptorCollection MockPlugin.AcquisitionService.DynamicAcqPars.GetProperties ( )

◆ ToString()

override string MockPlugin.AcquisitionService.DynamicAcqPars.ToString ( )

Definition at line 125 of file MockDynamicParAcquisitionService.cs.

126 {
127 return $"{mNoOfFakePars} Parameters, Values: {string.Join(", ", mFakePars)}";
128 }

◆ UpdateParlist()

void MockPlugin.AcquisitionService.DynamicAcqPars.UpdateParlist ( )
private

Definition at line 36 of file MockDynamicParAcquisitionService.cs.

37 {
38 mPropList.Clear();
39 mPropList.AddRange(TypeDescriptor.GetProperties(this,noCustomTypeDesc:true).OfType<PropertyDescriptor>());
40 var oldCount = mFakePars.Count;
41 if (oldCount > mNoOfFakePars)
42 {
43 mFakePars.RemoveRange(mNoOfFakePars,oldCount-mNoOfFakePars);
44 }
45 else if(oldCount < mNoOfFakePars)
46 {
47 for (var i = oldCount + 1; i <= mNoOfFakePars; ++i)
48 {
49 mFakePars.Add($"Placeholder {i}");
50 }
51 }
52 else
53 {
54 // wenn nichts geändert wurde, kein Refresh nötig
55 return;
56 }
57 TypeDescriptor.Refresh(this);
58 }

References MockPlugin.AcquisitionService.DynamicAcqPars.mFakePars, MockPlugin.AcquisitionService.DynamicAcqPars.mNoOfFakePars, and MockPlugin.AcquisitionService.DynamicAcqPars.mPropList.

Referenced by MockPlugin.AcquisitionService.DynamicAcqPars.DynamicAcqPars().

Member Data Documentation

◆ mFakePars

readonly List<string> MockPlugin.AcquisitionService.DynamicAcqPars.mFakePars = new List<string>()
private

◆ mNoOfFakePars

int MockPlugin.AcquisitionService.DynamicAcqPars.mNoOfFakePars = 3
private

◆ mPropList

readonly List<PropertyDescriptor> MockPlugin.AcquisitionService.DynamicAcqPars.mPropList = new List<PropertyDescriptor>()
private

Property Documentation

◆ NoOfFakePars

uint MockPlugin.AcquisitionService.DynamicAcqPars.NoOfFakePars
getset

Definition at line 26 of file MockDynamicParAcquisitionService.cs.

27 {
28 get => (uint)mNoOfFakePars;
29 set
30 {
31 mNoOfFakePars = (int)value;
33 }
34 }

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