Browse Source

修改plc恢复出厂设置问题

授权码生成工具
liup 3 months ago
parent
commit
34a7deb239
4 changed files with 34 additions and 9 deletions
  1. +8
    -2
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  2. +6
    -1
      app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java
  3. +19
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java
  4. +1
    -1
      app/src/main/res/layout/fragment_cloud_goods.xml

+ 8
- 2
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java View File

@@ -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));


+ 6
- 1
app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java View File

@@ -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();
}


+ 19
- 5
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java View File

@@ -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<BPA_PLCADDRESS> 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;


+ 1
- 1
app/src/main/res/layout/fragment_cloud_goods.xml View File

@@ -24,7 +24,7 @@

<Button
android:id="@+id/btn_synchronized_data"
android:layout_width="@dimen/dp_250"
android:layout_width="@dimen/dp_280"
android:layout_height="@dimen/dp_70"
android:textSize="@dimen/sp_32"
android:textColor="@color/white"


Loading…
Cancel
Save