Browse Source

lyw 上传

授权码生成工具
lyw 4 months ago
parent
commit
b2fc6e6821
63 changed files with 365 additions and 248 deletions
  1. +7
    -7
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  2. +13
    -13
      app/src/main/java/com/bonait/bnframework/business/ExecuteTest.java
  3. +9
    -9
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  4. +2
    -2
      app/src/main/java/com/bonait/bnframework/business/UpDataModel.java
  5. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java
  6. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/base/BaseFragment.java
  7. +6
    -8
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  8. +2
    -2
      app/src/main/java/com/bonait/bnframework/common/helper/BatchSync.java
  9. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/http/callback/files/FileProgressDialogCallBack.java
  10. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/http/callback/files2/FileProgressDialogCallBack2.java
  11. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/iot/AliyunIOTManager.java
  12. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpMainServer.java
  13. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java
  14. +11
    -0
      app/src/main/java/com/bonait/bnframework/common/utils/ToastUtils.java
  15. +2
    -2
      app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java
  16. +6
    -6
      app/src/main/java/com/bonait/bnframework/common/view/AddUserDialog.java
  17. +6
    -6
      app/src/main/java/com/bonait/bnframework/common/view/GoodEditDialog.java
  18. +4
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationNewActivity.java
  19. +6
    -6
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/lc_adapter.java
  20. +9
    -9
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  21. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home3Fragment.java
  22. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentPR.java
  23. +5
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java
  24. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/BunkerSetupActivity.java
  25. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CookingActivity.java
  26. +3
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CookingSimulatedActivity.java
  27. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java
  28. +3
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/Cpxz1Activity.java
  29. +3
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpxzActivity.java
  30. +3
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java
  31. +22
    -13
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyActivity.java
  32. +33
    -16
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyUpdate1Activity.java
  33. +14
    -13
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyUpdateActivity.java
  34. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/ImageChooseActivity.java
  35. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsMonitorFragment.java
  36. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java
  37. +15
    -15
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSeasoningsetFragment.java
  38. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java
  39. +3
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetGKCXFragment.java
  40. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZ1Fragment.java
  41. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZFragment.java
  42. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/systeminternetfragment.java
  43. +32
    -10
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_message.java
  44. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_plc.java
  45. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_plc_control.java
  46. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_silos_cl.java
  47. +6
    -21
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/imagebuttom.java
  48. +4
    -4
      app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java
  49. +3
    -3
      app/src/main/java/com/bonait/bnframework/modules/mine/fragment/UserActivity.java
  50. +2
    -2
      app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java
  51. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/dialog/EditGoodsDialog.java
  52. +8
    -8
      app/src/main/res/layout/activity_bunkersetup.xml
  53. +2
    -0
      app/src/main/res/layout/activity_cooking.xml
  54. +1
    -1
      app/src/main/res/layout/fragment_home_foods.xml
  55. +65
    -17
      app/src/main/res/layout/item/layout/dialog_silos_message.xml
  56. +1
    -1
      app/src/main/res/layout/item/layout/item_huolikongzhi1.xml
  57. BIN
     
  58. BIN
     
  59. BIN
     
  60. BIN
     
  61. +13
    -0
      app/src/main/res/values-en/strings.xml
  62. +0
    -3
      app/src/main/res/values/attrs.xml
  63. +13
    -0
      app/src/main/res/values/strings.xml

+ 7
- 7
app/src/main/java/com/bonait/bnframework/business/ConfigData.java View File

@@ -404,7 +404,7 @@ public class ConfigData {

@Override
public void onError(Response<String> val){
ToastUtils.info("获取主控数据失败!");
ToastUtils.info("获取主控数据失败!","Failed to obtain the main control data!");
}
});
}
@@ -441,12 +441,12 @@ public class ConfigData {
DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_PROCESSModel.class,null);
DBListDataUtil.addPROCESSModelList(rd.processModels);

ToastUtils.info("接收主控数据成功!");
ToastUtils.info("接收主控数据成功!","The master control data is received successfully!");
EventBus.getDefault().post(new DownGoodsEvent());
return true;
}catch (Exception ex){
// MessageLog.ShowError("解析数据失败!,"+ex.getMessage());
ToastUtils.info("解析数据失败!,"+ex.getMessage());
ToastUtils.info("解析数据失败!,"+ex.getMessage(),"Parsing failure!,"+ex.getMessage());
return false;
}
}
@@ -864,7 +864,7 @@ public class ConfigData {
QueryDB.AddGoodsSrecipe(item);
}
}
ToastUtils.info("下载菜品成功!!!");
ToastUtils.info("下载菜品成功!!!","Download dishes successfully!!!");

if (isSX) {
MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good");
@@ -1115,7 +1115,7 @@ public class ConfigData {
isSuceess = true;
} catch (Exception ex) {
isSuceess = true;
ToastUtils.info("上传菜品异常:" + ex.getMessage());
ToastUtils.info("上传菜品异常:" + ex.getMessage(),"Abnormal uploading of dishes:"+ ex.getMessage());
}


@@ -1132,7 +1132,7 @@ public class ConfigData {
public void onSuccess(Response<ResAPI<Boolean>> response) {
ResAPI<Boolean> allDataResAPI = response.body();
if (allDataResAPI.succeeded) {
ToastUtils.info("上传菜品成功!!!");
ToastUtils.info("上传菜品成功!!!","Uploaded dishes successfully!!!");
MessageManager.getInstance().sendMessage(MessageName.ScGood, "GoodUpdate");
editDialog.dismiss();
} else {
@@ -1141,7 +1141,7 @@ public class ConfigData {
}
});
} catch (Exception ex) {
ToastUtils.info("上传菜品异常:" + ex.getMessage());
ToastUtils.info("上传菜品异常:" + ex.getMessage(),"Abnormal uploading of dishes:"+ ex.getMessage());
}
}
}


+ 13
- 13
app/src/main/java/com/bonait/bnframework/business/ExecuteTest.java View File

@@ -42,7 +42,7 @@ public class ExecuteTest {
* 设置强制结束
*/
public static void SetForcedEnd() {
ToastUtils.info("客官,小菠萝正在强制结束,请耐心等候!!!");
ToastUtils.info("客官,小菠萝正在强制结束,请耐心等候!!!","Forcing the end, please wait...");
IsForcedEnd = true;
}

@@ -127,7 +127,7 @@ public class ExecuteTest {
public static void Write_PLC_Material(int silos, int val) {
try {
if(IsForcedEnd){ return;}
ToastUtils.info("准备写入PLC仓号需求:" + silos + "," + val );
ToastUtils.info("准备写入PLC仓号需求:" + silos + "," + val ,"Write PLC warehouse number requirements:" + silos + "," + val);

String name = "料仓" + silos + "下料完成";
ExecuteTheRecipe.WritePLC(name, false, null);
@@ -175,7 +175,7 @@ public class ExecuteTest {
if (key.contains("(秒)")) {
val = Integer.parseInt(value);
} else {
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
int writeValue = GetMXValue(key, value);
ExecuteTheRecipe.WritePLC(key, writeValue, new IWriteCallBack() {
@Override
@@ -227,7 +227,7 @@ public class ExecuteTest {
String key = entry.getKey();
String value = entry.getValue();
if (!key.contains("(秒)") && !key.contains("速度")) {
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value) );

//原点位,等待机器移动倒响应位置
BottomClick1(value);
@@ -249,7 +249,7 @@ public class ExecuteTest {
}
Log.e("等待反馈", name + ",等待结束");

ToastUtils.info("炒锅到达" + value + ",继续制作!!!");
ToastUtils.info("炒锅到达" + value + ",继续制作!!!","Pot arrive " + ConfigName.getInstance().getString_en(value) + ",Continue production!!!");
}
}

@@ -271,7 +271,7 @@ public class ExecuteTest {
try {
//是否手动
boolean ishand = true;
ToastUtils.info("准备倒入主料!");
ToastUtils.info("准备倒入主料!","Prepare to pour in the main ingredient!");

//region 判断是否手动
if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) {
@@ -341,7 +341,7 @@ public class ExecuteTest {
}
Thread.sleep(100);//10 *6
}
ToastUtils.info("主料倒入完成,继续制作!");
ToastUtils.info("主料倒入完成,继续制作!","Main ingredient pouring finished, continue production!");

}

@@ -421,7 +421,7 @@ public class ExecuteTest {
if (key.contains("(秒)")) {
val = Integer.parseInt(value);
} else {
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:"+ ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
int writeValue = GetMXValue(key, value);
//写加热挡位
ExecuteTheRecipe.WritePLC(key, writeValue, null);
@@ -468,7 +468,7 @@ public class ExecuteTest {
public void onFailure(String ErrorMsg) {
}
});
ToastUtils.info("火力按钮点击,当前级别:" + data);
ToastUtils.info("火力按钮点击,当前级别:" + data,"Fire button click, current level:" + data);

} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
@@ -485,7 +485,7 @@ public class ExecuteTest {
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
if (key.contains("(秒)") && !IsForcedEnd) {
int val = Integer.parseInt(value);
ThreadDelay(val);
@@ -504,12 +504,12 @@ public class ExecuteTest {
*/
private static void Write_PLC_CleanPan(HashMap<String, String> data) {
try {
ToastUtils.info("准备清洗!");
ToastUtils.info("准备清洗!","Ready for cleaning!");
//先延迟
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:"+ ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
if (key.contains("(秒)") && !IsForcedEnd) {
int val = Integer.parseInt(value);
ThreadDelay(val);
@@ -539,7 +539,7 @@ public class ExecuteTest {
Thread.sleep(100);//10 *6
}

ToastUtils.info("炒锅清洗完成!");
ToastUtils.info("炒锅清洗完成!","The pot is cleaned!");
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
}


+ 9
- 9
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -125,7 +125,7 @@ public class ExecuteTheRecipe {
* 设置强制结束
*/
public static void SetForcedEnd() {
ToastUtils.info("客官,小菠萝正在强制结束当前炒制菜品,请耐心等候!!!");
ToastUtils.info("客官,小菠萝正在强制结束当前炒制菜品,请耐心等候!!!","Forcing the end of the current dish, please wait...");
IsForcedEnd = true;
}

@@ -479,7 +479,7 @@ public class ExecuteTheRecipe {
if (key.contains("(秒)")) {
val = Integer.parseInt(value);
} else {
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:"+ ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
writeValue = GetMXValue(key, value);
if (ExecuteCurrentOperation != null) {
ExecuteCurrentOperation.Run("搅拌" + "|" + writeValue);
@@ -967,7 +967,7 @@ public class ExecuteTheRecipe {
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
if (key.contains("(秒)")) {
int val = Integer.parseInt(value);
if (all_list.size() > 0 && !IsForcedEnd) {
@@ -1007,7 +1007,7 @@ public class ExecuteTheRecipe {
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
if (key.contains("(秒)") && !IsForcedEnd) {
int val = Integer.parseInt(value);
ThreadDelay(val);
@@ -1433,7 +1433,7 @@ public class ExecuteTheRecipe {
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value) );
if (key.contains("(秒)")) {
int val = Integer.parseInt(value);
if (all_list.size() > 0) {
@@ -1538,10 +1538,10 @@ public class ExecuteTheRecipe {
public static void Write_PLC_YaoQian(MyStatus data) {
try {
if (data == MyStatus.Start) {
ToastUtils.info("点击摇浅按钮");
ToastUtils.info("点击摇浅按钮","Click the shallow button");

} else if (data == MyStatus.Stop) {
ToastUtils.info("点击停摇按钮");
ToastUtils.info("点击停摇按钮","Click the stop roll button");
}
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
@@ -1571,7 +1571,7 @@ public class ExecuteTheRecipe {
public void onFailure(String ErrorMsg) {
}
});
ToastUtils.info("火力按钮点击,当前级别:" + data);
ToastUtils.info("火力按钮点击,当前级别:" + data,"Click the fire button, current level:" + data);

} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
@@ -1620,7 +1620,7 @@ public class ExecuteTheRecipe {
});

} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}).start();


+ 2
- 2
app/src/main/java/com/bonait/bnframework/business/UpDataModel.java View File

@@ -239,7 +239,7 @@ public class UpDataModel {
isSuceess = true;
} catch (Exception ex) {
isSuceess = false;
ToastUtils.info("上传菜品异常:" + ex.getMessage());
ToastUtils.info("上传菜品异常:" + ex.getMessage(),"Abnormal uploading of dishes:" + ex.getMessage());
}
if (isSuceess) {
try {
@@ -262,7 +262,7 @@ public class UpDataModel {
}
}
} catch (Exception ex) {
ToastUtils.info("上传菜品异常:" + ex.getMessage());
ToastUtils.info("上传菜品异常:" + ex.getMessage(),"Abnormal uploading of dishes:" + ex.getMessage());
}
}



+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java View File

@@ -53,7 +53,7 @@ public class BaseActivity extends QMUIActivity implements EasyPermissions.Permis
if (requestCode == Constants.APP_SETTING_DIALOG_REQUEST_CODE) {
//在这儿,你可以再对权限进行检查,从而给出提示,或进行下一步操作
checkPermission();
ToastUtils.info("从设置中返回");
ToastUtils.info("从设置中返回","Return from Set");
}
}



+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/base/BaseFragment.java View File

@@ -43,7 +43,7 @@ public abstract class BaseFragment extends QMUIFragment implements EasyPermissio
if (requestCode == Constants.APP_SETTING_DIALOG_REQUEST_CODE) {
//在这儿,你可以再对权限进行检查,从而给出提示,或进行下一步操作
checkPermission();
ToastUtils.info("从设置中返回");
ToastUtils.info("从设置中返回","Return from Set");
}
}



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

@@ -39,6 +39,12 @@ public class ConfigName {
private ConfigName() {//默认构造函数私有,防止类外直接new创建对象
}

public String getString_en(String key){
if (getInstance().Process_info.get(key)!=null){
key = getInstance().Process_info.get(key);
}
return key;
}
public static synchronized ConfigName getInstance() { //静态同步方法作为唯一的实例对象获取方式
if (mInstance == null) {
mInstance = new ConfigName();
@@ -733,14 +739,6 @@ public class ConfigName {
add(new Res_PLCADDRESS("翻转电机", "VW352", 1, 0));
add(new Res_PLCADDRESS("炒锅", "VW354", 1, 0));
}};
public static String getKeyByValue(ConcurrentHashMap<String, String> map, String value) {
for (Map.Entry<String, String> entry : map.entrySet()) {
if (entry.getValue().equals(value)) {
return entry.getKey(); // 返回第一个找到的键
}
}
return null; // 如果没有找到,返回 null
}
/**
* 大炒自动投料工序模型-中英文资源字典
*/


+ 2
- 2
app/src/main/java/com/bonait/bnframework/common/helper/BatchSync.java View File

@@ -272,7 +272,7 @@ public class BatchSync {
isSuceess = true;
} catch (Exception ex) {
isSuceess = false;
ToastUtils.info("上传菜品异常:" + ex.getMessage());
ToastUtils.info("上传菜品异常:" + ex.getMessage(),"Abnormal uploading of dishes:" + ex.getMessage());
}
if (isSuceess) {
try {
@@ -296,7 +296,7 @@ public class BatchSync {
}
}
} catch (Exception ex) {
ToastUtils.info("上传菜品异常:" + ex.getMessage());
ToastUtils.info("上传菜品异常:" + ex.getMessage(),"Abnormal uploading of dishes:"+ ex.getMessage());
}
}
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/http/callback/files/FileProgressDialogCallBack.java View File

@@ -130,7 +130,7 @@ public abstract class FileProgressDialogCallBack extends FileCallback {
@Override
public void onClick(DialogInterface dialog, int which) {
OkGo.getInstance().cancelTag(context);
ToastUtils.info("已停止下载!");
ToastUtils.info("已停止下载!","Download stop");
dialog.dismiss();
}
});


+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/http/callback/files2/FileProgressDialogCallBack2.java View File

@@ -128,7 +128,7 @@ public abstract class FileProgressDialogCallBack2 extends FileCallback2 {
@Override
public void onClick(DialogInterface dialog, int which) {
OkGo.getInstance().cancelTag(context);
ToastUtils.info("已停止下载!");
ToastUtils.info("已停止下载!","Download stop");
dialog.dismiss();
}
});


+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/iot/AliyunIOTManager.java View File

@@ -120,7 +120,7 @@ public class AliyunIOTManager {
public void run() {
// 同步接口
LinkKit.getInstance().deinit();
ToastUtils.info("关闭IOT成功");
ToastUtils.info("关闭IOT成功","Shut down IOT successfully");
}
}).start();
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpMainServer.java View File

@@ -193,7 +193,7 @@ public class ModbusTcpMainServer {
ModbusTcpMainHelper.get().init(param, new ModbusCallback<ModbusMaster>() {
@Override
public void onSuccess(ModbusMaster modbusMaster) {
ToastUtils.info("设备 " + ConfigName.getInstance().MainAddress + " 连接成功");
ToastUtils.info("设备 " + ConfigName.getInstance().MainAddress + " 连接成功","Device " + ConfigName.getInstance().MainAddress + " is connected successful");

MessageLog.ShowInfo("设备 " + ConfigName.getInstance().MainAddress + " 连接成功");
ConfigName.getInstance().PlcMainIsConnect = true;


+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java View File

@@ -187,7 +187,7 @@ public class ModbusTcpServer {
ModbusTcpHelper.get().init(param, new ModbusCallback<ModbusMaster>() {
@Override
public void onSuccess(ModbusMaster modbusMaster) {
ToastUtils.info("设备 " + ConfigName.getInstance().Address + " 连接成功");
ToastUtils.info("设备 " + ConfigName.getInstance().Address + " 连接成功","Device " + ConfigName.getInstance().Address + " is connected successful");
MessageLog.ShowInfo("设备 " + ConfigName.getInstance().Address + " 连接成功");
ConfigName.getInstance().PlcIsConnect = true;
ConfigData.getInstance().PLC_Init();


+ 11
- 0
app/src/main/java/com/bonait/bnframework/common/utils/ToastUtils.java View File

@@ -22,6 +22,7 @@ import android.widget.Toast;

import com.bonait.bnframework.R;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.common.constant.ConfigName;

/**
* Created by LY on 2019/3/19.
@@ -85,6 +86,16 @@ public class ToastUtils {
info(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show();
}

public static void info(@NonNull String message,String message_en) {
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
message = message_en;
break;
case "zh":
break;
}
info(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show();
}
public static void info(@NonNull String message, int duration) {
info(MainApplication.getContext(), message, duration, true).show();
}


+ 2
- 2
app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java View File

@@ -111,12 +111,12 @@ public class UpdateAppUtils {
{
showUpdateDialog(context);
} else {
ToastUtils.info("当前版本已是最新版本");
ToastUtils.info("当前版本已是最新版本","This is the latest version!");
}

}else
{
ToastUtils.info("服务器没有版本");
ToastUtils.info("服务器没有版本","Server has no version");
}
}
});


+ 6
- 6
app/src/main/java/com/bonait/bnframework/common/view/AddUserDialog.java View File

@@ -180,28 +180,28 @@ public class AddUserDialog extends Dialog {
boolean IsSucees = false;
try {
if (edittext.getText().toString().isEmpty()) {
ToastUtils.info("用户名称不能为空!");
ToastUtils.info("用户名称不能为空!","The user name cannot be empty!");
return false;
}
if (edittext1.getText().toString().isEmpty()) {
ToastUtils.info("账户名称不能为空!");
ToastUtils.info("账户名称不能为空!","The user name cannot be empty!");
return false;
}
if (edittext2.getText().toString().isEmpty()) {
ToastUtils.info("用户密码不能为空!");
ToastUtils.info("用户密码不能为空!","The user password cannot be empty!");
return false;
}
if (edittext3.getText().toString().isEmpty()) {
ToastUtils.info("用户密码不能为空!");
ToastUtils.info("用户密码不能为空!","The user password cannot be empty!");
return false;
}

if (!edittext3.getText().toString().equals(edittext2.getText().toString())) {
ToastUtils.info("两次密码输入不一致!");
ToastUtils.info("两次密码输入不一致!","Two password entries are inconsistent!");
return false;
}
if (edittext4.getText().toString().isEmpty()) {
ToastUtils.info("用户角色不能为空!");
ToastUtils.info("用户角色不能为空!","The user role cannot be empty!");
return false;
}
return true;


+ 6
- 6
app/src/main/java/com/bonait/bnframework/common/view/GoodEditDialog.java View File

@@ -203,32 +203,32 @@ public class GoodEditDialog extends Dialog {
{
if(editsp_cp.getSelectedItem().toString().isEmpty())
{
ToastUtils.info("菜谱必须选择!");
ToastUtils.info("菜谱必须选择!","Recipe must be selected!");
return false;
}
if(editsp_dl.getSelectedItem().toString().isEmpty())
{
ToastUtils.info("大类必须选择!");
ToastUtils.info("大类必须选择!","Class must be selected!");
return false;
}
if(editsp_xl.getSelectedItem().toString().isEmpty())
{
ToastUtils.info("小类必须选择!");
ToastUtils.info("小类必须选择!","Subclasses must be selected!");
return false;
}
if(editsp_dw.getSelectedItem().toString().isEmpty())
{
ToastUtils.info("单位必须选择!");
ToastUtils.info("单位必须选择!","Units must be selected!");
return false;
}
if(editsp_fl.getSelectedItem().toString().isEmpty())
{
ToastUtils.info("配方分类必须选择!");
ToastUtils.info("配方分类必须选择!","Recipe classes must be selected!");
return false;
}
if(editsp_spsx.getSelectedItem().toString().isEmpty())
{
ToastUtils.info("商品属性必须选择!");
ToastUtils.info("商品属性必须选择!","Product attributes must be selected!");
return false;
}
return true;


+ 4
- 4
app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationNewActivity.java View File

@@ -411,7 +411,7 @@ public class BottomNavigationNewActivity extends BaseActivity {
int m = 0;
for (BPA_GOODS_PROCESS_DETAIL item : goodsrecipes) {
while (ExecuteTheRecipe.IsPause) {
ToastUtils.info("客官,当前菜品已暂停炒制!!!");
ToastUtils.info("客官,当前菜品已暂停炒制!!!","Current dishes stop stir-frying!!!");
Thread.sleep(1000);
}
MakeCipe = item;
@@ -458,7 +458,7 @@ public class BottomNavigationNewActivity extends BaseActivity {
onRecordStop();
if (ExecuteTheRecipe.IsForcedEnd)//强制结束
{
ToastUtils.info("客官,当前菜品已强制结束!!!");
ToastUtils.info("客官,当前菜品已强制结束!!!","Current dish has been forced to end!!!");
//初始化
//ExecuteTheRecipe.BottomClick("初始化");
ExecuteTheRecipe.showlog("菜谱【" + goods.name+"-"+ goodsGroup.name + "】已强制结束...");
@@ -478,7 +478,7 @@ public class BottomNavigationNewActivity extends BaseActivity {
}
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}
@@ -594,7 +594,7 @@ public class BottomNavigationNewActivity extends BaseActivity {
}
Thread.sleep(5000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}


+ 6
- 6
app/src/main/java/com/bonait/bnframework/modules/home/adapter/lc_adapter.java View File

@@ -88,7 +88,7 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_g));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"手动开关", true, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg,"Storehouse"+(position+1)+"switch," + finalKg);
}else
{
//关闭
@@ -96,7 +96,7 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_k2));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"手动开关", false, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg,"Storehouse"+(position+1)+"switch," + finalKg);
}
// AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
// @Override
@@ -130,7 +130,7 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_g));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"手动开关", true, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg,"Storehouse"+(position+1)+"switch," + finalKg);
}else
{
//关闭
@@ -138,7 +138,7 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_k2));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"手动开关", false, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg,"Storehouse"+(position+1)+"switch," + finalKg);
}
// AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
// @Override
@@ -172,7 +172,7 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_g));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"手动开关", true, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg,"Storehouse"+(position+1)+"switch," + finalKg);
}else
{
//关闭
@@ -180,7 +180,7 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_k2));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"手动开关", false, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg,"Storehouse"+(position+1)+"switch," + finalKg);
}
// AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
// @Override


+ 9
- 9
app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java View File

@@ -228,7 +228,7 @@ public class Home1Fragment extends BaseFragment {
nifty_slider3.setValue(0, true);

} catch (Exception e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}

@@ -649,7 +649,7 @@ public class Home1Fragment extends BaseFragment {
SetBottonStatus(false);
if (ExecuteTheRecipe.IsForcedEnd)//强制结束
{
ToastUtils.info("客官,当前菜品已强制结束!!!");
ToastUtils.info("客官,当前菜品已强制结束!!!","Current dish has been forced to end");
//初始化
// ExecuteTheRecipe.BottomClick("初始化");
ExecuteTheRecipe.showlog("菜谱【" + good.name +"-"+goodGroup.name+ "】已强制结束...");
@@ -668,7 +668,7 @@ public class Home1Fragment extends BaseFragment {
}
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}
@@ -785,7 +785,7 @@ public class Home1Fragment extends BaseFragment {
}
Thread.sleep(5000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}
@@ -800,7 +800,7 @@ public class Home1Fragment extends BaseFragment {
SxUI();
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}
@@ -1034,7 +1034,7 @@ public class Home1Fragment extends BaseFragment {
switch (view.getId()) {
case R.id.xzcp://选择菜谱按钮点击
skipToActivity(EditGoodsActivity.class);
ToastUtils.info("打开菜谱选择界面");
ToastUtils.info("打开菜谱选择界面","Open the recipes selection screen");
break;
case R.id.startbutton:
if (ExecuteTheRecipe.MakeStatus) {
@@ -1055,7 +1055,7 @@ public class Home1Fragment extends BaseFragment {
});
} else {
if (good == null) {
ToastUtils.info("请先选择一个商品");
ToastUtils.info("请先选择一个商品","Please select a product first");
return;
}

@@ -1196,11 +1196,11 @@ public class Home1Fragment extends BaseFragment {
ExecuteTheRecipe.BottomClick("炒菜位3");
break;
case R.id.chushihua:
ToastUtils.info("点击按钮:初始化");
ToastUtils.info("点击按钮:初始化","Click:Initialize");
ExecuteTheRecipe.BottomClick("初始化");
break;
case R.id.jiting:
ToastUtils.info("点击按钮:急停");
ToastUtils.info("点击按钮:急停","Click:Stop");
ExecuteTheRecipe.BottomClick("停止");
break;
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home3Fragment.java View File

@@ -43,7 +43,7 @@ public class Home3Fragment extends BaseFragment {

@OnClick(R.id.button)
public void onViewClicked() {
ToastUtils.info("我的");
ToastUtils.info("我的","Mine");
}

@Override


+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentPR.java View File

@@ -148,7 +148,7 @@ public class HomeFragmentPR extends BaseFragment {
private void initTopBar() {
mTopBar.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.topbj1));
mTopBar.setTitle("菜谱");
mTopBar.addRightTextButton("设备状态:" + (ConfigName.getInstance().PlcIsConnect ? "已连接" : "未连接"), R.id.status_image);
/*mTopBar.addRightTextButton("设备状态:" + (ConfigName.getInstance().PlcIsConnect ? "已连接" : "未连接"), R.id.status_image);*/
SoftKeyBoardListener.setListener(activity, new SoftKeyBoardListener.OnSoftKeyBoardChangeListener() {
@Override
public void keyBoardShow(int height) {
@@ -168,7 +168,7 @@ public class HomeFragmentPR extends BaseFragment {
@Override
public void run() {
mTopBar.removeAllRightViews();
mTopBar.addRightTextButton("设备状态:" + (ConfigName.getInstance().PlcIsConnect ? "已连接" : "未连接"), R.id.status_image);
/*mTopBar.addRightTextButton("设备状态:" + (ConfigName.getInstance().PlcIsConnect ? "已连接" : "未连接"), R.id.status_image);*/
}
});
Thread.sleep(1000);


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

@@ -377,7 +377,7 @@ public class HomeFragmentSBKZ extends BaseFragment {
}
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}
@@ -398,18 +398,18 @@ public class HomeFragmentSBKZ extends BaseFragment {
// ExecuteTheRecipe.BottomClick("炒锅清洗");
// ToastUtils.warning("自动清洗");
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context);
builder.setTitle("深度清洗抽水用量")
.setPlaceholder("在此输入您的用量")
builder.setTitle(getString(R.string.top_cleantip))
.setPlaceholder(getString(R.string.top_cleaninfo))
.setInputType(InputType.TYPE_CLASS_NUMBER)
.setCanceledOnTouchOutside(false)
.setDefaultText("500")
.addAction("取消", new QMUIDialogAction.ActionListener() {
.addAction(getString(R.string.btn_cancel), new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
dialog.dismiss();
}
})
.addAction("确定", new QMUIDialogAction.ActionListener() {
.addAction(getString(R.string.tip_save_confirm), new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
CharSequence text = builder.getEditText().getText();


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/BunkerSetupActivity.java View File

@@ -170,7 +170,7 @@ public class BunkerSetupActivity extends BaseActivity {
QueryDB.UpdateYL(item.id, item.siloszl);
}
InitData();
ToastUtils.info("补充完成!");
ToastUtils.info("补充完成!","Fill successfully!");
break;
}
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CookingActivity.java View File

@@ -360,7 +360,7 @@ public class CookingActivity extends LinearLayout {
}
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}


+ 3
- 3
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CookingSimulatedActivity.java View File

@@ -322,7 +322,7 @@ public class CookingSimulatedActivity extends BaseActivity {
});
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}
@@ -508,7 +508,7 @@ public class CookingSimulatedActivity extends BaseActivity {
if (key.contains("(秒)")) {
val = Integer.parseInt(value);
} else {
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
int writeValue = ExecuteTheRecipe.GetMXValue(key, value);
runOnUiThread(new Runnable() {
@Override
@@ -554,7 +554,7 @@ public class CookingSimulatedActivity extends BaseActivity {
for (HashMap.Entry<String, String> entry : formulation.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
ToastUtils.info("工序:" + key + "," + value);
ToastUtils.info("工序:" + key + "," + value,"Process:" + ConfigName.getInstance().getString_en(key) + "," + ConfigName.getInstance().getString_en(value));
if (key.contains("(秒)")) {
int val11 = Integer.parseInt(value);
Thread.sleep(val11 * 1000);


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java View File

@@ -102,7 +102,7 @@ public class CpActivity extends BaseActivity {
int FirstPos = mAdapter.getSectionIndex(position);
int SecondPos = mAdapter.getItemIndex(position);
//ItemPopupWindow.show(getContext(), holder.itemView, holder.getItemViewType(), FirstPos, SecondPos);
ToastUtils.info("一级条目" + FirstPos + "二级" + SecondPos);
ToastUtils.info("一级条目" + FirstPos + "二级" + SecondPos,"First-level" + FirstPos + "Second-level" + SecondPos);
return true;
}
});


+ 3
- 3
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/Cpxz1Activity.java View File

@@ -54,14 +54,14 @@ public class Cpxz1Activity extends BaseActivity {
search_view.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
ToastUtils.info("点击搜索按钮时触发"+s);
/*ToastUtils.info("点击搜索按钮时触发"+s);*/
return false;
}

@Override
public boolean onQueryTextChange(String s) {
DataBus.getInstance().GetGoods(s);
ToastUtils.info("搜索内容改变时触发,"+s);
/*ToastUtils.info("搜索内容改变时触发,"+s);*/
return false;
}
});
@@ -93,7 +93,7 @@ public class Cpxz1Activity extends BaseActivity {
}
};
}catch(Exception e){
ToastUtils.info("异常信息:"+e.getMessage());
ToastUtils.info("异常信息:"+e.getMessage(),"Exception message:" + e.getMessage());
}
}



+ 3
- 3
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpxzActivity.java View File

@@ -53,14 +53,14 @@ public class CpxzActivity extends BaseActivity {
search_view.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
ToastUtils.info("点击搜索按钮时触发"+s);
/*ToastUtils.info("点击搜索按钮时触发"+s);*/
return false;
}

@Override
public boolean onQueryTextChange(String s) {
DataBus.getInstance().GetGoods(s);
ToastUtils.info("搜索内容改变时触发,"+s);
/*ToastUtils.info("搜索内容改变时触发,"+s);*/
return false;
}
});
@@ -92,7 +92,7 @@ public class CpxzActivity extends BaseActivity {
}
};
}catch(Exception e){
ToastUtils.info("异常信息:"+e.getMessage());
ToastUtils.info("异常信息:"+e.getMessage(),"Exception message:" + e.getMessage());
}
}



+ 3
- 3
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java View File

@@ -372,7 +372,7 @@ public class DishTestActivity extends BaseActivity {
});
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}
@@ -562,7 +562,7 @@ public class DishTestActivity extends BaseActivity {
item.sort = k + 1;
QueryDB.AddGoodsSrecipe(item);
}
ToastUtils.info("菜谱保存成功!");
ToastUtils.info("菜谱保存成功!","Recipe saved successfully!");
dialog.dismiss();
MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good");

@@ -709,7 +709,7 @@ public class DishTestActivity extends BaseActivity {
//重置暂停开关
IsPause = false;
zanting_goodmake.SetStatus(false);
zanting_goodmake.setVisibility(View.VISIBLE);
/*zanting_goodmake.setVisibility(View.VISIBLE);*/
ExecuteTheRecipe.WritePLC("暂停开关", false, null);

IsStart = true;


+ 22
- 13
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyActivity.java View File

@@ -26,6 +26,7 @@ import android.widget.Spinner;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
@@ -318,7 +319,15 @@ public class DiyActivity extends BaseActivity {

if (data.isEmpty()) {
IsVerify = false;
description += "物料-不能为空,请勾选一个物料\n";
switch (getString(R.string.language)){
case "en":
description += "Material-can not be empty,please select a material\n";
break;
case "zh":
description += "物料-不能为空,请勾选一个物料\n";
break;
}

}
} else {
pf.materialType = 1;
@@ -327,7 +336,7 @@ public class DiyActivity extends BaseActivity {
String values = gongxu.GetValues();
if (values.isEmpty()) {
IsVerify = false;
description += gongxu.model.name + "-不能为空\n";
description += ConfigName.getInstance().getString_en(gongxu.model.name);
} else {
data += gongxu.model.name + "," + values + "|";
desc += values + ",";
@@ -340,7 +349,7 @@ public class DiyActivity extends BaseActivity {
pf.processvalue = data.substring(0, data.length() - 1);
return pf;
} else {
ToastUtils.info("数据验证失败,原因:" + description);
ToastUtils.info("数据验证失败,原因:" + description+ "-不能为空\n","Data verification failed, cause:"+ description + "-cannot be empty\n");
return null;
}
} catch (Exception ex) {
@@ -428,14 +437,14 @@ public class DiyActivity extends BaseActivity {
BPA_GOODSRECIPE obj_update = (BPA_GOODSRECIPE) bpa_goodsrecipes.get(index_update);
String selectname = hrgx.getSelectedItem().toString();
if (!obj_update.processname.equals(selectname)) {
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
return;
}
bpa_goodsrecipes.set(index_update, GetSelectItemFromValue());
gxbz_adapter.notifyDataSetChanged();
ToastUtils.info("修改步骤" + (index_update + 1) + ":" + obj_update.processname + "成功!");
ToastUtils.info("修改步骤" + (index_update + 1) + ":" + obj_update.processname + "成功!","Revise step" + (index_update + 1) + ":" + ConfigName.getInstance().getString_en(obj_update.processname) + "successfully!");
} else {
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
}
break;
case R.id.delete_gx://删除工序
@@ -449,9 +458,9 @@ public class DiyActivity extends BaseActivity {
if (index_delete - 1 >= 0) {
SetSelectPos(index_delete - 1);
}
ToastUtils.info("删除工序" + obj_delete.processname + "成功!");
ToastUtils.info("删除工序" + obj_delete.processname + "成功!","Delete process" + ConfigName.getInstance().getString_en(obj_delete.processname) + " successfully!");
} else {
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
}
break;
case R.id.shangyi://上移
@@ -466,7 +475,7 @@ public class DiyActivity extends BaseActivity {
//移动光标
SetSelectPos(index_up - 1);
} else {
ToastUtils.info("已经最顶部!");
ToastUtils.info("已经最顶部!","Already at the top!");
}
break;
case R.id.xiayi://下移
@@ -480,7 +489,7 @@ public class DiyActivity extends BaseActivity {
//移动光标
SetSelectPos(index_down + 1);
} else {
ToastUtils.info("已经最底部!");
ToastUtils.info("已经最底部!","Already at the bottom");
}
break;
case R.id.caozuomoshi://操作模式,打开自动记忆模式
@@ -493,12 +502,12 @@ public class DiyActivity extends BaseActivity {


if (name.isEmpty()) {
ToastUtils.info("菜谱名称不能为空!");
ToastUtils.info("菜谱名称不能为空!","The recipe name cannot be empty!");
return;
} else {
boolean isSucess = QueryDB.GetGoodsIs(name);
if (isSucess) {
ToastUtils.info("菜谱名称已存在!");
ToastUtils.info("菜谱名称已存在!","The recipe name already exists!");
return;
}

@@ -534,7 +543,7 @@ public class DiyActivity extends BaseActivity {
item.sort = k + 1;
QueryDB.AddGoodsSrecipe(item);
}
ToastUtils.info("菜谱生成成功!");
ToastUtils.info("菜谱生成成功!","Create recipe successfully!");
MessageManager.getInstance().sendMessage(MessageName.ScGood,"Good");
dialog.dismiss();
}


+ 33
- 16
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyUpdate1Activity.java View File

@@ -22,6 +22,7 @@ import android.widget.Spinner;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
@@ -329,7 +330,15 @@ public class DiyUpdate1Activity extends BaseActivity {

if (data.isEmpty()) {
IsVerify = false;
description += "物料-不能为空,请勾选一个物料\n";
switch (getString(R.string.language)){
case "en":
description += "Material-cannot be empty,please select one material\n";
break;
case "zh":
description += "物料-不能为空,请勾选一个物料\n";
break;
}

}
} else {
pf.materialType = 1;
@@ -338,7 +347,15 @@ public class DiyUpdate1Activity extends BaseActivity {
String values = gongxu.GetValues();
if (values.isEmpty()) {
IsVerify = false;
description += gongxu.model.name + "-不能为空\n";
switch (getString(R.string.language)){
case "en":
description += ConfigName.getInstance().getString_en(gongxu.model.name) + "-cannot be empty\n";
break;
case "zh":
description += gongxu.model.name + "-不能为空\n";
break;
}

} else {
data += gongxu.model.name + "," + values + "|";
desc += values + ",";
@@ -351,7 +368,7 @@ public class DiyUpdate1Activity extends BaseActivity {
pf.processvalue = data.substring(0, data.length() - 1);
return pf;
} else {
ToastUtils.info("数据验证失败,原因:" + description);
ToastUtils.info("数据验证失败,原因:" + description,"Data verification failed, cause:"+ description);
return null;
}
} catch (Exception ex) {
@@ -412,14 +429,14 @@ public class DiyUpdate1Activity extends BaseActivity {
BPA_GOODSRECIPE obj_update = (BPA_GOODSRECIPE) bpa_goodsrecipes.get(index_update);
String selectname = hrgx.getSelectedItem().toString();
if (!obj_update.processname.equals(selectname)) {
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
return;
}
bpa_goodsrecipes.set(index_update, GetSelectItemFromValue());
gxbz_adapter.notifyDataSetChanged();
ToastUtils.info("修改步骤" + (index_update + 1) + ":" + obj_update.processname + "成功!");
ToastUtils.info("修改步骤" + (index_update + 1) + ":" + obj_update.processname + "成功!","Revise step" + (index_update + 1) + ":" + ConfigName.getInstance().getString_en(obj_update.processname) + "successfully!");
} else {
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
}
break;
case R.id.delete_gx://删除工序
@@ -433,9 +450,9 @@ public class DiyUpdate1Activity extends BaseActivity {
if (index_delete - 1 >= 0) {
SetSelectPos(index_delete - 1);
}
ToastUtils.info("删除工序" + obj_delete.processname + "成功!");
ToastUtils.info("删除工序" + obj_delete.processname + "成功!","Delete process" + obj_delete.processname + "successfully!");
} else {
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
}
break;
case R.id.shangyi://上移
@@ -450,7 +467,7 @@ public class DiyUpdate1Activity extends BaseActivity {
//移动光标
SetSelectPos(index_up - 1);
} else {
ToastUtils.info("已经最顶部!");
ToastUtils.info("已经最顶部!","Already at the top!");
}
break;
case R.id.xiayi://下移
@@ -464,7 +481,7 @@ public class DiyUpdate1Activity extends BaseActivity {
//移动光标
SetSelectPos(index_down + 1);
} else {
ToastUtils.info("已经最底部!");
ToastUtils.info("已经最底部!","Already at the bottom!");
}
break;
case R.id.caozuomoshi://操作模式
@@ -475,12 +492,12 @@ public class DiyUpdate1Activity extends BaseActivity {
case R.id.shengchengnewcaipu:
String name1 = edittext.getText().toString();
if (name1.isEmpty()) {
ToastUtils.info("菜谱名称不能为空!");
ToastUtils.info("菜谱名称不能为空!","The recipe name cannot be empty!");
return;
} else {
boolean isSucess = QueryDB.GetGoodsIs(name1);
if (isSucess) {
ToastUtils.info("菜谱名称已存在!");
ToastUtils.info("菜谱名称已存在!","The recipe name already exists!");
return;
}

@@ -517,7 +534,7 @@ public class DiyUpdate1Activity extends BaseActivity {
item.sort = k + 1;
QueryDB.AddGoodsSrecipe(item);
}
ToastUtils.info("菜谱复刻成功!");
ToastUtils.info("菜谱复刻成功!","Recipe copy successful!");
dialog.dismiss();
MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good");
finish();
@@ -529,12 +546,12 @@ public class DiyUpdate1Activity extends BaseActivity {
case R.id.shengchengcaipu://修改菜谱
String name = edittext.getText().toString();
if (name.isEmpty()) {
ToastUtils.info("菜谱名称不能为空!");
ToastUtils.info("菜谱名称不能为空!","The recipe name cannot be empty!");
return;
} else {
boolean isSucess = QueryDB.GetGoodsIs(name, good.id);
if (isSucess) {
ToastUtils.info("菜谱名称已存在!");
ToastUtils.info("菜谱名称已存在!","The recipe name already exists!");
return;
}
if(!IsHotJ())
@@ -566,7 +583,7 @@ public class DiyUpdate1Activity extends BaseActivity {
item.sort = k + 1;
QueryDB.AddGoodsSrecipe(item);
}
ToastUtils.info("菜谱修改成功!");
ToastUtils.info("菜谱修改成功!","Revise recipe successfully!");
dialog.dismiss();
MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good");
finish();


+ 14
- 13
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyUpdateActivity.java View File

@@ -21,6 +21,7 @@ import android.widget.Spinner;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
@@ -471,15 +472,15 @@ public class DiyUpdateActivity extends BaseActivity {
String selectname= hrgx.getSelectedItem().toString();
if(!obj_update.processname.equals(selectname))
{
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
return;
}
bpa_goodsrecipes.set(index_update,GetSelectItemFromValue());
gxbz_adapter.notifyDataSetChanged();
ToastUtils.info("修改步骤"+(index_update+1)+":"+obj_update.processname+"成功!");
ToastUtils.info("修改步骤"+(index_update+1)+":"+obj_update.processname+"成功!","Revise step "+(index_update+1)+":"+ ConfigName.getInstance().getString_en(obj_update.processname) +"successfully!");
}else
{
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
}
break;
case R.id.delete_gx://删除工序
@@ -495,10 +496,10 @@ public class DiyUpdateActivity extends BaseActivity {
{
SetSelectPos(index_delete-1);
}
ToastUtils.info("删除工序"+obj_delete.processname+"成功!");
ToastUtils.info("删除工序"+obj_delete.processname+"成功!","Delete process"+ConfigName.getInstance().getString_en(obj_delete.processname) +"successfully!");
}else
{
ToastUtils.info("请先选择工序!");
ToastUtils.info("请先选择工序!","Please select the process first!");
}
break;
case R.id.shangyi://上移
@@ -514,7 +515,7 @@ public class DiyUpdateActivity extends BaseActivity {
SetSelectPos(index_up-1);
}else
{
ToastUtils.info("已经最顶部!");
ToastUtils.info("已经最顶部!","Already at the top!");
}
break;
case R.id.xiayi://下移
@@ -530,7 +531,7 @@ public class DiyUpdateActivity extends BaseActivity {
SetSelectPos(index_down+1);
}else
{
ToastUtils.info("已经最底部!");
ToastUtils.info("已经最底部!","Already at the bottom!");
}
break;
case R.id.caozuomoshi://操作模式
@@ -542,14 +543,14 @@ public class DiyUpdateActivity extends BaseActivity {
String name1=edittext.getText().toString();
if(name1.isEmpty())
{
ToastUtils.info("菜谱名称不能为空!");
ToastUtils.info("菜谱名称不能为空!","The recipe name cannot be empty!");
return;
}else
{
boolean isSucess= QueryDB.GetGoodsIs(name1);
if(isSucess)
{
ToastUtils.info("菜谱名称已存在!");
ToastUtils.info("菜谱名称已存在!","The recipe name already exists!");
return;
}

@@ -588,7 +589,7 @@ public class DiyUpdateActivity extends BaseActivity {
item.sort=k+1;
QueryDB.AddGoodsSrecipe(item);
}
ToastUtils.info("菜谱复刻成功!");
ToastUtils.info("菜谱复刻成功!","Recipe copy successful!");
dialog.dismiss();
MessageManager.getInstance().sendMessage(MessageName.ScGood,"Good");
finish();
@@ -601,14 +602,14 @@ public class DiyUpdateActivity extends BaseActivity {
String name=edittext.getText().toString();
if(name.isEmpty())
{
ToastUtils.info("菜谱名称不能为空!");
ToastUtils.info("菜谱名称不能为空!","The recipe name cannot be empty!");
return;
}else
{
boolean isSucess= QueryDB.GetGoodsIs(name,good.id);
if(isSucess)
{
ToastUtils.info("菜谱名称已存在!");
ToastUtils.info("菜谱名称已存在!","The recipe name already exists!");
return;
}

@@ -644,7 +645,7 @@ public class DiyUpdateActivity extends BaseActivity {
item.sort=k+1;
QueryDB.AddGoodsSrecipe(item);
}
ToastUtils.info("菜谱修改成功!");
ToastUtils.info("菜谱修改成功!","Recipe revise successful");
dialog.dismiss();
MessageManager.getInstance().sendMessage(MessageName.ScGood,"Good");
finish();


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/ImageChooseActivity.java View File

@@ -88,7 +88,7 @@ public class ImageChooseActivity extends BaseActivity {
}
};
}catch(Exception e){
ToastUtils.info("异常信息:"+e.getMessage());
ToastUtils.info("异常信息:"+e.getMessage(),"Exception message:" + e.getMessage());
}
}



+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsMonitorFragment.java View File

@@ -76,7 +76,7 @@ public class SystemCsMonitorFragment extends BaseFragment {

Run();
} catch (Exception e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
/**
@@ -119,7 +119,7 @@ public class SystemCsMonitorFragment extends BaseFragment {
}
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
ToastUtils.info("异常信息:" + e.getMessage(),"Exception message:" + e.getMessage());
}
}
}


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

@@ -123,7 +123,7 @@ public class SystemCsPLCFragment extends BaseFragment {
load_view.setVisibility(View.VISIBLE);
ConfigData.getInstance().RevertPLC();
Init();
ToastUtils.info("初始化成功!");
ToastUtils.info("初始化成功!","Successful initialization!");
dialog.dismiss();
}
});


+ 15
- 15
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSeasoningsetFragment.java View File

@@ -168,15 +168,15 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
String name = edittext.getText().toString();
String lx = wllx.getSelectedItem().toString();
if (name.isEmpty()) {
ToastUtils.info("物料名称不能为空");
ToastUtils.info("物料名称不能为空","Material name cannot be empty");
return;
}
if (lx.isEmpty()) {
ToastUtils.info("物料类型不能为空");
ToastUtils.info("物料类型不能为空","The material type cannot be empty");
return;
}
if (QueryDB.GetMaterialIs(name)) {
ToastUtils.info("物料名称重复,请重新输入后重试!");
ToastUtils.info("物料名称重复,请重新输入后重试!","Duplicate material name, please re-enter and try again!");
return;
}
BPA_MATERIAL bpa_material = new BPA_MATERIAL();
@@ -186,25 +186,25 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
bpa_material.deviceID = ConfigName.getInstance().DeviceId;
bpa_material.userID = ConfigName.getInstance().user.userID;
QueryDB.AddMaterial(bpa_material);
ToastUtils.info("新增成功");
ToastUtils.info("新增成功","New success");
Initdata_wl();
break;
case R.id.synchronous://同步云端

if (NetworkUtils.checkNetworkAvailable(context)) {
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context);
builder.setTitle("密码确认")
.setPlaceholder("在此输入权限密码")
builder.setTitle(getString(R.string.top_passwordconfirm))
.setPlaceholder(getString(R.string.text_permissionpassword))
.setInputType(InputType.TYPE_CLASS_TEXT)

.setCanceledOnTouchOutside(false)
.addAction("取消", new QMUIDialogAction.ActionListener() {
.addAction(getString(R.string.btn_cancel), new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
dialog.dismiss();
}
})
.addAction("确定", new QMUIDialogAction.ActionListener() {
.addAction(getString(R.string.tip_save_confirm), new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
if(ConfigName.isTEST){
@@ -221,10 +221,10 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
UpdateDataService.downLoadProcessModel("",getContext());
dialog.dismiss();
} else {
ToastUtils.info("权限密码不正确!");
ToastUtils.info("权限密码不正确!","The permission password is incorrect!");
}
} else {
ToastUtils.info("权限密码不正确!");
ToastUtils.info("权限密码不正确!","The permission password is incorrect!");
}
}
})
@@ -241,7 +241,7 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
public void onClick(QMUIDialog dialog, int index) {
ConfigData.getInstance().RevertPLCProcess();
Initdata_gx();
ToastUtils.info("恢复出厂设置成功!");
ToastUtils.info("恢复出厂设置成功!","The factory Settings are restored successfully!");
dialog.dismiss();
}
});
@@ -346,7 +346,7 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
CharSequence text = builder.getEditText().getText();
if (text != null && text.length() > 0) {
if (QueryDB.GetMaterialIs(text.toString())) {
ToastUtils.info("物料名称重复,请重新输入后重试!");
ToastUtils.info("物料名称重复,请重新输入后重试!","Material name duplicate, please re-enter and try again!");
return;
}
QueryDB.UpdateMaterialName(((BPA_MATERIAL) data).id, text.toString());
@@ -354,7 +354,7 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("物料名称不能为空!");
ToastUtils.info("物料名称不能为空!","The material name cannot be empty!");
}
}
})
@@ -450,7 +450,7 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("值不能为空!");
ToastUtils.info("值不能为空!","The value cannot be empty!");
}
}
})
@@ -479,7 +479,7 @@ public class SystemSeasoningsetFragment extends BaseFragment implements MyClickL
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("值不能为空!");
ToastUtils.info("值不能为空!","The value cannot be empty!");
}
}
})


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java View File

@@ -317,7 +317,7 @@ public class SystemSystemsetFragment extends BaseFragment {
ConfigName.getInstance().MaxTemp=Integer.parseInt(edittext_wd.getText().toString());
}
ConfigData.getInstance().SavePZ();
ToastUtils.info("保存成功");
ToastUtils.info("保存成功","Save successfully");
break;

}


+ 3
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetGKCXFragment.java View File

@@ -22,6 +22,7 @@ import android.widget.TextView;
import com.bonait.bnframework.R;
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.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
@@ -392,7 +393,7 @@ public class WokSetGKCXFragment extends BaseFragment {

ExecuteTheRecipe.WritePLC(name+"下限",va1,null);
ExecuteTheRecipe.WritePLC(name+"上限",va2,null);
ToastUtils.info(name + "保存成功!");
ToastUtils.info(name + "保存成功!","Save successfully");
}

/**
@@ -407,7 +408,7 @@ public class WokSetGKCXFragment extends BaseFragment {
ExecuteTheRecipe.WritePLC(name, false, null);
}
}, 500);
ToastUtils.info(name+"执行成功!");
ToastUtils.info(name+"执行成功!", ConfigName.getInstance().getString_en(name) +"Executed successfully!");
}
//endregion
}

+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZ1Fragment.java View File

@@ -403,7 +403,7 @@ public class WokSetTLZZ1Fragment extends BaseFragment {
ExecuteTheRecipe.WritePLC(name + "-回原点速度", va1, null);
ExecuteTheRecipe.WritePLC(name + "-点动速度", va2, null);
ExecuteTheRecipe.WritePLC(name + "-定位运行速度", va3, null);
ToastUtils.info(name + "保存成功!");
ToastUtils.info(name + "保存成功!","Save successfully");
}

/**
@@ -431,7 +431,7 @@ public class WokSetTLZZ1Fragment extends BaseFragment {
ExecuteTheRecipe.WritePLC(name, false, null);
}
}, 500);
ToastUtils.info(name + "执行成功!");
ToastUtils.info(name + "执行成功!","Executed successfully!");
}
//endregion
}

+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/WokSetTLZZFragment.java View File

@@ -465,7 +465,7 @@ public class WokSetTLZZFragment extends BaseFragment {
ExecuteTheRecipe.WritePLC(name + "-回原点速度", va1, null);
ExecuteTheRecipe.WritePLC(name + "-点动速度", va2, null);
ExecuteTheRecipe.WritePLC(name + "-定位运行速度", va3, null);
ToastUtils.info(name + "保存成功!");
ToastUtils.info(name + "保存成功!","Save successfully");
}

/**
@@ -493,7 +493,7 @@ public class WokSetTLZZFragment extends BaseFragment {
ExecuteTheRecipe.WritePLC(name, false, null);
}
}, 500);
ToastUtils.info(name + "执行成功!");
ToastUtils.info(name + "执行成功!","Executed successfully!");
}
//endregion
}

+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/systeminternetfragment.java View File

@@ -97,7 +97,7 @@ public class systeminternetfragment extends BaseFragment {
} catch (Exception e) {
}
}
ToastUtils.info("添加成功!");
ToastUtils.info("添加成功!","Add successfully!");
break;
}
}


+ 32
- 10
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_message.java View File

@@ -2,6 +2,7 @@ package com.bonait.bnframework.modules.home.fragment.mode;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -9,6 +10,7 @@ import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Spinner;
@@ -28,6 +30,8 @@ import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.utils.ToastUtils;

import org.w3c.dom.Text;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -48,7 +52,11 @@ public class add_silos_message extends LinearLayout {
@BindView(R.id.t_text)
TextView t_text;//1号

@BindView(R.id.img_dcqx)
ImageView img_dcqx;

@BindView(R.id.text_dcqx)
TextView text_dcqx;
@BindView(R.id.zongliang)
EditText zongliang;
@BindView(R.id.gaojingrongliang)
@@ -58,9 +66,9 @@ public class add_silos_message extends LinearLayout {
@BindView(R.id.editsp_wl)
Spinner editsp_wl;

@BindView(R.id.click_dcqx)
imagebuttom click_dcqx;


private boolean status = false;
public MyClickListener mListener = null;
private View root;
private Context contextMian;
@@ -95,7 +103,7 @@ public class add_silos_message extends LinearLayout {
/**
* 单仓清洗
*/
click_dcqx.mListener=new MyClickListener() {
/* click_dcqx.mListener=new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
boolean status = (boolean) data;
@@ -106,7 +114,7 @@ public class add_silos_message extends LinearLayout {
public void clickListenerNew(View v, int k, Object data) {

}
};
};*/
}

/**
@@ -148,7 +156,7 @@ public class add_silos_message extends LinearLayout {
*
* @param view
*/
@OnClick({R.id.save_rlsz,R.id.save_ghtl,
@OnClick({R.id.save_rlsz,R.id.save_ghtl,R.id.click_dcqx,
R.id.save_tlbd,R.id.click_dcbl,R.id.click_lcjz})
public void onViewClicked(View view) {
switch (view.getId()) {
@@ -162,7 +170,7 @@ public class add_silos_message extends LinearLayout {
QueryDB.UpdateSilosBJZ(mode.id,mode.warningValue);
QueryDB.UpdateSilosZL(mode.id,mode.siloszl);
initData();
ToastUtils.info("容量保存成功!");
ToastUtils.info("容量保存成功!","Capacity saved successfully!");
}
break;
case R.id.save_tlbd:
@@ -194,13 +202,13 @@ public class add_silos_message extends LinearLayout {
mode.materialName = material.name;
}
initData();
ToastUtils.info("更换物料成功!");
ToastUtils.info("更换物料成功!","Replace material successfully!");
break;
case R.id.click_dcbl:
QueryDB.UpdateYL(mode.id,mode.siloszl);
mode.silosmargin=mode.siloszl;
initData();
ToastUtils.info("补料成功!");
ToastUtils.info("补料成功!","Successful feeding!");
break;
case R.id.click_lcjz:
ExecuteTheRecipe.WritePLC("校准时间", 50, null);//默认校准时间5秒
@@ -212,8 +220,22 @@ public class add_silos_message extends LinearLayout {
ExecuteTheRecipe.WritePLC("开始校正", false, null);
}
}, 500);
ToastUtils.info("开始校准!");
ToastUtils.info("开始校准!","Start calibration!");
break;
case R.id.click_dcqx:
if (!status){
status = true;
ExecuteTheRecipe.WritePLC("料仓" + mode.num + "手动开关", status, null);
img_dcqx.setImageResource(R.mipmap.img_dcqx_2);
text_dcqx.setTextColor(Color.parseColor("#1296DB"));
}
else {
status = false;
ExecuteTheRecipe.WritePLC("料仓" + mode.num + "手动开关", status, null);
img_dcqx.setImageResource(R.mipmap.img_dcqx);
text_dcqx.setTextColor(Color.parseColor("#BEAA6A"));
}

}
}

@@ -295,7 +317,7 @@ public class add_silos_message extends LinearLayout {
*/
public void SetData(lcMode data, Activity activity) {
try {
click_dcqx.SetStatus(false);
/*click_dcqx.SetStatus(false);*/
mode = data;
//region 设置物料下拉框
materials.clear();


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_plc.java View File

@@ -95,7 +95,7 @@ public class fragment_plc extends LinearLayout {
model.iswrite=check_iswrite.isChecked()?1:0;
model.isread=check_isread.isChecked()?1:0;
QueryDB.UpdatePlcaddress(model);
ToastUtils.info("修改成功!");
ToastUtils.info("修改成功!","Revise successful");
dialog.dismiss();
}
});


+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_plc_control.java View File

@@ -191,7 +191,7 @@ public class fragment_plc_control extends LinearLayout {
public void onCheckedChanged(SwitchButton view, boolean isChecked) {
boolean ischick= control_switch.isChecked();
ExecuteTheRecipe.WritePLC(model.name,ischick,null);
ToastUtils.info("写入地址:"+model.address+"成功!状态:"+(ischick?"打开":"关闭"));
ToastUtils.info("写入地址:"+model.address+"成功!状态:"+(ischick?"打开":"关闭"),"Write address:"+model.address+"successfully!status:"+(ischick?"open":"close"));
}
});

@@ -251,7 +251,7 @@ public class fragment_plc_control extends LinearLayout {
Short val=Short.parseShort(text);
ExecuteTheRecipe.WritePLC(model.name,val,null);
}
ToastUtils.info("写入地址:"+model.address+"成功!");
ToastUtils.info("写入地址:"+model.address+"成功!","Write address:"+model.address+"successfully!");
break;

}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_silos_cl.java View File

@@ -69,7 +69,7 @@ public class fragment_silos_cl extends LinearLayout {
public void onFailure(String ErrorMsg) {
}
});
ToastUtils.info("料仓" + model.num+"出料:"+text+"g");
ToastUtils.info("料仓" + model.num+"出料:"+text+"g","Silo" + model.num+"Pour-out:"+text+"g");
break;
}
}

+ 6
- 21
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/imagebuttom.java View File

@@ -61,8 +61,6 @@ public class imagebuttom extends LinearLayout {
try {
ks_ys = typedArray.getResourceId(R.styleable.imagebutton_control_imagesrc_ks, R.mipmap.zhizuo_ks);
tz_ys = typedArray.getResourceId(R.styleable.imagebutton_control_imagesrc_tz,R.mipmap.zhizuo_js);
ks_ys_en = typedArray.getResourceId(R.styleable.imagebutton_control_imagesrc_ks_en, R.mipmap.zhizuo_ks);
tz_ys_en = typedArray.getResourceId(R.styleable.imagebutton_control_imagesrc_tz_en,R.mipmap.zhizuo_js);
typedArray.recycle();
}catch (Exception exception)
{
@@ -155,25 +153,12 @@ public class imagebuttom extends LinearLayout {
public void SetStatus(boolean status)
{
Status=status;
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
if(status)
{
image_u.setImageResource(tz_ys_en);
}else
{
image_u.setImageResource(ks_ys_en);
}
break;
case "zh":
if(status)
{
image_u.setImageResource(tz_ys);
}else
{
image_u.setImageResource(ks_ys);
}
break;
if(status)
{
image_u.setImageResource(tz_ys);
}else
{
image_u.setImageResource(ks_ys);
}

}


+ 4
- 4
app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java View File

@@ -254,7 +254,7 @@ public class MyFragment extends BaseFragment {
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("用户名不能为空!");
ToastUtils.info("用户名不能为空!","The user name cannot be empty!");
}
}
})
@@ -298,7 +298,7 @@ public class MyFragment extends BaseFragment {
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("签名不能为空!");
ToastUtils.info("签名不能为空!","The signature cannot be empty!");
}
}
})
@@ -339,7 +339,7 @@ public class MyFragment extends BaseFragment {
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("密码不能为空!");
ToastUtils.info("密码不能为空!","The password cannot be empty!");
}
}
})
@@ -359,7 +359,7 @@ public class MyFragment extends BaseFragment {
@Override
public void onClick(QMUIDialog dialog, int index) {
ConfigData.getInstance().RevertPLCProcess();
ToastUtils.info("恢复出厂设置成功!");
ToastUtils.info("恢复出厂设置成功!","The factory Settings are restored successfully!");
dialog.dismiss();
}
});


+ 3
- 3
app/src/main/java/com/bonait/bnframework/modules/mine/fragment/UserActivity.java View File

@@ -127,7 +127,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
return;
}
QueryDB.AddUser(bpa_user);
ToastUtils.info("新增成功");
ToastUtils.info("新增成功","New success");
Initdata();
editDialog.dismiss();
}
@@ -244,7 +244,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
}
QueryDB.UpdateUserName(((BPA_USER) data).id, text.toString());
Initdata();
ToastUtils.info("修改成功");
ToastUtils.info("修改成功","Revise successful");
dialog.dismiss();
} else {
//请填入昵称
@@ -284,7 +284,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {

QueryDB.UpdateAccount(((BPA_USER) data).id, text.toString());
Initdata();
ToastUtils.info("修改成功");
ToastUtils.info("修改成功","Revise successful");
dialog.dismiss();
} else {
//请填入昵称


+ 2
- 2
app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java View File

@@ -479,7 +479,7 @@ public class DiyProcessActivity extends BaseActivity {
}
processDetails.set(index_update, getSelectItemFromValue());
stepAdapter.notifyDataSetChanged();
NewToastUtil.getInstance().showToast("修改步骤[" + (index_update + 1) + ":" + obj_update.processname + "]成功!","Revise step [" + (index_update + 1) + ":" + obj_update.processname + "] Success!");
NewToastUtil.getInstance().showToast("修改步骤[" + (index_update + 1) + ":" + obj_update.processname + "]成功!","Revise step [" + (index_update + 1) + ":" +ConfigName.getInstance().getString_en(obj_update.processname ) + "] Success!");
}
} else {
NewToastUtil.getInstance().showToast("请先选择步骤!","Please select a step first!");
@@ -500,7 +500,7 @@ public class DiyProcessActivity extends BaseActivity {
if (index_delete - 1 >= 0) {
setSelectPos(index_delete - 1);
}
NewToastUtil.getInstance().showToast("删除步骤[" + processDetail.processname + "]成功!","Delete step [" + processDetail.processname + "] success!");
NewToastUtil.getInstance().showToast("删除步骤[" + processDetail.processname + "]成功!","Delete step [" +ConfigName.getInstance().getString_en(processDetail.processname) + "] success!");
} else {
NewToastUtil.getInstance().showToast("请先选择步骤!","Please select a step first!");
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/ui/dialog/EditGoodsDialog.java View File

@@ -667,7 +667,7 @@ public class EditGoodsDialog extends DialogFragment {
}
}
groupList.clear();
groupList.add("未匹配");
groupList.add(getString(R.string.text_waterset));
groupList.addAll(update);
int pos = 0;
// for(int i =0;i<groupList.size();i++){


+ 8
- 8
app/src/main/res/layout/activity_bunkersetup.xml View File

@@ -175,33 +175,33 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="操作说明"
android:text="@string/top_operation"
android:fontFamily="@font/fz2"
android:textSize="25dp"
android:textSize="20dp"
android:textColor="@color/deep_orange_primary"/>
<TextView
android:layout_marginTop="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:textSize="14dp"
android:fontFamily="@font/fz2"
android:text="1、物料设置:点击“设置”-“物料选择”,更换料仓物料。"
android:text="@string/top_operation_step_1"
android:textColor="#567722"/>
<TextView
android:layout_marginTop="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:textSize="14dp"
android:fontFamily="@font/fz2"
android:text="2、容量设置:点击“设置”-“容量设置”\n ,填写(总、告警)容量。"
android:text="@string/top_operation_step_2"
android:textColor="#567722"/>
<TextView
android:layout_marginTop="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:textSize="14dp"
android:fontFamily="@font/fz2"
android:text="3、物料校准:点击“设置”-“调料校准”\n ,记录出料克重写入标定处,保存生效。\n (注意:此操作需要先排空管道)"
android:text="@string/top_operation_step_3"
android:textColor="#567722"/>
</LinearLayout>
<RelativeLayout


+ 2
- 0
app/src/main/res/layout/activity_cooking.xml View File

@@ -92,6 +92,7 @@
</RelativeLayout>

<LinearLayout
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
@@ -125,6 +126,7 @@
app:imagesrc_tz="@mipmap/zhizuo_js" />

<ImageView
android:visibility="gone"
android:id="@+id/kancaipu"
android:layout_width="170dp"
android:layout_height="wrap_content"


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

@@ -38,7 +38,7 @@
android:id="@+id/tv_connect"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="设备状态:未连接"
android:text=""
android:layout_gravity="end"
android:textColor="@color/white"
android:textSize="25dp"


+ 65
- 17
app/src/main/res/layout/item/layout/dialog_silos_message.xml View File

@@ -235,12 +235,16 @@
android:layout_marginLeft="10dp"
android:textSize="20dp"
android:textColor="#5D7436"/>
<ImageView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
android:src="@mipmap/pkbdy" />
android:textColor="#F37636"
android:fontFamily="@font/fz2"
android:layout_marginBottom="2dp"
android:textSize="12dp"
android:text="@string/text_calibrationinfo"/>

</LinearLayout>
<LinearLayout
@@ -393,35 +397,79 @@
</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal"
android:layout_marginBottom="30dp">

<ImageView
<LinearLayout
android:id="@+id/click_dcbl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/dcbl" />
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@mipmap/image_dcbl" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/btn_single_silo"
android:textSize="15dp"
android:fontFamily="@font/fz2"
android:textColor="@color/topbj1"/>
</LinearLayout>

<com.bonait.bnframework.modules.home.fragment.mode.imagebuttom
<LinearLayout
android:id="@+id/click_dcqx"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="40dp"
app:imagesrc_ks="@mipmap/dcqx_select"
app:imagesrc_tz="@mipmap/dcqx"
app:imagesrc_ks_en="@mipmap/dcbl"
app:imagesrc_tz_en="@mipmap/cooking" />
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/img_dcqx"
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@mipmap/img_dcqx" />
<TextView
android:id="@+id/text_dcqx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/btn_single_silo_clean"
android:textSize="15dp"
android:fontFamily="@font/fz2"
android:textColor="@color/topbj1"/>
</LinearLayout>

<ImageView
<LinearLayout
android:id="@+id/click_lcjz"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="40dp"
android:src="@mipmap/tljz" />
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@mipmap/img_tljz" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/btn_calibrated_spices"
android:textSize="15dp"
android:fontFamily="@font/fz2"
android:textColor="@color/topbj1"/>
</LinearLayout>


</LinearLayout>
</RelativeLayout>
</RelativeLayout>

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

@@ -13,7 +13,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:text="@string/view_close"
android:textAlignment="center"
android:textColor="#BEAA6A"
android:textSize="18dp"


BIN
View File


BIN
View File


BIN
View File


BIN
View File


+ 13
- 0
app/src/main/res/values-en/strings.xml View File

@@ -178,4 +178,17 @@
<string name="btn_save">Save</string>
<string name="text_valve">④(Valve)</string>
<string name="text_servedish">Serve Dish</string>
<string name="btn_single_silo">Single Silo Feed</string>
<string name="btn_single_silo_clean">Single Silo Clean</string>
<string name="btn_calibrated_spices">Calibrate Spices</string>
<string name="top_passwordconfirm">Password Confirmation</string>
<string name="text_permissionpassword">Please enter the permission password</string>
<string name="top_operation">Operation instruction</string>
<string name="top_operation_step_1">1. Material Settings: click "Settings" - "Material selection" to replace the material in the bunker.</string>
<string name="top_operation_step_2">2. capacity Settings: Click "Settings" - "capacity Settings" \n, fill in the (total, alarm) capacity.</string>
<string name="top_operation_step_3">3. material calibration: click "Settings" - "seasoning calibration", record the \n discharge gram re-write the calibration, save effective.\n (Note: This operation requires emptying the pipe first)</string>
<string name="view_close">close</string>
<string name="top_cleantip">Deep cleaning pumping amount</string>
<string name="top_cleaninfo">Enter your dosage</string>
<string name="text_calibrationinfo">The pipe needs to be emptied before calibration</string>
</resources>

+ 0
- 3
app/src/main/res/values/attrs.xml View File

@@ -8,9 +8,6 @@
<attr name="imagesrc_ks" format="reference" />
<attr name="imagesrc_tz" format="reference" />
<attr name="imagesrc_qt" format="reference" />
<attr name="imagesrc_ks_en" format="reference" />
<attr name="imagesrc_tz_en" format="reference" />
<attr name="imagesrc_qt_en" format="reference" />
</declare-styleable>

<declare-styleable name="myMagicProgress">


+ 13
- 0
app/src/main/res/values/strings.xml View File

@@ -178,4 +178,17 @@
<string name="btn_save">保存</string>
<string name="text_valve">④(水阀)</string>
<string name="text_servedish">出餐</string>
<string name="btn_single_silo">单仓补料</string>
<string name="btn_single_silo_clean">单仓清洗</string>
<string name="btn_calibrated_spices">调料校准</string>
<string name="top_passwordconfirm">密码确认</string>
<string name="text_permissionpassword">在此输入权限密码</string>
<string name="top_operation">操作说明</string>
<string name="top_operation_step_1">1、物料设置:点击“设置”-“物料选择”,更换料仓物料。</string>
<string name="top_operation_step_2">2、容量设置:点击“设置”-“容量设置”,填写(总、告警)容量。</string>
<string name="top_operation_step_3">3、物料校准:点击“设置”-“调料校准”,记录出料克重写入标定处,保存生效。注意:此操作需要先排空管道)</string>
<string name="view_close">关</string>
<string name="top_cleantip">深度清洗抽水用量</string>
<string name="top_cleaninfo">在此输入您的用量</string>
<string name="text_calibrationinfo">标定前需要排空管道</string>
</resources>

Loading…
Cancel
Save