diff --git a/JiangsuEarthquake.zip b/JiangsuEarthquake.zip deleted file mode 100644 index aaba589..0000000 Binary files a/JiangsuEarthquake.zip and /dev/null differ diff --git a/JiangsuEarthquakeNow.zip b/JiangsuEarthquakeNow.zip index 274b65a..d771923 100644 Binary files a/JiangsuEarthquakeNow.zip and b/JiangsuEarthquakeNow.zip differ diff --git a/JiangsuEarthquakeNow/JiangsuEarthquake/App.xaml.cs b/JiangsuEarthquakeNow/JiangsuEarthquake/App.xaml.cs index 62fd8cf..5ebd0ab 100644 --- a/JiangsuEarthquakeNow/JiangsuEarthquake/App.xaml.cs +++ b/JiangsuEarthquakeNow/JiangsuEarthquake/App.xaml.cs @@ -10,6 +10,20 @@ namespace JiangsuEarthquake /// 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(); + } + + // 程序的其他启动代码... + } } } diff --git a/JiangsuEarthquakeNow/JiangsuEarthquake/ViewModels/MainViewModel.cs b/JiangsuEarthquakeNow/JiangsuEarthquake/ViewModels/MainViewModel.cs index d997077..9ee551a 100644 --- a/JiangsuEarthquakeNow/JiangsuEarthquake/ViewModels/MainViewModel.cs +++ b/JiangsuEarthquakeNow/JiangsuEarthquake/ViewModels/MainViewModel.cs @@ -2304,6 +2304,8 @@ namespace JiangsuEarthquake.ViewModels await Task.Delay(100); serverModel1.DoStop(); serverModel1 = new ServerModel(); + + serverModel1.IsOpened = false; })); 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_Port1", SocketServerInfo1.Port.ToString()); + serverModel1.IsOpened = true; + 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}');"; diff --git a/JiangsuEarthquakeNow/JiangsuEarthquake/Views/SystemEnvironDataView.xaml b/JiangsuEarthquakeNow/JiangsuEarthquake/Views/SystemEnvironDataView.xaml index 4216288..bcf9f7b 100644 --- a/JiangsuEarthquakeNow/JiangsuEarthquake/Views/SystemEnvironDataView.xaml +++ b/JiangsuEarthquakeNow/JiangsuEarthquake/Views/SystemEnvironDataView.xaml @@ -236,12 +236,12 @@ - + + Foreground="{Binding Path=Humidity, Converter={StaticResource ValueToBrushConvert},ConverterParameter=80}"/> diff --git a/JiangsuEarthquakeNow1.zip b/JiangsuEarthquakeNow1.zip deleted file mode 100644 index 45c8128..0000000 Binary files a/JiangsuEarthquakeNow1.zip and /dev/null differ diff --git a/JiangsuEarthquakeNow2.zip b/JiangsuEarthquakeNow2.zip deleted file mode 100644 index e8bd8c1..0000000 Binary files a/JiangsuEarthquakeNow2.zip and /dev/null differ diff --git a/JiangsuEarthquakeNow3.zip b/JiangsuEarthquakeNow3.zip deleted file mode 100644 index 76e4bd0..0000000 Binary files a/JiangsuEarthquakeNow3.zip and /dev/null differ diff --git a/MonitoringProgram.zip b/MonitoringProgram.zip new file mode 100644 index 0000000..a1b59c2 Binary files /dev/null and b/MonitoringProgram.zip differ