From 34a7deb239d65034340e08ca716eebb6dadaf819 Mon Sep 17 00:00:00 2001 From: liup <1454939542@qq.com> Date: Fri, 13 Sep 2024 14:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9plc=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E5=87=BA=E5=8E=82=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/ConfigName.java | 10 ++++++-- .../bnframework/common/helper/SdCart.java | 7 +++++- .../from/fragment/SystemCsPLCFragment.java | 24 +++++++++++++++---- .../main/res/layout/fragment_cloud_goods.xml | 2 +- 4 files changed, 34 insertions(+), 9 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 157e4da1..1f92607a 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 @@ -388,6 +388,7 @@ public class ConfigName { //位置动作 add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); + add(new Res_PLCADDRESS("维护位", "M20.0", 0, 1)); add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); @@ -1149,7 +1150,8 @@ public class ConfigName { put("一直反转","Negative"); put("原点位","Origin"); put("出餐启动","Pour-start"); - put("倒菜位","Pour"); + put("倒菜位","Maintenance"); + put("维护位","Pour"); put("抽料位","Extract"); put("清洗位","Clean"); put("炒菜位1","Fry1"); @@ -1187,8 +1189,9 @@ public class ConfigName { put("Origin","原点位"); put("Pour-start","出餐启动"); put("Pour","倒菜位"); + put("Maintenance","维护位"); put("Extract","抽料位"); - put("Clean","清洗位"); + put("Clean-pos","清洗位"); put("Fry1","炒菜位1"); put("Fry2","炒菜位2"); put("Fry3","炒菜位3"); @@ -1303,6 +1306,8 @@ public class ConfigName { //位置动作 add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); + add(new Res_PLCADDRESS("维护位", "M20.0", 0, 1)); + add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); @@ -1589,6 +1594,7 @@ public class ConfigName { //位置动作 add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); + add(new Res_PLCADDRESS("维护位", "M20.0", 0, 1)); add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); diff --git a/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java b/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java index 98953666..c090ace6 100644 --- a/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java +++ b/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java @@ -80,10 +80,15 @@ public class SdCart { File file2 = new File(dbPath); if(file2.exists()){ copyDirectory(dbPath,ConfigName.getInstance().appResRoot); + }else{ + //1.复制本地文件到SD卡 +// copyFilesFassets(ConfigName.getInstance().dishesCon, ConfigName.getInstance().dbPath); + //2.创建数据库结构 + DBHelper.getInstance(ConfigName.getInstance().dishesCon).CreateTables(); } }else { //1.复制本地文件到SD卡 - copyFilesFassets(ConfigName.getInstance().dishesCon, ConfigName.getInstance().dbPath); +// copyFilesFassets(ConfigName.getInstance().dishesCon, ConfigName.getInstance().dbPath); //2.创建数据库结构 DBHelper.getInstance(ConfigName.getInstance().dishesCon).CreateTables(); } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java index 049ec9b2..4bfc1d93 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java @@ -28,6 +28,7 @@ import com.bonait.bnframework.common.utils.NetworkUtils; import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.modules.home.fragment.mode.fragment_gx; import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; +import com.bonait.bnframework.ui.widget.NewToastUtil; import com.orhanobut.logger.Logger; import com.qmuiteam.qmui.widget.QMUILoadingView; import com.qmuiteam.qmui.widget.dialog.QMUIDialog; @@ -81,14 +82,16 @@ public class SystemCsPLCFragment extends BaseFragment { @Override public void run() { try { + plcview.removeAllViews(); ArrayList arrayList = QueryDB.GetPlcaddressALL(); for (BPA_PLCADDRESS item : arrayList) { fragment_plc gongxu = new fragment_plc(context, null, item); plcview.addView(gongxu); } + load_view.setVisibility(View.INVISIBLE); } catch (Exception e) { }finally { - load_view.setVisibility(View.INVISIBLE); + } } }); @@ -121,10 +124,21 @@ public class SystemCsPLCFragment extends BaseFragment { @Override public void onClick(QMUIDialog dialog, int index) { load_view.setVisibility(View.VISIBLE); - ConfigData.getInstance().RevertPLC(); - Init(); - ToastUtils.info("初始化成功!","Successful initialization!"); - dialog.dismiss(); + try{ + NewToastUtil.getInstance().showToast("正在初始化,请等待!"); + ConfigData.getInstance().RevertPLC(); +// Init(); + Activity activity = findActivity(context); + if (activity != null) { + activity.finish(); + } + NewToastUtil.getInstance().showToast("初始化成功,请重新进入!"); + }catch (Exception e){ + + }finally { + dialog.dismiss(); + } + } }); break; diff --git a/app/src/main/res/layout/fragment_cloud_goods.xml b/app/src/main/res/layout/fragment_cloud_goods.xml index ee28ceea..dc39efc8 100644 --- a/app/src/main/res/layout/fragment_cloud_goods.xml +++ b/app/src/main/res/layout/fragment_cloud_goods.xml @@ -24,7 +24,7 @@