From d62a80da212537b25cfbbbdd82d1f3fee377da56 Mon Sep 17 00:00:00 2001 From: fyf Date: Mon, 15 Jan 2024 14:31:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0plc=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bnframework/business/ConfigData.java | 4 + .../business/ExecuteTheRecipe.java | 520 +++++++----------- .../common/constant/ConfigName.java | 7 + .../common/modbus/ModbusTcpServer.java | 8 +- .../fragment/SystemSystemsetFragment.java | 33 ++ .../modules/mine/fragment/MyFragment.java | 16 +- .../res/layout/fragment_system_systemset.xml | 13 + 7 files changed, 268 insertions(+), 333 deletions(-) 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 16bb2dc1..1a7ac867 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ConfigData.java +++ b/app/src/main/java/com/bonait/bnframework/business/ConfigData.java @@ -292,6 +292,8 @@ public class ConfigData { ConfigName.getInstance().Version = ConfigUtil.read(ConfigName.getInstance().dishesCon, "Version", ConfigName.getInstance().Version); ConfigName.getInstance().HuoLi = ConfigUtil.read(ConfigName.getInstance().dishesCon, "HuoLi", ConfigName.getInstance().HuoLi); ConfigName.getInstance().MaxTemp = ConfigUtil.read(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); + ConfigName.getInstance().WhetherManualFeedingSuspended = ConfigUtil.read(ConfigName.getInstance().dishesCon, "WhetherManualFeedingSuspended", ConfigName.getInstance().WhetherManualFeedingSuspended); + ConfigName.getInstance().gkcxCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "gkcxCount", ConfigName.getInstance().gkcxCount ); ConfigName.getInstance().jiaobanCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "jiaobanCount", ConfigName.getInstance().jiaobanCount ); @@ -319,6 +321,8 @@ public class ConfigData { ConfigUtil.write(ConfigName.getInstance().dishesCon, "Version", ConfigName.getInstance().Version); ConfigUtil.write(ConfigName.getInstance().dishesCon, "HuoLi", ConfigName.getInstance().HuoLi); ConfigUtil.write(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); + ConfigUtil.write(ConfigName.getInstance().dishesCon, "WhetherManualFeedingSuspended", ConfigName.getInstance().WhetherManualFeedingSuspended); + ConfigUtil.write(ConfigName.getInstance().dishesCon, "gkcxCount", ConfigName.getInstance().gkcxCount ); ConfigUtil.write(ConfigName.getInstance().dishesCon, "jiaobanCount", ConfigName.getInstance().jiaobanCount ); 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 5ed329d8..de3b3880 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java +++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java @@ -36,6 +36,7 @@ import com.bonait.bnframework.modules.home.fragment.mode.MyStatus; import com.qmuiteam.qmui.widget.dialog.QMUIDialog; import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; +import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -101,6 +102,14 @@ public class ExecuteTheRecipe { * 当前执行工序 */ public static IRunT ExecuteCurrentOperation = null; + /** + * plc 当前版本号 + */ + public static String PlcVersion="0001"; + /** + * 通知版本号更新显示 + */ + public static IRun NotifyVersionNumUpdates = null; //endregion //region 强制结束 @@ -137,42 +146,36 @@ public class ExecuteTheRecipe { try { //1.解析 if (IsForcedEnd) { - ToastUtils.info("客官,小菠萝正在强制结束当前炒制菜品,请耐心等候!!!"); ExecuteTheRecipe.showlog("客官,小菠萝正在强制结束当前炒制菜品,请耐心等候!!!"); return false; } - ToastUtils.info("开始执行:" + recipe.sort + "、" + recipe.processms); ExecuteTheRecipe.showlog("开始执行:" + recipe.sort + "、" + recipe.processms); if (recipe.materialType == 0)//正常物料 { //先到达抽料位 - BPA_GOODSRECIPE data1 = Get位置("高速", "抽料位"); - ExecuteOperationSteps(data1.processname, data1.processvalue); - + Make位置("抽料位"); + //开始配料 ExecuteMaterialIssuance(recipe.processvalue); } else if (recipe.materialType == 1)//工序模型 { if (recipe.processname.equals("加水") || recipe.processname.equals("并行出料")) { - BPA_GOODSRECIPE data2 = Get位置("高速", "抽料位"); - ExecuteOperationSteps(data2.processname, data2.processvalue); + Make位置("抽料位"); } else if (recipe.processname.equals("主料")) { if (ConfigName.getInstance().versionSelectionEnum.contains("一拖")) { - BPA_GOODSRECIPE data3 = Get位置("高速", "原点位"); - ExecuteOperationSteps(data3.processname, data3.processvalue); + Make位置("原点位"); } else { - BPA_GOODSRECIPE data3 = Get位置("高速", "炒菜位1"); - ExecuteOperationSteps(data3.processname, data3.processvalue); + Make位置("炒菜位1"); } } else if (recipe.processname.equals("辅料")) { - BPA_GOODSRECIPE data3 = Get位置("高速", "原点位"); - ExecuteOperationSteps(data3.processname, data3.processvalue); + Make位置("原点位"); } + + //执行工序 ExecuteOperationSteps(recipe.processname, recipe.processvalue); if (recipe.processname.equals("出菜")) { - BPA_GOODSRECIPE data4 = Get位置("高速", "炒菜位1"); - ExecuteOperationSteps(data4.processname, data4.processvalue); + Make位置("炒菜位1"); } } } catch (Exception ex) { @@ -190,8 +193,6 @@ public class ExecuteTheRecipe { */ public static void ExecuteMaterialIssuance(String text) { try { - ToastUtils.info("准备下料!!!"); - if (!text.isEmpty()) { //仓号 值 HashMap formulation = new HashMap<>(); @@ -233,27 +234,7 @@ public class ExecuteTheRecipe { //一直等待下料完成 否则就一直等待 40s超时 for (Map.Entry entry : formulation.entrySet()) { BPA_SILOS silos = entry.getKey(); - Integer val = entry.getValue(); - String name = "料仓" + silos.num + "下料完成"; - ExecuteTheRecipe.showlog("等待"+name); - - final boolean[] IsComplete = {false}; - long a = System.currentTimeMillis(); - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * whileTime) { - break; - } else { - Object sb = ReadPLC(name);// ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog("正常等待结束"); - } - } - Thread.sleep(100);//10 *6 - } - ToastUtils.info(name); - ExecuteTheRecipe.showlog(name); - + ThreadWhile("料仓" + silos.num + "下料完成"); } } } catch (Exception ex) { @@ -318,9 +299,6 @@ public class ExecuteTheRecipe { Write_PLC_MainAccessory(formulation); } break; - case "加水": - Write_PLC_Water(formulation); - break; case "并行出料": Write_PLC_ParallelDischarge(formulation); break; @@ -359,7 +337,6 @@ public class ExecuteTheRecipe { if (ExecuteCurrentOperation != null) { ExecuteCurrentOperation.Run("液体料|" + silos.num); } - ToastUtils.info("准备写入PLC仓号需求:" + silos.num + "," + val / 10.0); ExecuteTheRecipe.showlog("准备写入PLC仓号需求:" + silos.num + "," + val / 10.0); String name = "料仓" + silos.num + "下料完成"; @@ -376,13 +353,13 @@ public class ExecuteTheRecipe { @Override public void onFailure(String ErrorMsg) { - ExecuteTheRecipe.showlog("需求值写入失败!尝试再次写入...错误原因:"+ErrorMsg); - WritePLC("料仓" + silos.num + "需求值", val,null); + ExecuteTheRecipe.showlog("需求值写入失败!尝试再次写入...错误原因:" + ErrorMsg); + WritePLC("料仓" + silos.num + "需求值", val, null); IsComplete[0] = true; } }); long a = System.currentTimeMillis(); - while (!IsComplete[0]&& !IsForcedEnd) { + while (!IsComplete[0] && !IsForcedEnd) { if ((System.currentTimeMillis() - a) > 1000 * whileTime) { break; } @@ -395,7 +372,6 @@ public class ExecuteTheRecipe { //減去料仓数量 int otherG = silos.silosmargin - (val / 10); QueryDB.UpdateYL(silos.id, otherG >= 0 ? otherG : 0); - //ToastUtils.info("写入PLC仓号需求:" + num + "," + val/10.0); } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); } @@ -412,8 +388,6 @@ public class ExecuteTheRecipe { private static void Write_PLC_Stir(HashMap data) { try { int val = 0; - ExecuteTheRecipe.showlog( "准备写入工序-------搅拌"); - for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); @@ -428,18 +402,23 @@ public class ExecuteTheRecipe { WritePLC(key, writeValue, new IWriteCallBack() { @Override public void onSuccess() { - ExecuteTheRecipe.showlog( "成功写入工序-------搅拌,挡位-"+writeValue); + ExecuteTheRecipe.showlog("搅拌,挡位-" + writeValue + ",写入成功!"); if (writeValue == 0) { WritePLC("搅拌", false, null); - ExecuteTheRecipe.showlog( "成功写入工序-------搅拌,开关-false"); } else { WritePLC("搅拌", true, null); - ExecuteTheRecipe.showlog( "成功写入工序-------搅拌,开关-true"); } } @Override public void onFailure(String ErrorMsg) { + ExecuteTheRecipe.showlog("搅拌,挡位-" + writeValue + ",写入失败!原因:" + ErrorMsg); + WritePLC(key, writeValue, null); + if (writeValue == 0) { + WritePLC("搅拌", false, null); + } else { + WritePLC("搅拌", true, null); + } } }); } @@ -447,7 +426,6 @@ public class ExecuteTheRecipe { if (val > 0) { ThreadDelay(val); - //Thread.sleep(val * 1000); } } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); @@ -461,8 +439,6 @@ public class ExecuteTheRecipe { */ private static void Write_PLC_Location(HashMap data) { try { - ExecuteTheRecipe.showlog( "准备写入工序-------锅口朝向"); - int val = 0; for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); @@ -480,41 +456,21 @@ public class ExecuteTheRecipe { String key = entry.getKey(); String value = entry.getValue(); if (!key.contains("(秒)") && !key.contains("速度")) { - ToastUtils.info("工序:" + key + "," + value); + ExecuteTheRecipe.showlog("工序:" + key + "," + value); if (ExecuteCurrentOperation != null) { ExecuteCurrentOperation.Run("位置" + "|" + value); } //原点位,等待机器移动倒响应位置 BottomClick1(value); - ExecuteTheRecipe.showlog( "成功写入工序-------锅口朝向-"+value+"-等待锅口移动中..."); - //一直等待机器移动到该位置,否则就一直等待 6s超时 - String name = value + "反馈"; - final boolean[] IsComplete = {false}; - long a = System.currentTimeMillis(); - ExecuteTheRecipe.showlog( name + ",等待中"); - - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * whileTime) { - break; - } else { - Object sb = ReadPLC(name);//ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog( "正常等待反馈信号结束"); - } - } - Thread.sleep(100);//10 *6 - } - ExecuteTheRecipe.showlog( name + ",等待结束。"+"炒锅到达" + value + ",继续制作!!!"); - ToastUtils.info("炒锅到达" + value + ",继续制作!!!"); + //一直等待机器移动到该位置 + ThreadWhile(value + "反馈"); } } if (val > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); } } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); @@ -528,11 +484,8 @@ public class ExecuteTheRecipe { */ private static void Write_PLC_Ingredients(HashMap data) { try { - ExecuteTheRecipe.showlog( "准备写入工序-------主料"); - //是否手动 boolean ishand = true; - ToastUtils.info("准备倒入主料!"); //region 判断是否手动 if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) { @@ -569,11 +522,13 @@ public class ExecuteTheRecipe { zl = value; } } - ToastUtils.info("工序:手动投料," + name + "," + zl); + ExecuteTheRecipe.showlog("工序:手动投料," + name + "," + zl); String title = "手动投料-温馨提示!"; String message = "客官请投入主料,[" + name + "]重量" + zl + "g,投入后点击[确定]继续流程!"; - //ExecuteTheRecipe.WritePLC("暂停开关", true, null); - ExecuteTheRecipe.showlog( "等待手动投入主料:"+name); + + if (ConfigName.getInstance().WhetherManualFeedingSuspended.contains("是")) { + ExecuteTheRecipe.WritePLC("暂停开关", true, null); + } final boolean[] IsComplete = {false}; Activity activity = findActivity(context); @@ -601,9 +556,12 @@ public class ExecuteTheRecipe { while (!IsComplete[0]) { Thread.sleep(100);//10 *6 } - //ExecuteTheRecipe.WritePLC("暂停开关", false, null); - ToastUtils.info("确定完成,继续制作!"); - ExecuteTheRecipe.showlog( "手动已确认投入主料:"+name+"-继续流程"); + + if (ConfigName.getInstance().WhetherManualFeedingSuspended.contains("是")) { + ExecuteTheRecipe.WritePLC("暂停开关", false, null); + } + + ExecuteTheRecipe.showlog("手动已确认投入主料:" + name + "-继续流程"); } else { //自动投料 if (ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本") || ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) { @@ -619,83 +577,36 @@ public class ExecuteTheRecipe { ExecuteCurrentOperation.Run("主料" + "|" + writeValue); } - //1.去某一个位置 BottomClick1("平移-去" + writeValue); - ExecuteTheRecipe.showlog( "平移-去" + writeValue); - - Log.d("平移", "平移-去" + writeValue); - ExecuteTheRecipe.showlog( "等待:" + "平移轴在" + writeValue); - - //一直等待机器移动到该位置,否则就一直等待 6s超时 - String name = "平移轴在" + writeValue; - final boolean[] IsComplete = {false}; - long a = System.currentTimeMillis(); - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * whileTime) { - break; - } else { - Object sb = ReadPLC(name);// ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog( "正常等待反馈信号结束"); - } - } - Thread.sleep(100);//10 *6 - } - Log.d("平移", name + "已经就位"); - ExecuteTheRecipe.showlog( name + "已经就位"); + //一直等待机器移动到该位置,否则就一直等待 + ThreadWhile("平移轴在" + writeValue); //2.给倒菜启动 BottomClick1("主料"); - ExecuteTheRecipe.showlog( "到菜启动"); - ExecuteTheRecipe.showlog( "等待:" + "倒菜完成"); - - name = "倒菜完成"; - IsComplete[0] = false; - a = System.currentTimeMillis(); - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * whileTime) { - break; - } else { - Object sb = ReadPLC(name);// ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog( "正常等待反馈信号结束"); - } - } - Thread.sleep(100);//10 *6 - } - - ExecuteTheRecipe.showlog( "主料倒入完成,继续制作!"); - - ToastUtils.info("主料倒入完成,继续制作!"); + //等待倒菜完成 + ThreadWhile("倒菜完成"); } } - Log.d("倒菜", "倒菜完成了"); if (IsMoveYiHaoWei()) { if (ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本") || ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) { ExecuteTheRecipe.BottomClick1("平移-去1号位"); - Log.d("移动去", "1号位"); } } - //判断炒制位置 - String czwz="炒菜位1"; + String czwz = "炒菜位1"; for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.contains("炒制位置")) { - czwz=value; + czwz = value; } } - BPA_GOODSRECIPE data3 = Get位置("高速", czwz); - ExecuteOperationSteps(data3.processname, data3.processvalue); - + Make位置(czwz); //判断是否有烹饪时间 int val = 0; @@ -706,14 +617,12 @@ public class ExecuteTheRecipe { val = Integer.parseInt(value); } } + if (val > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); } - Log.d("烹饪时间", "烹饪时间完成了"); - ExecuteTheRecipe.showlog( "烹饪时间完成了"); - + ExecuteTheRecipe.showlog("烹饪时间等待结束!继续下一步."); } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); } @@ -752,6 +661,7 @@ public class ExecuteTheRecipe { Thread.sleep(200); WritePLC(name, false, null); Log.e("按钮复位", name); + ExecuteTheRecipe.showlog("写入plc-------" + name); } catch (Exception ex) { Log.e("按钮异常", name + ex.getMessage()); WritePLC(name, false, null); @@ -775,8 +685,6 @@ public class ExecuteTheRecipe { */ private static void Write_PLC_Heating(HashMap data) { try { - ExecuteTheRecipe.showlog( "准备写入工序-------加热"); - int val = 0; for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); @@ -784,7 +692,7 @@ public class ExecuteTheRecipe { if (key.contains("(秒)")) { val = Integer.parseInt(value); } else { - ToastUtils.info("工序:" + key + "," + value); + ExecuteTheRecipe.showlog("工序:" + key + "," + value); int writeValue = GetMXValue(key, value); if (ExecuteCurrentOperation != null) { ExecuteCurrentOperation.Run("加热" + "|" + writeValue); @@ -793,7 +701,7 @@ public class ExecuteTheRecipe { WritePLC(key, writeValue, new IWriteCallBack() { @Override public void onSuccess() { - ExecuteTheRecipe.showlog( "写加热挡位:"+writeValue+"成功"); + ExecuteTheRecipe.showlog("写加热挡位:" + writeValue + "成功"); if (writeValue == 0) { ConfigName.getInstance().IsOpenHuoLi = false; WritePLC("加热", false, null); @@ -805,7 +713,8 @@ public class ExecuteTheRecipe { @Override public void onFailure(String ErrorMsg) { - ExecuteTheRecipe.showlog( "写加热挡位:"+writeValue+"失败,错误原因:"+ErrorMsg); + ExecuteTheRecipe.showlog("写加热挡位:" + writeValue + "失败,错误原因:" + ErrorMsg); + WritePLC(key, writeValue, null); if (writeValue == 0) { ConfigName.getInstance().IsOpenHuoLi = false; WritePLC("加热", false, null); @@ -821,52 +730,8 @@ public class ExecuteTheRecipe { if (val > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); - } - - } catch (Exception ex) { - ToastUtils.error("异常信息:" + ex.getMessage()); - } - } - - /** - * 写PLC加水 - * - * @param data - */ - private static void Write_PLC_Water(HashMap data) { - try { - int val = 0; - for (HashMap.Entry entry : data.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - if (key.contains("(秒)")) { - val = Integer.parseInt(value); - } - } - - if (ExecuteCurrentOperation != null) { - ExecuteCurrentOperation.Run("加水" + "|" + val); } - if (val > 0 && !IsForcedEnd) { - WritePLC("炒锅抽水", true, null); - final boolean[] IsComplete = {false}; - new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { - @Override - public void run() { - IsComplete[0] = true; - } - }, val * 1000); - long a = System.currentTimeMillis(); - while (!IsComplete[0]) { - if ((System.currentTimeMillis() - a) > 1000 * whileTime) { - break; - } - Thread.sleep(100); - } - ExecuteTheRecipe.WritePLC("炒锅抽水", false, null); - } } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); } @@ -879,31 +744,27 @@ public class ExecuteTheRecipe { */ private static void Write_PLC_ParallelDischarge(HashMap data) { try { - ExecuteTheRecipe.showlog( "准备写入工序-------并行出料"); - int val = 0;int cl_value=0; + int val = 0; + int cl_value = 0; for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.contains("(秒)")) { val = Integer.parseInt(value); - }else if (key.contains("出料克数")){ + } else if (key.contains("出料克数")) { //1000.0 10000/3 3333 - cl_value= (int) Math.round((Double.parseDouble(value) * 10)); + cl_value = (int) Math.round((Double.parseDouble(value) * 10)); } } - HashMap formulation = new HashMap<>(); - List bpa_silos = QueryDB. GetSilosALL(); - for (BPA_SILOS item:bpa_silos) - { - if (item.num==1 || item.num==2 || item.num==3) - { - if((cl_value/3)>0) - { - formulation.put(item, cl_value/3); + List bpa_silos = QueryDB.GetSilosALL(); + for (BPA_SILOS item : bpa_silos) { + if (item.num == 1 || item.num == 2 || item.num == 3) { + if ((cl_value / 3) > 0) { + formulation.put(item, cl_value / 3); } } } @@ -917,36 +778,14 @@ public class ExecuteTheRecipe { Thread.sleep(200);//等待写入完成 - //一直等待下料完成 否则就一直等待 40s超时 for (Map.Entry entry : formulation.entrySet()) { BPA_SILOS silos = entry.getKey(); - - String name = "料仓" + silos.num + "下料完成"; - ExecuteTheRecipe.showlog( "等待:"+name); - - final boolean[] IsComplete = {false}; - long a = System.currentTimeMillis(); - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * whileTime) { - break; - } else { - Object sb = ReadPLC(name);// ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog( "正常等待反馈信号结束"); - } - } - Thread.sleep(100);//10 *6 - } - ExecuteTheRecipe.showlog( name); - ToastUtils.info(name); + ThreadWhile("料仓" + silos.num + "下料完成"); } - if (val > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); } } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); @@ -963,11 +802,10 @@ public class ExecuteTheRecipe { for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); - ToastUtils.info("工序:" + key + "," + value); + ExecuteTheRecipe.showlog("工序:" + key + "," + value); if (key.contains("(秒)") && !IsForcedEnd) { int val = Integer.parseInt(value); ThreadDelay(val); - //Thread.sleep(val * 1000); } } } catch (Exception ex) { @@ -982,7 +820,6 @@ public class ExecuteTheRecipe { */ private static void Write_PLC_Outdishes(HashMap data) { try { - ToastUtils.info("准备出菜!"); ExecuteTheRecipe.showlog("准备出菜!"); //先延迟 @@ -994,34 +831,19 @@ public class ExecuteTheRecipe { int val = Integer.parseInt(value); if (all_list.size() > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); } } } ExecuteTheRecipe.WritePLC("搅拌", false, null); ExecuteTheRecipe.WritePLC("加热", false, null); + ExecuteTheRecipe.showlog("关闭搅拌、关闭加热!"); + BottomClick1("出菜"); //一直等待机器移动到该位置,否则就一直等待 6s超时 - String name = "出餐启动反馈"; - ExecuteTheRecipe.showlog("等待:出餐启动反馈"); + ThreadWhile3("出餐启动反馈", 5); - final boolean[] IsComplete = {false}; - long a = System.currentTimeMillis(); - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * (whileTime * 3)) { - break; - } else { - Object sb = ReadPLC(name);//ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog( "正常等待反馈信号结束"); - } - } - Thread.sleep(100);//10 *6 - } - ToastUtils.info("出菜完成,锅体准备回到原位!"); ExecuteTheRecipe.showlog("出菜完成,锅体准备回到原位!"); } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); @@ -1035,8 +857,8 @@ public class ExecuteTheRecipe { */ private static void Write_PLC_CleanPan(HashMap data) { try { - ToastUtils.info("准备清洗!"); ExecuteTheRecipe.showlog("准备清洗!"); + //先延迟 for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); @@ -1045,36 +867,19 @@ public class ExecuteTheRecipe { if (key.contains("(秒)") && !IsForcedEnd) { int val = Integer.parseInt(value); ThreadDelay(val); - //Thread.sleep(val * 1000); } } + //复位反馈信号 + ExecuteTheRecipe.WritePLC("炒锅清洗反馈", false, null); - - //一直等待机器移动到该位置,否则就一直等待 6s超时 - String name = "炒锅清洗反馈"; - ExecuteTheRecipe.WritePLC(name,false,null); - + //开始清洗 BottomClick1("炒锅清洗"); - ExecuteTheRecipe.showlog("等待:炒锅清洗反馈!"); - final boolean[] IsComplete = {false}; - long a = System.currentTimeMillis(); - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * (whileTime * 5)) { - break; - } else { - Object sb = ReadPLC(name);//ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog( "正常等待反馈信号结束"); + //等待清洗完成 + ThreadWhile3("炒锅清洗反馈", 5); - } - } - Thread.sleep(100);//10 *6 - } ExecuteTheRecipe.showlog("炒锅清洗完成!"); - ToastUtils.info("炒锅清洗完成!"); } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); } @@ -1092,7 +897,7 @@ public class ExecuteTheRecipe { try { //是否手动 boolean ishand = true; - ToastUtils.info("准备倒入主料!"); + ExecuteTheRecipe.showlog("准备倒入主料!"); //region 判断是否手动 if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) { @@ -1126,7 +931,7 @@ public class ExecuteTheRecipe { zl = value; } } - ToastUtils.info("工序:手动投料," + name + "," + zl); + ExecuteTheRecipe.showlog("工序:手动投料," + name + "," + zl); String title = "手动投料-温馨提示!"; String message = "客官请投入主料,[" + name + "]重量" + zl + "g,投入后点击[确定]继续流程!"; ExecuteTheRecipe.WritePLC("暂停开关", true, null); @@ -1138,7 +943,6 @@ public class ExecuteTheRecipe { @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) { @@ -1146,7 +950,6 @@ public class ExecuteTheRecipe { dialog.dismiss(); } }).create(com.qmuiteam.qmui.R.style.QMUI_Dialog).show(); - } catch (Exception e) { } @@ -1158,7 +961,7 @@ public class ExecuteTheRecipe { Thread.sleep(100);//10 *6 } ExecuteTheRecipe.WritePLC("暂停开关", false, null); - ToastUtils.info("确定完成,继续制作!"); + ExecuteTheRecipe.showlog("确定完成,继续制作!"); } else { //自动投料 String writeValue = "1号位"; @@ -1177,39 +980,23 @@ public class ExecuteTheRecipe { //2.给倒菜启动 BottomClick1("主料" + writeValue); - String name = writeValue + "倒菜完成"; - final boolean[] IsComplete = {false}; - long a = System.currentTimeMillis(); - while (!IsComplete[0] && !IsForcedEnd) { - if ((System.currentTimeMillis() - a) > 1000 * whileTime) { - break; - } else { - Object sb = ReadPLC(name);// ListeningValue.get(name); - if (sb != null) { - IsComplete[0] = (boolean) (sb); - } - } - Thread.sleep(100);//10 *6 - } - ToastUtils.info("主料倒入完成,继续制作!"); + ThreadWhile(writeValue + "倒菜完成"); } - Log.d("倒菜", "倒菜完成了"); if (IsMoveYiHaoWei()) { WriteMainPLC("炒锅投主料完成", true, null); } //判断炒制位置 - String czwz="炒菜位1"; + String czwz = "炒菜位1"; for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.contains("炒制位置")) { - czwz=value; + czwz = value; } } - BPA_GOODSRECIPE data3 = Get位置("高速", czwz); - ExecuteOperationSteps(data3.processname, data3.processvalue); + Make位置(czwz); //判断是否有烹饪时间 int val = 0; @@ -1222,12 +1009,7 @@ public class ExecuteTheRecipe { } if (val > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); } - - Log.d("烹饪时间", "烹饪时间完成了"); - - } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); } @@ -1242,7 +1024,7 @@ public class ExecuteTheRecipe { try { //是否手动 boolean ishand = true; - ToastUtils.info("准备倒入主料!"); + ExecuteTheRecipe.showlog("准备倒入主料!"); //region 判断是否手动 if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) { @@ -1276,7 +1058,7 @@ public class ExecuteTheRecipe { zl = value; } } - ToastUtils.info("工序:手动投料," + name + "," + zl); + ExecuteTheRecipe.showlog("工序:手动投料," + name + "," + zl); String title = "手动投料-温馨提示!"; String message = "客官请投入主料,[" + name + "]重量" + zl + "g,投入后点击[确定]继续流程!"; ExecuteTheRecipe.WritePLC("暂停开关", true, null); @@ -1308,7 +1090,7 @@ public class ExecuteTheRecipe { Thread.sleep(100);//10 *6 } ExecuteTheRecipe.WritePLC("暂停开关", false, null); - ToastUtils.info("确定完成,继续制作!"); + ExecuteTheRecipe.showlog("确定完成,继续制作!"); } else { //自动投料 String writeValue = "1号位"; @@ -1343,23 +1125,22 @@ public class ExecuteTheRecipe { ExecuteTheRecipe.WritePLC("加热", true, null); }//再次释放加热 } - Log.d("倒菜", "倒菜完成了"); + if (IsMoveYiHaoWei()) { WriteMainPLC("炒锅投主料完成", true, null); } //判断炒制位置 - String czwz="炒菜位1"; + String czwz = "炒菜位1"; for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.contains("炒制位置")) { - czwz=value; + czwz = value; } } - BPA_GOODSRECIPE data3 = Get位置("高速", czwz); - ExecuteOperationSteps(data3.processname, data3.processvalue); + Make位置(czwz); //判断是否有烹饪时间 int val = 0; @@ -1372,12 +1153,7 @@ public class ExecuteTheRecipe { } if (val > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); } - - Log.d("烹饪时间", "烹饪时间完成了"); - - } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); } @@ -1432,20 +1208,18 @@ public class ExecuteTheRecipe { }//再次释放加热 //判断炒制位置 - String czwz="炒菜位1"; + String czwz = "炒菜位1"; for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.contains("炒制位置")) { - czwz=value; + czwz = value; } } - BPA_GOODSRECIPE data3 = Get位置("高速", czwz); - ExecuteOperationSteps(data3.processname, data3.processvalue); + Make位置(czwz); if (val > 0 && !IsForcedEnd) { ThreadDelay(val); - //Thread.sleep(val * 1000); } } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); @@ -1459,7 +1233,7 @@ public class ExecuteTheRecipe { */ private static void Write_PLC_MainOutdishes(HashMap data) { try { - ToastUtils.info("准备出菜!"); + ExecuteTheRecipe.showlog("准备出菜!"); //先延迟 for (HashMap.Entry entry : data.entrySet()) { String key = entry.getKey(); @@ -1469,11 +1243,9 @@ public class ExecuteTheRecipe { int val = Integer.parseInt(value); if (all_list.size() > 0) { ThreadDelay(val); - //Thread.sleep(val * 1000); } } } - //ExecuteTheRecipe.WritePLC("搅拌", false, null); ExecuteTheRecipe.WritePLC("加热", false, null); WriteMainPLC("炒锅出餐完成", false, null); @@ -1518,7 +1290,7 @@ public class ExecuteTheRecipe { Thread.sleep(100);//10 *6 } WriteMainPLC("炒锅出餐完成", true, null); - ToastUtils.info("出菜完成,锅体准备回到原位!"); + ExecuteTheRecipe.showlog("出菜完成,锅体准备回到原位!"); } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); } @@ -1642,6 +1414,16 @@ public class ExecuteTheRecipe { ExecuteTheRecipe.WritePLC("料仓1校准开关", false, null);//默认校准时间5秒 ExecuteTheRecipe.WritePLC("料仓2校准开关", false, null);//默认校准时间5秒 ExecuteTheRecipe.WritePLC("料仓3校准开关", false, null);//默认校准时间5秒 + + //读取版本号 + ModbusTcpServer.get().ReadInt("VD1100", 1, val -> { + PlcVersion= String.valueOf(val[0]); + if(NotifyVersionNumUpdates!=null) + { + NotifyVersionNumUpdates.Run(); + } + }); + } catch (InterruptedException e) { ToastUtils.info("异常信息:" + e.getMessage()); } @@ -1770,6 +1552,9 @@ public class ExecuteTheRecipe { } else if (plcaddress.address.toUpperCase().startsWith("VW"))//short { ModbusTcpServer.get().WriteShort(plcaddress.address, Short.parseShort(value.toString()), callback); + } else if (plcaddress.address.toUpperCase().startsWith("VR"))//float + { + ModbusTcpServer.get().WriteFloat(plcaddress.address, Float.parseFloat(value.toString()), callback); } } } @@ -1807,6 +1592,11 @@ public class ExecuteTheRecipe { ModbusTcpServer.get().ReadShort(plcaddress.address, 1, val -> { ReturnsVariable[0] = val[0]; }); + }else if (plcaddress.address.toUpperCase().startsWith("VR"))//float + { + ModbusTcpServer.get().ReadFloat(plcaddress.address, 1, val -> { + ReturnsVariable[0] = val[0]; + }); } } } @@ -2093,6 +1883,15 @@ public class ExecuteTheRecipe { //region 获取基础挡位变量 + /** + * 执行位置 + * + * @param name + */ + public static void Make位置(String name) { + ExecuteOperationSteps(Get位置("高速", name).processname, Get位置("高速", name).processvalue); + } + /** * 获取位置 * @@ -2143,7 +1942,7 @@ public class ExecuteTheRecipe { * @param delay */ public static void ThreadDelay(int delay) { - ExecuteTheRecipe.showlog( "工序线程等待-------时长:"+delay+"秒,请耐心等待,开始计时!"); + ExecuteTheRecipe.showlog("工序线程等待-------时长:" + delay + "秒,请耐心等待,开始计时!"); long startTime = System.currentTimeMillis(); while ((System.currentTimeMillis() - startTime) <= (delay * 1000) && !IsForcedEnd) // @@ -2156,17 +1955,80 @@ public class ExecuteTheRecipe { long endTime = System.currentTimeMillis(); //结束时间 int time = (int) ((endTime - startTime) / 1000); - ExecuteTheRecipe.showlog( "工序线程等待结束-------总耗时:"+time); + ExecuteTheRecipe.showlog("工序线程等待结束-------总耗时:" + time); + } + + /** + * 线程等待 + * + * @param name + */ + public static void ThreadWhile(String name) { + //"炒菜位1反馈"; + final boolean[] IsComplete = {false}; + long a = System.currentTimeMillis(); + ExecuteTheRecipe.showlog(name + ",等待中"); + while (!IsComplete[0] && !IsForcedEnd) { + if ((System.currentTimeMillis() - a) > 1000 * whileTime) { + ExecuteTheRecipe.showlog(name + ",异常超时退出!"); + break; + } else { + Object sb = ReadPLC(name);//ListeningValue.get(name); + if (sb != null) { + IsComplete[0] = (boolean) (sb); + ExecuteTheRecipe.showlog(name + ",接收到信号!"); + } + } + try { + Thread.sleep(100);//10 *6 + } catch (InterruptedException e) { + IsComplete[0] = true; + ExecuteTheRecipe.showlog(name + ",异常退出!" + e.getMessage()); + } + } + ExecuteTheRecipe.showlog(name + ",等待结束!"); + } + + /** + * 线程等待 + * + * @param name + */ + public static void ThreadWhile3(String name, int k) { + //"炒菜位1反馈"; + final boolean[] IsComplete = {false}; + long a = System.currentTimeMillis(); + ExecuteTheRecipe.showlog(name + ",等待中"); + while (!IsComplete[0] && !IsForcedEnd) { + if ((System.currentTimeMillis() - a) > 1000 * whileTime * k) { + ExecuteTheRecipe.showlog(name + ",异常超时退出!"); + break; + } else { + Object sb = ReadPLC(name);//ListeningValue.get(name); + if (sb != null) { + IsComplete[0] = (boolean) (sb); + ExecuteTheRecipe.showlog(name + ",接收到信号!"); + } + } + try { + Thread.sleep(100);//10 *6 + } catch (InterruptedException e) { + IsComplete[0] = true; + ExecuteTheRecipe.showlog(name + ",异常退出!" + e.getMessage()); + } + } + ExecuteTheRecipe.showlog(name + ",等待结束!"); } //endregion //region 显示日志 + /** * 显示日志 */ - public static void showlog(String msg) - { + public static void showlog(String msg) { Log.e("hbl", msg); + ToastUtils.info(msg); } //endregion } 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 62fee614..de68c40a 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 @@ -1374,6 +1374,13 @@ public class ConfigName { //endregion + //region + /** + * 手动投料是否关闭火力 + */ + public String WhetherManualFeedingSuspended="否"; + //endregion + //region 计数累计 /** * 锅口朝向次数 diff --git a/app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java b/app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java index 4470bce6..e776f9fa 100644 --- a/app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java +++ b/app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java @@ -466,7 +466,7 @@ public class ModbusTcpServer { int add = GetAddress(Address); if (add < 0) return; try { - ReadHoldingRegistersResponse res = ModbusTcpHelper.get().syncReadHoldingRegisters(1, add, length); + ReadHoldingRegistersResponse res = ModbusTcpHelper.get().syncReadHoldingRegisters(1, add, length*2); byte[] data = res.getData(); float[] tempValues = new float[length]; for (int i = 0; i < length; i++) { @@ -474,7 +474,7 @@ public class ModbusTcpServer { for (int m = 0; m < 4; m++) { tempData[m] = data[i * 4 + m]; } - tempValues[i] = BytesToFloat(tempData, DataFormat.ABCD); + tempValues[i] = BytesToFloat(tempData, DataFormat.BADC); } if (tempValues.length == length) { if (callback != null) callback.onSuccess(tempValues); @@ -587,7 +587,9 @@ public class ModbusTcpServer { int add = GetAddress(Address); if (add < 0) return; int intBits = Float.floatToRawIntBits(Value); - short[] send = new short[]{(short) ((intBits >> 16) & 0xffff), (short) (intBits & 0xffff)}; + + short[] send = IntToShorts(intBits); + // short[] send = new short[]{(short) ((intBits >> 16) & 0xffff), (short) (intBits & 0xffff)}; try { ModbusTcpHelper.get().syncWriteRegisters(1, add, send); diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java index d26a1b26..fa0c06fa 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java @@ -59,10 +59,16 @@ public class SystemSystemsetFragment extends BaseFragment { @BindView(R.id.HuoLi) Spinner HuoLi; + @BindView(R.id.isStop) + Spinner isStop; + + @BindView(R.id.edittext_wd) EditText edittext_wd; ArrayList editTextLists = new ArrayList<>(); + + Map material_map_yes_no = new LinkedHashMap<>(); Map material_map = new LinkedHashMap<>(); Map material_map_vis = new LinkedHashMap<>(); @@ -118,6 +124,10 @@ public class SystemSystemsetFragment extends BaseFragment { material_map.put("测试环境", 1); material_map.put("正式环境", 2); + material_map_yes_no.put("是", 0); + material_map_yes_no.put("否", 1); + + for (int i = 0; i < ConfigName.getInstance().versionSelectionValues.length; i++) { material_map_vis.put(ConfigName.getInstance().versionSelectionValues[i], i); } @@ -131,6 +141,11 @@ public class SystemSystemsetFragment extends BaseFragment { adapter1.setDropDownViewResource(R.layout.spinner_dropdown_item); versionselection.setAdapter(adapter1); + ArrayAdapter adapter11 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map_yes_no.keySet())); + adapter11.setDropDownViewResource(R.layout.spinner_dropdown_item); + isStop.setAdapter(adapter11); + isStop.setSelection(material_map_yes_no.get(ConfigName.getInstance().WhetherManualFeedingSuspended)); + ArrayAdapter adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(ConfigName.getInstance().HeatingGearL.keySet())); adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); @@ -203,6 +218,22 @@ public class SystemSystemsetFragment extends BaseFragment { } }); + isStop.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() { + @Override + /*public void onItemSelected(AdapterView parent, View view, int position, long id) { + + }*/ + public void onItemSelected(AdapterView arg0, View arg1, int arg2, long arg3) { + ConfigName.getInstance().WhetherManualFeedingSuspended=isStop.getSelectedItem().toString(); + ConfigData.getInstance().SavePZ(); + } + + @Override + public void onNothingSelected(AdapterView parent) { + + } + }); + } @OnClick({R.id.StartButton}) @@ -279,6 +310,8 @@ public class SystemSystemsetFragment extends BaseFragment { ConfigName.getInstance().HuoLi=HuoLi.getSelectedItem().toString(); + ConfigName.getInstance().WhetherManualFeedingSuspended=isStop.getSelectedItem().toString(); + if(!edittext_wd.getText().toString().isEmpty()) { ConfigName.getInstance().MaxTemp=Integer.parseInt(edittext_wd.getText().toString()); diff --git a/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java b/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java index 3dcfc6e4..0980d378 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java @@ -20,12 +20,14 @@ import android.widget.TextView; import com.allen.library.SuperTextView; import com.bonait.bnframework.R; import com.bonait.bnframework.business.ConfigData; +import com.bonait.bnframework.business.ExecuteTheRecipe; import com.bonait.bnframework.common.base.BaseFragment; import com.bonait.bnframework.common.constant.ConfigName; import com.bonait.bnframework.common.constant.Constants; import com.bonait.bnframework.common.db.QueryDB; import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; import com.bonait.bnframework.common.db.mode.BPA_USER; +import com.bonait.bnframework.common.helper.I.IRun; import com.bonait.bnframework.common.utils.AlertDialogUtils; import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.common.utils.UpdateAppUtils; @@ -125,7 +127,19 @@ public class MyFragment extends BaseFragment { } private void initView() { initData(ConfigName.getInstance().user); - stvUpdate.setRightString(ConfigName.getInstance().Version); + stvUpdate.setRightString(ConfigName.getInstance().Version+"|"+ ExecuteTheRecipe.PlcVersion); + + ExecuteTheRecipe.NotifyVersionNumUpdates=new IRun() { + @Override + public void Run() { + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + stvUpdate.setRightString(ConfigName.getInstance().Version+"|"+ ExecuteTheRecipe.PlcVersion); + } + }); + } + }; /* * 版本更新,点击事件 * */ diff --git a/app/src/main/res/layout/fragment_system_systemset.xml b/app/src/main/res/layout/fragment_system_systemset.xml index c3e36454..aabda492 100644 --- a/app/src/main/res/layout/fragment_system_systemset.xml +++ b/app/src/main/res/layout/fragment_system_systemset.xml @@ -241,6 +241,19 @@ android:padding="3dp" android:textSize="12dp" android:text="1"/> + + +