谢翼翔 hai 1 ano
pai
achega
5f9399952c

+ 28 - 16
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmBendDeviceOeeInformation.xaml.cs

@@ -73,17 +73,32 @@ namespace SCADA_DAQ.Customer
             OeeAVGChart("亚威PBC折弯机", YaWeiPBCDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
             OeeAVGChart("百超折弯机", BaiChaoDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
         }
+        public List<TimeSection> Days { get; set; }
+        public void GetOeeData()
+        {
+            Days = DateTimeHelper.GetDays(DateTimeHelper.ToMonthStart(DateTime.Now), DateTimeHelper.ToMonthEnd(DateTime.Now));
+            var first = DateTime.Parse(Days.First().StartTime.ToString());
+            var last = DateTime.Parse(Days.Last().EndTime.ToString());
+            OeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= first & t.CreateTime <= last);
+
+
+        }
 
         public void OeeChart(string deviceName, IList<string> DeviceAisxX, IChartValues DeviceAxisY)
         {
-
+            var dayCount = DateTime.Now.Day;
             var listdouble = OeePercent(deviceName);
             for (int i = 0; i < listdouble.Count; i++)
             {
-                DeviceAxisY.Add(listdouble[i]);
+                if (i < dayCount)
+                {
+                    DeviceAxisY.Add(listdouble[i]);
+                }
+                
                 DeviceAisxX.Add(((i + 1).ToString() + "日"));
 
             }
+
             DeviceOeePercenValue.ChartOeeAxisYList = new ChartValues<double>();
             DeviceOeePercenValue.ChartOeeAxisXList = new List<string>();
 
@@ -92,26 +107,21 @@ namespace SCADA_DAQ.Customer
 
         public void OeeAVGChart(string deviceName, IChartValues DeviceAxisY)
         {
+            var dayCount = DateTime.Now.Day;
             var deviceAVG = OeePercentAVG(deviceName);
             for (int i = 0; i < deviceAVG.Count(); i++)
             {
-                DeviceAxisY.Add(deviceAVG[i]);
+                
+                    DeviceAxisY.Add(deviceAVG[i]);
+
+              
             }
             DeviceOeePercenValue.ChartOeeAVGAxisYList = new ChartValues<double>();
         }
 
         public IEnumerable<OEEDataModel> OeeData { get; set; }
 
-        public List<TimeSection> Days { get; set; }
-        public void GetOeeData()
-        {
-            Days = DateTimeHelper.GetDays(DateTimeHelper.ToMonthStart(DateTime.Now), DateTimeHelper.ToMonthEnd(DateTime.Now));
-            var first = DateTime.Parse(Days.First().StartTime.ToString());
-            var last = DateTime.Parse(Days.Last().EndTime.ToString());
-            OeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= first & t.CreateTime <= last);
-
-
-        }
+     
         public List<double> OeePercent(string deviceName)
         {
             var allOeePercentage = new List<double>();
@@ -145,9 +155,9 @@ namespace SCADA_DAQ.Customer
         public List<double> OeePercentAVG(string deviceName)
         {
             var hourStartResult = DateTime.Parse(Days.First().StartTime.ToString());
-            var hourEndResult = DateTime.Parse(DateTime.Now.ToString("00:00:00"));
+            var hourEndResult = DateTime.Parse(DateTime.Now.ToString("23:59:59"));
             var OeePercentStingAVG = OeeData.ToLookup(t => t.DeviceName)[deviceName]
-           .Where(t => t.CreateTime >= DateTime.Parse(hourStartResult.Format()) & t.CreateTime < DateTime.Parse(hourEndResult.Format()));
+           .Where(t => t.CreateTime >= DateTime.Parse(hourStartResult.Format()) & t.CreateTime <= DateTime.Parse(hourEndResult.Format()));
             double aVGValue = 0;
             var aVGOeePercentage = new List<double>();
             foreach (var item in OeePercentStingAVG)
@@ -155,9 +165,11 @@ namespace SCADA_DAQ.Customer
                 aVGValue = double.Parse(item.OeePercentage) + aVGValue;
             }
             var allAVGValue = aVGValue / OeePercentStingAVG.Count();
+       
             for (int i = 0; i < Days.Count; i++)
             {
-                aVGOeePercentage.Add(allAVGValue * 100);
+                    aVGOeePercentage.Add(allAVGValue * 100);
+              
             }
             return aVGOeePercentage;
         }

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

@@ -149,7 +149,7 @@ namespace SCADA_DAQ.Customer
                 {
                     if (OeePercentSting.Count() == 0)
                     {
-                        dayRunTime = null;
+                        dayRunTime = 0;
 
                     }
                     else
@@ -165,9 +165,9 @@ namespace SCADA_DAQ.Customer
         public List<double> OeePercentAVG(string deviceName)
         {
             var hourStartResult = DateTime.Parse(Days.First().StartTime.ToString());
-            var hourEndResult = DateTime.Parse(DateTime.Now.ToString("00:00:00"));
+            var hourEndResult = DateTime.Parse(DateTime.Now.ToString("23:59:59"));
             var OeePercentStingAVG = OeeData.ToLookup(t => t.DeviceName)[deviceName]
-           .Where(t => t.CreateTime >= DateTime.Parse(hourStartResult.Format()) & t.CreateTime < DateTime.Parse(hourEndResult.Format()));
+           .Where(t => t.CreateTime >= DateTime.Parse(hourStartResult.Format()) & t.CreateTime <= DateTime.Parse(hourEndResult.Format()));
             double aVGValue = 0;
             var aVGOeePercentage = new List<double>();
             foreach (var item in OeePercentStingAVG)

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

@@ -54,9 +54,9 @@ namespace SCADA_DAQ.Customer
                 while (true)
                 {
                     //点击频率  单位秒
-                    System.Threading.Thread.Sleep(3 * 1000);
+                    System.Threading.Thread.Sleep(10 * 60000);
                     //方法第一个参数鼠标x的坐标,第二个参数是鼠标y的坐标
-                    MouseFlag.MouseLeftClickEvent(500, 500, 0);
+                    MouseFlag.MouseLeftClickEvent(1401, 1061, 0);
 
                 }
             });

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

@@ -30,6 +30,7 @@ using System.Windows.Media.Animation;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using static SCADA_DAQ.Customer.UctFrmKanbanForPressBrakeEquipment;
 using Application = System.Windows.Application;
 using T_Col_Name = SqlSchema.DBNames.T_Col_Name;
 
@@ -48,6 +49,7 @@ namespace SCADA_DAQ.Customer
 
         public UctFrmRunHistory()
         {
+           
             InitializeComponent();
             TimeSelect.SelectTimeChangeEvent += TimeSelect_SelectTimeChangeEvent; ;
             TimeSelect.ReturnTodayEvent += TimeSelect_ReturnTodayEvent; ;

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

@@ -30,8 +30,8 @@ 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("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("10.163.96.79", "Vertiv", "sa", "1qaz2wsx");
 
         //public static SqlSchema.DIL.DILDB SqlDAL;