Пример #1
0
 public override bool Initialize()
 {
     var initForm = new InitializeForm();
     initForm.ShowDialog();
     try
     {
         elManager = new ElectricityManager(initForm.selectedCOM, true);
     }
     catch (Exception ex)
     {
         elManager.CloseThePort();
         return false;
     }
     return true;
 }
Пример #2
0
        public override bool Initialize()
        {
            var initForm = new InitializeForm();

            initForm.ShowDialog();
            try
            {
                elManager = new ElectricityManager(initForm.selectedCOM, true);
            }
            catch (Exception ex)
            {
                elManager.CloseThePort();
                return(false);
            }
            return(true);
        }
Пример #3
0
        public override bool Initialize()
        {
            InitializeForm init = new InitializeForm(this);
            init.ShowDialog();
            RFIDCards = init.RFIDCards;

            arduino = new SerialPort(init.COMPort, 9600);

            if (!arduino.IsOpen)
            {
                try
                {
                    arduino.Open();
                    arduino.DataReceived += new SerialDataReceivedEventHandler(arduino_DataReceived);
                }
                catch { }
            }

            return true;
        }
Пример #4
0
        public override bool Initialize()
        {
            InitializeForm init = new InitializeForm(this);

            init.ShowDialog();
            RFIDCards = init.RFIDCards;

            arduino = new SerialPort(init.COMPort, 9600);

            if (!arduino.IsOpen)
            {
                try
                {
                    arduino.Open();
                    arduino.DataReceived += new SerialDataReceivedEventHandler(arduino_DataReceived);
                }
                catch { }
            }

            return(true);
        }