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 AddHistoricalDGV() { thread = new Thread(showDialog); thread.Start(); list = new List <StructClass.StructTemperData>(); list = sqlCreate.Select_TemperData(cameraID, dtpStart.Value, dtpEnd.Value, StaticClass.DataBaseName); dgvHisData.Rows.Clear(); foreach (StructClass.StructTemperData structTemperData in list) { dgvHisData.Rows.Add(structTemperData.CameraID, structTemperData.IPAddress, structTemperData.dateTime, structTemperData.Type, structTemperData.Temper / 100, structTemperData.Status); } thread.Abort(); }