|
|
@@ -149,6 +149,14 @@ public class ExecuteTheRecipe { |
|
|
|
ExecuteTheRecipe.showlog("客官,小菠萝正在强制结束当前炒制菜品,请耐心等候!!!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if(!ConfigName.getInstance().PlcIsConnect) |
|
|
|
{ |
|
|
|
ExecuteTheRecipe.showlog("客官,检测到硬件已经断开连接,主动停止炒制!!!"); |
|
|
|
IsForcedEnd=true; |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
ExecuteTheRecipe.showlog("开始执行:" + recipe.sort + "、" + recipe.processms); |
|
|
|
|
|
|
|
if (recipe.materialType == 0)//正常物料 |
|
|
@@ -1955,7 +1963,7 @@ public class ExecuteTheRecipe { |
|
|
|
ExecuteTheRecipe.showlog("工序线程等待-------时长:" + delay + "秒,请耐心等待,开始计时!"); |
|
|
|
|
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
while ((System.currentTimeMillis() - startTime) <= (delay * 1000) && !IsForcedEnd) // |
|
|
|
while ((System.currentTimeMillis() - startTime) <= (delay * 1000) && !IsForcedEnd && ConfigName.getInstance().PlcIsConnect) |
|
|
|
{ |
|
|
|
try { |
|
|
|
Thread.sleep(100); |
|
|
@@ -1978,15 +1986,18 @@ public class ExecuteTheRecipe { |
|
|
|
final boolean[] IsComplete = {false}; |
|
|
|
long a = System.currentTimeMillis(); |
|
|
|
ExecuteTheRecipe.showlog(name + ",等待中"); |
|
|
|
while (!IsComplete[0] && !IsForcedEnd) { |
|
|
|
while (!IsComplete[0] && !IsForcedEnd && ConfigName.getInstance().PlcIsConnect) { |
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * whileTime) { |
|
|
|
ExecuteTheRecipe.showlog(name + ",异常超时退出!"); |
|
|
|
break; |
|
|
|
} else { |
|
|
|
Object sb = ReadPLC(name);//ListeningValue.get(name); |
|
|
|
Object sb = ReadPLC(name); |
|
|
|
if (sb != null) { |
|
|
|
IsComplete[0] = (boolean) (sb); |
|
|
|
ExecuteTheRecipe.showlog(name + ",接收到信号!"); |
|
|
|
if(IsComplete[0]) |
|
|
|
{ |
|
|
|
ExecuteTheRecipe.showlog(name + ",接收到信号!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
@@ -2009,7 +2020,7 @@ public class ExecuteTheRecipe { |
|
|
|
final boolean[] IsComplete = {false}; |
|
|
|
long a = System.currentTimeMillis(); |
|
|
|
ExecuteTheRecipe.showlog(name + ",等待中"); |
|
|
|
while (!IsComplete[0] && !IsForcedEnd) { |
|
|
|
while (!IsComplete[0] && !IsForcedEnd && ConfigName.getInstance().PlcIsConnect) { |
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * whileTime * k) { |
|
|
|
ExecuteTheRecipe.showlog(name + ",异常超时退出!"); |
|
|
|
break; |
|
|
@@ -2017,7 +2028,10 @@ public class ExecuteTheRecipe { |
|
|
|
Object sb = ReadPLC(name);//ListeningValue.get(name); |
|
|
|
if (sb != null) { |
|
|
|
IsComplete[0] = (boolean) (sb); |
|
|
|
ExecuteTheRecipe.showlog(name + ",接收到信号!"); |
|
|
|
if(IsComplete[0]) |
|
|
|
{ |
|
|
|
ExecuteTheRecipe.showlog(name + ",接收到信号!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|