Ejemplo n.º 1
0
        internal BvtPage()
        {
            Parameters = new Types.BVT.TestParameters {
                IsEnabled = true
            };
            ClampParameters = new Types.Clamping.TestParameters
            {
                StandardForce          = Types.Clamping.ClampingForceInternal.Custom,
                CustomForce            = 5,
                IsHeightMeasureEnabled = false
            };
            CommType    = Settings.Default.SinglePositionModuleMode ? Types.Commutation.ModuleCommutationType.Direct : Types.Commutation.ModuleCommutationType.MT3;
            Temperature = RoomTemp;
            InitializeComponent();

            m_XRed   = (SolidColorBrush)FindResource("xRed1");
            m_XGreen = (SolidColorBrush)FindResource("xGreen3");

            ClearStatus();

            ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction {
                YRange = new DisplayRange(-7, 7)
            };

            chartPlotter.Viewport.Restrictions.Add(restr);
        }
Ejemplo n.º 2
0
        private void Test_Click(object Sender, RoutedEventArgs E)
        {
            if (tabControl.SelectedIndex != 1)
            {
                return;
            }

            var paramGate = new Types.Gate.TestParameters {
                IsEnabled = false
            };
            var paramBvt = new Types.BVT.TestParameters {
                IsEnabled = false
            };
            var paramVtm = new Types.VTM.TestParameters {
                IsEnabled = false
            };
            var paramATU = new Types.ATU.TestParameters {
                IsEnabled = false
            };
            var paramQrrTq = new Types.QrrTq.TestParameters {
                IsEnabled = false
            };
            var paramIH = new Types.IH.TestParameters {
                IsEnabled = false
            };
            var paramRCC = new Types.RCC.TestParameters {
                IsEnabled = false
            };
            var paramTOU = new Types.TOU.TestParameters {
                IsEnabled = false
            };

            switch (tabControl.SelectedIndex)
            {
            case 1:
                paramVtm.IsEnabled  = true;
                paramVtm.IsSelfTest = true;
                break;
            }

            var started = Cache.Net.Start(paramGate, paramVtm, paramBvt, paramATU, paramQrrTq, paramIH, paramRCC,
                                          new Types.Commutation.TestParameters
            {
                BlockIndex      = Types.Commutation.HWBlockIndex.Block1,
                CommutationType = Types.Commutation.HWModuleCommutationType.Direct,
                Position        = Types.Commutation.HWModulePosition.Position1
            }, new Types.Clamping.TestParameters {
                SkipClamping = true
            }, paramTOU, true);

            var stopped = Cache.Net.IsStopButtonPressed;

            if (stopped || !started)
            {
                return;
            }

            IsRunning = true;
        }
Ejemplo n.º 3
0
        internal DeviceState Start(Types.BVT.TestParameters parameters, Types.Commutation.TestParameters commParameters)
        {
            m_Parameters = parameters;

            if (m_State == DeviceState.InProcess)
            {
                throw new Exception("BVT test is already started");
            }

            m_Result = new Types.BVT.TestResults {
                TestTypeId = parameters.TestTypeId
            };
            m_Stop = false;

            ClearWarning();

            if (!m_IsBVTEmulation)
            {
                var devState = (Types.BVT.HWDeviceState)ReadRegister(REG_DEVICE_STATE);
                if (devState == Types.BVT.HWDeviceState.Fault)
                {
                    var faultReason = (Types.BVT.HWFaultReason)ReadRegister(REG_FAULT_REASON);
                    FireNotificationEvent(Types.BVT.HWProblemReason.None, Types.BVT.HWWarningReason.None, faultReason,
                                          Types.BVT.HWDisableReason.None);

                    throw new Exception(string.Format("BVT is in fault state, reason: {0}", faultReason));
                }

                if (devState == Types.BVT.HWDeviceState.Disabled)
                {
                    var disableReason = (Types.BVT.HWDisableReason)ReadRegister(REG_DISABLE_REASON);
                    FireNotificationEvent(Types.BVT.HWProblemReason.None, Types.BVT.HWWarningReason.None,
                                          Types.BVT.HWFaultReason.None, disableReason);

                    throw new Exception(string.Format("BVT is in disabled state, reason: {0}", disableReason));
                }
            }

            m_State = DeviceState.InProcess;
            FireBvtAllEvent(m_State);

            MeasurementLogicRoutine(commParameters);

            if (m_State != DeviceState.Success)
            {
                FireBvtAllEvent(m_State);
            }

            return(m_State);
        }
Ejemplo n.º 4
0
        private void BtnStart_OnClick(object sender, RoutedEventArgs e)
        {
            if (VM.IsRunning)
            {
                return;
            }

            VM.IsRunning = true;

            var paramGate = new Types.Gate.TestParameters {
                IsEnabled = false
            };
            var paramVtm = new Types.VTM.TestParameters {
                IsEnabled = false
            };
            var paramBvt = new Types.BVT.TestParameters {
                IsEnabled = false
            };
            var paramATU = new Types.ATU.TestParameters {
                IsEnabled = false
            };
            var paramQrrTq = new Types.QrrTq.TestParameters {
                IsEnabled = false
            };
            var paramIH = new Types.IH.TestParameters {
                IsEnabled = false
            };
            var paramRCC = new Types.RCC.TestParameters {
                IsEnabled = false
            };

            //если пресс был зажат вручную - не стоит пробовать зажимать его ещё раз
            VM.Clamping.SkipClamping = Cache.Clamp.ManualClamping;

            Types.Commutation.TestParameters commutation = new Types.Commutation.TestParameters()
            {
                BlockIndex      = (!Cache.Clamp.UseTmax) ? Types.Commutation.HWBlockIndex.Block1 : Types.Commutation.HWBlockIndex.Block2,
                CommutationType = ConverterUtil.MapCommutationType(VM.CommutationType),
                Position        = ConverterUtil.MapModulePosition(VM.Position)
            };



            if (!Cache.Net.Start(paramGate, paramVtm, paramBvt, paramATU, paramQrrTq, paramIH, paramRCC, commutation, VM.Clamping, VM.TOU))
            {
                return;
            }

            ClearStatus();
        }
Ejemplo n.º 5
0
        internal void Start()
        {
            if (IsRunning)
            {
                return;
            }

            var paramGate = new Types.Gate.TestParameters {
                IsEnabled = false
            };
            var paramVtm = new Types.VTM.TestParameters {
                IsEnabled = false
            };
            var paramBvt = new Types.BVT.TestParameters {
                IsEnabled = false
            };
            var paramATU = new Types.ATU.TestParameters {
                IsEnabled = false
            };
            var paramIH = new Types.IH.TestParameters {
                IsEnabled = false
            };
            var paramRCC = new Types.RCC.TestParameters {
                IsEnabled = false
            };
            var paramTOU = new Types.TOU.TestParameters {
                IsEnabled = false
            };

            //если пресс был зажат вручную - не стоит пробовать зажимать его ещё раз
            ClampParameters.SkipClamping = Cache.Clamp.ManualClamping;

            if (!Cache.Net.Start(paramGate, paramVtm, paramBvt, paramATU, Parameters, paramIH, paramRCC,
                                 new Types.Commutation.TestParameters
            {
                BlockIndex = (!Cache.Clamp.clampPage.UseTmax) ? Types.Commutation.HWBlockIndex.Block1 : Types.Commutation.HWBlockIndex.Block2,
                CommutationType = ConverterUtil.MapCommutationType(CommType),
                Position = ConverterUtil.MapModulePosition(ModPosition)
            }, ClampParameters, paramTOU))
            {
                return;
            }

            ClearStatus();
            IsRunning = true;
        }
Ejemplo n.º 6
0
        internal BvtPage()
        {
            Parameters = new Types.BVT.TestParameters {
                IsEnabled = true
            };
            ClampParameters = new Types.Clamping.TestParameters {
                StandardForce = Types.Clamping.ClampingForceInternal.Custom, CustomForce = 5
            };
            CommType = Settings.Default.SinglePositionModuleMode ? Types.Commutation.ModuleCommutationType.Direct : Types.Commutation.ModuleCommutationType.MT3;

            InitializeComponent();

            m_XRed    = (SolidColorBrush)FindResource("xRed1");
            m_XOrange = (SolidColorBrush)FindResource("xOrange1");

            ClearStatus();
        }
Ejemplo n.º 7
0
        internal void Start()
        {
            if (IsRunning)
            {
                return;
            }

            var paramGate = new Types.Gate.TestParameters {
                IsEnabled = false
            };
            var paramBvt = new Types.BVT.TestParameters {
                IsEnabled = false
            };
            var paramATU = new Types.ATU.TestParameters {
                IsEnabled = false
            };
            var paramQrrTq = new Types.QrrTq.TestParameters {
                IsEnabled = false
            };
            var paramIH = new Types.IH.TestParameters {
                IsEnabled = false
            };
            var paramRCC = new Types.RCC.TestParameters {
                IsEnabled = false
            };
            var paramTOU = new Types.TOU.TestParameters {
                IsEnabled = false
            };

            ClampParameters.SkipClamping = Cache.Clamp.ManualClamping;
            ClearStatus();

            if (!Cache.Net.Start(paramGate, Parameters, paramBvt, paramATU, paramQrrTq, paramIH, paramRCC,
                                 new Types.Commutation.TestParameters
            {
                BlockIndex = (!Cache.Clamp.UseTmax) ? Types.Commutation.HWBlockIndex.Block1 : Types.Commutation.HWBlockIndex.Block2,
                CommutationType = ConverterUtil.MapCommutationType(CommType),
                Position = ConverterUtil.MapModulePosition(ModPosition)
            }, ClampParameters, paramTOU))
            {
                return;
            }

            IsRunning = true;
        }
Ejemplo n.º 8
0
 bool IExternalControl.Start(Types.Gate.TestParameters ParametersGate, Types.VTM.TestParameters ParametersSL,
                             Types.BVT.TestParameters ParametersBvt, Types.ATU.TestParameters ParametersAtu, Types.QrrTq.TestParameters ParametersQrrTq, Types.IH.TestParameters ParametersIH, Types.RCC.TestParameters ParametersRCC,
                             Types.Commutation.TestParameters ParametersComm, Types.Clamping.TestParameters ParametersClamp, Types.TOU.TestParameters ParametersTOU)
 {
     return(_IoMain.Start(ParametersGate, ParametersSL, ParametersBvt, ParametersAtu, ParametersQrrTq, ParametersIH, ParametersRCC, ParametersComm, ParametersClamp, ParametersTOU));
 }
Ejemplo n.º 9
0
        private void FillBvtParameters(Types.BVT.TestParameters parameters, long testTypeId)
        {
            var results = new List <Tuple <string, float?, float?> >();

            FillParametersResults(testTypeId, results);

            foreach (var result in results)
            {
                switch (result.Item1)
                {
                case "VRRM":
                    if (result.Item2.HasValue)
                    {
                        parameters.VRRM = Convert.ToUInt16(result.Item2.Value);
                    }
                    break;

                case "VDRM":
                    if (result.Item2.HasValue)
                    {
                        parameters.VDRM = Convert.ToUInt16(result.Item2.Value);
                    }
                    break;

                case "IRRM":
                    if (result.Item3.HasValue)
                    {
                        parameters.IRRM = Convert.ToUInt16(result.Item3.Value);
                    }
                    break;

                case "IDRM":
                    if (result.Item3.HasValue)
                    {
                        parameters.IDRM = Convert.ToUInt16(result.Item3.Value);
                    }
                    break;

                case "VRSM":
                    if (result.Item2.HasValue)
                    {
                        parameters.VRSM = Convert.ToUInt16(result.Item2.Value);
                    }
                    break;

                case "VDSM":
                    if (result.Item2.HasValue)
                    {
                        parameters.VDSM = Convert.ToUInt16(result.Item2.Value);
                    }
                    break;

                case "IRSM":
                    if (result.Item3.HasValue)
                    {
                        parameters.IRSM = Convert.ToUInt16(result.Item3.Value);
                    }
                    break;

                case "IDSM":
                    if (result.Item3.HasValue)
                    {
                        parameters.IDSM = Convert.ToUInt16(result.Item3.Value);
                    }
                    break;
                }
            }
        }
Ejemplo n.º 10
0
        private Types.BVT.TestParameters FillBvtConditions(long testTypeId)
        {
            var results    = new Dictionary <string, object>(9);
            var testParams = new Types.BVT.TestParameters()
            {
                IsEnabled = true, TestTypeId = testTypeId
            };

            FillOrder(testTypeId, testParams);

            FillConditionsResults(testTypeId, results);

            foreach (var result in results)
            {
                switch (result.Key)
                {
                case "BVT_En":
                    testParams.IsEnabled = Convert.ToBoolean(result.Value);
                    break;

                case "BVT_UseUdsmUrsm":
                    testParams.UseUdsmUrsm = Convert.ToBoolean(result.Value);
                    break;

                case "BVT_PulseFrequency":
                    testParams.PulseFrequency = Convert.ToUInt16(result.Value);
                    break;

                case "BVT_Type":
                    testParams.TestType = (BVTTestType)(Enum.Parse(typeof(BVTTestType), result.Value.ToString()));
                    break;

                case "BVT_I":
                    testParams.CurrentLimit = Float.ParseInternationally(result.Value.ToString());
                    break;

                case "BVT_RumpUp":
                    testParams.RampUpVoltage = Float.ParseInternationally(result.Value.ToString());
                    break;

                case "BVT_StartV":
                    testParams.StartVoltage = UInt16.Parse(result.Value.ToString());
                    break;

                case "BVT_F":
                    testParams.VoltageFrequency = UInt16.Parse(result.Value.ToString());
                    break;

                case "BVT_FD":
                    testParams.FrequencyDivisor = UInt16.Parse(result.Value.ToString());
                    break;

                case "BVT_Mode":
                    testParams.MeasurementMode =
                        (BVTMeasurementMode)(Enum.Parse(typeof(BVTMeasurementMode), result.Value.ToString()));
                    break;

                case "BVT_VR":
                    switch (testParams.TestType)
                    {
                    case BVTTestType.Both:
                    case BVTTestType.Reverse:
                        testParams.VoltageLimitR = UInt16.Parse(result.Value.ToString());
                        break;
                    }

                    break;

                case "BVT_VD":
                    switch (testParams.TestType)
                    {
                    case BVTTestType.Both:
                    case BVTTestType.Direct:
                        testParams.VoltageLimitD = UInt16.Parse(result.Value.ToString());
                        break;
                    }

                    break;

                case "BVT_PlateTime":
                    testParams.PlateTime = UInt16.Parse(result.Value.ToString());
                    break;


                case "BVT_UdsmUrsm_PulseFrequency":
                    testParams.UdsmUrsmPulseFrequency = Convert.ToUInt16(result.Value);
                    break;

                case "BVT_UdsmUrsm_Type":
                    testParams.UdsmUrsmTestType = (BVTTestType)(Enum.Parse(typeof(BVTTestType), result.Value.ToString()));
                    break;

                case "BVT_UdsmUrsm_I":
                    testParams.UdsmUrsmCurrentLimit = Float.ParseInternationally(result.Value.ToString());
                    break;

                case "BVT_UdsmUrsm_RumpUp":
                    testParams.UdsmUrsmRampUpVoltage = Float.ParseInternationally(result.Value.ToString());
                    break;

                case "BVT_UdsmUrsm_StartV":
                    testParams.UdsmUrsmStartVoltage = UInt16.Parse(result.Value.ToString());
                    break;

                case "BVT_UdsmUrsm_F":
                    testParams.UdsmUrsmVoltageFrequency = UInt16.Parse(result.Value.ToString());
                    break;

                case "BVT_UdsmUrsm_FD":
                    testParams.UdsmUrsmFrequencyDivisor = UInt16.Parse(result.Value.ToString());
                    break;

                case "BVT_UdsmUrsm_VR":
                    switch (testParams.UdsmUrsmTestType)
                    {
                    case BVTTestType.Both:
                    case BVTTestType.Reverse:
                        testParams.UdsmUrsmVoltageLimitR = UInt16.Parse(result.Value.ToString());
                        break;
                    }

                    break;

                case "BVT_UdsmUrsm_VD":
                    switch (testParams.UdsmUrsmTestType)
                    {
                    case BVTTestType.Both:
                    case BVTTestType.Direct:
                        testParams.UdsmUrsmVoltageLimitD = UInt16.Parse(result.Value.ToString());
                        break;
                    }

                    break;

                case "BVT_UdsmUrsm_PlateTime":
                    testParams.UdsmUrsmPlateTime = UInt16.Parse(result.Value.ToString());
                    break;
                }
            }

            return(testParams);
        }