Browse Source

设备数据采集逻辑完善

谢翼翔 1 year ago
parent
commit
cd8ac55137
15 changed files with 465 additions and 375 deletions
  1. 30 32
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Machines/SampleMachine.cs
  2. 1 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml
  3. 70 55
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml.cs
  4. 1 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmMainTain.xaml.cs
  5. 4 2
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml
  6. 50 81
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml.cs
  7. 6 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/LaserAndDigitalPunchingEquipmentWidget.xaml
  8. 83 94
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/LaserAndDigitalPunchingEquipmentWidget.xaml.cs
  9. 58 13
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/YaweiPressBrakeOneWidget.xaml
  10. 154 82
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/YaweiPressBrakeOneWidget.xaml.cs
  11. 1 2
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceInformationControls.xaml
  12. 1 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceInformationControlsSencd.xaml
  13. 3 4
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceInformationControlsThird.xaml
  14. 2 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctLaserMmachinePieChart.xaml
  15. 1 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctLaserMmachinePieChart.xaml.cs

+ 30 - 32
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Machines/SampleMachine.cs

@@ -99,50 +99,48 @@ namespace SCADA_DAQ.Customer.Machines
             if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.HourChanged ||
               e.ChangeType == SCADA.CommonLib.DateTimeChangeType.MinuteChanged)
             {
-                if (BaseDevice.ConnectState == SCADA.Comm.ConnectStates.Connected)
+                var duration = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>().ToLookup(t => t.Device);
+                foreach (var item in duration)
                 {
-                    var duration = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>().ToLookup(t => t.Device);
-                    foreach (var item in duration)
+                    if (BaseDevice.DeviceID == item.Key)
                     {
-                        if (BaseDevice.DeviceID == item.Key)
+                        foreach (var Value in item)
                         {
-                            foreach (var Value in item)
-                            {
-
-                                if (Value.StartTime.Hours == DateTime.Now.Hour &&
-                                     Value.StartTime.Minutes == DateTime.Now.Minute)
-                                {
-                                    var name = BaseDevice.DeviceID;
-                                    StartTime = DateTime.Now;
-                                    OrgID = Guid.NewGuid().ToString();
-                                    Env.SqlDAL.App_Vertiv_ScheduleStop.Insert(
-                                    new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str, OrgID),
-                                    new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StartTime_Dt, StartTime),
-                                    new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.TableName_Str, name));
-                                }
 
-                                if (Value.EndTime.Hours == DateTime.Now.Hour &&
-                                        Value.EndTime.Minutes == DateTime.Now.Minute)
-                                {
+                            if (Value.StartTime.Hours == DateTime.Now.Hour &&
+                                 Value.StartTime.Minutes == DateTime.Now.Minute)
+                            {
+                                var name = BaseDevice.DeviceID;
+                                StartTime = DateTime.Now;
+                                OrgID = Guid.NewGuid().ToString();
+                                Env.SqlDAL.App_Vertiv_ScheduleStop.Insert(
+                                new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str, OrgID),
+                                new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StartTime_Dt, StartTime),
+                                new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.TableName_Str, name));
+                            }
 
-                                    var stopTimeValue = DateTime.Now;
-                                    var lastTime = stopTimeValue - StartTime;
-                                    Env.SqlDAL.App_Vertiv_ScheduleStop.Update
-                                           (
-                                       $"{T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str} = '{OrgID}'",
-                                       new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.EndTime_Dt, stopTimeValue),
-                                       new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.Duration_Dt, lastTime)
-                                           );
-                                    OrgID = null;
-                                }
+                            if (Value.EndTime.Hours == DateTime.Now.Hour &&
+                                    Value.EndTime.Minutes == DateTime.Now.Minute)
+                            {
 
+                                var stopTimeValue = DateTime.Now;
+                                var lastTime = stopTimeValue - StartTime;
+                                Env.SqlDAL.App_Vertiv_ScheduleStop.Update
+                                       (
+                                   $"{T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str} = '{OrgID}'",
+                                   new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.EndTime_Dt, stopTimeValue),
+                                   new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.Duration_Dt, lastTime)
+                                       );
+                                OrgID = null;
                             }
-                        }
 
+                        }
                     }
 
                 }
 
+
+
             }
 
         }

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml

@@ -32,7 +32,7 @@
             <uct:UctDeviceInformationControlsSencd Grid.Column="4" x:Name="KanbanForPressBrakeEquipmentFive" Text="Bystronic折弯机设备运行状况" Margin="2"/>
         </Grid>
         <Grid Grid.Row="2">
-        <dashboard:YaweiPressBrakeOneWidget Grid.Row="1" Margin="8.8"/>
+        <dashboard:YaweiPressBrakeOneWidget Grid.Row="1" Margin="8.8" Loaded="YaweiPressBrakeOneWidget_Loaded"/>
         </Grid>
     </Grid>
     </Viewbox>

+ 70 - 55
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml.cs

@@ -7,6 +7,7 @@ using SCADA.CommonCtrl.WpfControl;
 using SCADA.CommonLib;
 using SCADA.CommonLib.Data.DIL;
 using SCADA.CommonLib.Data.DIL.Sqlite;
+using SCADA.Drive.Siemens.CNC840DA.Da;
 using SCADA_DAQ.Customer.Models;
 using SCADA_DAQ.Customer.Models.DeviceInfoTime;
 using SqlSchema.DBNames;
@@ -51,7 +52,7 @@ namespace SCADA_DAQ.Customer
             GetTableTime();
             GetRepairTime();
             GetScheduleStopTime();
-            
+
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
             ToolBar.Visibility = Visibility.Collapsed;
             Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
@@ -59,54 +60,75 @@ namespace SCADA_DAQ.Customer
             KanbanForPressBrakeEquipmentOne.Title = new string[] { "运行时间:",
                 "等待时间:",
                 "换模时间:",
-                "维修时间:",
+                "报警/维修时间:",
                 "维保时间:"};
 
             KanbanForPressBrakeEquipmentTwo.Title = new string[] { "运行时间:",
                 "等待时间:",
                 "换模时间:",
-                "维修时间:",
+                "报警/维修时间:",
                 "维保时间:"};
 
             KanbanForPressBrakeEquipmentThree.Title = new string[] { "运行时间:",
                 "等待时间:",
                 "换模时间:",
-                "维修时间:",
+                "报警/维修时间:",
                 "维保时间:"};
 
             KanbanForPressBrakeEquipmentFour.Title = new string[] { "运行时间:",
                 "等待时间:",
                 "换模时间:",
-                "维修时间:",
+                "报警/维修时间:",
                 "维保时间:"};
 
             KanbanForPressBrakeEquipmentFive.Title = new string[] { "运行时间:",
                 "等待时间:",
                 "换模时间:",
-                "维修时间:",
+                "报警/维修时间:",
                 "维保时间:"};
+           
 
             var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
-            var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位") - DevicScheduleStop("1号YaWei折弯机");//1号YaWei折弯机等待时间
             var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
             var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
-            var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位") - DevicScheduleStop("2号YaWei折弯机");//2号YaWei折弯机等待时间
             var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
 
             var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位"); ;//3号YaWei折弯机运行时间
-            var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位") - DevicScheduleStop("3号YaWei折弯机");//3号YaWei折弯机等待时间
             var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
 
             var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位"); ;//亚威PBC折弯机运行时间
-            var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位") - DevicScheduleStop("亚威PBC折弯机");//亚威PBC折弯机等待时间
             var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
 
             var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
-            var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位") - DevicScheduleStop("百超折弯机");//百超折弯机折弯机等待时间
             var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
 
 
+            var firstYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威一号折弯机").ToString() + "天";//亚威一号折弯机设备保养信息
+            var secondYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威二号折弯机").ToString() + "天";//亚威二号折弯机设备保养信息
+            var thirdYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威三号折弯机").ToString() + "天";//亚威三号折弯机设备保养信息
+            var pbcYaWweiRepairTime = "倒计时" + DeviceRepairTime("亚威PBC折弯机").ToString() + "天";//亚威PBC折弯机设备保养信息
+            var baiChaoRepairTime = "倒计时" + DeviceRepairTime("百超折弯机").ToString() + "天";//百超折弯机设备保养信息
+
+            var firstYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威一号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("1号YaWei折弯机", "维修时间")));
+            var secondYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威二号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("2号YaWei折弯机", "维修时间")));
+            var thirdYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威三号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("3号YaWei折弯机", "维修时间")));
+            var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间")));
+            var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间")));
+
+
+            double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+            var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+                - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间");//1号YaWei折弯机等待时间
+            var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
+                - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间");//2号YaWei折弯机等待时间
+            var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
+                - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间");//3号YaWei折弯机等待时间
+            var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
+                - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间");//亚威PBC折弯机等待时间
+            var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
+                - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间");//百超折弯机折弯机等待时间
+
             var firstYaWeiRunTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiRunTime)).ToString();
             var firstYaWeiStopTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiStopTime)).ToString();
             var firstYaWeiMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiMoldTime)).ToString();
@@ -119,7 +141,7 @@ namespace SCADA_DAQ.Customer
             var thirdYaWweiRunTimeSpan = TimeSpan.FromSeconds(Math.Round(thirdYaWweiRunTime)).ToString();
             var thirdYaWweiStopTimeSpan = TimeSpan.FromSeconds(Math.Round(thirdYaWweiStopTime)).ToString();
             var thirdYaWweiMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(thirdYaWweiMoldTime)).ToString();
-            
+
 
             var pbcYaWweiRunTimeSpan = TimeSpan.FromSeconds(Math.Round(pbcYaWweiRunTime)).ToString();
             var pbcYaWweiStopTimeSpan = TimeSpan.FromSeconds(Math.Round(pbcYaWweiStopTime)).ToString();
@@ -129,27 +151,6 @@ namespace SCADA_DAQ.Customer
             var baiChaoRunTimeSpan = TimeSpan.FromSeconds(Math.Round(baiChaoRunTime)).ToString();
             var baiChaoStopTimeSpan = TimeSpan.FromSeconds(Math.Round(baiChaoStopTime)).ToString();
             var baiChaoMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(baiChaoMoldTime)).ToString();
-            
-
-            var firstYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威一号折弯机").ToString() + "天";//亚威一号折弯机设备保养信息
-            var secondYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威二号折弯机").ToString() + "天";//亚威二号折弯机设备保养信息
-            var thirdYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威三号折弯机").ToString() + "天";//亚威三号折弯机设备保养信息
-            var pbcYaWweiRepairTime = "倒计时" + DeviceRepairTime("亚威PBC折弯机").ToString() + "天";//亚威PBC折弯机设备保养信息
-            var baiChaoRepairTime = "倒计时" + DeviceRepairTime("百超折弯机").ToString() + "天";//百超折弯机设备保养信息
-
-            var firstYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威一号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("1号YaWei折弯机", "维修时间")));
-            var secondYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威二号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("2号YaWei折弯机", "维修时间")));
-            var thirdYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威三号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("3号YaWei折弯机", "维修时间")));
-            var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间")));
-            var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间")));
-
-
-            //var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").ToString();//获取亚威一号折弯机设备维修时间
-            //var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").ToString();//获取亚威二号折弯机设备维修时间
-            //var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").ToString();//获取亚威三号折弯机设备维修时间
-            //var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").ToString();//获取亚威PBC折弯机设备维修时间
-            //var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").ToString();//获取百超折弯机设备维修时间
-
 
 
             KanbanForPressBrakeEquipmentOne.DeviceNameOne.Value = firstYaWeiRunTimeSpan;
@@ -224,7 +225,7 @@ namespace SCADA_DAQ.Customer
         public TimeSpan DevicMainTableTime(string deviceName)
         {
 
-            var timeMaintenanceTable = deviceMaintenanceTable.ToLookup(t => t.DeviceName)[deviceName].Select(t => t.DurationTime);//获取激光机设备维修时间
+            var timeMaintenanceTable = deviceMaintenanceTable.ToLookup(t => t.DeviceName)[deviceName].Select(t => t.DurationTime);//获取设备维修时间
             var MaintenanceTimeValue = new TimeSpan();
             foreach (TimeSpan item in timeMaintenanceTable)
             {
@@ -293,28 +294,53 @@ namespace SCADA_DAQ.Customer
                     GetTableTime();
                     GetRepairTime();
                     GetScheduleStopTime();
+                    double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
                     var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
-                    var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位") - DevicScheduleStop("1号YaWei折弯机");//1号YaWei折弯机等待时间
+                    //var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位") - DevicScheduleStop("1号YaWei折弯机");//1号YaWei折弯机等待时间
                     var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
                     var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
-                    var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位") - DevicScheduleStop("2号YaWei折弯机");//2号YaWei折弯机等待时间
+                    //var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位") - DevicScheduleStop("2号YaWei折弯机");//2号YaWei折弯机等待时间
                     var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
 
                     var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位"); ;//3号YaWei折弯机运行时间
-                    var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位") - DevicScheduleStop("3号YaWei折弯机");//3号YaWei折弯机等待时间
+                    //var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位") - DevicScheduleStop("3号YaWei折弯机");//3号YaWei折弯机等待时间
                     var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
 
                     var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位"); ;//亚威PBC折弯机运行时间
-                    var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位") - DevicScheduleStop("亚威PBC折弯机");//亚威PBC折弯机等待时间
+                    //var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位") - DevicScheduleStop("亚威PBC折弯机");//亚威PBC折弯机等待时间
                     var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
 
                     var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
-                    var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位") - DevicScheduleStop("百超折弯机");//百超折弯机折弯机等待时间
+                    //var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位") - DevicScheduleStop("百超折弯机");//百超折弯机折弯机等待时间
                     var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
 
 
 
+                    var firstYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威一号折弯机").ToString() + "天";//亚威一号折弯机设备保养信息
+                    var secondYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威二号折弯机").ToString() + "天";//亚威二号折弯机设备保养信息
+                    var thirdYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威三号折弯机").ToString() + "天";//亚威三号折弯机设备保养信息
+                    var pbcYaWweiRepairTime = "倒计时" + DeviceRepairTime("亚威PBC折弯机").ToString() + "天";//亚威PBC折弯机设备保养信息
+                    var baiChaoRepairTime = "倒计时" + DeviceRepairTime("百超折弯机").ToString() + "天";//百超折弯机设备保养信息
+
+                    var firstYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威一号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("1号YaWei折弯机", "维修时间")));
+                    var secondYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威二号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("2号YaWei折弯机", "维修时间")));
+                    var thirdYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威三号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("3号YaWei折弯机", "维修时间")));
+                    var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间")));
+                    var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间")));
+
+                    var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+                        - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间");//1号YaWei折弯机等待时间
+                    var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
+                        - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间");//2号YaWei折弯机等待时间
+                    var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
+                        - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间");//3号YaWei折弯机等待时间
+                    var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
+                        - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间");//亚威PBC折弯机等待时间
+                    var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
+                        - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间");//百超折弯机折弯机等待时间
+
+
                     var firstYaWeiRunTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiRunTime)).ToString();
                     var firstYaWeiStopTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiStopTime)).ToString();
                     var firstYaWeiMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiMoldTime)).ToString();
@@ -338,22 +364,6 @@ namespace SCADA_DAQ.Customer
                     var baiChaoStopTimeSpan = TimeSpan.FromSeconds(Math.Round(baiChaoStopTime)).ToString();
                     var baiChaoMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(baiChaoMoldTime)).ToString();
 
-                    var firstYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威一号折弯机").ToString() + "天";//亚威一号折弯机设备保养信息
-                    var secondYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威二号折弯机").ToString() + "天";//亚威二号折弯机设备保养信息
-                    var thirdYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威三号折弯机").ToString() + "天";//亚威三号折弯机设备保养信息
-                    var pbcYaWweiRepairTime = "倒计时" + DeviceRepairTime("亚威PBC折弯机").ToString() + "天";//亚威PBC折弯机设备保养信息
-                    var baiChaoRepairTime = "倒计时" + DeviceRepairTime("百超折弯机").ToString() + "天";//百超折弯机设备保养信息
-
-                    var firstYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威一号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("1号YaWei折弯机", "维修时间")));
-                    var secondYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威二号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("2号YaWei折弯机", "维修时间")));
-                    var thirdYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威三号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("3号YaWei折弯机", "维修时间")));
-                    var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间")));
-                    var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间")));
-                    //var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").ToString();//获取亚威一号折弯机设备维修时间
-                    //var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").ToString();//获取亚威二号折弯机设备维修时间
-                    //var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").ToString();//获取亚威三号折弯机设备维修时间
-                    //var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").ToString();//获取亚威PBC折弯机设备维修时间
-                    //var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").ToString();//获取百超折弯机设备维修时间
                     // 委托
                     Dispatcher.Invoke(new Action(() =>
                     {
@@ -413,6 +423,11 @@ namespace SCADA_DAQ.Customer
             Env.Schedual.DateTimeChanged -= Schedual_DateTimeChanged;
             base.CloseThis();
         }
+
+        private void YaweiPressBrakeOneWidget_Loaded(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 
 }

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmMainTain.xaml.cs

@@ -35,7 +35,7 @@ namespace SCADA_DAQ.Customer
             var machineList = new List<string>() {
                 "激光机",
                 "西门子840D数冲",
-                "倍福数冲",
+                "倍福数冲",
                 "百超折弯机",
                 "亚威一号折弯机",
                 "亚威二号折弯机",

+ 4 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml

@@ -36,7 +36,8 @@
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="18"
-                   Foreground="Cyan"/>
+                   Foreground="Cyan"
+                   Margin="0,0,0,50"/>
                     <uct:UctLaserMmachinePieChart Grid.Row="1"  Margin="16" x:Name="HighMachinePunchingMachine"/>
                 </Grid>
                 <Grid Grid.Column="1">
@@ -46,7 +47,8 @@
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="18"
-                   Foreground="Cyan"/>
+                   Foreground="Cyan"
+                   Margin="0,0,0,50"/>
                 </Grid>
             </Grid>
         </Grid>

+ 50 - 81
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml.cs

@@ -55,64 +55,49 @@ namespace SCADA_DAQ.Customer
             Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
             PunchingMachineEquipmentKanbanOne.Title = new string[] { "高机冲孔机运行时间:",
                 "高机冲孔机等待时间:",
-                "高机冲孔机报警时间:",
+                "高机冲孔机报警/维修时间:",
                 "高机冲孔机换模时间:",
-                "高机冲孔机维修时间:",
                 "高机冲孔机维保时间:"};
 
             PunchingMachineEquipmentKanbanTwo.Title = new string[] { "金方圆数控母线冲孔机运行时间:",
                 "金方圆数控母线冲孔机等待时间:",
-                "金方圆数控母线冲孔机报警时间:",
+                "金方圆数控母线冲孔机报警/维修时间:",
                 "金方圆数控母线冲孔机换模时间:",
-                "金方圆数控母线冲孔机维修时间:",
                 "金方圆数控母线冲孔机维保时间:"};
 
-            string[] punchingMachine = { "运行", "等待", "报警", "换模" };
-            //var kimFangyuanTimeMaintenanceTable = DevicMainTableTime("金方圆铜排冲剪机");//获取金方圆铜排冲剪机设备维修时间
-            //var kimFangyuanTimeMaintenanceTableString = DevicMainTableTime("金方圆铜排冲剪机").ToString();
-
-            //var highmachineTimeMaintenanceTable = DevicMainTableTime("高机铜排冲剪机")+TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "故障标志位"));//获取高机铜排冲剪机设备维修时间
-            //var highmachineTimeMaintenanceTableString = DevicMainTableTime("高机铜排冲剪机").ToString();
-
-            //var kimFangyuanArlamTime = kimFangyuanTimeMaintenanceTable.TotalSeconds * 0.2;//金方圆铜排冲剪机设备报警时间单位秒
-            //var kimFangyuanArlamTimeSpan = TimeSpan.FromSeconds(kimFangyuanArlamTime).ToString();
-            //var kimFangyuanArlamDouble = Convert.ToDouble(kimFangyuanArlamTime);
-
-            //var highmachineArlamTime = highmachineTimeMaintenanceTable.TotalSeconds * 0.2;//高机铜排冲剪机设备报警时间单位秒
-            //var highmachineArlamTimeSpan = TimeSpan.FromSeconds(highmachineArlamTime).ToString();
-            //var highmachineArlamDouble = Convert.ToDouble(highmachineArlamTime);
-            var kimFangyuanTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机") + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")));//获取金方圆铜排冲剪机设备维修时间
-
-            var highmachineTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("高机铜排冲剪机") + TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "维修时间")));//获取高机铜排冲剪机设备维修时间
-
+            string[] punchingMachine = { "运行", "等待", "报警/维修", "换模" };
+            var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
+            var highmachineRepairTime = "倒计时" + DeviceRepairTime("高机铜排冲剪机").ToString() + "天";//高机铜排冲剪机设备保养信息
+            var kimFangyuanArlamTimeSpanString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机")
+                + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")));//获取金方圆铜排冲剪机设备维修时间
 
-            var kimFangyuanArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")).ToString();
-            var kimFangyuanArlamDouble = DeviceAlarmTime("金方圆数控母线冲孔机");
+            var highmachineArlamTimeSpanString = Convert.ToString(DevicMainTableTime("高机铜排冲剪机")
+                + TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("高机母线冲剪机")));//获取高机铜排冲剪机设备维修时间
 
-            var highmachineArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("高机母线冲剪机")).ToString();
-            var highmachineArlamDouble = DeviceAlarmTime("高机母线冲剪机");
+            var kimFangyuanArlamDouble = DeviceAlarmTime("金方圆数控母线冲孔机")
+                + DeviceTimeValue("金方圆数控母线冲孔机", "维修时间") + DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;
+            var highmachineArlamDouble = DeviceAlarmTime("高机母线冲剪机")
+                + DeviceTimeValue("高机母线冲剪机", "维修时间") + DevicMainTableTime("高机铜排冲剪机").TotalSeconds;
 
             var kimFangyuanRunTime = DeviceTimeValue("金方圆数控母线冲孔机", "运行标志位");//金方圆数控母线冲孔机运行时间
             var kimFangyuanRunTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanRunTime)).ToString();
 
-            var kimFangyuanStopTime = DeviceTimeValue("金方圆数控母线冲孔机", "停止标志位") - DevicScheduleStop("金方圆数控母线冲孔机");//金方圆数控母线冲孔机等待时间
-            var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
+            var highmachineRunTime = DeviceTimeValue("高机母线冲剪机", "运行标志位"); ;//高机母线冲剪机运行时间
+            var highmachineRunTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineRunTime)).ToString();
 
             var kimFangyuanMoldTime = DeviceTimeValue("金方圆数控母线冲孔机", "换模标志位");//金方圆数控母线冲孔机换模时间
             var kimFangyuanMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanMoldTime)).ToString();
 
-            var highmachineRunTime = DeviceTimeValue("高机母线冲剪机", "运行标志位"); ;//高机母线冲剪机运行时间
-            var highmachineRunTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineRunTime)).ToString();
-
             var highmachineMoldTime = DeviceTimeValue("高机母线冲剪机", "换模标志位");//高机母线冲剪机换模时间
             var highmachineMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineMoldTime)).ToString();
 
-            var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
-            var highmachineRepairTime = "倒计时" + DeviceRepairTime("高机铜排冲剪机").ToString() + "天";//高机铜排冲剪机设备保养信息
 
-            var highmachineStopTime = HighDeviceWaitTime("高机母线冲剪机") - DevicScheduleStop("高机母线冲剪机") - DeviceAlarmTime("高机母线冲剪机") - highmachineRunTime - highmachineMoldTime - DeviceTimeValue("高机母线冲剪机", "维修时间");//高机母线冲剪机等待时间
-            var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
+            double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+            var kimFangyuanStopTime = totalTimeOfDay - kimFangyuanRunTime - kimFangyuanMoldTime - DevicScheduleStop("金方圆数控母线冲孔机") - kimFangyuanArlamDouble;//金方圆数控母线冲孔机等待时间
+            var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
 
+            var highmachineStopTime = totalTimeOfDay - highmachineRunTime - highmachineMoldTime - DevicScheduleStop("高机母线冲剪机") - highmachineArlamDouble;//高机母线冲剪机等待时间
+            var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
 
             var kimFangyuanTimeValue = new double[] { kimFangyuanRunTime, kimFangyuanStopTime, kimFangyuanArlamDouble, kimFangyuanMoldTime };
             var highmachineTimeValue = new double[] { highmachineRunTime, highmachineStopTime, highmachineArlamDouble, highmachineMoldTime };
@@ -133,17 +118,17 @@ namespace SCADA_DAQ.Customer
 
             PunchingMachineEquipmentKanbanOne.DeviceNameOne.Value = highmachineRunTimeSpan;
             PunchingMachineEquipmentKanbanOne.DeviceNameTwo.Value = highmachineStopTimeSpan;
-            PunchingMachineEquipmentKanbanOne.DeviceNameThree.Value = highmachineArlamTimeSpan;
+            PunchingMachineEquipmentKanbanOne.DeviceNameThree.Value = kimFangyuanArlamTimeSpanString;
             PunchingMachineEquipmentKanbanOne.DeviceNameFour.Value = highmachineMoldTimeSpan;
-            PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineTimeMaintenanceTableString;
-            PunchingMachineEquipmentKanbanOne.DeviceNameSix.Value = highmachineRepairTime;
+            //PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineTimeMaintenanceTableString;
+            PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineRepairTime;
 
             PunchingMachineEquipmentKanbanTwo.DeviceNameOne.Value = kimFangyuanRunTimeSpan;
             PunchingMachineEquipmentKanbanTwo.DeviceNameTwo.Value = kimFangyuanStopTimeSpan;
-            PunchingMachineEquipmentKanbanTwo.DeviceNameThree.Value = kimFangyuanArlamTimeSpan;
+            PunchingMachineEquipmentKanbanTwo.DeviceNameThree.Value = highmachineArlamTimeSpanString;
             PunchingMachineEquipmentKanbanTwo.DeviceNameFour.Value = kimFangyuanMoldTimeSpan;
-            PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanTimeMaintenanceTableString;
-            PunchingMachineEquipmentKanbanTwo.DeviceNameSix.Value = kimFangyuanRepairTime;
+            //PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanTimeMaintenanceTableString;
+            PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanRepairTime;
 
         }
         public List<MachineInfoModel> deviceInformation { get; set; }
@@ -283,54 +268,37 @@ namespace SCADA_DAQ.Customer
                     GetScheduleStopTime();
                     GetDeviceAlarmTime();
                     GetHighDeviceWaitTime();
-                    //var kimFangyuanTimeMaintenanceTable = DevicMainTableTime("金方圆铜排冲剪机");//获取金方圆铜排冲剪机设备维修时间
-                    //var kimFangyuanTimeMaintenanceTableString = DevicMainTableTime("金方圆铜排冲剪机").ToString();
-
-                    //var highmachineTimeMaintenanceTable = DevicMainTableTime("高机铜排冲剪机");//获取高机铜排冲剪机设备维修时间
-                    //var highmachineTimeMaintenanceTableString = DevicMainTableTime("高机铜排冲剪机").ToString();
-
-                    var kimFangyuanTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机") + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")));//获取金方圆铜排冲剪机设备维修时间
-
-                    var highmachineTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("高机铜排冲剪机") + TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "维修时间")));//获取高机铜排冲剪机设备维修时间
-                    //var kimFangyuanArlamTime = kimFangyuanTimeMaintenanceTable.TotalSeconds * 0.2;//金方圆铜排冲剪机设备报警时间单位秒
-                    //var kimFangyuanArlamTimeSpan = TimeSpan.FromSeconds(kimFangyuanArlamTime).ToString();
-                    //var kimFangyuanArlamDouble = Convert.ToDouble(kimFangyuanArlamTime);
-
-                    //var highmachineArlamTime = highmachineTimeMaintenanceTable.TotalSeconds * 0.2;//高机铜排冲剪机设备报警时间单位秒
-                    //var highmachineArlamTimeSpan = TimeSpan.FromSeconds(highmachineArlamTime).ToString();
-                    //var highmachineArlamDouble = Convert.ToDouble(highmachineArlamTime);
-
-                    //var kimFangyuanArlamTimeSpan = DeviceTimeValue("金方圆数控母线冲孔机", "故障标志位").ToString();
-                    //var kimFangyuanArlamDouble = DeviceTimeValue("金方圆数控母线冲孔机", "故障标志位");
+                    var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
+                    var highmachineRepairTime = "倒计时" + DeviceRepairTime("高机铜排冲剪机").ToString() + "天";//高机铜排冲剪机设备保养信息
+                    var kimFangyuanArlamTimeSpanString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机")
+                        + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")));//获取金方圆铜排冲剪机设备维修时间
 
-                    //var highmachineArlamTimeSpan = DeviceTimeValue("高机母线冲剪机", "故障标志位").ToString();
-                    //var highmachineArlamDouble = DeviceTimeValue("高机母线冲剪机", "故障标志位");
-                    var kimFangyuanArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")).ToString();
-                    var kimFangyuanArlamDouble = DeviceAlarmTime("金方圆数控母线冲孔机");
+                    var highmachineArlamTimeSpanString = Convert.ToString(DevicMainTableTime("高机铜排冲剪机")
+                        + TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("高机母线冲剪机")));//获取高机铜排冲剪机设备维修时间
 
-                    var highmachineArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("高机母线冲剪机")).ToString();
-                    var highmachineArlamDouble = DeviceAlarmTime("高机母线冲剪机");
+                    var kimFangyuanArlamDouble = DeviceAlarmTime("金方圆数控母线冲孔机")
+                        + DeviceTimeValue("金方圆数控母线冲孔机", "维修时间") + DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;
+                    var highmachineArlamDouble = DeviceAlarmTime("高机母线冲剪机")
+                        + DeviceTimeValue("高机母线冲剪机", "维修时间") + DevicMainTableTime("高机铜排冲剪机").TotalSeconds;
 
-                    string[] punchingMachine = { "运行", "等待", "报警", "换模" };
                     var kimFangyuanRunTime = DeviceTimeValue("金方圆数控母线冲孔机", "运行标志位");//金方圆数控母线冲孔机运行时间
                     var kimFangyuanRunTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanRunTime)).ToString();
 
-                    var kimFangyuanStopTime = DeviceTimeValue("金方圆数控母线冲孔机", "停止标志位") - DevicScheduleStop("金方圆数控母线冲孔机");//金方圆数控母线冲孔机等待时间
-                    var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
+                    var highmachineRunTime = DeviceTimeValue("高机母线冲剪机", "运行标志位"); ;//高机母线冲剪机运行时间
+                    var highmachineRunTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineRunTime)).ToString();
 
                     var kimFangyuanMoldTime = DeviceTimeValue("金方圆数控母线冲孔机", "换模标志位");//金方圆数控母线冲孔机换模时间
                     var kimFangyuanMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanMoldTime)).ToString();
 
-                    var highmachineRunTime = DeviceTimeValue("高机母线冲剪机", "运行标志位"); ;//高机母线冲剪机运行时间
-                    var highmachineRunTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineRunTime)).ToString();
-
                     var highmachineMoldTime = DeviceTimeValue("高机母线冲剪机", "换模标志位");//高机母线冲剪机换模时间
                     var highmachineMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineMoldTime)).ToString();
 
-                    var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
-                    var highmachineRepairTime = "倒计时" + DeviceRepairTime("高机铜排冲剪机").ToString() + "天";//高机铜排冲剪机设备保养信息
 
-                    var highmachineStopTime = HighDeviceWaitTime("高机母线冲剪机") - DevicScheduleStop("高机母线冲剪机") - DeviceAlarmTime("高机母线冲剪机") - highmachineRunTime - highmachineMoldTime - DeviceTimeValue("高机母线冲剪机", "维修时间");//高机母线冲剪机等待时间
+                    double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+                    var kimFangyuanStopTime = totalTimeOfDay - kimFangyuanRunTime - kimFangyuanMoldTime - DevicScheduleStop("金方圆数控母线冲孔机") - kimFangyuanArlamDouble;//金方圆数控母线冲孔机等待时间
+                    var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
+
+                    var highmachineStopTime = totalTimeOfDay - highmachineRunTime - highmachineMoldTime - DevicScheduleStop("高机母线冲剪机") - highmachineArlamDouble;//高机母线冲剪机等待时间
                     var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
 
                     var kimFangyuanTimeValue = new double[] { kimFangyuanRunTime, kimFangyuanStopTime, kimFangyuanArlamDouble, kimFangyuanMoldTime };
@@ -338,6 +306,7 @@ namespace SCADA_DAQ.Customer
                     //TimeResult[0] = $"{timespanOne.Hours.ToString("00")}时 {timespanOne.Minutes.ToString("00")}分 {timespanOne.Seconds.ToString("00")}秒";
                     //countdown[0] = "倒计时" + $"{timefinalResult}" + "天";
                     //var waitTime = $"{waitTimeResult.Hours.ToString("00")}时 {waitTimeResult.Minutes.ToString("00")}分 {Convert.ToInt32(waitTimeResult.Seconds).ToString("00")}秒";
+                    string[] punchingMachine = { "运行", "等待", "报警/维修", "换模" };
                     for (int k = 0; k < punchingMachine.Length; k++)
                     {
                         highmachineValue[k].Value = highmachineTimeValue[k];
@@ -357,17 +326,17 @@ namespace SCADA_DAQ.Customer
                         HighMachinePunchingMachine.Update();
                         PunchingMachineEquipmentKanbanOne.DeviceNameOne.Value = highmachineRunTimeSpan;
                         PunchingMachineEquipmentKanbanOne.DeviceNameTwo.Value = highmachineStopTimeSpan;
-                        PunchingMachineEquipmentKanbanOne.DeviceNameThree.Value = highmachineArlamTimeSpan;
+                        PunchingMachineEquipmentKanbanOne.DeviceNameThree.Value = kimFangyuanArlamTimeSpanString;
                         PunchingMachineEquipmentKanbanOne.DeviceNameFour.Value = highmachineMoldTimeSpan;
-                        PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineTimeMaintenanceTableString;
-                        PunchingMachineEquipmentKanbanOne.DeviceNameSix.Value = highmachineRepairTime;
+                        //PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineTimeMaintenanceTableString;
+                        PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineRepairTime;
 
                         PunchingMachineEquipmentKanbanTwo.DeviceNameOne.Value = kimFangyuanRunTimeSpan;
                         PunchingMachineEquipmentKanbanTwo.DeviceNameTwo.Value = kimFangyuanStopTimeSpan;
-                        PunchingMachineEquipmentKanbanTwo.DeviceNameThree.Value = kimFangyuanArlamTimeSpan;
+                        PunchingMachineEquipmentKanbanTwo.DeviceNameThree.Value = highmachineArlamTimeSpanString;
                         PunchingMachineEquipmentKanbanTwo.DeviceNameFour.Value = kimFangyuanMoldTimeSpan;
-                        PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanTimeMaintenanceTableString;
-                        PunchingMachineEquipmentKanbanTwo.DeviceNameSix.Value = kimFangyuanRepairTime;
+                        //PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanTimeMaintenanceTableString;
+                        PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanRepairTime;
 
                     }));
                 }

+ 6 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/LaserAndDigitalPunchingEquipmentWidget.xaml

@@ -25,7 +25,8 @@
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="18"
-                   Foreground="Cyan"/>
+                   Foreground="Cyan"
+                   Margin="0,0,0,40"/>
             <uct:UctLaserMmachinePieChart x:Name="LaserMmachineOne" Margin="8.8"/>
         </Grid>
         <Grid Grid.Column="1" Grid.Row="1">
@@ -34,7 +35,8 @@
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="18"
-                    Foreground="Cyan"/>
+                    Foreground="Cyan"
+                    Margin="0,0,0,60"/>
             <uct:UctLaserMmachinePieChart x:Name="SiemensNumberPunch" Margin="8.8"/>
         </Grid>
         <Grid Grid.Column="2" Grid.Row="1">
@@ -43,7 +45,8 @@
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="18"
-                   Foreground="Cyan"/>
+                   Foreground="Cyan"
+                   Margin="0,0,0,60"/>
             <uct:UctLaserMmachinePieChart x:Name="DoubleBlessingNumberRush" Margin="8.8"/>
         </Grid>
     </Grid>

+ 83 - 94
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/LaserAndDigitalPunchingEquipmentWidget.xaml.cs

@@ -50,73 +50,60 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             GetRepairTime();
             GetDeviceAlarmTime();
             GetHighDeviceWorkTime();
-            var laserTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("激光机") + TimeSpan.FromSeconds(DeviceTimeValue("激光机", "维修时间")));
 
-            var siemensTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("西门子840D数冲") + TimeSpan.FromSeconds(DeviceTimeValue("西门子840D数冲", "维修时间")));
-
-            var behwifTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("倍福数冲机") + TimeSpan.FromSeconds(DeviceTimeValue("倍福数冲机", "维修时间")));
-            //var laserTimeMaintenanceTable = DevicMainTableTime("激光机");//获取激光机设备维修时间
-            //var laserTimeMaintenanceTableString = DevicMainTableTime("激光机").ToString();//获取激光机设备维修时间
-            //var siemensTimeMaintenanceTable = DevicMainTableTime("西门子840D数冲");//获取西门子840D数冲设备维修时间
-            //var siemensTimeMaintenanceTableString = DevicMainTableTime("西门子840D数冲").ToString();//获取西门子840D数冲设备维修时间
-            //var behwifTimeMaintenanceTable = DevicMainTableTime("倍福数冲");//获取倍福数冲设备维修时间
-            //var behwifTimeMaintenanceTableString = DevicMainTableTime("倍福数冲").ToString();//获取倍福数冲设备维修时间
-
-            //var laserArlamTime = laserTimeMaintenanceTable.TotalSeconds * 0.2;//激光机设备报警时间单位秒
-            //var laserArlamTimeSpan = TimeSpan.FromSeconds(laserArlamTime).ToString();
-            //var laserArlamDouble = Convert.ToDouble(laserArlamTime);
-
-            //var siemensArlamTime = siemensTimeMaintenanceTable.TotalSeconds * 0.2;//西门子设备报警时间单位秒
-            //var siemensArlamTimeSpan = TimeSpan.FromSeconds(siemensArlamTime).ToString();
-            //var siemensArlamDouble = Convert.ToDouble(siemensArlamTime);
+            var laserRepairTime = "倒计时" + DeviceRepairTime("激光机").ToString() + "天";//激光机设备保养信息
+            var siemensRepairTime = "倒计时" + DeviceRepairTime("西门子840D数冲").ToString() + "天";//西门子设备保养信息
+            var behwifRepairTime = "倒计时" + DeviceRepairTime("倍福数冲").ToString() + "天";//倍福数冲设备保养信息
 
-            //var behwiftArlamTime = behwifTimeMaintenanceTable.TotalSeconds * 0.2;//倍福数冲设备报警时间单位秒
-            //var behwiftArlamTimeSpan = TimeSpan.FromSeconds(behwiftArlamTime).ToString();
-            //var bewiftArlamDouble = Convert.ToDouble(behwiftArlamTime);
+            var laserArlamString = Convert.ToString(DevicMainTableTime("激光机")
+                + TimeSpan.FromSeconds(DeviceTimeValue("激光机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("激光机")));
 
+            var siemensArlamString = Convert.ToString(DevicMainTableTime("西门子840D数冲")
+                + TimeSpan.FromSeconds(DeviceTimeValue("西门子840D数冲", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("西门子840D数冲")));
 
-            var laserArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("激光机")).ToString();
-            var laserArlamDouble = DeviceAlarmTime("激光机");
+            var behwiftArlamString = Convert.ToString(DevicMainTableTime("倍福数冲机")
+                + TimeSpan.FromSeconds(DeviceTimeValue("倍福数冲机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("倍福数冲机")));
 
-            var siemensArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("西门子840D数冲")).ToString();
-            var siemensArlamDouble = DeviceAlarmTime("西门子840D数冲");
+            var laserArlamDouble = DeviceAlarmTime("激光机") + DevicMainTableTime("激光机").TotalSeconds + DeviceTimeValue("激光机", "维修时间");
+            var siemensArlamDouble = DeviceAlarmTime("西门子840D数冲") + DevicMainTableTime("西门子840D数冲").TotalSeconds + DeviceTimeValue("西门子840D数冲", "维修时间");
+            var bewiftArlamDouble = DeviceAlarmTime("倍福数冲机") + DevicMainTableTime("倍福数冲机").TotalSeconds + DeviceTimeValue("倍福数冲机", "维修时间");
 
-            var behwiftArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("倍福数冲机")).ToString();
-            var bewiftArlamDouble = DeviceAlarmTime("倍福数冲机");
 
             var laserRunTime = DeviceTimeValue("激光机", "运行标志位");//激光机运行时间
             var laserRunTimeSpan = TimeSpan.FromSeconds(Math.Round(laserRunTime)).ToString();
 
-            var laserStopTime = DeviceTimeValue("激光机", "停止标志位") - DevicScheduleStop("激光机") ;//激光机等待时间
-            var laserStopTimeSpan = TimeSpan.FromSeconds(Math.Round(laserStopTime)).ToString();
-
             var siemensRunTime = DeviceTimeValue("西门子840D数冲", "运行标志位");//西门子运行时间
             var siemensRunTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensRunTime)).ToString();
 
-            var siemensStopTime = AllDeviceWorkTime("西门子840D数冲") - DevicScheduleStop("西门子840D数冲") ;//西门子等待时间
-            var siemensStopTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensStopTime)).ToString();
-
-            var siemensMoldTime = DeviceTimeValue("西门子840D数冲", "换模标志位");//西门子换模时间
-            var siemensMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensMoldTime)).ToString();
-
             var behwiftRunTime = DeviceTimeValue("倍福数冲机", "运行标志位"); ;//倍福数冲运行时间
             var behwiftRunTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftRunTime)).ToString();
 
-            var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位") - DevicScheduleStop("倍福数冲机") ;//倍福数冲等待时间
-            var behwiftStopTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftStopTime)).ToString();
+            var siemensMoldTime = DeviceTimeValue("西门子840D数冲", "换模标志位");//西门子换模时间
+            var siemensMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensMoldTime)).ToString();
 
             var behwiftMoldTime = DeviceTimeValue("倍福数冲机", "换模标志位");//倍福数冲换模时间
             var behwiftMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftMoldTime)).ToString();
 
-            var laserRepairTime = "倒计时" + DeviceRepairTime("激光机").ToString() + "天";//激光机设备保养信息
-            var siemensRepairTime = "倒计时" + DeviceRepairTime("西门子840D数冲").ToString() + "天";//西门子设备保养信息
-            var behwifRepairTime = "倒计时" + DeviceRepairTime("倍福数冲").ToString() + "天";//倍福数冲设备保养信息
+
+            double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+
+            //var laserStopTime = DeviceTimeValue("激光机", "停止标志位") - DevicScheduleStop("激光机");//激光机等待时间
+            //var siemensStopTime = AllDeviceWorkTime("西门子840D数冲") - DevicScheduleStop("西门子840D数冲");//西门子等待时间
+            //var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位") - DevicScheduleStop("倍福数冲机");//倍福数冲等待时间
+            var laserStopTime = totalTimeOfDay - laserRunTime  -DevicScheduleStop("激光机")- laserArlamDouble;//激光机等待时间
+            var siemensStopTime = totalTimeOfDay - siemensRunTime- siemensMoldTime- DevicScheduleStop("西门子840D数冲")- siemensArlamDouble;//西门子等待时间
+            var behwiftStopTime = totalTimeOfDay - behwiftRunTime- behwiftMoldTime-DevicScheduleStop("倍福数冲机")- bewiftArlamDouble;//倍福数冲等待时间
+
+
+            var laserStopTimeSpan = TimeSpan.FromSeconds(Math.Round(laserStopTime)).ToString();
+            var siemensStopTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensStopTime)).ToString();
+            var behwiftStopTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftStopTime)).ToString();
 
             var laserTimeValue = new double[] { laserRunTime, laserStopTime, laserArlamDouble };
             var siemensTimeValue = new double[] { siemensRunTime, siemensStopTime, siemensArlamDouble, siemensMoldTime };
             var behwiftTimeValue = new double[] { behwiftRunTime, behwiftStopTime, bewiftArlamDouble, behwiftMoldTime };
-            string[] laserDeviceStatus = { "运行", "等待", "报警" };
-            string[] deviceStatus = { "运行", "等待", "报警", "换模" };
+            string[] laserDeviceStatus = { "运行", "等待", "报警/维修" };
+            string[] deviceStatus = { "运行", "等待", "报警/维修", "换模" };
 
             for (int k = 0; k < laserDeviceStatus.Length; k++)
             {
@@ -153,41 +140,38 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
 
             LaserCountingPunchesOne.DeviceNameOne.Value = laserRunTimeSpan;
             LaserCountingPunchesOne.DeviceNameTwo.Value = laserStopTimeSpan;
-            LaserCountingPunchesOne.DeviceNameThree.Value = laserArlamTimeSpan;
-            LaserCountingPunchesOne.DeviceNameFour.Value = laserTimeMaintenanceTableString;
-            LaserCountingPunchesOne.DeviceNameFive.Value = laserRepairTime;
+            LaserCountingPunchesOne.DeviceNameThree.Value = laserArlamString;
+            //LaserCountingPunchesOne.DeviceNameFour.Value = laserTimeMaintenanceTableString;
+            LaserCountingPunchesOne.DeviceNameFour.Value = laserRepairTime;
 
             LaserCountingPunchesTwo.DeviceNameOne.Value = siemensRunTimeSpan;
             LaserCountingPunchesTwo.DeviceNameTwo.Value = siemensStopTimeSpan;
-            LaserCountingPunchesTwo.DeviceNameThree.Value = siemensArlamTimeSpan;
+            LaserCountingPunchesTwo.DeviceNameThree.Value = siemensArlamString;
             LaserCountingPunchesTwo.DeviceNameFour.Value = siemensMoldTimeSpan;
-            LaserCountingPunchesTwo.DeviceNameFive.Value = siemensTimeMaintenanceTableString;
-            LaserCountingPunchesTwo.DeviceNameSix.Value = siemensRepairTime;
+            //LaserCountingPunchesTwo.DeviceNameFive.Value = siemensTimeMaintenanceTableString;
+            LaserCountingPunchesTwo.DeviceNameFive.Value = siemensRepairTime;
 
             LaserCountingPunchesThree.DeviceNameOne.Value = behwiftRunTimeSpan;
             LaserCountingPunchesThree.DeviceNameTwo.Value = behwiftStopTimeSpan;
-            LaserCountingPunchesThree.DeviceNameThree.Value = behwiftArlamTimeSpan;
+            LaserCountingPunchesThree.DeviceNameThree.Value = behwiftArlamString;
             LaserCountingPunchesThree.DeviceNameFour.Value = behwiftMoldTimeSpan;
-            LaserCountingPunchesThree.DeviceNameFive.Value = behwifTimeMaintenanceTableString;
-            LaserCountingPunchesThree.DeviceNameSix.Value = behwifRepairTime;
+            //LaserCountingPunchesThree.DeviceNameFive.Value = behwifTimeMaintenanceTableString;
+            LaserCountingPunchesThree.DeviceNameFive.Value = behwifRepairTime;
 
             // 界面文本
             LaserCountingPunchesOne.Title = new string[] { "激光机运行时间:",
                 "激光机等待时间:",
-                "激光机报警时间:",
-                "激光机维修时间:",
+                "激光机报警/维修时间:",
                 "激光机维保时间:"};
             LaserCountingPunchesTwo.Title = new string[] { "西门子数冲运行时间:",
                 "西门子数冲等待时间:",
-                "西门子数报警时间:",
+                "西门子数报警/维修时间:",
                 "西门子数冲换模时间",
-                "西门子数冲维修时间:",
                 "西门子数冲维保时间:"};
             LaserCountingPunchesThree.Title = new string[] { "倍福数冲运行时间:",
                 "倍福数冲等待时间:",
-                "倍福数冲报警时间:",
+                "倍福数冲报警/维修时间:",
                 "倍福数冲换模时间",
-                "倍福数冲维修时间:",
                 "倍福数冲维保时间:"};
 
             LaserMmachineOne.ChartInit(laserValue);
@@ -328,11 +312,7 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
                     GetRepairTime();
                     GetDeviceAlarmTime();
                     GetHighDeviceWorkTime();
-                    var laserTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("激光机") + TimeSpan.FromSeconds(DeviceTimeValue("激光机", "维修时间")));
-
-                    var siemensTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("西门子840D数冲") + TimeSpan.FromSeconds(DeviceTimeValue("西门子840D数冲", "维修时间")));
 
-                    var behwifTimeMaintenanceTableString = Convert.ToString(DevicMainTableTime("倍福数冲机") + TimeSpan.FromSeconds(DeviceTimeValue("倍福数冲机", "维修时间")));
                     //var laserTimeMaintenanceTable = DevicMainTableTime("激光机");//获取激光机设备维修时间
                     //var laserTimeMaintenanceTableString = DevicMainTableTime("激光机").ToString();//获取激光机设备维修时间
                     //var siemensTimeMaintenanceTable = DevicMainTableTime("西门子840D数冲");//获取西门子840D数冲设备维修时间
@@ -351,51 +331,61 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
                     //var behwiftArlamTime = behwifTimeMaintenanceTable.TotalSeconds * 0.2;//倍福数冲设备报警时间单位秒
                     //var behwiftArlamTimeSpan = TimeSpan.FromSeconds(behwiftArlamTime).ToString();
                     //var bewiftArlamDouble = Convert.ToDouble(behwiftArlamTime);
-                    var laserArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("激光机")).ToString();
-                    var laserArlamDouble = DeviceAlarmTime("激光机");
 
-                    var siemensArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("西门子840D数冲")).ToString();
-                    var siemensArlamDouble = DeviceAlarmTime("西门子840D数冲");
+                    var laserRepairTime = "倒计时" + DeviceRepairTime("激光机").ToString() + "天";//激光机设备保养信息
+                    var siemensRepairTime = "倒计时" + DeviceRepairTime("西门子840D数冲").ToString() + "天";//西门子设备保养信息
+                    var behwifRepairTime = "倒计时" + DeviceRepairTime("倍福数冲").ToString() + "天";//倍福数冲设备保养信息
+
+                    var laserArlamString = Convert.ToString(DevicMainTableTime("激光机")
+                        + TimeSpan.FromSeconds(DeviceTimeValue("激光机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("激光机")));
+
+                    var siemensArlamString = Convert.ToString(DevicMainTableTime("西门子840D数冲")
+                        + TimeSpan.FromSeconds(DeviceTimeValue("西门子840D数冲", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("西门子840D数冲")));
+
+                    var behwiftArlamString = Convert.ToString(DevicMainTableTime("倍福数冲机")
+                        + TimeSpan.FromSeconds(DeviceTimeValue("倍福数冲机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("倍福数冲机")));
+
+                    var laserArlamDouble = DeviceAlarmTime("激光机") + DevicMainTableTime("激光机").TotalSeconds + DeviceTimeValue("激光机", "维修时间");
+                    var siemensArlamDouble = DeviceAlarmTime("西门子840D数冲") + DevicMainTableTime("西门子840D数冲").TotalSeconds + DeviceTimeValue("西门子840D数冲", "维修时间");
+                    var bewiftArlamDouble = DeviceAlarmTime("倍福数冲机") + DevicMainTableTime("倍福数冲机").TotalSeconds + DeviceTimeValue("倍福数冲机", "维修时间");
 
-                    var behwiftArlamTimeSpan = TimeSpan.FromSeconds(DeviceAlarmTime("倍福数冲机")).ToString();
-                    var bewiftArlamDouble = DeviceAlarmTime("倍福数冲机");
 
                     var laserRunTime = DeviceTimeValue("激光机", "运行标志位");//激光机运行时间
                     var laserRunTimeSpan = TimeSpan.FromSeconds(Math.Round(laserRunTime)).ToString();
 
-                    var laserStopTime = DeviceTimeValue("激光机", "停止标志位") - DevicScheduleStop("激光机");//激光机等待时间
-                    var laserStopTimeSpan = TimeSpan.FromSeconds(Math.Round(laserStopTime)).ToString();
-
                     var siemensRunTime = DeviceTimeValue("西门子840D数冲", "运行标志位");//西门子运行时间
                     var siemensRunTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensRunTime)).ToString();
 
-                    var siemensStopTime = AllDeviceWorkTime("西门子840D数冲") - DevicScheduleStop("西门子840D数冲");//西门子等待时间
-                    var siemensStopTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensStopTime)).ToString();
-
-                    var siemensMoldTime = DeviceTimeValue("西门子840D数冲", "换模标志位");//西门子换模时间
-                    var siemensMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensMoldTime)).ToString();
-
                     var behwiftRunTime = DeviceTimeValue("倍福数冲机", "运行标志位"); ;//倍福数冲运行时间
                     var behwiftRunTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftRunTime)).ToString();
 
-                    var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位") - DevicScheduleStop("倍福数冲机");//倍福数冲等待时间
-                    var behwiftStopTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftStopTime)).ToString();
+                    var siemensMoldTime = DeviceTimeValue("西门子840D数冲", "换模标志位");//西门子换模时间
+                    var siemensMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensMoldTime)).ToString();
 
                     var behwiftMoldTime = DeviceTimeValue("倍福数冲机", "换模标志位");//倍福数冲换模时间
                     var behwiftMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftMoldTime)).ToString();
 
-                    var laserRepairTime = "倒计时" + DeviceRepairTime("激光机").ToString() + "天";//激光机设备保养信息
-                    var siemensRepairTime = "倒计时" + DeviceRepairTime("西门子840D数冲").ToString() + "天";//西门子设备保养信息
-                    var behwifRepairTime = "倒计时" + DeviceRepairTime("倍福数冲").ToString() + "天";//倍福数冲设备保养信息
 
+                    double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
 
+                    //var laserStopTime = DeviceTimeValue("激光机", "停止标志位") - DevicScheduleStop("激光机");//激光机等待时间
+                    //var siemensStopTime = AllDeviceWorkTime("西门子840D数冲") - DevicScheduleStop("西门子840D数冲");//西门子等待时间
+                    //var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位") - DevicScheduleStop("倍福数冲机");//倍福数冲等待时间
+                    var laserStopTime = totalTimeOfDay - laserRunTime - DevicScheduleStop("激光机") - laserArlamDouble;//激光机等待时间
+                    var siemensStopTime = totalTimeOfDay - siemensRunTime - siemensMoldTime - DevicScheduleStop("西门子840D数冲") - siemensArlamDouble;//西门子等待时间
+                    var behwiftStopTime = totalTimeOfDay - behwiftRunTime - behwiftMoldTime - DevicScheduleStop("倍福数冲机") - bewiftArlamDouble;//倍福数冲等待时间
+
+
+                    var laserStopTimeSpan = TimeSpan.FromSeconds(Math.Round(laserStopTime)).ToString();
+                    var siemensStopTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensStopTime)).ToString();
+                    var behwiftStopTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftStopTime)).ToString();
 
 
                     var laserTimeValue = new double[] { laserRunTime, laserStopTime, laserArlamDouble };
                     var siemensTimeValue = new double[] { siemensRunTime, siemensStopTime, siemensArlamDouble, siemensMoldTime };
                     var behwiftTimeValue = new double[] { behwiftRunTime, behwiftStopTime, bewiftArlamDouble, behwiftMoldTime };
-                    string[] laserDeviceStatus = { "运行", "等待", "报警" };
-                    string[] deviceStatus = { "运行", "等待", "报警", "换模" };
+                    string[] laserDeviceStatus = { "运行", "等待", "报警/维修" };
+                    string[] deviceStatus = { "运行", "等待", "报警/维修", "换模" };
 
                     for (int i = 0; i < laserDeviceStatus.Length; i++)
                     {
@@ -419,26 +409,25 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
                         LaserMmachineOne.Update();
                         SiemensNumberPunch.Update();
                         DoubleBlessingNumberRush.Update();
-
                         LaserCountingPunchesOne.DeviceNameOne.Value = laserRunTimeSpan;
                         LaserCountingPunchesOne.DeviceNameTwo.Value = laserStopTimeSpan;
-                        LaserCountingPunchesOne.DeviceNameThree.Value = laserArlamTimeSpan;
-                        LaserCountingPunchesOne.DeviceNameFour.Value = laserTimeMaintenanceTableString;
-                        LaserCountingPunchesOne.DeviceNameFive.Value = laserRepairTime;
+                        LaserCountingPunchesOne.DeviceNameThree.Value = laserArlamString;
+                        //LaserCountingPunchesOne.DeviceNameFour.Value = laserTimeMaintenanceTableString;
+                        LaserCountingPunchesOne.DeviceNameFour.Value = laserRepairTime;
 
                         LaserCountingPunchesTwo.DeviceNameOne.Value = siemensRunTimeSpan;
                         LaserCountingPunchesTwo.DeviceNameTwo.Value = siemensStopTimeSpan;
-                        LaserCountingPunchesTwo.DeviceNameThree.Value = siemensArlamTimeSpan;
+                        LaserCountingPunchesTwo.DeviceNameThree.Value = siemensArlamString;
                         LaserCountingPunchesTwo.DeviceNameFour.Value = siemensMoldTimeSpan;
-                        LaserCountingPunchesTwo.DeviceNameFive.Value = siemensTimeMaintenanceTableString;
-                        LaserCountingPunchesTwo.DeviceNameSix.Value = siemensRepairTime;
+                        //LaserCountingPunchesTwo.DeviceNameFive.Value = siemensTimeMaintenanceTableString;
+                        LaserCountingPunchesTwo.DeviceNameFive.Value = siemensRepairTime;
 
                         LaserCountingPunchesThree.DeviceNameOne.Value = behwiftRunTimeSpan;
                         LaserCountingPunchesThree.DeviceNameTwo.Value = behwiftStopTimeSpan;
-                        LaserCountingPunchesThree.DeviceNameThree.Value = behwiftArlamTimeSpan;
+                        LaserCountingPunchesThree.DeviceNameThree.Value = behwiftArlamString;
                         LaserCountingPunchesThree.DeviceNameFour.Value = behwiftMoldTimeSpan;
-                        LaserCountingPunchesThree.DeviceNameFive.Value = behwifTimeMaintenanceTableString;
-                        LaserCountingPunchesThree.DeviceNameSix.Value = behwifRepairTime;
+                        //LaserCountingPunchesThree.DeviceNameFive.Value = behwifTimeMaintenanceTableString;
+                        LaserCountingPunchesThree.DeviceNameFive.Value = behwifRepairTime;
                     }));
 
                 }

+ 58 - 13
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/YaweiPressBrakeOneWidget.xaml

@@ -8,19 +8,64 @@
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
     <Grid>
-      <Grid>
-         <Grid.ColumnDefinitions>
-            <ColumnDefinition/>
-            <ColumnDefinition/>
-            <ColumnDefinition/>
-            <ColumnDefinition/>
-            <ColumnDefinition/>
-        </Grid.ColumnDefinitions>
-        <uct:UctYaweiPressBrakeOne x:Name="YaweiPressBrakeOne" />
-        <uct:UctYaweiPressBrakeOne x:Name="YaweiPressBrakeTwo" Grid.Column="1"/>
-        <uct:UctYaweiPressBrakeOne x:Name="YaweiPressBrakeThree" Grid.Column="2"/>
-        <uct:UctYaweiPressBrakeOne x:Name="YaweiPressBrakeFour" Grid.Column="3"/>
-        <uct:UctYaweiPressBrakeOne x:Name="YaweiPressBrakeFive" Grid.Column="4"/>
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition/>
+                <ColumnDefinition/>
+                <ColumnDefinition/>
+                <ColumnDefinition/>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <Grid Grid.Column="0">
+                <local:DashboardCard Margin="4"/>
+                <TextBlock Text="1号YaWei折弯机"
+                   HorizontalAlignment="Center"
+                   VerticalAlignment="Center"
+                   FontSize="18"
+                   Foreground="Cyan"
+                   Margin="0,0,0,50"/>
+                <uct:UctLaserMmachinePieChart x:Name="YaweiPressBrakeOne" />
+            </Grid>
+            <Grid Grid.Column="1">
+                <local:DashboardCard Margin="4"/>
+                <TextBlock Text="2号YaWei折弯机"
+                   HorizontalAlignment="Center"
+                   VerticalAlignment="Center"
+                   FontSize="18"
+                   Foreground="Cyan"
+                   Margin="0,0,0,50"/>
+                <uct:UctLaserMmachinePieChart x:Name="YaweiPressBrakeTwo" Grid.Column="1"/>
+            </Grid>
+            <Grid Grid.Column="2">
+                <local:DashboardCard Margin="4"/>
+                <TextBlock Text="3号YaWei折弯机"
+                   HorizontalAlignment="Center"
+                   VerticalAlignment="Center"
+                   FontSize="18"
+                   Foreground="Cyan"
+                   Margin="0,0,0,50"/>
+                <uct:UctLaserMmachinePieChart x:Name="YaweiPressBrakeThree" Grid.Column="2"/>
+            </Grid>
+            <Grid Grid.Column="3">
+                <local:DashboardCard Margin="4"/>
+                <TextBlock Text="亚威PBC折弯机"
+                   HorizontalAlignment="Center"
+                   VerticalAlignment="Center"
+                   FontSize="18"
+                   Foreground="Cyan"
+                   Margin="0,0,0,50"/>
+                <uct:UctLaserMmachinePieChart x:Name="YaweiPressBrakeFour" Grid.Column="3"/>
+            </Grid>
+            <Grid Grid.Column="5">
+                <local:DashboardCard Margin="4"/>
+                <TextBlock Text="百超折弯机"
+                   HorizontalAlignment="Center"
+                   VerticalAlignment="Center"
+                   FontSize="18"
+                   Foreground="Cyan"
+                   Margin="0,0,0,50"/>
+                <uct:UctLaserMmachinePieChart x:Name="YaweiPressBrakeFive" Grid.Column="4"/>
+            </Grid>
         </Grid>
     </Grid>
 </wpfcontrol:BaseUserControl>

+ 154 - 82
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/YaweiPressBrakeOneWidget.xaml.cs

@@ -34,78 +34,104 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
     public partial class YaweiPressBrakeOneWidget : BaseUserControl
     {
         private static SqlSchema.DIL.DILDB DAL = Env.SqlDAL;
-        private List<YaweiPressBrakeOneModel> pressBrakeOneValue = new List<YaweiPressBrakeOneModel>();
-        private List<YaweiPressBrakeOneModel> pressBrakeTwoValue = new List<YaweiPressBrakeOneModel>();
-        private List<YaweiPressBrakeOneModel> pressBrakeThreeValue = new List<YaweiPressBrakeOneModel>();
-        private List<YaweiPressBrakeOneModel> pressBrakeFourValue = new List<YaweiPressBrakeOneModel>();
-        private List<YaweiPressBrakeOneModel> pressBrakeFiveValue = new List<YaweiPressBrakeOneModel>();
+        //private List<YaweiPressBrakeOneModel> pressBrakeOneValue = new List<YaweiPressBrakeOneModel>();
+        //private List<YaweiPressBrakeOneModel> pressBrakeTwoValue = new List<YaweiPressBrakeOneModel>();
+        //private List<YaweiPressBrakeOneModel> pressBrakeThreeValue = new List<YaweiPressBrakeOneModel>();
+        //private List<YaweiPressBrakeOneModel> pressBrakeFourValue = new List<YaweiPressBrakeOneModel>();
+        //private List<YaweiPressBrakeOneModel> pressBrakeFiveValue = new List<YaweiPressBrakeOneModel>();
+
+        private List<LaserMmachinePieChartModel> pressBrakeOneValue = new List<LaserMmachinePieChartModel>();
+        private List<LaserMmachinePieChartModel> pressBrakeTwoValue = new List<LaserMmachinePieChartModel>();
+        private List<LaserMmachinePieChartModel> pressBrakeThreeValue = new List<LaserMmachinePieChartModel>();
+        private List<LaserMmachinePieChartModel> pressBrakeFourValue = new List<LaserMmachinePieChartModel>();
+        private List<LaserMmachinePieChartModel> pressBrakeFiveValue = new List<LaserMmachinePieChartModel>();
         public YaweiPressBrakeOneWidget()
         {
             InitializeComponent();
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
             GetDBData();
             GetScheduleStopTime();
-            string[] bending = { "运行", "等待", "换模" };
+            GetTableTime();
+            string[] deviceStatus = { "运行", "等待", "报警/维修", "换模" };
             var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
-            var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位")- DevicScheduleStop("1号YaWei折弯机");//1号YaWei折弯机等待时间
+            //var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位")- DevicScheduleStop("1号YaWei折弯机");//1号YaWei折弯机等待时间
             var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
             var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
-            var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位") - DevicScheduleStop("2号YaWei折弯机");//2号YaWei折弯机等待时间
+            //var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位") - DevicScheduleStop("2号YaWei折弯机");//2号YaWei折弯机等待时间
             var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
 
             var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位"); ;//3号YaWei折弯机运行时间
-            var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位") - DevicScheduleStop("3号YaWei折弯机");//3号YaWei折弯机等待时间
+            //var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位") - DevicScheduleStop("3号YaWei折弯机");//3号YaWei折弯机等待时间
             var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
 
             var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位"); ;//亚威PBC折弯机运行时间
-            var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位") - DevicScheduleStop("亚威PBC折弯机");//亚威PBC折弯机等待时间
+            //var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位") - DevicScheduleStop("亚威PBC折弯机");//亚威PBC折弯机等待时间
             var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
 
             var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
-            var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位") - DevicScheduleStop("百超折弯机");//百超折弯机折弯机等待时间
+            //var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位") - DevicScheduleStop("百超折弯机");//百超折弯机折弯机等待时间
             var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
 
-            var firstYaWeiValueTime = new double[] { firstYaWeiRunTime, firstYaWeiStopTime , firstYaWeiMoldTime };
-            var sencondYaWeiValueTime = new double[] { sencondYaWeiRunTime, sencondYaWeiStopTime, sencondYaWeiMoldTime };
-            var thirdYaWeiValueTime = new double[] { thirdYaWweiRunTime, thirdYaWweiStopTime, thirdYaWweiMoldTime };
-            var pbcYaWeiValueTime = new double[] { pbcYaWweiRunTime,pbcYaWweiStopTime,pbcYaWweiMoldTime };
-            var baiChaoValueTime = new double[] { baiChaoRunTime, baiChaoStopTime , baiChaoMoldTime };
-
-
-            for (int k = 0; k < bending.Length; k++)
+            double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+            var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+                - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间");//1号YaWei折弯机等待时间
+            var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
+                - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间");//2号YaWei折弯机等待时间
+            var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
+                - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间");//3号YaWei折弯机等待时间
+            var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
+                - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间");//亚威PBC折弯机等待时间
+            var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
+                - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间");//百超折弯机折弯机等待时间
+
+
+            var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间");
+            var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间");
+            var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间");
+            var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").TotalSeconds + DeviceTimeValue("亚威PBC折弯机", "维修时间");
+            var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").TotalSeconds+ DeviceTimeValue("百超折弯机", "维修时间");
+
+            var firstYaWeiValueTime = new double[] { firstYaWeiRunTime, firstYaWeiStopTime, firstYaWeiTimeMaintenanceTable, firstYaWeiMoldTime };
+            var sencondYaWeiValueTime = new double[] { sencondYaWeiRunTime, sencondYaWeiStopTime, secondYaWeiTimeMaintenanceTable, sencondYaWeiMoldTime };
+            var thirdYaWeiValueTime = new double[] { thirdYaWweiRunTime, thirdYaWweiStopTime, thirdYaWeiTimeMaintenanceTable, thirdYaWweiMoldTime };
+            var pbcYaWeiValueTime = new double[] { pbcYaWweiRunTime, pbcYaWweiStopTime, pbcYaWweiTimeMaintenanceTable, pbcYaWweiMoldTime };
+            var baiChaoValueTime = new double[] { baiChaoRunTime, baiChaoStopTime, baiChaoTimeMaintenanceTable, baiChaoMoldTime };
+
+
+            for (int k = 0; k < deviceStatus.Length; k++)
             {
-                pressBrakeOneValue.Add(new YaweiPressBrakeOneModel() { ItemName = bending[k], Value = firstYaWeiValueTime[k], MyProperty = k });
+                pressBrakeOneValue.Add(new LaserMmachinePieChartModel() { ItemName = deviceStatus[k], Value = firstYaWeiValueTime[k], MyProperty = k });
 
             }
 
-            for (int k = 0; k < bending.Length; k++)
+            for (int k = 0; k < deviceStatus.Length; k++)
             {
-                pressBrakeTwoValue.Add(new YaweiPressBrakeOneModel() { ItemName = bending[k], Value = sencondYaWeiValueTime[k], MyProperty = k });
+                pressBrakeTwoValue.Add(new LaserMmachinePieChartModel() { ItemName = deviceStatus[k], Value = sencondYaWeiValueTime[k], MyProperty = k });
             }
 
-            for (int k = 0; k < bending.Length; k++)
+            for (int k = 0; k < deviceStatus.Length; k++)
             {
-                pressBrakeThreeValue.Add(new YaweiPressBrakeOneModel() { ItemName = bending[k], Value = thirdYaWeiValueTime[k], MyProperty = k });
+                pressBrakeThreeValue.Add(new LaserMmachinePieChartModel() { ItemName = deviceStatus[k], Value = thirdYaWeiValueTime[k], MyProperty = k });
             }
 
 
-            for (int k = 0; k < bending.Length; k++)
+            for (int k = 0; k < deviceStatus.Length; k++)
             {
-                pressBrakeFourValue.Add(new YaweiPressBrakeOneModel() { ItemName = bending[k], Value = pbcYaWeiValueTime[k], MyProperty = k });
+                pressBrakeFourValue.Add(new LaserMmachinePieChartModel() { ItemName = deviceStatus[k], Value = pbcYaWeiValueTime[k], MyProperty = k });
             }
 
 
-            for (int k = 0; k < bending.Length; k++)
+            for (int k = 0; k < deviceStatus.Length; k++)
             {
-                pressBrakeFiveValue.Add(new YaweiPressBrakeOneModel() { ItemName = bending[k], Value = baiChaoValueTime[k], MyProperty = k });
+                pressBrakeFiveValue.Add(new LaserMmachinePieChartModel() { ItemName = deviceStatus[k], Value = baiChaoValueTime[k], MyProperty = k });
             }
 
-            YaweiPressBrakeOne.ChartInit(pressBrakeOneValue, "1号YaWei折弯机");
-            YaweiPressBrakeTwo.ChartInit(pressBrakeTwoValue, "2号YaWei折弯机");
-            YaweiPressBrakeThree.ChartInit(pressBrakeThreeValue, "3号YaWei折弯机");
-            YaweiPressBrakeFour.ChartInit(pressBrakeFourValue, "亚威PBC折弯机");
-            YaweiPressBrakeFive.ChartInit(pressBrakeFiveValue, "Bystronic折弯机");
+            YaweiPressBrakeOne.ChartInit(pressBrakeOneValue);
+            YaweiPressBrakeTwo.ChartInit(pressBrakeTwoValue);
+            YaweiPressBrakeThree.ChartInit(pressBrakeThreeValue);
+            YaweiPressBrakeFour.ChartInit(pressBrakeFourValue);
+            YaweiPressBrakeFive.ChartInit(pressBrakeFiveValue);
 
         }
         public List<MachineInfoModel> deviceInformation { get; set; }
@@ -120,9 +146,9 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
 
 
             //获取当天所有设备信息
-             deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
-                .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime)?.ToList();
-           
+            deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
+               .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime)?.ToList();
+
         }
         public double DeviceTimeValue(string deviceName, string StateCode)
         {
@@ -143,8 +169,8 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
             var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
 
-             deviceScheduleStop = DAL.App_Vertiv_ScheduleStop.GetData<ScheduleStopModel>()?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();//获取当天所有设备计划停止信息
-            
+            deviceScheduleStop = DAL.App_Vertiv_ScheduleStop.GetData<ScheduleStopModel>()?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();//获取当天所有设备计划停止信息
+
         }
 
 
@@ -158,6 +184,33 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             }
             return Convert.ToDouble(scheduleStopTimeValue.TotalSeconds);
         }
+
+        public List<MaintenanceTableModel> deviceMaintenanceTable { get; set; }
+        public void GetTableTime()
+        {
+            //var classesStartTimeSpan = Env.Schedual.CurrentClasses.StartTime.ToString();
+            //var classesEndTimeSpan = Env.Schedual.CurrentClasses.EndTime.ToString();
+            //var classesStartTime = Convert.ToDateTime(classesStartTimeSpan);
+            //var classesEndTime = Convert.ToDateTime(classesEndTimeSpan);
+            var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
+            var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
+
+            deviceMaintenanceTable = DAL.App_Vertiv_MaintenanceTable.GetData<MaintenanceTableModel>()?
+               .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();//获取当天所有设备维修信息
+
+        }
+        public TimeSpan DevicMainTableTime(string deviceName)
+        {
+
+            var timeMaintenanceTable = deviceMaintenanceTable.ToLookup(t => t.DeviceName)[deviceName].Select(t => t.DurationTime);//获取设备维修时间
+            var MaintenanceTimeValue = new TimeSpan();
+            foreach (TimeSpan item in timeMaintenanceTable)
+            {
+                MaintenanceTimeValue = MaintenanceTimeValue + item;
+            }
+            return MaintenanceTimeValue;
+        }
+
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
         {
             try
@@ -167,65 +220,84 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
                 {
                     GetDBData();
                     GetScheduleStopTime();
-                    string[] bending = { "运行", "等待", "换模" };
+                    GetTableTime();
+                    string[] deviceStatus = { "运行", "等待", "报警/维修", "换模" };
                     var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
-                    var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位") - DevicScheduleStop("1号YaWei折弯机");//1号YaWei折弯机等待时间
+                    //var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位") - DevicScheduleStop("1号YaWei折弯机");//1号YaWei折弯机等待时间
                     var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
                     var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
-                    var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位") - DevicScheduleStop("2号YaWei折弯机");//2号YaWei折弯机等待时间
+                    //var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位") - DevicScheduleStop("2号YaWei折弯机");//2号YaWei折弯机等待时间
                     var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
 
                     var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位"); ;//3号YaWei折弯机运行时间
-                    var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位") - DevicScheduleStop("3号YaWei折弯机");//3号YaWei折弯机等待时间
+                    //var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位") - DevicScheduleStop("3号YaWei折弯机");//3号YaWei折弯机等待时间
                     var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
 
                     var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位"); ;//亚威PBC折弯机运行时间
-                    var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位") - DevicScheduleStop("亚威PBC折弯机");//亚威PBC折弯机等待时间
+                    //var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位") - DevicScheduleStop("亚威PBC折弯机");//亚威PBC折弯机等待时间
                     var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
 
                     var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
-                    var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位") - DevicScheduleStop("百超折弯机");//百超折弯机折弯机等待时间
+                    //var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位") - DevicScheduleStop("百超折弯机");//百超折弯机折弯机等待时间
                     var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
 
-                    var firstYaWeiValueTime = new double[] { firstYaWeiRunTime, firstYaWeiStopTime, firstYaWeiMoldTime };
-                    var sencondYaWeiValueTime = new double[] { sencondYaWeiRunTime, sencondYaWeiStopTime, sencondYaWeiMoldTime };
-                    var thirdYaWeiValueTime = new double[] { thirdYaWweiRunTime, thirdYaWweiStopTime, thirdYaWweiMoldTime };
-                    var pbcYaWeiValueTime = new double[] { pbcYaWweiRunTime, pbcYaWweiStopTime, pbcYaWweiMoldTime };
-                    var baiChaoValueTime = new double[] { baiChaoRunTime, baiChaoStopTime, baiChaoMoldTime };
-
-
-
-                    for (int k = 0; k < bending.Length; k++)
-                            {
-                                pressBrakeOneValue[k].Value = firstYaWeiValueTime[k];
-
-                            }
-                       
-                            for (int k = 0; k < bending.Length; k++)
-                            {
-                                pressBrakeTwoValue[k].Value = sencondYaWeiValueTime[k];
-                            }
-
-
-                       
-                            for (int k = 0; k < bending.Length; k++)
-                            {
-                                pressBrakeThreeValue[k].Value = thirdYaWeiValueTime[k];
-                            }
-                      
-                            for (int k = 0; k < bending.Length; k++)
-                            {
-                                pressBrakeFourValue[k].Value = pbcYaWeiValueTime[k];
-                            }
-                       
-                     
-                            for (int k = 0; k < bending.Length; k++)
-                            {
-                                pressBrakeFiveValue[k].Value = baiChaoValueTime[k];
-                            }
-                      
-                    
+                    double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+                    var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+                        - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间");//1号YaWei折弯机等待时间
+                    var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
+                        - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间");//2号YaWei折弯机等待时间
+                    var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
+                        - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间");//3号YaWei折弯机等待时间
+                    var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
+                        - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间");//亚威PBC折弯机等待时间
+                    var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
+                        - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间");//百超折弯机折弯机等待时间
+
+                    var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间");
+                    var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间");
+                    var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间");
+                    var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").TotalSeconds + DeviceTimeValue("亚威PBC折弯机", "维修时间");
+                    var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").TotalSeconds + DeviceTimeValue("百超折弯机", "维修时间");
+
+                    var firstYaWeiValueTime = new double[] { firstYaWeiRunTime, firstYaWeiStopTime, firstYaWeiTimeMaintenanceTable, firstYaWeiMoldTime };
+                    var sencondYaWeiValueTime = new double[] { sencondYaWeiRunTime, sencondYaWeiStopTime, secondYaWeiTimeMaintenanceTable, sencondYaWeiMoldTime };
+                    var thirdYaWeiValueTime = new double[] { thirdYaWweiRunTime, thirdYaWweiStopTime, thirdYaWeiTimeMaintenanceTable, thirdYaWweiMoldTime };
+                    var pbcYaWeiValueTime = new double[] { pbcYaWweiRunTime, pbcYaWweiStopTime, pbcYaWweiTimeMaintenanceTable, pbcYaWweiMoldTime };
+                    var baiChaoValueTime = new double[] { baiChaoRunTime, baiChaoStopTime, baiChaoTimeMaintenanceTable, baiChaoMoldTime };
+
+
+
+                    for (int k = 0; k < deviceStatus.Length; k++)
+                    {
+                        pressBrakeOneValue[k].Value = firstYaWeiValueTime[k];
+
+                    }
+
+                    for (int k = 0; k < deviceStatus.Length; k++)
+                    {
+                        pressBrakeTwoValue[k].Value = sencondYaWeiValueTime[k];
+                    }
+
+
+
+                    for (int k = 0; k < deviceStatus.Length; k++)
+                    {
+                        pressBrakeThreeValue[k].Value = thirdYaWeiValueTime[k];
+                    }
+
+                    for (int k = 0; k < deviceStatus.Length; k++)
+                    {
+                        pressBrakeFourValue[k].Value = pbcYaWeiValueTime[k];
+                    }
+
+
+                    for (int k = 0; k < deviceStatus.Length; k++)
+                    {
+                        pressBrakeFiveValue[k].Value = baiChaoValueTime[k];
+                    }
+
+
                     // 委托
                     Dispatcher.Invoke(new Action(() =>
                     {

+ 1 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceInformationControls.xaml

@@ -17,7 +17,6 @@
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
-                <RowDefinition/>
             </Grid.RowDefinitions> 
             <local:UctMidcard Title="{Binding Text,ElementName=this}" FontSize="22" Margin="8.8" HorizontalAlignment="Left" />
             <local:UctNameTheTimeControl Grid.Row="1" Title="{Binding Title[0],ElementName=this}" Margin="8.8" x:Name="DeviceNameOne"/>
@@ -25,7 +24,7 @@
             <local:UctNameTheTimeControl Grid.Row="3" Title="{Binding Title[2],ElementName=this}" Margin="8.8" x:Name="DeviceNameThree"/>
             <local:UctNameTheTimeControl Grid.Row="4" Title="{Binding Title[3],ElementName=this}" Margin="8.8" x:Name="DeviceNameFour"/>
             <local:UctNameTheTimeControl Grid.Row="5" Title="{Binding Title[4],ElementName=this}" Margin="8.8" x:Name="DeviceNameFive"/>
-            <local:UctNameTheTimeControl Grid.Row="6" Title="{Binding Title[5],ElementName=this}" Margin="8.8" x:Name="DeviceNameSix"/>
+            <!--<local:UctNameTheTimeControl Grid.Row="6" Title="{Binding Title[5],ElementName=this}" Margin="8.8" x:Name="DeviceNameSix"/>-->
         </Grid>
     </Grid>
 </UserControl>

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceInformationControlsSencd.xaml

@@ -18,7 +18,7 @@
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
-          </Grid.RowDefinitions>
+            </Grid.RowDefinitions>
             <local:UctMidcard Title="{Binding Text,ElementName=this}" FontSize="22"  Margin="8.8"/>
             <local:UctNameTheTimeControlSencd Title="{Binding Title[0],ElementName=this}" Margin="8.8" x:Name="DeviceNameOne" Grid.Row="1"  />
             <local:UctNameTheTimeControlSencd Grid.Row="2" Title="{Binding Title[1],ElementName=this}" Margin="8.8" x:Name="DeviceNameTwo"/>

+ 3 - 4
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceInformationControlsThird.xaml

@@ -7,18 +7,17 @@
              mc:Ignorable="d" 
              x:Name="this"
               d:DesignHeight="450" d:DesignWidth="800">
-  
+
     <Grid >
         <dashboard:DashboardCard Margin="8.8"/>
         <Grid >
-             <Grid.RowDefinitions>
+            <Grid.RowDefinitions>
                 <RowDefinition Height="Auto"/>
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
-                <RowDefinition/>
             </Grid.RowDefinitions>
             <local:UctMidcard Title="{Binding Text,ElementName=this}" FontSize="25" Margin="8.8" />
             <local:UctNameTheTimeControlThird Title="{Binding Title[0],ElementName=this}" Margin="8.8" x:Name="DeviceNameOne" Grid.Row="1"/>
@@ -26,7 +25,7 @@
             <local:UctNameTheTimeControlThird Grid.Row="3" Title="{Binding Title[2],ElementName=this}" Margin="8.8" x:Name="DeviceNameThree"/>
             <local:UctNameTheTimeControlThird Grid.Row="4" Title="{Binding Title[3],ElementName=this}" Margin="8.8" x:Name="DeviceNameFour"/>
             <local:UctNameTheTimeControlThird Grid.Row="5" Title="{Binding Title[4],ElementName=this}" Margin="8.8" x:Name="DeviceNameFive"/>
-            <local:UctNameTheTimeControlThird Grid.Row="6" Title="{Binding Title[5],ElementName=this}" Margin="8.8" x:Name="DeviceNameSix"/>
+            <!--<local:UctNameTheTimeControlThird Grid.Row="6" Title="{Binding Title[5],ElementName=this}" Margin="8.8" x:Name="DeviceNameSix"/>-->
         </Grid>
     </Grid>
 </UserControl>

+ 2 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctLaserMmachinePieChart.xaml

@@ -3,18 +3,17 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:SCADA_DAQ.Customer.Views.Uct" xmlns:wpf="clr-namespace:LiveCharts.Wpf;assembly=SCADA.CommonCtrl"
+             xmlns:local="clr-namespace:SCADA_DAQ.Customer.Views.Uct" xmlns:wpf="clr-namespace:LiveCharts.Wpf;assembly=SCADA.CommonCtrl" xmlns:local1="clr-namespace:SCADA_DAQ.Customer.Views.Dashboard"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
     <Grid>
-             
         <wpf:PieChart LegendLocation="Bottom"
                       DisableAnimations="False"
                       x:Name="LaserMmachinePieChart"
                       Background="Transparent"
                       Foreground="Cyan"
                       InnerRadius="100"
-                      Width="400"
+                      Width="370"
                       FontSize="30">
         </wpf:PieChart>
     </Grid>

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctLaserMmachinePieChart.xaml.cs

@@ -29,7 +29,7 @@ namespace SCADA_DAQ.Customer.Views.Uct
         {
             InitializeComponent();
         }
-        public void ChartInit(List <LaserMmachinePieChartModel> pointModel)
+        public void ChartInit(List <LaserMmachinePieChartModel> pointModel )
         {
             var brushes = new List<Brush>()
             {