瀏覽代碼

计算功率,剔除曲线回放,工装板绑定显示

mengshunguo 1 月之前
父節點
當前提交
83dfeee37b
共有 3 個文件被更改,包括 21 次插入20 次删除
  1. 2 1
      SCADA_DAQ/Customer/Models/ProcessData.cs
  2. 1 1
      SCADA_DAQ/Customer/UctFrmMain.xaml
  3. 18 18
      SCADA_DAQ/Customer/UctFrmMain.xaml.cs

+ 2 - 1
SCADA_DAQ/Customer/Models/ProcessData.cs

@@ -105,7 +105,8 @@ namespace SCADA_DAQ.Customer.Models
         {
             Voltage = ((data[startIndex] << 8) + data[startIndex + 1]) / 100.0m;
             Amps = ((data[startIndex + 2] << 8) + data[startIndex + 3]) / 1000.0m;
-            Power = ((data[startIndex + 4] << 8) + data[startIndex + 5]) / 10.0m;
+            //Power = ((data[startIndex + 4] << 8) + data[startIndex + 5]) / 10.0m;
+            Power = Voltage * Amps;
         }
 
         /// <summary>

+ 1 - 1
SCADA_DAQ/Customer/UctFrmMain.xaml

@@ -54,7 +54,7 @@
                 </wpfcontrol:SmartGrid.Columns>
             </wpfcontrol:SmartGrid>
         </wpfcontrol:Card>-->
-        <wpfcontrol:Card Header="工装板绑定" Visibility="Collapsed" Margin="4" Grid.Column="1" Grid.Row="1" CardStyle="Success" FontSize="{DynamicResource LargeFontSize}">
+        <wpfcontrol:Card Header="工装板绑定"  Margin="4" Grid.Column="1" Grid.Row="1" CardStyle="Success" FontSize="{DynamicResource LargeFontSize}">
             <ContentControl>
                 <wpfcontrol:SmartGrid IsReadOnly="True" ShowHeader="False" ShowFooter="False" x:Name="DG_Binding" ShowRowTips="False">
                     <wpfcontrol:SmartGrid.Columns>

+ 18 - 18
SCADA_DAQ/Customer/UctFrmMain.xaml.cs

@@ -88,24 +88,24 @@ 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];
-                data.CreateTime = DateTime.Now;
-                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, "数据回放");
+            //var datas = Env.DAL.App_Microwave_TestResult.GetTopN<ProductModel>(100);
+            //var index = 0;
+            //CreateBackGroundTask(() =>
+            //{
+            //    var data = datas[index % datas.Count];
+            //    data.CreateTime = DateTime.Now;
+            //    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)