Simply3DScan
Program.cs
Go to the documentation of this file.
1 using System;
2 using System.IO;
3 using System.Windows.Forms;
5 using Configuration;
6 using Logging;
7 using SharedObjects;
8 using Simple3DScan.UI;
9 
10 namespace Simple3DScan
11 {
15  internal static class Program
16  {
20  public static readonly string Version = "0.1.9";
21 
25  [STAThread]
26  [LogException]
27  private static void Main()//string[] args)
28  {
29  Singleton<Config>.Instance.ReadConfiguration();
30 
31  string logFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
32  Singleton<Config>.Instance.Information.Places.LogSubPath);
33 
36  Singleton<Logger>.Instance.StartLogging(logFolder, "Simple3DScan");
37  Singleton<Logger>.Instance.LogInfo($"Program Version {Version}");
38  Application.EnableVisualStyles();
39  Application.SetCompatibleTextRenderingDefault(false);
40 
41  ArduinoCommands arduinoCommands;
42  if (!String.IsNullOrEmpty(Singleton<Config>.Instance.Information.Arduino.Port))
43  arduinoCommands = new ArduinoCommands(Singleton<Config>.Instance.Information.Arduino.BaudRate, Singleton<Config>.Instance.Information.Arduino.Port);
44  else
45  {
46  arduinoCommands = new ArduinoCommands(Singleton<Config>.Instance.Information.Arduino.BaudRate);
47  Singleton<Config>.Instance.Information.Arduino.Port = arduinoCommands.PortString;
48  }
49 
50  Application.Run(new SimpleScanMainForm(arduinoCommands));
51 
52  Singleton<Config>.Instance.WriteConfiguration();
53  Singleton<Logger>.Instance.Dispose();
54  Application.Exit();
55  }
56  }
57 }
static void CreatePathIfNotExisting(string folder)
Creates the path if not existing.
Definition: FileHelper.cs:14
Program for performing a 3D scan with FabScan
Definition: Program.cs:15
Class for detecting an arduino and sending commands to it
Class for creating a singleton for a generic class
Definition: Singleton.cs:9
static File Helpers
Definition: FileHelper.cs:8
Definition: Logger.cs:5
static readonly string Version
The version
Definition: Program.cs:20
string PortString
Gets the port string.
static T Instance
Gets the instance.
Definition: Singleton.cs:27
static void DeleteAllFilesInFolder(string imageFolder)
Deletes all files in folder.
Definition: FileHelper.cs:26