Browse Source

4333

燃气自翻炒锅
fyf 1 year ago
parent
commit
6c8ab5929c
2 changed files with 97 additions and 123 deletions
  1. +95
    -121
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +2
    -2
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java

+ 95
- 121
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -150,7 +150,15 @@ public class ExecuteTheRecipe {
BPA_GOODSRECIPE data2 = Get位置("高速", "抽料位");
ExecuteOperationSteps(data2.processname, data2.processvalue);
} else if (recipe.processname.equals("主料")) {
BPA_GOODSRECIPE data3 = Get位置("高速", "炒菜位1");
if (ConfigName.getInstance().versionSelectionEnum.contains("一拖")) {
BPA_GOODSRECIPE data3 = Get位置("高速", "原点位");
ExecuteOperationSteps(data3.processname, data3.processvalue);
} else {
BPA_GOODSRECIPE data3 = Get位置("高速", "炒菜位1");
ExecuteOperationSteps(data3.processname, data3.processvalue);
}
} else if (recipe.processname.equals("辅料")) {
BPA_GOODSRECIPE data3 = Get位置("高速", "原点位");
ExecuteOperationSteps(data3.processname, data3.processvalue);
}
ExecuteOperationSteps(recipe.processname, recipe.processvalue);
@@ -287,7 +295,7 @@ public class ExecuteTheRecipe {
case "主料":
if (ConfigName.getInstance().versionSelectionEnum.contains("一拖四")) {
Write_PLC_MainIngredients4(formulation);
}else if (ConfigName.getInstance().versionSelectionEnum.contains("一拖二")) {
} else if (ConfigName.getInstance().versionSelectionEnum.contains("一拖二")) {
Write_PLC_MainIngredients2(formulation);
} else {
Write_PLC_Ingredients(formulation);
@@ -539,18 +547,13 @@ public class ExecuteTheRecipe {
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();
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) {

@@ -955,18 +958,13 @@ public class ExecuteTheRecipe {
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();
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) {

@@ -1097,18 +1095,13 @@ public class ExecuteTheRecipe {
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();
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) {

@@ -1129,12 +1122,14 @@ public class ExecuteTheRecipe {
ExecuteCurrentOperation.Run("主料" + "|" + writeValue);
}

WriteMainPLC("机器人放主料完成", false, null);
WriteMainPLC("机器人放主料完成", false, null);
WriteMainPLC("炒锅请求投主料", true, null);
boolean isJre=false;
Object K= ReadPLC("加热");
isJre=K==null?false:(boolean) K;
if(isJre) {ExecuteTheRecipe.WritePLC("加热", false, 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();
@@ -1142,15 +1137,17 @@ public class ExecuteTheRecipe {
if ((System.currentTimeMillis() - a) > 1000 * (whileTime * 10)) {
break;
} else {
Object sb = ReadMainPLC("机器人放主料完成");//ListeningValue.get(name);
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);}//再次释放加热
WriteMainPLC("机器人投放主料完成", false, null);
if (isJre) {
ExecuteTheRecipe.WritePLC("加热", true, null);
}//再次释放加热
}
Log.d("倒菜", "倒菜完成了");

@@ -1202,10 +1199,12 @@ public class ExecuteTheRecipe {
WriteMainPLC("炒锅请求投辅料", true, null);


boolean isJre=false;
Object K= ReadPLC("加热");
isJre=K==null?false:(boolean) K;
if(isJre) {ExecuteTheRecipe.WritePLC("加热", false, 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();
@@ -1221,7 +1220,9 @@ public class ExecuteTheRecipe {
Thread.sleep(100);//10 *6
}
WriteMainPLC("机器人放辅料完成", false, null);
if(isJre) {ExecuteTheRecipe.WritePLC("加热", true, null);}//再次释放加热
if (isJre) {
ExecuteTheRecipe.WritePLC("加热", true, null);
}//再次释放加热

if (val > 0) {
Thread.sleep(val * 1000);
@@ -1507,12 +1508,11 @@ public class ExecuteTheRecipe {
WriteMainPLC("心跳", false, null);
WriteMainPLC("炒锅空闲状态", ConfigName.getInstance().WokStatus, null);
WriteMainPLC("投料机构状态", ConfigName.getInstance().TouLiaoStatus, null);
Log.e("炒锅状态", "炒锅状态: "+ ConfigName.getInstance().WokStatus);
Log.e("投料机构状态", "投料机构状态: "+ ConfigName.getInstance().TouLiaoStatus);
Log.e("炒锅状态", "炒锅状态: " + ConfigName.getInstance().WokStatus);
Log.e("投料机构状态", "投料机构状态: " + ConfigName.getInstance().TouLiaoStatus);
//读取主控下发的商品
ReadMasterDeliveryGoods();
}

} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
}
@@ -1794,75 +1794,50 @@ public class ExecuteTheRecipe {
if (goods == null) {
WriteMainPLC("商品数据验证", false, null);
} else {
// Object chushiover = ExecuteTheRecipe.getListingValue("初始化完成");
// if (!ConfigName.getInstance().PlcIsConnect) {
// ToastUtils.warning("PLC未准备就绪!!!");
// WriteMainPLC("商品数据验证", false, null);
// }else if (chushiover == null || !(boolean) chushiover) {
// ToastUtils.warning("设备未初始化,请先手动初始化设备!!!");
// WriteMainPLC("商品数据验证", false, null);
// }else
if (ExecuteTheRecipe.IsStart) {
Object chushiover = ExecuteTheRecipe.getListingValue("初始化完成");
if (!ConfigName.getInstance().PlcIsConnect) {
ToastUtils.warning("PLC未准备就绪!!!");
WriteMainPLC("商品数据验证", false, null);
} else if (chushiover == null || !(boolean) chushiover) {
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!");
WriteMainPLC("商品数据验证", false, null);
} else if (ExecuteTheRecipe.IsStart) {
ToastUtils.warning("请耐心等待商品制作结束!!!");
WriteMainPLC("商品数据验证", false, null);
} else {
WriteMainPLC("机器人准备就绪", false, null);
WriteMainPLC("商品数据验证", true, null);
if (ConfigName.getInstance().user.name.equals("admin") || ConfigName.getInstance().user.account.equals("admin") || ConfigName.getInstance().user.userID.equals("超级管理员")) {
boolean IsLaoVis = ConfigName.getInstance().user.name.equals("admin") || ConfigName.getInstance().user.account.equals("admin") || ConfigName.getInstance().user.userID.equals("超级管理员");
if (IsLaoVis) {
DataBus.getInstance().mListener.clickListener(null, goods);
boolean issucess=false;
try {
WriteMainPLC("机器人放主料完成", false, null);
final boolean[] IsComplete = {false};
long a = System.currentTimeMillis();
while (!IsComplete[0]) {
if ((System.currentTimeMillis() - a) > 1000 * (whileTime * 5)) {
break;
} else {
WriteMainPLC("投料机构状态", ConfigName.getInstance().TouLiaoStatus, null);
Object sb = ReadMainPLC("机器人放主料完成");
if (sb != null) {
IsComplete[0] = (boolean) (sb);
issucess=(boolean) (sb);
}
}
Thread.sleep(100);//10 *6
}
} catch (Exception e) {

}

if(issucess)
{
MessageManager.getInstance().sendMessage(MessageName.IsStratMakeGood1, goods.id);
}
} else {
MessageManager.getInstance().sendMessage(MessageName.OpenMakeGoodFrom, goods.id);
boolean issucess=false;
try {
final boolean[] IsComplete = {false};
long a = System.currentTimeMillis();
while (!IsComplete[0]) {
if ((System.currentTimeMillis() - a) > 1000 * (whileTime * 3)) {
break;
} else {
Object sb = ReadMainPLC("机器人放主料完成");
if (sb != null) {
IsComplete[0] = (boolean) (sb);
issucess= (boolean) (sb);
}
}
boolean issucess = false;
try {
final boolean[] IsComplete = {false};
long a = System.currentTimeMillis();
while (!IsComplete[0]) {
if ((System.currentTimeMillis() - a) > 1000 * (whileTime * 5)) {
break;
} else {
WriteMainPLC("投料机构状态", ConfigName.getInstance().TouLiaoStatus, null);
Object sb = ReadMainPLC("机器人准备就绪");
if (sb != null) {
IsComplete[0] = (boolean) (sb);
issucess = (boolean) (sb);
}
Thread.sleep(100);//10 *6
}

WriteMainPLC("机器人放主料完成", false, null);

} catch (Exception e) {

Thread.sleep(100);//10 *6
}
if(issucess)
{
WriteMainPLC("机器人准备就绪", false, null);
} catch (Exception e) {
}

if (issucess) {
if (IsLaoVis) {
MessageManager.getInstance().sendMessage(MessageName.IsStratMakeGood1, goods.id);
} else {
MessageManager.getInstance().sendMessage(MessageName.IsStratMakeGood, goods.id);
}
}
@@ -1871,14 +1846,13 @@ public class ExecuteTheRecipe {
}
}

Object IsJT = ReadMainPLC("机器人急停");
if (IsJT!=null)
{
if((boolean) IsJT)//异常情况
{
//WritePLC("停止",true,null);
}
}
// Object IsJT = ReadMainPLC("机器人急停");
// if (IsJT != null) {
// if ((boolean) IsJT)//异常情况
// {
// //WritePLC("停止",true,null);
// }
// }
}
//endregion



+ 2
- 2
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java View File

@@ -1132,12 +1132,12 @@ public class ConfigName {
put("炒锅请求投主料",10);


put("机器人放主料完成",51);
put("机器人准备就绪",51);//修改就绪信号
put("机器人放辅料完成",52);
put("机器人到达炒锅出餐位",53);
put("商品下发",54);
put("机器人急停",55);//true 异常 false 正常
put("机器人放主料完成",56);
put("机器人放主料完成",56);

put("商品信息",0);
}};


Loading…
Cancel
Save