Example #1
0
 private void GraphicDr_chBox_CheckedChanged(object sender, EventArgs e)
 {
     if (GraphicDr_chBox.Checked) //Create first dot and  allow you start to drawing
     {
         IsClicked = true;
         // Add items to list box
         Bot_Draw.DrawStart(DrawPoint_lb);
         Bot_Draw2.DrawStart(OtherPoint_lb);
     }
     else
     {
         IsClicked = false;
     }
 }
Example #2
0
        private void DoUpdate(object s, EventArgs e)
        {
            char[] rMess;
            rMess = serialPort1.ReadLine().ToCharArray();
            int    Time    = 0;
            string s_rMess = new string(rMess);

            //Message type:
            //head pr  temp  ti:me crc Start with 0- sec, 1- min, 2 - hour
            // 01   0  000   00 00 0
            if (rMess.Length == 12 && rMess[0] == '0')
            {
                //In [10] position: 0 - sec, 1-min 2-hour    07:25 = (0*10 + 7)*60 + (2*10 + 5)
                if (rMess[10] == '1')
                {
                    Time = (((rMess[6] - 48) * 10 + (rMess[7] - 48)) * 60 + ((rMess[8] - 48) * 10 + (rMess[9] - 48)));
                }
                // X - Time, Y - Temp
                Bot_Draw2.AddToDotList(new Point(Time, (rMess[3] - 48) * 100 + (rMess[4] - 48) * 10 + (rMess[5] - 48)), OtherPoint_lb);
                Array.Clear(rMess, 0, rMess.Length);
            }
        }