diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index a5d4326..731cc8d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -260,8 +260,10 @@ SoundSampleRateDialog.xaml + + @@ -281,7 +283,6 @@ SoundSpeedDialog.xaml - diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index a5d4326..731cc8d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -260,8 +260,10 @@ SoundSampleRateDialog.xaml + + @@ -281,7 +283,6 @@ SoundSpeedDialog.xaml - diff --git a/Correlator/DataService/ISerialPortService.cs b/Correlator/DataService/ISerialPortService.cs index 9be2e9e..4ef37f6 100644 --- a/Correlator/DataService/ISerialPortService.cs +++ b/Correlator/DataService/ISerialPortService.cs @@ -41,5 +41,10 @@ /// 水听器模式点数事件 /// event EventHandler CheckResponseEvent; + + /// + /// 水听器分包数据 Index 事件 + /// + event EventHandler ResponseIndexReceivedEvent; } } \ No newline at end of file diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index a5d4326..731cc8d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -260,8 +260,10 @@ SoundSampleRateDialog.xaml + + @@ -281,7 +283,6 @@ SoundSpeedDialog.xaml - diff --git a/Correlator/DataService/ISerialPortService.cs b/Correlator/DataService/ISerialPortService.cs index 9be2e9e..4ef37f6 100644 --- a/Correlator/DataService/ISerialPortService.cs +++ b/Correlator/DataService/ISerialPortService.cs @@ -41,5 +41,10 @@ /// 水听器模式点数事件 /// event EventHandler CheckResponseEvent; + + /// + /// 水听器分包数据 Index 事件 + /// + event EventHandler ResponseIndexReceivedEvent; } } \ No newline at end of file diff --git a/Correlator/DataService/SerialPortServiceImpl.cs b/Correlator/DataService/SerialPortServiceImpl.cs index 7d38620..6cc9b26 100644 --- a/Correlator/DataService/SerialPortServiceImpl.cs +++ b/Correlator/DataService/SerialPortServiceImpl.cs @@ -27,6 +27,7 @@ public event EventHandler DetectNoiseEvent; public event EventHandler StartCalculateEvent; public event EventHandler CheckResponseEvent; + public event EventHandler ResponseIndexReceivedEvent; public SerialPortServiceImpl(IEventAggregator eventAggregator, IAudioService audioService, ICommandService commandService, IApplicationDataService dataService) @@ -156,10 +157,11 @@ { if (receivedData[0] == 0xA3 && receivedData[1] == 0x20) { + //取出seq,确定收到的是第几包数据 int index = receivedData[15]; // "SerialPortServiceImpl".WriteLog($@"index => {index}"); - //取出seq,确定收到的是第几包数据 - RuntimeCache.SeqCaches.Add(index); + var indexEventArgs = new ResponseIndexEventArgs(deviceId, index); + ResponseIndexReceivedEvent?.Invoke(this, indexEventArgs); var response = BitConverter.ToString(receivedData).Replace("-", ""); //收集数据 diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj index a5d4326..731cc8d 100644 --- a/Correlator/Correlator.csproj +++ b/Correlator/Correlator.csproj @@ -260,8 +260,10 @@ SoundSampleRateDialog.xaml + + @@ -281,7 +283,6 @@ SoundSpeedDialog.xaml - diff --git a/Correlator/DataService/ISerialPortService.cs b/Correlator/DataService/ISerialPortService.cs index 9be2e9e..4ef37f6 100644 --- a/Correlator/DataService/ISerialPortService.cs +++ b/Correlator/DataService/ISerialPortService.cs @@ -41,5 +41,10 @@ /// 水听器模式点数事件 /// event EventHandler CheckResponseEvent; + + /// + /// 水听器分包数据 Index 事件 + /// + event EventHandler ResponseIndexReceivedEvent; } } \ No newline at end of file diff --git a/Correlator/DataService/SerialPortServiceImpl.cs b/Correlator/DataService/SerialPortServiceImpl.cs index 7d38620..6cc9b26 100644 --- a/Correlator/DataService/SerialPortServiceImpl.cs +++ b/Correlator/DataService/SerialPortServiceImpl.cs @@ -27,6 +27,7 @@ public event EventHandler DetectNoiseEvent; public event EventHandler StartCalculateEvent; public event EventHandler CheckResponseEvent; + public event EventHandler ResponseIndexReceivedEvent; public SerialPortServiceImpl(IEventAggregator eventAggregator, IAudioService audioService, ICommandService commandService, IApplicationDataService dataService) @@ -156,10 +157,11 @@ { if (receivedData[0] == 0xA3 && receivedData[1] == 0x20) { + //取出seq,确定收到的是第几包数据 int index = receivedData[15]; // "SerialPortServiceImpl".WriteLog($@"index => {index}"); - //取出seq,确定收到的是第几包数据 - RuntimeCache.SeqCaches.Add(index); + var indexEventArgs = new ResponseIndexEventArgs(deviceId, index); + ResponseIndexReceivedEvent?.Invoke(this, indexEventArgs); var response = BitConverter.ToString(receivedData).Replace("-", ""); //收集数据 diff --git a/Correlator/Dialog/CheckResponseDialog.xaml b/Correlator/Dialog/CheckResponseDialog.xaml index a571920..95785ce 100644 --- a/Correlator/Dialog/CheckResponseDialog.xaml +++ b/Correlator/Dialog/CheckResponseDialog.xaml @@ -2,6 +2,7 @@ x:Class="Correlator.Dialog.CheckResponseDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:cvt="clr-namespace:Correlator.Converter" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:hc="https://handyorg.github.io/handycontrol" @@ -16,7 +17,7 @@ + + @@ -71,6 +99,12 @@ + + + + + + @@ -78,11 +112,13 @@