Exemplo n.º 1
0
        internal DeviceState Start(TestParameters Parameters, Types.Commutation.TestParameters commParameters)
        {
            m_Parameters = Parameters;

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

            m_Result            = new TestResults();
            m_Result.TestTypeId = m_Parameters.TestTypeId;

            m_Stop = false;

            if (!m_IsEmulation)
            {
                //смотрим состояние Gate
                m_IOGate.ClearWarning();
                ushort State = m_IOGate.ReadDeviceState();

                switch (State)
                {
                case (ushort)Types.Gate.HWDeviceState.Fault:
                    ushort faultReason = m_IOGate.ReadFaultReason();
                    FireNotificationEvent(ComplexParts.Gate, (ushort)HWProblemReason.None, (ushort)HWWarningReason.None, faultReason, (ushort)HWDisableReason.None);

                    break;

                case (ushort)Types.Gate.HWDeviceState.Disabled:
                    ushort disableReason = m_IOGate.ReadDisableReason();
                    FireNotificationEvent(ComplexParts.Gate, (ushort)HWProblemReason.None, (ushort)HWWarningReason.None, (ushort)HWFaultReason.None, disableReason);

                    break;
                }

                //смотрим состояние StLs
                m_IOStLs.ClearWarning();
                State = m_IOStLs.ReadDeviceState();

                switch (State)
                {
                case (ushort)Types.VTM.HWDeviceState.Fault:
                    ushort faultReason = m_IOStLs.ReadFaultReason();
                    FireNotificationEvent(ComplexParts.SL, (ushort)HWProblemReason.None, (ushort)HWWarningReason.None, faultReason, (ushort)HWDisableReason.None);

                    break;

                case (ushort)Types.VTM.HWDeviceState.Disabled:
                    ushort disableReason = m_IOStLs.ReadDisableReason();
                    FireNotificationEvent(ComplexParts.SL, (ushort)HWProblemReason.None, (ushort)HWWarningReason.None, (ushort)HWFaultReason.None, disableReason);

                    break;
                }
            }

            MeasurementLogicRoutine(commParameters);

            return(m_State);
        }
Exemplo n.º 2
0
        internal DeviceState Start(TestParameters Parameters, Types.Commutation.TestParameters commParameters, out RCCResult resultRCC)
        {
            m_Parameters = Parameters;

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

            m_Result            = new TestResults();
            m_Result.TestTypeId = m_Parameters.TestTypeId;

            m_Stop = false;

            if (!m_IsEmulation)
            {
                //результат прозвонки цепи катод-катод не определён
                resultRCC = RCCResult.OPRESULT_NONE;

                //смотрим состояние Gate
                m_IOGate.ClearWarning();
                ushort State = m_IOGate.ReadDeviceState();

                switch (State)
                {
                case (ushort)Types.Gate.HWDeviceState.Fault:
                    ushort faultReason = m_IOGate.ReadFaultReason();
                    FireNotificationEvent(ComplexParts.Gate, (ushort)HWProblemReason.None, (ushort)HWWarningReason.None, faultReason, (ushort)HWDisableReason.None);

                    return((DeviceState)State);

                case (ushort)Types.Gate.HWDeviceState.Disabled:
                    ushort disableReason = m_IOGate.ReadDisableReason();
                    FireNotificationEvent(ComplexParts.Gate, (ushort)HWProblemReason.None, (ushort)HWWarningReason.None, (ushort)HWFaultReason.None, disableReason);

                    return((DeviceState)State);
                }
            }

            MeasurementLogicRoutine(commParameters);

            resultRCC = m_Result.RCC;

            return(m_State);
        }