Exemplo n.º 1
0
        /// <summary>
        ///     The thread orig wave start.
        /// </summary>
        void ThreadOrigWaveStart()
        {
            while (true)
            {
                this.OrigBytesEvent.WaitOne();
                var r = new byte[2];
                for (int i = 0; i < ConstUdpArg.ORIG_DETECT_LENGTH; i++)
                {
                    for (int j = 0; j < (this.OrigWaveBytes[0].Length / 2) - 1; j++)
                    {
                        r[0] = this.OrigWaveBytes[i][(j * 2) + 1];
                        r[1] = this.OrigWaveBytes[i][j * 2];
                        short a = BitConverter.ToInt16(r, 0);

                        this.OrigWaveFloats[i][j] = a / 8192.0f;
                    }
                }

                if (OrigGraphEventHandler != null)
                {
                    string sender = "OrigNet";
                    int    index  = DisPlayWindow.Info.OrigChannel - 1 + ((DisPlayWindow.Info.OrigTdiv - 1) * 8);
                    OrigGraphEventHandler.Invoke(sender, this.OrigWaveFloats[index]);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     线程处理函数:原始数据处理
        /// </summary>
        void ThreadOrigWaveStart()
        {
            while (true)
            {
                OrigBytesEvent.WaitOne();
                var r = new byte[2];
                for (int i = 0; i < ConstUdpArg.ORIG_DETECT_LENGTH; i++)
                {
                    for (int j = 0; j < (OrigWaveBytes[0].Length / 2 - 1); j++)
                    {
                        r[0] = OrigWaveBytes[i][j * 2 + 1];
                        r[1] = OrigWaveBytes[i][j * 2];
                        short a = BitConverter.ToInt16(r, 0);

                        OrigWaveFloats[i][j] = a / 8192.0f;
                    }
                }
                int origchannel = DisPlayWindow.Info.OrigChannel - 1;
                int origTdiv    = DisPlayWindow.Info.OrigTdiv - 1;
                int origpack    = origchannel + origTdiv * 8;
                if (OrigGraphEventHandler != null)
                {
                    string sender = "OrigNet";
                    OrigGraphEventHandler.Invoke(sender, OrigWaveFloats[origpack]);
                }
            }
        }
Exemplo n.º 3
0
            /// <summary>
            /// 线程处理函数:原始数据处理
            /// </summary>
            void ThreadOrigWaveStart()
            {
                while (true)
                {
                    OrigBytesEvent.WaitOne();
                    var r = new byte[2];
                    for (int i = 0; i < ConstUdpArg.ORIG_DETECT_LENGTH; i++)
                    {
                        for (int j = 0; j < OrigWaveBytes[0].Length / 2 - 1; j++)
                        {
                            r[0] = OrigWaveBytes[i][j * 2 + 1];
                            r[1] = OrigWaveBytes[i][j * 2];
                            short a = BitConverter.ToInt16(r, 0);

                            OrigWaveFloats[i][j] = a / 8192.0f;
                        }
                    }
                    if (OrigGraphEventHandler != null)
                    {
                        OrigGraphEventHandler.Invoke(null, OrigWaveFloats);
                    }
                }
            }