Browse Source

首页增加数据回放功能

肖奇伟 1 month ago
parent
commit
ed77f977b9
1 changed files with 19 additions and 0 deletions
  1. 19 0
      SCADA_DAQ/Customer/UctFrmMain.xaml.cs

+ 19 - 0
SCADA_DAQ/Customer/UctFrmMain.xaml.cs

@@ -86,6 +86,25 @@ namespace SCADA_DAQ.Customer
             //    });
             //}
             //T_PowerChart.Update(processDatas);
+
+
+            var datas = Env.DAL.App_Microwave_TestResult.GetTopN<ProductModel>(100);
+            var index = 0;
+            CreateBackGroundTask(() =>
+            {
+                var data = datas[index % datas.Count];
+                if (data.ProcessDatas == null || data.ProcessDatas.Count <= 0)
+                {
+                    var process = Env.DAL.App_Microwave_ProcessData.GetData<ProcessData>(t => t.ReportId == data.ID);
+                    data.ProcessDatas = process.ToList();
+                }
+                Dispatcher.Invoke(() =>
+                {
+                    HeaderView.DataContext = data;
+                    T_PowerChart.Update(data.ProcessDatas);
+                });
+                index++;
+            }, 10000, 1000, true, "数据回放");
         }
 
         private void Rfid2_TestFinish(object sender, TestFinishEventArgs e)