|
|
@@ -301,6 +301,9 @@ public class ExecuteTheRecipe { |
|
|
|
} |
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
} |
|
|
|
|
|
|
|
ToastUtils.info("炒锅到达"+value+",继续制作!!!"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception ex) { |
|
|
@@ -388,9 +391,9 @@ public class ExecuteTheRecipe { |
|
|
|
}else |
|
|
|
{ |
|
|
|
//自动投料 |
|
|
|
if(ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本")) |
|
|
|
if(ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本") || ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) |
|
|
|
{ |
|
|
|
String writeValue = "1#位置"; |
|
|
|
String writeValue = "1号位"; |
|
|
|
for (HashMap.Entry<String, String> entry : data.entrySet()) { |
|
|
|
String key = entry.getKey(); |
|
|
|
String value = entry.getValue(); |
|
|
@@ -398,49 +401,44 @@ public class ExecuteTheRecipe { |
|
|
|
writeValue=value; |
|
|
|
} |
|
|
|
} |
|
|
|
WritePLC(writeValue, true, new IWriteCallBack() { |
|
|
|
@Override |
|
|
|
public void onSuccess() { |
|
|
|
WritePLC("主料", true, new IWriteCallBack() { |
|
|
|
@Override |
|
|
|
public void onSuccess() { |
|
|
|
ToastUtils.info("主料倒入完成,继续制作!"); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) { |
|
|
|
String writeValue = "1#位置"; |
|
|
|
for (HashMap.Entry<String, String> entry : data.entrySet()) { |
|
|
|
String key = entry.getKey(); |
|
|
|
String value = entry.getValue(); |
|
|
|
if (key.contains("主料位置")) { |
|
|
|
writeValue=value; |
|
|
|
|
|
|
|
//1.去某一个位置 |
|
|
|
WritePLC("平移-去"+writeValue,true,null); |
|
|
|
|
|
|
|
//一直等待机器移动到该位置,否则就一直等待 6s超时 |
|
|
|
String name = "平移轴在"+writeValue; |
|
|
|
final boolean[] IsComplete = {false}; |
|
|
|
long a = System.currentTimeMillis(); |
|
|
|
while (!IsComplete[0]) { |
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * whileTime) { |
|
|
|
break; |
|
|
|
} else { |
|
|
|
Object sb = ListeningValue.get(name); |
|
|
|
if (sb != null) { |
|
|
|
IsComplete[0] = (boolean) (sb); |
|
|
|
} |
|
|
|
} |
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
} |
|
|
|
WritePLC(writeValue, true, new IWriteCallBack() { |
|
|
|
@Override |
|
|
|
public void onSuccess() { |
|
|
|
WritePLC("主料", true, new IWriteCallBack() { |
|
|
|
@Override |
|
|
|
public void onSuccess() { |
|
|
|
ToastUtils.info("主料倒入完成,继续制作!"); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
|
|
|
|
//2.给倒菜启动 |
|
|
|
WritePLC("主料", true, null); |
|
|
|
name = "倒菜完成"; |
|
|
|
IsComplete[0]=false; |
|
|
|
a = System.currentTimeMillis(); |
|
|
|
while (!IsComplete[0]) { |
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * whileTime) { |
|
|
|
break; |
|
|
|
} else { |
|
|
|
Object sb = ListeningValue.get(name); |
|
|
|
if (sb != null) { |
|
|
|
IsComplete[0] = (boolean) (sb); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
} |
|
|
|
// |
|
|
|
ToastUtils.info("主料倒入完成,继续制作!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception ex) { |
|
|
@@ -533,6 +531,23 @@ public class ExecuteTheRecipe { |
|
|
|
} |
|
|
|
} |
|
|
|
WritePLC("出菜", true, null); |
|
|
|
|
|
|
|
//一直等待机器移动到该位置,否则就一直等待 6s超时 |
|
|
|
String name = "出餐启动反馈"; |
|
|
|
final boolean[] IsComplete = {false}; |
|
|
|
long a = System.currentTimeMillis(); |
|
|
|
while (!IsComplete[0]) { |
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * whileTime) { |
|
|
|
break; |
|
|
|
} else { |
|
|
|
Object sb = ListeningValue.get(name); |
|
|
|
if (sb != null) { |
|
|
|
IsComplete[0] = (boolean) (sb); |
|
|
|
} |
|
|
|
} |
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
} |
|
|
|
ToastUtils.info("出菜完成,结束制作!"); |
|
|
|
} catch (Exception ex) { |
|
|
|
ToastUtils.error("异常信息:" + ex.getMessage()); |
|
|
|
} |
|
|
@@ -799,7 +814,6 @@ public class ExecuteTheRecipe { |
|
|
|
//endregion |
|
|
|
|
|
|
|
//region 获取基础挡位变量 |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取挡位变量 |
|
|
|
* |
|
|
|