Ejemplo n.º 1
0
        private string CreateSortTest()
        {
            string[] NeedSortBuffet = new string[res1.Count + cap1.Count + dci1.Count + Oltc1.Count];
            if (res1 != null)
            {
                for (int i = 0; i < res1.Count; i++)
                {
                    if (NumCorrection.GetNumForstring(res1[i]) >= 0)
                    {
                        string TaskKind    = "03";
                        string TaskNum     = NumCorrection.KeepNum(NumCorrection.Ten2Hex(i.ToString()), 2, HeadOrTail.Head);//resisitance 对应任务号
                        string DcresEnable = "01";
                        NeedSortBuffet[NumCorrection.GetNumForstring(res1[i])] = TaskKind + TaskNum + DcresEnable;
                    }
                }
            }
            if (cap1 != null)
            {
                for (int i = 0; i < cap1.Count; i++)
                {
                    if (NumCorrection.GetNumForstring(cap1[i]) >= 0)
                    {
                        string TaskKind    = "01";
                        string TaskNum     = NumCorrection.KeepNum(NumCorrection.Ten2Hex(i.ToString()), 2, HeadOrTail.Head);//resisitance 对应任务号
                        string DcresEnable = "01";
                        NeedSortBuffet[NumCorrection.GetNumForstring(cap1[i])] = TaskKind + TaskNum + DcresEnable;

                        // NeedSortBuffet[NumCorrection.GetNumForstring(cap1[i])] = cap[i];
                    }
                }
            }
            if (dci1 != null)
            {
                for (int i = 0; i < dci1.Count; i++)
                {
                    if (NumCorrection.GetNumForstring(dci1[i]) >= 0)
                    {
                        string TaskKind    = "02";
                        string TaskNum     = NumCorrection.KeepNum(NumCorrection.Ten2Hex(i.ToString()), 2, HeadOrTail.Head);//resisitance 对应任务号
                        string DcresEnable = "01";
                        NeedSortBuffet[NumCorrection.GetNumForstring(dci1[i])] = TaskKind + TaskNum + DcresEnable;
                        //  NeedSortBuffet[NumCorrection.GetNumForstring(dci1[i])] = dci[i];
                    }
                }
            }
            if (Oltc1 != null)
            {
                for (int i = 0; i < Oltc1.Count; i++)
                {
                    if (NumCorrection.GetNumForstring(Oltc1[i]) >= 0)
                    {
                        string TaskKind    = "04";
                        string TaskNum     = NumCorrection.KeepNum(NumCorrection.Ten2Hex(i.ToString()), 2, HeadOrTail.Head);//resisitance 对应任务号
                        string DcresEnable = "01";
                        NeedSortBuffet[NumCorrection.GetNumForstring(Oltc1[i])] = TaskKind + TaskNum + DcresEnable;
                        // NeedSortBuffet[NumCorrection.GetNumForstring(Oltc1[i])] = Oltc[i];
                    }
                }
            }
            for (int i = 0; i < NeedSortBuffet.Length; i++)
            {
                if (NeedSortBuffet[i] == null)
                {
                    NeedSortBuffet[i] = "00";
                }
            }
            return(string.Join("", NeedSortBuffet));
        }
Ejemplo n.º 2
0
        public string CreateTrans(JobList job)
        {
            TransformerWindingConfigStruct wt = job.Transformer.WindingConfig;
            int PhyNum = job.Transformer.PhaseNum;

            string TransName = NumCorrection.KeepNumSpace(job.Transformer.SerialNo, 64, HeadOrTail.Tail);
            string TransID   = NumCorrection.KeepNumSpace(job.Transformer.ID.ToString(), 10, HeadOrTail.Tail);
            string PhyNumStr = string.Empty;

            if (PhyNum == 2)
            {
                PhyNumStr = "01";
            }
            else
            {
                PhyNumStr = "00";
            }
            string WindConFig = ParsingWindConfig(job);//2/3
            string KindNum    = ParsingWingKing(job);
            string HTamMessage;

            if (job.Transformer.OLTC.WindingPosition == WindingType.HV)
            {
                HTamMessage = ParsingNum(job.Transformer.OLTC.TapNum) +
                              ParsingNum(job.Transformer.OLTC.TapMainNum) + "00" +
                              NumCorrection.DoubleToHexNum(job.Transformer.OLTC.Step);
            }
            else
            {
                HTamMessage = "0000000000";
            }
            string MTamMessage;

            if (job.Transformer.OLTC.WindingPosition == WindingType.MV)
            {
                MTamMessage = ParsingNum(job.Transformer.OLTC.TapNum) +
                              ParsingNum(job.Transformer.OLTC.TapMainNum) + "00" +
                              NumCorrection.DoubleToHexNum(job.Transformer.OLTC.Step);
            }
            else
            {
                MTamMessage = "0000000000";
            }
            //job.Transformer.OLTC.Step==0.0124;
            string p1            = NumCorrection.Ten2Hex(((job.Transformer.PowerRating.HV) * 1000).ToString());
            string p2            = NumCorrection.Ten2Hex(((job.Transformer.PowerRating.MV) * 1000).ToString());
            string p3            = NumCorrection.Ten2Hex(((job.Transformer.PowerRating.LV) * 1000).ToString());
            string PowerRating   = NumCorrection.KeepNum(p1, 8, HeadOrTail.Head) + NumCorrection.KeepNum(p2, 8, HeadOrTail.Head) + NumCorrection.KeepNum(p3, 8, HeadOrTail.Head);
            string v1            = NumCorrection.Ten2Hex(((job.Transformer.VoltageRating.HV) * 1000).ToString());
            string v2            = NumCorrection.Ten2Hex(((job.Transformer.VoltageRating.MV) * 1000).ToString());
            string v3            = NumCorrection.Ten2Hex(((job.Transformer.VoltageRating.LV) * 1000).ToString());
            string VoltageRating = NumCorrection.KeepNum(v1, 8, HeadOrTail.Head) + NumCorrection.KeepNum(v2, 8, HeadOrTail.Head) + NumCorrection.KeepNum(v3, 8, HeadOrTail.Head);

            return(TransName + TransID + PhyNumStr
                   + WindConFig + KindNum + HTamMessage + MTamMessage + PowerRating + VoltageRating);
            //  string
        }
Ejemplo n.º 3
0
 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", "绕组类型", "");
                 if (myini.ReadString("result", "VA", "") != "NULL")
                 {
                     DcresData[i - 1].Av = myini.ReadString("result", "VA", "");
                 }
                 if (myini.ReadString("result", "IA", "") != "NULL")
                 {
                     DcresData[i - 1].Ai = myini.ReadString("result", "IA", "");
                 }
                 if (myini.ReadString("result", "RA", "") != "NULL")
                 {
                     DcresData[i - 1].Ar = myini.ReadString("result", "RA", "");
                 }
                 if (myini.ReadString("result", "VB", "") != "NULL")
                 {
                     DcresData[i - 1].Bv = myini.ReadString("result", "VB", "");
                 }
                 if (myini.ReadString("result", "IB", "") != "NULL")
                 {
                     DcresData[i - 1].Bi = myini.ReadString("result", "IB", "");
                 }
                 if (myini.ReadString("result", "RB", "") != "NULL")
                 {
                     DcresData[i - 1].Br = myini.ReadString("result", "RB", "");
                 }
                 if (myini.ReadString("result", "VC", "") != "NULL")
                 {
                     DcresData[i - 1].Cv = myini.ReadString("result", "VC", "");
                 }
                 if (myini.ReadString("result", "IC", "") != "NULL")
                 {
                     DcresData[i - 1].Ci = myini.ReadString("result", "IC", "");
                 }
                 if (myini.ReadString("result", "RC", "") != "NULL")
                 {
                     DcresData[i - 1].Cr = myini.ReadString("result", "RC", "");
                 }
                 DcresData[i - 1].Error = myini.ReadString("result", "Error", "");
             }
         }
         return(DcresData);
     }
     catch
     {
         throw new Exception("直流电阻地址不存在");
     }
 }
Ejemplo n.º 4
0
        //介损供体
        private string CreateCapacitancePra(MeasurementItemStruct mi, JobList job)
        {
            if (mi.Terimal == null)
            {
                string CapacitanceVoltage = "00";
                CapacitanceVoltage = GetParameter.GetPraCapacitanceVoltageNum(job);
                string Fre = "01";
                string Wt  = "01";
                rc.CaPaNum++;
                rc.CaPaNumEnable = true;
                return(CapacitanceVoltage + Fre + Wt + NumCorrection.KeepNum(((int)mi.Winding.ToJSstation()).ToString(), 2, HeadOrTail.Head));
            }
            else
            {
                Parameter.JSstation Jsposition;
                string Windingkind = null;

                if (mi.Winding == WindingType.HV)
                {
                    Jsposition = Parameter.JSstation.高压套管A + (((int)mi.Terimal[0] + 3) % 4);
                }
                else
                {
                    Jsposition = Parameter.JSstation.中压套管A + (((int)mi.Terimal[0] + 3) % 4);
                }
                switch (Jsposition)
                {
                case Parameter.JSstation.高压套管A:
                    Windingkind = "03";
                    break;

                case Parameter.JSstation.高压套管B:
                    Windingkind = "04";
                    break;

                case Parameter.JSstation.高压套管C:
                    Windingkind = "05";
                    break;

                case Parameter.JSstation.高压套管0:
                    Windingkind = "06";
                    break;

                case Parameter.JSstation.中压套管A:
                    Windingkind = "07";
                    break;

                case Parameter.JSstation.中压套管B:
                    Windingkind = "08";
                    break;

                case Parameter.JSstation.中压套管C:
                    Windingkind = "09";
                    break;

                case Parameter.JSstation.中压套管0:
                    Windingkind = "0A";
                    break;

                default:
                    Windingkind = "03";
                    break;
                }
                string CapacitanceVoltage = GetParameter.GetPraCapacitanceVoltageNum(job);
                string Fre = "01";
                string Wt  = "00";
                rc.CaPaNum++;
                rc.CaPaNumEnable = true;

                return(CapacitanceVoltage + Fre + Wt + Windingkind);
            }
        }
Ejemplo n.º 5
0
 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), "");
                     if (DciData[i - 1].Awaveform.Length > 8000)
                     {
                         break;
                     }
                 }
                 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), "");
                     if (DciData[i - 1].Bwaveform.Length > 8000)
                     {
                         break;
                     }
                 }
                 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), "");
                     if (DciData[i - 1].Cwaveform.Length > 8000)
                     {
                         break;
                     }
                 }
                 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), "");
                     if (DciData[i - 1].Dwaveform.Length > 8000)
                     {
                         break;
                     }
                 }
                 DciData[i - 1].Dwaveform += myini.ReadString("result", "DED", "");
                 DciData[i - 1].Error      = myini.ReadString("result", "Error", "");
             }
         }
         return(DciData);
     }
     catch (Exception ex)
     { throw ex; }
 }