Example #1
0
        private void doEvents(string frame)
        {
            DataCoverter.RecieceFrame(frame);
            string mcuFrame = DataCoverter.GetDataToArduino();

            port.Write(mcuFrame);
            this.txtBoxSend.Text = mcuFrame;
            return;
        }
Example #2
0
        private void doEvents()
        {
            string mcuFrame = DataCoverter.GetDataToHMI(nowHMISend++);

            if (mcuFrame == string.Empty)
            {
                nowHMISend = 0;
            }
            else
            {
                port.Write(mcuFrame);
                this.txtBoxSend.Text = mcuFrame;
                port.Write(endSymmbol, 0, 3);
            }

            //update something everytime
            mcuFrame = DataCoverter.GetDataToHMI(0);             //speed
            port.Write(mcuFrame);
            //this.txtBoxSend.Text = mcuFrame;
            port.Write(endSymmbol, 0, 3);

            mcuFrame = DataCoverter.GetDataToHMI(2);             //distance to next station
            port.Write(mcuFrame);
            //this.txtBoxSend.Text = mcuFrame;
            port.Write(endSymmbol, 0, 3);

            mcuFrame = DataCoverter.GetDataToHMI(3);             //power level
            port.Write(mcuFrame);
            //this.txtBoxSend.Text = mcuFrame;
            port.Write(endSymmbol, 0, 3);

            mcuFrame = DataCoverter.GetDataToHMI(4);             //brake level
            port.Write(mcuFrame);
            //this.txtBoxSend.Text = mcuFrame;
            port.Write(endSymmbol, 0, 3);

            mcuFrame = DataCoverter.GetDataToHMI(24);            //cyliner pressure
            port.Write(mcuFrame);
            //this.txtBoxSend.Text = mcuFrame;
            port.Write(endSymmbol, 0, 3);

            mcuFrame = DataCoverter.GetDataToHMI(25);            //pipe pressure
            port.Write(mcuFrame);
            //this.txtBoxSend.Text = mcuFrame;
            port.Write(endSymmbol, 0, 3);

            //this.listBoxTsk.Items.Insert(0, DateTime.Now.ToString() + " >> Send: " + mcuFrame);
            //this.listBoxTsk.SelectedIndex = this.listBoxTsk.Items.Count - 1;
            //if (listBoxTsk.Items.Count > 18) listBoxTsk.Items.Clear();
            return;
        }
Example #3
0
        private void doEvents(string frame)
        {
            string mcuFrame = DataCoverter.GetDataToArduino();

            DataCoverter.RecieceFrame(frame);
            port.Write(mcuFrame);
            this.txtBoxSend.Text = mcuFrame;
            this.listBoxTsk.Items.Insert(0, DateTime.Now.ToString() + " >> Send: " + mcuFrame);
            this.listBoxTsk.SelectedIndex = this.listBoxTsk.Items.Count - 1;
            if (listBoxTsk.Items.Count > 15)
            {
                listBoxTsk.Items.Clear();
            }
            return;
        }