diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml b/Correlator/Dialog/NoiseWaveDialog.xaml new file mode 100644 index 0000000..dddec77 --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml b/Correlator/Dialog/NoiseWaveDialog.xaml new file mode 100644 index 0000000..dddec77 --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml.cs b/Correlator/Dialog/NoiseWaveDialog.xaml.cs new file mode 100644 index 0000000..bd9985a --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml.cs @@ -0,0 +1,52 @@ +using System.Drawing; +using System.Linq; +using System.Windows.Controls; +using Correlator.Util; + +namespace Correlator.Dialog +{ + public partial class NoiseWaveDialog : UserControl + { + public NoiseWaveDialog() + { + InitializeComponent(); + + //禁用XY缩放 + RedScottplotView.Configuration.LockHorizontalAxis = true; + RedScottplotView.Configuration.LockVerticalAxis = true; + RedScottplotView.Configuration.ScrollWheelZoom = false; + RedScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + RedScottplotView.Plot.Grid(false); + //四周边距 + RedScottplotView.Plot.YAxis.Layout(-5); + + // ###################################################################################### + + //禁用XY缩放 + BlueScottplotView.Configuration.LockHorizontalAxis = true; + BlueScottplotView.Configuration.LockVerticalAxis = true; + BlueScottplotView.Configuration.ScrollWheelZoom = false; + BlueScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + BlueScottplotView.Plot.Grid(false); + //四周边距 + BlueScottplotView.Plot.YAxis.Layout(-5); + + //渲染波形 + RedScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.LeftDeviceDataArray.Max()); + RedScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.LeftDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + RedScottplotView.Plot.AxisAuto(); + RedScottplotView.Refresh(); + + BlueScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.RightDeviceDataArray.Max()); + BlueScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.RightDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + BlueScottplotView.Plot.AxisAuto(); + BlueScottplotView.Refresh(); + } + } +} \ No newline at end of file diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml b/Correlator/Dialog/NoiseWaveDialog.xaml new file mode 100644 index 0000000..dddec77 --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml.cs b/Correlator/Dialog/NoiseWaveDialog.xaml.cs new file mode 100644 index 0000000..bd9985a --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml.cs @@ -0,0 +1,52 @@ +using System.Drawing; +using System.Linq; +using System.Windows.Controls; +using Correlator.Util; + +namespace Correlator.Dialog +{ + public partial class NoiseWaveDialog : UserControl + { + public NoiseWaveDialog() + { + InitializeComponent(); + + //禁用XY缩放 + RedScottplotView.Configuration.LockHorizontalAxis = true; + RedScottplotView.Configuration.LockVerticalAxis = true; + RedScottplotView.Configuration.ScrollWheelZoom = false; + RedScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + RedScottplotView.Plot.Grid(false); + //四周边距 + RedScottplotView.Plot.YAxis.Layout(-5); + + // ###################################################################################### + + //禁用XY缩放 + BlueScottplotView.Configuration.LockHorizontalAxis = true; + BlueScottplotView.Configuration.LockVerticalAxis = true; + BlueScottplotView.Configuration.ScrollWheelZoom = false; + BlueScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + BlueScottplotView.Plot.Grid(false); + //四周边距 + BlueScottplotView.Plot.YAxis.Layout(-5); + + //渲染波形 + RedScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.LeftDeviceDataArray.Max()); + RedScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.LeftDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + RedScottplotView.Plot.AxisAuto(); + RedScottplotView.Refresh(); + + BlueScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.RightDeviceDataArray.Max()); + BlueScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.RightDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + BlueScottplotView.Plot.AxisAuto(); + BlueScottplotView.Refresh(); + } + } +} \ No newline at end of file diff --git a/Correlator/Image/mfcc_demo.jpg b/Correlator/Image/mfcc_demo.jpg new file mode 100644 index 0000000..380d6b6 --- /dev/null +++ b/Correlator/Image/mfcc_demo.jpg Binary files differ diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml b/Correlator/Dialog/NoiseWaveDialog.xaml new file mode 100644 index 0000000..dddec77 --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml.cs b/Correlator/Dialog/NoiseWaveDialog.xaml.cs new file mode 100644 index 0000000..bd9985a --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml.cs @@ -0,0 +1,52 @@ +using System.Drawing; +using System.Linq; +using System.Windows.Controls; +using Correlator.Util; + +namespace Correlator.Dialog +{ + public partial class NoiseWaveDialog : UserControl + { + public NoiseWaveDialog() + { + InitializeComponent(); + + //禁用XY缩放 + RedScottplotView.Configuration.LockHorizontalAxis = true; + RedScottplotView.Configuration.LockVerticalAxis = true; + RedScottplotView.Configuration.ScrollWheelZoom = false; + RedScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + RedScottplotView.Plot.Grid(false); + //四周边距 + RedScottplotView.Plot.YAxis.Layout(-5); + + // ###################################################################################### + + //禁用XY缩放 + BlueScottplotView.Configuration.LockHorizontalAxis = true; + BlueScottplotView.Configuration.LockVerticalAxis = true; + BlueScottplotView.Configuration.ScrollWheelZoom = false; + BlueScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + BlueScottplotView.Plot.Grid(false); + //四周边距 + BlueScottplotView.Plot.YAxis.Layout(-5); + + //渲染波形 + RedScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.LeftDeviceDataArray.Max()); + RedScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.LeftDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + RedScottplotView.Plot.AxisAuto(); + RedScottplotView.Refresh(); + + BlueScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.RightDeviceDataArray.Max()); + BlueScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.RightDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + BlueScottplotView.Plot.AxisAuto(); + BlueScottplotView.Refresh(); + } + } +} \ No newline at end of file diff --git a/Correlator/Image/mfcc_demo.jpg b/Correlator/Image/mfcc_demo.jpg new file mode 100644 index 0000000..380d6b6 --- /dev/null +++ b/Correlator/Image/mfcc_demo.jpg Binary files differ diff --git a/Correlator/ViewModels/MainWindowViewModel.cs b/Correlator/ViewModels/MainWindowViewModel.cs index f52e502..56ddb10 100644 --- a/Correlator/ViewModels/MainWindowViewModel.cs +++ b/Correlator/ViewModels/MainWindowViewModel.cs @@ -769,7 +769,7 @@ return; } - _dialogService.Show("NoiseWaveView", null, delegate { }); + _dialogService.Show("NoiseWaveDialog", null, delegate { }); } private void OpenNumericKeypad() diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml b/Correlator/Dialog/NoiseWaveDialog.xaml new file mode 100644 index 0000000..dddec77 --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml.cs b/Correlator/Dialog/NoiseWaveDialog.xaml.cs new file mode 100644 index 0000000..bd9985a --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml.cs @@ -0,0 +1,52 @@ +using System.Drawing; +using System.Linq; +using System.Windows.Controls; +using Correlator.Util; + +namespace Correlator.Dialog +{ + public partial class NoiseWaveDialog : UserControl + { + public NoiseWaveDialog() + { + InitializeComponent(); + + //禁用XY缩放 + RedScottplotView.Configuration.LockHorizontalAxis = true; + RedScottplotView.Configuration.LockVerticalAxis = true; + RedScottplotView.Configuration.ScrollWheelZoom = false; + RedScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + RedScottplotView.Plot.Grid(false); + //四周边距 + RedScottplotView.Plot.YAxis.Layout(-5); + + // ###################################################################################### + + //禁用XY缩放 + BlueScottplotView.Configuration.LockHorizontalAxis = true; + BlueScottplotView.Configuration.LockVerticalAxis = true; + BlueScottplotView.Configuration.ScrollWheelZoom = false; + BlueScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + BlueScottplotView.Plot.Grid(false); + //四周边距 + BlueScottplotView.Plot.YAxis.Layout(-5); + + //渲染波形 + RedScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.LeftDeviceDataArray.Max()); + RedScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.LeftDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + RedScottplotView.Plot.AxisAuto(); + RedScottplotView.Refresh(); + + BlueScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.RightDeviceDataArray.Max()); + BlueScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.RightDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + BlueScottplotView.Plot.AxisAuto(); + BlueScottplotView.Refresh(); + } + } +} \ No newline at end of file diff --git a/Correlator/Image/mfcc_demo.jpg b/Correlator/Image/mfcc_demo.jpg new file mode 100644 index 0000000..380d6b6 --- /dev/null +++ b/Correlator/Image/mfcc_demo.jpg Binary files differ diff --git a/Correlator/ViewModels/MainWindowViewModel.cs b/Correlator/ViewModels/MainWindowViewModel.cs index f52e502..56ddb10 100644 --- a/Correlator/ViewModels/MainWindowViewModel.cs +++ b/Correlator/ViewModels/MainWindowViewModel.cs @@ -769,7 +769,7 @@ return; } - _dialogService.Show("NoiseWaveView", null, delegate { }); + _dialogService.Show("NoiseWaveDialog", null, delegate { }); } private void OpenNumericKeypad() diff --git a/Correlator/ViewModels/NoiseWaveViewViewModel.cs b/Correlator/ViewModels/NoiseWaveViewViewModel.cs index c319c4b..71f43d2 100644 --- a/Correlator/ViewModels/NoiseWaveViewViewModel.cs +++ b/Correlator/ViewModels/NoiseWaveViewViewModel.cs @@ -1,10 +1,11 @@ using System; +using System.Windows.Media.Imaging; using Prism.Mvvm; using Prism.Services.Dialogs; namespace Correlator.ViewModels { - public class NoiseWaveViewViewModel : BindableBase, IDialogAware + public class NoiseWaveDialogViewModel : BindableBase, IDialogAware { /// /// 空实现 @@ -19,6 +20,30 @@ public string Title => "传感器原始数据波形"; + private BitmapImage _redBitmapImage; + + public BitmapImage RedBitmapImage + { + get => _redBitmapImage; + set + { + _redBitmapImage = value; + RaisePropertyChanged(); + } + } + + private BitmapImage _blueBitmapImage; + + public BitmapImage BlueBitmapImage + { + get => _blueBitmapImage; + set + { + _blueBitmapImage = value; + RaisePropertyChanged(); + } + } + #endregion public bool CanCloseDialog() @@ -32,6 +57,8 @@ public void OnDialogOpened(IDialogParameters parameters) { + RedBitmapImage = new BitmapImage(new Uri(@"..\..\Image\mfcc_demo.jpg", UriKind.Relative)); + BlueBitmapImage = new BitmapImage(new Uri(@"..\..\Image\mfcc_demo.jpg", UriKind.Relative)); } } } \ No newline at end of file diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml b/Correlator/Dialog/NoiseWaveDialog.xaml new file mode 100644 index 0000000..dddec77 --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml.cs b/Correlator/Dialog/NoiseWaveDialog.xaml.cs new file mode 100644 index 0000000..bd9985a --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml.cs @@ -0,0 +1,52 @@ +using System.Drawing; +using System.Linq; +using System.Windows.Controls; +using Correlator.Util; + +namespace Correlator.Dialog +{ + public partial class NoiseWaveDialog : UserControl + { + public NoiseWaveDialog() + { + InitializeComponent(); + + //禁用XY缩放 + RedScottplotView.Configuration.LockHorizontalAxis = true; + RedScottplotView.Configuration.LockVerticalAxis = true; + RedScottplotView.Configuration.ScrollWheelZoom = false; + RedScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + RedScottplotView.Plot.Grid(false); + //四周边距 + RedScottplotView.Plot.YAxis.Layout(-5); + + // ###################################################################################### + + //禁用XY缩放 + BlueScottplotView.Configuration.LockHorizontalAxis = true; + BlueScottplotView.Configuration.LockVerticalAxis = true; + BlueScottplotView.Configuration.ScrollWheelZoom = false; + BlueScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + BlueScottplotView.Plot.Grid(false); + //四周边距 + BlueScottplotView.Plot.YAxis.Layout(-5); + + //渲染波形 + RedScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.LeftDeviceDataArray.Max()); + RedScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.LeftDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + RedScottplotView.Plot.AxisAuto(); + RedScottplotView.Refresh(); + + BlueScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.RightDeviceDataArray.Max()); + BlueScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.RightDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + BlueScottplotView.Plot.AxisAuto(); + BlueScottplotView.Refresh(); + } + } +} \ No newline at end of file diff --git a/Correlator/Image/mfcc_demo.jpg b/Correlator/Image/mfcc_demo.jpg new file mode 100644 index 0000000..380d6b6 --- /dev/null +++ b/Correlator/Image/mfcc_demo.jpg Binary files differ diff --git a/Correlator/ViewModels/MainWindowViewModel.cs b/Correlator/ViewModels/MainWindowViewModel.cs index f52e502..56ddb10 100644 --- a/Correlator/ViewModels/MainWindowViewModel.cs +++ b/Correlator/ViewModels/MainWindowViewModel.cs @@ -769,7 +769,7 @@ return; } - _dialogService.Show("NoiseWaveView", null, delegate { }); + _dialogService.Show("NoiseWaveDialog", null, delegate { }); } private void OpenNumericKeypad() diff --git a/Correlator/ViewModels/NoiseWaveViewViewModel.cs b/Correlator/ViewModels/NoiseWaveViewViewModel.cs index c319c4b..71f43d2 100644 --- a/Correlator/ViewModels/NoiseWaveViewViewModel.cs +++ b/Correlator/ViewModels/NoiseWaveViewViewModel.cs @@ -1,10 +1,11 @@ using System; +using System.Windows.Media.Imaging; using Prism.Mvvm; using Prism.Services.Dialogs; namespace Correlator.ViewModels { - public class NoiseWaveViewViewModel : BindableBase, IDialogAware + public class NoiseWaveDialogViewModel : BindableBase, IDialogAware { /// /// 空实现 @@ -19,6 +20,30 @@ public string Title => "传感器原始数据波形"; + private BitmapImage _redBitmapImage; + + public BitmapImage RedBitmapImage + { + get => _redBitmapImage; + set + { + _redBitmapImage = value; + RaisePropertyChanged(); + } + } + + private BitmapImage _blueBitmapImage; + + public BitmapImage BlueBitmapImage + { + get => _blueBitmapImage; + set + { + _blueBitmapImage = value; + RaisePropertyChanged(); + } + } + #endregion public bool CanCloseDialog() @@ -32,6 +57,8 @@ public void OnDialogOpened(IDialogParameters parameters) { + RedBitmapImage = new BitmapImage(new Uri(@"..\..\Image\mfcc_demo.jpg", UriKind.Relative)); + BlueBitmapImage = new BitmapImage(new Uri(@"..\..\Image\mfcc_demo.jpg", UriKind.Relative)); } } } \ No newline at end of file diff --git a/Correlator/Views/NoiseWaveView.xaml b/Correlator/Views/NoiseWaveView.xaml deleted file mode 100644 index c074d1d..0000000 --- a/Correlator/Views/NoiseWaveView.xaml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Correlator/App.xaml.cs b/Correlator/App.xaml.cs index ae11086..5fd331e 100644 --- a/Correlator/App.xaml.cs +++ b/Correlator/App.xaml.cs @@ -105,7 +105,7 @@ containerRegistry.RegisterDialog(); 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 92a9c69..9f7b81d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -189,22 +189,22 @@ Designer - - + + - + - - + + - + - + @@ -231,33 +231,33 @@ EditSoundSpeedDialog.xaml - - ImageFileExplorerDialog.xaml - + + ImageFileExplorerDialog.xaml + ImportHydrophoneDataDialog.xaml LoadingDialog.xaml + + NoiseWaveDialog.xaml + SoundSampleRateDialog.xaml - - - + + + - + - - - - - - NoiseWaveView.xaml - + + + + NumericKeypadDialog.xaml @@ -306,7 +306,7 @@ - + @@ -320,29 +320,29 @@ - + Designer MSBuild:Compile - + - + Designer MSBuild:Compile - - + + Designer + + + Designer MSBuild:Compile - - Designer - @@ -466,7 +466,10 @@ - + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml b/Correlator/Dialog/NoiseWaveDialog.xaml new file mode 100644 index 0000000..dddec77 --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Correlator/Dialog/NoiseWaveDialog.xaml.cs b/Correlator/Dialog/NoiseWaveDialog.xaml.cs new file mode 100644 index 0000000..bd9985a --- /dev/null +++ b/Correlator/Dialog/NoiseWaveDialog.xaml.cs @@ -0,0 +1,52 @@ +using System.Drawing; +using System.Linq; +using System.Windows.Controls; +using Correlator.Util; + +namespace Correlator.Dialog +{ + public partial class NoiseWaveDialog : UserControl + { + public NoiseWaveDialog() + { + InitializeComponent(); + + //禁用XY缩放 + RedScottplotView.Configuration.LockHorizontalAxis = true; + RedScottplotView.Configuration.LockVerticalAxis = true; + RedScottplotView.Configuration.ScrollWheelZoom = false; + RedScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + RedScottplotView.Plot.Grid(false); + //四周边距 + RedScottplotView.Plot.YAxis.Layout(-5); + + // ###################################################################################### + + //禁用XY缩放 + BlueScottplotView.Configuration.LockHorizontalAxis = true; + BlueScottplotView.Configuration.LockVerticalAxis = true; + BlueScottplotView.Configuration.ScrollWheelZoom = false; + BlueScottplotView.Configuration.RightClickDragZoom = false; + //去掉网格线 + BlueScottplotView.Plot.Grid(false); + //四周边距 + BlueScottplotView.Plot.YAxis.Layout(-5); + + //渲染波形 + RedScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.LeftDeviceDataArray.Max()); + RedScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.LeftDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + RedScottplotView.Plot.AxisAuto(); + RedScottplotView.Refresh(); + + BlueScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.RightDeviceDataArray.Max()); + BlueScottplotView.Plot.AddSignal( + RuntimeCache.CorrelatorData.RightDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) + ); + BlueScottplotView.Plot.AxisAuto(); + BlueScottplotView.Refresh(); + } + } +} \ No newline at end of file diff --git a/Correlator/Image/mfcc_demo.jpg b/Correlator/Image/mfcc_demo.jpg new file mode 100644 index 0000000..380d6b6 --- /dev/null +++ b/Correlator/Image/mfcc_demo.jpg Binary files differ diff --git a/Correlator/ViewModels/MainWindowViewModel.cs b/Correlator/ViewModels/MainWindowViewModel.cs index f52e502..56ddb10 100644 --- a/Correlator/ViewModels/MainWindowViewModel.cs +++ b/Correlator/ViewModels/MainWindowViewModel.cs @@ -769,7 +769,7 @@ return; } - _dialogService.Show("NoiseWaveView", null, delegate { }); + _dialogService.Show("NoiseWaveDialog", null, delegate { }); } private void OpenNumericKeypad() diff --git a/Correlator/ViewModels/NoiseWaveViewViewModel.cs b/Correlator/ViewModels/NoiseWaveViewViewModel.cs index c319c4b..71f43d2 100644 --- a/Correlator/ViewModels/NoiseWaveViewViewModel.cs +++ b/Correlator/ViewModels/NoiseWaveViewViewModel.cs @@ -1,10 +1,11 @@ using System; +using System.Windows.Media.Imaging; using Prism.Mvvm; using Prism.Services.Dialogs; namespace Correlator.ViewModels { - public class NoiseWaveViewViewModel : BindableBase, IDialogAware + public class NoiseWaveDialogViewModel : BindableBase, IDialogAware { /// /// 空实现 @@ -19,6 +20,30 @@ public string Title => "传感器原始数据波形"; + private BitmapImage _redBitmapImage; + + public BitmapImage RedBitmapImage + { + get => _redBitmapImage; + set + { + _redBitmapImage = value; + RaisePropertyChanged(); + } + } + + private BitmapImage _blueBitmapImage; + + public BitmapImage BlueBitmapImage + { + get => _blueBitmapImage; + set + { + _blueBitmapImage = value; + RaisePropertyChanged(); + } + } + #endregion public bool CanCloseDialog() @@ -32,6 +57,8 @@ public void OnDialogOpened(IDialogParameters parameters) { + RedBitmapImage = new BitmapImage(new Uri(@"..\..\Image\mfcc_demo.jpg", UriKind.Relative)); + BlueBitmapImage = new BitmapImage(new Uri(@"..\..\Image\mfcc_demo.jpg", UriKind.Relative)); } } } \ No newline at end of file diff --git a/Correlator/Views/NoiseWaveView.xaml b/Correlator/Views/NoiseWaveView.xaml deleted file mode 100644 index c074d1d..0000000 --- a/Correlator/Views/NoiseWaveView.xaml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Correlator/Views/NoiseWaveView.xaml.cs b/Correlator/Views/NoiseWaveView.xaml.cs deleted file mode 100644 index 779938d..0000000 --- a/Correlator/Views/NoiseWaveView.xaml.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Drawing; -using System.Linq; -using System.Windows.Controls; -using Correlator.Util; - -namespace Correlator.Views -{ - public partial class NoiseWaveView : UserControl - { - public NoiseWaveView() - { - InitializeComponent(); - - //禁用XY缩放 - RedScottplotView.Configuration.LockHorizontalAxis = true; - RedScottplotView.Configuration.LockVerticalAxis = true; - RedScottplotView.Configuration.ScrollWheelZoom = false; - RedScottplotView.Configuration.RightClickDragZoom = false; - //去掉网格线 - RedScottplotView.Plot.Grid(false); - //四周边距 - RedScottplotView.Plot.YAxis.Layout(-5); - - // ###################################################################################### - - //禁用XY缩放 - BlueScottplotView.Configuration.LockHorizontalAxis = true; - BlueScottplotView.Configuration.LockVerticalAxis = true; - BlueScottplotView.Configuration.ScrollWheelZoom = false; - BlueScottplotView.Configuration.RightClickDragZoom = false; - //去掉网格线 - BlueScottplotView.Plot.Grid(false); - //四周边距 - BlueScottplotView.Plot.YAxis.Layout(-5); - - //渲染波形 - RedScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.LeftDeviceDataArray.Max()); - RedScottplotView.Plot.AddSignal( - RuntimeCache.CorrelatorData.LeftDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) - ); - RedScottplotView.Plot.AxisAuto(); - RedScottplotView.Refresh(); - - BlueScottplotView.Plot.SetAxisLimits(0, 3500, 0, RuntimeCache.CorrelatorData.RightDeviceDataArray.Max()); - BlueScottplotView.Plot.AddSignal( - RuntimeCache.CorrelatorData.RightDeviceDataArray, color: Color.FromArgb(255, 49, 151, 36) - ); - BlueScottplotView.Plot.AxisAuto(); - BlueScottplotView.Refresh(); - } - } -} \ No newline at end of file