Bladeren bron

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

mengshunguo 1 maand geleden
bovenliggende
commit
83dfeee37b

+ 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)