Beispiel #1
0
 private void Get_Area_Param()//从数据库中加载 测温目标的位置信息
 {
     try
     {
         list_All_Spot     = new List <DMSDK.temperSpot>();
         list_All_Area     = new List <DMSDK.temperArea>();
         list_All_Line     = new List <DMSDK.temperLine>();
         list_All_Spot     = sqlCreate.Select_All_Spot(StaticClass.Temper_CameraId, "S", StaticClass.DataBaseName);
         list_All_Area     = sqlCreate.Select_All_Area(StaticClass.Temper_CameraId, "A", StaticClass.DataBaseName);
         list_All_Line     = sqlCreate.Select_All_Line(StaticClass.Temper_CameraId, "L", StaticClass.DataBaseName);
         Struct_temperSpot = new DMSDK.temperSpot();
         Struct_temperArea = new DMSDK.temperArea();
         Struct_temperLine = new DMSDK.temperLine();
         if (list_All_Spot.Count > 0 && list_All_Area.Count > 0 && list_All_Line.Count > 0)
         {
             for (int i = 0; i < list_All_Spot.Count; i++)
             {
                 Struct_temperSpot = (DMSDK.temperSpot)list_All_Spot[i];
                 ((TextBox)(tabSpot.Controls.Find("tbxSpot_" + (i + 1) + "_X", false)[0])).Text     = Struct_temperSpot.X1.ToString();
                 ((TextBox)(tabSpot.Controls.Find("tbxSpot_" + (i + 1) + "_Y", false)[0])).Text     = Struct_temperSpot.Y1.ToString();
                 ((TextBox)(tabSpot.Controls.Find("tbxSpot_" + (i + 1) + "_Emiss", false)[0])).Text = Struct_temperSpot.Emiss.ToString();
             }
             for (int i = 0; i < list_All_Area.Count; i++)
             {
                 Struct_temperArea = (DMSDK.temperArea)list_All_Area[i];
                 ((TextBox)(tabAreas.Controls.Find("tbxArea_" + (i + 1) + "_X1", false)[0])).Text               = Struct_temperArea.X1.ToString();
                 ((TextBox)(tabAreas.Controls.Find("tbxArea_" + (i + 1) + "_Y1", false)[0])).Text               = Struct_temperArea.Y1.ToString();
                 ((TextBox)(tabAreas.Controls.Find("tbxArea_" + (i + 1) + "_X2", false)[0])).Text               = Struct_temperArea.X2.ToString();
                 ((TextBox)(tabAreas.Controls.Find("tbxArea_" + (i + 1) + "_Y2", false)[0])).Text               = Struct_temperArea.Y2.ToString();
                 ((TextBox)(tabAreas.Controls.Find("tbxArea_" + (i + 1) + "_Emiss", false)[0])).Text            = Struct_temperArea.Emiss.ToString();
                 ((ComboBox)(tabAreas.Controls.Find("cbxMeasureType_" + (i + 1) + "", false)[0])).SelectedIndex = Struct_temperArea.MeasureType;//cbxMeasureType_1
             }
             for (int i = 0; i < list_All_Line.Count; i++)
             {
                 Struct_temperLine = (DMSDK.temperLine)list_All_Line[i];
                 ((TextBox)(tabLine.Controls.Find("tbxLine_" + (i + 1) + "_X1", false)[0])).Text    = Struct_temperLine.X1.ToString();    //
                 ((TextBox)(tabLine.Controls.Find("tbxLine_" + (i + 1) + "_Y1", false)[0])).Text    = Struct_temperLine.Y1.ToString();    //
                 ((TextBox)(tabLine.Controls.Find("tbxLine_" + (i + 1) + "_X2", false)[0])).Text    = Struct_temperLine.X2.ToString();    //
                 ((TextBox)(tabLine.Controls.Find("tbxLine_" + (i + 1) + "_Y2", false)[0])).Text    = Struct_temperLine.Y2.ToString();    //
                 ((TextBox)(tabLine.Controls.Find("tbxLine_" + (i + 1) + "_X3", false)[0])).Text    = Struct_temperLine.X3.ToString();    //
                 ((TextBox)(tabLine.Controls.Find("tbxLine_" + (i + 1) + "_Y3", false)[0])).Text    = Struct_temperLine.Y3.ToString();    //
                 ((TextBox)(tabLine.Controls.Find("tbxLine_" + (i + 1) + "_Emiss", false)[0])).Text = Struct_temperLine.Emiss.ToString(); //
             }
         }
         else
         {
             MessageBox.Show("测温参数-数据库异常!请检查数据库!");
         }
     }catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }