예제 #1
0
        public static MeasurementItemStruct CreateText(string Text)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.Description);

            mi.Text = Text;
            return(mi);
        }
예제 #2
0
        public static MeasurementItemStruct CreateDCResistanceMeasurementItem(WindingType winding)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.DCResistance);

            mi.Winding = winding;
            return(mi);
        }
예제 #3
0
        public static Parameter.YzfjCurrent GetPraDCResistanceCurrentUpanSpa(MeasurementItemStruct mi, JobList job)
        {
            int DCResistanceCurrent = job.Parameter.DCResistanceCurrent;

            if (mi.WindingConfig == TransformerWindingConfigName.Yn)
            {
                if (DCResistanceCurrent == 15)
                {
                    return(Parameter.YzfjCurrent._3_A);
                }
                else if (DCResistanceCurrent == 5)
                {
                    return(Parameter.YzfjCurrent._1_A);
                }
                else
                {
                    return(Parameter.YzfjCurrent._3_A);
                }
            }
            else
            {
                switch (DCResistanceCurrent)
                {
                case 5: return(Parameter.YzfjCurrent._1_A);

                case 10: return(Parameter.YzfjCurrent._3_A);

                case 15: return(Parameter.YzfjCurrent._10_A);

                default: return(Parameter.YzfjCurrent._1_A);
                }
            }
        }
 public static MeasurementResult NewInformation(MeasurementItemStruct testingItem, short[] MessageText, bool isOutputResult)
 {
     if ((testingItem == null) || (testingItem.Function != MeasurementFunction.Information))
     {
         throw new ArgumentException("测试结果与测试项目不符");
     }
     return(new MeasurementResult(MeasurementFunction.Information, MessageText, !isOutputResult));
 }
예제 #5
0
        public static MeasurementItemStruct CreateBushingCapacitanceMeasurementItem(WindingType winding, WindingTerimal terimal)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.BushingCapacitance);

            mi.Winding = winding;
            mi.Terimal = new WindingTerimal[] { terimal };
            return(mi);
        }
예제 #6
0
        public static MeasurementItemStruct CreateText(string Text, string NeedSwitckNum = "")
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.Description);

            mi.Text             = Text;
            mi.needSwitchTapNum = NeedSwitckNum;
            return(mi);
        }
예제 #7
0
        public static MeasurementItemStruct FromDataRow(System.Data.DataRow row)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct((MeasurementFunction)(int)row["function"]);

            if (mi.Winding != null)
            {
                mi.Winding = new WindingType((int)row["windingtype"]);
            }
            if ((row["terimal"]).ToString().Length > 0)
            {
                List <WindingTerimal> wts = new List <WindingTerimal>();
                foreach (var s in ((string)row["terimal"]).Split(';'))
                {
                    wts.Add(new WindingTerimal(int.Parse(s)));
                }
                mi.Terimal = wts.ToArray();
            }
            mi.WindingConfig = (TransformerWindingConfigName)(int)row["windingconfig"];
            if ((row["taplabel"]).ToString().Length > 0)
            {
                List <string> ss = new List <string>();
                foreach (var s in ((string)row["taplabel"]).Split(';'))
                {
                    //ss.Add(new WindingTerimal(int.Parse(s)));
                }
                mi.TapLabel = ((string)row["taplabel"]).Split(';');
            }
            mi.Text = row["text"].ToString();
            try { mi.failed = (bool)row["failed"]; } catch { }
            mi.completed = (bool)row["completed"];
            SCEEC.Numerics.PhysicalVariable[] pv = new Numerics.PhysicalVariable[9];
            for (int i = 0; i < 9; i++)
            {
                string pvs = row["result_pv" + (i + 1).ToString()].ToString();
                pv[i] = SCEEC.Numerics.NumericsConverter.Text2Value(pvs);
            }
            try
            {
                short[] waves = Bytes2Shorts(System.Convert.FromBase64String(Convert.ToString(row["waves"])));
                mi.result = new MeasurementResult(mi.Function, pv, waves, false, (DateTime)row["recordtime"]);
            }
            catch
            {
            }

            if (mi.Function == MeasurementFunction.Leakagecurrent)
            {
                var     data  = JsonConvert.DeserializeObject <TTM.LeakCurJson>(Convert.ToString(row["waves"]));
                short[] waves = new short[] { (short)data.H_L10kV, (short)data.L_H10kV, (short)data.HL10kV,
                                              (short)data.H_L20kV, (short)data.L_H20kV, (short)data.HL20kV,
                                              (short)data.H_L40kV, (short)data.L_H40kV, (short)data.HL40kV };
                mi.result = new MeasurementResult(mi.Function, pv, waves, false, (DateTime)row["recordtime"]);
            }

            return(mi);
        }
예제 #8
0
        public static MeasurementItemStruct CreateBushingDCInsulationMeasurementItem(WindingType winding, WindingTerimal terimal)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.BushingDCInsulation);

            mi.Winding = winding;
            mi.Terimal = new WindingTerimal[1] {
                terimal
            };
            return(mi);
        }
예제 #9
0
        public static MeasurementItemStruct CreateDCResistanceMeasurementItem(WindingType winding, string ChangerLabel)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.DCResistance);

            mi.Winding  = winding;
            mi.TapLabel = new string[1] {
                ChangerLabel
            };
            return(mi);
        }
예제 #10
0
        public static MeasurementItemStruct CreateDCResistanceMeasurementItem(WindingType winding, WindingTerimal terimal1, WindingTerimal terimal2)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.DCResistance);

            mi.Winding = winding;
            mi.Terimal = new WindingTerimal[2] {
                terimal1, terimal2
            };
            return(mi);
        }
예제 #11
0
        public static MeasurementItemStruct CreateOLTCSwitchingCharacterMeasurementItem(WindingType winding, string LastTapLabel, string NextTapLabel, TransformerWindingConfigName windingConfig)
        {
            MeasurementItemStruct mi = new MeasurementItemStruct(MeasurementFunction.OLTCSwitchingCharacter);

            mi.Winding       = winding;
            mi.WindingConfig = windingConfig;
            mi.TapLabel      = new string[2] {
                LastTapLabel, NextTapLabel
            };
            return(mi);
        }
 /// <summary>
 /// 创建测量结果(绕组有载分接项目)
 /// </summary>
 /// <param name="testingItem">测量项目</param>
 /// <param name="voltage">电压数组</param>
 /// <param name="current">电流数组</param>
 /// <param name="resistance">电阻数组</param>
 /// <param name="waves">波形数组</param>
 /// <param name="readyForTrigger">是否提示触发</param>
 /// <param name="isOutputResult">是否为最终输出结果</param>
 /// <returns></returns>
 public static MeasurementResult NewOLTCSwitchingCharacterResult(MeasurementItemStruct testingItem, PhysicalVariable[] voltage, PhysicalVariable[] current, PhysicalVariable[] resistance, short[] waves, bool readyForTrigger, bool isOutputResult)
 {
     if ((testingItem == null) || (testingItem.Function != MeasurementFunction.OLTCSwitchingCharacter))
     {
         throw new ArgumentException("测试结果与测试项目不符");
     }
     //if (waves.Length != 24008) throw new ArgumentException("波形组长度错误");
     return(new MeasurementResult(MeasurementFunction.OLTCSwitchingCharacter, new PhysicalVariable[9] {
         voltage[0], current[0], resistance[0], voltage[1], current[1], resistance[1], voltage[2], current[2], resistance[2]
     }, waves, readyForTrigger, !isOutputResult));
 }
예제 #13
0
        public static void BushingDCInsulation(ref MeasurementItemStruct mi, Transformer transformer, JobList Job)
        {
            Parameter.JYDZstation position;
            if (mi.Winding == WindingType.HV)
            {
                position = Parameter.JYDZstation.高压套管A + (((int)mi.Terimal[0] + 3) % 4);
            }
            else
            {
                position = Parameter.JYDZstation.中压套管A + (((int)mi.Terimal[0] + 3) % 4);
            }
            switch (mi.state)
            {
            case 0:
                byte[] TestKindData = TZ3310.SetPraJydz(position, GetParameter.GetPraBushingDCInsulationVoltage(Job), 50, GetParameter.GetPraDCInsulationResistance(Job), GetParameter.GetPraDCInsulationAbsorptionRatio(Job), 0);
                Thread.Sleep(100);
                TZ3310.StartTest(TestKindData);
                mi.stateText = "正在测试" + position.ToString() + "末屏中...";
                mi.state++;
                Thread.Sleep(4000);
                break;

            case 1:
                string[] Recbuffer = TZ3310.ReadTestData(Parameter.TestKind.绝缘电阻);
                Thread.Sleep(150);

                if (Recbuffer != null)
                {
                    PhysicalVariable[] Volate = new PhysicalVariable[1];

                    if (Recbuffer[Recbuffer.Length - 1] == "0")
                    {
                        mi.Result = MeasurementResult.NewBushingDCInsulationResult(mi, NumericsConverter.Text2Value(Recbuffer[0]), NumericsConverter.Text2Value(Recbuffer[1]),
                                                                                   NumericsConverter.Text2Value(Recbuffer[2]), null, false);
                    }
                    else if (Recbuffer[Recbuffer.Length - 1] == "1")
                    {
                        mi.Result = MeasurementResult.NewBushingDCInsulationResult(mi, Volate[0], NumericsConverter.Text2Value(Recbuffer[0]),
                                                                                   NumericsConverter.Text2Value(Recbuffer[1]), NumericsConverter.Text2Value(Recbuffer[2]), true);
                        mi.state++;
                        mi.completed = true;
                        mi.stateText = position.ToString() + "末屏测试完成";
                    }
                    else
                    {
                        mi.failed    = true;
                        mi.completed = true;
                        mi.stateText = mi.Winding + "错误类型:" + Recbuffer[0];
                    }
                }
                break;
            }
        }
 /// <summary>
 /// 创建测量结果(绕组绝缘电阻项目)
 /// </summary>
 /// <param name="testingItem">测量项目</param>
 /// <param name="voltage">电压</param>
 /// <param name="resistance">电阻</param>
 /// <param name="absorption">吸收比</param>
 /// <param name="polarization">极化指数</param>
 /// <param name="isOutputResult">是否为最终输出结果</param
 /// <returns>测量结果</returns>
 public static MeasurementResult NewDCInsulationResult(MeasurementItemStruct testingItem, PhysicalVariable voltage, PhysicalVariable resistance, PhysicalVariable absorption, PhysicalVariable polarization, bool isOutputResult)
 {
     if ((testingItem == null) || (testingItem.Function != MeasurementFunction.DCInsulation))
     {
         throw new ArgumentException("测试结果与测试项目不符");
     }
     //if ((voltage == null) || (voltage.PhysicalVariableType != Numerics.Quantities.QuantityName.Voltage)) throw new ArgumentException("电压参数错误");
     //if ((resistance == null) || (resistance.PhysicalVariableType != Numerics.Quantities.QuantityName.Resistance)) throw new ArgumentException("电阻参数错误");
     return(new MeasurementResult(MeasurementFunction.DCInsulation, new PhysicalVariable[4] {
         voltage, resistance, absorption, polarization
     }, !isOutputResult));
 }
예제 #15
0
        public static MeasurementResult DoMeasurement(ref MeasurementItemStruct mi, Transformer transformer, JobList Job, TestingWorkerSender sender)
        {
            switch (mi.Function)
            {
            case MeasurementFunction.DCInsulation:
                TestFunction.DoDCInsulation(ref mi, transformer, Job);
                break;

            case MeasurementFunction.Capacitance:
                TestFunction.Capacitance(ref mi, transformer, Job);
                break;

            case MeasurementFunction.DCResistance:    //直流电阻
                TestFunction.DCResistance(ref mi, transformer, Job, sender);
                break;

            case MeasurementFunction.BushingDCInsulation:
                TestFunction.BushingDCInsulation(ref mi, transformer, Job);
                break;

            case MeasurementFunction.BushingCapacitance:
                TestFunction.BushingCapacitance(ref mi, transformer, Job);
                break;

            case MeasurementFunction.OLTCSwitchingCharacter:
                TestFunction.OLTCSwitchingCharacter(ref mi, transformer, Job);
                break;

            case MeasurementFunction.Information:
                TestFunction.Information(ref mi, transformer, Job);
                break;

            case MeasurementFunction.DCCharge:    //充电
                break;

            case MeasurementFunction.Coreinsulation:    //充电
                TestFunction.Coredci(ref mi, transformer, Job);
                break;

            case MeasurementFunction.Leakagecurrent:    //充电
                TestFunction.Losscurrent(ref mi, transformer, Job);
                break;

            case MeasurementFunction.Shortcircuitimpedance:    //充电
                TestFunction.Shortvolate(ref mi, transformer, Job);
                break;

            case MeasurementFunction.Description:
                mi.completed = true;
                break;
            }
            return(null);
        }
예제 #16
0
        public static void Capacitance(ref MeasurementItemStruct mi, Transformer transformer, JobList Job)
        {
            switch (mi.state)
            {
            case 0:
                byte[] TestKindData;
                if (!transformer.Coupling || mi.Winding == WindingType.LV)
                {
                    TestKindData = TZ3310.SetPraJs(mi.Winding.ToJSstation(), Parameter.JSstyle.内接反接,
                                                   GetParameter.GetPraCapacitanceVoltage(Job), Parameter.JSFrequency._45To_55HZ, 0);
                }
                else
                {
                    TestKindData = TZ3310.SetPraJs(Parameter.JSstation.高中绕组, Parameter.JSstyle.内接反接,
                                                   GetParameter.GetPraCapacitanceVoltage(Job), Parameter.JSFrequency._45To_55HZ, 0);
                }
                Thread.Sleep(100);
                TZ3310.StartTest(TestKindData);
                mi.stateText = "正在测试" + mi.Winding + "介损绕组中...";
                mi.state++;
                Thread.Sleep(4000);
                break;

            case 1:
                string[] Recbuffer = TZ3310.ReadTestData(Parameter.TestKind.介质损耗);
                Thread.Sleep(150);
                if (Recbuffer != null)
                {
                    if (Recbuffer[Recbuffer.Length - 1] == "0")
                    {
                        mi.Result = MeasurementResult.NewCapacitanceResult(mi, NumericsConverter.Text2Value(Recbuffer[1]), null, null
                                                                           , NumericsConverter.Text2Value(Recbuffer[2]), NumericsConverter.Text2Value(Recbuffer[3]), false);
                    }
                    else if (Recbuffer[Recbuffer.Length - 1] == "1")
                    {
                        mi.Result = MeasurementResult.NewCapacitanceResult(mi, NumericsConverter.Text2Value(Recbuffer[0]),
                                                                           NumericsConverter.Text2Value(Recbuffer[1]), NumericsConverter.Text2Value(Recbuffer[2])
                                                                           , NumericsConverter.Text2Value(GetParameter.GetFreQuency(Parameter.JSFrequency._45To_55HZ)), NumericsConverter.Text2Value(Recbuffer[3]), true);
                        mi.completed = true;
                        mi.stateText = "读取" + mi.Winding + "绕组介损测试成功";
                    }
                    else
                    {
                        mi.failed    = true;
                        mi.completed = true;
                        mi.stateText = mi.Winding + "错误类型为:" + Recbuffer[0].ToString();
                    }
                }
                break;
            }
        }
예제 #17
0
        public static void DoDCInsulation(ref MeasurementItemStruct mi, Transformer transformer, JobList Job)
        {
            switch (mi.state)
            {
            case 0:
                byte[] TestKindData;
                if (!transformer.Coupling || mi.Winding == WindingType.LV)
                {
                    TestKindData = TZ3310.SetPraJydz(mi.Winding.ToJYDZstation(), GetParameter.GetPraDCInsulationVoltage(Job), 50, GetParameter.GetPraDCInsulationResistance(Job), GetParameter.GetPraDCInsulationAbsorptionRatio(Job), 0);
                }
                else
                {
                    TestKindData = TZ3310.SetPraJydz(Parameter.JYDZstation.高中绕组, GetParameter.GetPraDCInsulationVoltage(Job), 50, GetParameter.GetPraDCInsulationResistance(Job), GetParameter.GetPraDCInsulationAbsorptionRatio(Job), 0);
                }
                Thread.Sleep(100);
                TZ3310.StartTest(TestKindData);
                mi.stateText = "开始测量" + mi.Winding + "绝缘电阻中...";
                mi.state++;
                Thread.Sleep(4000);
                break;

            case 1:
                string[] Recbuffer = TZ3310.ReadTestData(Parameter.TestKind.绝缘电阻);
                if (Recbuffer != null)
                {
                    PhysicalVariable[] Volate = new PhysicalVariable[1];
                    if (Recbuffer[Recbuffer.Length - 1] == "0")
                    {
                        mi.Result = MeasurementResult.NewDCInsulationResult(mi, NumericsConverter.Text2Value(Recbuffer[0]), NumericsConverter.Text2Value(Recbuffer[1]),
                                                                            NumericsConverter.Text2Value(Recbuffer[2]), null, false);
                        Volate[0] = NumericsConverter.Text2Value(Recbuffer[0]);
                    }

                    else if (Recbuffer[Recbuffer.Length - 1] == "1")
                    {
                        mi.Result = MeasurementResult.NewDCInsulationResult(mi, Volate[0], NumericsConverter.Text2Value(Recbuffer[0]),
                                                                            NumericsConverter.Text2Value(Recbuffer[1]), NumericsConverter.Text2Value(Recbuffer[2]), true);
                        mi.completed = true;
                        mi.stateText = "读取" + mi.Winding + "绝缘电阻结果成功";
                    }
                    else
                    {
                        mi.failed    = true;
                        mi.completed = true;
                        mi.stateText = mi.Winding + "错误类型:" + Recbuffer[0];
                    }
                }
                break;
            }
        }
 /// <summary>
 /// 创建测量结果(套管电容量及介质损耗项目)
 /// </summary>
 /// <param name="testingItem">测量项目</param>
 /// <param name="voltage">电压</param>
 /// <param name="capacitance">电容量</param>
 /// <param name="tanDelta">介质损耗</param>
 /// <param name="frequency">频率</param>
 /// <param name="isOutputResult">是否为最终输出结果</param>
 /// <returns>测量结果</returns>
 public static MeasurementResult NewBushingCapacitanceResult(MeasurementItemStruct testingItem, PhysicalVariable voltage, PhysicalVariable capacitance, PhysicalVariable tanDelta, PhysicalVariable frequency, PhysicalVariable current, bool isOutputResult)
 {
     if ((testingItem == null) || (testingItem.Function != MeasurementFunction.BushingCapacitance))
     {
         throw new ArgumentException("测试结果与测试项目不符");
     }
     //if ((voltage == null) || (voltage.PhysicalVariableType != Numerics.Quantities.QuantityName.Voltage)) throw new ArgumentException("电压参数错误");
     //if ((capacitance == null) || (capacitance.PhysicalVariableType != Numerics.Quantities.QuantityName.Capacitance)) throw new ArgumentException("电容参数错误");
     //if (isOutputResult && ((tanDelta == null) || (tanDelta.PhysicalVariableType != Numerics.Quantities.QuantityName.None))) throw new ArgumentException("介损参数错误");
     //if (!isOutputResult && ((frequency == null) || (frequency.PhysicalVariableType != Numerics.Quantities.QuantityName.Frequency))) throw new ArgumentException("介损参数错误");
     return(new MeasurementResult(MeasurementFunction.BushingCapacitance, new PhysicalVariable[5] {
         frequency, voltage, capacitance, tanDelta, current
     }, !isOutputResult));
 }
예제 #19
0
        public static void BushingCapacitance(ref MeasurementItemStruct mi, Transformer transformer, JobList Job)
        {
            Parameter.JSstation Jsposition;
            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 (mi.state)
            {
            case 0:
                byte[] TestKindData = TZ3310.SetPraJs(Jsposition, Parameter.JSstyle.内接正接, GetParameter.GetPraCapacitanceVoltage(Job), Parameter.JSFrequency._45To_55HZ, 0);
                Thread.Sleep(100);
                TZ3310.StartTest(TestKindData);
                mi.stateText = "正在测试" + mi.Winding + "末屏中...";
                mi.state++;
                Thread.Sleep(4000);
                break;

            case 1:
                string[] Recbuffer = TZ3310.ReadTestData(Parameter.TestKind.介质损耗);
                if (Recbuffer != null)
                {
                    if (Recbuffer[Recbuffer.Length - 1] == "0")
                    {
                        mi.Result = MeasurementResult.NewBushingCapacitanceResult(mi, NumericsConverter.Text2Value(Recbuffer[1]), null, null
                                                                                  , NumericsConverter.Text2Value(Recbuffer[2]), NumericsConverter.Text2Value(Recbuffer[3]), false);
                    }
                    else if (Recbuffer[Recbuffer.Length - 1] == "1")
                    {
                        mi.Result = MeasurementResult.NewBushingCapacitanceResult(mi, NumericsConverter.Text2Value(Recbuffer[0]),
                                                                                  NumericsConverter.Text2Value(Recbuffer[1]), NumericsConverter.Text2Value(Recbuffer[2])
                                                                                  , NumericsConverter.Text2Value(GetParameter.GetFreQuency(Parameter.JSFrequency._45To_55HZ)), NumericsConverter.Text2Value(Recbuffer[3]), true);
                        mi.completed = true;
                        mi.stateText = "读取" + mi.Winding + "末屏测试完成";
                    }
                    else
                    {
                        // mi.failed = true;
                        mi.completed = true;
                        mi.stateText = mi.Winding + "错误类型:" + Recbuffer[0].ToString();
                    }
                }
                break;
            }
        }
예제 #20
0
        public static TestingWorkerSender FromDatabaseRows(int testID)
        {
            TestingWorkerSender sender = new TestingWorkerSender();
            var rows = WorkingSets.local.TestResults.Select("testid = '" + testID.ToString() + "'");

            if (rows.Length > 0)
            {
                sender.Transformer = WorkingSets.local.getTransformer((int)rows[0]["transformerid"]);
                sender.job         = WorkingSets.local.getJob((int)rows[0]["mj_id"]);
                List <MeasurementItemStruct> mlist = new List <MeasurementItemStruct>();
                MeasurementItemStruct        m;
                foreach (var row in rows)
                {
                    m = new MeasurementItemStruct((MeasurementFunction)((int)row["function"]))
                    {
                        Winding = new WindingType((int)row["windingtype"]),
                        Terimal = WindingTerimal.FromList((List <int>)
                                                              (new SCEEC.Converter.GenericListTypeConverter <int>().ConvertFrom((string)row["terimal"]))),
                        WindingConfig = (TransformerWindingConfigName)(int)row["windingconfig"],
                        TapLabel      = ((string)row["taplabel"]).Split(';'),
                        Text          = (string)row["text"],
                        failed        = (bool)row["failed"],
                        completed     = (bool)row["completed"]
                    };
                    List <SCEEC.Numerics.PhysicalVariable> pvList = new List <Numerics.PhysicalVariable>();
                    for (int i = 0; i < 9; i++)
                    {
                        string pvstr = (string)row["result_pv" + (i + 1).ToString()];
                        if (pvstr.Length > 0)
                        {
                            pvList.Add(SCEEC.Numerics.NumericsConverter.Text2Value(pvstr));
                        }
                        else
                        {
                            i = 9;
                        }
                    }
                    m.Result = new MeasurementResult(
                        m.Function,
                        pvList.ToArray(),
                        MeasurementItemStruct.Bytes2Shorts(Convert.FromBase64String((string)row["waves"])),
                        readyToTrigger: false, processing: false);
                    mlist.Add(m);
                }
                sender.MeasurementItems = mlist.ToArray();
            }
            return(sender);
        }
예제 #21
0
        private string CreateOLTcPra(MeasurementItemStruct mi, JobList job, int oltcnum)
        {
            string Position = "00";

            if (mi.Winding == WindingType.HV)
            {
                Position = "00";
            }
            else
            {
                Position = "01";
            }
            rc.OltcNum++;
            rc.OltcNumEnable = true;

            return("00" + Position + NumCorrection.KeepNum(oltcnum.ToString(), 2, HeadOrTail.Head) + "05" + "20");
        }
예제 #22
0
        public TestingWorkerSender getTestResults(string s)
        {
            var  rows   = TestResults.Select("function = " + ((int)MeasurementFunction.Information).ToString());
            int  testid = 0;
            bool valid  = false;

            foreach (var r in rows)
            {
                var ji = JobInformation.FromString((string)r["waves"]);
                if ((ji.testingName + "(" + ji.testingTime.ToString("yyyy-MM-dd") + ")") == s)
                {
                    testid = (int)r["testid"];
                    valid  = true;
                }
            }
            if (!valid)
            {
                throw new Exception("测试结果查找为空");
            }
            rows = TestResults.Select("testid = " + testid.ToString());
            if (rows.Length <= 0)
            {
                throw new Exception("测试结果导出出错");
            }
            var tws = new TestingWorkerSender();

            tws.job              = getJob((int)rows[0]["mj_id"]);
            tws.Transformer      = getTransformer((int)rows[0]["transformerid"]);
            tws.ProgressPercent  = 100;
            tws.CurrentItemIndex = 0;
            List <MeasurementItemStruct> mis = new List <MeasurementItemStruct>();

            foreach (var r in rows)
            {
                if ((int)r["function"] != (int)MeasurementFunction.Information)
                {
                    mis.Add(MeasurementItemStruct.FromDataRow(r));
                }
                else
                {
                    tws.job.Information = JobInformation.FromString((string)r["waves"]);
                }
            }
            tws.MeasurementItems = mis.ToArray();
            return(tws);
        }
예제 #23
0
        public static MeasurementItemStruct CreateOtherMeasurementItem(int kind)
        {
            MeasurementItemStruct mi;

            if (kind == 0)
            {
                mi = new MeasurementItemStruct(MeasurementFunction.Coreinsulation);
            }
            else if (kind == 1)
            {
                mi = new MeasurementItemStruct(MeasurementFunction.Leakagecurrent);
            }
            else
            {
                mi = new MeasurementItemStruct(MeasurementFunction.Shortcircuitimpedance);
            }
            return(mi);
        }
예제 #24
0
        private string CreateOLTcPra(MeasurementItemStruct mi, JobList job, int oltcnum)
        {
            string Position = GetTapLabel(mi).ToString("X2");

            if (mi.Winding == WindingType.HV)
            {
                Position = "00";
            }
            else
            {
                Position = "01";
            }
            rc.OltcNum++;
            rc.OltcNumEnable = true;

            return(GetCurrent(GetParameter.GetPraDCResistanceCurrentUpanSpa(mi, job)) +
                   Position + NumCorrection.KeepNum(oltcnum.ToString(), 2, HeadOrTail.Head) + "05" + "20");
        }
 /// <summary>
 /// 创建测量结果(绕组直流电阻项目)
 /// </summary>
 /// <param name="testingItem">测量项目</param>
 /// <param name="voltage">电压数组(A, B, C)</param>
 /// <param name="current">电流数组(A, B, C)</param>
 /// <param name="resistance">电阻数组(A, B, C)</param>
 /// <param name="isOutputResult">是否为最终输出结果</param>
 /// <returns>测量结果</returns>
 public static MeasurementResult NewDCResistanceResult(MeasurementItemStruct testingItem, PhysicalVariable[] voltage, PhysicalVariable[] current, PhysicalVariable[] resistance, bool isOutputResult)
 {
     if ((testingItem == null) || (testingItem.Function != MeasurementFunction.DCResistance))
     {
         throw new ArgumentException("测试结果与测试项目不符");
     }
     //if (voltage.Length != 3) throw new ArgumentException("电压参数错误");
     //if (current.Length != 3) throw new ArgumentException("电压参数错误");
     //if (resistance.Length != 3) throw new ArgumentException("电压参数错误");
     //for (int i = 0; i < 3; i++)
     //{
     //    if ((voltage[i] == null) || (voltage[i].PhysicalVariableType != Numerics.Quantities.QuantityName.Voltage)) throw new ArgumentException("电压参数错误");
     //    if ((current[i] == null) || (current[i].PhysicalVariableType != Numerics.Quantities.QuantityName.Current)) throw new ArgumentException("电流参数错误");
     //    if ((resistance[i] == null) || (resistance[i].PhysicalVariableType != Numerics.Quantities.QuantityName.Resistance)) throw new ArgumentException("电阻参数错误");
     //}
     return(new MeasurementResult(MeasurementFunction.DCResistance, new PhysicalVariable[9] {
         voltage[0], current[0], resistance[0], voltage[1], current[1], resistance[1], voltage[2], current[2], resistance[2]
     }, !isOutputResult));
 }
예제 #26
0
        //先创建测量数据再创建测量列表
        public void StartBuiltTestData(MeasurementItemStruct mi, JobList job)
        {
            switch (mi.Function)
            {
            case MeasurementFunction.DCInsulation:
                dci.Add(CreateDCInsulationPra(mi, job));
                dci1.Add(NumCorrection.KeepNum(NumKind.ToString(), 2, HeadOrTail.Head) + CreateDCInsulationPra(mi, job));
                NumKind++;
                break;

            case MeasurementFunction.BushingDCInsulation:
                dci.Add(CreateDCInsulationPra(mi, job));
                dci1.Add(NumCorrection.KeepNum(NumKind.ToString(), 2, HeadOrTail.Head) + CreateDCInsulationPra(mi, job));
                NumKind++;
                break;

            case MeasurementFunction.Capacitance:
                cap.Add(CreateCapacitancePra(mi, job));
                cap1.Add(NumCorrection.KeepNum(NumKind.ToString(), 2, HeadOrTail.Head) + CreateCapacitancePra(mi, job));
                NumKind++;
                break;

            case MeasurementFunction.BushingCapacitance:
                cap.Add(CreateCapacitancePra(mi, job));
                cap1.Add(NumCorrection.KeepNum(NumKind.ToString(), 2, HeadOrTail.Head) + CreateCapacitancePra(mi, job));
                NumKind++;
                break;

            case MeasurementFunction.DCResistance:    //直流电阻
                res.Add(CreateDcResistancePra(mi, job));
                res1.Add(NumCorrection.KeepNum(NumKind.ToString(), 2, HeadOrTail.Head) + CreateDcResistancePra(mi, job));
                NumKind++;
                break;

            case MeasurementFunction.OLTCSwitchingCharacter:
                Oltc.Add(CreateOLTcPra(mi, job, OltcNum));
                Oltc1.Add(NumCorrection.KeepNum(NumKind.ToString(), 2, HeadOrTail.Head) + CreateOLTcPra(mi, job, OltcNum));
                NumKind++;
                OltcNum++;
                break;
            }
        }
        public static MeasurementResult DoMeasurement(ref MeasurementItemStruct mi, Transformer transformer, JobList Job)
        {
            switch (mi.Function)
            {
            case MeasurementFunction.DCInsulation:
                TestFunction.DoDCInsulation(ref mi, transformer, Job);
                break;

            case MeasurementFunction.Capacitance:
                TestFunction.Capacitance(ref mi, transformer, Job);
                break;

            case MeasurementFunction.DCResistance:    //直流电阻
                TestFunction.DCResistance(ref mi, transformer, Job);
                break;

            case MeasurementFunction.BushingDCInsulation:
                TestFunction.BushingDCInsulation(ref mi, transformer, Job);
                break;

            case MeasurementFunction.BushingCapacitance:
                TestFunction.BushingCapacitance(ref mi, transformer, Job);
                break;

            case MeasurementFunction.OLTCSwitchingCharacter:
                TestFunction.OLTCSwitchingCharacter(ref mi, transformer, Job);
                break;

            case MeasurementFunction.Information:
                TestFunction.Information(ref mi, transformer, Job);
                break;

            case MeasurementFunction.DCCharge:    //充电
                break;

            case MeasurementFunction.Description:
                mi.completed = true;
                break;
            }
            return(null);
        }
예제 #28
0
 private static void getStartAndEndMessageReserver(int i, int TapLocation, int TapMainNum, JobList jobList, List <MeasurementItemStruct> miList)
 {
     if (i == TapLocation && TapMainNum > 1)
     {
         char tapMessage = (char)('A' + TapMainNum - 1);
         for (int j = 0; j <= TapMainNum; j++)
         {
             string firstMessage = String.Empty;
             string endMessage   = String.Empty;
             if (j == 0)
             {
                 firstMessage = (i + 1).ToString();
                 endMessage   = i.ToString() + (char)('A' + TapMainNum - 1);
             }
             else if (j == TapMainNum)
             {
                 firstMessage = i.ToString() + 'A';
                 endMessage   = (i - 1).ToString();
             }
             else
             {
                 firstMessage = i.ToString() + tapMessage;
                 tapMessage   = (char)(tapMessage - 1);
                 endMessage   = i.ToString() + tapMessage;
             }
             if (jobList.Transformer.OLTC.WindingPosition == WindingType.HV)
             {
                 miList.Add(MeasurementItemStruct.CreateOLTCSwitchingCharacterMeasurementItem(jobList.Transformer.OLTC.WindingPosition, firstMessage, endMessage, jobList.Transformer.WindingConfig.HV));
             }
             if (jobList.Transformer.OLTC.WindingPosition == WindingType.MV)
             {
                 miList.Add(MeasurementItemStruct.CreateOLTCSwitchingCharacterMeasurementItem(jobList.Transformer.OLTC.WindingPosition, firstMessage, endMessage, jobList.Transformer.WindingConfig.MV));
             }
         }
     }
 }
예제 #29
0
        private static TransformerWindingConfigName GetWindConfig(MeasurementItemStruct mi, Transformer transformer)
        {
            if (mi.Winding == WindingType.HV)
            {
                mi.WindingConfig = transformer.WindingConfig.HV;
            }
            else if (mi.Winding == WindingType.MV)
            {
                mi.WindingConfig = transformer.WindingConfig.MV;
            }
            else
            {
                if (transformer.PhaseNum == 2)
                {
                    mi.WindingConfig = transformer.WindingConfig.MV;
                }
                else
                {
                    mi.WindingConfig = transformer.WindingConfig.LV;
                }
            }

            return(mi.WindingConfig);
        }
예제 #30
0
 private byte GetTapLabel(MeasurementItemStruct mi)
 {
     return((byte)ChangeValueToNeed.GetOLtcNum(mi));
 }