Пример #1
0
        public void Update_Graph(TempList Data1, TempList Data2)
        {
            if (this.chart_temp.InvokeRequired)
            {
                chart_temp.Invoke((MethodInvoker) delegate() { Update_Graph(Data1, Data2); });
            }
            else
            {
                if (Data1.AmbientTemp < AxisY_MIN)
                {
                    AxisY_MIN = (UInt16)(Data1.AmbientTemp - 1);
                    chart_temp.ChartAreas[0].AxisY.Minimum = AxisY_MIN;
                }
                if (Data1.ObjectTemp > AxisY_MAX)
                {
                    AxisY_MAX = (UInt16)(Data1.ObjectTemp + 1);
                    chart_temp.ChartAreas[0].AxisY.Maximum = AxisY_MAX;
                }
                if (Data2.ObjectTemp > AxisY_MAX)
                {
                    AxisY_MAX = (UInt16)(Data2.ObjectTemp + 1);
                    chart_temp.ChartAreas[0].AxisY.Maximum = AxisY_MAX;
                }

                if (Data2.ObjectTemp < AxisY_MIN)
                {
                    AxisY_MIN = (UInt16)(Data2.ObjectTemp - 1);
                    chart_temp.ChartAreas[0].AxisY.Minimum = AxisY_MIN;
                }

                chart_temp.Series["Object Temp1"].Points.AddY(Data1.ObjectTemp);
                chart_temp.Series["Abient Temp"].Points.AddY(Data1.AmbientTemp);
                chart_temp.Series["Object Temp2"].Points.AddY(Data2.ObjectTemp);
            }
        }
Пример #2
0
 public void Update_Graph_add2(TempList Data2)
 {
     if (this.chart_temp.InvokeRequired)
     {
         chart_temp.Invoke((MethodInvoker) delegate() { Update_Graph_add2(Data2); });
     }
     else
     {
         chart_temp.Series["Object Temp2"].Points.AddY(Data2.ObjectTemp);
     }
 }
Пример #3
0
        private void temp()
        {
            string read;

            try
            {
                //settext("Reading");
                read = serialPort1.ReadLine();
                serialPort1.DiscardInBuffer();

                DateTime Time = DateTime.Now;

                /*TimeSpan diftime = (Time - LastTime);
                 * LastTime = DateTime.Now;
                 * settext(diftime.Seconds.ToString());
                 * settext(".");
                 * settext(diftime.Milliseconds.ToString());
                 * settext("\n");*/
                settext(read);
                //  Pos = 1;
                if (!heating || mea_heat)
                {
                    string[] sensorRead = read.Split(',');
                    setobjecttext(sensorRead[1]);
                    setambienttext(sensorRead[2]);
                    setpostext(sensorRead[3]);
                    IR       tIR = new IR((double.Parse(sensorRead[1])), (double.Parse(sensorRead[2])), (int.Parse(sensorRead[3])), Time);
                    TempList t   = new TempList((double.Parse(sensorRead[1])), (double.Parse(sensorRead[2])), Time);
                    Temp1.Add(t);
                    IR.Add(tIR);
                    if (Graph == true)
                    {
                        graph.Update_Graph_add1(t);
                    }
                }
            }
            catch (System.IndexOutOfRangeException)
            {
                settext("Serial Data Incorrect");
            }
            catch (System.IO.IOException)
            {
                settext("Serial Data Incorrect");
            }
        }