Browse Source

临时提交

谢翼翔 1 year ago
parent
commit
df45e1057a
24 changed files with 260 additions and 1009 deletions
  1. 8 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/CustomerEnv.cs
  2. 19 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/DeviceInfoTime/BendCounterProduuctionModel.cs
  3. 1 8
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/DeviceInfoTime/RepairTableModel.cs
  4. 5 2
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Service/GetTimeService.cs
  5. 34 26
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml
  6. 9 169
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml.cs
  7. 8 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmLaserCNCInterface.xaml
  8. 3 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmLaserCNCInterface.xaml.cs
  9. 4 2
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPressBrakeEquipmentHealthStatus.xaml
  10. 14 192
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPressBrakeEquipmentHealthStatus.xaml.cs
  11. 4 2
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPressBrakeEquipmentHealthStatusSencd.xaml
  12. 37 5
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPressBrakeEquipmentHealthStatusSencd.xaml.cs
  13. 6 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchEquipment.xaml
  14. 5 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchEquipment.xaml.cs
  15. 40 36
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentCapacity.xaml
  16. 7 5
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentCapacity.xaml.cs
  17. 4 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml
  18. 21 183
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml.cs
  19. 3 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml.cs
  20. 19 257
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/LaserAndDigitalPunchingEquipmentWidget.xaml.cs
  21. 4 104
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Dashboard/YaweiPressBrakeOneWidget.xaml.cs
  22. 2 2
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Env.cs
  23. BIN
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Icon/Logo-3.png
  24. 3 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj

+ 8 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/CustomerEnv.cs

@@ -31,17 +31,22 @@ namespace SCADA_DAQ.Customer
         /// <summary>
         /// 当天设备的所有记录
         /// </summary>
-        public static List<MachineInfoModel> MachineInfos { get; set; }
+        public static List<MachineInfoModel> MachineInfos { get; set; }=new List<MachineInfoModel>();
 
         /// <summary>
         /// 当天维修时间
         /// </summary>
-        public static List<MaintenanceTableModel> MaintenanceInfos { get; set; }
+        public static List<MaintenanceTableModel> MaintenanceInfos { get; set; } = new List<MaintenanceTableModel>();
 
         /// <summary>
         /// 保养记录
         /// </summary>
-        public static List<RepairTableModel> RepairInfos { get; set; }
+        public static List<RepairTableModel> RepairInfos { get; set; } = new List<RepairTableModel>();
+
+        /// <summary>
+        /// 设备产量
+        /// </summary>
+        public static List<BendCounterProduuctionModel> ProductionInfos { get; set; } = new List<BendCounterProduuctionModel>();
 
 
         public static AutoSaveParameterItem<ScheduleStopHourMinModel> ScheduleStopHourMinModel_1 { get; set; } =

+ 19 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/DeviceInfoTime/BendCounterProduuctionModel.cs

@@ -49,5 +49,24 @@ namespace SCADA_DAQ.Customer.Models.DeviceInfoTime
         private DateTime _CreateTime;
 
 
+        /// <summary>
+        /// 
+        /// </summary>
+        [Column(T_Col_Name.App_Vertiv_BendCounter.DeviceRegValue_Int)]
+        public int Value
+        {
+            get { return _Value; }
+            set
+            {
+                if (value != _Value)
+                {
+                    _Value = value;
+                    OnPropertyChanged(nameof(Value));
+                }
+            }
+        }
+        private int _Value;
+
+
     }
 }

+ 1 - 8
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/DeviceInfoTime/RepairTableModel.cs

@@ -69,13 +69,6 @@ namespace SCADA_DAQ.Customer.Models.DeviceInfoTime
         }
         private int _Duration;
 
-        public int DeviceRepairTime(string deviceName)//设备保养时间到期所剩的天数
-        {
-            var deviceRepairDay = DAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();//获取所有设备保养天数信息
-            var todayNow = DateTime.Now;
-            var RepairTime = deviceRepairDay.ToLookup(t => t.DeviceName)[deviceName].Last(t => t.Duration != null);//获取设备最新的一条保养信息
-            var RepairKeepTime = Convert.ToInt32((todayNow - RepairTime.CreateTime).TotalDays);//设备保养时间的天数
-            return RepairTime.Duration - RepairKeepTime;//设备保养时间到期所剩的天数
-        }
+   
     }
 }

+ 5 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Service/GetTimeService.cs

@@ -98,11 +98,14 @@ namespace SCADA_DAQ.Customer.Service
                                         && t.CreateTime <= end);
                 Log.Info($"获取当天状态所有记录,条数为{CustomerEnv.MachineInfos.Count}");
 
-                CustomerEnv.MaintenanceInfos = Env.SqlDAL.App_Vertiv_MaintenanceTable.GetData<MaintenanceTableModel>(t => t.CreateTime > start & t.CreateTime <= end);
+                CustomerEnv.MaintenanceInfos = Env.SqlDAL.App_Vertiv_MaintenanceTable.GetData<MaintenanceTableModel>(t => t.CreateTime > start && t.CreateTime <= end);
                 Log.Info($"获取当前维修所有记录,条数为{CustomerEnv.MaintenanceInfos.Count}");
 
                 CustomerEnv.RepairInfos = Env.SqlDAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();
-                Log.Info($"获取当前保养所有记录,条数为{CustomerEnv.MaintenanceInfos.Count}");
+                Log.Info($"获取当前保养所有记录,条数为{CustomerEnv.RepairInfos.Count}");
+
+                //CustomerEnv.ProductionInfos = Env.SqlDAL.App_Vertiv_BendCounter.GetData<BendCounterProduuctionModel>();
+                //Log.Info($"获取当前产能所有记录,条数为{CustomerEnv.ProductionInfos.Count}");
 
             }
         }

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

@@ -8,32 +8,40 @@
       d:DesignHeight="1080" d:DesignWidth="1920"
       Title="UctFrmKanbanForPressBrakeEquipment">
     <Viewbox Stretch="Fill">
-    <Grid Width="1920" Height="1080">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="60"/>
-            <RowDefinition/>
-            <RowDefinition/>
-        </Grid.RowDefinitions>
-        <Image x:Name="Image_Title" Grid.RowSpan="3" Stretch="Fill"/>
-        <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-        <TextBlock Text="折弯机运行信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold" />
-        <Grid Grid.Row="1" Margin="8.8">
-        <Grid.ColumnDefinitions>
-            <ColumnDefinition/>
-            <ColumnDefinition/>
-            <ColumnDefinition/>
-            <ColumnDefinition/>
-            <ColumnDefinition Width="1*"/>
-        </Grid.ColumnDefinitions>
-            <uct:UctDeviceInformationControlsSencd x:Name="KanbanForPressBrakeEquipmentOne" Text="1号折弯机设备运行状况" Margin="2"/>
-            <uct:UctDeviceInformationControlsSencd Grid.Column="1" x:Name="KanbanForPressBrakeEquipmentTwo" Text="2号折弯机设备运行状况" Margin="2"/>
-            <uct:UctDeviceInformationControlsSencd Grid.Column="2" x:Name="KanbanForPressBrakeEquipmentThree" Text="3号折弯机设备运行状况" Margin="2"/>
-            <uct:UctDeviceInformationControlsSencd Grid.Column="3" x:Name="KanbanForPressBrakeEquipmentFour" Text="亚威PBC折弯机设备运行状况" Margin="2"/>
-            <uct:UctDeviceInformationControlsSencd Grid.Column="4" x:Name="KanbanForPressBrakeEquipmentFive" Text="Bystronic折弯机设备运行状况" Margin="2"/>
+        <Grid Width="1920" Height="1080">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="60"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+            <Image x:Name="Image_Title" Stretch="Fill"/>
+            <Image x:Name="Image_Log" HorizontalAlignment="Left" VerticalAlignment="Center"/>
+            <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
+            <TextBlock Text="折弯机运行信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" />
+            <Grid  Grid.Row="1">
+                <Grid.RowDefinitions>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                </Grid.RowDefinitions>
+                <Image x:Name="Image_Bck"  Stretch="Fill" Grid.RowSpan="2"/>
+                <Grid  Margin="8.8">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition/>
+                        <ColumnDefinition/>
+                        <ColumnDefinition/>
+                        <ColumnDefinition/>
+                        <ColumnDefinition Width="1*"/>
+                    </Grid.ColumnDefinitions>
+               
+                    <uct:UctDeviceInformationControlsSencd x:Name="KanbanForPressBrakeEquipmentOne" Text="1号折弯机设备运行状况" Margin="2"/>
+                    <uct:UctDeviceInformationControlsSencd Grid.Column="1" x:Name="KanbanForPressBrakeEquipmentTwo" Text="2号折弯机设备运行状况" Margin="2"/>
+                    <uct:UctDeviceInformationControlsSencd Grid.Column="2" x:Name="KanbanForPressBrakeEquipmentThree" Text="3号折弯机设备运行状况" Margin="2"/>
+                    <uct:UctDeviceInformationControlsSencd Grid.Column="3" x:Name="KanbanForPressBrakeEquipmentFour" Text="亚威PBC折弯机设备运行状况" Margin="2"/>
+                    <uct:UctDeviceInformationControlsSencd Grid.Column="4" x:Name="KanbanForPressBrakeEquipmentFive" Text="Bystronic折弯机设备运行状况" Margin="2"/>
+                </Grid>
+                <Grid Grid.Row="1">
+                    <dashboard:YaweiPressBrakeOneWidget Grid.Row="1" Margin="8.8" Loaded="YaweiPressBrakeOneWidget_Loaded"/>
+                </Grid>
+            </Grid>
         </Grid>
-        <Grid Grid.Row="2">
-        <dashboard:YaweiPressBrakeOneWidget Grid.Row="1" Margin="8.8" Loaded="YaweiPressBrakeOneWidget_Loaded"/>
-        </Grid>
-    </Grid>
     </Viewbox>
 </wpfcontrol:BaseUctFrm>

+ 9 - 169
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml.cs

@@ -78,10 +78,10 @@ namespace SCADA_DAQ.Customer
             GetDBData();
             GetTableTime();
             GetRepairTime();
-            //GetScheduleStopTime();
-            //GetDeviceScheduleStopBetweenTime();
+            Image_Log.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\Logo-3.png");
+            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
+            Image_Bck.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
             ToolBar.Visibility = Visibility.Collapsed;
-            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
             LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
             KanbanForPressBrakeEquipmentOne.Title = new string[] { "运行时间:",
                 "等待时间:",
@@ -114,21 +114,6 @@ namespace SCADA_DAQ.Customer
                 "维保时间:"};
 
 
-            //var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
-            //var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
-
-            //var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
-            //var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
-
-            //var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("3号YaWei折弯机", "运行标志位"); ;//3号YaWei折弯机运行时间
-            //var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
-
-            //var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "运行标志位"); ;//亚威PBC折弯机运行时间
-            //var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
-
-            //var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
-            //var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "换模标志位");//百超折弯机换模时间
-
             var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
             var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
@@ -151,29 +136,6 @@ namespace SCADA_DAQ.Customer
             var pbcYaWweiRepairTime = "倒计时" + DeviceRepairTime("亚威PBC折弯机").ToString() + "天";//亚威PBC折弯机设备保养信息
             var baiChaoRepairTime = "倒计时" + DeviceRepairTime("百超折弯机").ToString() + "天";//百超折弯机设备保养信息
 
-            //var firstYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威一号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("1号YaWei折弯机", "维修时间"))
-            //    - TimeSpan.FromSeconds(DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "维修时间")));
-            //var secondYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威二号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("2号YaWei折弯机", "维修时间"))
-            //    - TimeSpan.FromSeconds(DeviceStateCodeStopBetweenTime("2号YaWei折弯机", "维修时间")));
-            //var thirdYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威三号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("3号YaWei折弯机", "维修时间"))
-            //    - TimeSpan.FromSeconds(DeviceStateCodeStopBetweenTime("3号YaWei折弯机", "维修时间")));
-            //var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间"))
-            //    - TimeSpan.FromSeconds(DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "维修时间")));
-            //var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间"))
-            //    - TimeSpan.FromSeconds(DeviceStateCodeStopBetweenTime("百超折弯机", "维修时间")));
-
-            //double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
-            //var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
-            //    - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间") + DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "维修时间");//1号YaWei折弯机等待时间
-            //var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
-            //    - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间") + DeviceStateCodeStopBetweenTime("2号YaWei折弯机", "维修时间");//2号YaWei折弯机等待时间
-            //var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
-            //    - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间") + DeviceStateCodeStopBetweenTime("3号YaWei折弯机", "维修时间"); //3号YaWei折弯机等待时间
-            //var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
-            //    - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间") + DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "维修时间");//亚威PBC折弯机等待时间
-            //var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
-            //    - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间") + DeviceStateCodeStopBetweenTime("百超折弯机", "维修时间");//百超折弯机折弯机等待时间
-
             var firstYaWeiTimeMaintenanceTableDouble = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间");
             var secondYaWeiTimeMaintenanceTableDouble = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间");
             var thirdYaWeiTimeMaintenanceTableDouble = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间");
@@ -252,23 +214,11 @@ namespace SCADA_DAQ.Customer
         public List<MachineInfoModel> deviceInformation { get; set; }
         public void GetDBData()//设备运行状态时间
         {
-            //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"));
-
-            //获取当天所有设备信息
-            //deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
-            //    .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();
-            deviceInformation = CustomerEnv.MachineInfos;
+               deviceInformation = CustomerEnv.MachineInfos;
         }
         public double DeviceTimeValue(string deviceName, string StateCode)//设备运行状态时间
         {
-            //获取当天所有设备信息
-            //var deviceInformation = DAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?.Where(t => t.CreateTime.Date == DateTime.Now.Date);
-            //var tt = deviceInformation.Where(m => m.CreateTime >= dateNightStratTime & m.CreateTime <= dateNightEndTime);
+            
             var keepTime = deviceInformation.ToLookup(t => t.Device)[deviceName].ToLookup(t => t.StateCode)[StateCode].Sum(t => t.DurationSec);
             return Convert.ToDouble(keepTime);
         }
@@ -276,15 +226,6 @@ namespace SCADA_DAQ.Customer
         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();//获取当天所有设备维修信息
             deviceMaintenanceTable = CustomerEnv.MaintenanceInfos;
         }
         public TimeSpan DevicMainTableTime(string deviceName)
@@ -304,20 +245,14 @@ namespace SCADA_DAQ.Customer
 
                 return new TimeSpan(0, 0, 0); ;
             }
-            //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;
+     
         }
 
 
         public List<RepairTableModel> deviceRepairDay { get; set; }
         public void GetRepairTime()
         {
-            //deviceRepairDay = DAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();
+           
             deviceRepairDay = CustomerEnv.RepairInfos;
         }
 
@@ -338,94 +273,7 @@ namespace SCADA_DAQ.Customer
             return RepairTime.Duration - RepairKeepTime;//设备保养时间到期所剩的天数
         }
 
-        //public List<ScheduleStopModel> deviceScheduleStop { get; set; }
-        //public void GetScheduleStopTime()//设备停止计划时间
-        //{
-        //    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();//获取当天所有设备计划停止信息
-
-        //}
-
-
-        //public double DevicScheduleStop(string deviceName)
-        //{
-
-        //    var scheduleStopTime = deviceScheduleStop.ToLookup(t => t.TableName)[deviceName].Select(t => t.DurationTime);//获取设备计划停止时间
-        //    var scheduleStopTimeValue = new TimeSpan();
-        //    foreach (TimeSpan item in scheduleStopTime)
-        //    {
-        //        scheduleStopTimeValue = scheduleStopTimeValue + item;
-        //    }
-        //    return Convert.ToDouble(scheduleStopTimeValue.TotalSeconds);
-        //}
-
-        //public List<MachineInfoModel> DeviceMachineInformation { get; set; }
-
-        //public List<DeviceScheduleStopModel> DeviceScheduleStopInformation { get; set; }
-
-        //public int DeviceStateCodeScheduleStopBetWeenTime { get; set; }
-
-        //public List<int> DeviceStateCodeScheduleStopBetweenTimeList { get; set; }
-
-        //public int DeviceStateCodeIntValue { get; set; }
-        //public void GetDeviceScheduleStopBetweenTime()
-        //{
-        //    DeviceScheduleStopInformation = Env.SqlDAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>();
-        //    DeviceMachineInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>();
-        //}
-        //public double DeviceStateCodeStopBetweenTime(string deviceName, string deviceStateCode)
-        //{
-        //    DeviceStateCodeIntValue = 0;
-        //    List<int> DeviceValue = new List<int>();
-        //    var deviceScheduleStop = DeviceScheduleStopInformation.ToLookup(t => t.Device)[deviceName];
-        //    foreach (var item in deviceScheduleStop)
-        //    {
-        //        var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString(item.StartTime.ToString()));
-        //        var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString(item.EndTime.ToString()));
-        //        var deviceBetweenTime = DeviceMachineInformation.ToLookup(t => t.Device)[deviceName].ToLookup(t => t.StateCode)[deviceStateCode]?
-        //        .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime);
-        //        DeviceStateCodeScheduleStopBetWeenTime = deviceBetweenTime.Sum(t => t.DurationSec);
-        //        DeviceValue.Add(DeviceStateCodeScheduleStopBetWeenTime);
-        //    }
-
-        //    DeviceStateCodeScheduleStopBetweenTimeList = DeviceValue;
-        //    for (int i = 0; i < DeviceStateCodeScheduleStopBetweenTimeList.Count; i++)
-        //    {
-        //        DeviceStateCodeIntValue = DeviceStateCodeScheduleStopBetweenTimeList[i] + DeviceStateCodeIntValue;
-        //    }
-        //    return DeviceStateCodeIntValue;
-        //}
-
-        //public int DeviceScheduleStopBetWeenTime { get; set; }
-
-        //public List<int> DeviceScheduleStopBetweenTimeList { get; set; }
-
-        //public int DeviceIntValue { get; set; }
-
-        //public double DeviceScheduleStopBetweenTime(string deviceName)
-        //{
-        //    DeviceIntValue = 0;
-        //    List<int> DeviceValue = new List<int>();
-        //    var deviceScheduleStop = DeviceScheduleStopInformation.ToLookup(t => t.Device)[deviceName];
-        //    foreach (var item in deviceScheduleStop)
-        //    {
-        //        var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString(item.StartTime.ToString()));
-        //        var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString(item.EndTime.ToString()));
-        //        var deviceBetweenTime = DeviceMachineInformation.ToLookup(t => t.Device)[deviceName]?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime);
-        //        DeviceScheduleStopBetWeenTime = deviceBetweenTime.Sum(t => t.DurationSec);
-        //        DeviceValue.Add(DeviceScheduleStopBetWeenTime);
-        //    }
-
-        //    DeviceScheduleStopBetweenTimeList = DeviceValue;
-        //    for (int i = 0; i < DeviceScheduleStopBetweenTimeList.Count; i++)
-        //    {
-        //        DeviceIntValue = DeviceScheduleStopBetweenTimeList[i] + DeviceIntValue;
-        //    }
-        //    return DeviceIntValue;
-        //}
-
+       
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
         {
 
@@ -437,9 +285,7 @@ namespace SCADA_DAQ.Customer
                     GetDBData();
                     GetTableTime();
                     GetRepairTime();
-                    //GetScheduleStopTime();
-                    //GetDeviceScheduleStopBetweenTime();
-
+                
                     var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
                     var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
@@ -462,12 +308,6 @@ namespace SCADA_DAQ.Customer
                     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 firstYaWeiTimeMaintenanceTableDouble = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间");
                     var secondYaWeiTimeMaintenanceTableDouble = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间");
                     var thirdYaWeiTimeMaintenanceTableDouble = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间");

+ 8 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmLaserCNCInterface.xaml

@@ -14,10 +14,15 @@
                 <RowDefinition Height="60"/>
                 <RowDefinition/>
             </Grid.RowDefinitions>
-            <Image x:Name="Image_Title" Grid.RowSpan="2" Stretch="Fill"/>
+            <Image x:Name="Image_Title" Stretch="Fill"/>
+            <Image x:Name="Image_Log" HorizontalAlignment="Left" VerticalAlignment="Center"/>
             <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-            <TextBlock Text="激光机及数冲运行信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold" />
-            <dashboard:LaserAndDigitalPunchingEquipmentWidget Grid.Row="1"  x:Name="startRun"/>
+            <TextBlock Text="激光机及数冲运行信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" />
+            <Grid Grid.Row="1">
+                <Image x:Name="Image_Bck"  Stretch="Fill"/>
+                <dashboard:LaserAndDigitalPunchingEquipmentWidget   x:Name="startRun"/>
+            </Grid>
+          
         </Grid>
     </Viewbox>
 </wpfcontrol:BaseUctFrm>

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

@@ -38,8 +38,10 @@ namespace SCADA_DAQ.Customer
         public UctFrmLaserCNCInterface()
         {
             InitializeComponent();
+            Image_Log.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\Logo-3.png");
+            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
+            Image_Bck.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
             ToolBar.Visibility = Visibility.Collapsed;
-            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
             LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
            

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

@@ -13,15 +13,17 @@
                 <RowDefinition Height="60"/>
                 <RowDefinition/>
             </Grid.RowDefinitions>
-            <Image x:Name="Image_Title" Grid.RowSpan="2" Stretch="Fill"/>
+            <Image x:Name="Image_Title" Stretch="Fill"/>
+            <Image x:Name="Image_Log" HorizontalAlignment="Left" VerticalAlignment="Center"/>
             <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-            <TextBlock Text="折弯机产能看板" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold"/>
+            <TextBlock Text="折弯机产能看板" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontWeight="Bold"/>
             <Grid Grid.Row="1">
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
                 </Grid.ColumnDefinitions>
+                <Image x:Name="Image_Bck" Grid.ColumnSpan="3" Stretch="Fill"/>
                 <dashboard:DashboardCard Margin="4"/>
                 <dashboard:DashboardCard Margin="4" Grid.Column="1"/>
                 <dashboard:DashboardCard Margin="4" Grid.Column="2"/>

+ 14 - 192
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPressBrakeEquipmentHealthStatus.xaml.cs

@@ -53,11 +53,12 @@ namespace SCADA_DAQ.Customer
         public UctFrmPressBrakeEquipmentHealthStatus()
         {
             InitializeComponent();
-            Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
-           
             UpdateTheView();
             ToolBar.Visibility = Visibility.Collapsed;
-            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
+            Image_Log.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\Logo-3.png");
+            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
+            Image_Bck.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
+            LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
             string[] hourUnitNumer = new string[] { "单位:次", "每小时折弯次数统计"};
             string[] dayUnitNumer = new string[] { "单位:次", "每日折弯次数统计" };
             string[] monthUnitNumer = new string[] { "单位:次", "每月折弯次数统计" };
@@ -81,9 +82,9 @@ namespace SCADA_DAQ.Customer
             ThirdYaWeiDevicFour.Title = yearUnitNumer;
 
 
-            ChartInit();
-            ChartIsInit = true;
-
+            //ChartInit();
+            //ChartIsInit = true;
+            //Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
 
         }
 
@@ -122,6 +123,7 @@ namespace SCADA_DAQ.Customer
             //仅更新当前时间的数据
             if (e.ChangeType == DateTimeChangeType.SecondChanged && e.TimeFlag.Second % 31 == 0 && ChartIsInit == true)
             {
+         
                 var nowYear = DateTime.Now;
                 var yearTime_int = nowYear.Year - 4;
                 DateTime newYaer = new DateTime(yearTime_int, nowYear.Month, nowYear.Day, nowYear.Hour, nowYear.Minute, nowYear.Second);
@@ -181,197 +183,17 @@ namespace SCADA_DAQ.Customer
             }
 
 
-            //try
-            //{
-            //    if (e.ChangeType.HasFlag(DateTimeChangeType.SecondChanged) &&
-            //    e.TimeFlag.Second % 15 == 0)
-            //    {
-            //        var nowYear = DateTime.Now;
-            //        var yearTime_int = nowYear.Year - 4;
-            //        DateTime newYaer = new DateTime(yearTime_int, nowYear.Month, nowYear.Day, nowYear.Hour, nowYear.Minute, nowYear.Second);
-            //        var hourTime = DateTimeHelper.GetHours(DateTimeHelper.ToDayStart(DateTime.Now), DateTimeHelper.ToDayEnd(DateTime.Now));
-            //        var dayTime = DateTimeHelper.GetDays(DateTimeHelper.ToMonthStart(DateTime.Now),DateTimeHelper.ToMonthEnd(DateTime.Now));
-            //        var monthlyTime = DateTimeHelper.GetMonths(DateTimeHelper.ToYearStart(DateTime.Now), DateTimeHelper.ToYearEnd(DateTime.Now));
-            //        var yearTime = DateTimeHelper.GetYears(DateTimeHelper.ToYearStart(newYaer), DateTimeHelper.ToYearEnd(DateTime.Now));
-            //        string[] deviceName = new string[] { "1号YaWei折弯机", "2号YaWei折弯机", "3号YaWei折弯机" };
-            //        for (int i = 0; i < hourTime.Count; i++)
-            //        {
-
-            //            var hourStartResult = hourTime[i].StartTime.Format();
-            //            var hourEndResult = hourTime[i].EndTime.Format();
-            //            for (int j = 0; j < deviceName.Length; j++)
-            //            {
-            //                if (j == 0)
-            //                {
-            //                    YaWeiOne[i] = new TimeYield()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInHours(deviceName[j], hourStartResult, hourEndResult)
-            //                    };
-            //                }
-            //                if (j == 1)
-            //                {
-            //                    YaWeiTwo[i] = new TimeYield()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInHours(deviceName[j], hourStartResult, hourEndResult)
-            //                    };
-            //                }
-            //                if (j == 2)
-            //                {
-            //                    YaWeiThree[i] = new TimeYield()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInHours(deviceName[j], hourStartResult, hourEndResult)
-            //                    };
-            //                };
-            //            }
-            //        }
-
-
-
-            //        for (int i = 0; i < dayTime.Count; i++)
-            //        {
-            //            for (int j = 0; j < deviceName.Length; j++)
-            //            {
-
-            //                var dayStartResult = dayTime[i].StartTime.Format();
-            //                var dayEndResult = dayTime[i].EndTime.Format();
-            //                if (j == 0)
-            //                {
-            //                    YaWeiDayOne[i] = new DailyProduction()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], dayStartResult, dayEndResult)
-            //                    };
-            //                }
-            //                if (j == 1)
-            //                {
-            //                    YaWeiDayTwo[i] = new DailyProduction()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], dayStartResult, dayEndResult)
-            //                    };
-            //                }
-            //                if (j == 2)
-            //                {
-            //                    YaWeiDayThree[i] = new DailyProduction()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], dayStartResult, dayEndResult)
-            //                    };
-            //                }
-            //            }
-            //        }
-
-
-            //        for (int i = 0; i < monthlyTime.Count; i++)
-            //        {
-
-            //            var monthlyStartResult = monthlyTime[i].StartTime.Format();
-            //            var monthlyEndResult = monthlyTime[i].EndTime.Format();
-            //            for (int j = 0; j < deviceName.Length; j++)
-            //            {
-            //                if (j == 0)
-            //                {
-            //                    YaWeiMonthlyOne[i] = new MonthlyProduction()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], monthlyStartResult, monthlyEndResult)
-            //                    };
-            //                }
-            //                if (j == 1)
-            //                {
-            //                    YaWeiMonthlyTwo[i] = new MonthlyProduction()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], monthlyStartResult, monthlyEndResult)
-            //                    };
-            //                }
-            //                if (j == 2)
-            //                {
-            //                    YaWeiMonthlyThree[i] = new MonthlyProduction()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], monthlyStartResult, monthlyEndResult)
-            //                    };
-            //                }
-            //            }
-            //        }
-
-            //        for (int i = 0; i < yearTime.Count; i++)
-            //        {
-            //            var yearStartResult = yearTime[i].StartTime.Format();
-            //            var yearEndResult = yearTime[i].EndTime.Format();
-            //            for (int j = 0; j < deviceName.Length; j++)
-            //            {
-            //                if (j == 0)
-            //                {
-            //                    YaWeiYearOne[i] = new AnnualOutput()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], yearStartResult, yearEndResult)
-
-            //                    };
-
-            //                }
-            //                if (j == 1)
-            //                {
-            //                    YaWeiYearTwo[i] = new AnnualOutput()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], yearStartResult, yearEndResult)
-            //                    };
-            //                }
-            //                if (j == 2)
-            //                {
-
-            //                    YaWeiYearThree[i] = new AnnualOutput()
-            //                    {
-            //                        Indx = i,
-            //                        Value = NumberOfBendsInDays(deviceName[j], yearStartResult, yearEndResult)
-
-            //                    };
-
-            //                }
-            //            }
-            //        }
-
-            //        Dispatcher.Invoke(new Action(() =>
-            //        {
-            //            FirstYaWeiDevicOne.ChartInit(YaWeiOne.Values, "每小时折弯次数", "{0}次");
-            //            SencedYaWeiDevicOne.ChartInit(YaWeiTwo.Values, "每小时折弯次数", "{0}次");
-            //            ThirdYaWeiDevicOne.ChartInit(YaWeiThree.Values, "每小时折弯次数", "{0}次");
-
-            //            FirstYaWeiDevicTwo.ChartInit(YaWeiDayOne.Values, "每日折弯次数", "{0}次");
-            //            SencedYaWeiDevicTwo.ChartInit(YaWeiDayTwo.Values, "每日折弯次数", "{0}次");
-            //            ThirdYaWeiDevicTwo.ChartInit(YaWeiDayThree.Values, "每日折弯次数", "{0}次");
-
-            //            FirstYaWeiDevicThree.ChartInit(YaWeiMonthlyOne.Values, "每月折弯次数", "{0}次");
-            //            SencedYaWeiDevicThree.ChartInit(YaWeiMonthlyTwo.Values, "每月折弯次数", "{0}次");
-            //            ThirdYaWeiDevicThree.ChartInit(YaWeiMonthlyThree.Values, "每月折弯次数", "{0}次");
-
-            //            FirstYaWeiDevicFour.ChartInit(YaWeiYearOne.Values, "每年折弯次数", "{0}次");
-            //            SencedYaWeiDevicFour.ChartInit(YaWeiYearTwo.Values, "每年折弯次数", "{0}次");
-            //            ThirdYaWeiDevicFour.ChartInit(YaWeiYearThree.Values, "每年折弯次数", "{0}次");
-
-            //        }));
-            //    }
-            //}
-            //catch (Exception ex)
-            //{
-
-            //   // MessageBox.Show(ex + "");
-            //}
-
         }
-     
+
+      
+
         public int NumberOfBendsInHours(string frequency, string startTime, string endTime)
         {
             var pressbrake = $"{T_Col_Name.App_Vertiv_BendCounter.DeviceName_Str}='{frequency}'"
            + $"AND {T_Col_Name.App_Vertiv_BendCounter.CreateTime_Dt} between '{startTime}'" +
              $"and '{endTime}'";
             return Env.SqlDAL.App_Vertiv_BendCounter.Count(pressbrake);
+
         }
         public int NumberOfBendsInDays(string frequency, string startDay, string endDay)
         {
@@ -382,9 +204,9 @@ namespace SCADA_DAQ.Customer
 
         }
 
-   
 
-    
+
+
         public void UpdateTheView()
         {
             

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

@@ -13,14 +13,16 @@
                 <RowDefinition Height="60"/>
                 <RowDefinition/>
             </Grid.RowDefinitions>
-            <Image x:Name="Image_Title" Grid.RowSpan="2" Stretch="Fill"/>
+            <Image x:Name="Image_Title" Stretch="Fill"/>
+            <Image x:Name="Image_Log" HorizontalAlignment="Left" VerticalAlignment="Center"/>
             <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-            <TextBlock Text="折弯机产能信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold" />
+            <TextBlock Text="折弯机产能信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" />
             <Grid Grid.Row="1">
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
                 </Grid.ColumnDefinitions>
+                <Image x:Name="Image_Bck" Grid.ColumnSpan="2" Stretch="Fill"/>
                 <dashboard:DashboardCard Margin="20"/>
                 <dashboard:DashboardCard Margin="20" Grid.Column="1"/>
                 <Grid Grid.Column="0" Margin="30">

+ 37 - 5
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPressBrakeEquipmentHealthStatusSencd.xaml.cs

@@ -3,6 +3,7 @@ using SCADA.CommonCtrl.WpfControl;
 using SCADA.CommonLib;
 using SCADA.CommonLib.Helper;
 using SCADA_DAQ.Customer.Models;
+using SCADA_DAQ.Customer.Models.DeviceInfoTime;
 using SqlSchema.DBNames;
 using System;
 using System.Collections.Generic;
@@ -44,9 +45,11 @@ namespace SCADA_DAQ.Customer
         public UctFrmPressBrakeEquipmentHealthStatusSencd()
         {
             InitializeComponent();
+            Image_Log.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\Logo-3.png");
+            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
+            Image_Bck.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
             ToolBar.Visibility = Visibility.Collapsed;
-            Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
-            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
+         
             LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
 
             FourthYaWeiDevicOne.Title = new string[] { "单位:次", "每小时折弯次数统计" };
@@ -61,9 +64,9 @@ namespace SCADA_DAQ.Customer
             FourthYaWeiDevicFour.Title = new string[] { "单位:次", "每年折弯次数统计" };
             BystronicFour.Title = new string[] { "单位:次", "每年折弯次数统计" };
 
-            ChartInit();
-            ChartIsInit = true;
-
+            //ChartInit();
+            //ChartIsInit = true;
+            //Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
         }
 
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
@@ -134,6 +137,12 @@ namespace SCADA_DAQ.Customer
             }
         }
 
+        //public List<BendCounterProduuctionModel> ProductionInfos { get; set; }
+
+        //public void GetProductionInfos()
+        //{
+        //    ProductionInfos = CustomerEnv.ProductionInfos;
+        //}
         public int NumberOfBendsInHours(string frequency, string startTime, string endTime)
         {
             var pressbrake = $"{T_Col_Name.App_Vertiv_BendCounter.DeviceName_Str}='{frequency}'"
@@ -149,6 +158,29 @@ namespace SCADA_DAQ.Customer
             return Env.SqlDAL.App_Vertiv_BendCounter.Count(pressbrake);
 
         }
+        //public int NumberOfBendsInHours(string frequency, string startTime, string endTime)
+        //{
+        //    // var pressbrake = $"{T_Col_Name.App_Vertiv_BendCounter.DeviceName_Str}='{frequency}'"
+        //    //+ $"AND {T_Col_Name.App_Vertiv_BendCounter.CreateTime_Dt} between '{startTime}'" +
+        //    //  $"and '{endTime}'";
+        //    // return Env.SqlDAL.App_Vertiv_BendCounter.Count(pressbrake);
+
+        //    var pressbrake = ProductionInfos.ToLookup(t => t.DeviceName_Str)[frequency].ToLookup(t => t.CreateTime >= DateTime.Parse(startTime) & t.CreateTime <= DateTime.Parse(endTime)).Count();
+        //    return pressbrake;
+
+
+
+
+        //}
+        //public int NumberOfBendsInDays(string frequency, string startDay, string endDay)
+        //{
+        //    //    var pressbrake = $"{T_Col_Name.App_Vertiv_BendCounter.DeviceName_Str}='{frequency}'"
+        //    //   + $"AND {T_Col_Name.App_Vertiv_BendCounter.CreateTime_Dt} between '{DateTime.Now.ToString($"{startDay}")}'" +
+        //    //    $"and '{DateTime.Now.ToString($"{endDay}")}'";
+        //    //    return Env.SqlDAL.App_Vertiv_BendCounter.Count(pressbrake);
+        //    var pressbrake = ProductionInfos.ToLookup(t => t.DeviceName_Str)[frequency].ToLookup(t => t.CreateTime >= DateTime.Parse(startDay) && t.CreateTime <= DateTime.Parse(endDay)).Count();
+        //    return pressbrake;
+        //}
 
         private void ChartInit()
         {

+ 6 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchEquipment.xaml

@@ -13,15 +13,18 @@
                 <RowDefinition Height="60"/>
                 <RowDefinition/>
             </Grid.RowDefinitions>
-            <Image x:Name="Image_Title" Grid.RowSpan="2" Stretch="Fill"/>
+            <Image x:Name="Image_Title" Stretch="Fill"/>
+            <Image x:Name="Image_Log" HorizontalAlignment="Left" VerticalAlignment="Center"/>
             <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-            <TextBlock Text="激光机及数冲产能信息"  FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold"/>
+            <TextBlock Text="激光机及数冲产能信息"  FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center"  Foreground="White" FontWeight="Bold"/>
+         
             <Grid Grid.Row="1">
-                <Grid.ColumnDefinitions>
+                  <Grid.ColumnDefinitions>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
                 </Grid.ColumnDefinitions>
+                <Image x:Name="Image_Bck" Grid.ColumnSpan="3" Stretch="Fill"/>
                 <dashboard:DashboardCard Margin="4"/>
                 <dashboard:DashboardCard Margin="4" Grid.Column="1"/>
                 <dashboard:DashboardCard Margin="4" Grid.Column="2"/>

+ 5 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchEquipment.xaml.cs

@@ -48,9 +48,11 @@ namespace SCADA_DAQ.Customer
         public UctFrmPunchEquipment()
         {
             InitializeComponent();
-            Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
+            Image_Log.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\Logo-3.png");
+            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
+            Image_Bck.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
+            //Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
             ToolBar.Visibility = Visibility.Collapsed;
-            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
             LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
 
             LaserMachineDevicOne.Title = new string[] { "单位:张", "每小时张数统计" };
@@ -69,7 +71,7 @@ namespace SCADA_DAQ.Customer
             BehwiftDevicFour.Title = new string[] { "单位:件", "每年件数统计" };
             SiemensDevicFour.Title = new string[] { "单位:件", "每年件数统计" };
 
-            ChartInit();
+            //ChartInit();
             ChartIsInit = true;
         }
 

+ 40 - 36
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentCapacity.xaml

@@ -13,44 +13,48 @@
                 <RowDefinition Height="60"/>
                 <RowDefinition/>
             </Grid.RowDefinitions>
-            <Image x:Name="Image_Title" Grid.RowSpan="2" Stretch="Fill"/>
+            
+            <Image x:Name="Image_Title" Stretch="Fill"/>
+            <Image x:Name="Image_Log" HorizontalAlignment="Left" VerticalAlignment="Center"/>
             <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-            <TextBlock Text="冲孔机产能信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold"/>
+            <TextBlock Text="冲孔机产能信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontWeight="Bold"/>
             <Grid Grid.Row="1">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition/>
-                    <ColumnDefinition/>
-                </Grid.ColumnDefinitions>
-                <dashboard:DashboardCard Margin="20"/>
-                <dashboard:DashboardCard Margin="20" Grid.Column="1"/>
-                <Grid Grid.Column="0" Margin="30">
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="Auto"/>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                    </Grid.RowDefinitions>
-                    <TextBlock Text="高机冲孔机设备产能" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Cyan" />
-                    <dashboard1:UctTimeYield Grid.Row="1" x:Name="HighMachineDevicOne"/>
-                    <dashboard1:UctDailyProduction Grid.Row="2" x:Name="HighMachineDevicTwo"/>
-                    <dashboard1:UctMonthlyProduction Grid.Row="3" x:Name="HighMachineDevicThree"/>
-                    <dashboard1:UctAnnualOutput Grid.Row="4" x:Name="HighMachineDevicFour"/>
-                </Grid>
-                <Grid Grid.Column="1" Margin="30">
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="Auto"/>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                    </Grid.RowDefinitions>
-                    <TextBlock Text="金方圆数控母线冲孔机设备产能" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Cyan" />
-                    <dashboard1:UctTimeYield Grid.Row="1" x:Name="GoldDevicOne"/>
-                    <dashboard1:UctDailyProduction Grid.Row="2" x:Name="GoldDevicTwo"/>
-                    <dashboard1:UctMonthlyProduction Grid.Row="3" x:Name="GoldDevicThree"/>
-                    <dashboard1:UctAnnualOutput Grid.Row="4" x:Name="GoldDevicFour"/>
-
+                <Image x:Name="Image_Bck"  Stretch="Fill"/>
+                <Grid >
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition/>
+                        <ColumnDefinition/>
+                    </Grid.ColumnDefinitions>
+                    <dashboard:DashboardCard Margin="20"/>
+                    <dashboard:DashboardCard Margin="20" Grid.Column="1"/>
+                    <Grid Grid.Column="0" Margin="30">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="Auto"/>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                        </Grid.RowDefinitions>
+                        <TextBlock Text="高机冲孔机设备产能" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Cyan" />
+                        <dashboard1:UctTimeYield Grid.Row="1" x:Name="HighMachineDevicOne"/>
+                        <dashboard1:UctDailyProduction Grid.Row="2" x:Name="HighMachineDevicTwo"/>
+                        <dashboard1:UctMonthlyProduction Grid.Row="3" x:Name="HighMachineDevicThree"/>
+                        <dashboard1:UctAnnualOutput Grid.Row="4" x:Name="HighMachineDevicFour"/>
+                    </Grid>
+                    <Grid Grid.Column="1" Margin="30">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="Auto"/>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                        </Grid.RowDefinitions>
+                        <TextBlock Text="金方圆数控母线冲孔机设备产能" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Cyan" />
+                        <dashboard1:UctTimeYield Grid.Row="1" x:Name="GoldDevicOne"/>
+                        <dashboard1:UctDailyProduction Grid.Row="2" x:Name="GoldDevicTwo"/>
+                        <dashboard1:UctMonthlyProduction Grid.Row="3" x:Name="GoldDevicThree"/>
+                        <dashboard1:UctAnnualOutput Grid.Row="4" x:Name="GoldDevicFour"/>
+                    </Grid>
                 </Grid>
             </Grid>
         </Grid>

+ 7 - 5
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentCapacity.xaml.cs

@@ -44,8 +44,10 @@ namespace SCADA_DAQ.Customer
         {
             InitializeComponent();
             ToolBar.Visibility = Visibility.Collapsed;
-            Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
-            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
+           
+            Image_Log.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\Logo-3.png");
+            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
+            Image_Bck.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
             LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
 
             HighMachineDevicOne.Title = new string[] { "单位:件", "每小时件数统计" };
@@ -60,9 +62,9 @@ namespace SCADA_DAQ.Customer
             HighMachineDevicFour.Title = new string[] { "单位:件", "每年件数统计" };
             GoldDevicFour.Title = new string[] { "单位:件", "每年件数统计" };
 
-            ChartInit();
-            ChartIsInit = true;
-
+            //ChartInit();
+            //ChartIsInit = true;
+            //Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
         }
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
         {

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

@@ -10,11 +10,12 @@
     <Viewbox Stretch="Fill">
         <Grid Width="1920" Height="1080">
             <Grid.RowDefinitions>
-                <RowDefinition Height="AUTO"/>
+                <RowDefinition Height="60"/>
                 <RowDefinition/>
              </Grid.RowDefinitions>
             <Grid Grid.Row="0">
-                <Image x:Name="VertivTitle" Stretch="Fill"/>
+                <Image x:Name="Image_Title" Stretch="Fill"/>
+                <Image x:Name="Image_Log" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                 <TextBlock Text="冲孔机运行信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" />
                 <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
             </Grid>
@@ -23,7 +24,7 @@
                     <RowDefinition />
                     <RowDefinition/>
                 </Grid.RowDefinitions>
-                <Image x:Name="Image_Title" Grid.RowSpan="2"  Stretch="Fill"/>
+                <Image x:Name="Image_Bck" Grid.RowSpan="2"  Stretch="Fill"/>
      
            
             <Grid Grid.Row="0">

+ 21 - 183
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml.cs

@@ -50,12 +50,10 @@ namespace SCADA_DAQ.Customer
             GetDBData();
             GetTableTime();
             GetRepairTime();
-            //GetScheduleStopTime();
-            //GetDeviceAlarmTime();
-            //GetDeviceStopTime();
             ToolBar.Visibility = Visibility.Collapsed;
-            VertivTitle.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
-            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
+            Image_Log.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\Logo-3.png");
+            Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivTitle.jpg");
+            Image_Bck.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\vertivbg.jpg");
             LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
             PunchingMachineEquipmentKanbanOne.Title = new string[] { "高机冲孔机运行时间:",
@@ -73,15 +71,11 @@ namespace SCADA_DAQ.Customer
             string[] punchingMachine = { "运行", "等待", "报警/维修", "换模" };
             var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
             var highmachineRepairTime = "倒计时" + DeviceRepairTime("高机铜排冲剪机").ToString() + "天";//高机铜排冲剪机设备保养信息
-            //var kimFangyuanArlamTimeSpanString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机")
-            //    + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")));//获取金方圆铜排冲剪机设备维修时间
 
-            //var highmachineArlamTimeSpanString = Convert.ToString(DevicMainTableTime("高机铜排冲剪机")
-            //    + TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("高机母线冲剪机")));//获取高机铜排冲剪机设备维修时间
 
             var kimFangyuanArlamDouble = DeviceTimeValue("金方圆数控母线冲孔机", "故障标志位")
                 + DeviceTimeValue("金方圆数控母线冲孔机", "维修时间") + DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;
-            var highmachineArlamDouble = DeviceTimeValue("高机母线冲剪机","故障标志位")
+            var highmachineArlamDouble = DeviceTimeValue("高机母线冲剪机", "故障标志位")
                 + DeviceTimeValue("高机母线冲剪机", "维修时间") + DevicMainTableTime("高机铜排冲剪机").TotalSeconds;
             var kimFangyuanArlamTimeSpanString = TimeSpan.FromSeconds(Math.Round(kimFangyuanArlamDouble)).ToString();//获取金方圆铜排冲剪机设备维修时间
 
@@ -100,14 +94,6 @@ namespace SCADA_DAQ.Customer
             var highmachineMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineMoldTime)).ToString();
 
 
-            double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
-            //var kimFangyuanStopTime = totalTimeOfDay - kimFangyuanRunTime - kimFangyuanMoldTime - DevicScheduleStop("金方圆数控母线冲孔机") - kimFangyuanArlamDouble
-            // + DeviceScheduleStopBetweenTime("金方圆数控母线冲孔机") + DeviceAlarmScheduleStopBetweenTime("金方圆数控母线冲孔机");//金方圆数控母线冲孔机等待时间
-            //var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
-
-            //var highmachineStopTime = totalTimeOfDay - highmachineRunTime - highmachineMoldTime - DevicScheduleStop("高机母线冲剪机") - highmachineArlamDouble
-            //     + DeviceScheduleStopBetweenTime("高机母线冲剪机") + DeviceAlarmScheduleStopBetweenTime("高机母线冲剪机");//高机母线冲剪机等待时间
-            //var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
             var kimFangyuanStopTime = DeviceTimeValue("金方圆数控母线冲孔机", "停止标志位") - DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;//金方圆数控母线冲孔机等待时间
             var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
 
@@ -136,36 +122,25 @@ namespace SCADA_DAQ.Customer
             PunchingMachineEquipmentKanbanOne.DeviceNameTwo.Value = highmachineStopTimeSpan;
             PunchingMachineEquipmentKanbanOne.DeviceNameThree.Value = highmachineArlamTimeSpanString;
             PunchingMachineEquipmentKanbanOne.DeviceNameFour.Value = highmachineMoldTimeSpan;
-            //PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineTimeMaintenanceTableString;
             PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineRepairTime;
 
             PunchingMachineEquipmentKanbanTwo.DeviceNameOne.Value = kimFangyuanRunTimeSpan;
             PunchingMachineEquipmentKanbanTwo.DeviceNameTwo.Value = kimFangyuanStopTimeSpan;
             PunchingMachineEquipmentKanbanTwo.DeviceNameThree.Value = kimFangyuanArlamTimeSpanString;
             PunchingMachineEquipmentKanbanTwo.DeviceNameFour.Value = kimFangyuanMoldTimeSpan;
-            //PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanTimeMaintenanceTableString;
             PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanRepairTime;
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
         }
         public List<MachineInfoModel> deviceInformation { get; set; }
         public void GetDBData()//设备运行状态时间
         {
-            //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"));
             //获取当天所有设备信息
-            deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
-            .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();
+            deviceInformation = CustomerEnv.MachineInfos;
 
         }
         public double DeviceTimeValue(string deviceName, string StateCode)//设备运行状态时间
         {
-            //    //获取当天所有设备信息
-            //    var deviceInformation = DAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?.Where(t => t.CreateTime.Date == DateTime.Now.Date);
             var keepTime = deviceInformation.ToLookup(t => t.Device)[deviceName].ToLookup(t => t.StateCode)[StateCode].Sum(t => t.DurationSec);
             return Convert.ToDouble(keepTime);
         }
@@ -173,7 +148,7 @@ namespace SCADA_DAQ.Customer
         public List<RepairTableModel> deviceRepairDay { get; set; }
         public void GetRepairTime()
         {
-            deviceRepairDay = DAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();
+            deviceRepairDay = CustomerEnv.RepairInfos;
 
         }
         public int DeviceRepairTime(string deviceName)//设备保养时间到期所剩的天数
@@ -195,15 +170,8 @@ namespace SCADA_DAQ.Customer
         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();//获取当天所有设备维修信息
+            deviceMaintenanceTable = CustomerEnv.MaintenanceInfos;//获取当天所有设备维修信息
 
         }
         public TimeSpan DevicMainTableTime(string deviceName)
@@ -223,126 +191,14 @@ namespace SCADA_DAQ.Customer
 
                 return new TimeSpan(0, 0, 0); ;
             }
-            //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;
+
         }
 
-        //public List<ScheduleStopModel> deviceScheduleStop { get; set; }
-        //public void GetScheduleStopTime()//设备停止计划时间
-        //{
-        //    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();//获取当天所有设备计划停止信息
-
-        //}
-
-
-        //public double DevicScheduleStop(string deviceName)
-        //{
-
-        //    var scheduleStopTime = deviceScheduleStop.ToLookup(t => t.TableName)[deviceName].Select(t => t.DurationTime);//获取设备计划停止时间
-        //    var scheduleStopTimeValue = new TimeSpan();
-        //    foreach (TimeSpan item in scheduleStopTime)
-        //    {
-        //        scheduleStopTimeValue = scheduleStopTimeValue + item;
-        //    }
-        //    return Convert.ToDouble(scheduleStopTimeValue.TotalSeconds);
-        //}
-
-
-        //public List<AlarmColumModel> deviceAlarmTime { get; set; }
-
-        //public List<AlarmColumModel> DistinctDeviceAlarmTime { get; set; }
-        //public void GetDeviceAlarmTime()//获取设备一天报警信息
-        //{
-        //    var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
-        //    var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
-        //    deviceAlarmTime = DAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();
-
-        //    var classesYesterdayStartTime = Convert.ToDateTime(DateTime.Now.AddDays(-1).Date);
-        //    var classesDayEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
-        //    DistinctDeviceAlarmTime =DAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesYesterdayStartTime & t.CreateTime <= classesDayEndTime).ToList();
-
-        //}
-        //public List<DeviceScheduleStopModel> deviceStopTime { get; set; }
-
-        //public void GetDeviceStopTime()//获取计划停止时间
-        //{
-        //     deviceStopTime = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>();
-        //}
-
-        //public double DeviceAlarmTime(string deviceName)
-        //{
-        //    var timeStopTime = deviceStopTime.ToLookup(t => t.Device)[deviceName];
-        //    var timeStopPieces = new List<TimePiece>();
-        //    if (timeStopTime.Count() != 0)
-        //    {
-        //        foreach (var item in timeStopTime)
-        //        {
-        //            timeStopPieces.Add(new TimePiece
-        //            {
-        //                StartTime = Convert.ToDateTime(item.StartTime.ToString()).TimeOfDay,
-        //                EndTime = Convert.ToDateTime(item.EndTime.ToString()).TimeOfDay
-        //            });
-        //        }
-        //    }
-                    
-        //    var informationValue = deviceAlarmTime?.ToLookup(t => t.Device_Str)[deviceName];
-        //    var deviceValueInformation = DistinctDeviceAlarmTime.ToLookup(t => t.Device_Str)[deviceName];
-        //    var timePieces = new List<TimePiece>();
-        //    if (deviceValueInformation.Count() != 0)
-        //    {
-        //        foreach (var item in deviceValueInformation)
-        //        {
-        //            if (item.StartTime < Convert.ToDateTime(DateTime.Now.ToString("00:00:00")) & item.EndTime > Convert.ToDateTime(DateTime.Now.ToString("00:00:00")))
-        //            {
-        //                timePieces.Add(new TimePiece
-        //                {
-        //                    StartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00")).TimeOfDay,
-        //                    EndTime = item.EndTime.TimeOfDay
-        //                });
-        //            }
-
-        //        }
-
-        //    }
-        //    if (informationValue.Count() != 0)
-        //    {
-        //        foreach (var item in informationValue)
-        //        {
-        //            timePieces.Add(new TimePiece
-        //            {
-        //                StartTime = item.StartTime.TimeOfDay,
-        //                EndTime = item.EndTime.TimeOfDay
-        //            });
-        //        }
-        //    }
-        //    if(timePieces.Count() == 0)
-        //    {
-        //        timePieces = new List<TimePiece>() {
-
-        //              new TimePiece{StartTime =TimeSpan.FromSeconds(DateTime.Now.ToOADate()) ,
-        //                  EndTime = TimeSpan.FromSeconds(DateTime.Now.ToOADate())},
-        //             };
-        //    }
-
-        //    var total = TimeTotalHelper.DistinctPlanStopTime(TimeTotalHelper.DistinctTime(timePieces), timeStopPieces);
-        //    var doubletotal = total.TotalSeconds;
-        //    return doubletotal;
-
-        //}
-
-
-     
+
+
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
         {
-           
+
             if (e.ChangeType.HasFlag(DateTimeChangeType.MinuteChanged))
             {
                 Dispatcher.BeginInvoke(new Action(() =>
@@ -354,28 +210,18 @@ namespace SCADA_DAQ.Customer
             }
             try
             {
-                if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged  &&
+                if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged &&
                             e.TimeFlag.Second % 16 == 0)
-                 {
+                {
                     System.GC.Collect(2);
                     GetDBData();
                     GetTableTime();
                     GetRepairTime();
-                    //GetScheduleStopTime();
-                    //GetDeviceAlarmTime();
-                    //GetDeviceStopTime();
-                     var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
+                  
+                    var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
                     var highmachineRepairTime = "倒计时" + DeviceRepairTime("高机铜排冲剪机").ToString() + "天";//高机铜排冲剪机设备保养信息
-                     //var kimFangyuanArlamTimeSpanString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机")
-                    // + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")));//获取金方圆铜排冲剪机设备维修时间
-
-                    //var highmachineArlamTimeSpanString = Convert.ToString((DevicMainTableTime("高机铜排冲剪机"))
-                    //    + TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("高机母线冲剪机")));//获取高机铜排冲剪机设备维修时间
-
-
-                    //var kimFangyuanArlamDouble = DeviceAlarmTime("金方圆数控母线冲孔机")
-                    //    + DeviceTimeValue("金方圆数控母线冲孔机", "维修时间") + DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;
-                    var kimFangyuanArlamDouble = DeviceTimeValue("金方圆数控母线冲孔机","故障标志位")
+                                                                                                   
+                    var kimFangyuanArlamDouble = DeviceTimeValue("金方圆数控母线冲孔机", "故障标志位")
                         + DeviceTimeValue("金方圆数控母线冲孔机", "维修时间") + DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;
                     var highmachineArlamDouble = DeviceTimeValue("高机母线冲剪机", "故障标志位")
                         + DeviceTimeValue("高机母线冲剪机", "维修时间") + DevicMainTableTime("高机铜排冲剪机").TotalSeconds;
@@ -398,24 +244,18 @@ namespace SCADA_DAQ.Customer
 
 
                     double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
-                    
-                    var kimFangyuanStopTime = DeviceTimeValue("金方圆数控母线冲孔机", "停止标志位")- DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;//金方圆数控母线冲孔机等待时间
+
+                    var kimFangyuanStopTime = DeviceTimeValue("金方圆数控母线冲孔机", "停止标志位") - DevicMainTableTime("金方圆铜排冲剪机").TotalSeconds;//金方圆数控母线冲孔机等待时间
                     var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
 
 
-                    var highmachineStopTime = DeviceTimeValue("高机母线冲剪机", "停止标志位")- DevicMainTableTime("高机铜排冲剪机").TotalSeconds;//高机母线冲剪机等待时间
+                    var highmachineStopTime = DeviceTimeValue("高机母线冲剪机", "停止标志位") - DevicMainTableTime("高机铜排冲剪机").TotalSeconds;//高机母线冲剪机等待时间
                     var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
 
                     var kimFangyuanTimeValue = new double[] { kimFangyuanRunTime, kimFangyuanStopTime, kimFangyuanArlamDouble, kimFangyuanMoldTime };
                     var highmachineTimeValue = new double[] { highmachineRunTime, highmachineStopTime, highmachineArlamDouble, highmachineMoldTime };
 
-                    //var highmachineStopTime = totalTimeOfDay - highmachineRunTime - highmachineMoldTime - DeviceTimeValue("高机母线冲剪机", "计划停止时间") - highmachineArlamDouble
-                    //+ DeviceScheduleStopBetweenTime("高机母线冲剪机") + DeviceAlarmScheduleStopBetweenTime("高机母线冲剪机");//高机母线冲剪机等待时间
-                    //var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
-
-                    //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++)
                     {
@@ -438,14 +278,12 @@ namespace SCADA_DAQ.Customer
                         PunchingMachineEquipmentKanbanOne.DeviceNameTwo.Value = highmachineStopTimeSpan;
                         PunchingMachineEquipmentKanbanOne.DeviceNameThree.Value = highmachineArlamTimeSpanString;
                         PunchingMachineEquipmentKanbanOne.DeviceNameFour.Value = highmachineMoldTimeSpan;
-                        //PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineTimeMaintenanceTableString;
                         PunchingMachineEquipmentKanbanOne.DeviceNameFive.Value = highmachineRepairTime;
 
                         PunchingMachineEquipmentKanbanTwo.DeviceNameOne.Value = kimFangyuanRunTimeSpan;
                         PunchingMachineEquipmentKanbanTwo.DeviceNameTwo.Value = kimFangyuanStopTimeSpan;
                         PunchingMachineEquipmentKanbanTwo.DeviceNameThree.Value = kimFangyuanArlamTimeSpanString;
                         PunchingMachineEquipmentKanbanTwo.DeviceNameFour.Value = kimFangyuanMoldTimeSpan;
-                        //PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanTimeMaintenanceTableString;
                         PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanRepairTime;
 
                     }));

+ 3 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml.cs

@@ -55,6 +55,9 @@ namespace SCADA_DAQ.Customer
             TimeSelect.ReturnTodayEvent += TimeSelect_ReturnTodayEvent; ;
             Env.selectTimeModel.PropertyChanged += SelectTimeModel_PropertyChanged;
             var OOO = new TimeSpan(0, 0, 0);
+            //var hourTime = DateTimeHelper.GetHours(DateTimeHelper.ToDayStart(DateTime.Now), DateTimeHelper.ToDayEnd(DateTime.Now));
+            //var pressbrake = CustomerEnv.ProductionInfos.ToLookup(t => t.DeviceName_Str)["1号YaWei折弯机"].ToLookup(t => t.CreateTime >= hourTime[23].StartTime & t.CreateTime <= hourTime[23].EndTime).Count();
+            
         }
         private void SelectTimeModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
         {

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

@@ -50,24 +50,11 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             GetDBData();
             GetTableTime();
             GetRepairTime();
-            GetHighDeviceWorkTime();
-       
+   
             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("倍福数冲机")));
-            Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
-            //var laserArlamDouble = DeviceAlarmTime("激光机") + DevicMainTableTime("激光机").TotalSeconds + DeviceTimeValue("激光机", "维修时间");
-            //var siemensArlamDouble = DeviceAlarmTime("西门子840D数冲") + DevicMainTableTime("西门子840D数冲").TotalSeconds + DeviceTimeValue("西门子840D数冲", "维修时间");
-            //var bewiftArlamDouble = DeviceAlarmTime("倍福数冲机") + DevicMainTableTime("倍福数冲机").TotalSeconds + DeviceTimeValue("倍福数冲机", "维修时间");
 
             var laserArlamDouble = DeviceTimeValue("激光机", "故障标志位") + DevicMainTableTime("激光机").TotalSeconds + DeviceTimeValue("激光机", "维修时间");
             var siemensArlamDouble = DeviceTimeValue("西门子840D数冲", "故障标志位") + DevicMainTableTime("西门子840D数冲").TotalSeconds + DeviceTimeValue("西门子840D数冲", "维修时间");
@@ -94,18 +81,10 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             var behwiftMoldTime = DeviceTimeValue("倍福数冲机", "换模标志位");//倍福数冲换模时间
             var behwiftMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftMoldTime)).ToString();
 
-
-            //double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
-
             var laserStopTime = DeviceTimeValue("激光机", "停止标志位") - DevicMainTableTime("激光机").TotalSeconds;//激光机等待时间
-            var siemensStopTime = DeviceTimeValue("西门子840D数冲","停止标志位") - DevicMainTableTime("西门子840D数冲").TotalSeconds;//西门子等待时间
+            var siemensStopTime = DeviceTimeValue("西门子840D数冲", "停止标志位") - DevicMainTableTime("西门子840D数冲").TotalSeconds;//西门子等待时间
             var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位") - DevicMainTableTime("倍福数冲机").TotalSeconds;//倍福数冲等待时间
-            //var laserStopTime = totalTimeOfDay - laserRunTime - DevicScheduleStop("激光机") - laserArlamDouble
-            //     + DeviceScheduleStopBetweenTime("激光机") + DeviceAlarmScheduleStopBetweenTime("激光机");//激光机等待时间
-            //var siemensStopTime = totalTimeOfDay - siemensRunTime - siemensMoldTime - DevicScheduleStop("西门子840D数冲") - siemensArlamDouble
-            //    + DeviceScheduleStopBetweenTime("西门子840D数冲") + DeviceAlarmScheduleStopBetweenTime("西门子840D数冲");//西门子等待时间
-            //var behwiftStopTime = totalTimeOfDay - behwiftRunTime - behwiftMoldTime - DevicScheduleStop("倍福数冲机") - bewiftArlamDouble
-            //    + DeviceScheduleStopBetweenTime("倍福数冲机") + DeviceAlarmScheduleStopBetweenTime("倍福数冲机");//倍福数冲等待时间
+
 
 
             var laserStopTimeSpan = TimeSpan.FromSeconds(Math.Round(laserStopTime)).ToString();
@@ -152,8 +131,8 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
 
             TimeSpan Time = new TimeSpan(2, 40, 0);
             var laserCeShi = laserArlamDouble + laserRunTime + laserStopTime;
-     
-            var siemensCeShi= siemensArlamDouble + siemensRunTime + siemensStopTime + siemensMoldTime;
+
+            var siemensCeShi = siemensArlamDouble + siemensRunTime + siemensStopTime + siemensMoldTime;
 
             var behwiftCeShi = behwiftRunTime + behwiftStopTime + bewiftArlamDouble + behwiftMoldTime;
 
@@ -161,23 +140,21 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             LaserCountingPunchesOne.DeviceNameTwo.Value = laserStopTimeSpan;
             LaserCountingPunchesOne.DeviceNameThree.Value = laserArlamString;
             LaserCountingPunchesOne.DeviceNameFour.Value = laserRepairTime;
-            //LaserCountingPunchesOne.DeviceNameFive.Value = Time.ToString();
-;      /*     LaserCountingPunchesOne.DeviceNameSix.Value = TimeSpan.FromSeconds(Math.Round(laserCeShi)).ToString();*/
+
 
             LaserCountingPunchesTwo.DeviceNameOne.Value = siemensRunTimeSpan;
             LaserCountingPunchesTwo.DeviceNameTwo.Value = siemensStopTimeSpan;
             LaserCountingPunchesTwo.DeviceNameThree.Value = siemensArlamString;
             LaserCountingPunchesTwo.DeviceNameFour.Value = siemensMoldTimeSpan;
             LaserCountingPunchesTwo.DeviceNameFive.Value = siemensRepairTime;
-            //LaserCountingPunchesTwo.DeviceNameSix.Value = TimeSpan.FromSeconds(Math.Round(siemensCeShi)).ToString();
+
 
             LaserCountingPunchesThree.DeviceNameOne.Value = behwiftRunTimeSpan;
             LaserCountingPunchesThree.DeviceNameTwo.Value = behwiftStopTimeSpan;
             LaserCountingPunchesThree.DeviceNameThree.Value = behwiftArlamString;
             LaserCountingPunchesThree.DeviceNameFour.Value = behwiftMoldTimeSpan;
             LaserCountingPunchesThree.DeviceNameFive.Value = behwifRepairTime;
-            //LaserCountingPunchesThree.DeviceNameSix.Value = TimeSpan.FromSeconds(Math.Round(behwiftCeShi)).ToString();
-            // 界面文本
+
             LaserCountingPunchesOne.Title = new string[] { "激光机运行时间:",
                 "激光机等待时间:",
                 "激光机报警/维修时间:",
@@ -201,22 +178,12 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
         public List<MachineInfoModel> deviceInformation { get; set; }
         public void GetDBData()//设备运行状态时间
         {
-            //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"));
-            //获取当天所有设备信息
-            deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
-               .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();
+            deviceInformation = CustomerEnv.MachineInfos; //获取当天所有设备信息
 
         }
 
         public double DeviceTimeValue(string deviceName, string StateCode)//设备运行状态时间
         {
-            ////获取当天所有设备信息
-            //var deviceInformation = DAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?.Where(t => t.CreateTime.Date == DateTime.Now.Date);
             var keepTime = deviceInformation.ToLookup(t => t.Device)[deviceName].ToLookup(t => t.StateCode)[StateCode].Sum(t => t.DurationSec);
             return Convert.ToDouble(keepTime);
         }
@@ -224,7 +191,7 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
         public List<RepairTableModel> deviceRepairDay { get; set; }
         public void GetRepairTime()
         {
-            deviceRepairDay = DAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();
+            deviceRepairDay = CustomerEnv.RepairInfos;
 
         }
         public int DeviceRepairTime(string deviceName)//设备保养时间到期所剩的天数
@@ -246,11 +213,7 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
         public List<MaintenanceTableModel> deviceMaintenanceTable { get; set; }
         public void GetTableTime()
         {
-            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();//获取当天所有设备维修信息
+             deviceMaintenanceTable =CustomerEnv.MaintenanceInfos;//获取当天所有设备维修信息
 
         }
         public TimeSpan DevicMainTableTime(string deviceName)
@@ -270,210 +233,11 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
 
                 return new TimeSpan(0, 0, 0); ;
             }
-            //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;
-        }
-        //public List<ScheduleStopModel> deviceScheduleStop { get; set; }
-        //public void GetScheduleStopTime()//设备停止计划时间
-        //{
-        //    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>().ToList();//获取当天所有设备计划停止信息
-
-        //}
-        //public double DevicScheduleStop(string deviceName)
-        //{
-        //    //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 scheduleStopTime = deviceScheduleStop.ToLookup(t => t.TableName)[deviceName].Select(t => t.DurationTime);//获取设备计划停止时间
-        //    var scheduleStopTimeValue = new TimeSpan();
-        //    foreach (TimeSpan item in scheduleStopTime)
-        //    {
-        //        scheduleStopTimeValue = scheduleStopTimeValue + item;
-        //    }
-        //    return Convert.ToDouble(scheduleStopTimeValue.TotalSeconds);
-        //}
-
-        //public List<AlarmColumModel> deviceAlarmTime { get; set; }
-
-        //public List<AlarmColumModel> DistinctDeviceAlarmTime { get; set; }
-        //public void GetDeviceAlarmTime()//获取设备一天报警信息
-        //{
-        //    var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
-        //    var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
-        //    deviceAlarmTime = DAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();
-
-        //    var classesYesterdayStartTime = Convert.ToDateTime(DateTime.Now.AddDays(-1).Date);
-        //    var classesDayEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
-        //    DistinctDeviceAlarmTime = DAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesYesterdayStartTime & t.CreateTime <= classesDayEndTime).ToList();
-        //}
-        //public List<DeviceScheduleStopModel> deviceStopTime { get; set; }
-
-        //public void GetDeviceStopTime()//获取计划停止时间
-        //{
-        //    deviceStopTime = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>();
-        //}
-
-        //public double DeviceAlarmTime(string deviceName)
-        //{
-        //    var timeStopTime = deviceStopTime.ToLookup(t => t.Device)[deviceName];
-        //    var timeStopPieces = new List<TimePiece>();
-        //    if (timeStopTime.Count() != 0)
-        //    {
-        //        foreach (var item in timeStopTime)
-        //        {
-        //            timeStopPieces.Add(new TimePiece
-        //            {
-        //                StartTime = Convert.ToDateTime(item.StartTime.ToString()).TimeOfDay,
-        //                EndTime = Convert.ToDateTime(item.EndTime.ToString()).TimeOfDay
-        //            });
-        //        }
-        //    }
-
-        //    var informationValue = deviceAlarmTime?.ToLookup(t => t.Device_Str)[deviceName];
-        //    var deviceValueInformation = DistinctDeviceAlarmTime.ToLookup(t => t.Device_Str)[deviceName];
-        //    var timePieces = new List<TimePiece>();
-        //    if (deviceValueInformation.Count() != 0)
-        //    {
-        //        foreach (var item in deviceValueInformation)
-        //        {
-        //            if (item.StartTime < Convert.ToDateTime(DateTime.Now.ToString("00:00:00")) & item.EndTime > Convert.ToDateTime(DateTime.Now.ToString("00:00:00")))
-        //            {
-        //                timePieces.Add(new TimePiece
-        //                {
-        //                    StartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00")).TimeOfDay,
-        //                    EndTime = item.EndTime.TimeOfDay
-        //                });
-        //            }
-
-        //        }
-
-        //    }
-        //    if (informationValue.Count() != 0)
-        //    {
-        //        foreach (var item in informationValue)
-        //        {
-        //            timePieces.Add(new TimePiece
-        //            {
-        //                StartTime = item.StartTime.TimeOfDay,
-        //                EndTime = item.EndTime.TimeOfDay
-        //            });
-        //        }
-        //    }
-
-        //    if (timePieces.Count() == 0)
-        //    {
-        //        timePieces = new List<TimePiece>() {
-
-        //              new TimePiece{StartTime =TimeSpan.FromSeconds(DateTime.Now.ToOADate()) ,
-        //                  EndTime = TimeSpan.FromSeconds(DateTime.Now.ToOADate())},
-        //             };
-        //    }
-
-        //    var total = TimeTotalHelper.DistinctPlanStopTime(TimeTotalHelper.DistinctTime(timePieces), timeStopPieces);
-        //    var doubletotal = total.TotalSeconds;
-        //    return doubletotal;
-
-        //}
-
-
-        public List<DeviceWorkTimeModel> DeviceWorkTime { get; set; }//所有设备一天通电时间的信息
-        public void GetHighDeviceWorkTime()
-        {
-            var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
-            var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
-            DeviceWorkTime = DAL.App_Vertiv_WorkTime.GetData<DeviceWorkTimeModel>()?.Where(t => t.TurnOnTime >= classesStartTime & t.TurnOnTime <= classesEndTime).ToList();
+         
         }
+        
 
-        public double AllDeviceWorkTime(string deviceName)//设备一天通电的时长
-        {
-
-            var DeviceWait = DeviceWorkTime.ToLookup(t => t.DeviceName)[deviceName].Sum(t => t.DurationSec);//获取设备等待时间
-            return DeviceWait;
-        }
-
-        //public List<MachineInfoModel> DeviceMachineInformation { get; set; }
-
-        //public List<DeviceScheduleStopModel> DeviceScheduleStopInformation { get; set; }
-
-        //public int DeviceScheduleStopBetWeenTime { get; set; }
-
-        //public List<int> DeviceScheduleStopBetweenTimeList { get; set; }
-
-        //public int IntValue { get; set; }
-        //public void GetDeviceScheduleStopBetweenTime()
-        //{
-        //    DeviceScheduleStopInformation = Env.SqlDAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>();
-        //    DeviceMachineInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>();
-        //}
-        //public double DeviceScheduleStopBetweenTime(string deviceName)
-        //{
-
-        //    List<int> DeviceValue = new List<int>();
-        //    var deviceScheduleStop = DeviceScheduleStopInformation.ToLookup(t => t.Device)[deviceName];
-        //    foreach (var item in deviceScheduleStop)
-        //    {
-
-        //        var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString(item.StartTime.ToString()));
-        //        var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString(item.EndTime.ToString()));
-        //        var deviceBetweenTime = DeviceMachineInformation?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime);
-        //        DeviceScheduleStopBetWeenTime = deviceBetweenTime.Sum(t => t.DurationSec);
-        //        DeviceValue.Add(DeviceScheduleStopBetWeenTime);
-        //    }
-
-        //    DeviceScheduleStopBetweenTimeList = DeviceValue;
-        //    for (int i = 0; i < DeviceScheduleStopBetweenTimeList.Count; i++)
-        //    {
-        //        IntValue = DeviceScheduleStopBetweenTimeList[i] + IntValue;
-        //    }
-        //    return IntValue;
-        //}
-
-
-
-
-        //public List<AlarmColumModel> DeviceAlarmMachineInformation { get; set; }
-
-        //public List<DeviceScheduleStopModel> DeviceAlarmScheduleStopInformation { get; set; }
-        //public int DeviceAlarmInt { get; set; }
-
-        //public List<int> DeviceAlarmIntList { get; set; }
-        //public void GetDeviceAlarmScheduleStopBetweenTime()
-        //{
-        //    DeviceAlarmScheduleStopInformation = Env.SqlDAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>();
-
-        //    DeviceAlarmMachineInformation = Env.SqlDAL.Base_AlarmLog.GetData<AlarmColumModel>();
-        //}
-
-        //public double DeviceAlarmScheduleStopBetweenTime(string deviceName)
-        //{
-
-        //    List<int> DeviceValue = new List<int>();
-        //    var deviceScheduleStop = DeviceAlarmScheduleStopInformation.ToLookup(t => t.Device)[deviceName];
-        //    foreach (var item in deviceScheduleStop)
-        //    {
-        //        var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString(item.StartTime.ToString()));
-        //        var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString(item.EndTime.ToString()));
-        //        var deviceBetweenTime = DeviceAlarmMachineInformation?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime);
-        //        DeviceAlarmInt = deviceBetweenTime.Sum(t => t.DurationSec);
-        //        DeviceValue.Add(DeviceAlarmInt);
-        //    }
-
-        //    DeviceAlarmIntList = DeviceValue;
-        //    for (int i = 0; i < DeviceAlarmIntList.Count; i++)
-        //    {
-        //        DeviceAlarmInt = DeviceAlarmIntList[i] + DeviceAlarmInt;
-        //    }
-        //    return DeviceAlarmInt;
-        //}
+          
 
 
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
@@ -481,7 +245,7 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
 
             try
             {
-                if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged   &&
+                if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged &&
                             e.TimeFlag.Second % 16 == 0)
 
                 {
@@ -489,9 +253,7 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
                     GetDBData();
                     GetTableTime();
                     GetRepairTime();
-                    GetHighDeviceWorkTime();
-                 
-            
+              
                     var laserRepairTime = "倒计时" + DeviceRepairTime("激光机").ToString() + "天";//激光机设备保养信息
                     var siemensRepairTime = "倒计时" + DeviceRepairTime("西门子840D数冲").ToString() + "天";//西门子设备保养信息
                     var behwifRepairTime = "倒计时" + DeviceRepairTime("倍福数冲机").ToString() + "天";//倍福数冲设备保养信息
@@ -574,20 +336,20 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
                         LaserCountingPunchesOne.DeviceNameThree.Value = laserArlamString;
                         LaserCountingPunchesOne.DeviceNameFour.Value = laserRepairTime;
                         //LaserCountingPunchesOne.DeviceNameFive.Value = Time.ToString();
-                     
+
                         LaserCountingPunchesTwo.DeviceNameOne.Value = siemensRunTimeSpan;
                         LaserCountingPunchesTwo.DeviceNameTwo.Value = siemensStopTimeSpan;
                         LaserCountingPunchesTwo.DeviceNameThree.Value = siemensArlamString;
                         LaserCountingPunchesTwo.DeviceNameFour.Value = siemensMoldTimeSpan;
                         LaserCountingPunchesTwo.DeviceNameFive.Value = siemensRepairTime;
-                
+
 
                         LaserCountingPunchesThree.DeviceNameOne.Value = behwiftRunTimeSpan;
                         LaserCountingPunchesThree.DeviceNameTwo.Value = behwiftStopTimeSpan;
                         LaserCountingPunchesThree.DeviceNameThree.Value = behwiftArlamString;
                         LaserCountingPunchesThree.DeviceNameFour.Value = behwiftMoldTimeSpan;
                         LaserCountingPunchesThree.DeviceNameFive.Value = behwifRepairTime;
-                    
+
                     }));
 
                 }

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

@@ -122,13 +122,9 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
         public List<MachineInfoModel> deviceInformation { get; set; }
         public void GetDBData()//设备运行状态时间
         {
-            var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
-            var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
-
 
             //获取当天所有设备信息
-            deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
-               .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime)?.ToList();
+            deviceInformation = CustomerEnv.MachineInfos;
 
         }
         public double DeviceTimeValue(string deviceName, string StateCode)
@@ -139,44 +135,11 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
         }
 
 
-        //public List<ScheduleStopModel> deviceScheduleStop { get; set; }
-        //public void GetScheduleStopTime()//设备停止计划时间
-        //{
-        //    //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"));
-
-        //    deviceScheduleStop = DAL.App_Vertiv_ScheduleStop.GetData<ScheduleStopModel>()?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();//获取当天所有设备计划停止信息
-
-        //}
-
-
-        //public double DevicScheduleStop(string deviceName)
-        //{
-        //    var scheduleStopTime = deviceScheduleStop.ToLookup(t => t.TableName)[deviceName].Select(t => t.DurationTime);//获取设备计划停止时间
-        //    var scheduleStopTimeValue = new TimeSpan();
-        //    foreach (TimeSpan item in scheduleStopTime)
-        //    {
-        //        scheduleStopTimeValue = scheduleStopTimeValue + item;
-        //    }
-        //    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();//获取当天所有设备维修信息
+            deviceMaintenanceTable = CustomerEnv.MaintenanceInfos;//获取当天所有设备维修信息
 
         }
         public TimeSpan DevicMainTableTime(string deviceName)
@@ -199,70 +162,7 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
           
         }
 
-        //public List<MachineInfoModel> DeviceMachineInformation { get; set; }
-
-        //public List<DeviceScheduleStopModel> DeviceScheduleStopInformation { get; set; }
-
-        //public int DeviceStateCodeScheduleStopBetWeenTime { get; set; }
-
-        //public List<int> DeviceStateCodeScheduleStopBetweenTimeList { get; set; }
-
-        //public int DeviceStateCodeIntValue { get; set; }
-        //public void GetDeviceScheduleStopBetweenTime()
-        //{
-        //    DeviceScheduleStopInformation = Env.SqlDAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>();
-        //    DeviceMachineInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>();
-        //}
-        //public double DeviceStateCodeStopBetweenTime(string deviceName, string deviceStateCode)
-        //{
-        //    DeviceStateCodeIntValue = 0;
-        //    List<int> DeviceValue = new List<int>();
-        //    var deviceScheduleStop = DeviceScheduleStopInformation.ToLookup(t => t.Device)[deviceName];
-        //    foreach (var item in deviceScheduleStop)
-        //    {
-        //        var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString(item.StartTime.ToString()));
-        //        var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString(item.EndTime.ToString()));
-        //        var deviceBetweenTime = DeviceMachineInformation.ToLookup(t => t.Device)[deviceName].ToLookup(t => t.StateCode)[deviceStateCode]?
-        //        .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime);
-        //        DeviceStateCodeScheduleStopBetWeenTime = deviceBetweenTime.Sum(t => t.DurationSec);
-        //        DeviceValue.Add(DeviceStateCodeScheduleStopBetWeenTime);
-        //    }
-
-        //    DeviceStateCodeScheduleStopBetweenTimeList = DeviceValue;
-        //    for (int i = 0; i < DeviceStateCodeScheduleStopBetweenTimeList.Count; i++)
-        //    {
-        //        DeviceStateCodeIntValue = DeviceStateCodeScheduleStopBetweenTimeList[i] + DeviceStateCodeIntValue;
-        //    }
-        //    return DeviceStateCodeIntValue;
-        //}
-
-        //public int DeviceScheduleStopBetWeenTime { get; set; }
-
-        //public List<int> DeviceScheduleStopBetweenTimeList { get; set; }
-
-        //public int DeviceIntValue { get; set; }
-
-        //public double DeviceScheduleStopBetweenTime(string deviceName)
-        //{
-        //    DeviceIntValue = 0;
-        //    List<int> DeviceValue = new List<int>();
-        //    var deviceScheduleStop = DeviceScheduleStopInformation.ToLookup(t => t.Device)[deviceName];
-        //    foreach (var item in deviceScheduleStop)
-        //    {
-        //        var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString(item.StartTime.ToString()));
-        //        var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString(item.EndTime.ToString()));
-        //        var deviceBetweenTime = DeviceMachineInformation.ToLookup(t => t.Device)[deviceName]?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime);
-        //        DeviceScheduleStopBetWeenTime = deviceBetweenTime.Sum(t => t.DurationSec);
-        //        DeviceValue.Add(DeviceScheduleStopBetWeenTime);
-        //    }
-
-        //    DeviceScheduleStopBetweenTimeList = DeviceValue;
-        //    for (int i = 0; i < DeviceScheduleStopBetweenTimeList.Count; i++)
-        //    {
-        //        DeviceIntValue = DeviceScheduleStopBetweenTimeList[i] + DeviceIntValue;
-        //    }
-        //    return DeviceIntValue;
-        //}
+       
 
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
         {

+ 2 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Env.cs

@@ -30,9 +30,9 @@ namespace SCADA_DAQ
 
         //public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("10.163.96.79", "Vertiv", "sa", "1qaz2wsx");
 
-        //public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("127.0.0.1", "Vertiv", "sa", "M+123456");
+        public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("127.0.0.1", "Vertiv", "sa", "M+123456");
         
-        public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("10.163.96.79", "Vertiv", "sa", "1qaz2wsx");
+        //public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("10.163.96.79", "Vertiv", "sa", "1qaz2wsx");
 
         //public static SqlSchema.DIL.DILDB SqlDAL;
 

BIN
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Icon/Logo-3.png


+ 3 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj

@@ -340,6 +340,9 @@
     <None Update="Icon\KejiBian.jpg">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Update="Icon\Logo-3.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Icon\logo.ico">
       <Pack>True</Pack>
       <PackagePath>\</PackagePath>