From e9611468edaa6e1130965dc6d27cf90a756bde4e Mon Sep 17 00:00:00 2001 From: fyf Date: Wed, 21 Feb 2024 11:18:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B7=B1=E5=BA=A6=E6=B8=85?= =?UTF-8?q?=E6=B4=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/ConfigName.java | 72 +++-- .../modules/home/fragment/Home1Fragment.java | 47 +++- .../home/fragment/HomeFragmentSBKZ.java | 46 +++- .../from/fragment/WokSetTLZZFragment.java | 86 +++++- app/src/main/res/layout/fragment_home1.xml | 19 +- .../main/res/layout/fragment_wok_set_tlzz.xml | 250 +++++++++++++++++- 6 files changed, 476 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java index a356db8b..b4eb7d83 100644 --- a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java +++ b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java @@ -601,6 +601,12 @@ public class ConfigName { add(new Res_PLCADDRESS("翻转-去3号位", "M16.5", 0, 1)); add(new Res_PLCADDRESS("翻转-去4号位", "M16.6", 0, 1)); + add(new Res_PLCADDRESS("翻转-去1号吸料位", "M16.6", 0, 1)); + add(new Res_PLCADDRESS("翻转-去2号吸料位", "M70.5", 0, 1)); + add(new Res_PLCADDRESS("翻转-去3号吸料位", "M70.6", 0, 1)); + add(new Res_PLCADDRESS("翻转-去4号吸料位", "M70.7", 0, 1)); + + add(new Res_PLCADDRESS("翻转-1号位置值", "VD276", 1, 1)); add(new Res_PLCADDRESS("翻转-1#位置设定", "M17.0", 0, 1)); add(new Res_PLCADDRESS("翻转-2号位置值", "VD280", 1, 1)); @@ -609,6 +615,15 @@ public class ConfigName { add(new Res_PLCADDRESS("翻转-3#位置设定", "M17.2", 0, 1)); add(new Res_PLCADDRESS("翻转-4号位置值", "VD288", 1, 1)); add(new Res_PLCADDRESS("翻转-4#位置设定", "M17.3", 0, 1)); + add(new Res_PLCADDRESS("翻转-1号吸料位置值", "VD288", 1, 1)); + add(new Res_PLCADDRESS("翻转-1#吸料位置设定", "M17.3", 0, 1)); + add(new Res_PLCADDRESS("翻转-2号吸料位置值", "VD138", 1, 1)); + add(new Res_PLCADDRESS("翻转-2#吸料位置设定", "M70.0", 0, 1)); + add(new Res_PLCADDRESS("翻转-3号吸料位置值", "VD142", 1, 1)); + add(new Res_PLCADDRESS("翻转-3#吸料位置设定", "M70.1", 0, 1)); + add(new Res_PLCADDRESS("翻转-4号吸料位置值", "VD146", 1, 1)); + add(new Res_PLCADDRESS("翻转-4#吸料位置设定", "M70.2", 0, 1)); + add(new Res_PLCADDRESS("倒菜启动", "M17.4", 0, 1)); add(new Res_PLCADDRESS("磁铁吸合", "M17.5", 0, 1)); @@ -639,6 +654,11 @@ public class ConfigName { add(new Res_PLCADDRESS("翻转轴在2号位", "M44.1", 1, 0)); add(new Res_PLCADDRESS("翻转轴在3号位", "M44.2", 1, 0)); add(new Res_PLCADDRESS("翻转轴在4号位", "M44.3", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在1号吸料位", "M44.3", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在2号吸料位", "M72.0", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在3号吸料位", "M72.1", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在4号吸料位", "M72.2", 1, 0)); + add(new Res_PLCADDRESS("倒菜完成", "M44.4", 1, 0)); add(new Res_PLCADDRESS("心跳位", "VW1000", 0, 1)); @@ -844,6 +864,12 @@ public class ConfigName { add(new Res_PLCADDRESS("翻转-去3号位", "M16.5", 0, 1)); add(new Res_PLCADDRESS("翻转-去4号位", "M16.6", 0, 1)); + add(new Res_PLCADDRESS("翻转-去1号吸料位", "M16.6", 0, 1)); + add(new Res_PLCADDRESS("翻转-去2号吸料位", "M70.5", 0, 1)); + add(new Res_PLCADDRESS("翻转-去3号吸料位", "M70.6", 0, 1)); + add(new Res_PLCADDRESS("翻转-去4号吸料位", "M70.7", 0, 1)); + + add(new Res_PLCADDRESS("翻转-1号位置值", "VD276", 1, 1)); add(new Res_PLCADDRESS("翻转-1#位置设定", "M17.0", 0, 1)); add(new Res_PLCADDRESS("翻转-2号位置值", "VD280", 1, 1)); @@ -852,25 +878,18 @@ public class ConfigName { add(new Res_PLCADDRESS("翻转-3#位置设定", "M17.2", 0, 1)); add(new Res_PLCADDRESS("翻转-4号位置值", "VD288", 1, 1)); add(new Res_PLCADDRESS("翻转-4#位置设定", "M17.3", 0, 1)); + add(new Res_PLCADDRESS("翻转-1号吸料位置值", "VD288", 1, 1)); + add(new Res_PLCADDRESS("翻转-1#吸料位置设定", "M17.3", 0, 1)); + add(new Res_PLCADDRESS("翻转-2号吸料位置值", "VD138", 1, 1)); + add(new Res_PLCADDRESS("翻转-2#吸料位置设定", "M70.0", 0, 1)); + add(new Res_PLCADDRESS("翻转-3号吸料位置值", "VD142", 1, 1)); + add(new Res_PLCADDRESS("翻转-3#吸料位置设定", "M70.1", 0, 1)); + add(new Res_PLCADDRESS("翻转-4号吸料位置值", "VD146", 1, 1)); + add(new Res_PLCADDRESS("翻转-4#吸料位置设定", "M70.2", 0, 1)); + add(new Res_PLCADDRESS("倒菜启动", "M17.4", 0, 1)); add(new Res_PLCADDRESS("磁铁吸合", "M17.5", 0, 1)); - add(new Res_PLCADDRESS("温度模拟输入量", "-------------", 0, 0)); - add(new Res_PLCADDRESS("温度模拟量上限", "VW1050", 1, 1)); - add(new Res_PLCADDRESS("温度模拟量下限", "VW1052", 1, 1)); - add(new Res_PLCADDRESS("温度模拟量", "VW1054", 1, 1)); - add(new Res_PLCADDRESS("温度量程上限", "VD1060", 1, 1)); - add(new Res_PLCADDRESS("温度量程下限", "VD1056", 1, 1)); - - add(new Res_PLCADDRESS("电流模拟输入量", "-------------", 0, 0)); - add(new Res_PLCADDRESS("电流模拟量上限", "VW1070", 1, 1)); - add(new Res_PLCADDRESS("电流模拟量下限", "VW1072", 1, 1)); - add(new Res_PLCADDRESS("电流模拟量", "VW1074", 1, 1)); - add(new Res_PLCADDRESS("电流量程上限", "VD1080", 1, 1)); - add(new Res_PLCADDRESS("电流量程下限", "VD1076", 1, 1)); - add(new Res_PLCADDRESS("电流报警设置", "VW1092", 1, 1)); - add(new Res_PLCADDRESS("异常加热故障信息", "M42.1", 1, 1)); - //反馈信号 add(new Res_PLCADDRESS("反馈信号", "-------------", 0, 0)); add(new Res_PLCADDRESS("初始化完成", "M40.0", 1, 0)); @@ -898,9 +917,30 @@ public class ConfigName { add(new Res_PLCADDRESS("翻转轴在2号位", "M44.1", 1, 0)); add(new Res_PLCADDRESS("翻转轴在3号位", "M44.2", 1, 0)); add(new Res_PLCADDRESS("翻转轴在4号位", "M44.3", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在1号吸料位", "M44.3", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在2号吸料位", "M72.0", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在3号吸料位", "M72.1", 1, 0)); + add(new Res_PLCADDRESS("翻转轴在4号吸料位", "M72.2", 1, 0)); + add(new Res_PLCADDRESS("倒菜完成", "M44.4", 1, 0)); add(new Res_PLCADDRESS("心跳位", "VW1000", 0, 1)); + add(new Res_PLCADDRESS("温度模拟输入量", "-------------", 0, 0)); + add(new Res_PLCADDRESS("温度模拟量上限", "VW1050", 1, 1)); + add(new Res_PLCADDRESS("温度模拟量下限", "VW1052", 1, 1)); + add(new Res_PLCADDRESS("温度模拟量", "VW1054", 1, 1)); + add(new Res_PLCADDRESS("温度量程上限", "VD1060", 1, 1)); + add(new Res_PLCADDRESS("温度量程下限", "VD1056", 1, 1)); + + add(new Res_PLCADDRESS("电流模拟输入量", "-------------", 0, 0)); + add(new Res_PLCADDRESS("电流模拟量上限", "VW1070", 1, 1)); + add(new Res_PLCADDRESS("电流模拟量下限", "VW1072", 1, 1)); + add(new Res_PLCADDRESS("电流模拟量", "VW1074", 1, 1)); + add(new Res_PLCADDRESS("电流量程上限", "VD1080", 1, 1)); + add(new Res_PLCADDRESS("电流量程下限", "VD1076", 1, 1)); + add(new Res_PLCADDRESS("电流报警设置", "VW1092", 1, 1)); + add(new Res_PLCADDRESS("异常加热故障信息", "M42.1", 1, 1)); + //检测信号 add(new Res_PLCADDRESS("监测信号", "-------------", 0, 0)); add(new Res_PLCADDRESS("当前锅底温度", "VD300", 1, 0)); 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 ed799105..08a88c70 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 @@ -18,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView; import android.os.CountDownTimer; import android.os.Handler; +import android.text.InputType; import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -1002,7 +1003,7 @@ public class Home1Fragment extends BaseFragment { * * @param view */ - @OnClick({R.id.xzcp, R.id.startbutton, R.id.qdjb + @OnClick({R.id.xzcp, R.id.startbutton, R.id.qdjb,R.id.sdqx , R.id.yaoqian, R.id.tingyao , R.id.ydw, R.id.dcw, R.id.clw, R.id.qxw, R.id.ccw1, R.id.ccw2, R.id.ccw3 , R.id.chushihua, R.id.jiting}) @@ -1063,6 +1064,50 @@ public class Home1Fragment extends BaseFragment { } ExecuteTheRecipe.BottomClick("炒锅清洗"); break; + case R.id.sdqx://开始深度清洗 + if (!IsMake(true)) { + return; + } + + final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); + builder.setTitle("深度清洗抽水用量") + .setPlaceholder("在此输入您的用量") + .setInputType(InputType.TYPE_CLASS_NUMBER) + .setDefaultText("500") + .addAction("取消", new QMUIDialogAction.ActionListener() { + @Override + public void onClick(QMUIDialog dialog, int index) { + dialog.dismiss(); + } + }) + .addAction("确定", new QMUIDialogAction.ActionListener() { + @Override + public void onClick(QMUIDialog dialog, int index) { + CharSequence text = builder.getEditText().getText(); + if (text != null && text.length() > 0) { + String t = text.toString(); + int val=1000; + try { + val=Integer.parseInt(t); + } catch (Exception ex) { + ToastUtils.warning("输入格式出错!"); + return; + } + ExecuteTheRecipe.WritePLC("清洗抽水量", val, null); + try { + Thread.sleep(500);//等待写入成功 + } catch (InterruptedException e) { + + } + ExecuteTheRecipe.BottomClick("深度清洗"); + dialog.dismiss(); + } else { + ToastUtils.warning("用量不能为空!"); + } + } + }) + .show(); + break; case R.id.yaoqian: if (!IsMake(true)) { return; diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java index a639359a..dbe884dc 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java @@ -7,6 +7,7 @@ import androidx.appcompat.app.AppCompatActivity; import android.app.Activity; import android.content.Context; import android.os.Bundle; +import android.text.InputType; import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -35,6 +36,8 @@ import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.modules.home.fragment.mode.imagebuttom3; import com.bonait.bnframework.modules.home.fragment.mode.newhuoli_control; import com.orhanobut.logger.Logger; +import com.qmuiteam.qmui.widget.dialog.QMUIDialog; +import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; import java.util.ArrayList; import java.util.List; @@ -374,8 +377,47 @@ public class HomeFragmentSBKZ extends BaseFragment { ToastUtils.warning("初始化"); break; case R.id.zidongqingxi://自动清洗 - ExecuteTheRecipe.BottomClick("炒锅清洗"); - ToastUtils.warning("自动清洗"); +// ExecuteTheRecipe.BottomClick("炒锅清洗"); +// ToastUtils.warning("自动清洗"); + final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); + builder.setTitle("深度清洗抽水用量") + .setPlaceholder("在此输入您的用量") + .setInputType(InputType.TYPE_CLASS_NUMBER) + .setDefaultText("500") + .addAction("取消", new QMUIDialogAction.ActionListener() { + @Override + public void onClick(QMUIDialog dialog, int index) { + dialog.dismiss(); + } + }) + .addAction("确定", new QMUIDialogAction.ActionListener() { + @Override + public void onClick(QMUIDialog dialog, int index) { + CharSequence text = builder.getEditText().getText(); + if (text != null && text.length() > 0) { + String t = text.toString(); + int val=1000; + try { + val=Integer.parseInt(t); + } catch (Exception ex) { + ToastUtils.warning("输入格式出错!"); + return; + } + ExecuteTheRecipe.WritePLC("清洗抽水量", val, null); + try { + Thread.sleep(500);//等待写入成功 + } catch (InterruptedException e) { + + } + ExecuteTheRecipe.BottomClick("深度清洗"); + ToastUtils.warning("自动清洗"); + dialog.dismiss(); + } else { + ToastUtils.warning("用量不能为空!"); + } + } + }) + .show(); break; } } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZFragment.java index 2fffe165..1a944598 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZFragment.java @@ -79,8 +79,17 @@ public class WokSetTLZZFragment extends BaseFragment { TextView edit_fzz_wz2; @BindView(R.id.edit_fzz_wz3) TextView edit_fzz_wz3; - @BindView(R.id.edit_fzz_wz4) - TextView edit_fzz_wz4; +// @BindView(R.id.edit_fzz_wz4) +// TextView edit_fzz_wz4; + + @BindView(R.id.edit_fzz_xl1) + TextView edit_fzz_xl1; + @BindView(R.id.edit_fzz_xl2) + TextView edit_fzz_xl2; + @BindView(R.id.edit_fzz_xl3) + TextView edit_fzz_xl3; + @BindView(R.id.edit_fzz_xl4) + TextView edit_fzz_xl4; //endregion //region 界面 @@ -205,6 +214,11 @@ public class WokSetTLZZFragment extends BaseFragment { Object m3 = ExecuteTheRecipe.ReadPLC("翻转-3号位置值"); Object m4 = ExecuteTheRecipe.ReadPLC("翻转-4号位置值"); + + Object m5 = ExecuteTheRecipe.ReadPLC("翻转-1号吸料位置值"); + Object m6 = ExecuteTheRecipe.ReadPLC("翻转-2号吸料位置值"); + Object m7 = ExecuteTheRecipe.ReadPLC("翻转-3号吸料位置值"); + Object m8 = ExecuteTheRecipe.ReadPLC("翻转-4号吸料位置值"); getActivity().runOnUiThread(new Runnable() { @Override public void run() { @@ -254,11 +268,35 @@ public class WokSetTLZZFragment extends BaseFragment { } else { edit_fzz_wz3.setText("未知"); } - if (m4 != null) { - edit_fzz_wz4.setText(m4 + ""); +// if (m4 != null) { +// edit_fzz_wz4.setText(m4 + ""); +// } else { +// edit_fzz_wz4.setText("未知"); +// } + if (m5 != null) { + edit_fzz_xl1.setText(m5 + ""); + } else { + edit_fzz_xl1.setText("未知"); + } + + if (m6 != null) { + edit_fzz_xl2.setText(m6 + ""); + } else { + edit_fzz_xl2.setText("未知"); + } + + if (m7 != null) { + edit_fzz_xl3.setText(m7 + ""); + } else { + edit_fzz_xl3.setText("未知"); + } + + if (m8 != null) { + edit_fzz_xl4.setText(m8 + ""); } else { - edit_fzz_wz4.setText("未知"); + edit_fzz_xl4.setText("未知"); } + } }); Thread.sleep(500); @@ -280,8 +318,8 @@ public class WokSetTLZZFragment extends BaseFragment { R.id.pyz_qu1, R.id.pyz_qu2, R.id.pyz_qu3, R.id.pyz_qu4, R.id.fzz_hl, - R.id.fzz_wzsz1, R.id.fzz_wzsz2, R.id.fzz_wzsz3, R.id.fzz_wzsz4, - R.id.fzz_qu1, R.id.fzz_qu2, R.id.fzz_qu3, R.id.fzz_qu4, + R.id.fzz_wzsz1, R.id.fzz_wzsz2, R.id.fzz_wzsz3, R.id.fzz_wzsz_xl1,R.id.fzz_wzsz_xl2,R.id.fzz_wzsz_xl3,R.id.fzz_wzsz_xl4, + R.id.fzz_qu1, R.id.fzz_qu2, R.id.fzz_qu3, R.id.fzz_qu5,R.id.fzz_qu6,R.id.fzz_qu7,R.id.fzz_qu8, R.id.dcqd_button, @@ -329,8 +367,20 @@ public class WokSetTLZZFragment extends BaseFragment { case R.id.fzz_wzsz3: ButtomZhiWeiZhi("翻转-3#位置设定"); break; - case R.id.fzz_wzsz4: - ButtomZhiWeiZhi("翻转-4#位置设定"); +// case R.id.fzz_wzsz4: +// ButtomZhiWeiZhi("翻转-4#位置设定"); +// break; + case R.id.fzz_wzsz_xl1: + ButtomZhiWeiZhi("翻转-1#吸料位置设定"); + break; + case R.id.fzz_wzsz_xl2: + ButtomZhiWeiZhi("翻转-2#吸料位置设定"); + break; + case R.id.fzz_wzsz_xl3: + ButtomZhiWeiZhi("翻转-3#吸料位置设定"); + break; + case R.id.fzz_wzsz_xl4: + ButtomZhiWeiZhi("翻转-4#吸料位置设定"); break; case R.id.fzz_qu1: ButtomZhiWeiZhi("翻转-去1号位"); @@ -341,9 +391,23 @@ public class WokSetTLZZFragment extends BaseFragment { case R.id.fzz_qu3: ButtomZhiWeiZhi("翻转-去3号位"); break; - case R.id.fzz_qu4: - ButtomZhiWeiZhi("翻转-去4号位"); +// case R.id.fzz_qu4: +// ButtomZhiWeiZhi("翻转-去4号位"); +// break; + case R.id.fzz_qu5: + ButtomZhiWeiZhi("翻转-去1号吸料位"); + break; + case R.id.fzz_qu6: + ButtomZhiWeiZhi("翻转-去2号吸料位"); break; + case R.id.fzz_qu7: + ButtomZhiWeiZhi("翻转-去3号吸料位"); + break; + case R.id.fzz_qu8: + ButtomZhiWeiZhi("翻转-去4号吸料位"); + break; + + case R.id.dcqd_button: ButtomZhiWeiZhi("主料"); break; diff --git a/app/src/main/res/layout/fragment_home1.xml b/app/src/main/res/layout/fragment_home1.xml index ded6e11c..09ec9d48 100644 --- a/app/src/main/res/layout/fragment_home1.xml +++ b/app/src/main/res/layout/fragment_home1.xml @@ -605,7 +605,24 @@ android:layout_centerInParent="true" android:layout_marginBottom="10dp" android:background="@drawable/bg_btn_login_selected" - android:text="自动清洗" + android:text="普通清洁" + android:textColor="@color/white" + android:textSize="16dp" /> + + + + +