Commit 37feaee7 几米阳光

等待条件添加结果记录

1 个父辈 98df55ac
...@@ -115,32 +115,42 @@ namespace OnlineStore.DeviceLibrary ...@@ -115,32 +115,42 @@ namespace OnlineStore.DeviceLibrary
string msg = ""; string msg = "";
if (wait.IsHomeMove) if (wait.IsHomeMove)
{ {
if ((!ACHomeMoveIsEnd(wait.AxisInfo,out msg))) if (wait.IsEnd.Equals(false) && (!ACHomeMoveIsEnd(wait.AxisInfo, out msg)))
{ {
if (!msg.Equals("")) if (!msg.Equals(""))
{ {
WarnMsg = msg; WarnMsg = msg;
Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
} }
isOk = false; isOk = false;
break; break;
} }
else
{
wait.IsEnd = true;
}
} }
else else
{ {
if (!wait.IsEnd)
bool isEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
if (!msg.Equals(""))
{ {
isOk = false; bool isEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
WarnMsg = msg; if (!msg.Equals(""))
Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType); {
break; isOk = false;
} WarnMsg = msg;
else if (!isEnd) Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
{ break;
isOk = false; }
break; else if (!isEnd)
{
isOk = false;
break;
}
else
{
wait.IsEnd = true;
}
} }
} }
} }
......
...@@ -149,6 +149,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,6 +149,7 @@ namespace OnlineStore.DeviceLibrary
wait.WaitType = 2; wait.WaitType = 2;
wait.IoType = ioType; wait.IoType = ioType;
wait.IoValue = ioValue; wait.IoValue = ioValue;
wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitAxis(ConfigMoveAxis axis,int targetPosition,int targetSpeed ) public static WaitResultInfo WaitAxis(ConfigMoveAxis axis,int targetPosition,int targetSpeed )
...@@ -160,6 +161,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -160,6 +161,7 @@ namespace OnlineStore.DeviceLibrary
wait.IsHomeMove = false; wait.IsHomeMove = false;
wait.TargetPosition = targetPosition; wait.TargetPosition = targetPosition;
wait.TargetSpeed = targetSpeed; wait.TargetSpeed = targetSpeed;
wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitAxis(ConfigMoveAxis axis, bool isHomeMove) public static WaitResultInfo WaitAxis(ConfigMoveAxis axis, bool isHomeMove)
...@@ -169,6 +171,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -169,6 +171,7 @@ namespace OnlineStore.DeviceLibrary
wait.WaitType = 1; wait.WaitType = 1;
wait.AxisInfo = axis; wait.AxisInfo = axis;
wait.IsHomeMove = true; wait.IsHomeMove = true;
wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitStell(byte slvAddr, int targetPosition, int speed) public static WaitResultInfo WaitStell(byte slvAddr, int targetPosition, int speed)
...@@ -180,6 +183,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -180,6 +183,7 @@ namespace OnlineStore.DeviceLibrary
wait.IsHomeMove = false; wait.IsHomeMove = false;
wait.TargetPosition = targetPosition; wait.TargetPosition = targetPosition;
wait.TargetSpeed = speed; wait.TargetSpeed = speed;
wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitStellHome(byte slvAddr, int targetPosition, int speed) public static WaitResultInfo WaitStellHome(byte slvAddr, int targetPosition, int speed)
...@@ -191,6 +195,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -191,6 +195,7 @@ namespace OnlineStore.DeviceLibrary
wait.IsHomeMove = true; wait.IsHomeMove = true;
wait.TargetPosition = 0; wait.TargetPosition = 0;
wait.TargetSpeed = speed; wait.TargetSpeed = speed;
wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome) public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome)
...@@ -209,6 +214,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -209,6 +214,7 @@ namespace OnlineStore.DeviceLibrary
wait.CanWhileMoveCount = 0; wait.CanWhileMoveCount = 0;
wait.WaitType = 3; wait.WaitType = 3;
wait.TimeMSeconds = MScends; wait.TimeMSeconds = MScends;
wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitAxisOrg(ConfigMoveAxis axis,IO_VALUE value ) public static WaitResultInfo WaitAxisOrg(ConfigMoveAxis axis,IO_VALUE value )
...@@ -219,6 +225,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -219,6 +225,7 @@ namespace OnlineStore.DeviceLibrary
wait.AxisInfo = axis; wait.AxisInfo = axis;
wait.IsHomeMove = true; wait.IsHomeMove = true;
wait.IoValue = value; wait.IoValue = value;
wait.IsEnd = false;
return wait; return wait;
} }
public string ToStr() public string ToStr()
...@@ -299,7 +306,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -299,7 +306,10 @@ namespace OnlineStore.DeviceLibrary
/// 轴目标速度 /// 轴目标速度
/// </summary> /// </summary>
public int TargetSpeed { get; set; } public int TargetSpeed { get; set; }
/// <summary>
/// 是否已经结束
/// </summary>
public bool IsEnd{ get; set; }
} }
public enum StoreMoveType public enum StoreMoveType
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!