コード例 #1
0
        private void FireBvtEvent(DeviceState State, Types.BVT.TestResults Result, BVTTestType type, bool IsUdsmUrsm)
        {
            var message = string.Format($"BVT {(IsUdsmUrsm ? "UdsmUrsm" : "")} {(type == BVTTestType.Direct ? "direct" : "reverse")} test state {0}", State);

            if (State == DeviceState.Success)
            {
                message = string.Format($"BVT {(IsUdsmUrsm ? "UdsmUrsm" : "")} {(type == BVTTestType.Direct ? "direct" : "reverse")} test result " +
                                        $"{(type == BVTTestType.Direct ? Result.VDRM : Result.VRRM)} V, {(type == BVTTestType.Direct ? Result.IDRM : Result.IRRM)} mA");
            }

            SystemHost.Journal.AppendLog(ComplexParts.BVT, LogMessageType.Info, message);
            if (type == BVTTestType.Direct)
            {
                if (IsUdsmUrsm)
                {
                    m_Communication.PostBVTUdsmUrsmDirectEvent(State, Result);
                }
                else
                {
                    m_Communication.PostBVTDirectEvent(State, Result);
                }
            }
            else
            {
                if (IsUdsmUrsm)
                {
                    m_Communication.PostBVTUdsmUrsmReverseEvent(State, Result);
                }
                else
                {
                    m_Communication.PostBVTReverseEvent(State, Result);
                }
            }
        }