diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index 96a43c7..cfb0428 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -45,7 +45,7 @@ containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); - + //Dialog or Window containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); @@ -56,6 +56,7 @@ containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); + containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index 96a43c7..cfb0428 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -45,7 +45,7 @@ containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); - + //Dialog or Window containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); @@ -56,6 +56,7 @@ containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); + containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index a33ee5d..653b0a9 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -220,6 +220,9 @@ CheckResponseDialog.xaml + + DetectNoiseDialog.xaml + EditSoundSpeedDialog.xaml @@ -241,6 +244,7 @@ + @@ -285,6 +289,7 @@ + @@ -311,6 +316,7 @@ Designer MSBuild:Compile + Designer diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index 96a43c7..cfb0428 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -45,7 +45,7 @@ containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); - + //Dialog or Window containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); @@ -56,6 +56,7 @@ containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); + containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index a33ee5d..653b0a9 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -220,6 +220,9 @@ CheckResponseDialog.xaml + + DetectNoiseDialog.xaml + EditSoundSpeedDialog.xaml @@ -241,6 +244,7 @@ + @@ -285,6 +289,7 @@ + @@ -311,6 +316,7 @@ Designer MSBuild:Compile + Designer diff --git a/Correlator/DataService/SerialPortServiceImpl.cs b/Correlator/DataService/SerialPortServiceImpl.cs index a439c2f..1f55a3f 100644 --- a/Correlator/DataService/SerialPortServiceImpl.cs +++ b/Correlator/DataService/SerialPortServiceImpl.cs @@ -241,15 +241,25 @@ //发送消息计算数据 if (_dataModel.LeftDeviceDataArray != null && _dataModel.RightDeviceDataArray != null) { - var diffTime = Convert.ToInt32( - Math.Abs((_dataModel.LeftReceiveDataTime - _dataModel.RightReceiveDataTime).TotalSeconds) - ); - "SerialPortServiceImpl".WriteLog("加速度计左右两边接收到的数据时间差:" + diffTime + "s"); + if (RuntimeCache.IsDetectNoise) + { + _eventAggregator.GetEvent().Publish(_dataModel); + } + else + { + var diffTime = Convert.ToInt32( + Math.Abs((_dataModel.LeftReceiveDataTime - _dataModel.RightReceiveDataTime).TotalSeconds) + ); - //左右两边接收到的数据时间差超过10s,认为不是同一次此指令返回的,舍弃 - if (diffTime >= 10) return; - RuntimeCache.CorrelatorData = _dataModel; - _eventAggregator.GetEvent().Publish(); + //左右两边接收到的数据时间差超过10s,认为不是同一次此指令返回的,舍弃 + if (diffTime >= 10) + { + return; + } + + RuntimeCache.CorrelatorData = _dataModel; + _eventAggregator.GetEvent().Publish(); + } } } } diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index 96a43c7..cfb0428 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -45,7 +45,7 @@ containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); - + //Dialog or Window containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); @@ -56,6 +56,7 @@ containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); + containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index a33ee5d..653b0a9 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -220,6 +220,9 @@ CheckResponseDialog.xaml + + DetectNoiseDialog.xaml + EditSoundSpeedDialog.xaml @@ -241,6 +244,7 @@ + @@ -285,6 +289,7 @@ + @@ -311,6 +316,7 @@ Designer MSBuild:Compile + Designer diff --git a/Correlator/DataService/SerialPortServiceImpl.cs b/Correlator/DataService/SerialPortServiceImpl.cs index a439c2f..1f55a3f 100644 --- a/Correlator/DataService/SerialPortServiceImpl.cs +++ b/Correlator/DataService/SerialPortServiceImpl.cs @@ -241,15 +241,25 @@ //发送消息计算数据 if (_dataModel.LeftDeviceDataArray != null && _dataModel.RightDeviceDataArray != null) { - var diffTime = Convert.ToInt32( - Math.Abs((_dataModel.LeftReceiveDataTime - _dataModel.RightReceiveDataTime).TotalSeconds) - ); - "SerialPortServiceImpl".WriteLog("加速度计左右两边接收到的数据时间差:" + diffTime + "s"); + if (RuntimeCache.IsDetectNoise) + { + _eventAggregator.GetEvent().Publish(_dataModel); + } + else + { + var diffTime = Convert.ToInt32( + Math.Abs((_dataModel.LeftReceiveDataTime - _dataModel.RightReceiveDataTime).TotalSeconds) + ); - //左右两边接收到的数据时间差超过10s,认为不是同一次此指令返回的,舍弃 - if (diffTime >= 10) return; - RuntimeCache.CorrelatorData = _dataModel; - _eventAggregator.GetEvent().Publish(); + //左右两边接收到的数据时间差超过10s,认为不是同一次此指令返回的,舍弃 + if (diffTime >= 10) + { + return; + } + + RuntimeCache.CorrelatorData = _dataModel; + _eventAggregator.GetEvent().Publish(); + } } } } diff --git a/Correlator/Dialog/DetectNoiseDialog.xaml b/Correlator/Dialog/DetectNoiseDialog.xaml new file mode 100644 index 0000000..ac882b1 --- /dev/null +++ b/Correlator/Dialog/DetectNoiseDialog.xaml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +