diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index 75beba8..5be7580 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -1,6 +1,6 @@  - + Debug AnyCPU @@ -77,6 +77,9 @@ ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll + + ..\packages\HandyControl.3.3.0\lib\net48\HandyControl.dll + ..\packages\HandyControl.3.3.0\lib\net48\HandyControl.dll @@ -117,66 +120,66 @@ ..\packages\SQLitePCLRaw.provider.dynamic_cdecl.2.0.4\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll - + ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll - - - - - + + + + + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - + ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - + + ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll - + 4.0 - - - + + + MSBuild:Compile Designer - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + AudioFileUserControl.xaml @@ -216,40 +219,40 @@ SoundSpeedUserControl.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PipeRangeWindow.xaml @@ -265,22 +268,22 @@ Designer MSBuild:Compile - - - - - - - - + + + + + + + + Designer MSBuild:Compile - - - - + + + + MSBuild:Compile Designer @@ -296,7 +299,7 @@ MainWindow.xaml Code - + @@ -313,175 +316,175 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - + \ No newline at end of file diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index 75beba8..5be7580 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -1,6 +1,6 @@  - + Debug AnyCPU @@ -77,6 +77,9 @@ ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll + + ..\packages\HandyControl.3.3.0\lib\net48\HandyControl.dll + ..\packages\HandyControl.3.3.0\lib\net48\HandyControl.dll @@ -117,66 +120,66 @@ ..\packages\SQLitePCLRaw.provider.dynamic_cdecl.2.0.4\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll - + ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll - - - - - + + + + + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - + ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - + + ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll - + 4.0 - - - + + + MSBuild:Compile Designer - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + AudioFileUserControl.xaml @@ -216,40 +219,40 @@ SoundSpeedUserControl.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PipeRangeWindow.xaml @@ -265,22 +268,22 @@ Designer MSBuild:Compile - - - - - - - - + + + + + + + + Designer MSBuild:Compile - - - - + + + + MSBuild:Compile Designer @@ -296,7 +299,7 @@ MainWindow.xaml Code - + @@ -313,175 +316,175 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - + \ No newline at end of file diff --git a/Correlator/UserControlPage/FilterUserControl.xaml b/Correlator/UserControlPage/FilterUserControl.xaml index 987d6ad..c654bb0 100644 --- a/Correlator/UserControlPage/FilterUserControl.xaml +++ b/Correlator/UserControlPage/FilterUserControl.xaml @@ -4,8 +4,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converter="clr-namespace:Correlator.Converter" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:gd="clr-namespace:LiveCharts.Geared;assembly=LiveCharts.Geared" - xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="768" @@ -151,6 +149,7 @@ HorizontalAlignment="Right" VerticalAlignment="Top" Background="#224f86" + Command="{Binding StartCollectDataCommand}" Content="开始采集" FontSize="14" Foreground="White" @@ -207,10 +206,12 @@ - @@ -257,21 +258,6 @@ Height="{Binding ElementName=gridContainer, Path=ActualHeight}" Background="Transparent"> - - - - - - - - - - - - - - - @@ -380,10 +366,12 @@ - @@ -417,7 +405,7 @@ Height="200" ClipToBounds="True"> - + Debug AnyCPU @@ -77,6 +77,9 @@ ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll + + ..\packages\HandyControl.3.3.0\lib\net48\HandyControl.dll + ..\packages\HandyControl.3.3.0\lib\net48\HandyControl.dll @@ -117,66 +120,66 @@ ..\packages\SQLitePCLRaw.provider.dynamic_cdecl.2.0.4\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll - + ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll - - - - - + + + + + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - + ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - + + ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll - + 4.0 - - - + + + MSBuild:Compile Designer - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + AudioFileUserControl.xaml @@ -216,40 +219,40 @@ SoundSpeedUserControl.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PipeRangeWindow.xaml @@ -265,22 +268,22 @@ Designer MSBuild:Compile - - - - - - - - + + + + + + + + Designer MSBuild:Compile - - - - + + + + MSBuild:Compile Designer @@ -296,7 +299,7 @@ MainWindow.xaml Code - + @@ -313,175 +316,175 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - + \ No newline at end of file diff --git a/Correlator/UserControlPage/FilterUserControl.xaml b/Correlator/UserControlPage/FilterUserControl.xaml index 987d6ad..c654bb0 100644 --- a/Correlator/UserControlPage/FilterUserControl.xaml +++ b/Correlator/UserControlPage/FilterUserControl.xaml @@ -4,8 +4,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converter="clr-namespace:Correlator.Converter" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:gd="clr-namespace:LiveCharts.Geared;assembly=LiveCharts.Geared" - xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="768" @@ -151,6 +149,7 @@ HorizontalAlignment="Right" VerticalAlignment="Top" Background="#224f86" + Command="{Binding StartCollectDataCommand}" Content="开始采集" FontSize="14" Foreground="White" @@ -207,10 +206,12 @@ - @@ -257,21 +258,6 @@ Height="{Binding ElementName=gridContainer, Path=ActualHeight}" Background="Transparent"> - - - - - - - - - - - - - - - @@ -380,10 +366,12 @@ - @@ -417,7 +405,7 @@ Height="200" ClipToBounds="True"> /// X轴起始频率 @@ -134,26 +135,23 @@ } } - public GearedValues ColumnValuesA { get; set; } = new GearedValues(); - public GearedValues ColumnValuesB { get; set; } = new GearedValues(); + public IChartValues ColumnValuesA { get; set; } = new ChartValues(); + public IChartValues ColumnValuesB { get; set; } = new ChartValues(); #endregion public RelayCommand GoBackCommand { get; set; } - public RelayCommand MouseLeftButtonDownCommand { get; set; } - public RelayCommand MouseMoveCommand { get; set; } - public RelayCommand MouseLeftButtonUpCommand { get; set; } - public RelayCommand MouseLeaveCommand { get; set; } + public RelayCommand StartCollectDataCommand { get; set; } - private readonly DispatcherTimer _statusTimer = new DispatcherTimer(); + private readonly DispatcherTimer _statusTimer = new DispatcherTimer + { + Interval = TimeSpan.FromSeconds(1) + }; public FilterViewModel() { GoBackCommand = new RelayCommand(() => { Messenger.Default.Send("", MessengerToken.RemoveFilter); }); - MouseLeftButtonDownCommand = new RelayCommand(MouseLeftButtonDown); - MouseMoveCommand = new RelayCommand(MouseMove); - MouseLeftButtonUpCommand = new RelayCommand(MouseLeftButtonUp); - MouseLeaveCommand = new RelayCommand(MouseLeave); + StartCollectDataCommand = new RelayCommand(StartCollectData); //默认值 HighValue = 600; @@ -173,8 +171,6 @@ ColumnValuesA.Add(p); } - ColumnValuesA.WithQuality(Quality.Medium); - for (var i = 0; i < 300; i++) { var p = new ObservablePoint @@ -186,10 +182,7 @@ ColumnValuesB.Add(p); } - ColumnValuesB.WithQuality(Quality.Medium); - //每秒查询信号状态 - _statusTimer.Interval = TimeSpan.FromSeconds(1); _statusTimer.Tick += delegate { SensorASignalIntensity = FlowStatus.SensorASignalIntensity; @@ -198,20 +191,66 @@ _statusTimer.Start(); } - private void MouseLeftButtonDown(object sender) + private void StartCollectData() { - } + var collectDataTask = new Task(() => + { + // while (FlowStatus.CanCollectData) + // { + // SenderClass.SendCorrelatorWakeUpCmd(SerialPortManager.Instance.SerialPort); + // Task.Delay(10 * 1000); + // } - private void MouseMove(object sender) - { - } + return true; + }); + collectDataTask.Start(); - private void MouseLeftButtonUp(object sender) - { - } + var getFreWaveTask = new Task(() => + { + // var num = 0; + // + // while (!CorrelatorDataSaveThread.devDataValueMap.ContainsKey(DevCode.Dev1) || + // !CorrelatorDataSaveThread.devDataValueMap.ContainsKey(DevCode.Dev2)) + // { + // Task.Delay(100); + // if (num++ >= 600) + // { + // MessageBox.Show("接收不到数据,请检查设备是否开启", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Error); + // FlowStatus.IsRedCollectComplete = false; + // FlowStatus.IsBlueCollectComplete = false; + // return false; + // } + // } + // + // FlowStatus.CanCollectData = false; //停止下发采集指令 + // FlowStatus.CanGetSignal = true; //开始状态采集指令的发送 + // + // ClassCalculate calculate = ClassCalculate.Instance; + // calculate.Device1 = DevCode.Dev1; + // calculate.Device2 = DevCode.Dev2; + // + // calculate.GetFreWave(); - private void MouseLeave(object sender) - { + FlowStatus.IsRedCollectComplete = true; + FlowStatus.IsBlueCollectComplete = true; + return true; + }); + getFreWaveTask.Start(); + + //显示Loading + + if (collectDataTask.Result && getFreWaveTask.Result) + { + //取消Loading + if (FlowStatus.IsRedCollectComplete && FlowStatus.IsBlueCollectComplete) + { + FlowStatus.IsRedCollectComplete = false; + FlowStatus.IsBlueCollectComplete = false; + + LineRedVisibility = "Visible"; + LineBlueVisibility = "Visible"; + } + } } } } \ No newline at end of file