diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs index a5f41a2..2f41d56 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -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(); }