Simply3DScan
Configuration.Config Class Reference

Class for accessing the configuration. More...

Public Member Functions

void ReadConfiguration ()
 Reads the configuration from file. More...
 
void WriteConfiguration ()
 Writes the configuration to file. More...
 

Static Public Member Functions

static Camera CreateDefaultCamera ()
 Creates the default camera. More...
 
static Motor CreateDefaultMotor ()
 Creates the default motor. More...
 
static Laser CreateDefaultLaser ()
 Creates the default laser. More...
 
static Turntable CreateDefaultTurntable ()
 Creates the default turntable. More...
 
static Line CreateDefaultVisibleLimits ()
 Creates the default visible limits. More...
 
static Arduino CreateDefaultArduinoSettings ()
 Creates the default arduino settings. More...
 
static Places CreateDefaultPlaces ()
 Creates the default places. More...
 
static List< ResolutionCreateDefaultResolutions ()
 Creates the default resolutions. More...
 
static Filter CreateDefaultFilter ()
 Creates the default filter. More...
 

Properties

Information Information [get]
 Gets the information. More...
 

Detailed Description

Class for accessing the configuration.

Definition at line 12 of file Config.cs.

Member Function Documentation

static Arduino Configuration.Config.CreateDefaultArduinoSettings ( )
static

Creates the default arduino settings.

Returns

Definition at line 173 of file Config.cs.

174  {
175  return new Arduino
176  {
177  Port = String.Empty,
178  BaudRate = 9600
179  };
180  }
static Camera Configuration.Config.CreateDefaultCamera ( )
static

Creates the default camera.

Returns

Definition at line 97 of file Config.cs.

98  {
99  return new Camera
100  {
101  Name = "",
102  Moniker = "",
103  WorldCoordinates = new Coordinates {X = 0.0f, Y = 5.57f, Z = 30.9f},
104  Width = 1280,
105  Height = 960,
106  WorldWidth = 24.6f // c270, c9xx = 26.6f
107  };
108  }
static Filter Configuration.Config.CreateDefaultFilter ( )
static

Creates the default filter.

Returns

Definition at line 218 of file Config.cs.

219  {
220  return new Filter
221  {
222  UseHslFilter = true,
223  SaturationMin = 0.05f,
224  SaturationMax = 1f,
225  LuminanceMin = 0.05f,
226  LuminanceMax = 1f,
227  HueMin = 280,
228  HueMax = 340,
229  UseColorFilter = true,
230  FilterRedMin = 252,
231  FilterRedMax = 255,
232  FilterGreenMin = 0,
233  FilterGreenMax = 255,
234  FilterBlueMin = 0,
235  FilterBlueMax = 255,
236  GrayFilter = GrayFilter.BT709,
237  UseThresholdFilter = true,
238  Threshold = 40,
239  UseErosionFilter = true,
240  UseDiletationFilter = true
241  };
242  }
static Laser Configuration.Config.CreateDefaultLaser ( )
static

Creates the default laser.

Returns

Definition at line 128 of file Config.cs.

129  {
130  return new Laser
131  {
132  WorldCoordinates = new Coordinates {X = 14.0f, Y = 6.4f, Z = 28.8f},
133  UpperRange = 0,
134  LowerRange = 30,
135  Offset = 90,
136  SwipeMin = 18.0f,
137  SwipeMax = 70.0f,
138  MotorEnabled = false
139  };
140  }
static Motor Configuration.Config.CreateDefaultMotor ( )
static

Creates the default motor.

Returns

Definition at line 114 of file Config.cs.

115  {
116  return new Motor
117  {
118  Steps = 200,
119  MicroSteps = 16,
120  MicroStepsEnabled = true
121  };
122  }
static Places Configuration.Config.CreateDefaultPlaces ( )
static

Creates the default places.

Returns

Definition at line 186 of file Config.cs.

187  {
188  return new Places
189  {
190  ImageSubPath = "Images",
191  LogSubPath = "Logs",
192  LastFilePath = String.Empty,
193  SaveImages = false,
194  FileFormat = FileFormat.Ascii
195  };
196  }
FileFormat
File output format
Definition: FileFormat.cs:6
static List<Resolution> Configuration.Config.CreateDefaultResolutions ( )
static

Creates the default resolutions.

Returns

Definition at line 202 of file Config.cs.

203  {
204  return new List<Resolution>
205  {
206  new Resolution(Precision.Excellent, 1.125f, 10, 4),
207  new Resolution(Precision.Good, 2.25f, 20, 6),
208  new Resolution(Precision.Average, 4.5f, 40, 8),
209  new Resolution(Precision.BelowAverage, 9.0f, 80, 10),
210  new Resolution(Precision.Beasty, 18.0f, 160, 12)
211  };
212  }
Precision
Information about the precision of a scan
Definition: Precision.cs:6
static Turntable Configuration.Config.CreateDefaultTurntable ( )
static

Creates the default turntable.

Returns

Definition at line 146 of file Config.cs.

147  {
148  return new Turntable
149  {
150  WorldCoordinates = new Coordinates {X = 0.0f, Y = 0.0f, Z = 7.5f},
151  Radius = 6.25f,
152  SafetyDistance = 5
153  };
154  }
static Line Configuration.Config.CreateDefaultVisibleLimits ( )
static

Creates the default visible limits.

Returns

Definition at line 160 of file Config.cs.

161  {
162  return new Line
163  {
164  PercentFromTop = 75f,
165  Color = Color.FromKnownColor(KnownColor.Blue)
166  };
167  }
void Configuration.Config.ReadConfiguration ( )

Reads the configuration from file.

Definition at line 27 of file Config.cs.

28  {
29  if (!File.Exists(fileName))
30  {
31  this.Information = CreateInitialConfiguration();
32  return;
33  }
34  this.Information = new Information();
35 
36  XmlSerializer reader = new XmlSerializer(typeof (Information));
37  StreamReader file = new StreamReader(fileName);
38  this.Information = (Information)reader.Deserialize(file);
39  file.Close();
40 
41  this.SetMissingValues();
42  }
Information Information
Gets the information.
Definition: Config.cs:22
void Configuration.Config.WriteConfiguration ( )

Writes the configuration to file.

Definition at line 64 of file Config.cs.

65  {
66  XmlSerializer writer = new XmlSerializer(typeof(Information));
67  StreamWriter file = new StreamWriter(fileName);
68  writer.Serialize(file, this.Information);
69  file.Close();
70  }
Information Information
Gets the information.
Definition: Config.cs:22

Property Documentation

Information Configuration.Config.Information
get

Gets the information.

The information.

Definition at line 22 of file Config.cs.


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