diff --git a/Txgy.FilesWatcher/ViewModels/MainViewModel.cs b/Txgy.FilesWatcher/ViewModels/MainViewModel.cs
index 0d47525..e92bfdd 100644
--- a/Txgy.FilesWatcher/ViewModels/MainViewModel.cs
+++ b/Txgy.FilesWatcher/ViewModels/MainViewModel.cs
@@ -121,34 +121,17 @@ namespace Txgy.FilesWatcher.ViewModels
get { return account; }
set { SetProperty(ref account, value); }
}
- private string password="123";
+ private int workAreaId = 1;
- public string Password
+ public int WorkAreaId
{
- get { return password; }
- set { SetProperty(ref password, value); }
+ get { return workAreaId; }
+ set { SetProperty(ref workAreaId, value); }
}
- private string _loginContent="登 录";
-
- public string LoginContent
- {
- get { return _loginContent; }
- set { SetProperty(ref _loginContent, value); }
- }
bool isLogin = false;
- public DelegateCommand LoginCommand => new(() => {
- if (!isLogin)
- {
- this.ShowLoading();
- // _websocketClient.SiginServer(Account, Password);
- }
- else
- {
- isLogin = false;
- LoginContent = "登 录";
- // _websocketClient.Closed();
- }
+ public DelegateCommand SureCommand => new(() => {
+
});
public DelegateCommand StartCommand => new(Start);
@@ -220,7 +203,7 @@ namespace Txgy.FilesWatcher.ViewModels
// path = "I:\\DATA/NET2023/06/22/22/56";
if (Directory.Exists(path))
{
- UploadMseedFile.UploadMSeedOnce(path);
+ UploadMseedFile.UploadMSeedOnce(path, WorkAreaId);
}
}
@@ -316,12 +299,12 @@ namespace Txgy.FilesWatcher.ViewModels
if (watch != null && watch.Path == watcherArray[0].Path)
{
watcherArray[0].EnableRaisingEvents = false;
- UploadRealtimeFile.UploadRealtimeFileOnce(e.FullPath, lastLine);
+ UploadRealtimeFile.UploadRealtimeFileOnce(e.FullPath, lastLine, WorkAreaId);
}
else if (watch != null && watch.Path == watcherArray[1].Path)
{
watcherArray[1].EnableRaisingEvents = false;
- UploadPostproFile.UploadPostproFileOnce(watcherArray[1].Path, lastLine);
+ UploadPostproFile.UploadPostproFileOnce(watcherArray[1].Path, lastLine, WorkAreaId);
}
var str= dataList.Where(f => f.Data == lastLine).FirstOrDefault();
if (!string.IsNullOrWhiteSpace(lastLine)
diff --git a/Txgy.FilesWatcher/Views/MainView.xaml b/Txgy.FilesWatcher/Views/MainView.xaml
index 985d1f7..e3b55eb 100644
--- a/Txgy.FilesWatcher/Views/MainView.xaml
+++ b/Txgy.FilesWatcher/Views/MainView.xaml
@@ -17,7 +17,7 @@
-
+
@@ -33,21 +33,17 @@
-
+
-
-
+
+
-
-
-
-
-
+
diff --git a/Txgy.FilesWatcher/model/DBConfig.cs b/Txgy.FilesWatcher/model/DBConfig.cs
index ca6fcee..cb6f83f 100644
--- a/Txgy.FilesWatcher/model/DBConfig.cs
+++ b/Txgy.FilesWatcher/model/DBConfig.cs
@@ -11,7 +11,6 @@ namespace Txgy.FilesWatcher.model
public class DBConfig
{
private static readonly string _connStr;
- private static IDbConnection Cnn => new MySqlConnection(_connStr);
static DBConfig()
{
_connStr = "Server=bj-cdb-q64mbxr6.sql.tencentcdb.com;Port=60027;Database=yuwu2021;Uid=yuwudba;Pwd=Yw123456;charset='utf8'";
@@ -19,54 +18,47 @@ namespace Txgy.FilesWatcher.model
public static MySqlConnection OpenConnection()
{
MySqlConnection connection = new MySqlConnection(_connStr);
- // SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
connection.Open();
return connection;
}
- public string getConfig(string configkey)
- {
- return "";
- }
+
/////////////////////////////////
//createtables 配置
//起始台站号
public int stationNoStart = 02;
//结束台站号
- public int stationNoend => 27;
+ public int stationNoend = 27;
//起始年月
- public string YearMonthStart => "2022-03";
+ public string YearMonthStart = "2022-03";
//结束年月
- public string YearMonthend => "2027-03";
+ public string YearMonthend = "2027-03";
//uploadminiseed 配置(以分钟为单位)
- //Miniseed文件路径BASE
- public string MiniseedPathBase => "Y:/YuwuN3102mseed/NET2023";
+ public string MiniseedPathBase = "Y:/YuwuN3102mseed/NET2023";
//从当前年、月、日、时、分,往以前X分钟
//'BeforeNMin' => 60*24*1,
- public int BeforeNMin => 60 * 1 * 1;
+ public int BeforeNMin = 60 * 1 * 1;
//从当前年、月、日、时、分,往以后X分钟
//'AfterNMin' => 60*24*1,
- public int AfterNMin => 10 * 1 * 1;
- /////////////////////////////////
+ public int AfterNMin = 10 * 1 * 1;
+
/////////////////////////////////
//uploadrealtime 配置(以天为单位)
//realtimeEvent文件路径BASE
- public string EventPathBase => "Y:/YuwuN3102mseed/";
+ public string EventPathBase = "Y:/YuwuN3102mseed/";
//从当前年、月、日往以前X天
- public int EventBeforeNDay => 3;
+ public int EventBeforeNDay = 3;
//从当前年、月、日往以后X天
- public int EventAfterNDay => 1;
- /////////////////////////////////
+ public int EventAfterNDay = 1;
+
- /////////////////////////////////
- //uploadpostpro 配置(以天为单位)
//PostProEvent文件路径BASE
- public string PostProEventPathBase => "Y:/YuwuN3102mseed/post/";
+ public string PostProEventPathBase = "Y:/YuwuN3102mseed/post/";
//从当前年、月、日往以前X天
- public int PostProEventBeforeNDa => 3;
+ public int PostProEventBeforeNDa = 3;
//从当前年、月、日往以后X天
- public int PostProEventAfterNDay => 1;
+ public int PostProEventAfterNDay = 1;
}
}
diff --git a/Txgy.FilesWatcher/model/UploadMseedFile.cs b/Txgy.FilesWatcher/model/UploadMseedFile.cs
index a8a582d..b8ba86c 100644
--- a/Txgy.FilesWatcher/model/UploadMseedFile.cs
+++ b/Txgy.FilesWatcher/model/UploadMseedFile.cs
@@ -12,7 +12,6 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using Txgy.FilesWatcher.DBModels;
-using static System.Net.WebRequestMethods;
namespace Txgy.FilesWatcher.model
{
@@ -60,7 +59,7 @@ namespace Txgy.FilesWatcher.model
}
catch (Exception ex)
{
- throw ex;
+ System.Windows.MessageBox.Show(ex.ToString());
}
}
diff --git a/Txgy.FilesWatcher/model/UploadPostproFile.cs b/Txgy.FilesWatcher/model/UploadPostproFile.cs
index a778275..1d4107a 100644
--- a/Txgy.FilesWatcher/model/UploadPostproFile.cs
+++ b/Txgy.FilesWatcher/model/UploadPostproFile.cs
@@ -35,7 +35,6 @@ namespace Txgy.FilesWatcher.model
var a = conn.QueryFirst(sqlNumber);
if (a == 0)
{
- // string WaveTime = $"{file.Substring(3, 4)}-{file.Substring(7, 2)}-{file.Substring(9, 2)}T{file.Substring(12, 2)}:{file.Substring(14, 2)}:{file.Substring(16, 2)}";
string[] index_file_line = eventMessage.Split(" ");
string EventTime = index_file_line[0].Substring(0, 23);
string OriginTime = EventTime;
diff --git a/Txgy.FilesWatcher/model/UploadRealtimeFile.cs b/Txgy.FilesWatcher/model/UploadRealtimeFile.cs
index ee84112..6b25be6 100644
--- a/Txgy.FilesWatcher/model/UploadRealtimeFile.cs
+++ b/Txgy.FilesWatcher/model/UploadRealtimeFile.cs
@@ -42,7 +42,6 @@ namespace Txgy.FilesWatcher.model
var a = conn.QueryFirst(sqlNumber);
if (a==0)
{
- // string WaveTime = $"{file.Substring(3, 4)}-{file.Substring(7, 2)}-{file.Substring(9, 2)}T{file.Substring(12, 2)}:{file.Substring(14, 2)}:{file.Substring(16, 2)}";
string[] index_file_line = eventMessage.Split(" ");
string EventTime = index_file_line[0].Substring(0, 23);
string OriginTime = EventTime;