Exemple #1
0
        /// <summary>
        /// Rozpoczęcie sczytywania stanów zbiorników przez COM
        /// </summary>
        public void Init()
        {
            _measurementBL = new MeasurementBL();
            _measurementBL.Init();

            _containerBL = new ContainerBL();
            _containerBL.Init();

            SystemConfigBL configBL = new SystemConfigBL();
            configBL.Init();
            configBL.FillRecord();

            _rs232 = new RS232();
            _rs232.ReadTimeOut = 1000;
            _rs232.DataReceivedEvent += new RS232.DataReceived(_rs232_DataReceivedEvent);
            _rs232.CanReadExisting = true;
            _rs232.Open(configBL.MainRow.ComName, 1200);
        }
Exemple #2
0
        public ConfigurationForm()
        {
            InitializeComponent();

            // dodawanie dostępnych portow do comboboxa
            String[] arrPorts = System.IO.Ports.SerialPort.GetPortNames();
            List<string> s = new List<string>();
            foreach (string portName in arrPorts)
                s.Add(portName);

            s.Sort();
            foreach (string port in s)
                cbComNbr.Items.Add(port);

            _configBL = new SystemConfigBL();
            _configBL.Init();
            _configBL.FillRecord();

            // wczytywanie aktualnie ustawionego (jako widoczny)
            cbComNbr.Text = _configBL.MainRow.ComName;
        }