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("直流电阻地址不存在");
     }
 }
 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("介质损耗地址错误"); }
 }
 private static DcInlutionUpandata[] ReadDcinlution(string DciPath)
 {
     try
     {
         string[]             filenum = Directory.GetFiles(DciPath);
         DcInlutionUpandata[] DciData = new DcInlutionUpandata[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].PreResistance = myini.ReadString("result", "保护阻值", "");
                 DciData[i - 1].JyxxM         = myini.ReadString("result", "绝缘下限", "");
                 DciData[i - 1].AbsM          = myini.ReadString("result", "吸收比下限", "");
                 DciData[i - 1].Volate        = myini.ReadString("result", "Vo", "");
                 DciData[i - 1].Resistance    = myini.ReadString("result", "R", "");
                 DciData[i - 1]._0_15         = myini.ReadString("result", "0:15", "");
                 DciData[i - 1]._1_00         = myini.ReadString("result", "1:00", "");
                 DciData[i - 1].Abs           = myini.ReadString("result", "吸收比", "");
                 DciData[i - 1].Jhzs          = myini.ReadString("result", "极化指数", "");
                 DciData[i - 1].Error         = myini.ReadString("result", "Error", "");
             }
         }
         return(DciData);
     }
     catch { throw new Exception("绝缘电阻地址错误"); }
 }
        private static OltcUpandata[] ReadOltc(string DciPath)
        {
            try
            {
                string[]       filenum = Directory.GetFiles(DciPath);
                OltcUpandata[] DciData = new OltcUpandata[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].Windkind          = myini.ReadString("result", "绕组类型", "");
                        DciData[i - 1].windposition      = myini.ReadString("result", "分接位置", "");
                        DciData[i - 1].Current           = myini.ReadString("result", "试验电流", "");
                        DciData[i - 1].Protectresistance = myini.ReadString("result", "触发电阻", "");
                        DciData[i - 1].Starttime         = myini.ReadString("result", "触发时间", "");

                        for (int j = 1; j < 25; j++)
                        {
                            DciData[i - 1].Awaveform += myini.ReadString("result", "A" +
                                                                         NumCorrection.KeepNum(j.ToString(), 2, HeadOrTail.Head), "");
                        }
                        DciData[i - 1].Awaveform += myini.ReadString("result", "AED", "");
                        for (int j = 1; j < 25; j++)
                        {
                            DciData[i - 1].Bwaveform += myini.ReadString("result", "B" +
                                                                         NumCorrection.KeepNum(j.ToString(), 2, HeadOrTail.Head), "");
                        }
                        DciData[i - 1].Bwaveform += myini.ReadString("result", "BED", "");
                        for (int j = 1; j < 25; j++)
                        {
                            DciData[i - 1].Cwaveform += myini.ReadString("result", "C" +
                                                                         NumCorrection.KeepNum(j.ToString(), 2, HeadOrTail.Head), "");
                        }
                        DciData[i - 1].Cwaveform += myini.ReadString("result", "CED", "");
                        for (int j = 1; j < 25; j++)
                        {
                            DciData[i - 1].Dwaveform += myini.ReadString("result", "D" +
                                                                         NumCorrection.KeepNum(j.ToString(), 2, HeadOrTail.Head), "");
                        }
                        DciData[i - 1].Dwaveform += myini.ReadString("result", "DED", "");
                        DciData[i - 1].Error      = myini.ReadString("result", "Error", "");
                    }
                }
                return(DciData);
            }
            catch { throw new Exception("有载分接地址错误"); }
        }
示例#5
0
 /// <summary>
 /// 创建测试信息
 /// </summary>
 /// <param name="BaseMessagepath">文件名,.ini文件</param>
 public static void CreateBaseMessageIni(string BaseMessagepath)
 {
     if (!File.Exists(BaseMessagepath))
     {
         INIFiLE myini = new INIFiLE(BaseMessagepath);
         myini.WriteString("information", "注意事项", "试验名称为必填项,删除”NULL“写入需要的信息");
         myini.WriteString("information", "测试时间", DateTime.Now.ToString("yyyy-MM-dd"));
         myini.WriteString("information", "试验名称", "NULL");
         myini.WriteString("information", "试验人员", "NULL");
         myini.WriteString("information", "试验单位", "NULL");
         myini.WriteString("information", "审核人", "NULL");
         myini.WriteString("information", "批准人", "NULL");
         myini.WriteString("information", "负责人", "NULL");
         myini.WriteString("information", "天气", "NULL");
         myini.WriteString("information", "温度", "NULL");
         myini.WriteString("information", "湿度", "NULL");
         myini.WriteInt("information", "变压器油温(整数)", 23);
     }
 }
示例#6
0
 /// <summary>
 /// 创建测试信息
 /// </summary>
 /// <param name="BaseMessagepath">文件名,.ini文件</param>
 public static void CreateBaseMessageIni(string BaseMessagepath, JobList job)
 {
     if (!File.Exists(BaseMessagepath))
     {
         INIFiLE myini = new INIFiLE(BaseMessagepath);
         myini.WriteString("information", "注意事项", "试验名称为必填项,删除”NULL“写入需要的信息");
         myini.WriteString("information", "测试时间", DateTime.Now.ToString("yyyy-MM-dd"));
         myini.WriteString("information", "试验名称", job.Information.testingName);
         myini.WriteString("information", "试验人员", job.Information.tester);
         myini.WriteString("information", "试验单位", job.Information.testingAgency);
         myini.WriteString("information", "审核人", job.Information.auditor);
         myini.WriteString("information", "批准人", job.Information.approver);
         myini.WriteString("information", "负责人", job.Information.principal);
         myini.WriteString("information", "天气", job.Information.weather);
         myini.WriteString("information", "温度", job.Information.temperature);
         myini.WriteString("information", "湿度", job.Information.humidity);
         myini.WriteInt("information", "变压器油温(整数)", (int)job.Information.oilTemperature);
     }
 }
        /// <summary>
        /// 更新jobinf单
        /// </summary>
        /// <param name="taskinformationpath"></param>
        /// <returns></returns>
        public JobList UpdataJob(string taskinformationpath)
        {
            INIFiLE iNI = new INIFiLE(taskinformationpath);

            if (!DateTime.TryParse(iNI.ReadString("information", "测试时间", ""), out jobInfo.Information.testingTime))
            {
                jobInfo.Information.testingTime = DateTime.Now;
            }
            jobInfo.Information.testingName    = iNI.ReadString("information", "试验名称", "");
            jobInfo.Information.tester         = iNI.ReadString("information", "试验人员", "");
            jobInfo.Information.testingAgency  = iNI.ReadString("information", "试验单位", "");
            jobInfo.Information.auditor        = iNI.ReadString("information", "审核人", "");
            jobInfo.Information.approver       = iNI.ReadString("information", "批准人", "");
            jobInfo.Information.principal      = iNI.ReadString("information", "负责人", "");
            jobInfo.Information.weather        = iNI.ReadString("information", "天气", "");
            jobInfo.Information.temperature    = iNI.ReadString("information", "温度", "");
            jobInfo.Information.humidity       = iNI.ReadString("information", "湿度", "");
            jobInfo.Information.oilTemperature = iNI.ReadInt("information", "变压器油温(整数)", 23);
            return(jobInfo);
        }