public MainWindow() { InitializeComponent(); rssController = new RSSController(); analisExcel = new AnalisExcel("total table.xlsx"); }
private Task <string> FindPortName() { Task <string> task = new Task <string>(() => { //return ""; return(RSSController.FindPortName()); }); task.Start(); return(task); }
/// <summary> /// Поиск COM-порта RSS-контроллера. /// </summary> /// <returns></returns> public static string FindPortName() { string[] portNames = SerialPort.GetPortNames(); foreach (string portName in portNames) { try { RSSController rssController = new RSSController(); rssController.PostContructor(portName); if (rssController.GetControlStatus(true)) { return(portName); } } catch { } } return(""); }
/// <summary> /// Пост-конструктор. /// </summary> /// <param name="controller"></param> public void PostConstructor(RSSController controller) { rssController = controller; }