public SerialPortModel(LaserSettings settings) { if (string.IsNullOrEmpty(settings.ComPort)) { settings.ComPort = "COM4"; } _serialPort = new SerialPort(settings.ComPort, 128000); _serialPort.Open(); SetTimer(); _stopwatch.Start(); }
public string SaveSettings(LaserSettings settings) { return($"(set-settings,{Newtonsoft.Json.JsonConvert.SerializeObject(settings)})"); }