Browse Source

临时提交

谢翼翔 1 year ago
parent
commit
2a9a71c9a5

BIN
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/Lib/SCADA.dll


BIN
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/Lib/Topshelf.dll


+ 49 - 4
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Machines/FXMachine.cs

@@ -11,6 +11,7 @@ using System.Text;
 using System.Threading.Tasks;
 using SCADA_DAQ.Customer.Models;
 using SqlSchema.DBNames;
+using static NPOI.HSSF.Util.HSSFColor;
 
 namespace SCADA_DAQ.Customer.Machines
 {
@@ -21,6 +22,50 @@ namespace SCADA_DAQ.Customer.Machines
         public FXMachine(string machieID) : base(machieID)
         {
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
+            PropertyChanged += FXMachine_PropertyChanged;
+
+        }
+
+        private void FXMachine_PropertyChanged(object sender, PropertyChangedEventArgs e)
+        {
+            if (e.PropertyName == nameof(IsOpenTime))
+            {
+                if (IsOpenTime == true)
+                {
+                    if (machineStateResumeModels.Count != 0)
+                    {
+                        machineStateResumeModels[0].EndTime = DateTime.Parse(DateTime.Now.Format());
+                        Env.SqlDAL.App_Vertiv_MachineInfo.Update(
+                            $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{machineStateResumeModels[0].StateId}'",
+                            new UpdateItem("EndTime_Dt", DateTime.Now.Format()),
+                            new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, machineStateResumeModels[0].EndTime - machineStateResumeModels[0].StartTime),
+                            new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (machineStateResumeModels[0].EndTime - machineStateResumeModels[0].StartTime).TotalSeconds)
+                            );
+                        //machineStateResumeModels.RemoveAt(0);
+
+                    }
+
+                }
+                else
+                {
+                    if (IsOpenTime == false )
+                    {
+                        var runFlag = this.GetListenReg("运行标志位");
+                        var stopFlag = this.GetListenReg("停止标志位");
+                        var toolChangeFlag = this.GetListenReg("换模标志位");
+                        var repairFlag = this.GetListenReg("维修时间");
+                        RegInfo reg = runFlag.Value == 1 ? runFlag : stopFlag.Value == 1 ? stopFlag : toolChangeFlag.Value == 1 ? toolChangeFlag : repairFlag.Value == 1 ? repairFlag : null;
+                        if (reg == null)
+                        {
+                            InsertStateRecord(reg);
+                        }
+                   
+                    }
+
+
+                }
+            }
+
         }
 
 
@@ -83,7 +128,6 @@ namespace SCADA_DAQ.Customer.Machines
             base.RegReadValueChanged(sender, e);
             var reg = (RegInfo)sender;
             InsertStateRecord(reg);
-
         }
 
         protected override void ScanCompleted(object sender, EventArgs e)
@@ -114,7 +158,7 @@ namespace SCADA_DAQ.Customer.Machines
                         );
                     log.Info($"设备名{BaseDevice.DeviceID},插入状态{reg.Comment.Variable},记录列表有{machineStateResumeModels.Count}条数据");
                 }
-                if (reg?.Value != null && reg.Value == 0)
+                if (reg?.OldValue != null && reg.Value == 0)
                 {
                     if (machineStateResumeModels.Count > 0)
                     {
@@ -128,8 +172,9 @@ namespace SCADA_DAQ.Customer.Machines
                                 new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (machineStateResumeModels[0].EndTime - machineStateResumeModels[0].StartTime).TotalSeconds)
                                 );
                             log.Info($"设备名{BaseDevice.DeviceID},更新状态{reg.Comment.Variable},记录列表有{machineStateResumeModels.Count}条数据");
+                            machineStateResumeModels.RemoveAt(0);
                         }
-                        machineStateResumeModels.RemoveAt(0);
+
                     }
                 }
             }
@@ -154,7 +199,7 @@ namespace SCADA_DAQ.Customer.Machines
                     machineStateResumeModels.RemoveAt(0);
                 }
                 //断线要清除列表
-                machineStateResumeModels.Clear();
+                //machineStateResumeModels.Clear();
             }
         }
 

+ 33 - 52
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Machines/SampleMachine.cs

@@ -36,6 +36,25 @@ namespace SCADA_DAQ.Customer.Machines
 
         public DateTime StartTime { get; set; }
 
+
+        /// <summary>
+        /// 计划停止时间
+        /// </summary>
+        public bool IsOpenTime
+        {
+            get { return _IsOpenTime; }
+            set
+            {
+                if (value != _IsOpenTime)
+                {
+                    _IsOpenTime = value;
+                    OnPropertyChanged(nameof(IsOpenTime));
+                }
+            }
+        }
+        private bool _IsOpenTime;
+
+
         private static SqlSchema.DIL.DILDB DAL = Env.SqlDAL;
         /// <summary>
         /// 
@@ -56,48 +75,7 @@ namespace SCADA_DAQ.Customer.Machines
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
         {
 
-            //if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.MinuteChanged ||
-            //    e.ChangeType == SCADA.CommonLib.DateTimeChangeType.HourChanged)
-            //{
-            //    if (BaseDevice.ConnectState == SCADA.Comm.ConnectStates.Connected)
-            //    {
-
-            //        for (int i = 0; i < 10; i++)
-            //        {
-            //            if (CustomerEnv.schedualList[i].IsEnable)
-            //            {
-            //                if (CustomerEnv.schedualList[i].MaintainHour == DateTime.Now.Hour &&
-            //                     CustomerEnv.schedualList[i].StartMin == DateTime.Now.Minute)
-            //                {
-            //                    var name = BaseDevice.DeviceID= "亚威PBC折弯机";
-            //                    StartTime = DateTime.Now;
-            //                    OrgID = Guid.NewGuid().ToString();
-            //                    Env.SqlDAL.App_Vertiv_ScheduleStop.Insert(
-            //                    new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str, OrgID),
-            //                    new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StartTime_Dt, StartTime),
-            //                    new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.TableName_Str, name));
-            //                }
-
-            //                if (CustomerEnv.schedualList[i].MaintainsStopInHour == DateTime.Now.Hour &&
-            //                         CustomerEnv.schedualList[i].StopMinute == DateTime.Now.Minute)
-            //                {
-
-            //                    var stopTimeValue = DateTime.Now;
-            //                    var lastTime = stopTimeValue - StartTime;
-            //                    Env.SqlDAL.App_Vertiv_ScheduleStop.Update
-            //                           (
-            //                       $"{T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str} = '{OrgID}'",
-            //                       new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.EndTime_Dt, stopTimeValue),
-            //                       new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.Duration_Dt, lastTime)
-            //                           );
-            //                    OrgID = null;
-            //                }                         
-            //            }
-            //        }
-            //    }
-            //}
-            if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.HourChanged ||
-              e.ChangeType.HasFlag(DateTimeChangeType.MinuteChanged) == SCADA.CommonLib.DateTimeChangeType.MinuteChanged.HasFlag(DateTimeChangeType.MinuteChanged))
+            if ( e.ChangeType.HasFlag(DateTimeChangeType.MinuteChanged))
             {
                 var duration = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>().ToLookup(t => t.Device);
                 foreach (var item in duration)
@@ -106,32 +84,35 @@ namespace SCADA_DAQ.Customer.Machines
                     {
                         foreach (var Value in item)
                         {
-
                             if (Value.StartTime.Hours == DateTime.Now.Hour &&
                                  Value.StartTime.Minutes == DateTime.Now.Minute)
                             {
+                                IsOpenTime = true;
                                 var name = BaseDevice.DeviceID;
                                 StartTime = DateTime.Now;
                                 OrgID = Guid.NewGuid().ToString();
-                                Env.SqlDAL.App_Vertiv_ScheduleStop.Insert(
-                                new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str, OrgID),
-                                new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.StartTime_Dt, StartTime),
-                                new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.TableName_Str, name));
+                                Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
+                                new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, OrgID),
+                                new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, StartTime),
+                                new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str,name),
+                                new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "计划停止时间")
+                                );
                             }
 
                             if (Value.EndTime.Hours == DateTime.Now.Hour &&
                                     Value.EndTime.Minutes == DateTime.Now.Minute)
                             {
-
+                                IsOpenTime = false;
                                 var stopTimeValue = DateTime.Now;
                                 var lastTime = stopTimeValue - StartTime;
-                                Env.SqlDAL.App_Vertiv_ScheduleStop.Update
+                                Env.SqlDAL.App_Vertiv_MachineInfo.Update
                                        (
-                                   $"{T_Col_Name.App_Vertiv_ScheduleStop.StateId_Str} = '{OrgID}'",
-                                   new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.EndTime_Dt, stopTimeValue),
-                                   new UpdateItem(T_Col_Name.App_Vertiv_ScheduleStop.Duration_Dt, lastTime)
+                                   $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{OrgID}'",
+                                   new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, stopTimeValue),
+                                   new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, lastTime)
                                        );
                                 OrgID = null;
+                             
                             }
 
                         }

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

@@ -90,20 +90,35 @@ 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 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 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 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 pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "运行标志位"); ;//亚威PBC折弯机运行时间
+            //var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
 
-            var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
-            var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "换模标志位");//百超折弯机换模时间
+            //var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
+            //var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "换模标志位");//百超折弯机换模时间
+
+            var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
+            var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
+
+            var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
+            var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
+
+            var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位");//3号YaWei折弯机运行时间
+            var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
+
+            var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位");//亚威PBC折弯机运行时间
+            var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
+
+            var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位");//百超折弯机运行时间
+            var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
 
 
             var firstYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威一号折弯机").ToString() + "天";//亚威一号折弯机设备保养信息
@@ -112,28 +127,39 @@ 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 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("百超折弯机", "维修时间")));
+            var firstYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威一号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("1号YaWei折弯机", "维修时间")));
+            var secondYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威二号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("2号YaWei折弯机", "维修时间")));
+            var thirdYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威三号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("3号YaWei折弯机", "维修时间")));
+            var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间")));
+            var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间")));
+
+            //double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+            //var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+            //    - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间") + 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 firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位");//1号YaWei折弯机等待时间
+            var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位");//2号YaWei折弯机等待时间
+            var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位"); //3号YaWei折弯机等待时间
+            var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位");//亚威PBC折弯机等待时间
+            var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位");//百超折弯机折弯机等待时间
 
             var firstYaWeiRunTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiRunTime)).ToString();
             var firstYaWeiStopTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiStopTime)).ToString();
@@ -359,7 +385,7 @@ namespace SCADA_DAQ.Customer
             try
             {
                 if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged &&
-                            e.TimeFlag.Second % 16 == 0)
+                            e.TimeFlag.Minute % 1 == 0)
                 {
                     GetDBData();
                     GetTableTime();
@@ -367,21 +393,20 @@ namespace SCADA_DAQ.Customer
                     GetScheduleStopTime();
                     GetDeviceScheduleStopBetweenTime();
 
+                    var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
+                    var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
-                    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 sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
+                    var sencondYaWeiMoldTime = DeviceTimeValue("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 thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位");//3号YaWei折弯机运行时间
+                    var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
 
-                    var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "运行标志位"); ;//亚威PBC折弯机运行时间
-                    var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
+                    var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位");//亚威PBC折弯机运行时间
+                    var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
 
-                    var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "运行标志位"); ;//百超折弯机运行时间
-                    var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "换模标志位");//百超折弯机换模时间
+                    var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位");//百超折弯机运行时间
+                    var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
 
 
                     var firstYaWeiRepairTime = "倒计时" + DeviceRepairTime("亚威一号折弯机").ToString() + "天";//亚威一号折弯机设备保养信息
@@ -390,28 +415,28 @@ 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 firstYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威一号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("1号YaWei折弯机", "维修时间")));
+                    var secondYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威二号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("2号YaWei折弯机", "维修时间")));
+                    var thirdYaWeiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威三号折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("3号YaWei折弯机", "维修时间")));
+                    var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间")));
+                    var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间")));
+
+                    //double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+                    //var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+                    //    - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间") + 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 firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位");//1号YaWei折弯机等待时间
+                    var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位");//2号YaWei折弯机等待时间
+                    var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位"); //3号YaWei折弯机等待时间
+                    var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位");//亚威PBC折弯机等待时间
+                    var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位");//百超折弯机折弯机等待时间
 
                     var firstYaWeiRunTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiRunTime)).ToString();
                     var firstYaWeiStopTimeSpan = TimeSpan.FromSeconds(Math.Round(firstYaWeiStopTime)).ToString();

+ 16 - 8
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml.cs

@@ -96,12 +96,20 @@ namespace SCADA_DAQ.Customer
 
 
             double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
-            var kimFangyuanStopTime = totalTimeOfDay - kimFangyuanRunTime - kimFangyuanMoldTime - DevicScheduleStop("金方圆数控母线冲孔机") - kimFangyuanArlamDouble
-             + DeviceScheduleStopBetweenTime("金方圆数控母线冲孔机") + DeviceAlarmScheduleStopBetweenTime("金方圆数控母线冲孔机");//金方圆数控母线冲孔机等待时间
+            //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("金方圆数控母线冲孔机", "停止标志位");//金方圆数控母线冲孔机等待时间
             var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
 
-            var highmachineStopTime = totalTimeOfDay - highmachineRunTime - highmachineMoldTime - DevicScheduleStop("高机母线冲剪机") - highmachineArlamDouble
-                 + DeviceScheduleStopBetweenTime("高机母线冲剪机") + DeviceAlarmScheduleStopBetweenTime("高机母线冲剪机");//高机母线冲剪机等待时间
+           var highmachineStopTime = totalTimeOfDay - highmachineRunTime - highmachineMoldTime - DevicScheduleStop("高机母线冲剪机") - highmachineArlamDouble
+               + DeviceScheduleStopBetweenTime("高机母线冲剪机") + DeviceAlarmScheduleStopBetweenTime("高机母线冲剪机");//高机母线冲剪机等待时间
             var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
 
             var kimFangyuanTimeValue = new double[] { kimFangyuanRunTime, kimFangyuanStopTime, kimFangyuanArlamDouble, kimFangyuanMoldTime };
@@ -344,7 +352,7 @@ namespace SCADA_DAQ.Customer
             try
             {
                 if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged &&
-                            e.TimeFlag.Second % 12 == 0)
+                            e.TimeFlag.Minute % 1 == 0)
                 {
                     GetDBData();
                     GetTableTime();
@@ -381,12 +389,12 @@ namespace SCADA_DAQ.Customer
 
 
                     double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
-                    var kimFangyuanStopTime = totalTimeOfDay - kimFangyuanRunTime - kimFangyuanMoldTime - DevicScheduleStop("金方圆数控母线冲孔机") - kimFangyuanArlamDouble
-                        + DeviceScheduleStopBetweenTime("金方圆数控母线冲孔机")+ DeviceAlarmScheduleStopBetweenTime("金方圆数控母线冲孔机");//金方圆数控母线冲孔机等待时间
+
+                    var kimFangyuanStopTime = DeviceTimeValue("金方圆数控母线冲孔机", "停止标志位");//金方圆数控母线冲孔机等待时间
                     var kimFangyuanStopTimeSpan = TimeSpan.FromSeconds(Math.Round(kimFangyuanStopTime)).ToString();
 
                     var highmachineStopTime = totalTimeOfDay - highmachineRunTime - highmachineMoldTime - DevicScheduleStop("高机母线冲剪机") - highmachineArlamDouble
-                         + DeviceScheduleStopBetweenTime("高机母线冲剪机") + DeviceAlarmScheduleStopBetweenTime("高机母线冲剪机");//高机母线冲剪机等待时间
+                        + DeviceScheduleStopBetweenTime("高机母线冲剪机") + DeviceAlarmScheduleStopBetweenTime("高机母线冲剪机");//高机母线冲剪机等待时间
                     var highmachineStopTimeSpan = TimeSpan.FromSeconds(Math.Round(highmachineStopTime)).ToString();
 
                     var kimFangyuanTimeValue = new double[] { kimFangyuanRunTime, kimFangyuanStopTime, kimFangyuanArlamDouble, kimFangyuanMoldTime };

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

@@ -88,17 +88,17 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             var behwiftMoldTimeSpan = TimeSpan.FromSeconds(Math.Round(behwiftMoldTime)).ToString();
 
 
-            double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+            //double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
 
-            //var laserStopTime = DeviceTimeValue("激光机", "停止标志位") - DevicScheduleStop("激光机");//激光机等待时间
-            //var siemensStopTime = AllDeviceWorkTime("西门子840D数冲") - DevicScheduleStop("西门子840D数冲");//西门子等待时间
-            //var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位") - DevicScheduleStop("倍福数冲机");//倍福数冲等待时间
-            var laserStopTime = totalTimeOfDay - laserRunTime - DevicScheduleStop("激光机") - laserArlamDouble
-                 + DeviceScheduleStopBetweenTime("激光机") + DeviceAlarmScheduleStopBetweenTime("激光机");//激光机等待时间
-            var siemensStopTime = totalTimeOfDay - siemensRunTime - siemensMoldTime - DevicScheduleStop("西门子840D数冲") - siemensArlamDouble
-                + DeviceScheduleStopBetweenTime("西门子840D数冲") + DeviceAlarmScheduleStopBetweenTime("西门子840D数冲");//西门子等待时间
-            var behwiftStopTime = totalTimeOfDay - behwiftRunTime - behwiftMoldTime - DevicScheduleStop("倍福数冲机") - bewiftArlamDouble
-                + DeviceScheduleStopBetweenTime("倍福数冲机") + DeviceAlarmScheduleStopBetweenTime("倍福数冲机");//倍福数冲等待时间
+            var laserStopTime = DeviceTimeValue("激光机", "停止标志位");//激光机等待时间
+            var siemensStopTime = AllDeviceWorkTime("西门子840D数冲");//西门子等待时间
+            var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位");//倍福数冲等待时间
+            //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();
@@ -386,7 +386,7 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             try
             {
                 if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged &&
-                            e.TimeFlag.Second % 3 == 0)
+                            e.TimeFlag.Minute % 2 == 0)
 
                 {
                     GetDBData();
@@ -452,16 +452,11 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
 
                     double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
 
-                    //var laserStopTime = DeviceTimeValue("激光机", "停止标志位") - DevicScheduleStop("激光机");//激光机等待时间
-                    //var siemensStopTime = AllDeviceWorkTime("西门子840D数冲") - DevicScheduleStop("西门子840D数冲");//西门子等待时间
-                    //var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位") - DevicScheduleStop("倍福数冲机");//倍福数冲等待时间
-                    var laserStopTime = totalTimeOfDay - laserRunTime - DevicScheduleStop("激光机") - laserArlamDouble
-                        + DeviceScheduleStopBetweenTime("激光机")+ DeviceAlarmScheduleStopBetweenTime("激光机");//激光机等待时间
-                    var siemensStopTime = totalTimeOfDay - siemensRunTime - siemensMoldTime - DevicScheduleStop("西门子840D数冲") - siemensArlamDouble 
-                        + DeviceScheduleStopBetweenTime("西门子840D数冲")+ DeviceAlarmScheduleStopBetweenTime("西门子840D数冲");//西门子等待时间
-                    var behwiftStopTime = totalTimeOfDay - behwiftRunTime - behwiftMoldTime - DevicScheduleStop("倍福数冲机") - bewiftArlamDouble
-                        + DeviceScheduleStopBetweenTime("倍福数冲机") + DeviceAlarmScheduleStopBetweenTime("倍福数冲机");//倍福数冲等待时间
-                 
+     
+                    var laserStopTime = DeviceTimeValue("激光机", "停止标志位");//激光机等待时间
+                    var siemensStopTime = AllDeviceWorkTime("西门子840D数冲");//西门子等待时间
+                    var behwiftStopTime = DeviceTimeValue("倍福数冲机", "停止标志位");//倍福数冲等待时间
+
 
                     var laserStopTimeSpan = TimeSpan.FromSeconds(Math.Round(laserStopTime)).ToString();
                     var siemensStopTimeSpan = TimeSpan.FromSeconds(Math.Round(siemensStopTime)).ToString();

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

@@ -50,39 +50,59 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             GetTableTime();
             GetDeviceScheduleStopBetweenTime();
             string[] deviceStatus = { "运行", "等待", "报警/维修", "换模" };
-            var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
-            var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
+            //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 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 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 pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "运行标志位");//亚威PBC折弯机运行时间
+            //var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
 
-            var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "运行标志位"); //百超折弯机运行时间
-            var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "换模标志位");//百超折弯机换模时间
+            //var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "运行标志位"); //百超折弯机运行时间
+            //var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位") - DeviceStateCodeStopBetweenTime("百超折弯机", "换模标志位");//百超折弯机换模时间
+            var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
+            var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
 
-            double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+            var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
+            var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
 
-            var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
-                 - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("1号YaWei折弯机");//1号YaWei折弯机等待时间
-            var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
-                - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("2号YaWei折弯机");//2号YaWei折弯机等待时间
-            var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
-                - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("3号YaWei折弯机");//3号YaWei折弯机等待时间
-            var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
-                - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间") + DeviceScheduleStopBetweenTime("亚威PBC折弯机");//亚威PBC折弯机等待时间
-            var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
-                - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间") + DeviceScheduleStopBetweenTime("百超折弯机");//百超折弯机折弯机等待时间
+            var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位");//3号YaWei折弯机运行时间
+            var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
 
-            var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "维修时间");
-            var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("2号YaWei折弯机", "维修时间");
-            var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("3号YaWei折弯机", "维修时间");
-            var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").TotalSeconds + DeviceTimeValue("亚威PBC折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "维修时间");
-            var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").TotalSeconds + DeviceTimeValue("百超折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("百超折弯机", "维修时间");
+            var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位");//亚威PBC折弯机运行时间
+            var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
+
+            var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位");//百超折弯机运行时间
+            var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
+
+
+            var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位");//1号YaWei折弯机等待时间
+            var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位");//2号YaWei折弯机等待时间
+            var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位"); //3号YaWei折弯机等待时间
+            var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位");//亚威PBC折弯机等待时间
+            var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位");//百超折弯机折弯机等待时间
+
+            //double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
+            //var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+            //     - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("1号YaWei折弯机");//1号YaWei折弯机等待时间
+            //var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
+            //    - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("2号YaWei折弯机");//2号YaWei折弯机等待时间
+            //var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
+            //    - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("3号YaWei折弯机");//3号YaWei折弯机等待时间
+            //var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
+            //    - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间") + DeviceScheduleStopBetweenTime("亚威PBC折弯机");//亚威PBC折弯机等待时间
+            //var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
+            //    - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间") + DeviceScheduleStopBetweenTime("百超折弯机");//百超折弯机折弯机等待时间
+
+            var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间") ;
+            var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间") ;
+            var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间") ;
+            var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").TotalSeconds + DeviceTimeValue("亚威PBC折弯机", "维修时间") ;
+            var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").TotalSeconds + DeviceTimeValue("百超折弯机", "维修时间") ;
 
             var firstYaWeiValueTime = new double[] { firstYaWeiRunTime, firstYaWeiStopTime, firstYaWeiTimeMaintenanceTable, firstYaWeiMoldTime };
             var sencondYaWeiValueTime = new double[] { sencondYaWeiRunTime, sencondYaWeiStopTime, secondYaWeiTimeMaintenanceTable, sencondYaWeiMoldTime };
@@ -273,46 +293,39 @@ namespace SCADA_DAQ.Customer.Views.Dashboard
             try
             {
                 if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged &&
-                            e.TimeFlag.Second % 16 == 0)
+                            e.TimeFlag.Minute % 1 == 0)
                 {
                     GetDBData();
                     GetScheduleStopTime();
                     GetTableTime();
                     GetDeviceScheduleStopBetweenTime();
                     string[] deviceStatus = { "运行", "等待", "报警/维修", "换模" };
-                    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("百超折弯机", "换模标志位");//百超折弯机换模时间
-
-                    double totalTimeOfDay = TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")).TotalSeconds;
-
-                    var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
-                         - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("1号YaWei折弯机");//1号YaWei折弯机等待时间
-                    var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
-                        - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("2号YaWei折弯机");//2号YaWei折弯机等待时间
-                    var thirdYaWweiStopTime = totalTimeOfDay - thirdYaWweiRunTime - thirdYaWweiMoldTime - DevicScheduleStop("3号YaWei折弯机")
-                        - DevicMainTableTime("亚威三号折弯机").TotalSeconds - DeviceTimeValue("3号YaWei折弯机", "维修时间") + DeviceScheduleStopBetweenTime("3号YaWei折弯机");//3号YaWei折弯机等待时间
-                    var pbcYaWweiStopTime = totalTimeOfDay - pbcYaWweiRunTime - pbcYaWweiMoldTime - DevicScheduleStop("亚威PBC折弯机")
-                        - DevicMainTableTime("亚威PBC折弯机").TotalSeconds - DeviceTimeValue("亚威PBC折弯机", "维修时间") + DeviceScheduleStopBetweenTime("亚威PBC折弯机");//亚威PBC折弯机等待时间
-                    var baiChaoStopTime = totalTimeOfDay - baiChaoRunTime - baiChaoMoldTime - DevicScheduleStop("百超折弯机")
-                        - DevicMainTableTime("百超折弯机").TotalSeconds - DeviceTimeValue("百超折弯机", "维修时间") + DeviceScheduleStopBetweenTime("百超折弯机");//百超折弯机折弯机等待时间
-
-                    var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("1号YaWei折弯机", "维修时间");
-                    var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("2号YaWei折弯机", "维修时间");
-                    var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("3号YaWei折弯机", "维修时间");
-                    var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").TotalSeconds + DeviceTimeValue("亚威PBC折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("亚威PBC折弯机", "维修时间");
-                    var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").TotalSeconds + DeviceTimeValue("百超折弯机", "维修时间") - DeviceStateCodeStopBetweenTime("百超折弯机", "维修时间");
+                    var firstYaWeiRunTime = DeviceTimeValue("1号YaWei折弯机", "运行标志位");//1号YaWei折弯机运行时间
+                    var firstYaWeiMoldTime = DeviceTimeValue("1号YaWei折弯机", "换模标志位");//1号YaWei折弯机换模时间
+
+                    var sencondYaWeiRunTime = DeviceTimeValue("2号YaWei折弯机", "运行标志位");//2号YaWei折弯机运行时间
+                    var sencondYaWeiMoldTime = DeviceTimeValue("2号YaWei折弯机", "换模标志位");//2号YaWei折弯机换模时间
+
+                    var thirdYaWweiRunTime = DeviceTimeValue("3号YaWei折弯机", "运行标志位");//3号YaWei折弯机运行时间
+                    var thirdYaWweiMoldTime = DeviceTimeValue("3号YaWei折弯机", "换模标志位");//3号YaWei折弯机换模时间
+
+                    var pbcYaWweiRunTime = DeviceTimeValue("亚威PBC折弯机", "运行标志位");//亚威PBC折弯机运行时间
+                    var pbcYaWweiMoldTime = DeviceTimeValue("亚威PBC折弯机", "换模标志位");//亚威PBC折弯机换模时间
+
+                    var baiChaoRunTime = DeviceTimeValue("百超折弯机", "运行标志位");//百超折弯机运行时间
+                    var baiChaoMoldTime = DeviceTimeValue("百超折弯机", "换模标志位");//百超折弯机换模时间
+
+                    var firstYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威一号折弯机").TotalSeconds + DeviceTimeValue("1号YaWei折弯机", "维修时间");
+                    var secondYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威二号折弯机").TotalSeconds + DeviceTimeValue("2号YaWei折弯机", "维修时间");
+                    var thirdYaWeiTimeMaintenanceTable = DevicMainTableTime("亚威三号折弯机").TotalSeconds + DeviceTimeValue("3号YaWei折弯机", "维修时间");
+                    var pbcYaWweiTimeMaintenanceTable = DevicMainTableTime("亚威PBC折弯机").TotalSeconds + DeviceTimeValue("亚威PBC折弯机", "维修时间");
+                    var baiChaoTimeMaintenanceTable = DevicMainTableTime("百超折弯机").TotalSeconds + DeviceTimeValue("百超折弯机", "维修时间");
+
+                    var firstYaWeiStopTime = DeviceTimeValue("1号YaWei折弯机", "停止标志位");//1号YaWei折弯机等待时间
+                    var sencondYaWeiStopTime = DeviceTimeValue("2号YaWei折弯机", "停止标志位");//2号YaWei折弯机等待时间
+                    var thirdYaWweiStopTime = DeviceTimeValue("3号YaWei折弯机", "停止标志位"); //3号YaWei折弯机等待时间
+                    var pbcYaWweiStopTime = DeviceTimeValue("亚威PBC折弯机", "停止标志位");//亚威PBC折弯机等待时间
+                    var baiChaoStopTime = DeviceTimeValue("百超折弯机", "停止标志位");//百超折弯机折弯机等待时间
 
                     var firstYaWeiValueTime = new double[] { firstYaWeiRunTime, firstYaWeiStopTime, firstYaWeiTimeMaintenanceTable, firstYaWeiMoldTime };
                     var sencondYaWeiValueTime = new double[] { sencondYaWeiRunTime, sencondYaWeiStopTime, secondYaWeiTimeMaintenanceTable, sencondYaWeiMoldTime };

File diff suppressed because it is too large
+ 0 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj


Some files were not shown because too many files changed in this diff