Commit dc294e32 LN

增加自动重新运动功能。

1 个父辈 0722175b
......@@ -69,6 +69,7 @@ namespace TSA_V.DeviceLibrary
{
//上一个节点返回原点
PUSICANControl.AbsMove(PreNodeId, TSAVBean.RotateNode_DefaultPosition);
Thread.Sleep(50);
}
PUSICANControl.AbsMove(moveNode.NodeId, position.RotatePosition);
......
......@@ -175,6 +175,8 @@ namespace TSA_V.DeviceLibrary
public int TemperatureMax { get; set; }
public int WhileMoveCount = 0;
public static bool GetWaitResult(List<WaitResultInfo> waitList, TimeSpan span,bool oneOkCanEnd, out string waitMsg)
{
waitMsg = "";
......@@ -199,8 +201,16 @@ namespace TSA_V.DeviceLibrary
if (wait.WaitType.Equals(WaitTypeEnum.NodeMove_1))
{
string msg = "";
wait.IsEnd = PUSICANControl.MoveIsEnd(wait.Node.NodeId, wait.TargetPosition,out msg);
wait.IsEnd = PUSICANControl.MoveIsEnd(wait.Node.NodeId, wait.TargetPosition,out msg,out bool canWhileMove);
waitMsg = waitMsg + msg;
if (span.TotalSeconds >= 5 && canWhileMove && wait.WhileMoveCount.Equals(0))
{
wait.WhileMoveCount++;
LogUtil.info(waitMsg + ". 自动重新运动一次"+wait.WhileMoveCount);
PUSICANControl.AbsMove(wait.Node.NodeId, wait.TargetPosition);
}
}
else if (wait.WaitType.Equals(WaitTypeEnum.NodeHome_2))
{
......
......@@ -287,6 +287,7 @@ namespace TSA_V.DeviceLibrary
{
//上一个节点返回原点
PUSICANControl.AbsMove(PreNodeId, TSAVBean.RotateNode_DefaultPosition);
Thread.Sleep(50);
}
PUSICANControl.AbsMove(moveNode.NodeId, position.RotatePosition);
waitList.Add(WaitResultInfo.WaitNode(moveNode, position.RotatePosition));
......
......@@ -926,12 +926,13 @@ namespace PUSICANLibrary
/// <summary>
/// 运动是否结束
/// </summary>
public static bool MoveIsEnd(uint nodeId, int targetPosition,out string waitMsg)
public static bool MoveIsEnd(uint nodeId, int targetPosition,out string waitMsg,out bool canWhileMove)
{
//判断忙碌状态=0 当前坐标=targetPosition
int currPosition = GetPosition(nodeId);
int cha = Math.Abs(targetPosition - currPosition);
waitMsg = "当前坐标[" + currPosition + "]";
canWhileMove = true;
if (cha < 10)
{
int value = 0;
......@@ -942,6 +943,7 @@ namespace PUSICANLibrary
waitMsg = waitMsg + "忙碌状态["+busyStr+"]";
if (busyStr.Equals("1"))
{
canWhileMove = false;
return false;
}
else
......
......@@ -269,7 +269,7 @@ namespace TSA_V
{
if (span.TotalMinutes > 1)
{
waitMsg = "等待【" + waitMsg + "】超时 已等待【" + span.TotalMinutes.ToString() + "】分钟,";
waitMsg = "等待【" + waitMsg + "】超时 已等待【" + Math.Round( span.TotalMinutes ,2)+ "】分钟,";
foreach (WaitResultInfo wait in list)
{
waitMsg = waitMsg + "\r\n" + wait.ToStr();
......
......@@ -268,7 +268,7 @@ namespace TSA_V
{
if (span.TotalMinutes > 1)
{
waitMsg = "等待【" + waitMsg + "】超时 已等待【" + span.TotalMinutes.ToString() + "】分钟,";
waitMsg = "等待【" + waitMsg + "】超时 已等待【" + Math.Round(span.TotalMinutes, 2) + "】分钟,";
foreach (WaitResultInfo wait in list)
{
waitMsg = waitMsg + "\r\n" + wait.ToStr();
......
......@@ -106,7 +106,7 @@ namespace TSA_V
private static void NoIdLog(string id, string defaultStr)
{
LogUtil.info("No id:[" + id + "], please add,use default string :" + defaultStr);
LogUtil.debug("No id:[" + id + "], please add,use default string :" + defaultStr);
if (!defaultMap.ContainsKey(id))
{
defaultMap.Add(id, defaultStr);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!