Exemplo n.º 1
0
 public void judge_out(DataDes t, string s)         //判断当前输出,设置到显示
 {
     if (t.val == t.str_tab[1])
     {
         result = true;                                  //若是成功
     }
     else
     {
         result = false;
     }
     bd.Background  = result ? Brushes.Green : Brushes.Red;
     bd.BorderBrush = result ? Brushes.LightGreen : Brushes.LightPink;
 }
Exemplo n.º 2
0
 public void ini_mc(Dictionary <string, object> v)        //初始化测控体系,并对参数的显示进行额外配置
 {
     //判断协议配置的方式
     if (v.ContainsKey("filename"))             //若是从文件加载的
     {
         try
         {
             string s = v["filename"] as string;
             s = Tool.relPath_2_abs(Config.configPath, s);        //都是以配置文件为基础的
             object t = Tool.load_json_from_file <Dictionary <string, object> >(s);
             Tool.dictinary_update(ref t, v);                     //用软件配置更新协议配置文件里加载的配置
             v = t as Dictionary <string, object>;
         }
         catch (Exception e)
         {
             //MessageBox.Show(e.ToString());
         }
     }
     mc_prot.formJson(v);                    //初始化测控体系
     foreach (var item in mc_prot.para_dict) //将参数列表复制到显示参数表
     {
         DataDes td = new DataDes(item.Value);
         td.name        = item.Key;
         dset[item.Key] = td;
     }
     if (v.ContainsKey("para_dict"))             //重新解析参数字典的配置,拿出显示的配置
     {
         ArrayList list = v["para_dict"] as ArrayList;
         foreach (var item in list)
         {
             var     tv = item as Dictionary <string, object>;
             string  s  = tv["name"] as string;
             DataDes td = dset[s];
             if (tv.ContainsKey("is_cv"))
             {
                 td.is_cv = ((int)tv["is_cv"]) != 0;
             }
             if (tv.ContainsKey("is_dis"))
             {
                 td.is_dis = ((int)tv["is_dis"]) != 0;
             }
         }
     }
 }
Exemplo n.º 3
0
 public void void_fun(DataDes dd)
 {
 }