private static DcresistaceUpandata[] ReadDcresisitance(string DcPath)
 {
     try
     {
         string[] filenum = Directory.GetFiles(DcPath);
         DcresistaceUpandata[] DcresData = new DcresistaceUpandata[filenum.Length];
         for (int i = 1; i <= filenum.Length; i++)
         {
             if (File.Exists(DcPath + "\\" + NumCorrection.KeepNum(i.ToString(), 2, HeadOrTail.Head) + ".ini"))
             {
                 INIFiLE myini = new INIFiLE(DcPath + "\\" + NumCorrection.KeepNum(i.ToString(), 2, HeadOrTail.Head) + ".ini");
                 DcresData[i - 1].Data           = myini.ReadString("result", "Date", "");
                 DcresData[i - 1].Time           = myini.ReadString("result", "Time", "");
                 DcresData[i - 1].Position       = myini.ReadString("result", "试验位置", "");
                 DcresData[i - 1].Windingconfige = myini.ReadString("result", "绕组类型", "");
                 DcresData[i - 1].Av             = myini.ReadString("result", "VA", "");
                 DcresData[i - 1].Ai             = myini.ReadString("result", "IA", "");
                 DcresData[i - 1].Ar             = myini.ReadString("result", "RA", "");
                 DcresData[i - 1].Bv             = myini.ReadString("result", "VB", "");
                 DcresData[i - 1].Bi             = myini.ReadString("result", "IB", "");
                 DcresData[i - 1].Br             = myini.ReadString("result", "RB", "");
                 DcresData[i - 1].Cv             = myini.ReadString("result", "VC", "");
                 DcresData[i - 1].Ci             = myini.ReadString("result", "IC", "");
                 DcresData[i - 1].Cr             = myini.ReadString("result", "RC", "");
                 DcresData[i - 1].Error          = myini.ReadString("result", "Error", "");
             }
         }
         return(DcresData);
     }
     catch
     {
         throw new Exception("直流电阻地址不存在");
     }
 }
Exemplo n.º 2
0
 public static int GetResWindkind(DcresistaceUpandata res)
 {
     if (res.Windingconfige == "Yn型")
     {
         return(0);
     }
     if (res.Windingconfige == "Y型")
     {
         return(1);
     }
     if (res.Windingconfige == "D型")
     {
         return(2);
     }
     if (res.Windingconfige == "Zn型")
     {
         return(3);
     }
     return(-1);
 }
 private DataRow UsbToRow(DcresistaceUpandata res)
 {
     System.Data.DataRow row = WorkingSets.local.TestResults.NewRow();
     try { row["testname"] = jobInfo.Information.testingName; } catch { }
     try { row["testid"] = jobInfo.Information.GetHashCode(); } catch { }
     try { row["transformerid"] = jobInfo.Transformer.ID; } catch { }
     try { row["mj_id"] = jobInfo.id; } catch { }
     try { row["mj_id"] = 1; } catch { }
     //row["testname"] =
     try { row["function"] = 3; } catch { }
     try { row["windingtype"] = GetIniFileData.GetResPositionTerimal(res).windingtype; } catch { }
     if (GetIniFileData.GetResPositionTerimal(res).Termal != null)
     {
         try { row["terimal"] = GetIniFileData.GetResPositionTerimal(res).Termal; } catch { }
     }
     try { row["windingconfig"] = GetIniFileData.GetResPositionTerimal(res).windingconfig; } catch { }
     //if (TapLabel != null)
     //{
     //    if (TapLabel.Length == 2)
     //        try { row["taplabel"] = TapLabel[0] + ";" + TapLabel[1]; } catch { }
     //    else if (Terimal.Length == 1)
     //        try { row["taplabel"] = TapLabel[0]; } catch { }
     //    else
     //        try { row["taplabel"] = string.Empty; } catch { }
     //}
     try { row["failed"] = 0; } catch { }
     try { row["completed"] = 1; } catch { }
     try { row["result_pv1"] = res.Av; } catch { }
     try { row["result_pv2"] = res.Ai; } catch { }
     try { row["result_pv3"] = res.Ar; } catch { }
     try { row["result_pv4"] = res.Bv; } catch { }
     try { row["result_pv5"] = res.Bi; } catch { }
     try { row["result_pv6"] = res.Br; } catch { }
     try { row["result_pv7"] = res.Cv; } catch { }
     try { row["result_pv8"] = res.Ci; } catch { }
     try { row["result_pv9"] = res.Cr; } catch { }
     try { row["recordtime"] = res.Time; } catch { }
     return(row);
 }
Exemplo n.º 4
0
        public static WindingDiffer GetResPositionTerimal(DcresistaceUpandata res)
        {
            WindingDiffer wd = new WindingDiffer();

            wd.windingtype   = 0;
            wd.windingconfig = 0;
            wd.Termal        = null;
            if (res.Position == "高压全部")
            {
                wd.windingtype   = 0;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = null;
                return(wd);
            }
            if (res.Position == "高压AB_A")
            {
                wd.windingtype   = 0;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "1;2";
                return(wd);
            }
            if (res.Position == "高压BC_B")
            {
                wd.windingtype   = 0;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "2;3";
                return(wd);
            }
            if (res.Position == "高压CA_C")
            {
                wd.windingtype   = 0;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "3;1";
                return(wd);
            }
            if (res.Position == "中压全部")
            {
                wd.windingtype   = 1;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = null;
                return(wd);
            }
            if (res.Position == "中压AB_A")
            {
                wd.windingtype   = 1;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "1;2";
                return(wd);
            }
            if (res.Position == "中压BC_B")
            {
                wd.windingtype   = 1;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "2;3";
                return(wd);
            }
            if (res.Position == "中压CA_C")
            {
                wd.windingtype   = 1;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "3;1";
                return(wd);
            }
            if (res.Position == "低压全部")
            {
                wd.windingtype   = 2;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = null;
                return(wd);
            }
            if (res.Position == "低压AB_A")
            {
                wd.windingtype   = 2;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "1;2";
                return(wd);
            }
            if (res.Position == "低压BC_B")
            {
                wd.windingtype   = 2;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "2;3";
                return(wd);
            }
            if (res.Position == "低压CA_C")
            {
                wd.windingtype   = 2;
                wd.windingconfig = GetResWindkind(res);
                wd.Termal        = "3;1";
                return(wd);
            }

            return(wd);
        }