|
|
@@ -285,8 +285,10 @@ public class ExecuteTheRecipe { |
|
|
|
Write_PLC_Heating(formulation); |
|
|
|
break; |
|
|
|
case "主料": |
|
|
|
if (ConfigName.getInstance().versionSelectionEnum.contains("一拖")) { |
|
|
|
Write_PLC_MainIngredients(formulation); |
|
|
|
if (ConfigName.getInstance().versionSelectionEnum.contains("一拖四")) { |
|
|
|
Write_PLC_MainIngredients4(formulation); |
|
|
|
}else if (ConfigName.getInstance().versionSelectionEnum.contains("一拖二")) { |
|
|
|
Write_PLC_MainIngredients2(formulation); |
|
|
|
} else { |
|
|
|
Write_PLC_Ingredients(formulation); |
|
|
|
} |
|
|
@@ -898,11 +900,11 @@ public class ExecuteTheRecipe { |
|
|
|
//region 一拖四写PLC工序 |
|
|
|
|
|
|
|
/** |
|
|
|
* 写PLC主料 |
|
|
|
* 写PLC主料 一拖4 |
|
|
|
* |
|
|
|
* @param data |
|
|
|
*/ |
|
|
|
private static void Write_PLC_MainIngredients(HashMap<String, String> data) { |
|
|
|
private static void Write_PLC_MainIngredients4(HashMap<String, String> data) { |
|
|
|
try { |
|
|
|
//是否手动 |
|
|
|
boolean ishand = true; |
|
|
@@ -1039,6 +1041,144 @@ public class ExecuteTheRecipe { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 写PLC主料 一拖2 |
|
|
|
* |
|
|
|
* @param data |
|
|
|
*/ |
|
|
|
private static void Write_PLC_MainIngredients2(HashMap<String, String> data) { |
|
|
|
try { |
|
|
|
//是否手动 |
|
|
|
boolean ishand = true; |
|
|
|
ToastUtils.info("准备倒入主料!"); |
|
|
|
|
|
|
|
//region 判断是否手动 |
|
|
|
if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) { |
|
|
|
ishand = true; |
|
|
|
} else { |
|
|
|
for (HashMap.Entry<String, String> entry : data.entrySet()) { |
|
|
|
String key = entry.getKey(); |
|
|
|
String value = entry.getValue(); |
|
|
|
if (key.contains("投料动作")) { |
|
|
|
if (value.contains("手动投料")) { |
|
|
|
ishand = true; |
|
|
|
} else { |
|
|
|
ishand = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//endregion |
|
|
|
|
|
|
|
|
|
|
|
if (ishand) { |
|
|
|
String name = ""; |
|
|
|
String zl = ""; |
|
|
|
int val = 0; |
|
|
|
for (HashMap.Entry<String, String> entry : data.entrySet()) { |
|
|
|
String key = entry.getKey(); |
|
|
|
String value = entry.getValue(); |
|
|
|
if (key.contains("名称")) { |
|
|
|
name = value; |
|
|
|
} else if (key.contains("重量")) { |
|
|
|
zl = value; |
|
|
|
} |
|
|
|
} |
|
|
|
ToastUtils.info("工序:手动投料," + name + "," + zl); |
|
|
|
String title = "手动投料-温馨提示!"; |
|
|
|
String message = "客官请投入主料,[" + name + "]重量" + zl + "g,投入后点击[确定]继续流程!"; |
|
|
|
ExecuteTheRecipe.WritePLC("暂停开关", true, null); |
|
|
|
|
|
|
|
final boolean[] IsComplete = {false}; |
|
|
|
Activity activity = findActivity(context); |
|
|
|
if (activity != null) { |
|
|
|
activity.runOnUiThread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
try { |
|
|
|
|
|
|
|
new QMUIDialog.MessageDialogBuilder(context) |
|
|
|
.setCancelable(false) |
|
|
|
.setTitle(title) |
|
|
|
.setMessage(message) |
|
|
|
.addAction("确定", new QMUIDialogAction.ActionListener() { |
|
|
|
@Override |
|
|
|
public void onClick(QMUIDialog dialog, int index) { |
|
|
|
IsComplete[0] = true; |
|
|
|
dialog.dismiss(); |
|
|
|
} |
|
|
|
}) |
|
|
|
.create(com.qmuiteam.qmui.R.style.QMUI_Dialog).show(); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
while (!IsComplete[0]) { |
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
} |
|
|
|
ExecuteTheRecipe.WritePLC("暂停开关", false, null); |
|
|
|
ToastUtils.info("确定完成,继续制作!"); |
|
|
|
} else { |
|
|
|
//自动投料 |
|
|
|
String writeValue = "1号位"; |
|
|
|
if (ExecuteCurrentOperation != null) { |
|
|
|
ExecuteCurrentOperation.Run("主料" + "|" + writeValue); |
|
|
|
} |
|
|
|
|
|
|
|
WriteMainPLC("机器人放主料完成", false, null); |
|
|
|
WriteMainPLC("炒锅请求投主料", true, null); |
|
|
|
boolean isJre=false; |
|
|
|
Object K= ReadPLC("加热"); |
|
|
|
isJre=K==null?false:(boolean) K; |
|
|
|
if(isJre) {ExecuteTheRecipe.WritePLC("加热", false, null);}//提前关闭加热 |
|
|
|
|
|
|
|
final boolean[] IsComplete = {false}; |
|
|
|
long a = System.currentTimeMillis(); |
|
|
|
while (!IsComplete[0]) { |
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * (whileTime * 10)) { |
|
|
|
break; |
|
|
|
} else { |
|
|
|
Object sb = ReadMainPLC("机器人放主料完成");//ListeningValue.get(name); |
|
|
|
if (sb != null) { |
|
|
|
IsComplete[0] = (boolean) (sb); |
|
|
|
} |
|
|
|
} |
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
} |
|
|
|
WriteMainPLC("机器人放主料完成", false, null); |
|
|
|
if(isJre) {ExecuteTheRecipe.WritePLC("加热", true, null);}//再次释放加热 |
|
|
|
} |
|
|
|
Log.d("倒菜", "倒菜完成了"); |
|
|
|
|
|
|
|
if (IsMoveYiHaoWei()) { |
|
|
|
WriteMainPLC("炒锅投主料完成", true, null); |
|
|
|
} |
|
|
|
|
|
|
|
//判断是否有烹饪时间 |
|
|
|
int val = 0; |
|
|
|
for (HashMap.Entry<String, String> entry : data.entrySet()) { |
|
|
|
String key = entry.getKey(); |
|
|
|
String value = entry.getValue(); |
|
|
|
if (key.contains("(秒)")) { |
|
|
|
val = Integer.parseInt(value); |
|
|
|
} |
|
|
|
} |
|
|
|
if (val > 0) { |
|
|
|
Thread.sleep(val * 1000); |
|
|
|
} |
|
|
|
|
|
|
|
Log.d("烹饪时间", "烹饪时间完成了"); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception ex) { |
|
|
|
ToastUtils.error("异常信息:" + ex.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 写PLC投辅料 |
|
|
|
* |
|
|
@@ -1736,7 +1876,7 @@ public class ExecuteTheRecipe { |
|
|
|
{ |
|
|
|
if((boolean) IsJT)//异常情况 |
|
|
|
{ |
|
|
|
WritePLC("停止",true,null); |
|
|
|
//WritePLC("停止",true,null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|