Simply3DScan
Simple3DScan.UI.ScanControl Class Reference

Control for 3d Scanning More...

Inheritance diagram for Simple3DScan.UI.ScanControl:
Collaboration diagram for Simple3DScan.UI.ScanControl:

Public Member Functions

delegate void StartScan ()
 
delegate void StopScan ()
 
 ScanControl ()
 Initializes a new instance of the ScanControl class. More...
 
void Init (ArduinoCommands arduino)
 Initializes the control. More...
 

Protected Member Functions

void InitiateCameraDropdown ()
 Initiates the camera dropdown. More...
 
override void Dispose (bool disposing)
 Verwendete Ressourcen bereinigen. More...
 
void ScanWorker_DoWork (object sender, DoWorkEventArgs e)
 Handles the DoWork event of the scanWorker control. More...
 
void ScanWorker_ProgressChanged (object sender, ProgressChangedEventArgs e)
 Handles the ProgressChanged event of the ScanWorker control. More...
 
virtual void ScanWorker_RunWorkerCompleted (object sender, RunWorkerCompletedEventArgs e)
 Handles the RunWorkerCompleted event of the ScanWorker control. More...
 
void ToggleButtonCapture_Click (object sender, EventArgs e)
 Handles the Click event of the toggleButtonCapture control. More...
 
void ComboBoxCameras_SelectedIndexChanged (object sender, EventArgs e)
 Handles the SelectedIndexChanged event of the comboBoxCameras control. More...
 
IEnumerable< ColorPoint3DScanImage (int actualSteps, string imageFolder, int steps, int sweep, ArduinoCommands arduino, CameraControl imaging, Information configuration)
 Scans the image. More...
 
bool PerformScan (ArduinoCommands arduino, CameraControl cameraControl, Information configuration, int numberOfTotalSteps, Resolution resolution, string imageFolder, IPointWriter writer)
 Performs the scan. More...
 
bool InitiateWriter (ArduinoCommands arduino, Information configuration, out IPointWriter writer)
 Initiates the writer. More...
 

Static Protected Member Functions

static void MoveLaserToLeftStartPosition (ArduinoCommands arduino, CameraControl cameraControl, Information configuration)
 Moves the laser to left start position. More...
 
static void GetResolutionAndSteps (Precision precision, Information configuration, out int numberOfTotalSteps, out Resolution resolution)
 Gets the resolution and steps. More...
 
static string ResetImageFolder (Information configuration)
 Resets the image folder. More...
 
static void SavePoints (Control control, IPointWriter writer, Information configuration)
 Saves the points. More...
 

Protected Attributes

readonly BackgroundWorker ScanWorker = new BackgroundWorker()
 The scan worker More...
 
readonly Information ConfigurationInformation = Singleton<Config>.Instance.Information
 The configuration information More...
 
readonly Dictionary< string, string > VideoSources = new Dictionary<string, string>()
 The video sources More...
 
System.Windows.Forms.Label LabelSelectCamera
 
Syncfusion.Windows.Forms.Gauge.RadialGauge RadialGaugeProgress
 
System.Windows.Forms.ComboBox ComboBoxCameras
 
Syncfusion.Windows.Forms.Tools.RadialSlider RadialSliderPrecision
 
System.Windows.Forms.Label LabelCapture
 
Syncfusion.Windows.Forms.Tools.ToggleButton ToggleButtonCapture
 
System.Windows.Forms.Label labelPrecision
 
CameraControl ImagingControl
 

Package Functions

void Stop ()
 Stops this instance. More...
 
void Start ()
 Starts this instance. More...
 

Properties

ArduinoCommands Arduino [get, set]
 The arduino command connection More...
 

Events

StartScan StartScanning
 Occurs when [start scanning]. More...
 
StopScan StopScanning
 Occurs when [stop scanning]. More...
 

Detailed Description

Control for 3d Scanning

Definition at line 20 of file ScanControl.cs.

Constructor & Destructor Documentation

Simple3DScan.UI.ScanControl.ScanControl ( )

Initializes a new instance of the ScanControl class.

Definition at line 72 of file ScanControl.cs.

73  {
74  this.InitializeComponent();
75  }

Member Function Documentation

void Simple3DScan.UI.ScanControl.ComboBoxCameras_SelectedIndexChanged ( object  sender,
EventArgs  e 
)
protected

Handles the SelectedIndexChanged event of the comboBoxCameras control.

Parameters
senderThe source of the event.
eThe EventArgs instance containing the event data.

Definition at line 263 of file ScanControl.cs.

264  {
265  if (!this.VideoSources.ContainsKey(this.ComboBoxCameras.SelectedItem.ToString()))
266  return;
267 
268  this.ConfigurationInformation.Camera.Name = this.ComboBoxCameras.SelectedItem.ToString();
269  this.ConfigurationInformation.Camera.Moniker = this.VideoSources[this.ComboBoxCameras.SelectedItem.ToString()];
270 
271  this.SetMaxFrameSizes(this.ConfigurationInformation.Camera.Moniker);
272 
276 
278  }
readonly Information ConfigurationInformation
The configuration information
Definition: ScanControl.cs:32
void StartImaging(string source)
Starts the imaging.
Camera Camera
Gets or sets the camera.
Definition: Information.cs:24
string Moniker
Gets or sets the moniker.
Definition: Camera.cs:22
string Name
Gets or sets the name.
Definition: Camera.cs:15
float LaserLeftPosition
Gets or sets the laser left position.
Laser Laser
Gets or sets the laser.
Definition: Information.cs:17
float SwipeMax
Gets or sets the swipe maximum.
Definition: Laser.cs:52
float LaserRightPosition
Gets or sets the laser right position.
System.Windows.Forms.ComboBox ComboBoxCameras
readonly Dictionary< string, string > VideoSources
The video sources
Definition: ScanControl.cs:42
bool LaserMotorEnabled
Gets or sets a value indicating whether [laser motor enabled].
int Width
Gets or sets the width.
Definition: Camera.cs:38
float SwipeMin
Gets or sets the swipe minimum.
Definition: Laser.cs:45
bool MotorEnabled
Gets or sets a value indicating whether [motor enabled].
Definition: Laser.cs:59
override void Simple3DScan.UI.ScanControl.Dispose ( bool  disposing)
protected

Verwendete Ressourcen bereinigen.

Parameters
disposingTrue, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.

Definition at line 153 of file ScanControl.cs.

154  {
155  if (disposing && (this.components != null))
156  {
157  this.components.Dispose();
158  }
160 
161  base.Dispose(disposing);
162  }
void StopImaging()
Stops the imaging.
static void Simple3DScan.UI.ScanControl.GetResolutionAndSteps ( Precision  precision,
Information  configuration,
out int  numberOfTotalSteps,
out Resolution  resolution 
)
staticprotected

Gets the resolution and steps.

Parameters
precisionThe precision.
configurationThe configuration.
numberOfTotalStepsThe number of total steps.
resolutionThe resolution.

Definition at line 483 of file ScanControl.cs.

484  {
485  numberOfTotalSteps = configuration.Motor.MicroStepsEnabled
486  ? configuration.Motor.MicroSteps*configuration.Motor.Steps
487  : configuration.Motor.Steps;
488 
489  resolution = configuration.Resolutions.First(x => x.Precision == precision);
490  }
bool MicroStepsEnabled
Gets or sets a value indicating whether [micro steps enabled].
Definition: Motor.cs:31
int MicroSteps
Gets or sets the number of micro steps.
Definition: Motor.cs:24
List< Resolution > Resolutions
Gets or sets the resolutions.
Definition: Information.cs:67
Motor Motor
Gets or sets the motor.
Definition: Information.cs:52
int Steps
Gets or sets the number of steps.
Definition: Motor.cs:16
void Simple3DScan.UI.ScanControl.Init ( ArduinoCommands  arduino)

Initializes the control.

Parameters
arduinoThe arduino.

Definition at line 95 of file ScanControl.cs.

96  {
97  this.Arduino = arduino;
98  this.Arduino.ActivateLaser(false);
99 
100  ButtonRenderer styleRenderer = new ButtonRenderer();
101  this.ToggleButtonCapture.Renderer = styleRenderer;
102 
103  this.RadialSliderPrecision.ValueChanged += this.RadialSliderPrecision_ValueChanged;
104 
105  }
Class holding configuration to access an arduino
Definition: Arduino.cs:7
Syncfusion.Windows.Forms.Tools.RadialSlider RadialSliderPrecision
Syncfusion.Windows.Forms.Tools.ToggleButton ToggleButtonCapture
void Simple3DScan.UI.ScanControl.InitiateCameraDropdown ( )
protected

Initiates the camera dropdown.

Definition at line 112 of file ScanControl.cs.

113  {
114  FilterInfoCollection filterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);
115 
116  int i = 0;
117  foreach (FilterInfo filterInfo in filterInfoCollection)
118  {
119  this.ComboBoxCameras.Items.Add(filterInfo.Name);
120  this.VideoSources.Add(filterInfo.Name, filterInfo.MonikerString);
121  if (!String.IsNullOrEmpty(this.ConfigurationInformation.Camera.Name) &&
122  filterInfo.Name == this.ConfigurationInformation.Camera.Name)
123  this.ComboBoxCameras.SelectedIndex = i;
124  i++;
125  }
126  }
readonly Information ConfigurationInformation
The configuration information
Definition: ScanControl.cs:32
Camera Camera
Gets or sets the camera.
Definition: Information.cs:24
string Name
Gets or sets the name.
Definition: Camera.cs:15
System.Windows.Forms.ComboBox ComboBoxCameras
readonly Dictionary< string, string > VideoSources
The video sources
Definition: ScanControl.cs:42
bool Simple3DScan.UI.ScanControl.InitiateWriter ( ArduinoCommands  arduino,
Information  configuration,
out IPointWriter  writer 
)
protected

Initiates the writer.

Parameters
arduinoThe arduino.
configurationThe configuration.
writerThe writer.
Returns

Definition at line 523 of file ScanControl.cs.

524  {
525  switch (configuration.Places.FileFormat)
526  {
527  case FileFormat.Ascii:
528  arduino.ActivateLaser();
529  writer = new WriterAsc();
530  break;
531  case FileFormat.Pcd:
532  writer = new WriterPcd();
533  break;
534  default:
535  writer = null;
536  return false;
537  }
538  return true;
539  }
FileFormat FileFormat
Gets or sets the file format.
Definition: Places.cs:46
Write Points to PCD file
Definition: WriterPcd.cs:27
Places Places
Gets or sets the places.
Definition: Information.cs:59
FileFormat
File output format
Definition: FileFormat.cs:6
void ActivateLaser(bool on=true)
Activates the laser.
Write Points to Asc file
Definition: WriterAsc.cs:13

Here is the call graph for this function:

static void Simple3DScan.UI.ScanControl.MoveLaserToLeftStartPosition ( ArduinoCommands  arduino,
CameraControl  cameraControl,
Information  configuration 
)
staticprotected

Moves the laser to left start position.

Parameters
arduinoThe arduino.
cameraControlThe camera control.
configurationThe configuration.

Definition at line 453 of file ScanControl.cs.

454  {
455  if (!configuration.Laser.MotorEnabled)
456  return;
457  arduino.ActivateLaser();
458 
459  float actualX = TransformImage.GetLaserLinePosition(cameraControl.GetNextPicture(), configuration.Filter);
460 
461  while (actualX > configuration.Laser.SwipeMin*configuration.Camera.Width/100)
462  {
463  arduino.RotateLaserCcw(4);
464  actualX = TransformImage.GetLaserLinePosition(cameraControl.GetNextPicture(), configuration.Filter);
465  }
466  arduino.RotateLaserCcw(4);
467  arduino.ActivateLaser(false);
468  }
Filter Filter
Gets or sets the filter.
Definition: Information.cs:89
Camera Camera
Gets or sets the camera.
Definition: Information.cs:24
Laser Laser
Gets or sets the laser.
Definition: Information.cs:17
void ActivateLaser(bool on=true)
Activates the laser.
void RotateLaserCcw(int steps)
Rotates the laser counter clockwise.
int Width
Gets or sets the width.
Definition: Camera.cs:38
float SwipeMin
Gets or sets the swipe minimum.
Definition: Laser.cs:45
bool MotorEnabled
Gets or sets a value indicating whether [motor enabled].
Definition: Laser.cs:59

Here is the call graph for this function:

bool Simple3DScan.UI.ScanControl.PerformScan ( ArduinoCommands  arduino,
CameraControl  cameraControl,
Information  configuration,
int  numberOfTotalSteps,
Resolution  resolution,
string  imageFolder,
IPointWriter  writer 
)
protected

Performs the scan.

Parameters
arduinoThe arduino.
cameraControlThe camera control.
configurationThe configuration.
numberOfTotalStepsThe number of total steps.
resolutionThe resolution.
imageFolderThe image folder.
writerThe writer.
Returns

Definition at line 421 of file ScanControl.cs.

422  {
423  for (int actualSteps = 0; actualSteps <= numberOfTotalSteps; actualSteps += resolution.Steps)
424  {
425  if (this.ScanWorker.CancellationPending)
426  return true;
427 
428  int percentage = actualSteps*100/numberOfTotalSteps;
429 
430  IEnumerable<ColorPoint3D> points = this.ScanImage(actualSteps, imageFolder, resolution.Steps, resolution.SweepSteps, arduino, cameraControl, configuration);
431 
432  if(null != points)
433  foreach (ColorPoint3D point in points)
434  writer.AddPoint(point);
435 
436  this.ScanWorker.ReportProgress(percentage);
437  }
438  return false;
439  }
int Steps
Gets or sets the steps.
Definition: Resolution.cs:33
void AddPoint(ColorPoint3D point)
Adds the point.
IEnumerable< ColorPoint3D > ScanImage(int actualSteps, string imageFolder, int steps, int sweep, ArduinoCommands arduino, CameraControl imaging, Information configuration)
Scans the image.
Definition: ScanControl.cs:315
readonly BackgroundWorker ScanWorker
The scan worker
Definition: ScanControl.cs:27
int SweepSteps
Gets or sets the sweep steps.
Definition: Resolution.cs:41

Here is the call graph for this function:

static string Simple3DScan.UI.ScanControl.ResetImageFolder ( Information  configuration)
staticprotected

Resets the image folder.

Parameters
configurationThe configuration.
Returns

Definition at line 503 of file ScanControl.cs.

504  {
505  string imageFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
506  configuration.Places.ImageSubPath);
507 
508  FileHelper.CreatePathIfNotExisting(imageFolder);
509 
510  FileHelper.DeleteAllFilesInFolder(imageFolder);
511  return imageFolder;
512  }
static void CreatePathIfNotExisting(string folder)
Creates the path if not existing.
Definition: FileHelper.cs:14
string ImageSubPath
Gets or sets the image sub path.
Definition: Places.cs:38
static File Helpers
Definition: FileHelper.cs:8
Places Places
Gets or sets the places.
Definition: Information.cs:59
static void DeleteAllFilesInFolder(string imageFolder)
Deletes all files in folder.
Definition: FileHelper.cs:26

Here is the call graph for this function:

static void Simple3DScan.UI.ScanControl.SavePoints ( Control  control,
IPointWriter  writer,
Information  configuration 
)
staticprotected

Saves the points.

Parameters
controlThe control.
writerThe writer.
configurationThe configuration.

Definition at line 549 of file ScanControl.cs.

550  {
551  control.Invoke((MethodInvoker) delegate
552  {
553  SaveFileDialog saveDialog = new SaveFileDialog();
554  if (!String.IsNullOrEmpty(configuration.Places.ImageSubPath))
555  saveDialog.InitialDirectory = configuration.Places.ImageSubPath;
556 
557  switch (configuration.Places.FileFormat)
558  {
559 
560  case FileFormat.Pcd:
561  saveDialog.DefaultExt = ".PLY";
562  saveDialog.Filter = "PLY (.ply)|*.ply";
563  saveDialog.FileName = "ColoredPoints" + DateTime.Now.ToFileTime();
564  break;
565  default:
566  saveDialog.DefaultExt = ".asc";
567  saveDialog.Filter = "Ascii (.asc)|*.asc";
568  saveDialog.FileName = "Points" + DateTime.Now.ToFileTime();
569  break;
570  }
571 
572  DialogResult result = saveDialog.ShowDialog();
573 
574  if (result != DialogResult.OK)
575  return;
576 
577  string filename = saveDialog.FileName;
578  configuration.Places.LastFilePath = Path.GetDirectoryName(filename);
579  writer.Write(filename);
580  });
581  }
FileFormat FileFormat
Gets or sets the file format.
Definition: Places.cs:46
string LastFilePath
Gets or sets the last file path.
Definition: Places.cs:22
void Write(string fileName)
Writes to specified file name.
string ImageSubPath
Gets or sets the image sub path.
Definition: Places.cs:38
Places Places
Gets or sets the places.
Definition: Information.cs:59
FileFormat
File output format
Definition: FileFormat.cs:6

Here is the call graph for this function:

IEnumerable<ColorPoint3D> Simple3DScan.UI.ScanControl.ScanImage ( int  actualSteps,
string  imageFolder,
int  steps,
int  sweep,
ArduinoCommands  arduino,
CameraControl  imaging,
Information  configuration 
)
protected

Scans the image.

Parameters
actualStepsThe actual steps.
imageFolderThe image folder.
stepsThe steps.
sweepThe sweep.
arduinoThe arduino.
imagingThe imaging.
configurationThe configuration.
Returns

Definition at line 315 of file ScanControl.cs.

316  {
317  Image image;
318  Image imageOff = null;
319  List<ColorPoint3D> points = new List<ColorPoint3D>();
320 
321  if (!configuration.Laser.MotorEnabled)
322  {
323  if (configuration.Places.FileFormat == FileFormat.Pcd)
324  {
325  arduino.ActivateLaser(false);
326 
327  image = imaging.GetNextPicture();
328 
329  imageOff = (Image) image.Clone();
330  imageOff.SaveImage(imageFolder, "OffLaserLight", actualSteps, configuration); // for autodesk 123d
331 
332  arduino.ActivateLaser();
333  }
334 
335  image = imaging.GetNextPicture();
336 
337  if (configuration.Places.FileFormat == FileFormat.Pcd)
338  arduino.ActivateLaser(false);
339 
340  image.SaveImage(imageFolder, "OnLaserLight", actualSteps, configuration);
341 
342  image = TransformImage.CreateGrayImageOfLaser((Bitmap) image, configuration.Filter);
343  image.SaveImage(imageFolder, "LaserLight", actualSteps, configuration);
344 
345  Image skeletonImage = TransformImage.SimpleSkeletonizationImage((Bitmap) image);
346  skeletonImage.SaveImage(imageFolder, "Skeleton", actualSteps, configuration);
347 
348  points = TransformImage.TransformStepImage(skeletonImage, imageOff, actualSteps,
349  configuration.Motor.MicroStepsEnabled, configuration);
350  }
351 
352  if (configuration.Laser.MotorEnabled)
353  {
354  if (configuration.Places.FileFormat == FileFormat.Pcd)
355  arduino.ActivateLaser();
356 
357  image = imaging.GetNextPicture();
358 
359  float actualX = TransformImage.GetLaserLinePosition(image, configuration.Filter);
360  bool swipeRight = actualX <= configuration.Laser.SwipeMin*configuration.Camera.Width/100;
361 
362  if (swipeRight)
363  {
364  while (TransformImage.GetLaserLinePosition(image, configuration.Filter) <
365  configuration.Laser.SwipeMax*configuration.Camera.Width/100)
366  {
367  if (this.ScanWorker.CancellationPending)
368  return null;
369 
370  arduino.RotateLaserCw(sweep);
371 
372  image = CaptureSweepImage(actualSteps, imaging, configuration, ref points);
373  }
374  }
375  else
376  {
377  while (TransformImage.GetLaserLinePosition(image, configuration.Filter) >
378  configuration.Laser.SwipeMin*configuration.Camera.Width/100)
379  {
380  if (this.ScanWorker.CancellationPending)
381  return null;
382 
383  arduino.RotateLaserCcw(sweep);
384 
385  image = CaptureSweepImage(actualSteps, imaging, configuration, ref points);
386  }
387  }
388  }
389  arduino.RotateTurnTableCw(steps);
390 
391  return points;
392  }
Filter Filter
Gets or sets the filter.
Definition: Information.cs:89
FileFormat FileFormat
Gets or sets the file format.
Definition: Places.cs:46
Camera Camera
Gets or sets the camera.
Definition: Information.cs:24
void RotateLaserCw(int steps)
Rotates the laser clockwise.
Laser Laser
Gets or sets the laser.
Definition: Information.cs:17
float SwipeMax
Gets or sets the swipe maximum.
Definition: Laser.cs:52
bool MicroStepsEnabled
Gets or sets a value indicating whether [micro steps enabled].
Definition: Motor.cs:31
void RotateTurnTableCw(int steps)
Rotates the turn table clockwise.
Places Places
Gets or sets the places.
Definition: Information.cs:59
readonly BackgroundWorker ScanWorker
The scan worker
Definition: ScanControl.cs:27
FileFormat
File output format
Definition: FileFormat.cs:6
void ActivateLaser(bool on=true)
Activates the laser.
void RotateLaserCcw(int steps)
Rotates the laser counter clockwise.
int Width
Gets or sets the width.
Definition: Camera.cs:38
System.Drawing.Image Image
Motor Motor
Gets or sets the motor.
Definition: Information.cs:52
float SwipeMin
Gets or sets the swipe minimum.
Definition: Laser.cs:45
bool MotorEnabled
Gets or sets a value indicating whether [motor enabled].
Definition: Laser.cs:59

Here is the call graph for this function:

void Simple3DScan.UI.ScanControl.ScanWorker_DoWork ( object  sender,
DoWorkEventArgs  e 
)
protected

Handles the DoWork event of the scanWorker control.

Parameters
senderThe source of the event.
eThe DoWorkEventArgs instance containing the event data.

Definition at line 173 of file ScanControl.cs.

174  {
175  if (this.StartScanning != null)
176  this.StartScanning();
177  Precision precision = (Precision)e.Argument;
178 
179  string imageFolder = ResetImageFolder(this.ConfigurationInformation);
180 
181  int numberOfTotalSteps;
182  Resolution resolution;
183  GetResolutionAndSteps(precision, this.ConfigurationInformation, out numberOfTotalSteps, out resolution);
184 
186 
187  IPointWriter writer;
188  if (!this.InitiateWriter(this.Arduino, this.ConfigurationInformation, out writer))
189  return;
190 
191  if (this.PerformScan(this.Arduino, this.ImagingControl, this.ConfigurationInformation, numberOfTotalSteps, resolution, imageFolder, writer)) return;
192 
194  this.Arduino.ActivateLaser(false);
195 
196  SavePoints(this, writer, this.ConfigurationInformation);
197  }
FileFormat FileFormat
Gets or sets the file format.
Definition: Places.cs:46
readonly Information ConfigurationInformation
The configuration information
Definition: ScanControl.cs:32
Configuration of a scan resulution
Definition: Resolution.cs:10
Class holding configuration to access an arduino
Definition: Arduino.cs:7
static string ResetImageFolder(Information configuration)
Resets the image folder.
Definition: ScanControl.cs:503
static void MoveLaserToLeftStartPosition(ArduinoCommands arduino, CameraControl cameraControl, Information configuration)
Moves the laser to left start position.
Definition: ScanControl.cs:453
Places Places
Gets or sets the places.
Definition: Information.cs:59
FileFormat
File output format
Definition: FileFormat.cs:6
bool PerformScan(ArduinoCommands arduino, CameraControl cameraControl, Information configuration, int numberOfTotalSteps, Resolution resolution, string imageFolder, IPointWriter writer)
Performs the scan.
Definition: ScanControl.cs:421
Interface for writing points to file
Definition: IPointWriter.cs:8
static void GetResolutionAndSteps(Precision precision, Information configuration, out int numberOfTotalSteps, out Resolution resolution)
Gets the resolution and steps.
Definition: ScanControl.cs:483
StartScan StartScanning
Occurs when [start scanning].
Definition: ScanControl.cs:54
Precision
Information about the precision of a scan
Definition: Precision.cs:6
static void SavePoints(Control control, IPointWriter writer, Information configuration)
Saves the points.
Definition: ScanControl.cs:549
bool InitiateWriter(ArduinoCommands arduino, Information configuration, out IPointWriter writer)
Initiates the writer.
Definition: ScanControl.cs:523
void Simple3DScan.UI.ScanControl.ScanWorker_ProgressChanged ( object  sender,
ProgressChangedEventArgs  e 
)
protected

Handles the ProgressChanged event of the ScanWorker control.

Parameters
senderThe source of the event.
eThe ProgressChangedEventArgs instance containing the event data.

Definition at line 205 of file ScanControl.cs.

206  {
207  this.RadialGaugeProgress.Value = e.ProgressPercentage;
208  }
Syncfusion.Windows.Forms.Gauge.RadialGauge RadialGaugeProgress
virtual void Simple3DScan.UI.ScanControl.ScanWorker_RunWorkerCompleted ( object  sender,
RunWorkerCompletedEventArgs  e 
)
protectedvirtual

Handles the RunWorkerCompleted event of the ScanWorker control.

Parameters
senderThe source of the event.
eThe RunWorkerCompletedEventArgs instance containing the event data.

Definition at line 217 of file ScanControl.cs.

218  {
219  if (this.StopScanning != null)
220  this.StopScanning();
221 
222  this.ToggleButtonCapture.ToggleState = ToggleButtonState.Inactive;
223  this.ScanWorker.DoWork -= this.ScanWorker_DoWork;
224  this.ScanWorker.ProgressChanged -= this.ScanWorker_ProgressChanged;
225  this.ScanWorker.RunWorkerCompleted -= this.ScanWorker_RunWorkerCompleted;
226  this.Arduino.ActivateLaser(false);
227  }
void ScanWorker_DoWork(object sender, DoWorkEventArgs e)
Handles the DoWork event of the scanWorker control.
Definition: ScanControl.cs:173
Class holding configuration to access an arduino
Definition: Arduino.cs:7
Syncfusion.Windows.Forms.Tools.ToggleButton ToggleButtonCapture
readonly BackgroundWorker ScanWorker
The scan worker
Definition: ScanControl.cs:27
void ScanWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
Handles the ProgressChanged event of the ScanWorker control.
Definition: ScanControl.cs:205
StopScan StopScanning
Occurs when [stop scanning].
Definition: ScanControl.cs:62
virtual void ScanWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
Handles the RunWorkerCompleted event of the ScanWorker control.
Definition: ScanControl.cs:217
void Simple3DScan.UI.ScanControl.Start ( )
package

Starts this instance.

Definition at line 603 of file ScanControl.cs.

604  {
606  }
readonly Information ConfigurationInformation
The configuration information
Definition: ScanControl.cs:32
void StartImaging(string source)
Starts the imaging.
Camera Camera
Gets or sets the camera.
Definition: Information.cs:24
string Name
Gets or sets the name.
Definition: Camera.cs:15
delegate void Simple3DScan.UI.ScanControl.StartScan ( )

void Simple3DScan.UI.ScanControl.Stop ( )
package

Stops this instance.

Definition at line 591 of file ScanControl.cs.

592  {
594  if (this.ScanWorker.IsBusy)
595  this.ScanWorker.CancelAsync();
596  }
void StopImaging()
Stops the imaging.
readonly BackgroundWorker ScanWorker
The scan worker
Definition: ScanControl.cs:27
delegate void Simple3DScan.UI.ScanControl.StopScan ( )

void Simple3DScan.UI.ScanControl.ToggleButtonCapture_Click ( object  sender,
EventArgs  e 
)
protected

Handles the Click event of the toggleButtonCapture control.

Parameters
senderThe source of the event.
eThe EventArgs instance containing the event data.

Definition at line 239 of file ScanControl.cs.

240  {
241  this.RadialGaugeProgress.Value = 0;
242 
243  if (this.ScanWorker.IsBusy != true)
244  {
245  this.ScanWorker.DoWork += this.ScanWorker_DoWork;
246  this.ScanWorker.ProgressChanged += this.ScanWorker_ProgressChanged;
247  this.ScanWorker.RunWorkerCompleted += this.ScanWorker_RunWorkerCompleted;
248  this.ScanWorker.WorkerReportsProgress = true;
249  this.ScanWorker.WorkerSupportsCancellation = true;
250  this.ScanWorker.RunWorkerAsync((Precision)this.RadialSliderPrecision.Value);
251  }
252  else
253  this.ScanWorker.CancelAsync();
254  }
Syncfusion.Windows.Forms.Gauge.RadialGauge RadialGaugeProgress
void ScanWorker_DoWork(object sender, DoWorkEventArgs e)
Handles the DoWork event of the scanWorker control.
Definition: ScanControl.cs:173
Syncfusion.Windows.Forms.Tools.RadialSlider RadialSliderPrecision
readonly BackgroundWorker ScanWorker
The scan worker
Definition: ScanControl.cs:27
void ScanWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
Handles the ProgressChanged event of the ScanWorker control.
Definition: ScanControl.cs:205
Precision
Information about the precision of a scan
Definition: Precision.cs:6
virtual void ScanWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
Handles the RunWorkerCompleted event of the ScanWorker control.
Definition: ScanControl.cs:217

Member Data Documentation

System.Windows.Forms.ComboBox Simple3DScan.UI.ScanControl.ComboBoxCameras
protected

Definition at line 219 of file ScanControl.Designer.cs.

readonly Information Simple3DScan.UI.ScanControl.ConfigurationInformation = Singleton<Config>.Instance.Information
protected

The configuration information

Definition at line 32 of file ScanControl.cs.

CameraControl Simple3DScan.UI.ScanControl.ImagingControl
protected

Definition at line 224 of file ScanControl.Designer.cs.

System.Windows.Forms.Label Simple3DScan.UI.ScanControl.LabelCapture
protected

Definition at line 221 of file ScanControl.Designer.cs.

System.Windows.Forms.Label Simple3DScan.UI.ScanControl.labelPrecision
protected

Definition at line 223 of file ScanControl.Designer.cs.

System.Windows.Forms.Label Simple3DScan.UI.ScanControl.LabelSelectCamera
protected

Definition at line 217 of file ScanControl.Designer.cs.

Syncfusion.Windows.Forms.Gauge.RadialGauge Simple3DScan.UI.ScanControl.RadialGaugeProgress
protected

Definition at line 218 of file ScanControl.Designer.cs.

Syncfusion.Windows.Forms.Tools.RadialSlider Simple3DScan.UI.ScanControl.RadialSliderPrecision
protected

Definition at line 220 of file ScanControl.Designer.cs.

readonly BackgroundWorker Simple3DScan.UI.ScanControl.ScanWorker = new BackgroundWorker()
protected

The scan worker

Definition at line 27 of file ScanControl.cs.

Syncfusion.Windows.Forms.Tools.ToggleButton Simple3DScan.UI.ScanControl.ToggleButtonCapture
protected

Definition at line 222 of file ScanControl.Designer.cs.

readonly Dictionary<string, string> Simple3DScan.UI.ScanControl.VideoSources = new Dictionary<string, string>()
protected

The video sources

Definition at line 42 of file ScanControl.cs.

Property Documentation

ArduinoCommands Simple3DScan.UI.ScanControl.Arduino
getset

The arduino command connection

Definition at line 37 of file ScanControl.cs.

Event Documentation

StartScan Simple3DScan.UI.ScanControl.StartScanning

Occurs when [start scanning].

Definition at line 54 of file ScanControl.cs.

StopScan Simple3DScan.UI.ScanControl.StopScanning

Occurs when [stop scanning].

Definition at line 62 of file ScanControl.cs.


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