新增功能:
1 编写地震仪参数读取和设置功能;
This commit is contained in:
parent
29a4b89416
commit
f2ad8bcd46
Binary file not shown.
@ -6,6 +6,10 @@
|
|||||||
"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}",
|
"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}"
|
"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\\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\\models\\earthquakeparasetmodel.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\\earthquakeparasetmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\models\\earthquakeparasetmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\models\\earthquakeparasetmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
@ -14,10 +18,6 @@
|
|||||||
"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}",
|
"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}"
|
"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\\common\\tools.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\\tools.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\common\\tools.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{51CD2C1B-B7CD-4AC0-8087-846E14D316AD}|JiangsuEarthquake\\JiangsuEarthquake.csproj|solutionrelative:jiangsuearthquake\\common\\tools.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
@ -58,7 +58,7 @@
|
|||||||
"DocumentGroups": [
|
"DocumentGroups": [
|
||||||
{
|
{
|
||||||
"DockedWidth": 196,
|
"DockedWidth": 196,
|
||||||
"SelectedChildIndex": 10,
|
"SelectedChildIndex": 11,
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
@ -73,22 +73,26 @@
|
|||||||
"WhenOpened": "2024-04-24T08:54:53.626Z",
|
"WhenOpened": "2024-04-24T08:54:53.626Z",
|
||||||
"IsPinned": true
|
"IsPinned": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$type": "Bookmark",
|
||||||
|
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 1,
|
"DocumentIndex": 2,
|
||||||
"Title": "EarthQuakeParaSetModel.cs",
|
"Title": "EarthQuakeParaSetModel.cs",
|
||||||
"DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
"DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
||||||
"RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
"RelativeDocumentMoniker": "JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
||||||
"ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
"ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
||||||
"RelativeToolTip": "JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
"RelativeToolTip": "JiangsuEarthquake\\Models\\EarthQuakeParaSetModel.cs",
|
||||||
"ViewState": "AQIAABwAAAAAAAAAAAAkwC8AAAAlAAAA",
|
"ViewState": "AQIAAGsAAAAAAAAAAAAUwIMAAAAnAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2024-05-07T06:16:48.633Z",
|
"WhenOpened": "2024-05-07T06:16:48.633Z",
|
||||||
"EditorCaption": ""
|
"EditorCaption": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 2,
|
"DocumentIndex": 3,
|
||||||
"Title": "BoosterStationStateDataViewModel.cs",
|
"Title": "BoosterStationStateDataViewModel.cs",
|
||||||
"DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs",
|
"DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs",
|
||||||
"RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs",
|
"RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\BoosterStationStateDataViewModel.cs",
|
||||||
@ -127,7 +131,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 3,
|
"DocumentIndex": 1,
|
||||||
"Title": "SystemControlView.xaml",
|
"Title": "SystemControlView.xaml",
|
||||||
"DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SystemControlView.xaml",
|
"DocumentMoniker": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\Views\\SystemControlView.xaml",
|
||||||
"RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\SystemControlView.xaml",
|
"RelativeDocumentMoniker": "JiangsuEarthquake\\Views\\SystemControlView.xaml",
|
||||||
@ -197,7 +201,7 @@
|
|||||||
"RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\MainViewModel.cs",
|
"RelativeDocumentMoniker": "JiangsuEarthquake\\ViewModels\\MainViewModel.cs",
|
||||||
"ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\MainViewModel.cs",
|
"ToolTip": "F:\\Code\\JSEQ\\20240301_JSEQ_upperpc\\JiangsuEarthquake\\JiangsuEarthquake\\ViewModels\\MainViewModel.cs",
|
||||||
"RelativeToolTip": "JiangsuEarthquake\\ViewModels\\MainViewModel.cs",
|
"RelativeToolTip": "JiangsuEarthquake\\ViewModels\\MainViewModel.cs",
|
||||||
"ViewState": "AQIAAAgIAAAAAAAAAIAwwBwIAAAAAAAA",
|
"ViewState": "AQIAAIIIAAAAAAAAAAAqwI0IAAAVAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2024-03-12T06:03:03.53Z",
|
"WhenOpened": "2024-03-12T06:03:03.53Z",
|
||||||
"EditorCaption": ""
|
"EditorCaption": ""
|
||||||
|
|||||||
@ -1477,10 +1477,11 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if (!SeisZeroSetStartIsReceived)
|
if (!SeisZeroSetStartIsReceived)
|
||||||
{
|
{
|
||||||
OpenSetMsgVisibility = Visibility.Visible;
|
OpenSetMsgVisibility = Visibility.Visible;
|
||||||
OpenSetMsg = "请求数据发送成功,但未接收到数据!";
|
OpenSetMsg = "请求凋零开启发送成功,但未接收到数据!";
|
||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStartButtonIsEnabled = true;
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止定时器
|
// 停止定时器
|
||||||
@ -1492,10 +1493,11 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if (!SeisZeroSetStopIsReceived)
|
if (!SeisZeroSetStopIsReceived)
|
||||||
{
|
{
|
||||||
CloseSetMsgVisibility = Visibility.Visible;
|
CloseSetMsgVisibility = Visibility.Visible;
|
||||||
CloseSetMsg = "请求数据发送成功,但未接收到数据!";
|
CloseSetMsg = "请求调零停止发送成功,但未接收到数据!";
|
||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStartButtonIsEnabled = true;
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止定时器
|
// 停止定时器
|
||||||
@ -1507,10 +1509,11 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if (!SeisLevelSetStartIsReceived)
|
if (!SeisLevelSetStartIsReceived)
|
||||||
{
|
{
|
||||||
OpenSetMsgVisibility = Visibility.Visible;
|
OpenSetMsgVisibility = Visibility.Visible;
|
||||||
OpenSetMsg = "请求数据发送成功,但未接收到数据!";
|
OpenSetMsg = "请求调平开始发送成功,但未接收到数据!";
|
||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStopButtonIsEnabled = true;
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止定时器
|
// 停止定时器
|
||||||
@ -1522,10 +1525,11 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if (!SeisLevelSetStopIsReceived)
|
if (!SeisLevelSetStopIsReceived)
|
||||||
{
|
{
|
||||||
CloseSetMsgVisibility = Visibility.Visible;
|
CloseSetMsgVisibility = Visibility.Visible;
|
||||||
CloseSetMsg = "请求数据发送成功,但未接收到数据!";
|
CloseSetMsg = "请求调平停止发送成功,但未接收到数据!";
|
||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStopButtonIsEnabled = true;
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止定时器
|
// 停止定时器
|
||||||
@ -1668,6 +1672,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if(msg[1].Equals("True")) //打开
|
if(msg[1].Equals("True")) //打开
|
||||||
{
|
{
|
||||||
SeisZeroSetStartButtonIsEnabled = false;
|
SeisZeroSetStartButtonIsEnabled = false;
|
||||||
|
SeisZeroSetStopButtonIsEnabled = false;
|
||||||
SeisZeroSetStartIsReceived = false;
|
SeisZeroSetStartIsReceived = false;
|
||||||
|
|
||||||
sendDataSeis.Clear();
|
sendDataSeis.Clear();
|
||||||
@ -1696,6 +1701,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStartButtonIsEnabled = true;
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1712,6 +1718,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStartButtonIsEnabled = true;
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1731,6 +1738,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStartButtonIsEnabled = true;
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1738,6 +1746,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if(!msg[1].Equals("True")) //关闭
|
if(!msg[1].Equals("True")) //关闭
|
||||||
{
|
{
|
||||||
SeisZeroSetStopButtonIsEnabled = false;
|
SeisZeroSetStopButtonIsEnabled = false;
|
||||||
|
SeisZeroSetStartButtonIsEnabled = false;
|
||||||
SeisZeroSetStopIsReceived = false;
|
SeisZeroSetStopIsReceived = false;
|
||||||
|
|
||||||
sendDataSeis.Clear();
|
sendDataSeis.Clear();
|
||||||
@ -1766,6 +1775,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStopButtonIsEnabled = true;
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1782,6 +1792,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStopButtonIsEnabled = true;
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1801,6 +1812,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStopButtonIsEnabled = true;
|
SeisZeroSetStopButtonIsEnabled = true;
|
||||||
|
SeisZeroSetStartButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1808,6 +1820,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if(msg[1].Equals("True")) //开启
|
if(msg[1].Equals("True")) //开启
|
||||||
{
|
{
|
||||||
SeisLevelSetStartButtonIsEnabled = false;
|
SeisLevelSetStartButtonIsEnabled = false;
|
||||||
|
SeisLevelSetStopButtonIsEnabled = false;
|
||||||
SeisLevelSetStartIsReceived = false;
|
SeisLevelSetStartIsReceived = false;
|
||||||
|
|
||||||
sendDataSeis.Clear();
|
sendDataSeis.Clear();
|
||||||
@ -1836,6 +1849,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStartButtonIsEnabled = true;
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1852,6 +1866,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStartButtonIsEnabled = true;
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1871,6 +1886,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerOpenSetMsgHidden.Start();
|
timerOpenSetMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStartButtonIsEnabled = true;
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1878,6 +1894,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if(!msg[1].Equals("True")) //关闭
|
if(!msg[1].Equals("True")) //关闭
|
||||||
{
|
{
|
||||||
SeisLevelSetStopButtonIsEnabled = false;
|
SeisLevelSetStopButtonIsEnabled = false;
|
||||||
|
SeisLevelSetStartButtonIsEnabled = false;
|
||||||
SeisLevelSetStopIsReceived = false;
|
SeisLevelSetStopIsReceived = false;
|
||||||
|
|
||||||
sendDataSeis.Clear();
|
sendDataSeis.Clear();
|
||||||
@ -1906,6 +1923,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStopButtonIsEnabled = true;
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1922,6 +1940,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStopButtonIsEnabled = true;
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1941,6 +1960,7 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
timerCloseSetMsgHidden.Start();
|
timerCloseSetMsgHidden.Start();
|
||||||
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
CloseSetMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisLevelSetStopButtonIsEnabled = true;
|
SeisLevelSetStopButtonIsEnabled = true;
|
||||||
|
SeisLevelSetStartButtonIsEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1965,10 +1985,11 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if (!EarthQuakeParaSetIsReceived)
|
if (!EarthQuakeParaSetIsReceived)
|
||||||
{
|
{
|
||||||
SeisParaMsgVisibility = Visibility.Visible;
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
SeisParaMsg = "请求数据发送成功,但未接收到数据!";
|
SeisParaMsg = "参数设置发送成功,但未接收到数据!";
|
||||||
timerSeisParaMsgHidden.Start();
|
timerSeisParaMsgHidden.Start();
|
||||||
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
EarthQuakeParaSetBtnIsEnabled = true;
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止定时器
|
// 停止定时器
|
||||||
@ -1980,10 +2001,11 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
if (!EarthQuakeParaReadIsReceived)
|
if (!EarthQuakeParaReadIsReceived)
|
||||||
{
|
{
|
||||||
SeisParaMsgVisibility = Visibility.Visible;
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
SeisParaMsg = "请求数据发送成功,但未接收到数据!";
|
SeisParaMsg = "参数读取发送成功,但未接收到数据!";
|
||||||
timerSeisParaMsgHidden.Start();
|
timerSeisParaMsgHidden.Start();
|
||||||
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
EarthQuakeParaReadBtnIsEnabled = true;
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止定时器
|
// 停止定时器
|
||||||
@ -2065,24 +2087,59 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
// break;
|
// break;
|
||||||
case "EarthQuakeParaSetBtn":
|
case "EarthQuakeParaSetBtn":
|
||||||
EarthQuakeParaSetBtnIsEnabled = false;
|
EarthQuakeParaSetBtnIsEnabled = false;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = false;
|
||||||
earthQuakeParaSetIsReceived = false;
|
earthQuakeParaSetIsReceived = false;
|
||||||
|
|
||||||
byte[] sationNo = Tools.IntToBytes(int.Parse(msg[1])); //台号
|
byte[] sationNo = Tools.IntToBytes(int.Parse(msg[1])); //台号
|
||||||
byte[] stationName = Encoding.UTF8.GetBytes(msg[2]); //台站名称
|
byte[] stationName = Encoding.UTF8.GetBytes(msg[2]); //台站名称
|
||||||
stationName = Tools.PadArrayWithZeros(stationName, 36);
|
stationName = Tools.PadArrayWithZeros(stationName, 32);
|
||||||
byte[] stationShortName = Encoding.UTF8.GetBytes(msg[3]); //台站缩写
|
byte[] stationShortName = Encoding.UTF8.GetBytes(msg[3]); //台站缩写
|
||||||
stationShortName = Tools.PadArrayWithZeros(stationShortName, 8);
|
stationShortName = Tools.PadArrayWithZeros(stationShortName, 8);
|
||||||
byte[] earthQuakeCount = BitConverter.GetBytes(short.Parse(msg[4]));
|
byte[] earthQuakeCount = BitConverter.GetBytes(short.Parse(msg[4])); //地震计总数
|
||||||
earthQuakeCount = Tools.PadArrayWithZeros(earthQuakeCount, 2);
|
earthQuakeCount = Tools.PadArrayWithZeros(earthQuakeCount, 2);
|
||||||
|
byte[] channelsNo = BitConverter.GetBytes(short.Parse(msg[5])); //总通道数
|
||||||
|
channelsNo = Tools.PadArrayWithZeros(channelsNo, 2);
|
||||||
|
byte[] wd = Tools.IntToBytes(int.Parse(msg[6])); //纬度
|
||||||
|
byte[] jd = Tools.IntToBytes(int.Parse(msg[7])); //经度
|
||||||
|
byte[] gaoCheng = Tools.IntToBytes(int.Parse(msg[8])); //高程
|
||||||
|
byte[] startTime = BitConverter.GetBytes(short.Parse(msg[9])); //起用日期
|
||||||
|
startTime = Tools.PadArrayWithZeros(startTime, 32);
|
||||||
|
byte[] stationid = BitConverter.GetBytes(short.Parse(msg[10])); //台网标志
|
||||||
|
stationid = Tools.PadArrayWithZeros(stationid, 4);
|
||||||
|
byte[] software_version = BitConverter.GetBytes(short.Parse(msg[11])); //软件版本
|
||||||
|
software_version = Tools.PadArrayWithZeros(software_version, 32);
|
||||||
|
|
||||||
sendDataSeis.Clear();
|
sendDataSeis.Clear();
|
||||||
sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC
|
sendDataSeis.AddRange(new byte[] { 0xBF, 0x13, 0x97, 0x74 }); //SYNC
|
||||||
sendDataSeis.AddRange(new byte[] { 0xA0, 0x00 }); //CMD
|
sendDataSeis.AddRange(new byte[] { 0xA0, 0x00 }); //CMD
|
||||||
sendDataSeis.AddRange(new byte[] { 0x00, 0x82 }); //LENGTH
|
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.Clear();
|
||||||
checkByte.AddRange(new byte[] { 0xA0, 0x00 }); //CMD
|
checkByte.AddRange(new byte[] { 0xA0, 0x00 }); //CMD
|
||||||
checkByte.AddRange(new byte[] { 0x00, 0x82 }); //LENGTH
|
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
|
checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM
|
||||||
|
|
||||||
sendDataSeis.AddRange(checkCode);
|
sendDataSeis.AddRange(checkCode);
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@ -2094,11 +2151,12 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OpenSetMsgVisibility = Visibility.Visible;
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
OpenSetMsg = "通信未连接!";
|
SeisParaMsg = "通信未连接!";
|
||||||
timerOpenSetMsgHidden.Start();
|
timerSeisParaMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStartButtonIsEnabled = true;
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2110,34 +2168,105 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OpenSetMsgVisibility = Visibility.Visible;
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
OpenSetMsg = "通信未连接!";
|
SeisParaMsg = "通信未连接!";
|
||||||
timerOpenSetMsgHidden.Start();
|
timerSeisParaMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStartButtonIsEnabled = true;
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
OpenSetMsgVisibility = Visibility.Visible;
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
OpenSetMsg = "请求调零开启发送成功!";
|
SeisParaMsg = "设置参数发送成功!";
|
||||||
timerOpenSetMsgHidden.Start();
|
timerSeisParaMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Green);
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Green);
|
||||||
timerSeisZeroSetStart.Start();
|
timerEarthQuakeParaSet.Start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OpenSetMsgVisibility = Visibility.Visible;
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
OpenSetMsg = "请求调零开启发送失败!";
|
SeisParaMsg = "设置参数发送失败!";
|
||||||
timerOpenSetMsgHidden.Start();
|
timerSeisParaMsgHidden.Start();
|
||||||
OpenSetMsgForeground = new SolidColorBrush(Colors.Red);
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
SeisZeroSetStartButtonIsEnabled = true;
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "EarthQuakeParaReadBtn":
|
case "EarthQuakeParaReadBtn":
|
||||||
|
EarthQuakeParaSetBtnIsEnabled = false;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = false;
|
||||||
|
earthQuakeParaReadIsReceived = 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
|
||||||
|
sendDataSeis.AddRange(new byte[] { 0x00, 0x00 }); //地震计号
|
||||||
|
checkByte.Clear();
|
||||||
|
checkByte.AddRange(new byte[] { 0xB0, 0x00 }); //CMD
|
||||||
|
checkByte.AddRange(new byte[] { 0x00, 0x02 }); //LENGTH
|
||||||
|
checkByte.AddRange(new byte[] { 0x00, 0x00 }); //地震计号
|
||||||
|
checkCode = Tools.CRCCalc(checkByte.ToArray()); //CHK_SUM
|
||||||
|
|
||||||
|
sendDataSeis.AddRange(checkCode);
|
||||||
|
|
||||||
|
result = false;
|
||||||
|
if (station_id == 1)
|
||||||
|
{
|
||||||
|
if (clientModelDZY1.IsConnected)
|
||||||
|
{
|
||||||
|
result = clientModelDZY1.SendMessage(sendDataSeis.ToArray());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
|
SeisParaMsg = "通信未连接!";
|
||||||
|
timerSeisParaMsgHidden.Start();
|
||||||
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (clientModelDZY2.IsConnected)
|
||||||
|
{
|
||||||
|
result = clientModelDZY2.SendMessage(sendDataSeis.ToArray());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
|
SeisParaMsg = "通信未连接!";
|
||||||
|
timerSeisParaMsgHidden.Start();
|
||||||
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
|
SeisParaMsg = "设置参数发送成功!";
|
||||||
|
timerSeisParaMsgHidden.Start();
|
||||||
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Green);
|
||||||
|
timerEarthQuakeParaSet.Start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SeisParaMsgVisibility = Visibility.Visible;
|
||||||
|
SeisParaMsg = "设置参数发送失败!";
|
||||||
|
timerSeisParaMsgHidden.Start();
|
||||||
|
SeisParaMsgForeground = new SolidColorBrush(Colors.Red);
|
||||||
|
EarthQuakeParaSetBtnIsEnabled = true;
|
||||||
|
EarthQuakeParaReadBtnIsEnabled = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user