Browse Source

代码完善

谢翼翔 1 year ago
parent
commit
eb9780d353

+ 24 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Machines/CP1HMachine.cs

@@ -98,8 +98,6 @@ namespace SCADA_DAQ.Customer.Machines
 
             }
 
-
-
             if (reg.Comment.Variable == "换模标志位" && RepairValueRegFalse)
             {
                 if (reg.Value == 0)
@@ -122,8 +120,31 @@ namespace SCADA_DAQ.Customer.Machines
                     ChangeModel.OnOrgID_Str = "";
                 }
             }
+
+            //if (reg.Comment.Variable == "故障标志位" && RepairValueRegFalse)
+            //{
+            //    if (reg.Value == 0)
+            //    {
+            //        ChangeModel.OnOrgID_Str = Guid.NewGuid().ToString();
+            //        ChangeModel.StateOnTime_Dt = DateTime.Now;
+            //        Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
+            //            new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmId_Str, ChangeModel.OnOrgID_Str),
+            //            new UpdateItem(T_Col_Name.Base_AlarmLog.Device_Str, BaseDevice.DeviceID),
+            //            new UpdateItem(T_Col_Name.Base_AlarmLog.TriggedTime_Dt, DateTime.Now),
+            //            new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmCode_Str, "故障标志位"));
+            //    }
+            //    else
+            //    {
+            //        Env.SqlDAL.App_Vertiv_MachineInfo.Update(
+            //            $"{T_Col_Name.Base_AlarmLog.AlarmId_Str} = '{ChangeModel.OnOrgID_Str}'",
+            //            new UpdateItem(T_Col_Name.Base_AlarmLog.RecoverTime_Dt, DateTime.Now),
+            //            //new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - ProgramStart.StateOnTime_Dt)),
+            //            new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, (DateTime.Now - ChangeModel.StateOnTime_Dt).TotalSeconds));
+            //        ChangeModel.OnOrgID_Str = "";
+            //    }
+            //}
         }
-        
+
 
         public override void ConnectStateChanged(object sender, ConnectStateChangedEventArgs e)
         {

+ 9 - 23
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Machines/SampleMachine.cs

@@ -97,7 +97,7 @@ namespace SCADA_DAQ.Customer.Machines
             //    }
             //}
             if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.HourChanged ||
-              e.ChangeType == SCADA.CommonLib.DateTimeChangeType.MinuteChanged)
+              e.ChangeType.HasFlag(DateTimeChangeType.MinuteChanged) == SCADA.CommonLib.DateTimeChangeType.MinuteChanged.HasFlag(DateTimeChangeType.MinuteChanged))
             {
                 var duration = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>().ToLookup(t => t.Device);
                 foreach (var item in duration)
@@ -190,21 +190,13 @@ namespace SCADA_DAQ.Customer.Machines
             {
                 AlarmCollection.Add(e.Alarm);
             }));
-            (GlobalEnv.Instance.AlarmDB as BaseDB).Insert(out _, "Base_AlarmLog",
-                new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmId_Str, e.Alarm.Id),
-                new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmCode_Str, e.Alarm.AlarmCode),
-                new UpdateItem(T_Col_Name.Base_AlarmLog.Device_Str, reg.Protocol?.DeviceID),
-                new UpdateItem(T_Col_Name.Base_AlarmLog.TagName_Str, reg.Comment.Variable),
-                new UpdateItem(T_Col_Name.Base_AlarmLog.TriggedTime_Dt, e.Alarm.TriggedTime),
-                new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
-            //Env.DAL.Base_AlarmLog.Insert(
+            //(GlobalEnv.Instance.AlarmDB as BaseDB).Insert(out _, "Base_AlarmLog",
             //    new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmId_Str, e.Alarm.Id),
             //    new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmCode_Str, e.Alarm.AlarmCode),
             //    new UpdateItem(T_Col_Name.Base_AlarmLog.Device_Str, reg.Protocol?.DeviceID),
             //    new UpdateItem(T_Col_Name.Base_AlarmLog.TagName_Str, reg.Comment.Variable),
             //    new UpdateItem(T_Col_Name.Base_AlarmLog.TriggedTime_Dt, e.Alarm.TriggedTime),
-            //    new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed)
-            //    );
+            //    new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
         }
 
         /// <summary>   ·
@@ -219,18 +211,12 @@ namespace SCADA_DAQ.Customer.Machines
             {
                 AlarmCollection.Remove(e.Alarm);
             }));
-            (GlobalEnv.Instance.AlarmDB as BaseDB).Update("Base_AlarmLog",
-                $"{T_Col_Name.Base_AlarmLog.AlarmId_Str}='{e.Alarm.Id}'",
-                new UpdateItem(T_Col_Name.Base_AlarmLog.RecoverTime_Dt, e.Alarm.RecoverTime),
-              new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Str, e.Alarm.Duration.ToString(@"dd\.hh\:mm\:ss\.fff")),
-              new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, e.Alarm.DurationTicks),
-              new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
-            //Env.DAL.Base_AlarmLog.Update(
-            //$"{T_Col_Name.Base_AlarmLog.AlarmId_Str}='{e.Alarm.Id}'",
-            //new UpdateItem(T_Col_Name.Base_AlarmLog.RecoverTime_Dt, e.Alarm.RecoverTime),
-            //new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Str, e.Alarm.Duration.ToString(@"dd\.hh\:mm\:ss\.fff")),
-            //new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, e.Alarm.DurationTicks),
-            //new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
+            //(GlobalEnv.Instance.AlarmDB as BaseDB).Update("Base_AlarmLog",
+            //    $"{T_Col_Name.Base_AlarmLog.AlarmId_Str}='{e.Alarm.Id}'",
+            //    new UpdateItem(T_Col_Name.Base_AlarmLog.RecoverTime_Dt, e.Alarm.RecoverTime),
+            //  new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Str, e.Alarm.Duration.ToString(@"dd\.hh\:mm\:ss\.fff")),
+            //  new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, e.Alarm.DurationTicks),
+            //  new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
         }
 
         public override void ConnectStateChanged(object sender, ConnectStateChangedEventArgs e)

+ 6 - 4
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/MachineMoldTime/QueryMachineMoldModel.cs

@@ -25,7 +25,7 @@ namespace SCADA_DAQ.Customer.Models.MachineMoldTime
         /// <summary>
         /// 设备名称
         /// </summary>
-        [AutoViewProperty("设备名称")]
+        [AutoViewProperty("设备名称", OptionItemsSource = nameof(DeviceList), StringType = StringType.IsLimited)]
         [Query(T_Col_Name.App_Vertiv_MachineInfo.Device_Str)]
         public string Device
         {
@@ -40,11 +40,13 @@ namespace SCADA_DAQ.Customer.Models.MachineMoldTime
             }
         }
         private string _Device;
-
+        public List<string> DeviceList { get; set; } = new List<string> { "1号YaWei折弯机", "2号YaWei折弯机", "3号YaWei折弯机", "激光机", "高机母线冲剪机", "百超折弯机",
+            "倍福数冲机", "金方圆数控母线冲孔机", "西门子840D数冲", "亚威PBC折弯机" };
 
         /// <summary>
         /// 
         /// </summary>
+        [AutoViewProperty("设备状态")]
         [Query(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str)]
         public string StateCode
         {
@@ -58,8 +60,8 @@ namespace SCADA_DAQ.Customer.Models.MachineMoldTime
                 }
             }
         }
-        private string _StateCode="换模标志位";
-
+        private string _StateCode;
+        //public List<string> DeviceCode { get; set; } = new List<string> { "换模标志位", "停止标志位" };
 
         /// <summary>
         /// 

+ 3 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/MachineRepairTime/QueryMachinRepairModel.cs

@@ -23,7 +23,7 @@ namespace SCADA_DAQ.Customer.Models.MachineRepairTime
         /// <summary>
         /// 设备名称
         /// </summary>
-        [AutoViewProperty("设备名称")]
+        [AutoViewProperty("设备名称", OptionItemsSource = nameof(DeviceList), StringType = StringType.IsLimited)]
         [Query(T_Col_Name.App_Vertiv_MaintenanceTable.DeviceName_Str)]
         public string DeviceName
         {
@@ -38,9 +38,10 @@ namespace SCADA_DAQ.Customer.Models.MachineRepairTime
             }
         }
         private string _DeviceName;
+        public List<string> DeviceList { get; set; } = new List<string> { "亚威一号折弯机", "亚威二号折弯机", "亚威三号折弯机", "激光机", "高机铜排冲剪机", "百超折弯机",
+            "倍福数冲机", "金方圆铜排冲剪机", "西门子840D数冲", "亚威PBC折弯机" };
 
 
-   
 
 
         /// <summary>

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

@@ -329,7 +329,7 @@ namespace SCADA_DAQ.Customer
                     var pbcYaWweiTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("亚威PBC折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("亚威PBC折弯机", "维修时间")));
                     var baiChaoTimeMaintenanceTable = Convert.ToString(DevicMainTableTime("百超折弯机") + TimeSpan.FromSeconds(DeviceTimeValue("百超折弯机", "维修时间")));
 
-                    var firstYaWeiStopTime = totalTimeOfDay - firstYaWeiRunTime - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
+                    var firstYaWeiStopTime = totalTimeOfDay  - firstYaWeiMoldTime - DevicScheduleStop("1号YaWei折弯机")
                         - DevicMainTableTime("亚威一号折弯机").TotalSeconds - DeviceTimeValue("1号YaWei折弯机", "维修时间");//1号YaWei折弯机等待时间
                     var sencondYaWeiStopTime = totalTimeOfDay - sencondYaWeiRunTime - sencondYaWeiMoldTime - DevicScheduleStop("2号YaWei折弯机")
                         - DevicMainTableTime("亚威二号折弯机").TotalSeconds - DeviceTimeValue("2号YaWei折弯机", "维修时间");//2号YaWei折弯机等待时间

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

@@ -44,7 +44,7 @@ namespace SCADA_DAQ.Customer
                 "高机铜排冲剪机",
                 "金方圆铜排冲剪机",
             };
-
+      
             var PropertyList = new List<string>() {
                 "LaserMachine",
                 "SimensPunch",

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

@@ -118,14 +118,14 @@ namespace SCADA_DAQ.Customer
 
             PunchingMachineEquipmentKanbanOne.DeviceNameOne.Value = highmachineRunTimeSpan;
             PunchingMachineEquipmentKanbanOne.DeviceNameTwo.Value = highmachineStopTimeSpan;
-            PunchingMachineEquipmentKanbanOne.DeviceNameThree.Value = kimFangyuanArlamTimeSpanString;
+            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 = highmachineArlamTimeSpanString;
+            PunchingMachineEquipmentKanbanTwo.DeviceNameThree.Value = kimFangyuanArlamTimeSpanString;
             PunchingMachineEquipmentKanbanTwo.DeviceNameFour.Value = kimFangyuanMoldTimeSpan;
             //PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanTimeMaintenanceTableString;
             PunchingMachineEquipmentKanbanTwo.DeviceNameFive.Value = kimFangyuanRepairTime;

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

@@ -9,7 +9,7 @@
               d:DesignHeight="450" d:DesignWidth="800">
   
     <Grid >
-        <dashboard:DashboardCard Margin="2"/>
+        <dashboard:DashboardCard Margin="8.8"/>
         <Grid>
              <Grid.RowDefinitions>
                 <RowDefinition Height="Auto"/>

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