Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            rssController = new RSSController();

            analisExcel = new AnalisExcel("total table.xlsx");
        }
Esempio n. 2
0
        private Task <string> FindPortName()
        {
            Task <string> task = new Task <string>(() =>
            {
                //return "";
                return(RSSController.FindPortName());
            });

            task.Start();
            return(task);
        }
Esempio n. 3
0
        /// <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("");
        }
Esempio n. 4
0
 /// <summary>
 /// Пост-конструктор.
 /// </summary>
 /// <param name="controller"></param>
 public void PostConstructor(RSSController controller)
 {
     rssController = controller;
 }