예제 #1
0
 private void Cancel_SetLine(string type, Button btnAdd_Line, TextBox tbxLine_X1, TextBox tbxLine_Y1, TextBox tbxLine_X2, TextBox tbxLine_Y2, TextBox tbxLine_X3, TextBox tbxLine_Y3, TextBox tbxLine_Emiss, Button btnClear_Line)//取消设置线
 {
     list_All_Line      = new List <DMSDK.temperLine>();
     list_All_Line      = sqlCreate.Select_Line(StaticClass.Temper_CameraId, type, StaticClass.DataBaseName);
     Struct_temperLine  = (DMSDK.temperLine)list_All_Line[0];
     tbxLine_X1.Text    = Struct_temperLine.X1.ToString();
     tbxLine_Y1.Text    = Struct_temperLine.Y1.ToString();
     tbxLine_X2.Text    = Struct_temperLine.X2.ToString();
     tbxLine_Y2.Text    = Struct_temperLine.Y2.ToString();
     tbxLine_X3.Text    = Struct_temperLine.X3.ToString();
     tbxLine_Y3.Text    = Struct_temperLine.Y3.ToString();
     tbxLine_Emiss.Text = Struct_temperLine.Emiss.ToString();
     foreach (Control control in pnlBtnLine.Controls)
     {
         control.Enabled = true;
     }
     IsSet_Line            = false;
     btnAdd_Line.Text      = "编辑";
     btnClear_Line.Text    = "清除";
     tabSpot.Enabled       = true;
     tabAreas.Enabled      = true;
     tbxLine_X1.Enabled    = false;
     tbxLine_Y1.Enabled    = false;
     tbxLine_X2.Enabled    = false;
     tbxLine_Y2.Enabled    = false;
     tbxLine_X3.Enabled    = false;
     tbxLine_Y3.Enabled    = false;
     tbxLine_Emiss.Enabled = false;
     Dispose_Graph();
 }
예제 #2
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);
     }
 }