Пример #1
0
        private void FrmHistoricalTemperData_Load(object sender, EventArgs e)
        {
            //cameraID = 1;
            //tabHistroicalData.Region = new Region(new RectangleF(tabPage1.Left, tabPage1.Top, tabPage1.Width, tabPage1.Height));//把上面隐藏
            cbxType.SelectedIndex = 0;
            chartHisrotricalData.Series.Clear();//清除默认的series
            ChartType();
            tbxCameraID.Text = cameraID.ToString();

            List <StructClass.StructTemperData> list = new List <StructClass.StructTemperData>();

            list = sqlCreate.Select_TemperData(cameraID, dtpStart.Value, dtpEnd.Value, StaticClass.DataBaseName);
            dgvHisData.Rows.Clear();
            foreach (StructClass.StructTemperData structTemper in list)
            {
                dgvHisData.Rows.Add(structTemper.CameraID, structTemper.IPAddress, structTemper.dateTime, structTemper.Type, Convert.ToDecimal(structTemper.Temper) / 100, structTemper.Status);
            }
            list = sqlCreate.Select_TemperData_ASC(cameraID, dtpStart.Value, dtpEnd.Value, StaticClass.DataBaseName);
            int i = 0;

            foreach (StructClass.StructTemperData structTemper in list)
            {
                i++;
                if (i % 5 == 0)
                {
                    ChartHisrotricalData(structTemper);
                }
            }
            ChartHis_AddSeries();
        }
 private void AddHistoricalLines()
 {
     list = sqlCreate.Select_TemperData_ASC(cameraID, dtpStart.Value, dtpEnd.Value, StaticClass.DataBaseName);
     foreach (StructClass.StructTemperData structTemper in list)
     {
         ChartHisrotricalData(structTemper);
     }
 }