Browse Source

lyw 上传

授权码生成工具
lyw 4 months ago
parent
commit
3cf4baa9eb
25 changed files with 133 additions and 105 deletions
  1. +7
    -7
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  2. +4
    -4
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  3. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/http/callback/files/FileProgressDialogCallBack.java
  4. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/http/callback/files2/FileProgressDialogCallBack2.java
  5. +6
    -5
      app/src/main/java/com/bonait/bnframework/common/http/callback/json/JsonCallback.java
  6. +38
    -31
      app/src/main/java/com/bonait/bnframework/common/iot/AliyunIOTManager.java
  7. +20
    -1
      app/src/main/java/com/bonait/bnframework/common/utils/ToastUtils.java
  8. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java
  9. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/good_adapter.java
  10. +13
    -13
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  11. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentPR.java
  12. +2
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java
  13. +4
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/AutoTestActivity.java
  14. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CookingActivity.java
  15. +4
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java
  16. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyActivity.java
  17. +1
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java
  18. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyUpdateActivity.java
  19. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDListSectionAdapter.java
  20. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_plc_control.java
  21. +14
    -15
      app/src/main/java/com/bonait/bnframework/modules/mine/fragment/UserActivity.java
  22. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java
  23. +2
    -2
      app/src/main/java/com/bonait/bnframework/test/TestActivity.java
  24. +3
    -0
      app/src/main/res/values-en/strings.xml
  25. +3
    -0
      app/src/main/res/values/strings.xml

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

@@ -659,7 +659,7 @@ public class ConfigData {
});
//endregion
} else {
ToastUtils.warning("无网络,请先连接网络!!!");
ToastUtils.warning("无网络,请先连接网络!!!","No network connection!");
}
}

@@ -688,7 +688,7 @@ public class ConfigData {
}
});
} else {
ToastUtils.warning("无网络,请先连接网络!!!");
ToastUtils.warning("无网络,请先连接网络!!!","No network connection!");
}
}

@@ -700,7 +700,7 @@ public class ConfigData {
public void GetGoodProcess(Context context, String goodid, Boolean isSX) {
Boolean IsXZ = QueryDB.GetGoodsIDIs(goodid);
if (IsXZ) {
ToastUtils.warning("请勿重复下载,本地商品已存在!!!");
ToastUtils.warning("请勿重复下载,本地商品已存在!!!","Product already exist");
return;
}

@@ -874,7 +874,7 @@ public class ConfigData {
}
});
} else {
ToastUtils.warning("无网络,请先连接网络!!!");
ToastUtils.warning("无网络,请先连接网络!!!","No network connection!");
}

}
@@ -889,7 +889,7 @@ public class ConfigData {
try {
if (NetworkUtils.checkNetworkAvailable(context)) {
if (ConfigName.getInstance().organizeMode == null && ConfigName.getInstance().cloudData != null) {
ToastUtils.warning("无组织信息不能上传,请设置当前店铺信息!!!");
ToastUtils.warning("无组织信息不能上传,请设置当前店铺信息!!!","Please set the store information first!");
return;
}
BPA_GOODS good = QueryDB.GetGoodsId(goodid);//ConfigName.getInstance().SaasAddress
@@ -1136,7 +1136,7 @@ public class ConfigData {
MessageManager.getInstance().sendMessage(MessageName.ScGood, "GoodUpdate");
editDialog.dismiss();
} else {
ToastUtils.warning("上传菜品失败!!!");
ToastUtils.warning("上传菜品失败!!!","Upload failure!");
}
}
});
@@ -1158,7 +1158,7 @@ public class ConfigData {


} else {
ToastUtils.warning("无网络,请先连接网络!!!");
ToastUtils.warning("无网络,请先连接网络!!!","No network connection!");
}
} catch (Exception ex) {
}


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

@@ -2029,13 +2029,13 @@ public class ExecuteTheRecipe {
} else {
Object chushiover = ExecuteTheRecipe.getListingValue("初始化完成");
if (!ConfigName.getInstance().PlcIsConnect && !ConfigName.isTEST) {
ToastUtils.warning("PLC未准备就绪!!!");
ToastUtils.warning("PLC未准备就绪!!!","PLC not connected");
WriteMainPLC("商品数据验证", false, null);
} else if ((chushiover == null || !(boolean) chushiover) && !ConfigName.isTEST) {
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!");
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!","The device is not initialized!");
WriteMainPLC("商品数据验证", false, null);
} else if (ExecuteTheRecipe.IsStart) {
ToastUtils.warning("请耐心等待商品制作结束!!!");
ToastUtils.warning("请耐心等待商品制作结束!!!","Wait for the product to finish!");
WriteMainPLC("商品数据验证", false, null);
} else {
WriteMainPLC("机器人准备就绪", false, null);
@@ -2352,7 +2352,7 @@ public class ExecuteTheRecipe {
*/
public static void showlog(String msg) {
Log.e("hbl", msg);
ToastUtils.info(msg);
/*ToastUtils.info(msg);*/
}
//endregion
}

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

@@ -72,7 +72,7 @@ public abstract class FileProgressDialogCallBack extends FileCallback {
downloadNotification.downloadError();
}

ToastUtils.error(response.body().getName() + "下载失败,请重新下载!");
ToastUtils.error(response.body().getName() + "下载失败,请重新下载!","Download failure!");
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}


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

@@ -71,7 +71,7 @@ public abstract class FileProgressDialogCallBack2 extends FileCallback2 {
downloadNotification.downloadError();
}

ToastUtils.error(response.body().getName() + "下载失败,请重新下载!");
ToastUtils.error(response.body().getName() + "下载失败,请重新下载!","Download failure!");
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}


+ 6
- 5
app/src/main/java/com/bonait/bnframework/common/http/callback/json/JsonCallback.java View File

@@ -2,6 +2,7 @@ package com.bonait.bnframework.common.http.callback.json;

import android.app.Activity;
import android.content.Intent;
import android.util.Log;

import com.bonait.bnframework.manager.ActivityLifecycleManager;
import com.bonait.bnframework.common.constant.SPConstants;
@@ -77,13 +78,13 @@ public abstract class JsonCallback<T> extends AbsCallback<T> {
}*/

if (exception instanceof UnknownHostException || exception instanceof ConnectException) {
ToastUtils.error("网络连接失败,请连接网络!");
ToastUtils.error("网络连接失败,请连接网络!","Network connection failure");
} else if (exception instanceof SocketTimeoutException) {
ToastUtils.error("网络请求超时,请稍后重试!");
ToastUtils.error("网络请求超时,请稍后重试!","Network request timeout");
} else if (exception instanceof HttpException) {
ToastUtils.error("暂时无法连接服务器,请稍后重试!");
ToastUtils.error("暂时无法连接服务器,请稍后重试!","Unable to connect to server");
} else if (exception instanceof StorageException) {
ToastUtils.error("SD卡不存在或者没有获取SD卡访问权限!");
ToastUtils.error("SD卡不存在或者没有获取SD卡访问权限!","No SD card exists!");
} else if (exception instanceof TokenException) {
// 删除token,跳转到登录页面
skipLoginActivityAndFinish(exception);
@@ -105,7 +106,7 @@ public abstract class JsonCallback<T> extends AbsCallback<T> {

// 如果不是WelcomeActivity,显示Toast告知token已过期
if (activity.getClass() != WelcomeActivity.class) {
ToastUtils.info(exception.getMessage());
Log.e("token已过期",exception.getMessage());
}

// 结束所有Activity


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

@@ -25,6 +25,7 @@ import com.aliyun.alink.linksdk.tmp.utils.TmpConstant;
import com.aliyun.alink.linksdk.tools.AError;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.iot.manager.IDemoCallback;
import com.bonait.bnframework.common.iot.manager.InitManager;
import com.bonait.bnframework.common.iot.mode.AppLog;
@@ -92,13 +93,13 @@ public class AliyunIOTManager {
public void OpenDev(Context context) {
try {
if (userDevInfoError) {
ToastUtils.warning("三元组文件格式不正确,请重新检查格式");
ToastUtils.warning("三元组文件格式不正确,请重新检查格式","Incorrect format!");
} else {
if (!TextUtils.isEmpty(deviceSecret) || !TextUtils.isEmpty(password) || !TextUtils.isEmpty(deviceToken)) {
connect(context);
} else {
if (!userDevInfoError) {
ToastUtils.warning("三元组信息无效,请重新填写");
ToastUtils.warning("三元组信息无效,请重新填写","Invalid message!");
}
userDevInfoError = true;
}
@@ -141,16 +142,16 @@ public class AliyunIOTManager {
public void UploadProperty(Property property, String val) {
try {
if (property == null) {
showToast("选择的property为空");
showToast("选择的property为空","Property Null");
return;
}
String value = val;
if (property == null || value == null || property.getIdentifier() == null) {
showToast("属性或值为空");
showToast("属性或值为空","Property or Value Null");
return;
}
if (property.getDataType() == null) {
showToast("属性类型为空");
showToast("属性类型为空","The property type is null");
return;
}
if (TmpConstant.TYPE_VALUE_INTEGER.equals(property.getDataType().getType())) {
@@ -158,7 +159,7 @@ public class AliyunIOTManager {
if (parseData != DEF_VALUE) {
report(property.getIdentifier(), new ValueWrapper.IntValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
}
return;
}
@@ -167,7 +168,7 @@ public class AliyunIOTManager {
if (parseData != null) {
report(property.getIdentifier(), new ValueWrapper.DoubleValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
}
return;
}
@@ -176,7 +177,7 @@ public class AliyunIOTManager {
if (parseData != null) {
report(property.getIdentifier(), new ValueWrapper.DoubleValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
}
return;
}
@@ -185,7 +186,7 @@ public class AliyunIOTManager {
if (parseData == 0 || parseData == 1) {
report(property.getIdentifier(), new ValueWrapper.BooleanValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
}
return;
}
@@ -212,7 +213,7 @@ public class AliyunIOTManager {
try {
List<Map<String, Object>> specsList = (List<Map<String, Object>>) property.getDataType().getSpecs();
if (specsList == null || specsList.size() == 0) {
showToast("云端创建的struct结构为空,不上传任何值。");
showToast("云端创建的struct结构为空,不上传任何值。","Cloud struct null");
return;
}
JSONObject dataJson = JSONObject.parseObject(value);
@@ -239,12 +240,12 @@ public class AliyunIOTManager {
if (isValidInt(String.valueOf(dataJson.get(idKey)))) {
valueItem = new ValueWrapper.DateValueWrapper(String.valueOf(dataJson.get(idKey)));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
}
} else if ("enum".equals(dataType)) {
valueItem = new ValueWrapper.EnumValueWrapper(getInt(String.valueOf(dataJson.get(idKey))));
} else {
showToast("数据格式不支持");
showToast("数据格式不支持","Nonsupport data format");
}
if (valueItem != null) {
dataMap.put(idKey, valueItem);
@@ -254,13 +255,11 @@ public class AliyunIOTManager {

report(property.getIdentifier(), new ValueWrapper.StructValueWrapper(dataMap));
} catch (Exception e) {
showToast("数据格式不正确");
showToast("数据格式不正确","Wrong data format");
}
return;
}
showToast("该类型Demo暂不支持,用户可参照其他类型代码示例开发支持。");
} catch (Exception e) {
showToast("数据格式不对");
e.printStackTrace();
}
}
@@ -302,7 +301,7 @@ public class AliyunIOTManager {
*/
public void UploadEvents(Event event, String val) {
if (event == null) {
showToast("事件不能为空");
showToast("事件不能为空","The event cannot be empty!");
return;
}

@@ -311,7 +310,7 @@ public class AliyunIOTManager {
String mapEventData = val;
JSONObject object = JSONObject.parseObject(mapEventData);
if (object == null){
showToast("参数不能为空");
showToast("参数不能为空","The parameter cannot be null");
return;
}
if (event.getOutputData() != null) {
@@ -329,7 +328,7 @@ public class AliyunIOTManager {
if (parseData != DEF_VALUE) {
hashMap.put(arg.getIdentifier(), new ValueWrapper.IntValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
break;
}
continue;
@@ -339,7 +338,7 @@ public class AliyunIOTManager {
if (parseData != null) {
hashMap.put(arg.getIdentifier(), new ValueWrapper.DoubleValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
break;
}
continue;
@@ -349,7 +348,7 @@ public class AliyunIOTManager {
if (parseData != null) {
hashMap.put(arg.getIdentifier(), new ValueWrapper.DoubleValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
break;
}
continue;
@@ -359,7 +358,7 @@ public class AliyunIOTManager {
if (parseData == 0 || parseData == 1) {
hashMap.put(arg.getIdentifier(), new ValueWrapper.BooleanValueWrapper(parseData));
} else {
showToast("数据格式不对");
showToast("数据格式不对","Wrong data format");
break;
}
continue;
@@ -385,7 +384,6 @@ public class AliyunIOTManager {
}
} catch (Exception e) {
e.printStackTrace();
showToast("数据格式错误");
return;
}
try {
@@ -402,7 +400,7 @@ public class AliyunIOTManager {
}
} catch (Exception e) {
e.printStackTrace();
showToast("上报失败 " + e);
showToast("上报失败 ","Report failure");
}
}
//endregion
@@ -583,7 +581,17 @@ public class AliyunIOTManager {
{
ToastUtils.info(message);
}

private static void showToast(String message,String message_en)
{
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
message = message_en;
break;
case "zh":
break;
}
ToastUtils.info(message);
}
private boolean isValidDouble(String value) {
if (TextUtils.isEmpty(value)) {
return false;
@@ -636,7 +644,7 @@ public class AliyunIOTManager {
LinkKit.getInstance().getDeviceThing().thingPropertyPost(reportData, resourceListener);
} catch (Exception e) {
e.printStackTrace();
showToast("上报失败 " + e);
showToast("上报失败 " + e,"Report failure");
}
} else {
try {
@@ -648,7 +656,7 @@ public class AliyunIOTManager {
// thing.thingPropertyPost(reportData, resourceListener);
} catch (Exception e) {
e.printStackTrace();
showToast("上报失败 " + e);
showToast("上报失败 " + e,"Report failure");
}
}
}
@@ -660,13 +668,13 @@ public class AliyunIOTManager {
@Override
public void onSuccess(String alinkId, Object o) {
AppLog.d(TAG, "onSuccess() called with: alinkId = [" + alinkId + "], o = [" + o + "]");
showToast("设备状态上报上行成功(code=200),用户可以根据云端返回的data判断是否有不符合的属性上报");
showToast("设备状态上报上行成功(code=200),用户可以根据云端返回的data判断是否有不符合的属性上报","Success!");
}

@Override
public void onError(String alinkId, AError aError) {
AppLog.d(TAG, "onError() called with: alinkId = [" + alinkId + "], aError = [" + aError + "]");
showToast("设备上报状态失败");
showToast("设备上报状态失败","Fail");
}
};

@@ -677,7 +685,6 @@ public class AliyunIOTManager {
@Override
public void onProcess(String identify, Object result, ITResResponseCallback itResResponseCallback) {
Log.d(TAG, "onProcess() called with: s = [" + identify + "], o = [" + result + "], itResResponseCallback = [" + itResResponseCallback + "]");
showToast("收到异步服务调用 " + identify);
if (SERVICE_SET.equals(identify)) {
// TODO 用户按照真实设备的接口调用 设置设备的属性
// 设置完真实设备属性之后,上报设置完成的属性值
@@ -714,12 +721,12 @@ public class AliyunIOTManager {

@Override
public void onSuccess(Object o, OutputParams outputParams) {
showToast("注册服务成功");
showToast("注册服务成功","Sign service successful");
}

@Override
public void onFail(Object o, ErrorInfo errorInfo) {
showToast("注册服务失败");
showToast("注册服务失败","Sign service successful");
}
};
//endregion

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

@@ -73,7 +73,16 @@ public class ToastUtils {
public static void warning(@NonNull String message) {
warning(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show();
}

public static void warning(@NonNull String message,String message_en) {
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
message = message_en;
break;
case "zh":
break;
}
warning(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show();
}
public static void warning(@NonNull String message, int duration) {
warning(MainApplication.getContext(), message, duration, true).show();
}
@@ -117,6 +126,16 @@ public class ToastUtils {
}

public static void error(@NonNull String message) {
/*error(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show();*/
}
public static void error(@NonNull String message,String message_en) {
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
message = message_en;
break;
case "zh":
break;
}
error(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show();
}
//===========================================使用ApplicationContext 方法=========================


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

@@ -119,7 +119,7 @@ public class BottomNavigation2Activity extends BaseActivity {
}
private void test(){
if (ConfigName.getInstance().organizeMode == null && ConfigName.getInstance().cloudData != null) {
ToastUtils.warning("无组织信息不能上传,请设置当前店铺信息!!!");
ToastUtils.warning("无组织信息不能上传,请设置当前店铺信息!!!","Please set the store information");
return;
}
ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();


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

@@ -169,7 +169,7 @@ public class good_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
@Override
public void onClick(View view) {
if (isCloud) {
ToastUtils.warning("请先下载该商品!");
ToastUtils.warning("请先下载该商品!","Please download the product first!");
} else {
if (mListener != null) {
mListener.clickListenerNew(view, 4, mode);


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

@@ -433,7 +433,7 @@ public class Home1Fragment extends BaseFragment {
ExecuteTheRecipe.WritePLC("炒锅抽水", false, null);
}
} else {
ToastUtils.warning("请先控制锅口朝向:抽料位");
ToastUtils.warning("请先控制锅口朝向:抽料位","Please control the pan direction: Extract");
ExecuteTheRecipe.WritePLC("炒锅抽水", false, null);
}
return false;
@@ -450,7 +450,7 @@ public class Home1Fragment extends BaseFragment {
ExecuteTheRecipe.WritePLC("炒锅放水", false, null);
}
} else {
ToastUtils.warning("请先控制锅口朝向:清洗位");
ToastUtils.warning("请先控制锅口朝向:清洗位","Please control the pan direction: Clean");
ExecuteTheRecipe.WritePLC("炒锅放水", false, null);
}
return false;
@@ -1060,13 +1060,13 @@ public class Home1Fragment extends BaseFragment {
}

if (!ConfigName.getInstance().PlcIsConnect && !ConfigName.isTEST) {
ToastUtils.warning("PLC未准备就绪!!!");
ToastUtils.warning("PLC未准备就绪!!!","PLC not connected");
return;
}

Object chushiover = ExecuteTheRecipe.getListingValue("初始化完成");
if ((chushiover == null || !(boolean) chushiover) && !ConfigName.isTEST) {
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!");
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!","The device is not initialized!");
return;
}

@@ -1097,17 +1097,17 @@ public class Home1Fragment extends BaseFragment {
}

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)
.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();
@@ -1117,7 +1117,7 @@ public class Home1Fragment extends BaseFragment {
try {
val=Integer.parseInt(t);
} catch (Exception ex) {
ToastUtils.warning("输入格式出错!");
ToastUtils.warning("输入格式出错!","Input error!");
return;
}
ExecuteTheRecipe.WritePLC("清洗抽水量", val, null);
@@ -1129,7 +1129,7 @@ public class Home1Fragment extends BaseFragment {
ExecuteTheRecipe.BottomClick("深度清洗");
dialog.dismiss();
} else {
ToastUtils.warning("用量不能为空!");
ToastUtils.warning("用量不能为空!","Data cannot be empty!");
}
}
})
@@ -1213,14 +1213,14 @@ public class Home1Fragment extends BaseFragment {
*/
public boolean IsMake(boolean k) {
if (!ConfigName.getInstance().PlcIsConnect && !ConfigName.isTEST) {
ToastUtils.warning("PLC未准备就绪!!!");
ToastUtils.warning("PLC未准备就绪!!!","PLC not connected");
return false;
}

Object chushiover = ExecuteTheRecipe.getListingValue("初始化完成");
//Object jiting = ExecuteTheRecipe.getListingValue("设备急停");
if ((chushiover == null || !(boolean) chushiover) && !ConfigName.isTEST) {
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!");
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!","The device is not initialized!");
return false;
}

@@ -1230,7 +1230,7 @@ public class Home1Fragment extends BaseFragment {
// }

if (ExecuteTheRecipe.MakeStatus && k) {
ToastUtils.warning("客官,商品制作未结束请勿进行其他操作.请耐心等待商品制作结束!!!");
ToastUtils.warning("客官,商品制作未结束请勿进行其他操作.请耐心等待商品制作结束!!!","Product unfinished!");
return false;
}



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

@@ -437,7 +437,7 @@ public class HomeFragmentPR extends BaseFragment {
case 5: //打开制作窗体
//判断是否正在制作
if (ExecuteTheRecipe.IsStart) {
ToastUtils.warning("请耐心等待商品制作结束!!!");
ToastUtils.warning("请耐心等待商品制作结束!!!","Product unfinished!");
} else {
MessageManager.getInstance().sendMessage(MessageName.OpenMakeGoodFrom, goodid);
qupenren.setVisibility(View.GONE);


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

@@ -392,7 +392,6 @@ public class HomeFragmentSBKZ extends BaseFragment {
switch (view.getId()) {
case R.id.chushihua://初始化
ExecuteTheRecipe.BottomClick("初始化");
ToastUtils.warning("初始化");
break;
case R.id.zidongqingxi://自动清洗
// ExecuteTheRecipe.BottomClick("炒锅清洗");
@@ -419,7 +418,7 @@ public class HomeFragmentSBKZ extends BaseFragment {
try {
val=Integer.parseInt(t);
} catch (Exception ex) {
ToastUtils.warning("输入格式出错!");
ToastUtils.warning("输入格式出错!","Input error");
return;
}
ExecuteTheRecipe.WritePLC("清洗抽水量", val, null);
@@ -429,10 +428,9 @@ public class HomeFragmentSBKZ extends BaseFragment {

}
ExecuteTheRecipe.BottomClick("深度清洗");
ToastUtils.warning("自动清洗");
dialog.dismiss();
} else {
ToastUtils.warning("用量不能为空!");
ToastUtils.warning("用量不能为空!","Data cannot be empty!");
}
}
})


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

@@ -65,13 +65,13 @@ public class AutoTestActivity extends BaseActivity {
}

private void initTopBar() {
mTopBar.setTitle("模块自动测试");
mTopBar.setTitle(getString(R.string.top_autotest);
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(ExecuteTest.IsStart || ExecuteTheRecipe.MakeStatus)
{
ToastUtils.warning("请先结束任务!!!");
ToastUtils.warning("请先结束任务!!!","Please end the task first!");
return;
}else
{
@@ -85,13 +85,13 @@ public class AutoTestActivity extends BaseActivity {
public void onClick(View view) {
String s = edittext_quanxian.getText().toString();
if (s == null || s.isEmpty()) {
ToastUtils.warning("权限密码不能为空!");
ToastUtils.warning("权限密码不能为空!","The permission password cannot be empty!");
} else {
if (s.equals("bpa123456")) {
quanxian.setVisibility(View.GONE);
viewPager.setVisibility(View.VISIBLE);
} else {
ToastUtils.warning("权限密码不正确!");
ToastUtils.warning("权限密码不正确!","The permission password is incorrect!");
}
}
}


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

@@ -304,7 +304,7 @@ public class CookingActivity extends LinearLayout {
@Override
public void onClick(View view) {
if (ExecuteTheRecipe.IsStart) {
ToastUtils.warning("请等待制作完成后退出...");
ToastUtils.warning("请等待制作完成后退出...","Wait for it to finish...");
return;
}
setVisibility(View.GONE);


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

@@ -252,7 +252,7 @@ public class DishTestActivity extends BaseActivity {
@Override
public void onClick(View view) {
if (IsStart) {
ToastUtils.warning("请等待制作完成后退出...");
ToastUtils.warning("请等待制作完成后退出...","Wait for it to finish...");
return;
}
finish();
@@ -497,7 +497,7 @@ public class DishTestActivity extends BaseActivity {
case R.id.click_cpmc://菜品名称保存
String data = caipinmingchen_text.getText().toString();
if (data.isEmpty()) {
ToastUtils.warning("菜品名称不能为空!");
ToastUtils.warning("菜品名称不能为空!","The dish name cannot be empty!");
return;
}
DataBus.getInstance().ShowGoodName = data;
@@ -1465,7 +1465,7 @@ public class DishTestActivity extends BaseActivity {
try {
Double.parseDouble(t);
} catch (Exception ex) {
ToastUtils.warning("输入格式出错!");
ToastUtils.warning("输入格式出错!","Input error");
return;
}

@@ -1473,7 +1473,7 @@ public class DishTestActivity extends BaseActivity {

dialog.dismiss();
} else {
ToastUtils.warning("用量不能为空!");
ToastUtils.warning("用量不能为空!","Data connot be empty");
}
}
})


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

@@ -422,7 +422,7 @@ public class DiyActivity extends BaseActivity {
}
if(isfa==false)
{
ToastUtils.warning("加热工序之前,必须先添加搅拌工序!");
ToastUtils.warning("加热工序之前,必须先添加搅拌工序!","Add process [Stir] first");
return;
}
}
@@ -513,7 +513,7 @@ public class DiyActivity extends BaseActivity {

if(!IsHotJ())
{
ToastUtils.warning("加热工序之前,必须先添加搅拌工序!");
ToastUtils.warning("加热工序之前,必须先添加搅拌工序!","Add ");
return;
}



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

@@ -123,7 +123,7 @@ public class DiyMemoryActivity extends BaseActivity {
@Override
public void onClick(View view) {
if (isRun) {
ToastUtils.warning("请先结束烹饪!!!");
ToastUtils.warning("请先结束烹饪!!!","Please end cooking first");
} else {
finish();
}
@@ -332,12 +332,10 @@ public class DiyMemoryActivity extends BaseActivity {
*/
public boolean isRunClick() {
if (!isRun) {
ToastUtils.warning("请先开始计时器!!!");
return false;
}

if (isMake) {
ToastUtils.warning("请等待上一步骤结束!!!");
return false;
}



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

@@ -388,7 +388,7 @@ public class DiyUpdateActivity extends BaseActivity {
return pf;
}else
{
ToastUtils.info("数据验证失败,原因:"+description);
ToastUtils.info("数据验证失败","Data validation failure");
return null;
}
}catch (Exception ex)


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

@@ -173,7 +173,7 @@ public class QDListSectionAdapter extends QMUIDefaultStickySectionAdapter {
public void onClick(View view) {
if(isCloud)
{
ToastUtils.warning("请先下载该商品!");
ToastUtils.warning("请先下载该商品!","Download product first!");
}else
{
MessageManager.getInstance().sendMessage(MessageName.ClickGood, ((SectionItem)section.getItemAt(itemIndex)));


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

@@ -209,7 +209,7 @@ public class fragment_plc_control extends LinearLayout {
}
}, 500);

ToastUtils.info(model.name+"执行成功!");
ToastUtils.info(model.name+"执行成功!","Executed successfully!");
}
});
}


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

@@ -182,7 +182,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
user2.exp = "研发用户";
QueryDB.AddUser(user2);

ToastUtils.info("恢复出厂成功!");
ToastUtils.info("恢复出厂成功!","Factory restoration success!");
Initdata();
dialog.dismiss();
}
@@ -256,18 +256,18 @@ public class UserActivity extends BaseActivity implements MyClickListener {
break;
case R.id.zhanghao://修改物料名称按钮
final QMUIDialog.EditTextDialogBuilder builder1 = new QMUIDialog.EditTextDialogBuilder(this);
builder1.setTitle("用户账号")
.setPlaceholder("在此输入用户账号")
builder1.setTitle(getString(R.string.top_User))
.setPlaceholder(getString(R.string.text_User))
.setDefaultText(((BPA_USER) data).account)
.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) {
CharSequence text = builder1.getEditText().getText();
@@ -288,7 +288,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("不能为空!");
ToastUtils.info("不能为空!","Cannot be empty!");
}
}
})
@@ -296,29 +296,29 @@ public class UserActivity extends BaseActivity implements MyClickListener {
break;
case R.id.mima://修改物料名称按钮
final QMUIDialog.EditTextDialogBuilder builder2 = new QMUIDialog.EditTextDialogBuilder(this);
builder2.setTitle("用户密码")
.setPlaceholder("在此输入用户密码")
builder2.setTitle(getString(R.string.top_Password))
.setPlaceholder(R.string.text_Password)
.setDefaultText(((BPA_USER) data).pass)
.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.btn_cancel), new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
CharSequence text = builder2.getEditText().getText();
if (text != null && text.length() > 0) {
QueryDB.UpdateUserPass(((BPA_USER) data).id, text.toString());
Initdata();
ToastUtils.info("修改成功");
ToastUtils.info("修改成功","Revise successful");
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("不能为空!");
ToastUtils.info("不能为空!","Cannot be empty");
}
}
})
@@ -345,11 +345,11 @@ public class UserActivity extends BaseActivity implements MyClickListener {
if (names != null && !names.isEmpty()) {
QueryDB.UpdateUserRole(((BPA_USER) data).id, names);
Initdata();
ToastUtils.info("修改成功");
ToastUtils.info("修改成功","Revise successful");
dialog.dismiss();
} else {
//请填入昵称
ToastUtils.info("不能为空!");
ToastUtils.info("不能为空!","Cannot be empty");
return;
}
dialog.dismiss();
@@ -362,7 +362,6 @@ public class UserActivity extends BaseActivity implements MyClickListener {
case R.id.button_item://删除按钮
QueryDB.DeleteUser((BPA_USER) data);
Initdata();
ToastUtils.info("删除成功");
break;
}
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java View File

@@ -194,7 +194,7 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL
* 忘记密码
* */
private void forgotPassword() {
ToastUtils.info("请与管理员联系修改密码!");
ToastUtils.info("请与管理员联系修改密码!","Contact the administrator to change the password!");
}

// *************************以下为登录验证及跳转界面相关*************************//


+ 2
- 2
app/src/main/java/com/bonait/bnframework/test/TestActivity.java View File

@@ -151,7 +151,7 @@ public class TestActivity extends BaseActivity {
.execute(new FileProgressDialogCallBack2(this,totalSize) {
@Override
public void onSuccess(Response<File> response) {
ToastUtils.success("下载完成!");
ToastUtils.success(getString(R.string.text_downloadsuc));
}
});
}
@@ -163,7 +163,7 @@ public class TestActivity extends BaseActivity {
.execute(new FileProgressDialogCallBack(this) {
@Override
public void onSuccess(Response<File> response) {
ToastUtils.success("下载完成!");
ToastUtils.success(getString(R.string.text_downloadsuc));
}
});
}


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

@@ -47,6 +47,8 @@
<string name="btn_sign">SIGN</string>
<string name="text_Password">Please enter your password</string>
<string name="text_User">Please enter a username</string>
<string name="top_User">Username</string>
<string name="top_Password">Password</string>
<string name="text_Login_Fass">The username or password is incorrect!</string>
<string name="text_LoadInfo">The software is being initialized, please wait....</string>
<string name="text_Appstart">Starting...</string>
@@ -191,4 +193,5 @@
<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>
<string name="top_autotest">Auto test</string>
</resources>

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

@@ -47,6 +47,8 @@
<string name="btn_sign">登 录</string>
<string name="text_Password">请输入密码!</string>
<string name="text_User">请输入用户名</string>
<string name="top_User">用户名</string>
<string name="top_Password">密码</string>
<string name="text_Login_Fass">账号密码不正确!</string>
<string name="text_LoadInfo">软件初始化,加载中请稍后....</string>
<string name="text_Appstart">程序启动中...</string>
@@ -191,4 +193,5 @@
<string name="top_cleantip">深度清洗抽水用量</string>
<string name="top_cleaninfo">在此输入您的用量</string>
<string name="text_calibrationinfo">标定前需要排空管道</string>
<string name="top_autotest">模块自动测试</string>
</resources>

Loading…
Cancel
Save