新增:
1 完成上下位机通信功能测试,并对出现的bug进行修改;
This commit is contained in:
parent
db357c62fa
commit
9a51dcc1f6
Binary file not shown.
BIN
JiangsuEarthquake/JiangsuEarthquake/Assets/Images/NoDevice.png
Normal file
BIN
JiangsuEarthquake/JiangsuEarthquake/Assets/Images/NoDevice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
@ -592,6 +592,26 @@ namespace JiangsuEarthquake.Common
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 十六进制数组转二进制数组
|
||||||
|
public static byte[] ConvertHexToBinary(byte[] hexArray)
|
||||||
|
{
|
||||||
|
byte[] binaryArray = new byte[hexArray.Length * 8];
|
||||||
|
for (int i = 0; i < hexArray.Length; i++)
|
||||||
|
{
|
||||||
|
string binaryString = Convert.ToString(hexArray[i], 2);
|
||||||
|
// 补充到8位,以确保每个byte都是8位
|
||||||
|
binaryString = binaryString.PadLeft(8, '0');
|
||||||
|
// 将二进制字符串转换为byte数组
|
||||||
|
for (int j = 0; j < 8; j++)
|
||||||
|
{
|
||||||
|
binaryArray[i * 8 + j] = Convert.ToByte(binaryString[j] - '0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return binaryArray;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region IntToByte[4]
|
#region IntToByte[4]
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// int转化为byte[4]
|
/// int转化为byte[4]
|
||||||
|
|||||||
@ -7,4 +7,5 @@
|
|||||||
<ImageSource x:Key="CycleGray">Assets/Images/CycleGray.png</ImageSource>
|
<ImageSource x:Key="CycleGray">Assets/Images/CycleGray.png</ImageSource>
|
||||||
<ImageSource x:Key="DeviceOff">Assets/Images/DeviceOff.png</ImageSource>
|
<ImageSource x:Key="DeviceOff">Assets/Images/DeviceOff.png</ImageSource>
|
||||||
<ImageSource x:Key="DeviceOn">Assets/Images/DeviceOn.png</ImageSource>
|
<ImageSource x:Key="DeviceOn">Assets/Images/DeviceOn.png</ImageSource>
|
||||||
|
<ImageSource x:Key="NoDevice">Assets/Images/NoDevice.png</ImageSource>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@ -38,6 +38,7 @@
|
|||||||
<None Remove="Assets\Images\Link.png" />
|
<None Remove="Assets\Images\Link.png" />
|
||||||
<None Remove="Assets\Images\Max.png" />
|
<None Remove="Assets\Images\Max.png" />
|
||||||
<None Remove="Assets\Images\Min.png" />
|
<None Remove="Assets\Images\Min.png" />
|
||||||
|
<None Remove="Assets\Images\NoDevice.png" />
|
||||||
<None Remove="Assets\Images\Open.png" />
|
<None Remove="Assets\Images\Open.png" />
|
||||||
<None Remove="Assets\Images\Refresh.png" />
|
<None Remove="Assets\Images\Refresh.png" />
|
||||||
<None Remove="Assets\Images\Reset.png" />
|
<None Remove="Assets\Images\Reset.png" />
|
||||||
@ -156,6 +157,9 @@
|
|||||||
<Resource Include="Assets\Images\Min.png">
|
<Resource Include="Assets\Images\Min.png">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
<Resource Include="Assets\Images\NoDevice.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Resource>
|
||||||
<Resource Include="Assets\Images\Open.png">
|
<Resource Include="Assets\Images\Open.png">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
|||||||
@ -557,7 +557,7 @@ namespace JiangsuEarthquake.Models
|
|||||||
App.Current.Dispatcher.Invoke(() =>
|
App.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
if (id == 1)
|
if (id == 1)
|
||||||
MainViewModel.baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOff");
|
return;
|
||||||
else
|
else
|
||||||
MainViewModel.baseStationStateModel2.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOff");
|
MainViewModel.baseStationStateModel2.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOff");
|
||||||
|
|
||||||
@ -578,7 +578,7 @@ namespace JiangsuEarthquake.Models
|
|||||||
App.Current.Dispatcher.Invoke(() =>
|
App.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
if (id == 1)
|
if (id == 1)
|
||||||
MainViewModel.baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOn");
|
return;
|
||||||
else
|
else
|
||||||
MainViewModel.baseStationStateModel2.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOn");
|
MainViewModel.baseStationStateModel2.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOn");
|
||||||
|
|
||||||
@ -598,7 +598,7 @@ namespace JiangsuEarthquake.Models
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
//存储历史设置
|
//存储历史设置
|
||||||
sql = $"insert into switch_info_his(StationID,RecordTime,SwitchName,SwitchState) values('{id}','{DateTime.Now}','BackupSeisPower','{state}');";
|
sql = $"insert into switch_info_his(StationID,RecordTime,SwitchName,SwitchState) values('{id}','{DateTime.Now}','ElectPower','{state}');";
|
||||||
DBHelper.ExecuteNonQuery(sql, 1);
|
DBHelper.ExecuteNonQuery(sql, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -669,6 +669,7 @@ namespace JiangsuEarthquake.Models
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
byte[] state1 = new byte[] { byteList[7], byteList[8], byteList[9], byteList[10] };
|
byte[] state1 = new byte[] { byteList[7], byteList[8], byteList[9], byteList[10] };
|
||||||
|
state1 = Tools.ConvertHexToBinary(state1);
|
||||||
if (Tools.IsBitSet(state1, 32))
|
if (Tools.IsBitSet(state1, 32))
|
||||||
JunBox_ProBoard_PowCarrier_State = 1;
|
JunBox_ProBoard_PowCarrier_State = 1;
|
||||||
if (Tools.IsBitSet(state1, 31))
|
if (Tools.IsBitSet(state1, 31))
|
||||||
@ -695,6 +696,7 @@ namespace JiangsuEarthquake.Models
|
|||||||
JunBox_Elect = 1;
|
JunBox_Elect = 1;
|
||||||
|
|
||||||
byte[] state2 = new byte[] { byteList[11], byteList[12], byteList[13], byteList[14] };
|
byte[] state2 = new byte[] { byteList[11], byteList[12], byteList[13], byteList[14] };
|
||||||
|
state2 = Tools.ConvertHexToBinary(state2);
|
||||||
if (Tools.IsBitSet(state2, 32))
|
if (Tools.IsBitSet(state2, 32))
|
||||||
Leakage = 1;
|
Leakage = 1;
|
||||||
if (Tools.IsBitSet(state2, 31))
|
if (Tools.IsBitSet(state2, 31))
|
||||||
|
|||||||
@ -1862,6 +1862,12 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
|
|
||||||
|
|
||||||
#region 状态设置页面电源On/Off状态初始化
|
#region 状态设置页面电源On/Off状态初始化
|
||||||
|
if(station_id==1)
|
||||||
|
{
|
||||||
|
ElectPowerOpenBtnIsEnabled = false;
|
||||||
|
ElectPowerCloseBtnIsEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
sql = String.Format("select RelayStatus from boosterstation_state where StationID = {0} ORDER by id desc limit 1", 1);
|
sql = String.Format("select RelayStatus from boosterstation_state where StationID = {0} ORDER by id desc limit 1", 1);
|
||||||
dataReader = DBHelper.ExecuteReader(sql, 1);
|
dataReader = DBHelper.ExecuteReader(sql, 1);
|
||||||
if (dataReader.Read())
|
if (dataReader.Read())
|
||||||
@ -1898,10 +1904,10 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
else
|
else
|
||||||
baseStationStateModel1.JunBox_Seis2 = (ImageSource)Application.Current.FindResource("DeviceOff");
|
baseStationStateModel1.JunBox_Seis2 = (ImageSource)Application.Current.FindResource("DeviceOff");
|
||||||
|
|
||||||
if (dataReader["JunBox_Elect"].ToString() == "1")
|
//if (dataReader["JunBox_Elect"].ToString() == "1")
|
||||||
baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOn");
|
// baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOn");
|
||||||
else
|
//else
|
||||||
baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("DeviceOff");
|
baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("NoDevice");
|
||||||
|
|
||||||
|
|
||||||
if (dataReader["JunBox_ProBoard_PowCarrier_State"].ToString() == "0")
|
if (dataReader["JunBox_ProBoard_PowCarrier_State"].ToString() == "0")
|
||||||
@ -4688,6 +4694,9 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
break;
|
break;
|
||||||
case "SystemControlView":
|
case "SystemControlView":
|
||||||
MainSeisIsChecked = true;
|
MainSeisIsChecked = true;
|
||||||
|
baseStationStateModel1.JunBox_Elect = (ImageSource)Application.Current.FindResource("NoDevice");
|
||||||
|
ElectPowerOpenBtnIsEnabled = false;
|
||||||
|
ElectPowerCloseBtnIsEnabled = false;
|
||||||
|
|
||||||
#region 从数据库中读取站点一海底基站、主备地震仪的电源开关和功能启停状态,并显示到页面
|
#region 从数据库中读取站点一海底基站、主备地震仪的电源开关和功能启停状态,并显示到页面
|
||||||
//string sql = String.Format("select SwitchState from switch_info where StationID = 1 and SwitchName = 'BaseStationPower'");
|
//string sql = String.Format("select SwitchState from switch_info where StationID = 1 and SwitchName = 'BaseStationPower'");
|
||||||
@ -4793,6 +4802,8 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
break;
|
break;
|
||||||
case "SystemControlView":
|
case "SystemControlView":
|
||||||
MainSeisIsChecked = true;
|
MainSeisIsChecked = true;
|
||||||
|
ElectPowerOpenBtnIsEnabled = true;
|
||||||
|
ElectPowerCloseBtnIsEnabled = true;
|
||||||
|
|
||||||
#region 从数据库中读取站点二海底基站、主备地震仪的电源开关和功能启停状态,并显示到页面
|
#region 从数据库中读取站点二海底基站、主备地震仪的电源开关和功能启停状态,并显示到页面
|
||||||
//string sql = String.Format("select SwitchState from switch_info where StationID = 2 and SwitchName = 'BaseStationPower'");
|
//string sql = String.Format("select SwitchState from switch_info where StationID = 2 and SwitchName = 'BaseStationPower'");
|
||||||
|
|||||||
Binary file not shown.
@ -11,7 +11,7 @@
|
|||||||
<add key="XWJ_Service_IP1" value="10.20.102.229" />
|
<add key="XWJ_Service_IP1" value="10.20.102.229" />
|
||||||
<add key="XWJ_Service_Port1" value="9527" />
|
<add key="XWJ_Service_Port1" value="9527" />
|
||||||
<add key="XWJ_Service_IPEndPoint1" value="10.20.102.201:0" />
|
<add key="XWJ_Service_IPEndPoint1" value="10.20.102.201:0" />
|
||||||
<add key="XWJ_Service_IP2" value="10.20.102.201" />
|
<add key="XWJ_Service_IP2" value="10.20.102.229" />
|
||||||
<add key="XWJ_Service_Port2" value="9528" />
|
<add key="XWJ_Service_Port2" value="9528" />
|
||||||
<add key="XWJ_Service_IPEndPoint2" value="10.20.102.201:0" />
|
<add key="XWJ_Service_IPEndPoint2" value="10.20.102.201:0" />
|
||||||
<add key="FTPIP1" value="10.20.98.219" />
|
<add key="FTPIP1" value="10.20.98.219" />
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("JiangsuEarthquake")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("JiangsuEarthquake")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+61ab0351f9c108eff79a78da68e2d28ea1803b38")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+db357c62fa64b508f3bdf99ddc12577da611e5d2")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("JiangsuEarthquake")]
|
[assembly: System.Reflection.AssemblyProductAttribute("JiangsuEarthquake")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("JiangsuEarthquake")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("JiangsuEarthquake")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
5a7bf72812aaa09ee422f7a5fec4b31c3e51dd2f4b28e4c2c0fbaa7b83ccbd8d
|
ffc0e59e2d5d836bc16ecab8b7acca818090807c6120167d90ffdbb10b85a5a6
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -16,5 +16,5 @@ F:\Code\JSEQ\20240301_JSEQ_upperpc\JiangsuEarthquake\JiangsuEarthquake\App.xaml
|
|||||||
227-662592483
|
227-662592483
|
||||||
Assets\Styles\DefaultStyle.xaml;ImageDictionary.xaml;MainWindow.xaml;Views\AlarmRecordView.xaml;Views\BoosterStationStateDataView.xaml;Views\LogRecordView.xaml;Views\RealTimeDataView.xaml;Views\SeismometerParameterView.xaml;Views\SeismometerStateDataView.xaml;Views\SystemControlView.xaml;Views\SystemEnvironDataView.xaml;Views\SystemMonitorDataView.xaml;Views\UserControls\AlarmSettingView.xaml;Views\UserControls\BaseStationModel.xaml;Views\UserControls\FTPConnectSstView.xaml;Views\UserControls\FTPSettingView.xaml;Views\UserControls\InitialView.xaml;Views\UserControls\InitialView1.xaml;Views\UserControls\OtherSettingView.xaml;Views\UserControls\TextDialog.xaml;
|
Assets\Styles\DefaultStyle.xaml;ImageDictionary.xaml;MainWindow.xaml;Views\AlarmRecordView.xaml;Views\BoosterStationStateDataView.xaml;Views\LogRecordView.xaml;Views\RealTimeDataView.xaml;Views\SeismometerParameterView.xaml;Views\SeismometerStateDataView.xaml;Views\SystemControlView.xaml;Views\SystemEnvironDataView.xaml;Views\SystemMonitorDataView.xaml;Views\UserControls\AlarmSettingView.xaml;Views\UserControls\BaseStationModel.xaml;Views\UserControls\FTPConnectSstView.xaml;Views\UserControls\FTPSettingView.xaml;Views\UserControls\InitialView.xaml;Views\UserControls\InitialView1.xaml;Views\UserControls\OtherSettingView.xaml;Views\UserControls\TextDialog.xaml;
|
||||||
|
|
||||||
True
|
False
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\Views\LogRecordView.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BBF4C673CF40E4386BA52CCA94BB06B2F1CBF400"
|
#pragma checksum "..\..\..\..\Views\LogRecordView.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3B781C81F640001620B4CE20722354B1FE658E52"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// 此代码由工具生成。
|
// 此代码由工具生成。
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\Views\LogRecordView.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BBF4C673CF40E4386BA52CCA94BB06B2F1CBF400"
|
#pragma checksum "..\..\..\..\Views\LogRecordView.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3B781C81F640001620B4CE20722354B1FE658E52"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// 此代码由工具生成。
|
// 此代码由工具生成。
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
JiangsuEarthquake/Picture/NoDevice.png
Normal file
BIN
JiangsuEarthquake/Picture/NoDevice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Loading…
Reference in New Issue
Block a user