Browse Source

lyw 上传

授权码生成工具
lyw 5 months ago
parent
commit
d937cc5391
19 changed files with 399 additions and 127 deletions
  1. +6
    -4
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  2. +1
    -1
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  3. +165
    -58
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  4. +31
    -0
      app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java
  5. +8
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  6. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/BunkerSetupActivity.java
  7. +4
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CookingActivity.java
  8. +6
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java
  9. +6
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/imagebuttom.java
  10. +110
    -30
      app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java
  11. +13
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/step/DiyStepAdapter.java
  12. +15
    -1
      app/src/main/java/com/bonait/bnframework/ui/widget/ProcessValueView.java
  13. +4
    -4
      app/src/main/res/layout/activity_cooking.xml
  14. +1
    -1
      app/src/main/res/layout/activity_edit_process.xml
  15. +7
    -2
      app/src/main/res/layout/item/layout/item_jingdutiao1.xml
  16. +4
    -4
      app/src/main/res/layout/item/layout/layout_add_goods_sel_classify.xml
  17. +3
    -8
      app/src/main/res/layout/item/layout/view_process_value.xml
  18. +7
    -0
      app/src/main/res/values-en/strings.xml
  19. +7
    -0
      app/src/main/res/values/strings.xml

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

@@ -1205,14 +1205,15 @@ public class ConfigData {
processTS = ConfigName.getInstance().Process_大炒;
} else if (ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本")) {
plcaddresses = ConfigName.getInstance().PlcAddress_大炒自动投料;
switch (ConfigName.getInstance().app.getString(R.string.language)){
processTS = ConfigName.getInstance().Process_大炒自动投料;
/*switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
processTS = ConfigName.getInstance().Process_大炒自动投料_en;
break;
case "zh":
processTS = ConfigName.getInstance().Process_大炒自动投料;
break;
}
}*/
} else if (ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) {
plcaddresses = ConfigName.getInstance().PlcAddress_小炒;
processTS = ConfigName.getInstance().Process_小炒;
@@ -1258,14 +1259,15 @@ public class ConfigData {
processTS = ConfigName.getInstance().Process_大炒;
} else if (ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本")) {
plcaddresses = ConfigName.getInstance().PlcAddress_大炒自动投料;
switch (ConfigName.getInstance().app.getString(R.string.language)){
processTS = ConfigName.getInstance().Process_大炒自动投料;
/*switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
processTS = ConfigName.getInstance().Process_大炒自动投料_en;
break;
case "zh":
processTS = ConfigName.getInstance().Process_大炒自动投料;
break;
}
}*/

} else if (ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) {
plcaddresses = ConfigName.getInstance().PlcAddress_小炒;


+ 1
- 1
app/src/main/java/com/bonait/bnframework/business/MainInit.java View File

@@ -274,7 +274,7 @@ public class MainInit {
}
}
}
ConfigData.getInstance().RevertPLCProcess();
if(QueryDB.GetPlcaddressALL().size()<=0)
{
ConfigData.getInstance().RevertPLCProcess();


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

@@ -2,6 +2,7 @@ package com.bonait.bnframework.common.constant;

import android.app.Application;
import android.content.Context;
import android.widget.Switch;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS;
@@ -19,6 +20,7 @@ import com.bonait.bnframework.common.utils.ScreenUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
@@ -730,6 +732,152 @@ public class ConfigName {
add(new Res_PLCADDRESS("搅拌电机", "VW350", 1, 0));
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
}
/**
* 大炒自动投料工序模型-中英文资源字典
*/
public ConcurrentHashMap<String,String> Process_info = new ConcurrentHashMap<String,String>(){{
put("搅拌","Stir");
put("位置","Possition");
put("加热","Heat");
put("主料","Material");
put("液体料","Liquor");
put("并行出料","Parallel Pour");
put("延迟","Delay");
put("出菜","Serve");
put("清洗","Clean");
put("搅拌速度","Stirring Rate");
put("延迟(秒)","Delay(s)");
put("转动速度","Turn Rate");
put("位置动作","Move");
put("加热功率","Heat Power");
put("主料名称","Name");
put("主料位置","Main Possition");
put("主料重量","Weight");
put("投料动作","Input Move");
put("炒制位置","Fry Bit");
put("烹饪(秒)","Cook(s)");
put("出料克数","Gram Weight");
put("等待(秒)","Wait(s)");
put("清洗方式","Way");
put("抽水量","Weight");
put("正转反转、一直正转、一直反转","Positive&Negative、Positive、Negative");
put("原点位、出餐启动、倒菜位、抽料位、清洗位、炒菜位1、炒菜位2、炒菜位3","Origin、Pour-start、Pour、Extract、Clean、Fry1、Fry2、Fry3");
put("1号位、2号位、3号位、4号位","1 Bit、2 Bit、3 Bit、4 Bit");
put("炒菜位1、炒菜位2、炒菜位3、原点位","Fry1、Fry2、Fry3、Origin");
put("投出等待三秒、直接投出、手动投料","Wait 3s、Direct Throw、Manual Throw");
put("停止、最低、低速、中速、高速、最高、极高","Stop、Lowest、Low、Middle、High、Highest、Extreme");
put( "停止、一档、二档、三档、四档、五档、六档、七档、八档","Stop、1Gear、2Gear、3Gear、4Gear、5Gear、6Gear、7Gear、8Gear");
put( "一般清洗、深度清洗","Normal、Depth");

put("一般清洗","Normal");
put("深度清洗","Depth");
put("正转反转","Positive&Negative");
put("一直正转","Positive");
put("一直反转","Negative");
put("原点位","Origin");
put("出餐启动","Pour-start");
put("倒菜位","Pour");
put("抽料位","Extract");
put("清洗位","Clean");
put("炒菜位1","Fry1");
put("炒菜位2","Fry2");
put("炒菜位3","Fry3");
put("1号位","1 Bit");
put("2号位","2 Bit");
put("3号位","3 Bit");
put("4号位","4 Bit");
put("投出等待三秒","Wait 3s");
put("直接投出","Direct Throw");
put("手动投料","Manual Throw");
put("停止","Stop");
put("最低","Lowest");
put("低速","Low");
put("中速","Middle");
put("高速","High");
put("最高","Highest");
put("极高","Extreme");
put("一档","1Gear");
put("二档","2Gear");
put("三档","3Gear");
put("四档","4Gear");
put("五档","5Gear");
put("六档","6Gear");
put("七档","7Gear");
put("八档","8Gear");

}};
public ConcurrentHashMap<String,String> Process_info_en = new ConcurrentHashMap<String,String>(){{
put("Positive&Negative","正转反转");
put("Positive","一直正转");
put("Negative","一直反转");
put("Origin","原点位");
put("Pour-start","出餐启动");
put("Pour","倒菜位");
put("Extract","抽料位");
put("Clean","清洗位");
put("Fry1","炒菜位1");
put("Fry2","炒菜位2");
put("Fry3","炒菜位3");
put("1 Bit","1号位");
put("2 Bit","2号位");
put("3 Bit","3号位");
put("4 Bit","4号位");
put("Wait 3s","投出等待三秒");
put("Direct Throw","直接投出");
put("Manual Throw","手动投料");
put("Stop","停止");
put("Lowest","最低");
put("Low","低速");
put("Middle","中速");
put("High","高速");
put("Highest","最高");
put("Extreme","极高");
put("1Gear","一档");
put("2Gear","二档");
put("3Gear","三档");
put("4Gear","四档");
put("5Gear","五档");
put("6Gear","六档");
put("7Gear","七档");
put("8Gear","八档");
put("Normal","一般清洗");
put("Depth","深度清洗");

put("Stir","搅拌");
put("Possition","位置");
put("Heat","加热");
put("Material","主料");
put("Liquor","液体料");
put("Parallel Pour","并行出料");
put("Delay","延迟");
put("Serve Dishes","出菜");
put("Clean","清洗");
put("Stirring Rate","搅拌速度");
put("Delay(s)","延迟(秒)");
put("Turn Rate","转动速度");
put("Move","位置动作");
put("Heat Power","加热功率");
put("Name","主料名称");
put("Main Possition","主料位置");
put("Weight","主料重量");
put("Input Move","投料动作");
put("Fry Bit","炒制位置");
put("Cook(s)","烹饪(秒)");
put("Gram Weight","出料克数");
put("Wait(s)","等待(秒)");
put("Way","清洗方式");
put("Weight","抽水量");


}};
/**
* 大炒自动投料工序模型
@@ -745,21 +893,6 @@ public class ConfigName {
add(new ProcessT("出菜", Arrays.asList("等待(秒)")));
add(new ProcessT("清洗", Arrays.asList("清洗方式","抽水量","等待(秒)")));

}};
/**
* 大炒自动投料工序模型
*/
public List<ProcessT> Process_大炒自动投料_en = new ArrayList<ProcessT>() {{
add(new ProcessT("Stir", Arrays.asList("Stirring Rate", "Delay(s)")));
add(new ProcessT("Possition", Arrays.asList("Turn Rate", "Move", "Delay(s)")));
add(new ProcessT("Heat", Arrays.asList("Heat Power", "Delay(s)")));
add(new ProcessT("Material", Arrays.asList("Name", "Main Possition", "Weight", "Input Move","Fry Bit","Cook(s)")));
add(new ProcessT("Liquor", new ArrayList<>()));
add(new ProcessT("Parallel Pour", Arrays.asList("Gram Weight","Delay(s)")));
add(new ProcessT("Delay", Arrays.asList("Delay(s)")));
add(new ProcessT("Serve Dishes", Arrays.asList("Delay(s)")));
add(new ProcessT("Clean", Arrays.asList("Way","Weight","Delay(s)")));

}};
/**
* 小炒基础PLC模型
@@ -1362,49 +1495,23 @@ public class ConfigName {
*/
public static String GetProcessTypeVal(String item) {
String data = "";
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
if (item.equals("FryMove")) {
data = "Positive&negative、Positive、negative";
} else if (item.equals("Move")) {
data = "Origin、Maintain、Pour、Extract、Clean、Fry1、Fry2、Fry3";
} else if (item.equals("Fry Bit")) {
data = "Fry1、Fry2、Fry3、Origin";
}else if (item.equals("Input Move")) {
//data = "投出抖动三次、投出等待三秒、直接投出、手动投料";
data = "Wait 3s、Direct Throw、Manual Throw";
}else if (item.equals("Way")) {
data = "Normal、Depth";
}
else if (item.equals("Main Possition")) {
data = "1Bit、2Bit、3Bit、4Bit";
} else if (item.equals("Positive") || item.equals("negative") || item.equals("Stirring Rate") || item.equals("Turn Rate")) {
data = "Stop、Lowest、Low、Middle、High、Highest、Extreme";
} else if (item.equals("Heat Power") || item.equals("热锅功率")) {
data = "Stop、1Gear、2Gear、3Gear、4Gear、5Gear、6Gear、7Gear、8Gear";
}
break;
case "zh":
if (item.equals("搅拌动作")) {
data = "正转反转、一直正转、一直反转";
} else if (item.equals("位置动作")) {
data = "原点位、出餐启动、倒菜位、抽料位、清洗位、炒菜位1、炒菜位2、炒菜位3";
} else if (item.equals("炒制位置")) {
data = "炒菜位1、炒菜位2、炒菜位3、原点位";
}else if (item.equals("投料动作")) {
//data = "投出抖动三次、投出等待三秒、直接投出、手动投料";
data = "投出等待三秒、直接投出、手动投料";
}else if (item.equals("清洗方式")) {
data = "一般清洗、深度清洗";
}
else if (item.equals("主料位置")) {
data = "1号位、2号位、3号位、4号位";
} else if (item.equals("正转速度") || item.equals("反转速度") || item.equals("转动速度") || item.equals("搅拌速度")) {
data = "停止、最低、低速、中速、高速、最高、极高";
} else if (item.equals("加热功率") || item.equals("热锅功率")) {
data = "停止、一档、二档、三档、四档、五档、六档、七档、八档";
}
break;
if (item.equals("搅拌动作")) {
data = "正转反转、一直正转、一直反转";
} else if (item.equals("位置动作")) {
data = "原点位、出餐启动、倒菜位、抽料位、清洗位、炒菜位1、炒菜位2、炒菜位3";
} else if (item.equals("炒制位置")) {
data = "炒菜位1、炒菜位2、炒菜位3、原点位";
} else if (item.equals("投料动作")) {
//data = "投出抖动三次、投出等待三秒、直接投出、手动投料";
data = "投出等待三秒、直接投出、手动投料";
} else if (item.equals("清洗方式")) {
data = "一般清洗、深度清洗";
} else if (item.equals("主料位置")) {
data = "1号位、2号位、3号位、4号位";
} else if (item.equals("正转速度") || item.equals("反转速度") || item.equals("转动速度") || item.equals("搅拌速度")) {
data = "停止、最低、低速、中速、高速、最高、极高";
} else if (item.equals("加热功率") || item.equals("热锅功率")) {
data = "停止、一档、二档、三档、四档、五档、六档、七档、八档";
}
return data;
}


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

@@ -1,6 +1,7 @@
package com.bonait.bnframework.common.utils;

import android.content.Context;
import android.provider.ContactsContract;
import android.view.View;
import android.widget.TextView;

@@ -76,6 +77,36 @@ public class AlertDialogUtils {
.create(mCurrentDialogStyle).show();
}

/**
* 对话框,有取消确定按钮
* */
public static void showDialog(Context context, String title, String message,String title_en,String message_en, QMUIDialogAction.ActionListener onClickListener) {
String top = "";
String mes="";
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
top = title_en;
mes = message_en;
break;
case "zh":
top = title;
mes = message;
break;
}
new QMUIDialog.MessageDialogBuilder(context)
.setCancelable(false)
.setTitle(top)
.setMessage(mes)
.setCanceledOnTouchOutside(false)
.addAction(ConfigName.getInstance().app.getString(R.string.btn_cancel), new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
dialog.dismiss();
}
})
.addAction(ConfigName.getInstance().app.getString(R.string.tip_save_confirm), onClickListener)
.create(mCurrentDialogStyle).show();
}
/**
* 对话框,自定义确定按钮
* */


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

@@ -207,7 +207,7 @@ public class Home1Fragment extends BaseFragment {
ExecuteTheRecipe.MakeStatus = false;

mTopBar.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.app_color_theme_4));
mTopBar.setTitle("菜谱烹饪");
mTopBar.setTitle(getString(R.string.text_cooking));

}

@@ -258,7 +258,7 @@ public class Home1Fragment extends BaseFragment {
if (!IsMake(true)) {
return;
}
gongxumiaoshu.setText("等待开始");
gongxumiaoshu.setText(getString(R.string.text_waitstart));
goodGroup = (BPA_GOODS_SUBATTRIBUTE_GROUP)data;
good = GoodsDBUtil.getById(goodGroup.goodsId);
SetBottonStatus(false);
@@ -1042,8 +1042,10 @@ public class Home1Fragment extends BaseFragment {
// return;
//按钮点击
String title = "停止操作提示!";
String title_en = "Stop operation!";
String message_en ="Are you sure you want to stop production!";
String message = "请问客官确定要停止制作吗,小菠萝会生气的,啊啊啊啊啊啊啊...我的饭饭?";
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
AlertDialogUtils.showDialog(context, title, message,title_en,message_en, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
//强制结束
@@ -1070,8 +1072,10 @@ public class Home1Fragment extends BaseFragment {

//按钮点击
String title = "开始操作提示!";
String title_en = "Start operation!";
String message_en ="Are you sure you want to start production!";
String message = "请问客官确定要开始制作吗,小菠萝好开心呀,马上就有好吃的耶?";
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
AlertDialogUtils.showDialog(context, title, message,title_en,message_en, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
ExecuteTheRecipe.StopForcedEnd();


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

@@ -77,7 +77,7 @@ public class BunkerSetupActivity extends BaseActivity {
*/
private void initTopBar() {
mTopBar.setBackgroundColor(ContextCompat.getColor(context, R.color.topbj1));
mTopBar.setTitle("料仓设置");
mTopBar.setTitle(getString(R.string.text_home_SZ));
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {


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

@@ -186,7 +186,7 @@ public class CookingActivity extends LinearLayout {
SetReset();
SetRest1();
SetProcess(goodsGroup.maketime, 0);
SetMiaoShu("等待开始...");
SetMiaoShu(ConfigName.getInstance().app.getString(R.string.text_waitstart));
runtime.setText(formatTime(goodsGroup.maketime));

if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本") || ConfigName.getInstance().versionSelectionEnum.contains("一拖")) {
@@ -216,7 +216,7 @@ public class CookingActivity extends LinearLayout {
* @param
*/
public void SetMiaoShuTime(int time) {
gongxutime.setText("预计等待:"+time+"s");
gongxutime.setText(ConfigName.getInstance().app.getString(R.string.text_expect)+time+"s");
}

/**
@@ -237,7 +237,7 @@ public class CookingActivity extends LinearLayout {
* 复位
*/
public void SetReset() {
SetMiaoShu("等待开始...");
SetMiaoShu(ConfigName.getInstance().app.getString(R.string.text_waitstart));
zanting_goodmake.SetStatus(false);
zanting_goodmake.setVisibility(View.GONE);
}
@@ -299,7 +299,7 @@ public class CookingActivity extends LinearLayout {
*/
private void initTopBar() {
mTopBar.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.topbj1));
mTopBar.setTitle("菜谱烹饪");
mTopBar.setTitle(ConfigName.getInstance().app.getString(R.string.text_cooking));
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {


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

@@ -209,8 +209,10 @@ public class DiyMemoryActivity extends BaseActivity {
case R.id.startbutton://启动 停止
if (isRun) {
String title = "停止操作提示!";
String title_en = "Stop operation!";
String message_en ="Are you sure you want to stop production!";
String message = "请问客官确定要停止制作吗,小菠萝会生气的,啊啊啊啊啊啊啊...我的饭饭?";
AlertDialogUtils.showDialog(view.getContext(), title, message, new QMUIDialogAction.ActionListener() {
AlertDialogUtils.showDialog(view.getContext(), title, message,title_en,message_en, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
StopTime();
@@ -220,8 +222,10 @@ public class DiyMemoryActivity extends BaseActivity {
} else {

String title = "开始操作提示!";
String title_en = "Start operation!";
String message_en ="Are you sure you want to start production!";
String message = "请问客官确定要开始制作吗,小菠萝好开心呀,马上就有好吃的耶?";
AlertDialogUtils.showDialog(view.getContext(), title, message, new QMUIDialogAction.ActionListener() {
AlertDialogUtils.showDialog(view.getContext(), title, message,title_en,message_en, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
StartTime();


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

@@ -82,8 +82,10 @@ public class imagebuttom extends LinearLayout {
if(Status)
{
String title = "停止操作提示!";
String title_en = "Stop operation!";
String message_en ="Are you sure you want to stop production!";
String message = "请问客官确定要停止制作吗,小菠萝会生气的,啊啊啊啊啊啊啊...我的饭饭?";
AlertDialogUtils.showDialog(getContext(), title, message, new QMUIDialogAction.ActionListener() {
AlertDialogUtils.showDialog(getContext(), title, message,title_en,message_en, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
//强制结束
@@ -110,8 +112,10 @@ public class imagebuttom extends LinearLayout {
}

String title = "开始操作提示!";
String title_en = "Start operation!";
String message_en ="Are you sure you want to start production!";
String message = "请问客官确定要开始制作吗,小菠萝好开心呀,马上就有好吃的耶?";
AlertDialogUtils.showDialog(getContext(), title, message, new QMUIDialogAction.ActionListener() {
AlertDialogUtils.showDialog(getContext(), title, message,title_en,message_en, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
ExecuteTheRecipe.StopForcedEnd();


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

@@ -8,6 +8,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AdapterView;
@@ -353,8 +354,16 @@ public class DiyProcessActivity extends BaseActivity {
int i = 0;
String id = "";
for (BPA_PROCESS item : data) {
processMap.put(item.name, item.id);
processMapIndex.put(item.name, i);
switch (getString(R.string.language)){
case "en":
processMap.put(ConfigName.getInstance().Process_info.get(item.name),item.id);
processMapIndex.put(item.name, i);
break;
case "zh":
processMap.put(item.name, item.id);
processMapIndex.put(item.name, i);
break;
}
if (i == 0) {
id = item.id;
}
@@ -455,14 +464,23 @@ public class DiyProcessActivity extends BaseActivity {
int index_update = stepAdapter.getCurrentPosition();
if (index_update >= 0 && index_update < processDetails.size()) {
BPA_GOODS_PROCESS_DETAIL obj_update = (BPA_GOODS_PROCESS_DETAIL) processDetails.get(index_update);
String selectname = viewBinding.spinnerProcess.getSelectedItem().toString();
if (!obj_update.processname.equals(selectname)) {
NewToastUtil.getInstance().showToast("修改失败,选中步骤名称不相同!");
return;
if (obj_update!=null){
String selectname = viewBinding.spinnerProcess.getSelectedItem().toString();
switch (getString(R.string.language)){
case "en":
selectname = ConfigName.getInstance().Process_info_en.get(selectname);
break;
case "zh":
break;
}
if (!obj_update.processname.equals(selectname)) {
NewToastUtil.getInstance().showToast("修改失败,选中步骤名称不相同!");
return;
}
processDetails.set(index_update, getSelectItemFromValue());
stepAdapter.notifyDataSetChanged();
NewToastUtil.getInstance().showToast("修改步骤[" + (index_update + 1) + ":" + obj_update.processname + "]成功!");
}
processDetails.set(index_update, getSelectItemFromValue());
stepAdapter.notifyDataSetChanged();
NewToastUtil.getInstance().showToast("修改步骤[" + (index_update + 1) + ":" + obj_update.processname + "]成功!");
} else {
NewToastUtil.getInstance().showToast("请先选择步骤!");
}
@@ -496,8 +514,11 @@ public class DiyProcessActivity extends BaseActivity {
public BPA_GOODS_PROCESS_DETAIL getSelectItemFromValue() {
BPA_GOODS_PROCESS_DETAIL processDetail = new BPA_GOODS_PROCESS_DETAIL();
try {
ArrayList<BPA_PROCESS> data_1 = QueryDB.GetProcessALL();
processDetail.goodsSubAttributeGroupId = subAttributeGroupId;
String name = viewBinding.spinnerProcess.getSelectedItem().toString();
long t= viewBinding.spinnerProcess.getSelectedItemId();
String name = data_1.get((int) t).name;
/*String name = viewBinding.spinnerProcess.getSelectedItem().toString();*/
boolean IsVerify = true;
StringBuilder description = new StringBuilder();
// 延迟,100|延迟,100|延迟,100|延迟,100|
@@ -525,26 +546,48 @@ public class DiyProcessActivity extends BaseActivity {
for (int i = 0; i < viewBinding.llProcessValue.getChildCount(); i++) {
ProcessValueView viw = (ProcessValueView) viewBinding.llProcessValue.getChildAt(i);
String values = viw.GetValues();
String modelname = "";
switch (getString(R.string.language)){
case "en":
if (ConfigName.getInstance().Process_info_en.get(values)!=null){
values =ConfigName.getInstance().Process_info_en.get(values);
}
if (ConfigName.getInstance().Process_info_en.get(viw.model.name) != null){
modelname = ConfigName.getInstance().Process_info_en.get(viw.model.name);
}else {
modelname = viw.model.name;
}
break;
case "zh":
modelname = viw.model.name;
break;
}


if (values.isEmpty()) {
IsVerify = false;
description.append(viw.model.name).append("不能为空");
} else {
data.append(viw.model.name).append(",").append(values).append("|");
desc.append(values).append(",");
if (ConfigName.getInstance().Process_info_en.get(values) != null) {
data.append(modelname).append(",").append(ConfigName.getInstance().Process_info_en.get(values)).append("|");
desc.append(ConfigName.getInstance().Process_info_en.get(values)).append(",");
} else {
data.append(modelname).append(",").append(values).append("|");
desc.append(values).append(",");
}
}

// if(viw.model.name.contains("位置")){
// position = Integer.parseInt(values.replace("号位",""));
// }
if(viw.model.name.contains("主料名称")){
/* if(modelname.contains("位置")){
position = Integer.parseInt(values.replace("号位","").replace(" Bit",""));
}*/
if(modelname.contains("主料名称")){
mainFoodName = values;
}
}
if(position>0){
/*if(mainFoodName!=""){
LogUtils.d(TAG+" getSelectItemFromValue 修改主料名称 old mainFoods="+mainFoods.toString());
mainFoods.set(position-1,mainFoodName);
LogUtils.d(TAG+" getSelectItemFromValue 修改主料名称 new mainFoods="+mainFoods.toString());
}
}*/
}
if (IsVerify) {
processDetail.processname = name;
@@ -561,6 +604,10 @@ public class DiyProcessActivity extends BaseActivity {
}
}

public BPA_GOODS_PROCESS_DETAIL getProcessValue_tozh(){
BPA_GOODS_PROCESS_DETAIL processDetail = new BPA_GOODS_PROCESS_DETAIL();
return processDetail;
}
/**
* 移动光标 选中步骤
* @param index
@@ -641,10 +688,20 @@ public class DiyProcessActivity extends BaseActivity {
LogUtils.d("SelectItemFrom 1");
for (BPA_PROCESSModel item : mode) {
item_gx gx = new item_gx();
gx.datatype = item.datatype;
gx.name = item.name;
gx.data = item.data;
gx.IsWL = false;
switch (getString(R.string.language)){
case "en":
gx.datatype = item.datatype;
gx.name = ConfigName.getInstance().Process_info.get(item.name);
gx.data = ConfigName.getInstance().Process_info.get(item.data);
gx.IsWL = false;
break;
case "zh":
gx.datatype = item.datatype;
gx.name = item.name;
gx.data = item.data;
gx.IsWL = false;
break;
}
ProcessValueView view = new ProcessValueView(this, null, gx);
if(item.datatype == 2){
view.setListener(spinnerSelectListener);
@@ -678,14 +735,18 @@ public class DiyProcessActivity extends BaseActivity {

@Override
public void onSelect(int position,String name) {
for (int i = 0; i < viewBinding.llProcessValue.getChildCount(); i++) {
/*for (int i = 0; i < viewBinding.llProcessValue.getChildCount(); i++) {
ProcessValueView processValueView = (ProcessValueView) viewBinding.llProcessValue.getChildAt(i);
if(processValueView.model.name.equals("主料名称")){
String processName = "";
if (ConfigName.getInstance().Process_info_en.get(processValueView.model.name)!=null){
processName = ConfigName.getInstance().Process_info_en.get(processValueView.model.name);
}
if(processValueView.model.name.equals("主料名称")||processName.equals("主料名称")){
if(!mainFoods.isEmpty() && mainFoods.size()>position){
processValueView.setMainFoodName(mainFoods.get(position));
}
}
}
}*/
}


@@ -707,15 +768,34 @@ public class DiyProcessActivity extends BaseActivity {

for (int i = 0; i < viewBinding.llProcessValue.getChildCount(); i++) {
ProcessValueView processValueView = (ProcessValueView) viewBinding.llProcessValue.getChildAt(i);
String res = formulation.get(processValueView.model.name);
LogUtils.d(" updateProcessSpinner res="+res+";processValueView.model.name="+processValueView.model.name);
String res="";
switch (getString(R.string.language)){
case "en":
String processname = "";
if (ConfigName.getInstance().Process_info_en.get(processValueView.model.name)!=null){
processname = ConfigName.getInstance().Process_info_en.get(processValueView.model.name);
}else {
processname = processValueView.model.name;
}
res = formulation.get(processname);
LogUtils.d(" updateProcessSpinner res="+res+";processValueView.model.name="+processname);
break;
case "zh":
res = formulation.get(processValueView.model.name);
LogUtils.d(" updateProcessSpinner res="+res+";processValueView.model.name="+processValueView.model.name);
break;
}
if (res != null) {
processValueView.SetValues(res);
}else {
if(processValueView.model.name.equals("主料名称")){
String processModelName = "";
if (ConfigName.getInstance().Process_info_en.get(processValueView.model.name)!=null){
processModelName=ConfigName.getInstance().Process_info_en.get(processValueView.model.name);
}
if(processValueView.model.name.equals("主料名称")||processModelName.equals("主料名称")){
processValueView.setMainFoodName(mainFoods.get(0));
}
if(processValueView.model.name.contains("正转时间")||processValueView.model.name.contains("反转时间")){
if(processValueView.model.name.contains("正转时间")||processValueView.model.name.contains("反转时间")||processModelName.contains("反转时间")||processModelName.contains("反转时间")){
processValueView.SetValues("3");
}
}


+ 13
- 1
app/src/main/java/com/bonait/bnframework/ui/adapter/step/DiyStepAdapter.java View File

@@ -6,6 +6,9 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
import com.bonait.bnframework.databinding.ItemStepBinding;
import com.bonait.bnframework.ui.adapter.BaseAdapter;
@@ -33,7 +36,16 @@ public abstract class DiyStepAdapter extends BaseAdapter<BPA_GOODS_PROCESS_DETAI
holder.binding.root.setSelected(mCurrentPosition == position);
holder.binding.removeUp.setVisibility(mCurrentPosition == position?View.VISIBLE:View.GONE);
holder.binding.removeDown.setVisibility(mCurrentPosition == position?View.VISIBLE:View.GONE);
holder.binding.name.setText((position+1)+"."+mData.get(position).processname);
String processName = "";
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
processName = ConfigName.getInstance().Process_info.get(mData.get(position).processname);
break;
case "zh":
processName = mData.get(position).processname;
break;
}
holder.binding.name.setText((position+1)+"."+processName);
holder.binding.root.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {


+ 15
- 1
app/src/main/java/com/bonait/bnframework/ui/widget/ProcessValueView.java View File

@@ -10,6 +10,7 @@ import android.widget.ArrayAdapter;
import android.widget.RelativeLayout;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.databinding.ViewProcessValueBinding;
import com.bonait.bnframework.modules.home.fragment.mode.item_gx;
import com.bonait.bnframework.ui.util.DisplayManager;
@@ -182,10 +183,23 @@ public class ProcessValueView extends RelativeLayout {
}
break;
case 2://选项
switch (ConfigName.getInstance().app.getString(R.string.language)){
case "en":
if (ConfigName.getInstance().Process_info.get(value)!=null){
value = ConfigName.getInstance().Process_info.get(value);
}
break;
case "zh":
break;
}
Object res= editsp_map.get(value);
if(res!=null)
{
if(viewBinding.name.getText().toString().equals("搅拌档位")){
String name ="";
if (ConfigName.getInstance().Process_info_en.get(viewBinding.name.getText().toString())!=null){
name = ConfigName.getInstance().Process_info_en.get(viewBinding.name.getText().toString());
}
if(viewBinding.name.getText().toString().equals("搅拌档位")||name.equals("搅拌档位")){
viewBinding.spinner.setSelection(Math.min(((int)res-1),4));
}else {
viewBinding.spinner.setSelection((int)res-1);


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

@@ -108,7 +108,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="5dp"
android:text="预计等待:0"
android:text="@string/text_expect"
android:textColor="#797373"
android:textSize="14dp" />
</LinearLayout>
@@ -161,7 +161,7 @@
android:layout_width="150dp"
android:layout_height="80dp"
android:contentDescription="false"
android:tag="翻炒速度-按钮"
android:tag="@string/btn_fry_sp"
app:imagesrc_ks="@mipmap/sb1"
app:imagesrc_qt="@mipmap/sb2"
app:imagesrc_tz="@mipmap/sb3" />
@@ -321,7 +321,7 @@
android:layout_width="100dp"
android:layout_height="60dp"
android:contentDescription="false"
android:tag="液料"
android:tag="@string/btn_liquid"
app:imagesrc_ks="@mipmap/sb1"
app:imagesrc_qt="@mipmap/sb2"
app:imagesrc_tz="@mipmap/sb3" />
@@ -350,7 +350,7 @@
android:layout_width="100dp"
android:layout_height="90dp"
android:contentDescription="false"
android:tag="锅口朝向-按钮"
android:tag="@string/btn_pot"
app:imagesrc_ks="@mipmap/sb1"
app:imagesrc_qt="@mipmap/sb2"
app:imagesrc_tz="@mipmap/sb3" />


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

@@ -145,7 +145,7 @@
<!--模拟炒制-->
<TextView
android:id="@+id/btn_simulation"
android:layout_width="@dimen/dp_240"
android:layout_width="@dimen/dp_280"
style="@style/TextView_btn_normal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"


+ 7
- 2
app/src/main/res/layout/item/layout/item_jingdutiao1.xml View File

@@ -70,11 +70,16 @@
android:textStyle="bold" />
</RelativeLayout>

<RelativeLayout
<TextView
android:layout_marginRight="-2dp"
android:layout_alignParentRight="true"
android:layout_width="60dp"
android:layout_height="40dp"
android:background="@mipmap/silos_sz"/>
android:text="@string/btn_waterset"
android:textSize="25dp"
android:textColor="@color/white"
android:textStyle="bold"
android:gravity="center"
android:background="@drawable/bg_round10_yellow2_btn"/>

</RelativeLayout>

+ 4
- 4
app/src/main/res/layout/item/layout/layout_add_goods_sel_classify.xml View File

@@ -14,7 +14,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:background="@drawable/bg_round25_top_yellow"
style="@style/TextView_btn_dialog"
android:text="选择分类"
android:text="@string/btn_selectclass"
/>

<TextView
@@ -25,7 +25,7 @@
android:layout_marginLeft="@dimen/dp_50"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_130"
android:text="选择分类:"
android:text="@string/btn_selectclass_1"
style="@style/TextView_desc"
/>

@@ -49,7 +49,7 @@
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_20"
style="@style/TextView_btn_dialog"
android:text="取消"
android:text="@string/btn_cancel"
/>

<TextView
@@ -61,7 +61,7 @@
android:layout_marginLeft="@dimen/dp_480"
android:layout_marginBottom="@dimen/dp_20"
style="@style/TextView_btn_dialog"
android:text="下一步"
android:text="@string/btn_next"
/>

<ImageView


+ 3
- 8
app/src/main/res/layout/item/layout/view_process_value.xml View File

@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_430"
android:layout_width="430dp"
android:layout_height="@dimen/dp_70"
android:layout_marginBottom="@dimen/dp_10"
android:id="@+id/root"
@@ -17,14 +17,11 @@
android:buttonTint="@color/radiusImageView_selected_mask_color"/>
<TextView
android:id="@+id/name"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:layout_width="@dimen/dp_190"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_70"
tools:text="液体料液体料液体料"
tools:text="Main Possition"
android:textSize="25dp"
android:maxLines="1"
android:maxLength="10"
android:gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/check"
@@ -45,8 +42,6 @@
android:layout_height="@dimen/dp_70"
android:background="@drawable/input_bj"
android:layout_alignParentRight="true"
android:inputType="text"
android:maxLines="1"
android:padding="@dimen/dp_3"
android:textSize="@dimen/sp_32" />
</RelativeLayout>

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

@@ -79,6 +79,7 @@
<string name="text_potdirection_1">Please control the pan direction: Extraction Position</string>
<string name="text_potdirection_2">Please control the pan direction: Clean Position</string>
<string name="text_waterset">Null</string>
<string name="btn_waterset">Set</string>
<string name="btn_pourmeal">Pour Out Meal-按钮</string>
<string name="btn_putmeal">Feed-按钮</string>
<string name="text_waitput">Please wait for the end of the last feeding!!!</string>
@@ -137,6 +138,8 @@
<string name="info_selectprocess">Please select the subattribute for each row!</string>
<string name="btn_addclass">Add Class</string>
<string name="text_deleteinfo">Delete or Not?</string>
<string name="btn_selectclass">Select Class</string>
<string name="btn_selectclass_1">Select Class:</string>
<string name="top_editclass">Edit Class</string>
<string name="text_noselect">Unselect</string>
<string name="text_attribute">Attribute</string>
@@ -160,4 +163,8 @@
<string name="text_haveprocess_1">Existential process</string>
<string name="text_haveprocess_2">Non-existent process</string>
<string name="text_haveprocess_3">Unable to import while editing</string>
<string name="text_cooking">Cooking</string>
<string name="text_waitstart">Wait starting</string>
<string name="text_expect">Expect to wait</string>
<string name="btn_liquid">Liquid</string>
</resources>

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

@@ -79,6 +79,7 @@
<string name="text_potdirection_1">请先控制锅口朝向:抽料位</string>
<string name="text_potdirection_2">请先控制锅口朝向:清洗位</string>
<string name="text_waterset">未设置</string>
<string name="btn_waterset">设置</string>
<string name="btn_pourmeal">出 餐-按钮</string>
<string name="btn_putmeal">投料-按钮</string>
<string name="text_waitput">请耐心等待上一次投料结束!!!</string>
@@ -135,6 +136,8 @@
<string name="info_datanull">数据为空</string>
<string name="info_editprocess">该组合没有工序,请先编辑工序</string>
<string name="info_selectprocess">请选择每行对应的子属性!</string>
<string name="btn_selectclass">选择分类</string>
<string name="btn_selectclass_1">选择分类:</string>
<string name="btn_addclass">添加分类</string>
<string name="text_deleteinfo">是否删除?</string>
<string name="top_editclass">编辑分类</string>
@@ -160,4 +163,8 @@
<string name="text_haveprocess_1">存在分组</string>
<string name="text_haveprocess_2">不存在分组</string>
<string name="text_haveprocess_3">正在编辑无法导入</string>
<string name="text_cooking">菜谱烹饪</string>
<string name="text_waitstart">等待开始</string>
<string name="text_expect">预计等待</string>
<string name="btn_liquid">液料</string>
</resources>

Loading…
Cancel
Save