コード例 #1
0
 /// <summary>
 /// 显示测量信息
 /// </summary>
 /// <param name="currentInputFrequency"></param>
 /// <param name="currentSampleTime"></param>
 /// <param name="pulseFrequencies"></param>
 /// <param name="scopeCHACollection"></param>
 /// <param name="scopeCHAEdgeCollection"></param>
 private void ShowMeasureInfos(int currentInputFrequency, int currentSampleTime, List <double> pulseFrequencies, ObservableCollection <Data> scopeCHACollection, ObservableCollection <Data> scopeCHAEdgeCollection)
 {
     new Thread(delegate()
     {
         ThreadPool.QueueUserWorkItem(delegate
         {
             SynchronizationContext.SetSynchronizationContext(new System.Windows.Threading.DispatcherSynchronizationContext(System.Windows.Application.Current.Dispatcher));
             SynchronizationContext.Current.Send(pl =>
             {
                 MeasurementInfos.Insert(0, new FrequencyMeasurementInfo(currentInputFrequency, currentSampleTime, pulseFrequencies, scopeCHACollection, scopeCHAEdgeCollection));
             }, null);
         });
     }).Start();
 }
コード例 #2
0
        /// <summary>
        /// 显示输入输出数据
        /// </summary>
        /// <param name="time">当前时间</param>
        /// <param name="currentInput">当前输入</param>
        /// <param name="currentOutput">当前输出</param>
        /// <param name="isSuccess">执行结果</param>
        private void ShowIOData(double time, double currentInput, double currentOutput)
        {
            new Thread(delegate()
            {
                ThreadPool.QueueUserWorkItem(delegate
                {
                    SynchronizationContext.SetSynchronizationContext(new System.Windows.Threading.DispatcherSynchronizationContext(System.Windows.Application.Current.Dispatcher));
                    SynchronizationContext.Current.Send(pl =>
                    {
                        AVoltageEdgeCollection.Add(new Data
                        {
                            Value1 = currentInput,
                            Value  = time
                        });

                        ScopeCHACollection.Add(new Data
                        {
                            Value1 = currentInput,
                            Value  = time
                        });

                        BVoltageEdgeCollection.Add(new Data
                        {
                            Value1 = currentOutput,
                            Value  = time
                        });

                        ScopeCHBCollection.Add(new Data
                        {
                            Value1 = currentOutput,
                            Value  = time
                        });

                        MeasurementInfos.Insert(0, new InputOutputMeasurementInfo(currentInput, currentOutput));
                    }, null);
                });
            }).Start();
        }
コード例 #3
0
        /// <summary>
        /// 显示释放测试数据
        /// </summary>
        /// <param name="time">当前时间</param>
        /// <param name="currentVoltage">当前电压</param>
        /// <param name="currentPressure">当前气压</param>
        /// <param name="isSuccess">执行结果</param>
        private void ShowNData(double time, double currentVoltage, double currentPressure, bool isSuccess)
        {
            new Thread(delegate()
            {
                ThreadPool.QueueUserWorkItem(delegate
                {
                    SynchronizationContext.SetSynchronizationContext(new System.Windows.Threading.DispatcherSynchronizationContext(System.Windows.Application.Current.Dispatcher));
                    SynchronizationContext.Current.Send(pl =>
                    {
                        PVoltageCollection.Add(new Data
                        {
                            Value1 = currentVoltage,
                            Value  = time
                        });

                        if (isSuccess)
                        {
                            PVoltageEdgeCollection.Add(new Data
                            {
                                Value1 = currentVoltage,
                                Value  = time
                            });
                            MeasurementInfos.Insert(0, new PNVoltageMeasurementInfo("已释放", currentVoltage, currentPressure, "L", "释放电压"));
                        }
                        else
                        {
                            NVoltageEdgeCollection.Add(new Data
                            {
                                Value1 = currentVoltage,
                                Value  = time
                            });
                            MeasurementInfos.Insert(0, new PNVoltageMeasurementInfo("测量释放", currentVoltage, currentPressure, "H", "无效"));
                        }
                    }, null);
                });
            }).Start();
        }