diff --git a/app/src/main/java/com/bonait/bnframework/business/ConfigData.java b/app/src/main/java/com/bonait/bnframework/business/ConfigData.java index 8da08bb5..ffca7ff8 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ConfigData.java +++ b/app/src/main/java/com/bonait/bnframework/business/ConfigData.java @@ -995,7 +995,7 @@ public class ConfigData { //PLC连接成功,启动数据监听 ExecuteTheRecipe.Listening(); - ExecuteTheRecipe.WritePLC("手自切换",true,null); + } //endregion } diff --git a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java index ab9ca5e7..9370f4b6 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java +++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java @@ -225,6 +225,24 @@ public class ExecuteTheRecipe { names.add("果糖右温度"); } + new Thread(new Runnable() { + @Override + public void run() { + //1.自动模式 + ExecuteTheRecipe.WritePLC("手自切换",true,null); + //1.清除开关 + for (int i=1;i<=20;i++) + { + ExecuteTheRecipe.WritePLC("通道"+i+"校准开关",false,null); + } + + for (int i=1;i<=20;i++) + { + ExecuteTheRecipe.WritePLC("手动控制"+i,false,null); + } + } + }); + ThreadManager.Get().StartLong("PLC设备数据监听", true, new IThread() { @Override public void Run() throws InterruptedException { diff --git a/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java b/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java index 1ed9d6b1..02a9a594 100644 --- a/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java +++ b/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java @@ -65,6 +65,21 @@ public class AlertDialogUtils { .create(mCurrentDialogStyle).show(); } + public static QMUIDialog showDialog111(Context context, String title, String message, QMUIDialogAction.ActionListener onClickListener) { + return new QMUIDialog.MessageDialogBuilder(context) + .setCancelable(false) + .setTitle(title) + .setMessage(message) + .addAction("取消", new QMUIDialogAction.ActionListener() { + @Override + public void onClick(QMUIDialog dialog, int index) { + dialog.dismiss(); + } + }) + .addAction("确定", onClickListener) + .create(mCurrentDialogStyle); + } + /** * 对话框,自定义确定按钮 * */ diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java index 1705f69c..5df9dc9f 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java @@ -39,11 +39,13 @@ import com.bonait.bnframework.common.db.mode.BPA_SUBORDER; import com.bonait.bnframework.common.db.res.ResGoodProperty; import com.bonait.bnframework.common.db.res.ResGoodsMake; import com.bonait.bnframework.common.db.res.SilosLsjyMode; +import com.bonait.bnframework.common.db.res.UserLogEnum; import com.bonait.bnframework.common.helper.I.IRun; import com.bonait.bnframework.common.helper.I.IRunT; import com.bonait.bnframework.common.helper.I.IThread; import com.bonait.bnframework.common.helper.I.IWriteCallBack; import com.bonait.bnframework.common.helper.I.MyClickListener; +import com.bonait.bnframework.common.helper.MessageLog; import com.bonait.bnframework.common.helper.ThreadManager; import com.bonait.bnframework.common.linktab.LinkMode; import com.bonait.bnframework.common.linktab.TopItemDecoration; @@ -243,74 +245,55 @@ public class MakeGoodFragment extends BaseFragment { @Override public void clickListener(View v, Object data) { ResGoodsMake makegood = (ResGoodsMake) data; - if (!ConfigName.getInstance().PlcIsConnect) { - ToastUtils.warning("设备已离线,请检查设备..."); - return; - } - - if (DataBus.getInstance().ZDQX_IsStart) { - ToastUtils.warning("自动清洗中,请等待清洗完成!"); - return; - } - - if (ExecuteTheRecipe.IsMakeGood) { - ToastUtils.warning("请耐心等待上一商品制作完成..."); - return; - } - - if (makegood.subOrder.status == 1) { - ToastUtils.warning("商品:" + makegood.good.name + ",已在制作中..."); - return; - } - - if (makegood.subOrder.status == 2) { - ToastUtils.warning("商品:" + makegood.good.name + ",已制作完成..."); - return; - } - - if (ConfigName.getInstance().versionSelectionEnum.equals("奶茶机")) { - if (!ExecuteTheRecipe.IsCup) { - ToastUtils.warning("出料口没有检测到器皿!"); - return; - } - } - +// if (!ConfigName.getInstance().PlcIsConnect) { +// ToastUtils.warning("设备已离线,请检查设备..."); +// return; +// } +// +// if (DataBus.getInstance().ZDQX_IsStart) { +// ToastUtils.warning("自动清洗中,请等待清洗完成!"); +// return; +// } +// +// if (ExecuteTheRecipe.IsMakeGood) { +// ToastUtils.warning("请耐心等待上一商品制作完成..."); +// return; +// } +// +// if (makegood.subOrder.status == 1) { +// ToastUtils.warning("商品:" + makegood.good.name + ",已在制作中..."); +// return; +// } +// +// if (makegood.subOrder.status == 2) { +// ToastUtils.warning("商品:" + makegood.good.name + ",已制作完成..."); +// return; +// } +// +// if (ConfigName.getInstance().versionSelectionEnum.equals("奶茶机")) { +// if (!ExecuteTheRecipe.IsCup) { +// ToastUtils.warning("出料口没有检测到器皿!"); +// return; +// } +// } String title = "温馨提示!"; String message = "客官确定要开始制作【" + makegood.good.name + "】吗?"; - AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { + QMUIDialog dialog= AlertDialogUtils.showDialog111(context, title, message, new QMUIDialogAction.ActionListener() { @Override public void onClick(QMUIDialog dialog, int index) { - - //判断温度是否到达 - if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) { - if (makegood.Gt1) { - if (ExecuteTheRecipe.SugarTempLeft < ExecuteTheRecipe.SugarTempLeft_SZ) { - ToastUtils.warning("果糖左仓温度未达到设置值,不允许出料..."); - return; - } - } - if (makegood.Gt2) { - if (ExecuteTheRecipe.SugarTempRight < ExecuteTheRecipe.SugarTempRight_SZ) { - ToastUtils.warning("果糖右仓温度未达到设置值,不允许出料..."); - return; - } - } - } - new Thread(new Runnable() { - @Override - public void run() { - //设置清洗模式 - ExecuteTheRecipe.WritePLC("清洗模式", false, null); - ExecuteTheRecipe.WritePLC("砝码校准模式", false, null); - ExecuteTheRecipe.WritePLC("手自切换", true, null); - } - }).start(); - ExecuteTheRecipe.Execute(makegood); - ToastUtils.warning("商品:" + makegood.good.name + ",开始制作"); + make(makegood); dialog.dismiss(); } }); + ExecuteTheRecipe.OnIngredientButtonPressedNotify = new IRun() { + @Override + public void Run() { + make(makegood); + dialog.dismiss(); + } + }; + dialog.show(); } @Override @@ -319,11 +302,42 @@ public class MakeGoodFragment extends BaseFragment { } }; + public void make(ResGoodsMake makegood) + { + //判断温度是否到达 + if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) { + if (makegood.Gt1) { + if (ExecuteTheRecipe.SugarTempLeft < ExecuteTheRecipe.SugarTempLeft_SZ) { + ToastUtils.warning("果糖左仓温度未达到设置值,不允许出料..."); + return; + } + } + if (makegood.Gt2) { + if (ExecuteTheRecipe.SugarTempRight < ExecuteTheRecipe.SugarTempRight_SZ) { + ToastUtils.warning("果糖右仓温度未达到设置值,不允许出料..."); + return; + } + } + } + new Thread(new Runnable() { + @Override + public void run() { + //设置清洗模式 + ExecuteTheRecipe.WritePLC("清洗模式", false, null); + ExecuteTheRecipe.WritePLC("砝码校准模式", false, null); + ExecuteTheRecipe.WritePLC("手自切换", true, null); + } + }).start(); + ExecuteTheRecipe.Execute(makegood); + ToastUtils.warning("商品:" + makegood.good.name + ",开始制作"); + } + /** * 初始化TopBar */ private void initTopBar() { - mTopBar.setTitle("智慧菠萝点餐系统"); + + mTopBar.setTitle("智慧菠萝点餐系统"+ConfigName.getInstance().Version); mTopBar.addLeftImageButton(R.mipmap.silos1,1).setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java index 54e36bf1..6f0eb693 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java @@ -397,6 +397,10 @@ public class silos_jiaoyan extends LinearLayout { new Thread(new Runnable() { @Override public void run() { + for (int i=1;i<=20;i++) + { + ExecuteTheRecipe.WritePLC("通道"+i+"校准开关",false,null); + } ExecuteTheRecipe.WritePLC("通道" + lcMode.num + "校准开关", true, null); if(activity!=null) {