From 3d3adbf17ca855d24a30e379eb8a84ade6163afb Mon Sep 17 00:00:00 2001 From: mzhifa Date: Mon, 26 Feb 2024 23:50:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/MsEventModel.cs | 1 + .../ViewModels/DataProcessViewModel.cs | 17 ++-- .../Views/DataProcessView.xaml | 6 +- .../Views/MainView.xaml | 8 +- StartServerWPF/serverprogram/tools/apms.json | 80 ++++++++++--------- 5 files changed, 61 insertions(+), 51 deletions(-) diff --git a/StartServerWPF.Modules.Main/Models/MsEventModel.cs b/StartServerWPF.Modules.Main/Models/MsEventModel.cs index f7e7383..bdf48a3 100644 --- a/StartServerWPF.Modules.Main/Models/MsEventModel.cs +++ b/StartServerWPF.Modules.Main/Models/MsEventModel.cs @@ -24,6 +24,7 @@ namespace StartServerWPF.Modules.Main.Models { this.eventMessage = message; string[] evtS = message.Trim(' ').Split(new char[] { ' ' }); + CurrentTime = DateTime.Now; OriginTime = DateTime.Parse(evtS[0]); EastCoordinate = double.Parse(evtS[2]); NorthCoordinate = double.Parse(evtS[1]); diff --git a/StartServerWPF.Modules.Main/ViewModels/DataProcessViewModel.cs b/StartServerWPF.Modules.Main/ViewModels/DataProcessViewModel.cs index cad0c2a..4da0ba5 100644 --- a/StartServerWPF.Modules.Main/ViewModels/DataProcessViewModel.cs +++ b/StartServerWPF.Modules.Main/ViewModels/DataProcessViewModel.cs @@ -236,7 +236,6 @@ namespace StartServerWPF.Modules.Main.ViewModels MessageBox.Show("内容不能为空", "提示", MessageBoxButton.OK); return; } - var time = (EndSelectedDate.AddSeconds(-EndSelectedDate.Second) - StartSelectedDate.AddSeconds(-StartSelectedDate.Second)); if (time.TotalMinutes < 1) { @@ -245,10 +244,12 @@ namespace StartServerWPF.Modules.Main.ViewModels } DateTime dateTime = StartSelectedDate; string temPath = Path.GetPathRoot(_workareaModel.savepath) + "temPath"; - if (!Directory.Exists(temPath)) + //清除临时文件 + if (Directory.Exists(temPath)) { - Directory.CreateDirectory(temPath); + Directory.Delete(temPath, true); } + Directory.CreateDirectory(temPath); Task.Run(() => { IsBusy = false; @@ -378,11 +379,11 @@ namespace StartServerWPF.Modules.Main.ViewModels Debug.WriteLine($"****数据处理程序退出,{e.ToString()}******************"); IsBusy = true; //处理完成后删除临时文件 - string temPath = Path.GetPathRoot(_workareaModel.savepath) + "temPath"; - if (Directory.Exists(temPath)) - { - Directory.Delete(temPath, true); - } + //string temPath = Path.GetPathRoot(_workareaModel.savepath) + "temPath"; + //if (Directory.Exists(temPath)) + //{ + // Directory.Delete(temPath, true); + //} //解析处理后的事件文件 var fileName = Directory.GetFiles(SavePath, "*.index", SearchOption.AllDirectories); List lines = new List(); diff --git a/StartServerWPF.Modules.Main/Views/DataProcessView.xaml b/StartServerWPF.Modules.Main/Views/DataProcessView.xaml index 1e31030..4004d3f 100644 --- a/StartServerWPF.Modules.Main/Views/DataProcessView.xaml +++ b/StartServerWPF.Modules.Main/Views/DataProcessView.xaml @@ -117,15 +117,15 @@ - - + + - + diff --git a/StartServerWPF.Modules.Main/Views/MainView.xaml b/StartServerWPF.Modules.Main/Views/MainView.xaml index 4cc00fb..546ece5 100644 --- a/StartServerWPF.Modules.Main/Views/MainView.xaml +++ b/StartServerWPF.Modules.Main/Views/MainView.xaml @@ -133,8 +133,8 @@ - - + + @@ -155,8 +155,8 @@ - - + + diff --git a/StartServerWPF/serverprogram/tools/apms.json b/StartServerWPF/serverprogram/tools/apms.json index 65c6fac..4feb5c3 100644 --- a/StartServerWPF/serverprogram/tools/apms.json +++ b/StartServerWPF/serverprogram/tools/apms.json @@ -1,39 +1,47 @@ { - "station" :"N3102_staion_20230403.csv", - "ttime":[{"station":"ttime","ttime2d":"ttime_gw20210427.tab"}], - "Main.log_level":"DEBUG", - "Main.slice_seconds": 30 , - "Main.overlap_seconds": 10 , - "Main.is_mag":"YES", - "Main.is_write_slice":"NO", - "Main.lon":38398463.49, - "Main.lat":4031112.103, - "Main.height":1102.63, - "Main.savepath":"I://yuwuN3102mseed//post", - "Main.push2wx":"NO", - "Main.push_url":"http://www.txgy.cloud/api/index/push", - "Main.push_mag":-1.0, - "Main.message_id":1, - "Main.company_id":1, - "Main.area_id":8, - "Main.content":"通知事件", - "Main.push_key":"Y3qYFBQPMbfTt6m", - - "RServer.host":"127.0.0.1", - "channels":[ - {"network":"HA","station":"N02,N03,N04,N05,N06,N07,N08,N09,N10,N11,N12,N13,N14,N15,N16,N17,N18,N19,N20,N21,N22,N23,N24,N25,N26,N27","location":"06","channels":"SHZ:SHN:SHE"} + "station": "I:/DATA/workarea/n2017/N2107_1116.csv", + "ttime": [ + { + "station": "ttime", + "ttime2d": "I:/DATA/workarea/n2017/ttime_gw20210427.tab" + } ], - "Locate.log_level" : "DEBUG", - "Locate.work_path" :".", - "Locate.xmin":38396517, - "Locate.xmax":38398317, - "Locate.ymin":4029418, - "Locate.ymax":4031218, - "Locate.zref":1039, - "Locate.zmin":300, - "Locate.zmax":800, - "Locate.minstep":10, - "Locate.method":"", - "Locate.clusted_otime":0.5 - + "Main.log_level": "DEBUG", + "Main.slice_seconds": 30, + "Main.overlap_seconds": 10, + "Main.is_mag": "YES", + "Main.is_write_slice": "NO", + "Main.lon": 38398463.49, + "Main.lat": 4031112.103, + "Main.height": 1102.63, + "Main.savepath": "I:/DATA/workarea/n2017/Post", + "Main.push2wx": "NO", + "Main.push_url": "http://www.txgy.cloud/api/index/push", + "Main.push_mag": -1.0, + "Main.message_id": 1, + "Main.company_id": 1, + "Main.area_id": 8, + "Main.content": "通知事件", + "Main.push_key": "Y3qYFBQPMbfTt6m", + "RServer.host": "127.0.0.1", + "channels": [ + { + "network": "HA", + "location": "06", + "channels": "SHZ:SHN:SHE", + "station": "N02,N06,N19,N09,N13,N14,N15,N16,N18,N20,N22,N24,N11,N26,N05,N27,N23,N10" + } + ], + "Locate.log_level": "DEBUG", + "Locate.work_path": ".", + "Locate.xmin": 38400000.0, + "Locate.xmax": 38401600.0, + "Locate.ymin": 4030400.0, + "Locate.ymax": 4032000.0, + "Locate.zref": 1039.0, + "Locate.zmin": 300.0, + "Locate.zmax": 800.0, + "Locate.minstep": 10.0, + "Locate.method": "", + "Locate.clusted_otime": 0.5 } \ No newline at end of file