Ejemplo n.º 1
0
 public GraphForm()
 {
     if (!this.DesignMode)
     {
         InitializeComponent();
     }
     _Weather_Info = new Weather_Info();
 }
Ejemplo n.º 2
0
        public dataform()
        {
            if (!this.DesignMode)
            {
                InitializeComponent();
            }

            //call to class data
            _Weather_Info     = new Weather_Info();
            _DataControl_Info = new DataControl();
        }
Ejemplo n.º 3
0
        //timer to plotgraph
        private void Timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            timer1.Start();
            setTimesDisplay();

            this._Weather_Info = DataPoints._Weather_Info;

            if (!IsEnable)
            {
                PoltGraphWindDirection();
                PoltGraphWindSpeed();
                PoltGraphTemperature();
                PoltGraphHumidity();
            }

            if (this._Weather_Info != null)
            {
                stopwatch.Start();
                TimeSpan timeSpan = stopwatch.Elapsed;
                double   timess   = timeSpan.TotalSeconds;

                windDirRaw.AddPoint(timess, _Weather_Info.WindDirRaw);
                windDirKMF.AddPoint(timess, _Weather_Info.Wind_Dir);

                windSpRaw.AddPoint(timess, _Weather_Info.WindSpeedRaw);
                windSpKMF.AddPoint(timess, _Weather_Info.Wind_Speed);

                temp.AddPoint(timess, _Weather_Info.Temperature);

                humid.AddPoint(timess, _Weather_Info.Humidity);

                WindDir_Graph.GraphPane.XAxis.Scale.Max   = timess + 1;
                WindSpeed_Graph.GraphPane.XAxis.Scale.Max = timess + 1;
                Temper_Graph.GraphPane.XAxis.Scale.Max    = timess + 1;
                Humidity_Graph.GraphPane.XAxis.Scale.Max  = timess + 1;

                if (windDirRaw.Points.Count < 500 && windDirKMF.Points.Count < 500 &&
                    windSpRaw.Points.Count < 500 && windSpKMF.Points.Count < 500 &&
                    temp.Points.Count < 500 && humid.Points.Count < 500)
                {
                    WindDir_Graph.GraphPane.XAxis.Scale.Min   = 1;
                    WindSpeed_Graph.GraphPane.XAxis.Scale.Min = 1;
                    Temper_Graph.GraphPane.XAxis.Scale.Min    = 1;
                    Humidity_Graph.GraphPane.XAxis.Scale.Min  = 1;
                }
                else
                {
                    WindDir_Graph.GraphPane.XAxis.Scale.Min = windDirRaw.Points[0].X;
                    WindDir_Graph.GraphPane.XAxis.Scale.Min = windDirKMF.Points[0].X;

                    WindSpeed_Graph.GraphPane.XAxis.Scale.Min = windSpRaw.Points[0].X;
                    WindSpeed_Graph.GraphPane.XAxis.Scale.Min = windSpKMF.Points[0].X;

                    Temper_Graph.GraphPane.XAxis.Scale.Min = temp.Points[0].X;

                    Humidity_Graph.GraphPane.XAxis.Scale.Min = temp.Points[0].X;
                }

                WindDir_Graph.AxisChange();
                WindDir_Graph.Invalidate();

                WindSpeed_Graph.AxisChange();
                WindSpeed_Graph.Invalidate();

                Temper_Graph.AxisChange();
                Temper_Graph.Invalidate();

                Humidity_Graph.AxisChange();
                Humidity_Graph.Invalidate();
            }
        }