From 778e9c4307f84036a9e10e6b4c57e78769b6b19c Mon Sep 17 00:00:00 2001 From: fyf Date: Thu, 6 Jul 2023 18:21:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E4=BD=9C23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/ExecuteTheRecipe.java | 78 +++++++++++++++++++ .../modules/home/fragment/Home1Fragment.java | 18 +++-- .../home/fragment/mode/LocationStatus.java | 8 ++ .../modules/home/fragment/mode/MyStatus.java | 10 +++ 4 files changed, 106 insertions(+), 8 deletions(-) create mode 100644 app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/LocationStatus.java create mode 100644 app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/MyStatus.java 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 7a88e350..8d7e0336 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java +++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java @@ -5,6 +5,8 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; import com.bonait.bnframework.common.db.mode.BPA_SILOS; import com.bonait.bnframework.common.utils.ToastUtils; +import com.bonait.bnframework.modules.home.fragment.mode.LocationStatus; +import com.bonait.bnframework.modules.home.fragment.mode.MyStatus; import java.util.ArrayList; import java.util.HashMap; @@ -359,4 +361,80 @@ public class ExecuteTheRecipe { } //endregion + //region 主页按钮 + + /** + * 点击清洗按钮 + * @param data + */ + public static void Write_PLC_Clean(MyStatus data) + { + try + { + if(data==MyStatus.Start) + { + ToastUtils.info("点击启动搅拌清洗按钮"); + + }else if(data==MyStatus.Paused) + { + ToastUtils.info("点击暂停清洗按钮"); + + }else if(data==MyStatus.Stop) + { + ToastUtils.info("点击停止清洗按钮"); + } + }catch (Exception ex) + { + ToastUtils.error("异常信息:" + ex.getMessage()); + } + } + + /** + * 点击清洗按钮 + * @param data + */ + public static void Write_PLC_Location(LocationStatus data) + { + try + { + if(data==LocationStatus.InLocation) + { + ToastUtils.info("点击炒菜位按钮"); + + }else if(data==LocationStatus.OutLocation) + { + ToastUtils.info("点击出菜位按钮"); + + }else if(data==LocationStatus.PourWaterLocation) + { + ToastUtils.info("点击倒水位按钮"); + } + }catch (Exception ex) + { + ToastUtils.error("异常信息:" + ex.getMessage()); + } + } + + /** + * 点击摇欠按钮 + * @param data + */ + public static void Write_PLC_YaoQian(MyStatus data) + { + try + { + if(data==MyStatus.Start) + { + ToastUtils.info("点击摇浅按钮"); + + }else if(data==MyStatus.Stop) + { + ToastUtils.info("点击停摇按钮"); + } + }catch (Exception ex) + { + ToastUtils.error("异常信息:" + ex.getMessage()); + } + } + //endregion } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java index 685934c1..6f3a89a7 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java @@ -35,6 +35,8 @@ import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.common.view.MyLayoutManager; import com.bonait.bnframework.modules.home.adapter.lc_adapter; import com.bonait.bnframework.modules.home.fragment.from.CpxzActivity; +import com.bonait.bnframework.modules.home.fragment.mode.LocationStatus; +import com.bonait.bnframework.modules.home.fragment.mode.MyStatus; import com.bonait.bnframework.modules.home.fragment.mode.huoli_control; import com.capton.colorfulprogressbar.ColorfulProgressbar; import com.orhanobut.logger.Logger; @@ -325,28 +327,28 @@ public class Home1Fragment extends BaseFragment { } break; case R.id.qdjb: - ToastUtils.info("点击启动搅拌清洗按钮"); + ExecuteTheRecipe.Write_PLC_Clean(MyStatus.Start); break; case R.id.ztjb: - ToastUtils.info("点击暂停清洗按钮"); + ExecuteTheRecipe.Write_PLC_Clean(MyStatus.Paused); break; case R.id.tzjb: - ToastUtils.info("点击停止清洗按钮"); + ExecuteTheRecipe.Write_PLC_Clean(MyStatus.Stop); break; case R.id.ccw: - ToastUtils.info("点击炒菜位按钮"); + ExecuteTheRecipe.Write_PLC_Location(LocationStatus.InLocation); break; case R.id.chucw: - ToastUtils.info("点击出菜位按钮"); + ExecuteTheRecipe.Write_PLC_Location(LocationStatus.OutLocation); break; case R.id.dsw: - ToastUtils.info("点击倒水位按钮"); + ExecuteTheRecipe.Write_PLC_Location(LocationStatus.PourWaterLocation); break; case R.id.yaoqian: - ToastUtils.info("点击摇浅按钮"); + ExecuteTheRecipe.Write_PLC_YaoQian(MyStatus.Start); break; case R.id.tingyao: - ToastUtils.info("点击停摇按钮"); + ExecuteTheRecipe.Write_PLC_YaoQian(MyStatus.Stop); break; } } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/LocationStatus.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/LocationStatus.java new file mode 100644 index 00000000..52bec4ea --- /dev/null +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/LocationStatus.java @@ -0,0 +1,8 @@ +package com.bonait.bnframework.modules.home.fragment.mode; + + +public enum LocationStatus { + InLocation, + OutLocation, + PourWaterLocation +} diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/MyStatus.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/MyStatus.java new file mode 100644 index 00000000..3d30eb7d --- /dev/null +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/MyStatus.java @@ -0,0 +1,10 @@ +package com.bonait.bnframework.modules.home.fragment.mode; + +/** + * 状态 + */ +public enum MyStatus { + Start, + Paused, + Stop +}