Commit 7793f08d 张东亮

翻板运动过程中停止继续运行翻转过头问题

1 个父辈 3f460bbe
...@@ -11,7 +11,7 @@ namespace DeviceLibrary ...@@ -11,7 +11,7 @@ namespace DeviceLibrary
{ {
public class LiftMonitor : ISafetyDevice public class LiftMonitor : ISafetyDevice
{ {
string doorClose = IO_Type.StringDoor_Close; string doorClose = IO_Type.NGDoor_Close;
/// <summary> /// <summary>
/// 关闭端延时 /// 关闭端延时
/// </summary> /// </summary>
...@@ -71,6 +71,12 @@ namespace DeviceLibrary ...@@ -71,6 +71,12 @@ namespace DeviceLibrary
moveInfo.log($"急停未解除"); moveInfo.log($"急停未解除");
return; return;
} }
double speed = (double)upspeed;
if(paused)
{
speed = speed / 3.0;
moveInfo.log($"上一次有暂停,速度降为{speed}");
}
paused = false; paused = false;
if (IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH))
{ {
...@@ -84,7 +90,7 @@ namespace DeviceLibrary ...@@ -84,7 +90,7 @@ namespace DeviceLibrary
IOManager.IOMove(axisbreak, IO_VALUE.HIGH); IOManager.IOMove(axisbreak, IO_VALUE.HIGH);
Thread.Sleep(200); Thread.Sleep(200);
} }
axisBean.RelMove(StrokeLength, (double)upspeed); axisBean.RelMove(StrokeLength, speed);
DateTime d = DateTime.Now; DateTime d = DateTime.Now;
moveInfo.log($"{axisBean.AxisName},LiftUp"); moveInfo.log($"{axisBean.AxisName},LiftUp");
var wr = WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitUp), $"等待顶升[{axisBean.Config.Explain}]机构上升"); var wr = WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitUp), $"等待顶升[{axisBean.Config.Explain}]机构上升");
...@@ -162,6 +168,12 @@ namespace DeviceLibrary ...@@ -162,6 +168,12 @@ namespace DeviceLibrary
moveInfo.log($"急停未解除"); moveInfo.log($"急停未解除");
return; return;
} }
double speed = (double)downspeed;
if (paused)
{
speed = speed / 3.0;
moveInfo.log($"上一次有暂停,速度降为{speed}");
}
paused = false; paused = false;
if (IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
{ {
...@@ -175,7 +187,7 @@ namespace DeviceLibrary ...@@ -175,7 +187,7 @@ namespace DeviceLibrary
IOManager.IOMove(axisbreak, IO_VALUE.HIGH); IOManager.IOMove(axisbreak, IO_VALUE.HIGH);
Thread.Sleep(200); Thread.Sleep(200);
} }
axisBean.RelMove(-StrokeLength, (double)downspeed); axisBean.RelMove(-StrokeLength, speed);
DateTime d = DateTime.Now; DateTime d = DateTime.Now;
moveInfo.log($"{axisBean.AxisName},LiftDown"); moveInfo.log($"{axisBean.AxisName},LiftDown");
var wr = WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitDown), $"等待顶升[{axisBean.Config.Explain}]机构下降"); var wr = WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitDown), $"等待顶升[{axisBean.Config.Explain}]机构下降");
......
...@@ -25,6 +25,13 @@ namespace DeviceLibrary ...@@ -25,6 +25,13 @@ namespace DeviceLibrary
CheckAndRunServer(); CheckAndRunServer();
string json = HttpHelper.Get(url); string json = HttpHelper.Get(url);
Result result = JsonHelper.DeserializeJsonToObject<Result>(json); Result result = JsonHelper.DeserializeJsonToObject<Result>(json);
if (result == null)
{
LogUtil.info($"reelStatusCheck 无反馈,重试");
Thread.Sleep(1000);
json = HttpHelper.Get(url);
result = JsonHelper.DeserializeJsonToObject<Result>(json);
}
if (result != null && result.code == 0) if (result != null && result.code == 0)
{ {
LogUtil.info($"{configName} 料盘放置正常"); LogUtil.info($"{configName} 料盘放置正常");
...@@ -42,9 +49,9 @@ namespace DeviceLibrary ...@@ -42,9 +49,9 @@ namespace DeviceLibrary
} }
return false; return false;
} }
static Process EyemFeatureSet = new Process(); static Process EyemFeatureSet = new Process();
static int webclienttimeout = 30000; static int webclienttimeout = 30000;
public static void CheckAndRunServer() public static void CheckAndRunServer()
{ {
lock (EyemFeatureSet) lock (EyemFeatureSet)
{ {
...@@ -60,14 +67,14 @@ namespace DeviceLibrary ...@@ -60,14 +67,14 @@ namespace DeviceLibrary
throw new Exception("找不到算法服务器文件"); throw new Exception("找不到算法服务器文件");
} }
EyemFeatureSet= ProcessUtil.StartProcess("EyemFeatureSet", Application.StartupPath+"\\Modules\\EyemFeatureSet\\"); EyemFeatureSet = ProcessUtil.StartProcess("EyemFeatureSet", Application.StartupPath + "\\Modules\\EyemFeatureSet\\");
int num = 5; int num = 5;
while (num > 0) while (num > 0)
{ {
num--; num--;
Thread.Sleep(1000); Thread.Sleep(1000);
MyWebClient myWebClient = new MyWebClient(webclienttimeout); MyWebClient myWebClient = new MyWebClient(webclienttimeout);
string text2 = myWebClient.DownloadString(visionUrl+"/alive"); string text2 = myWebClient.DownloadString(visionUrl + "/alive");
if (text2.Trim() == "\"1\"") if (text2.Trim() == "\"1\"")
{ {
return; return;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!