KWD hace 7 meses
padre
commit
09d1b2e00c

+ 14 - 0
TeamAAS-VM/Core/Management.cs

@@ -233,6 +233,16 @@ namespace TeamAAS_VP.Core
             get { return _CTtime; }
             set { SetProperty(ref _CTtime, value); }
         }
+
+        private bool _TorqueStatus = false;
+
+        public bool TorqueStatus
+        {
+            get { return _TorqueStatus; }
+            set { _TorqueStatus = value; }
+        }
+
+
         #endregion
 
         #region 命令
@@ -1731,6 +1741,10 @@ namespace TeamAAS_VP.Core
                         }
                         if (state == 1 || state == 2)
                         {
+                            if (TorqueStatus)
+                            {
+                                
+                            }
                             SendTaskMessage(Lang.收到停止锁付信号, MessageLevel.Debug);
                             //位置编号
                             Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);

+ 2 - 7
TeamAAS-VM/Services/TorqueService.cs

@@ -113,8 +113,6 @@ namespace TeamAAS_VP.Services
 
             result.Add(await plc.WriteNodeAsync(addressConfig.Manu_ZAxis_Velocity.Address, speed));
 
-            float Z_Distance = -(PlcPoint.TorquePoints[0].Z_Position_Start - PlcPoint.TorquePoints[0].Z_Position_Stop);
-
             result.Add(await Robot.JumpAsync(point, 0));
 
             result.Add(await plc.WriteNodeAsync<bool>(addressConfig.ManuToHome.Address, true));
@@ -161,12 +159,11 @@ namespace TeamAAS_VP.Services
                 Y = PlcPoint.TorquePoints[2].Y_Position,
                 Z = PlcPoint.TorquePoints[2].Z_Position_Start,
             };
-            //float Z_Distance = -(PlcPoint.TorquePoints[2].Z_Position_Start - PlcPoint.TorquePoints[2].Z_Position_Stop);
-
-            result.Add(await plc.WriteNodeAsync(addressConfig.Manu_ZAxis_Velocity.Address, (float)5.0));
 
             result.Add(await Robot.JumpAsync(point, 0));
 
+            result.Add(await plc.WriteNodeAsync(addressConfig.Manu_ZAxis_Velocity.Address, (float)5.0));
+
             result.Add(await plc.WriteNodeAsync(addressConfig.Check_ScrewTorque.Address, true));
 
             point.Z = PlcPoint.TorquePoints[2].Z_Position_Stop;
@@ -177,8 +174,6 @@ namespace TeamAAS_VP.Services
 
             result.Add(await plc.WriteNodeAsync(addressConfig.Manu_ZAxis_Velocity.Address, (float)100.0));
 
-            result.Add(await BackZero_Async(Robot, point));
-
             return !result.Contains(false);
         }
 

+ 6 - 4
TeamAAS-VM/ViewModels/Home/TorqueCheckViewModel.cs

@@ -528,7 +528,7 @@ namespace TeamAAS_VP.ViewModels.Home
         {
             try
             {
-                await Task.Delay(100);
+                await Task.Delay(500);
                 TValue = management.SignalValue;
                 double tvalue = double.Parse(TValue.Split(' ')[0]);
                 double pvalue = Value;
@@ -580,13 +580,14 @@ namespace TeamAAS_VP.ViewModels.Home
 
             while (count++ < 20)
             {
-                await Task.Delay(100);
+                await Task.Delay(50);
                 oking = plc.ReadNode(addressConfig.Screw_OK.Address);
                 nging = plc.ReadNode(addressConfig.Screw_NG.Address);
 
                 if (oking != null && nging != null)
                 {
-                    bool okin = (bool)oking; bool ngin = (bool)nging;
+                    bool okin = (bool)oking;
+                    bool ngin = (bool)nging;
                     //电批OKNG
                     if (okin || ngin)
                     {
@@ -602,9 +603,10 @@ namespace TeamAAS_VP.ViewModels.Home
                         });
                         //await _systemDatabaseService.RecordLockResultAsync(lockResult);
                         await plc.WriteNodeAsync(addressConfig.In_WorkDone.Address, (Int16)0);
-
+                        //await Task.Delay(200);
                         Value = lockResult.LockTorque;
                         await plc.WriteNodeAsync(addressConfig.Check_ScrewTorque.Address, false);
+                        await _torqueService.BackZero_Async(Robot,Robot.GetRobotPos());
                         return true;
                     }
                 }