diff --git a/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/.suo b/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/.suo index a615d34..cd4087c 100644 Binary files a/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/.suo and b/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/.suo differ diff --git a/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/DocumentLayout.json b/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/DocumentLayout.json index 3376ea0..e301fb3 100644 --- a/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/DocumentLayout.json +++ b/JiangsuEarthquake/.vs/JiangsuEarthquake/v17/DocumentLayout.json @@ -2,38 +2,54 @@ "Version": 1, "WorkspaceRootPath": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\", "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\viewmodels\\mainviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\viewmodels\\mainviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\viewmodels\\boosterstationstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\viewmodels\\boosterstationstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\views\\systemcontrolview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\views\\systemcontrolview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" }, { - "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", - "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\models\\servermodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\models\\servermodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\viewmodels\\mainviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\viewmodels\\mainviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\models\\clientmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\models\\clientmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\models\\lowercomputermodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\models\\lowercomputermodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\common\\server.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\common\\server.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\base\\command.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\base\\command.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\models\\seismographmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\models\\seismographmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\viewmodels\\systemstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\viewmodels\\systemstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\views\\realtimedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\views\\realtimedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" }, + { + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" + }, + { + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|f:\\code\\jseq\\20240301_jseq_upperpc\\jiangsuearthquake\\jiangsuearthquake\\base\\command.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\base\\command.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\viewmodels\\systemstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\viewmodels\\systemstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\views\\seismometerstatedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\views\\seismometerstatedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" @@ -46,14 +62,6 @@ "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\viewmodels\\seismometerstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\viewmodels\\seismometerstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\viewmodels\\boosterstationstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\viewmodels\\boosterstationstatedataviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\models\\clientmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\models\\clientmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\jiangsuearthquake\\views\\boosterstationstatedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\views\\boosterstationstatedataview.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" @@ -94,11 +102,11 @@ "DocumentGroups": [ { "DockedWidth": 169, - "SelectedChildIndex": 16, + "SelectedChildIndex": 20, "Children": [ { "$type": "Document", - "DocumentIndex": 15, + "DocumentIndex": 17, "Title": "App.config", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\App.config", "RelativeDocumentMoniker": "JiangsuEarthquake\\App.config", @@ -109,22 +117,48 @@ "WhenOpened": "2024-04-24T08:54:53.626Z", "IsPinned": true }, + { + "$type": "Document", + "DocumentIndex": 5, + "Title": "LowerComputerModel.cs", + "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\LowerComputerModel.cs", + "RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\LowerComputerModel.cs", + "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\LowerComputerModel.cs", + "RelativeToolTip": "JiangsuEarthquake\\Models\\LowerComputerModel.cs", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAGMBAAA5AAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-17T02:27:46.939Z", + "EditorCaption": "" + }, { "$type": "Document", "DocumentIndex": 3, + "Title": "ServerModel.cs", + "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\ServerModel.cs", + "RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\ServerModel.cs", + "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\ServerModel.cs", + "RelativeToolTip": "JiangsuEarthquake\\Models\\ServerModel.cs", + "ViewState": "AQIAAHkAAAAAAAAAAAAQwJAAAAAgAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-17T01:54:39.276Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 6, "Title": "Server.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Common\\Server.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Common\\Server.cs", "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Common\\Server.cs", "RelativeToolTip": "JiangsuEarthquake\\Common\\Server.cs", - "ViewState": "AQIAAO8AAAAAAAAAAAAQwAUBAAAdAAAA", + "ViewState": "AQIAAOUAAAAAAAAAAAAzwAkBAAAqAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-05-16T07:49:02.5Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 10, "Title": "Command.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Base\\Command.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Base\\Command.cs", @@ -137,7 +171,7 @@ }, { "$type": "Document", - "DocumentIndex": 8, + "DocumentIndex": 12, "Title": "SeismometerStateDataView.xaml", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SeismometerStateDataView.xaml", "RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\SeismometerStateDataView.xaml", @@ -149,7 +183,7 @@ }, { "$type": "Document", - "DocumentIndex": 10, + "DocumentIndex": 14, "Title": "SeismometerStateDataViewModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\SeismometerStateDataViewModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\SeismometerStateDataViewModel.cs", @@ -162,7 +196,7 @@ }, { "$type": "Document", - "DocumentIndex": 9, + "DocumentIndex": 13, "Title": "SystemControlView.xaml.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SystemControlView.xaml.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\SystemControlView.xaml.cs", @@ -175,20 +209,20 @@ }, { "$type": "Document", - "DocumentIndex": 11, + "DocumentIndex": 1, "Title": "BoosterStationStateDataViewModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs", "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs", "RelativeToolTip": "JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs", - "ViewState": "AQIAAO8BAAAAAAAAAAAqwAYCAAA6AAAA", + "ViewState": "AQIAAH8AAAAAAAAAAAAAAEUBAAAwAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-05-14T00:25:10.523Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 13, + "DocumentIndex": 15, "Title": "BoosterStationStateDataView.xaml", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\BoosterStationStateDataView.xaml", "RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\BoosterStationStateDataView.xaml", @@ -200,7 +234,7 @@ }, { "$type": "Document", - "DocumentIndex": 14, + "DocumentIndex": 16, "Title": "CSVDownload.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Common\\CSVDownload.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Common\\CSVDownload.cs", @@ -213,7 +247,7 @@ }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 9, "Title": "MainWindow.xaml", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\MainWindow.xaml", "RelativeDocumentMoniker": "JiangsuEarthquake\\MainWindow.xaml", @@ -225,7 +259,7 @@ }, { "$type": "Document", - "DocumentIndex": 17, + "DocumentIndex": 19, "Title": "AlarmRecordViewModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\AlarmRecordViewModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\AlarmRecordViewModel.cs", @@ -237,7 +271,7 @@ }, { "$type": "Document", - "DocumentIndex": 18, + "DocumentIndex": 20, "Title": "EarthQuakeParaSetModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs", @@ -249,7 +283,7 @@ }, { "$type": "Document", - "DocumentIndex": 20, + "DocumentIndex": 22, "Title": "DBHelper.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\DataAccess\\DBHelper.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\DataAccess\\DBHelper.cs", @@ -261,7 +295,7 @@ }, { "$type": "Document", - "DocumentIndex": 16, + "DocumentIndex": 18, "Title": "VolCurCollectorModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\VolCurCollectorModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\VolCurCollectorModel.cs", @@ -273,7 +307,7 @@ }, { "$type": "Document", - "DocumentIndex": 6, + "DocumentIndex": 11, "Title": "SystemStateDataViewModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\SystemStateDataViewModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\SystemStateDataViewModel.cs", @@ -286,7 +320,7 @@ }, { "$type": "Document", - "DocumentIndex": 19, + "DocumentIndex": 21, "Title": "Tools.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Common\\Tools.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Common\\Tools.cs", @@ -298,19 +332,7 @@ }, { "$type": "Document", - "DocumentIndex": 0, - "Title": "SystemControlView.xaml", - "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SystemControlView.xaml", - "RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\SystemControlView.xaml", - "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SystemControlView.xaml", - "RelativeToolTip": "JiangsuEarthquake\\Views\\SystemControlView.xaml", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", - "WhenOpened": "2024-05-09T08:34:40.529Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 12, + "DocumentIndex": 4, "Title": "ClientModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\ClientModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\ClientModel.cs", @@ -324,32 +346,44 @@ { "$type": "Document", "DocumentIndex": 2, + "Title": "SystemControlView.xaml", + "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SystemControlView.xaml", + "RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\SystemControlView.xaml", + "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SystemControlView.xaml", + "RelativeToolTip": "JiangsuEarthquake\\Views\\SystemControlView.xaml", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", + "WhenOpened": "2024-05-09T08:34:40.529Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, "Title": "MainViewModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\MainViewModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\MainViewModel.cs", "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\MainViewModel.cs", "RelativeToolTip": "JiangsuEarthquake\\ViewModels\\MainViewModel.cs", - "ViewState": "AQIAACkAAAAAAAAAAAAUwEQFAAAAAAAA", + "ViewState": "AQIAAIMKAAAAAAAAAAAgwKcKAABHAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-03-12T06:03:03.53Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 7, "Title": "SeismographModel.cs", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\SeismographModel.cs", "RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\SeismographModel.cs", "ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\SeismographModel.cs", "RelativeToolTip": "JiangsuEarthquake\\Models\\SeismographModel.cs", - "ViewState": "AQIAABkAAAAAAAAAAAAkwDoAAAAJAAAA", + "ViewState": "AQIAAEICAAAAAAAAAAAkwCsDAABVAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-05-14T07:44:15.338Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 7, + "DocumentIndex": 8, "Title": "RealTimeDataView.xaml", "DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\RealTimeDataView.xaml", "RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\RealTimeDataView.xaml", diff --git a/JiangsuEarthquake/JiangsuEarthquake/Common/Server.cs b/JiangsuEarthquake/JiangsuEarthquake/Common/Server.cs index a7bf846..b73577b 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/Common/Server.cs +++ b/JiangsuEarthquake/JiangsuEarthquake/Common/Server.cs @@ -249,7 +249,7 @@ namespace JiangsuEarthquake.Common /// 向所有在线的客户端发送信息. /// /// 发送的byte[] - public void SendToAll(byte[] SendData) + public bool SendToAll(byte[] SendData) { try { @@ -258,10 +258,13 @@ namespace JiangsuEarthquake.Common if (item != null) SendToClient(item.Ip, SendData); }); + + return true; } catch (Exception ex) { - //Console.Write(ex.Message); + Console.Write(ex.Message); + return false; } } diff --git a/JiangsuEarthquake/JiangsuEarthquake/Models/LowerComputerModel.cs b/JiangsuEarthquake/JiangsuEarthquake/Models/LowerComputerModel.cs index 827a47a..0365f00 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/Models/LowerComputerModel.cs +++ b/JiangsuEarthquake/JiangsuEarthquake/Models/LowerComputerModel.cs @@ -52,11 +52,24 @@ namespace JiangsuEarthquake.Models //CRC校验失败 if (checkCodeCRC != byteList[^1]) { - //发送失败信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + try + { + //发送失败信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + } + catch + { + + } return; } @@ -77,11 +90,24 @@ namespace JiangsuEarthquake.Models byteLength = BitConverter.ToInt16(new byte[] { byteList[3], byteList[2] }, 0); if(byteLength!=106) //长度校验失败 { - //发送失败信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + try + { + //发送失败信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + } + catch + { + + } } if (byteList[7] == 0x00) //数据类型(0-hex格式,1-string) @@ -99,19 +125,46 @@ namespace JiangsuEarthquake.Models gestureY = BitConverter.ToSingle(new byte[4] { byteList[27], byteList[26], byteList[25], byteList[24] }, 0); gestureZ = BitConverter.ToSingle(new byte[4] { byteList[31], byteList[30], byteList[29], byteList[28] }, 0); - //发送成功信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); + try + { + //发送成功信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); + } + } + catch + { + + } + } catch (Exception ex) { - //发送失败信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + try + { + //发送失败信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + } + catch + { + + } } //数据存储 @@ -134,11 +187,24 @@ namespace JiangsuEarthquake.Models byteLength = BitConverter.ToInt16(new byte[] { byteList[3], byteList[2] }, 0); if (byteLength != 45) //长度校验失败 { - //发送失败信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + try + { + //发送失败信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + } + catch + { + + } } try @@ -206,19 +272,45 @@ namespace JiangsuEarthquake.Models voltage121 = BitConverter.ToSingle(new byte[] { byteList[18], byteList[17], byteList[16], byteList[15] }, 0); voltage122 = BitConverter.ToSingle(new byte[] { byteList[18], byteList[17], byteList[16], byteList[15] }, 0); - //发送成功信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); + try + { + //发送成功信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x01).ToArray()); + } + } + catch + { + + } } catch(Exception ex) { - //发送失败信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + try + { + //发送失败信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + } + catch + { + + } } //数据存储 @@ -231,11 +323,24 @@ namespace JiangsuEarthquake.Models byteLength = BitConverter.ToInt16(new byte[] { byteList[3], byteList[2] }, 0); if (byteLength != 8) //长度校验失败 { - //发送失败信息 - if (id == 1) - MainWindow.mainViewModel.serverModel1.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); - else if (id == 2) - MainWindow.mainViewModel.serverModel2.SendMess(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + try + { + //发送失败信息 + if (id == 1) + { + if (MainWindow.mainViewModel.serverModel1 != null && MainWindow.mainViewModel.serverModel1.IsOpened) + MainWindow.mainViewModel.serverModel1.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + else if (id == 2) + { + if (MainWindow.mainViewModel.serverModel2 != null && MainWindow.mainViewModel.serverModel2.IsOpened) + MainWindow.mainViewModel.serverModel2.SendMessage(ServerReplyData(byteList[5], byteList[6], 0x00).ToArray()); + } + } + catch + { + + } } List SendData = new List(); diff --git a/JiangsuEarthquake/JiangsuEarthquake/Models/SeismographModel.cs b/JiangsuEarthquake/JiangsuEarthquake/Models/SeismographModel.cs index 25d89ba..5f30271 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/Models/SeismographModel.cs +++ b/JiangsuEarthquake/JiangsuEarthquake/Models/SeismographModel.cs @@ -642,6 +642,7 @@ namespace JiangsuEarthquake.Models MainWindow.mainViewModel.timerOpenSetMsgHidden.Start(); MainWindow.mainViewModel.OpenSetMsgForeground = new SolidColorBrush(Colors.Green); MainWindow.mainViewModel.timerSeisZeroSetStart.Stop(); + MainWindow.mainViewModel.ImageSourceSetZero = (ImageSource)Application.Current.FindResource("DeviceOn"); MainWindow.mainViewModel.SeisZeroSetStartButtonIsEnabled = true; MainWindow.mainViewModel.SeisZeroSetStopButtonIsEnabled = true; } @@ -658,6 +659,7 @@ namespace JiangsuEarthquake.Models MainWindow.mainViewModel.timerCloseSetMsgHidden.Start(); MainWindow.mainViewModel.CloseSetMsgForeground = new SolidColorBrush(Colors.Green); MainWindow.mainViewModel.timerSeisZeroSetStop.Stop(); + MainWindow.mainViewModel.ImageSourceSetZero = (ImageSource)Application.Current.FindResource("DeviceOff"); MainWindow.mainViewModel.SeisZeroSetStopButtonIsEnabled = true; MainWindow.mainViewModel.SeisZeroSetStartButtonIsEnabled = true; } @@ -788,6 +790,7 @@ namespace JiangsuEarthquake.Models MainWindow.mainViewModel.timerOpenSetMsgHidden.Start(); MainWindow.mainViewModel.OpenSetMsgForeground = new SolidColorBrush(Colors.Green); MainWindow.mainViewModel.timerSeisLevelSetStart.Stop(); + MainWindow.mainViewModel.ImageSourceSetLevel = (ImageSource)Application.Current.FindResource("DeviceOn"); MainWindow.mainViewModel.SeisLevelSetStartButtonIsEnabled = true; MainWindow.mainViewModel.SeisLevelSetStopButtonIsEnabled = true; } @@ -804,6 +807,7 @@ namespace JiangsuEarthquake.Models MainWindow.mainViewModel.timerCloseSetMsgHidden.Start(); MainWindow.mainViewModel.CloseSetMsgForeground = new SolidColorBrush(Colors.Green); MainWindow.mainViewModel.timerSeisLevelSetStop.Stop(); + MainWindow.mainViewModel.ImageSourceSetLevel = (ImageSource)Application.Current.FindResource("DeviceOff"); MainWindow.mainViewModel.SeisLevelSetStopButtonIsEnabled = true; MainWindow.mainViewModel.SeisLevelSetStartButtonIsEnabled = true; } diff --git a/JiangsuEarthquake/JiangsuEarthquake/Models/ServerModel.cs b/JiangsuEarthquake/JiangsuEarthquake/Models/ServerModel.cs index 127532b..dbdb420 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/Models/ServerModel.cs +++ b/JiangsuEarthquake/JiangsuEarthquake/Models/ServerModel.cs @@ -140,12 +140,21 @@ namespace JiangsuEarthquake.Models /// /// 推送消息 /// - public void SendMess(byte[] SendData) + public bool SendMessage(byte[] SendData) { - Task.Factory.StartNew(new Action(() => + bool result = false; + try { - _server.SendToAll(SendData); - })); + Task.Factory.StartNew(new Action(() => + { + result = _server.SendToAll(SendData); + })); + } + catch + { + result = false; + } + return result; } } } diff --git a/JiangsuEarthquake/JiangsuEarthquake/ViewModels/BoosterStationStateDataViewModel.cs b/JiangsuEarthquake/JiangsuEarthquake/ViewModels/BoosterStationStateDataViewModel.cs index d047c68..a4fbe7c 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/ViewModels/BoosterStationStateDataViewModel.cs +++ b/JiangsuEarthquake/JiangsuEarthquake/ViewModels/BoosterStationStateDataViewModel.cs @@ -323,6 +323,8 @@ namespace JiangsuEarthquake.ViewModels } #endregion + public BoosterStationStateDataViewModel() + { } public BoosterStationStateDataViewModel(int id) { diff --git a/JiangsuEarthquake/JiangsuEarthquake/ViewModels/MainViewModel.cs b/JiangsuEarthquake/JiangsuEarthquake/ViewModels/MainViewModel.cs index 47b21a8..79abc09 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/ViewModels/MainViewModel.cs +++ b/JiangsuEarthquake/JiangsuEarthquake/ViewModels/MainViewModel.cs @@ -187,6 +187,24 @@ namespace JiangsuEarthquake.ViewModels public DispatcherTimer timerMainSeis2ConnectMsgHidden = new DispatcherTimer(); public DispatcherTimer timerBackupSeis2ConnectMsgHidden = new DispatcherTimer(); + + public DispatcherTimer timerBaseStationMsgHidden = new DispatcherTimer(); + + public DispatcherTimer timerMainSeisMsgHidden = new DispatcherTimer(); + + public DispatcherTimer timerBackupSeisMsgHidden = new DispatcherTimer(); + + public DispatcherTimer timerBaseStationPowerOn = new DispatcherTimer(); + + public DispatcherTimer timerBaseStationPowerOff = new DispatcherTimer(); + + public DispatcherTimer timerMainSeisPowerOn = new DispatcherTimer(); + + public DispatcherTimer timerMainSeisPowerOff = new DispatcherTimer(); + + public DispatcherTimer timerBackupSeisPowerOn = new DispatcherTimer(); + + public DispatcherTimer timerBackupSeisPowerOff = new DispatcherTimer(); #endregion @@ -403,6 +421,33 @@ namespace JiangsuEarthquake.ViewModels timerBackupSeis2ConnectMsgHidden.Interval = TimeSpan.FromSeconds(2); timerBackupSeis2ConnectMsgHidden.Tick += TimerBackupSeis2ConnectMsgHidden_Tick; + + timerBaseStationMsgHidden.Interval = TimeSpan.FromSeconds(2); + timerBaseStationMsgHidden.Tick += TimerBaseStationMsgHidden_Tick; + + timerMainSeisMsgHidden.Interval = TimeSpan.FromSeconds(2); + timerMainSeisMsgHidden.Tick += TimerMainSeisMsgHidden_Tick; + + timerBackupSeisMsgHidden.Interval = TimeSpan.FromSeconds(2); + timerBackupSeisMsgHidden.Tick += TimerBackupSeisMsgHidden_Tick; + + timerBaseStationPowerOn.Interval = TimeSpan.FromSeconds(20); + timerBaseStationPowerOn.Tick += TimerBaseStationPowerOn_Tick; + + timerBaseStationPowerOff.Interval = TimeSpan.FromSeconds(20); + timerBaseStationPowerOff.Tick += TimerBaseStationPowerOff_Tick; + + timerMainSeisPowerOn.Interval = TimeSpan.FromSeconds(20); + timerMainSeisPowerOn.Tick += TimerMainSeisPowerOn_Tick; + + timerMainSeisPowerOff.Interval = TimeSpan.FromSeconds(20); + timerMainSeisPowerOff.Tick += TimerMainSeisPowerOff_Tick; + + timerBackupSeisPowerOn.Interval = TimeSpan.FromSeconds(20); + timerBackupSeisPowerOn.Tick += TimerBackupSeisPowerOn_Tick; + + timerBackupSeisPowerOff.Interval = TimeSpan.FromSeconds(20); + timerBackupSeisPowerOff.Tick += TimerBackupSeisPowerOff_Tick; #endregion @@ -1942,16 +1987,129 @@ namespace JiangsuEarthquake.ViewModels #endregion - List sendDataSeis = new List(); - - private byte[] checkCode { get; set; } = new byte[2]; //从CMD到DATA结束的CRC16校验和 - - private List checkByte { get; set; } = new List(); //校验码Byte - - #region Remote Control #region BaseStation Set + private void TimerBaseStationPowerOn_Tick(object sender, EventArgs e) + { + if (!BaseStationPowerOnIsReceived) + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "开启海底基站电源发送成功,但未接收到数据!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + } + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerBaseStationPowerOff_Tick(object sender, EventArgs e) + { + if (!BaseStationPowerOffIsReceived) + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "关闭海底基站电源发送成功,但未接收到数据!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + } + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerMainSeisPowerOn_Tick(object sender, EventArgs e) + { + if (!MainSeisPowerOnIsReceived) + { + MainSeisMsgVisibility = Visibility.Visible; + MainSeisMsg = "开启主地震仪电源发送成功,但未接收到数据!"; + timerMainSeisMsgHidden.Start(); + MainSeisMsgForeground = new SolidColorBrush(Colors.Red); + MainSeisPowerOpenBtnIsEnabled = true; + MainSeisPowerCloseBtnIsEnabled = true; + } + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerMainSeisPowerOff_Tick(object sender, EventArgs e) + { + if (!MainSeisPowerOffIsReceived) + { + MainSeisMsgVisibility = Visibility.Visible; + MainSeisMsg = "关闭主地震仪电源发送成功,但未接收到数据!"; + timerMainSeisMsgHidden.Start(); + MainSeisMsgForeground = new SolidColorBrush(Colors.Red); + MainSeisPowerOpenBtnIsEnabled = true; + MainSeisPowerCloseBtnIsEnabled = true; + } + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerBackupSeisPowerOn_Tick(object sender, EventArgs e) + { + if (!BackupSeisPowerOnIsReceived) + { + BackupSeisMsgVisibility = Visibility.Visible; + BackupSeisMsg = "开启备地震仪电源发送成功,但未接收到数据!"; + timerBackupSeisMsgHidden.Start(); + BackupSeisMsgForeground = new SolidColorBrush(Colors.Red); + BackupSeisPowerOpenBtnIsEnabled = true; + BackupSeisPowerCloseBtnIsEnabled = true; + } + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerBackupSeisPowerOff_Tick(object sender, EventArgs e) + { + if (!BackupSeisPowerOffIsReceived) + { + BackupSeisMsgVisibility = Visibility.Visible; + BackupSeisMsg = "关闭备地震仪电源发送成功,但未接收到数据!"; + timerBackupSeisMsgHidden.Start(); + BackupSeisMsgForeground = new SolidColorBrush(Colors.Red); + BackupSeisPowerOpenBtnIsEnabled = true; + BackupSeisPowerCloseBtnIsEnabled = true; + } + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerBaseStationMsgHidden_Tick(object sender, EventArgs e) + { + BaseStationMsgVisibility = Visibility.Hidden; + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerMainSeisMsgHidden_Tick(object sender, EventArgs e) + { + MainSeisMsgVisibility = Visibility.Hidden; + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + + private void TimerBackupSeisMsgHidden_Tick(object sender, EventArgs e) + { + BackupSeisMsgVisibility = Visibility.Hidden; + + // 停止定时器 + (sender as DispatcherTimer).Stop(); + } + private Brush baseStationPowerBackground = new SolidColorBrush(Colors.Red); public Brush BaseStationPowerBackground @@ -1960,6 +2118,14 @@ namespace JiangsuEarthquake.ViewModels set { baseStationPowerBackground = value; this.DoNotify(); } } + private ImageSource imageSourceBaseStation = (ImageSource)Application.Current.FindResource("DeviceOff"); + + public ImageSource ImageSourceBaseStation + { + get { return imageSourceBaseStation; } + set { imageSourceBaseStation = value; this.DoNotify(); } + } + private string baseStationMsg; public string BaseStationMsg @@ -1992,6 +2158,14 @@ namespace JiangsuEarthquake.ViewModels set { mainSeisPowerBackground = value; this.DoNotify(); } } + private ImageSource imageSourceMainSeis = (ImageSource)Application.Current.FindResource("DeviceOff"); + + public ImageSource ImageSourceMainSeis + { + get { return imageSourceMainSeis; } + set { imageSourceMainSeis = value; this.DoNotify(); } + } + private string mainSeisMsg; public string MainSeisMsg @@ -2024,6 +2198,14 @@ namespace JiangsuEarthquake.ViewModels set { backupSeisPowerBackground = value; this.DoNotify(); } } + private ImageSource imageSourceBackupSeis = (ImageSource)Application.Current.FindResource("DeviceOff"); + + public ImageSource ImageSourceBackupSeis + { + get { return imageSourceBackupSeis; } + set { imageSourceBackupSeis = value; this.DoNotify(); } + } + private string backupSeisMsg; public string BackupSeisMsg @@ -2048,6 +2230,54 @@ namespace JiangsuEarthquake.ViewModels set { backupSeisMsgVisibility = value; this.DoNotify(); } } + private bool baseStationPowerOnIsReceived = false; + + public bool BaseStationPowerOnIsReceived + { + get { return baseStationPowerOnIsReceived; } + set { baseStationPowerOnIsReceived = value; this.DoNotify(); } + } + + private bool baseStationPowerOffIsReceived = false; + + public bool BaseStationPowerOffIsReceived + { + get { return baseStationPowerOffIsReceived; } + set { baseStationPowerOffIsReceived = value; this.DoNotify(); } + } + + private bool mainSeisPowerOnIsReceived = false; + + public bool MainSeisPowerOnIsReceived + { + get { return mainSeisPowerOnIsReceived; } + set { mainSeisPowerOnIsReceived = value; this.DoNotify(); } + } + + private bool mainSeisPowerOffIsReceived = false; + + public bool MainSeisPowerOffIsReceived + { + get { return mainSeisPowerOffIsReceived; } + set { mainSeisPowerOffIsReceived = value; this.DoNotify(); } + } + + private bool backupSeisPowerOnIsReceived = false; + + public bool BackupSeisPowerOnIsReceived + { + get { return backupSeisPowerOnIsReceived; } + set { backupSeisPowerOnIsReceived = value; this.DoNotify(); } + } + + private bool backupSeisPowerOffIsReceived = false; + + public bool BackupSeisPowerOffIsReceived + { + get { return backupSeisPowerOffIsReceived; } + set { backupSeisPowerOffIsReceived = value; this.DoNotify(); } + } + private bool baseStationPowerOpenBtnIsEnabled = true; public bool BaseStationPowerOpenBtnIsEnabled @@ -2095,7 +2325,6 @@ namespace JiangsuEarthquake.ViewModels get { return backupSeisPowerCloseBtnIsEnabled; } set { backupSeisPowerCloseBtnIsEnabled = value; this.DoNotify(); } } - #endregion @@ -2204,6 +2433,14 @@ namespace JiangsuEarthquake.ViewModels set { openSetMsgForeground = value; this.DoNotify(); } } + private ImageSource imageSourceSetZero = (ImageSource)Application.Current.FindResource("DeviceOff"); + + public ImageSource ImageSourceSetZero + { + get { return imageSourceSetZero; } + set { imageSourceSetZero = value; this.DoNotify(); } + } + private Visibility openSetMsgVisibility = Visibility.Visible; public Visibility OpenSetMsgVisibility @@ -2228,6 +2465,14 @@ namespace JiangsuEarthquake.ViewModels set { closeSetMsgForeground = value; this.DoNotify(); } } + private ImageSource imageSourceSetLevel = (ImageSource)Application.Current.FindResource("DeviceOff"); + + public ImageSource ImageSourceSetLevel + { + get { return imageSourceSetLevel; } + set { imageSourceSetLevel = value; this.DoNotify(); } + } + private Visibility closeSetMsgVisibility = Visibility.Visible; public Visibility CloseSetMsgVisibility @@ -2301,6 +2546,29 @@ namespace JiangsuEarthquake.ViewModels } #endregion + + private List RemoteControl(byte SensorKind, byte SensorId, byte ActionKind, byte ActionType) + { + List sendData = new List(); + + sendData.Clear(); + sendData.AddRange(new byte[] { 0xFE, 0xEF }); // 帧头(H=0xFE 0xEF) + sendData.AddRange(new byte[] { 0x00, 0x09 }); //长度(L=9)(MSH MSL) + sendData.Add(0x00); //地址码(ADDR=00) + sendData.Add(0x03); //功能码(FUNC=03) + sendData.Add(0x01); //操作功能(OPERATION = 0x01) + sendData.Add(SensorKind); //传感器数据类型KIND + sendData.Add(SensorId); //传感器ID + sendData.Add(ActionKind); //动作类型(ACT,0-关闭;1-开启) + sendData.Add(ActionType); //动作种类(0x00-电源,0x01-数据回传) + + byte checkCode = Tools.CheckSum(sendData.ToArray()); + sendData.Add(checkCode); //校验(CS = 帧头 ...+... 批量设置) + sendData.Add(0x16); //结束符(0x16) + + return sendData; + } + //各个开关 public async void Btn_Switch(object o) { @@ -2309,19 +2577,193 @@ namespace JiangsuEarthquake.ViewModels switch (msg[0]) { case "BaseStationPowerPicker": - if(msg[1].Equals("True")) //打开 + if (msg[1].Equals("True")) //打开 { + BaseStationPowerOpenBtnIsEnabled = false; + BaseStationPowerCloseBtnIsEnabled = false; + BaseStationPowerOnIsReceived = false; + List sendDataPower = RemoteControl(0x30, 0x06, 0x01, 0x00); + + bool result = false; + if (station_id == 1) + { + if (serverModel1!=null&&serverModel1.IsOpened) + { + result = serverModel1.SendMessage(sendDataPower.ToArray()); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "通信未连接!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + break; + } + } + else + { + if (serverModel2 != null && serverModel2.IsOpened) + { + result = serverModel2.SendMessage(sendDataPower.ToArray()); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "通信未连接!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + break; + } + } + + if (result) + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "打开海底基站电源发送成功!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Green); + timerBaseStationPowerOn.Start(); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "打开海底基站电源发送失败!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + } } else { + BaseStationPowerOpenBtnIsEnabled = false; + BaseStationPowerCloseBtnIsEnabled = false; + BaseStationPowerOffIsReceived = false; + List sendDataPower = RemoteControl(0x30, 0x06, 0x00, 0x00); + + bool result = false; + if (station_id == 1) + { + if (serverModel1 != null && serverModel1.IsOpened) + { + result = serverModel1.SendMessage(sendDataPower.ToArray()); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "通信未连接!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + break; + } + } + else + { + if (serverModel2 != null && serverModel2.IsOpened) + { + result = serverModel2.SendMessage(sendDataPower.ToArray()); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "通信未连接!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + break; + } + } + + if (result) + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "关闭海底基站电源发送成功!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Green); + timerBaseStationPowerOff.Start(); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "关闭海底基站电源发送失败!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + } } break; case "MainSeisPowerPicker": if (msg[1].Equals("True")) //打开 { + MainSeisPowerOpenBtnIsEnabled = false; + MainSeisPowerCloseBtnIsEnabled = false; + MainSeisPowerOnIsReceived = false; + List sendDataPower = RemoteControl(0x30, 0x06, 0x01, 0x08); + + bool result = false; + if (station_id == 1) + { + if (serverModel1 != null && serverModel1.IsOpened) + { + result = serverModel1.SendMessage(sendDataPower.ToArray()); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "通信未连接!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + break; + } + } + else + { + if (serverModel2 != null && serverModel2.IsOpened) + { + result = serverModel2.SendMessage(sendDataPower.ToArray()); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "通信未连接!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + break; + } + } + + if (result) + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "打开海底基站电源发送成功!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Green); + timerBaseStationPowerOn.Start(); + } + else + { + BaseStationMsgVisibility = Visibility.Visible; + BaseStationMsg = "打开海底基站电源发送失败!"; + timerBaseStationMsgHidden.Start(); + BaseStationMsgForeground = new SolidColorBrush(Colors.Red); + BaseStationPowerOpenBtnIsEnabled = true; + BaseStationPowerCloseBtnIsEnabled = true; + } } else { @@ -2345,10 +2787,14 @@ namespace JiangsuEarthquake.ViewModels SeisZeroSetStopButtonIsEnabled = false; SeisZeroSetStartIsReceived = false; - sendDataSeis.Clear(); - sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC - sendDataSeis.AddRange(new byte[] { 0xA0, 0x50 }); //CMD - sendDataSeis.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + List sendDataSeisZero = new List(); + byte[] checkCodeSeisZero = new byte[2]; + List checkByteSeisZero = new List(); + + sendDataSeisZero.Clear(); + sendDataSeisZero.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC + sendDataSeisZero.AddRange(new byte[] { 0xA0, 0x50 }); //CMD + sendDataSeisZero.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH //地震计号 byte[] numDZJ = new byte[2]; @@ -2368,22 +2814,22 @@ namespace JiangsuEarthquake.ViewModels } numDZJ = Tools.PadArrayWithZeros(numDZJ, 2); - sendDataSeis.AddRange(numDZJ); //DATA - checkByte.Clear(); - checkByte.AddRange(new byte[] { 0xA0, 0x50 }); //CMD - checkByte.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH - checkByte.AddRange(numDZJ); //DATA - checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM - sendDataSeis.AddRange(checkCode); + sendDataSeisZero.AddRange(numDZJ); //DATA + checkByteSeisZero.Clear(); + checkByteSeisZero.AddRange(new byte[] { 0xA0, 0x50 }); //CMD + checkByteSeisZero.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + checkByteSeisZero.AddRange(numDZJ); //DATA + checkCodeSeisZero = Tools.CRCCalc(checkByteSeisZero.ToArray()); //CHK_SUM + sendDataSeisZero.AddRange(checkCodeSeisZero); bool result = false; if (station_id == 1) { if (MainSeisIsChecked) { - if (clientModelMainSeis1.IsConnected&&IsMainSeis1CertSucs) + if (clientModelMainSeis1.IsConnected && IsMainSeis1CertSucs) { - result = clientModelMainSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis1.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2400,7 +2846,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis1.IsConnected && IsBackupSeis1CertSucs) { - result = clientModelBackupSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis1.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2420,7 +2866,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis2.IsConnected && IsMainSeis2CertSucs) { - result = clientModelMainSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis2.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2437,7 +2883,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis2.IsConnected && IsBackupSeis2CertSucs) { - result = clientModelBackupSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis2.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2478,10 +2924,14 @@ namespace JiangsuEarthquake.ViewModels SeisZeroSetStartButtonIsEnabled = false; SeisZeroSetStopIsReceived = false; - sendDataSeis.Clear(); - sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC - sendDataSeis.AddRange(new byte[] { 0xA0, 0x51 }); //CMD - sendDataSeis.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + List sendDataSeisZero = new List(); + byte[] checkCodeSeisZero = new byte[2]; + List checkByteSeisZero = new List(); + + sendDataSeisZero.Clear(); + sendDataSeisZero.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC + sendDataSeisZero.AddRange(new byte[] { 0xA0, 0x51 }); //CMD + sendDataSeisZero.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH //地震计号 byte[] numDZJ = new byte[2]; @@ -2501,13 +2951,13 @@ namespace JiangsuEarthquake.ViewModels } numDZJ = Tools.PadArrayWithZeros(numDZJ, 2); - sendDataSeis.AddRange(numDZJ); //DATA - checkByte.Clear(); - checkByte.AddRange(new byte[] { 0xA0, 0x51 }); //CMD - checkByte.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH - checkByte.AddRange(numDZJ); //DATA - checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM - sendDataSeis.AddRange(checkCode); + sendDataSeisZero.AddRange(numDZJ); //DATA + checkByteSeisZero.Clear(); + checkByteSeisZero.AddRange(new byte[] { 0xA0, 0x51 }); //CMD + checkByteSeisZero.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + checkByteSeisZero.AddRange(numDZJ); //DATA + checkCodeSeisZero = Tools.CRCCalc(checkByteSeisZero.ToArray()); //CHK_SUM + sendDataSeisZero.AddRange(checkCodeSeisZero); bool result = false; if (station_id == 1) @@ -2516,7 +2966,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis1.IsConnected && IsMainSeis1CertSucs) { - result = clientModelMainSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis1.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2533,7 +2983,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis1.IsConnected && IsBackupSeis1CertSucs) { - result = clientModelBackupSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis1.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2553,7 +3003,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis2.IsConnected && IsMainSeis2CertSucs) { - result = clientModelMainSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis2.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2570,7 +3020,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis2.IsConnected && IsBackupSeis2CertSucs) { - result = clientModelBackupSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis2.SendMessage(sendDataSeisZero.ToArray()); } else { @@ -2611,10 +3061,14 @@ namespace JiangsuEarthquake.ViewModels SeisLevelSetStopButtonIsEnabled = false; SeisLevelSetStartIsReceived = false; - sendDataSeis.Clear(); - sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC - sendDataSeis.AddRange(new byte[] { 0xA0, 0x90 }); //CMD - sendDataSeis.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + List sendDataSeisLevel = new List(); + byte[] checkCodeSeisLevel = new byte[2]; + List checkByteSeisLevel = new List(); + + sendDataSeisLevel.Clear(); + sendDataSeisLevel.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC + sendDataSeisLevel.AddRange(new byte[] { 0xA0, 0x90 }); //CMD + sendDataSeisLevel.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH //地震计号 byte[] numDZJ = new byte[2]; @@ -2634,13 +3088,13 @@ namespace JiangsuEarthquake.ViewModels } numDZJ = Tools.PadArrayWithZeros(numDZJ, 2); - sendDataSeis.AddRange(numDZJ); //DATA - checkByte.Clear(); - checkByte.AddRange(new byte[] { 0xA0, 0x90 }); //CMD - checkByte.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH - checkByte.AddRange(numDZJ); //DATA - checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM - sendDataSeis.AddRange(checkCode); + sendDataSeisLevel.AddRange(numDZJ); //DATA + checkByteSeisLevel.Clear(); + checkByteSeisLevel.AddRange(new byte[] { 0xA0, 0x90 }); //CMD + checkByteSeisLevel.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + checkByteSeisLevel.AddRange(numDZJ); //DATA + checkCodeSeisLevel = Tools.CRCCalc(checkByteSeisLevel.ToArray()); //CHK_SUM + sendDataSeisLevel.AddRange(checkCodeSeisLevel); bool result = false; if (station_id == 1) @@ -2649,7 +3103,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis1.IsConnected && IsMainSeis1CertSucs) { - result = clientModelMainSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis1.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -2666,7 +3120,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis1.IsConnected && IsBackupSeis1CertSucs) { - result = clientModelBackupSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis1.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -2686,7 +3140,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis2.IsConnected && IsMainSeis2CertSucs) { - result = clientModelMainSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis2.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -2703,7 +3157,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis2.IsConnected && IsBackupSeis2CertSucs) { - result = clientModelBackupSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis2.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -2744,10 +3198,14 @@ namespace JiangsuEarthquake.ViewModels SeisLevelSetStartButtonIsEnabled = false; SeisLevelSetStopIsReceived = false; - sendDataSeis.Clear(); - sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC - sendDataSeis.AddRange(new byte[] { 0xA0, 0x91 }); //CMD - sendDataSeis.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + List sendDataSeisLevel = new List(); + byte[] checkCodeSeisLevel = new byte[2]; + List checkByteSeisLevel = new List(); + + sendDataSeisLevel.Clear(); + sendDataSeisLevel.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC + sendDataSeisLevel.AddRange(new byte[] { 0xA0, 0x91 }); //CMD + sendDataSeisLevel.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH //地震计号 byte[] numDZJ = new byte[2]; @@ -2767,13 +3225,13 @@ namespace JiangsuEarthquake.ViewModels } numDZJ = Tools.PadArrayWithZeros(numDZJ, 2); - sendDataSeis.AddRange(numDZJ); //DATA - checkByte.Clear(); - checkByte.AddRange(new byte[] { 0xA0, 0x91 }); //CMD - checkByte.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH - checkByte.AddRange(numDZJ); //DATA - checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM - sendDataSeis.AddRange(checkCode); + sendDataSeisLevel.AddRange(numDZJ); //DATA + checkByteSeisLevel.Clear(); + checkByteSeisLevel.AddRange(new byte[] { 0xA0, 0x91 }); //CMD + checkByteSeisLevel.AddRange(new byte[] { 0x00, 0x04 }); //LENGTH + checkByteSeisLevel.AddRange(numDZJ); //DATA + checkCodeSeisLevel = Tools.CRCCalc(checkByteSeisLevel.ToArray()); //CHK_SUM + sendDataSeisLevel.AddRange(checkCodeSeisLevel); bool result = false; if (station_id == 1) @@ -2782,7 +3240,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis1.IsConnected && IsMainSeis1CertSucs) { - result = clientModelMainSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis1.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -2799,7 +3257,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis1.IsConnected && IsBackupSeis1CertSucs) { - result = clientModelBackupSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis1.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -2819,7 +3277,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis2.IsConnected && IsMainSeis2CertSucs) { - result = clientModelMainSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis2.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -2836,7 +3294,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis2.IsConnected && IsBackupSeis2CertSucs) { - result = clientModelBackupSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis2.SendMessage(sendDataSeisLevel.ToArray()); } else { @@ -3018,6 +3476,10 @@ namespace JiangsuEarthquake.ViewModels EarthQuakeParaSetIsSend = false; EarthQuakeParaReadIsSend = false; + List sendDataSeisPara = new List(); + byte[] checkCodeSeisPara = new byte[2]; + List checkByteSeisPara = new List(); + byte[] sationNo = Tools.IntToBytes(int.Parse(msg[1])); //台号 byte[] stationName = Encoding.UTF8.GetBytes(msg[2]); //台站名称 stationName = Tools.PadArrayWithZeros(stationName, 32); @@ -3037,38 +3499,38 @@ namespace JiangsuEarthquake.ViewModels byte[] software_version = BitConverter.GetBytes(short.Parse(msg[11])); //软件版本 software_version = Tools.PadArrayWithZeros(software_version, 32); - sendDataSeis.Clear(); - sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC - sendDataSeis.AddRange(new byte[] { 0xA0, 0x00 }); //CMD - sendDataSeis.AddRange(new byte[] { 0x00, 0x82 }); //LENGTH - sendDataSeis.AddRange(sationNo); - sendDataSeis.AddRange(stationName); - sendDataSeis.AddRange(stationShortName); - sendDataSeis.AddRange(earthQuakeCount); - sendDataSeis.AddRange(channelsNo); - sendDataSeis.AddRange(wd); - sendDataSeis.AddRange(jd); - sendDataSeis.AddRange(gaoCheng); - sendDataSeis.AddRange(startTime); - sendDataSeis.AddRange(stationid); - sendDataSeis.AddRange(software_version); - checkByte.Clear(); - checkByte.AddRange(new byte[] { 0xA0, 0x00 }); //CMD - checkByte.AddRange(new byte[] { 0x00, 0x82 }); //LENGTH - checkByte.AddRange(sationNo); - checkByte.AddRange(stationName); - checkByte.AddRange(stationShortName); - checkByte.AddRange(earthQuakeCount); - checkByte.AddRange(channelsNo); - checkByte.AddRange(wd); - checkByte.AddRange(jd); - checkByte.AddRange(gaoCheng); - checkByte.AddRange(startTime); - checkByte.AddRange(stationid); - checkByte.AddRange(software_version); - checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM + sendDataSeisPara.Clear(); + sendDataSeisPara.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC + sendDataSeisPara.AddRange(new byte[] { 0xA0, 0x00 }); //CMD + sendDataSeisPara.AddRange(new byte[] { 0x00, 0x82 }); //LENGTH + sendDataSeisPara.AddRange(sationNo); + sendDataSeisPara.AddRange(stationName); + sendDataSeisPara.AddRange(stationShortName); + sendDataSeisPara.AddRange(earthQuakeCount); + sendDataSeisPara.AddRange(channelsNo); + sendDataSeisPara.AddRange(wd); + sendDataSeisPara.AddRange(jd); + sendDataSeisPara.AddRange(gaoCheng); + sendDataSeisPara.AddRange(startTime); + sendDataSeisPara.AddRange(stationid); + sendDataSeisPara.AddRange(software_version); + checkByteSeisPara.Clear(); + checkByteSeisPara.AddRange(new byte[] { 0xA0, 0x00 }); //CMD + checkByteSeisPara.AddRange(new byte[] { 0x00, 0x82 }); //LENGTH + checkByteSeisPara.AddRange(sationNo); + checkByteSeisPara.AddRange(stationName); + checkByteSeisPara.AddRange(stationShortName); + checkByteSeisPara.AddRange(earthQuakeCount); + checkByteSeisPara.AddRange(channelsNo); + checkByteSeisPara.AddRange(wd); + checkByteSeisPara.AddRange(jd); + checkByteSeisPara.AddRange(gaoCheng); + checkByteSeisPara.AddRange(startTime); + checkByteSeisPara.AddRange(stationid); + checkByteSeisPara.AddRange(software_version); + checkCodeSeisPara = Tools.CRCCalc(checkByteSeisPara.ToArray()); //CHK_SUM - sendDataSeis.AddRange(checkCode); + sendDataSeisPara.AddRange(checkCodeSeisPara); bool result = false; if (station_id == 1) @@ -3077,7 +3539,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis1.IsConnected && IsMainSeis1CertSucs) { - result = clientModelMainSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis1.SendMessage(sendDataSeisPara.ToArray()); } else { @@ -3094,7 +3556,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis1.IsConnected && IsBackupSeis1CertSucs) { - result = clientModelBackupSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis1.SendMessage(sendDataSeisPara.ToArray()); } else { @@ -3114,7 +3576,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis2.IsConnected && IsMainSeis2CertSucs) { - result = clientModelMainSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis2.SendMessage(sendDataSeisPara.ToArray()); } else { @@ -3131,7 +3593,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis2.IsConnected && IsBackupSeis2CertSucs) { - result = clientModelBackupSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis2.SendMessage(sendDataSeisPara.ToArray()); } else { @@ -3173,10 +3635,14 @@ namespace JiangsuEarthquake.ViewModels EarthQuakeParaSetIsSend = false; EarthQuakeParaReadIsSend = false; - sendDataSeis.Clear(); - sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC - sendDataSeis.AddRange(new byte[] { 0xB0, 0x00 }); //CMD - sendDataSeis.AddRange(new byte[] { 0x00, 0x02 }); //LENGTH + List sendDataSeisParaRead = new List(); + byte[] checkCodeSeisParaRead = new byte[2]; + List checkByteSeisParaRead = new List(); + + sendDataSeisParaRead.Clear(); + sendDataSeisParaRead.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC + sendDataSeisParaRead.AddRange(new byte[] { 0xB0, 0x00 }); //CMD + sendDataSeisParaRead.AddRange(new byte[] { 0x00, 0x02 }); //LENGTH //地震计号 byte[] numDZJ = new byte[2]; @@ -3196,14 +3662,14 @@ namespace JiangsuEarthquake.ViewModels } numDZJ = Tools.PadArrayWithZeros(numDZJ, 2); - sendDataSeis.AddRange(numDZJ); //地震计号 - checkByte.Clear(); - checkByte.AddRange(new byte[] { 0xB0, 0x00 }); //CMD - checkByte.AddRange(new byte[] { 0x00, 0x02 }); //LENGTH - checkByte.AddRange(numDZJ); //地震计号 - checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM + sendDataSeisParaRead.AddRange(numDZJ); //地震计号 + checkByteSeisParaRead.Clear(); + checkByteSeisParaRead.AddRange(new byte[] { 0xB0, 0x00 }); //CMD + checkByteSeisParaRead.AddRange(new byte[] { 0x00, 0x02 }); //LENGTH + checkByteSeisParaRead.AddRange(numDZJ); //地震计号 + checkCodeSeisParaRead = Tools.CRCCalc(checkByteSeisParaRead.ToArray()); //CHK_SUM - sendDataSeis.AddRange(checkCode); + sendDataSeisParaRead.AddRange(checkCodeSeisParaRead); result = false; if (station_id == 1) @@ -3212,7 +3678,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis1.IsConnected && IsMainSeis1CertSucs) { - result = clientModelMainSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis1.SendMessage(sendDataSeisParaRead.ToArray()); } else { @@ -3229,7 +3695,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis1.IsConnected && IsBackupSeis1CertSucs) { - result = clientModelBackupSeis1.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis1.SendMessage(sendDataSeisParaRead.ToArray()); } else { @@ -3249,7 +3715,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelMainSeis2.IsConnected && IsMainSeis2CertSucs) { - result = clientModelMainSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelMainSeis2.SendMessage(sendDataSeisParaRead.ToArray()); } else { @@ -3266,7 +3732,7 @@ namespace JiangsuEarthquake.ViewModels { if (clientModelBackupSeis2.IsConnected && IsBackupSeis2CertSucs) { - result = clientModelBackupSeis2.SendMessage(sendDataSeis.ToArray()); + result = clientModelBackupSeis2.SendMessage(sendDataSeisParaRead.ToArray()); } else { diff --git a/JiangsuEarthquake/JiangsuEarthquake/ViewModels/SystemStateDataViewModel.cs b/JiangsuEarthquake/JiangsuEarthquake/ViewModels/SystemStateDataViewModel.cs index 45231c6..4362533 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/ViewModels/SystemStateDataViewModel.cs +++ b/JiangsuEarthquake/JiangsuEarthquake/ViewModels/SystemStateDataViewModel.cs @@ -243,12 +243,12 @@ namespace JiangsuEarthquake.ViewModels if (station_id == 1) { if (MainWindow.mainViewModel.serverModel1.IsOpened) - MainWindow.mainViewModel.serverModel1.SendMess(new byte[4] { 0x00, 0x01, 0x02, 0x04 }); + MainWindow.mainViewModel.serverModel1.SendMessage(new byte[4] { 0x00, 0x01, 0x02, 0x04 }); } else { if (MainWindow.mainViewModel.serverModel2.IsOpened) - MainWindow.mainViewModel.serverModel2.SendMess(new byte[4] { 0x00, 0x01, 0x02, 0x03 }); + MainWindow.mainViewModel.serverModel2.SendMessage(new byte[4] { 0x00, 0x01, 0x02, 0x03 }); } } #endregion diff --git a/JiangsuEarthquake/JiangsuEarthquake/Views/SystemControlView.xaml b/JiangsuEarthquake/JiangsuEarthquake/Views/SystemControlView.xaml index 792e428..9e05ad2 100644 --- a/JiangsuEarthquake/JiangsuEarthquake/Views/SystemControlView.xaml +++ b/JiangsuEarthquake/JiangsuEarthquake/Views/SystemControlView.xaml @@ -853,9 +853,12 @@ - + Background="{Binding BaseStationPowerBackground}"/>--> + +