From 3322022068ab818912d6f5d9e5eb31f51cc639c2 Mon Sep 17 00:00:00 2001
From: patrick.xu <patrick.xu@broconcentric.com>
Date: 星期四, 24 二月 2022 09:12:30 +0800
Subject: [PATCH] 添加配置文件的DataShift2

---
 src/Bro.Device.GTSCard/GTSCardDriver.cs |   43 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/src/Bro.Device.GTSCard/GTSCardDriver.cs b/src/Bro.Device.GTSCard/GTSCardDriver.cs
index 25ec672..14b4c25 100644
--- a/src/Bro.Device.GTSCard/GTSCardDriver.cs
+++ b/src/Bro.Device.GTSCard/GTSCardDriver.cs
@@ -312,7 +312,6 @@
             }
         }
 
-
         public override bool AllAxisOn()
         {
             List<Task<bool>> taskList = new List<Task<bool>>(); ;
@@ -387,7 +386,7 @@
                 responseMessage.Result = resultList.All(u => u == true);
                 if (!responseMessage.Result)
                 {
-                    responseMessage.Message = $"鐐逛綅杩愬姩寮傚父";
+                    responseMessage.Message = $"鐐逛綅杩愬姩寮傚父,杩愬姩缁撴灉锛歿string.Join(" ", resultList.Select(u => u ? "1" : "0"))}";
                 }
             }
             return responseMessage;
@@ -770,7 +769,14 @@
                     repeatTime--;
                 }
 
-                return (ret == (short)GTSRetCode.GRCRunOK) && isStop;
+                if (repeatTime <= 0)
+                {
+                    LogAsync(DateTime.Now, "杞�" + optionPara.AxisIndex + "APS_absolute_move鏈仠姝�", "");
+                    return false;
+                }
+
+                //return (ret == (short)GTSRetCode.GRCRunOK) && isStop;
+                return true;
             }
             catch (Exception ex)
             {
@@ -992,18 +998,26 @@
                             capture = 0;
 
                             //姝i檺浣�
-                            if ((axisStatus.AxisStatus & 0x20) != 0 && !goHomePara.IsCaptureDirPositive)
+                            if ((axisStatus.AxisStatus & 0x20) != 0)
                             {
-                                isRightLimitReached = true;
+                                homeDirection = false;
+
+                                if (!goHomePara.IsCaptureDirPositive)
+                                {
+                                    isRightLimitReached = true;
+                                }
                             }
 
                             //璐熼檺浣�
-                            if ((axisStatus.AxisStatus & 0x40) != 0 && goHomePara.IsCaptureDirPositive)
+                            if ((axisStatus.AxisStatus & 0x40) != 0)
                             {
-                                isRightLimitReached = true;
-                            }
+                                homeDirection = true;
 
-                            homeDirection = !homeDirection;
+                                if (goHomePara.IsCaptureDirPositive)
+                                {
+                                    isRightLimitReached = true;
+                                }
+                            }
 
                             LogAsync(DateTime.Now, $"杞磠movingOption.AxisIndex}鏋侀檺浣嶇疆鎹㈠悜", "");
                         }
@@ -1055,6 +1069,10 @@
                 AllMoveStop(true);
                 OnExceptionOccured?.Invoke(DateTime.Now, ex);
                 return false;
+            }
+            finally
+            { 
+            
             }
         }
 
@@ -1235,7 +1253,9 @@
                             }
                         });
 
-                        _positionWait.SpinOnce();
+                        Task.Delay(100).Wait();
+
+                        //_positionWait.SpinOnce();
                     }
                     catch (Exception ex)
                     {
@@ -1272,7 +1292,8 @@
                             }
                         });
 
-                        _statusWait.SpinOnce();
+                        Thread.Sleep(10);
+                        //Task.Delay(10).Wait();
                     }
                     catch (Exception ex)
                     {

--
Gitblit v1.8.0