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 259 of file ScanControl.cs.

260  {
261  if (!this.VideoSources.ContainsKey(this.ComboBoxCameras.SelectedItem.ToString()))
262  return;
263 
264  this.ConfigurationInformation.Camera.Name = this.ComboBoxCameras.SelectedItem.ToString();
265  this.ConfigurationInformation.Camera.Moniker = this.VideoSources[this.ComboBoxCameras.SelectedItem.ToString()];
266 
267  this.SetMaxFrameSizes(this.ConfigurationInformation.Camera.Moniker);
268 
272 
274  }
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 151 of file ScanControl.cs.

152  {
153  if (disposing)
154  {
155  this.components?.Dispose();
156  }
158 
159  base.Dispose(disposing);
160  }
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 479 of file ScanControl.cs.

480  {
481  numberOfTotalSteps = configuration.Motor.MicroStepsEnabled
482  ? configuration.Motor.MicroSteps*configuration.Motor.Steps
483  : configuration.Motor.Steps;
484 
485  resolution = configuration.Resolutions.First(x => x.Precision == precision);
486  }
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  int i = 0;
115  foreach (FilterInfo filterInfo in new FilterInfoCollection(FilterCategory.VideoInputDevice))
116  {
117  this.ComboBoxCameras.Items.Add(filterInfo.Name);
118  this.VideoSources.Add(filterInfo.Name, filterInfo.MonikerString);
119  if (!String.IsNullOrEmpty(this.ConfigurationInformation.Camera.Name) &&
120  filterInfo.Name == this.ConfigurationInformation.Camera.Name)
121  this.ComboBoxCameras.SelectedIndex = i;
122  i++;
123  }
124  }
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 519 of file ScanControl.cs.

520  {
521  switch (configuration.Places.FileFormat)
522  {
523  case FileFormat.Ascii:
524  arduino.ActivateLaser();
525  writer = new WriterAsc();
526  break;
527  case FileFormat.Pcd:
528  writer = new WriterPcd();
529  break;
530  default:
531  writer = null;
532  return false;
533  }
534  return true;
535  }
FileFormat FileFormat
Gets or sets the file format.
Definition: Places.cs:46
Write Points to PCD file
Definition: WriterPcd.cs:26
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 449 of file ScanControl.cs.

450  {
451  if (!configuration.Laser.MotorEnabled)
452  return;
453  arduino.ActivateLaser();
454 
455  float actualX = TransformImage.GetLaserLinePosition(cameraControl.GetNextPicture(), configuration.Filter);
456 
457  while (actualX > configuration.Laser.SwipeMin*configuration.Camera.Width/100)
458  {
459  arduino.RotateLaserCcw(4);
460  actualX = TransformImage.GetLaserLinePosition(cameraControl.GetNextPicture(), configuration.Filter);
461  }
462  arduino.RotateLaserCcw(4);
463  arduino.ActivateLaser(false);
464  }
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 417 of file ScanControl.cs.

418  {
419  for (int actualSteps = 0; actualSteps <= numberOfTotalSteps; actualSteps += resolution.Steps)
420  {
421  if (this.ScanWorker.CancellationPending)
422  return true;
423 
424  int percentage = actualSteps*100/numberOfTotalSteps;
425 
426  IEnumerable<ColorPoint3D> points = this.ScanImage(actualSteps, imageFolder, resolution.Steps, resolution.SweepSteps, arduino, cameraControl, configuration);
427 
428  if(null != points)
429  foreach (ColorPoint3D point in points)
430  writer.AddPoint(point);
431 
432  this.ScanWorker.ReportProgress(percentage);
433  }
434  return false;
435  }
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:311
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 499 of file ScanControl.cs.

500  {
501  string imageFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
502  configuration.Places.ImageSubPath);
503 
504  FileHelper.CreatePathIfNotExisting(imageFolder);
505 
506  FileHelper.DeleteAllFilesInFolder(imageFolder);
507  return imageFolder;
508  }
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 545 of file ScanControl.cs.

546  {
547  control.Invoke((MethodInvoker) delegate
548  {
549  SaveFileDialog saveDialog = new SaveFileDialog();
550  if (!String.IsNullOrEmpty(configuration.Places.ImageSubPath))
551  saveDialog.InitialDirectory = configuration.Places.ImageSubPath;
552 
553  switch (configuration.Places.FileFormat)
554  {
555 
556  case FileFormat.Pcd:
557  saveDialog.DefaultExt = ".PLY";
558  saveDialog.Filter = "PLY (.ply)|*.ply";
559  saveDialog.FileName = "ColoredPoints" + DateTime.Now.ToFileTime();
560  break;
561  default:
562  saveDialog.DefaultExt = ".asc";
563  saveDialog.Filter = "Ascii (.asc)|*.asc";
564  saveDialog.FileName = "Points" + DateTime.Now.ToFileTime();
565  break;
566  }
567 
568  DialogResult result = saveDialog.ShowDialog();
569 
570  if (result != DialogResult.OK)
571  return;
572 
573  string filename = saveDialog.FileName;
574  configuration.Places.LastFilePath = Path.GetDirectoryName(filename);
575  writer.Write(filename);
576  });
577  }
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 311 of file ScanControl.cs.

312  {
313  Image image;
314  Image imageOff = null;
315  List<ColorPoint3D> points = new List<ColorPoint3D>();
316 
317  if (!configuration.Laser.MotorEnabled)
318  {
319  if (configuration.Places.FileFormat == FileFormat.Pcd)
320  {
321  arduino.ActivateLaser(false);
322 
323  image = imaging.GetNextPicture();
324 
325  imageOff = (Image) image.Clone();
326  imageOff.SaveImage(imageFolder, "OffLaserLight", actualSteps, configuration); // for autodesk 123d
327 
328  arduino.ActivateLaser();
329  }
330 
331  image = imaging.GetNextPicture();
332 
333  if (configuration.Places.FileFormat == FileFormat.Pcd)
334  arduino.ActivateLaser(false);
335 
336  image.SaveImage(imageFolder, "OnLaserLight", actualSteps, configuration);
337 
338  image = TransformImage.CreateGrayImageOfLaser((Bitmap) image, configuration.Filter);
339  image.SaveImage(imageFolder, "LaserLight", actualSteps, configuration);
340 
341  Image skeletonImage = TransformImage.SimpleSkeletonizationImage((Bitmap) image);
342  skeletonImage.SaveImage(imageFolder, "Skeleton", actualSteps, configuration);
343 
344  points = TransformImage.TransformStepImage(skeletonImage, imageOff, actualSteps,
345  configuration.Motor.MicroStepsEnabled, configuration);
346  }
347 
348  if (configuration.Laser.MotorEnabled)
349  {
350  if (configuration.Places.FileFormat == FileFormat.Pcd)
351  arduino.ActivateLaser();
352 
353  image = imaging.GetNextPicture();
354 
355  float actualX = TransformImage.GetLaserLinePosition(image, configuration.Filter);
356  bool swipeRight = actualX <= configuration.Laser.SwipeMin*configuration.Camera.Width/100;
357 
358  if (swipeRight)
359  {
360  while (TransformImage.GetLaserLinePosition(image, configuration.Filter) <
361  configuration.Laser.SwipeMax*configuration.Camera.Width/100)
362  {
363  if (this.ScanWorker.CancellationPending)
364  return null;
365 
366  arduino.RotateLaserCw(sweep);
367 
368  image = CaptureSweepImage(actualSteps, imaging, configuration, ref points);
369  }
370  }
371  else
372  {
373  while (TransformImage.GetLaserLinePosition(image, configuration.Filter) >
374  configuration.Laser.SwipeMin*configuration.Camera.Width/100)
375  {
376  if (this.ScanWorker.CancellationPending)
377  return null;
378 
379  arduino.RotateLaserCcw(sweep);
380 
381  image = CaptureSweepImage(actualSteps, imaging, configuration, ref points);
382  }
383  }
384  }
385  arduino.RotateTurnTableCw(steps);
386 
387  return points;
388  }
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 171 of file ScanControl.cs.

172  {
173  this.StartScanning?.Invoke();
174  Precision precision = (Precision)e.Argument;
175 
176  string imageFolder = ResetImageFolder(this.ConfigurationInformation);
177 
178  int numberOfTotalSteps;
179  Resolution resolution;
180  GetResolutionAndSteps(precision, this.ConfigurationInformation, out numberOfTotalSteps, out resolution);
181 
183 
184  IPointWriter writer;
185  if (!this.InitiateWriter(this.Arduino, this.ConfigurationInformation, out writer))
186  return;
187 
188  if (this.PerformScan(this.Arduino, this.ImagingControl, this.ConfigurationInformation, numberOfTotalSteps, resolution, imageFolder, writer)) return;
189 
191  this.Arduino.ActivateLaser(false);
192 
193  SavePoints(this, writer, this.ConfigurationInformation);
194  }
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:499
static void MoveLaserToLeftStartPosition(ArduinoCommands arduino, CameraControl cameraControl, Information configuration)
Moves the laser to left start position.
Definition: ScanControl.cs:449
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:417
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:479
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:545
bool InitiateWriter(ArduinoCommands arduino, Information configuration, out IPointWriter writer)
Initiates the writer.
Definition: ScanControl.cs:519
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 202 of file ScanControl.cs.

203  {
204  this.RadialGaugeProgress.Value = e.ProgressPercentage;
205  }
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 214 of file ScanControl.cs.

215  {
216  this.StopScanning?.Invoke();
217 
218  this.ToggleButtonCapture.ToggleState = ToggleButtonState.Inactive;
219  this.ScanWorker.DoWork -= this.ScanWorker_DoWork;
220  this.ScanWorker.ProgressChanged -= this.ScanWorker_ProgressChanged;
221  this.ScanWorker.RunWorkerCompleted -= this.ScanWorker_RunWorkerCompleted;
222  this.Arduino.ActivateLaser(false);
223  }
void ScanWorker_DoWork(object sender, DoWorkEventArgs e)
Handles the DoWork event of the scanWorker control.
Definition: ScanControl.cs:171
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:202
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:214
void Simple3DScan.UI.ScanControl.Start ( )
package

Starts this instance.

Definition at line 599 of file ScanControl.cs.

600  {
602  }
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 587 of file ScanControl.cs.

588  {
590  if (this.ScanWorker.IsBusy)
591  this.ScanWorker.CancelAsync();
592  }
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 235 of file ScanControl.cs.

236  {
237  this.RadialGaugeProgress.Value = 0;
238 
239  if (this.ScanWorker.IsBusy != true)
240  {
241  this.ScanWorker.DoWork += this.ScanWorker_DoWork;
242  this.ScanWorker.ProgressChanged += this.ScanWorker_ProgressChanged;
243  this.ScanWorker.RunWorkerCompleted += this.ScanWorker_RunWorkerCompleted;
244  this.ScanWorker.WorkerReportsProgress = true;
245  this.ScanWorker.WorkerSupportsCancellation = true;
246  this.ScanWorker.RunWorkerAsync((Precision)this.RadialSliderPrecision.Value);
247  }
248  else
249  this.ScanWorker.CancelAsync();
250  }
Syncfusion.Windows.Forms.Gauge.RadialGauge RadialGaugeProgress
void ScanWorker_DoWork(object sender, DoWorkEventArgs e)
Handles the DoWork event of the scanWorker control.
Definition: ScanControl.cs:171
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:202
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:214

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: