コード例 #1
0
        private void sampleListCharge()
        {
            MyBL BLaux = new MyBL();

            SampleList            = BLaux.getsignals_persons(_item.Id);
            dg_samples.DataSource = SampleList;
        }
コード例 #2
0
        private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
        {
            CheckForIllegalCrossThreadCalls = false;

            int dataLength = serialPort1.BytesToRead;

            byte[] data        = new byte[dataLength];
            int    nbrDataRead = serialPort1.Read(data, 0, dataLength);

            if (nbrDataRead == 0)
            {
                return;
            }
            // add to buffer ...
            for (int i = 0; i < data.Length; i++)
            {
                Buffer.Add(data[i]);
            }

            // parse the buffer ...
            ParseBuffer();

            //if(!serialPort1.IsOpen)
            if (termina)
            {
                MessageBox.Show("Inicio del registro en db de los datos");
                BL.saveSampleData(signal_type, _item.Id, SampleDataList);
                MessageBox.Show("Registro guardado correctamente");
                SampleList = BL.getsignals_persons(_item.Id);
                grafico v = new grafico(BL.getDatasamplesLast(), BL.getsignal_typeString(signal_type));
                termina = false;
                v.ShowDialog();
            }
        }