private static CaptanceUpandata[] ReadCaptance(string DciPath)
 {
     try
     {
         string[]           filenum = Directory.GetFiles(DciPath);
         CaptanceUpandata[] DciData = new CaptanceUpandata[filenum.Length];
         for (int i = 1; i <= filenum.Length; i++)
         {
             if (File.Exists(DciPath + "\\" + NumCorrection.KeepNum(i.ToString(), 2, HeadOrTail.Head) + ".ini"))
             {
                 INIFiLE myini = new INIFiLE(DciPath + "\\" + NumCorrection.KeepNum(i.ToString(), 2, HeadOrTail.Head) + ".ini");
                 DciData[i - 1].Data     = myini.ReadString("result", "Date", "");
                 DciData[i - 1].Time     = myini.ReadString("result", "Time", "");
                 DciData[i - 1].Position = myini.ReadString("result", "试验位置", "");
                 DciData[i - 1].TestKind = myini.ReadString("result", "试验模式", "");
                 DciData[i - 1].Volate   = myini.ReadString("result", "Vo", "");
                 DciData[i - 1].Fre      = myini.ReadString("result", "Fr", "");
                 DciData[i - 1].Cx       = myini.ReadString("result", "Cx", "");
                 DciData[i - 1].Tan      = myini.ReadString("result", "tan", "");
                 DciData[i - 1].Error    = myini.ReadString("result", "Error", "");
             }
         }
         return(DciData);
     }
     catch { throw new Exception("介质损耗地址错误"); }
 }
示例#2
0
 private DataRow UsbToRow(CaptanceUpandata cap)
 {
     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 { }
     //row["testname"] =
     try { row["function"] = GetIniFileData.GetCapNum(cap).Function; } catch { }
     try { row["windingtype"] = GetIniFileData.GetCapNum(cap).windingtype; } catch { }
     try { row["terimal"] = GetIniFileData.GetCapNum(cap).Termal; } catch { }
     try { row["windingconfig"] = GetIniFileData.GetCapNum(cap).windingconfig; } catch { }
     try { row["failed"] = 0; } catch { }
     try { row["completed"] = 1; } catch { }
     try { row["result_pv1"] = cap.Fre; } catch { }
     try { row["result_pv2"] = cap.Volate; } catch { }
     try { row["result_pv3"] = cap.Cx; } catch { }
     try { row["result_pv4"] = cap.Tan; } catch { }
     try { row["recordtime"] = cap.Time; } catch { }
     return(row);
 }
示例#3
0
        public static Capdiffer GetCapNum(CaptanceUpandata cap)
        {
            Capdiffer capdiffer = new Capdiffer();

            if (cap.Position == "高压绕组")
            {
                capdiffer.windingconfig = 0;
                capdiffer.Function      = 2;
                capdiffer.windingtype   = 0;
                capdiffer.Termal        = null;
                return(capdiffer);
            }
            if (cap.Position == "中压绕组")
            {
                capdiffer.windingconfig = 0;
                capdiffer.Function      = 2;
                capdiffer.windingtype   = 1;
                capdiffer.Termal        = null;
                return(capdiffer);
            }
            if (cap.Position == "低压绕组")
            {
                capdiffer.windingconfig = 0;
                capdiffer.Function      = 2;
                capdiffer.windingtype   = 2;
                capdiffer.Termal        = null;
                return(capdiffer);
            }
            if (cap.Position == "高压套管A")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 0;   //高中低
                capdiffer.Termal        = "1"; //OABC
                return(capdiffer);
            }
            if (cap.Position == "高压绕组B")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 0;   //高中低
                capdiffer.Termal        = "2"; //OABC
                return(capdiffer);
            }
            if (cap.Position == "高压绕组C")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 0;   //高中低
                capdiffer.Termal        = "3"; //OABC
                return(capdiffer);
            }
            if (cap.Position == "高压绕组0")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 0;   //高中低
                capdiffer.Termal        = "0"; //OABC
                return(capdiffer);
            }
            if (cap.Position == "中压套管A")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 1;   //高中低
                capdiffer.Termal        = "1"; //OABC
                return(capdiffer);
            }
            if (cap.Position == "中压绕组B")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 1;   //高中低
                capdiffer.Termal        = "2"; //OABC
                return(capdiffer);
            }
            if (cap.Position == "中压绕组C")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 1;   //高中低
                capdiffer.Termal        = "3"; //OABC
                return(capdiffer);
            }
            if (cap.Position == "中压绕组0")
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 5;   //函数
                capdiffer.windingtype   = 1;   //高中低
                capdiffer.Termal        = "0"; //OABC
                return(capdiffer);
            }
            else
            {
                capdiffer.windingconfig = 0;   //Yn
                capdiffer.Function      = 2;   //函数
                capdiffer.windingtype   = 1;   //高中低
                capdiffer.Termal        = "0"; //OABC
                return(capdiffer);
            }//默认
        }