Exemplo n.º 1
0
        /// <summary>
        /// Abort the self test sequence.
        /// </summary>
        /// <remarks>This request will stop the execution of the self-test process on the VCU and return control to the propulsion software.</remarks>
        /// <exception cref="CommunicationException">Thrown if the error code returned from the call to the m_SelfTestMarshal.AbortSTSequence() method is not
        /// CommunicationError.Success.</exception>
        public void AbortSTSequence()
        {
            Debug.Assert(m_MutexCommuncationInterface != null,
                         "CommunicationSelfTest.AbortSTSequence() - [m_MutexCommuncationInterface != null]");

            CommunicationError errorCode = CommunicationError.UnknownError;

            try
            {
                m_MutexCommuncationInterface.WaitOne(DefaultMutexWaitDurationMs, false);
                errorCode = m_SelfTestMarshal.AbortSTSequence();
            }
            catch (Exception)
            {
                errorCode = CommunicationError.SystemException;
                throw new CommunicationException("CommunicationSelfTest.AbortSTSequence()", errorCode);
            }
            finally
            {
                m_MutexCommuncationInterface.ReleaseMutex();
            }

            if (DebugMode.Enabled == true)
            {
                DebugMode.AbortSTSequence_t abortSTSequence = new DebugMode.AbortSTSequence_t(errorCode);
                DebugMode.Write(abortSTSequence.ToXML());
            }

            if (errorCode != CommunicationError.Success)
            {
                throw new CommunicationException("CommunicationSelfTest.AbortSTSequence()", errorCode);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Abort the self test sequence.
        /// </summary>
        /// <remarks>This request will stop the execution of the self-test process on the VCU and return control to the propulsion software.</remarks>
        /// <exception cref="CommunicationException">Thrown if the error code returned from the call to the PTUDLL32.AbortSTSequence() method is not 
        /// CommunicationError.Success.</exception>
        public void AbortSTSequence()
        {
            Debug.Assert(m_MutexCommuncationInterface != null,
                         "CommunicationSelfTest.AbortSTSequence() - [m_MutexCommuncationInterface != null]");

            CommunicationError errorCode = CommunicationError.UnknownError;
            try
            {
                m_MutexCommuncationInterface.WaitOne(DefaultMutexWaitDurationMs, false);
                errorCode = m_SelfTestMarshal.AbortSTSequence();
            }
            catch (Exception)
            {
                errorCode = CommunicationError.SystemException;
                throw new CommunicationException("CommunicationSelfTest.AbortSTSequence()", errorCode);
            }
            finally
            {
                m_MutexCommuncationInterface.ReleaseMutex();
            }

            if (DebugMode.Enabled == true)
            {
                DebugMode.AbortSTSequence_t abortSTSequence = new DebugMode.AbortSTSequence_t(errorCode);
                DebugMode.Write(abortSTSequence.ToXML());
            }

            if (errorCode != CommunicationError.Success)
            {
                throw new CommunicationException("CommunicationSelfTest.AbortSTSequence()", errorCode);
            }
        }