異常資料同步 每 5分鐘自動執行

This commit is contained in:
cesar liu 2022-08-18 10:07:32 +08:00
parent f44c36c4bc
commit a189bcc2f4

View File

@ -18,6 +18,7 @@ namespace solarApp
getStationSvc stationSvc = new getStationSvc();
System.Timers.Timer _timer;
bool autoTask = false; //測試自動跑 irrDayHour 累計日照小時差異
procSyncError svc = new procSyncError(); // 異常資料同步
public fmArchive()
{
InitializeComponent();
@ -112,6 +113,16 @@ namespace solarApp
//bt_archive_Click.PerformClick();
}
//異常處理 每 5分鐘跑一次
if ((DateTime.Now.Minute % 5) == 0 && autoTask == false)
{
lbMsgTitle.Text = DateTime.Now.ToString() + " timer start";
btSyncErr.PerformClick();
autoTask = true;
//bt_archive_Click.PerformClick();
}
//臨時的 累計日照
//if (DateTime.Now.Minute == 30 && (DateTime.Now.Second >= 0 && DateTime.Now.Second <= 10) && autoTask == false)
//{
@ -703,7 +714,7 @@ namespace solarApp
private void btSyncErr_Click(object sender, EventArgs e)
{
procSyncError svc = new procSyncError();
svc.syncErrData();
}