新增功能:
1 新增同时只运行运行一个江苏地震上位机的限制要求;
This commit is contained in:
parent
8fe9103f0d
commit
b462182361
Binary file not shown.
Binary file not shown.
@ -10,6 +10,20 @@ namespace JiangsuEarthquake
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
private static Mutex mutex = new Mutex(true, "JiangsuEarthquake");
|
||||||
|
|
||||||
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnStartup(e);
|
||||||
|
|
||||||
|
if (!mutex.WaitOne(TimeSpan.Zero, true))
|
||||||
|
{
|
||||||
|
//MessageBox.Show("应用程序已运行。");
|
||||||
|
Application.Current.Shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 程序的其他启动代码...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2304,6 +2304,8 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
await Task.Delay(100);
|
await Task.Delay(100);
|
||||||
serverModel1.DoStop();
|
serverModel1.DoStop();
|
||||||
serverModel1 = new ServerModel();
|
serverModel1 = new ServerModel();
|
||||||
|
|
||||||
|
serverModel1.IsOpened = false;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
string sql = $"insert into log_record(StationID,RecordTime,Device_Name,Operation_Type,Record) values('1','{DateTime.Now}','海底地震监测基站-接驳盒','通信连接','服务器已关闭');";
|
string sql = $"insert into log_record(StationID,RecordTime,Device_Name,Operation_Type,Record) values('1','{DateTime.Now}','海底地震监测基站-接驳盒','通信连接','服务器已关闭');";
|
||||||
@ -2322,6 +2324,8 @@ namespace JiangsuEarthquake.ViewModels
|
|||||||
Tools.UpdateAppSettings("XWJ_Service_IP1", SocketServerInfo1.IP);
|
Tools.UpdateAppSettings("XWJ_Service_IP1", SocketServerInfo1.IP);
|
||||||
Tools.UpdateAppSettings("XWJ_Service_Port1", SocketServerInfo1.Port.ToString());
|
Tools.UpdateAppSettings("XWJ_Service_Port1", SocketServerInfo1.Port.ToString());
|
||||||
|
|
||||||
|
serverModel1.IsOpened = true;
|
||||||
|
|
||||||
string record = "服务器已开启,IP:" + SocketServerInfo1.IP + ",Port:" + SocketServerInfo1.Port;
|
string record = "服务器已开启,IP:" + SocketServerInfo1.IP + ",Port:" + SocketServerInfo1.Port;
|
||||||
|
|
||||||
string sql = $"insert into log_record(StationID,RecordTime,Device_Name,Operation_Type,Record) values('1','{DateTime.Now}','海底地震监测基站-接驳盒','通信连接','{record}');";
|
string sql = $"insert into log_record(StationID,RecordTime,Device_Name,Operation_Type,Record) values('1','{DateTime.Now}','海底地震监测基站-接驳盒','通信连接','{record}');";
|
||||||
|
|||||||
@ -236,12 +236,12 @@
|
|||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
<!--<DataGridTextColumn Binding="{Binding Humidity,StringFormat=F2}" Width="0.7*" Header="湿度 %"
|
<!--<DataGridTextColumn Binding="{Binding Humidity,StringFormat=F2}" Width="0.7*" Header="湿度 %"
|
||||||
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
||||||
<!--接驳盒内部湿度设置范围为:0-60-->
|
<!--接驳盒内部湿度设置范围为:0-80-->
|
||||||
<DataGridTemplateColumn Width="0.7*" Header="湿度 %" CellStyle="{StaticResource DataGridCellCenter}">
|
<DataGridTemplateColumn Width="0.7*" Header="湿度 %" CellStyle="{StaticResource DataGridCellCenter}">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock HorizontalAlignment="Center" Text="{Binding Humidity,StringFormat=F2}"
|
<TextBlock HorizontalAlignment="Center" Text="{Binding Humidity,StringFormat=F2}"
|
||||||
Foreground="{Binding Path=Humidity, Converter={StaticResource ValueToBrushConvert},ConverterParameter=60}"/>
|
Foreground="{Binding Path=Humidity, Converter={StaticResource ValueToBrushConvert},ConverterParameter=80}"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
MonitoringProgram.zip
Normal file
BIN
MonitoringProgram.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user