From 937d3a9a1a3dc700af5e6f22df86093d38f890da Mon Sep 17 00:00:00 2001
From: liup <1454939542@qq.com>
Date: Sat, 23 Nov 2024 14:45:18 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/other.xml | 2 +-
app/build.gradle | 2 +-
app/release/output-metadata.json | 2 +-
.../bonait/bnframework/business/MainInit.java | 4 +-
.../common/constant/ConfigName.java | 14 +-
.../bnframework/modbus/ModbusCenter.java | 68 +++---
.../dialog/control/WokControlDialog.java | 201 +++++++++++-------
.../new/layout/dialog_chaoguo_control.xml | 2 +-
8 files changed, 167 insertions(+), 128 deletions(-)
diff --git a/.idea/other.xml b/.idea/other.xml
index 49481ad4..104e542e 100644
--- a/.idea/other.xml
+++ b/.idea/other.xml
@@ -262,7 +262,7 @@
-
+
diff --git a/app/build.gradle b/app/build.gradle
index 29b847c9..4a254f62 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -86,7 +86,7 @@ android {
ndkVersion '28.0.12433566 rc1'
applicationVariants.all { variant ->
variant.outputs.all {
- outputFileName = "robot-xiaochao-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk"
+ outputFileName = "robot-xiaochao-v${defaultConfig.versionCode}-${releaseTime()}"+"-signed-${variant.name}.apk"
}
}
}
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
index 1911c510..151936d9 100644
--- a/app/release/output-metadata.json
+++ b/app/release/output-metadata.json
@@ -13,7 +13,7 @@
"attributes": [],
"versionCode": 105,
"versionName": "1.0.5",
- "outputFile": "robot-xiaochao-v105-202411071556-unsigned-release.apk"
+ "outputFile": "robot-xiaochao-v105-202411141544-signed-release.apk"
}
],
"elementType": "File"
diff --git a/app/src/main/java/com/bonait/bnframework/business/MainInit.java b/app/src/main/java/com/bonait/bnframework/business/MainInit.java
index 0754122f..c3e7a1d1 100644
--- a/app/src/main/java/com/bonait/bnframework/business/MainInit.java
+++ b/app/src/main/java/com/bonait/bnframework/business/MainInit.java
@@ -220,8 +220,8 @@ public class MainInit {
}
- if(QueryDB.GetProcessALL().isEmpty() || PreferenceUtils.getInt("PlcInit",3)==3){
- PreferenceUtils.setInt("PlcInit",4);
+ if(QueryDB.GetProcessALL().isEmpty() || PreferenceUtils.getInt("PlcInit",4)!=5){
+ PreferenceUtils.setInt("PlcInit",5);
ConfigData.getInstance().RevertPLCProcess();
}
diff --git a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
index 708af92f..6e8195de 100644
--- a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
+++ b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
@@ -33,7 +33,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class ConfigName {
//是否是测试模式
- public final static boolean TEST = true;
+ public final static boolean TEST = false;
//崩溃重启
public final static boolean ERROR_ROOT = false;
//日志打印
@@ -112,14 +112,7 @@ public class ConfigName {
*/
public String fireNum1 = "";
public String fireNum2 = "";
- /**
- * 翻炒速度
- */
- public String fanchaoSpeed = "";
- /**
- * 锅口朝向
- */
- public String guokouChaoxiang = "";
+
public static String dataPath = "/hbldbWokRobot";
@@ -241,6 +234,7 @@ public class ConfigName {
add(new Res_PLCADDRESS("设备急停", "M40.1", 1, 0));
add(new Res_PLCADDRESS("原点位反馈", "M40.2", 1, 0));
add(new Res_PLCADDRESS("抽料位反馈", "M40.3", 1, 0));
+ add(new Res_PLCADDRESS("维护位反馈", "M48.0", 1, 0));
add(new Res_PLCADDRESS("炒菜位1反馈", "M40.4", 0, 0));
add(new Res_PLCADDRESS("炒菜位2反馈", "M40.5", 0, 0));
add(new Res_PLCADDRESS("炒菜位高反馈", "M40.4", 0, 0));
@@ -483,7 +477,7 @@ public class ConfigName {
}
public void checkPositionList(){
- LogUtils.d("ReadPositionStatusPLC positionList="+positionList.size());
+// LogUtils.d("ReadPositionStatusPLC positionList="+positionList.size());
for (Map.Entry entry : positionList.entrySet()) {
String key = entry.getKey();
CheckPositionBean value = entry.getValue();
diff --git a/app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java b/app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java
index 1d064b46..1f171892 100644
--- a/app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java
+++ b/app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java
@@ -95,17 +95,17 @@ public class ModbusCenter {
if(Wok1ModbusTcpServer.get().plcIsConnect){
int i = 0;
for (Res_PLCADDRESS item : ConfigName.getInstance().PlcAddress_Wok) {
- i++;
- if(i == 5){
- if (Wok2ModbusTcpServer.get().plcIsConnect) {
- WritePlc(2,"心跳位", 0, null);
- }
- if (Wok1ModbusTcpServer.get().plcIsConnect) {
- WritePlc(1,"心跳位", 0, null);
- }
- }
if(item!=null){
if (item.isread == 1) {
+ i++;
+ if(i == 5){
+ if (Wok2ModbusTcpServer.get().plcIsConnect) {
+ WritePlc(2,"心跳位", 0, null);
+ }
+ if (Wok1ModbusTcpServer.get().plcIsConnect) {
+ WritePlc(1,"心跳位", 0, null);
+ }
+ }
if(Wok1ModbusTcpServer.get().plcIsConnect){
Object val = wokReadPlc(1,item.name);
Wok1ModbusTcpServer.get().listeningValue.put(item.name, val);
@@ -158,17 +158,18 @@ public class ModbusCenter {
if(Wok2ModbusTcpServer.get().plcIsConnect){
int i=0;
for (Res_PLCADDRESS item : ConfigName.getInstance().PlcAddress_Wok) {
- i++;
- if(i == 5){
- if (Wok2ModbusTcpServer.get().plcIsConnect) {
- WritePlc(2,"心跳位", 0, null);
- }
- if (Wok1ModbusTcpServer.get().plcIsConnect) {
- WritePlc(1,"心跳位", 0, null);
- }
- }
+
if(item!=null){
if (item.isread == 1) {
+ i++;
+ if(i == 5){
+ if (Wok2ModbusTcpServer.get().plcIsConnect) {
+ WritePlc(2,"心跳位", 0, null);
+ }
+ if (Wok1ModbusTcpServer.get().plcIsConnect) {
+ WritePlc(1,"心跳位", 0, null);
+ }
+ }
if(Wok2ModbusTcpServer.get().plcIsConnect){
Object val = wokReadPlc(2,item.name);
Wok2ModbusTcpServer.get().listeningValue.put(item.name, val);
@@ -240,7 +241,6 @@ public class ModbusCenter {
listeningValue.put("输送线出料菜盆检测", val[1]);
listeningValue.put("输送线进料菜盆检测", val[0]);
if(val[0]){
- LogUtils.d("输送线进料菜盆检测 M12.2 true");
if( ConfigName.getInstance().isPutFinish){
ThreadManager.get().execute(new Runnable() {
@Override
@@ -263,7 +263,6 @@ public class ModbusCenter {
});
}
}else if(val[1]){
- LogUtils.d("输送线出料菜盆检测 M12.3 true");
try{
ConfigName.getInstance().isPutFinish = false;
ModbusCenter.rackWritePlc("输送线停止",true,null);
@@ -298,22 +297,21 @@ public class ModbusCenter {
if(RobotModbusTcpServer.get().plcIsConnect){
int i = 0;
for (Res_PLCADDRESS item : ConfigName.getInstance().PlcAddress_Robot) {
- i++;
- if(i == 5){
- if (Wok2ModbusTcpServer.get().plcIsConnect) {
- WritePlc(2,"心跳位", 0, null);
- }
- if (Wok1ModbusTcpServer.get().plcIsConnect) {
- WritePlc(1,"心跳位", 0, null);
- }
- }
+
if(item!=null){
if (item.isread == 1) {
+ i++;
+ if(i == 5){
+ if (Wok2ModbusTcpServer.get().plcIsConnect) {
+ WritePlc(2,"心跳位", 0, null);
+ }
+ if (Wok1ModbusTcpServer.get().plcIsConnect) {
+ WritePlc(1,"心跳位", 0, null);
+ }
+ }
if(RobotModbusTcpServer.get().plcIsConnect){
Object val = robotReadPlc(item.name);
- if(ConfigName.LOG_TEST){
- LogUtils.d("机器人PLC设备数据监听 ovenReadPlc item="+item.name+" plcaddress.address="+item.address+" val="+val);
- }
+
listeningValue.put(item.name, val);
}
}
@@ -706,7 +704,7 @@ public class ModbusCenter {
try {
if (plcAddress.get(name)!=null) {
BPA_PLCADDRESS plcaddress = plcAddress.get(name);
- LogUtils.d("robotWritePlc name1="+name+plcaddress.address);
+// LogUtils.d("robotWritePlc name1="+name+plcaddress.address);
assert plcaddress != null;
if (!plcaddress.address.isEmpty() && RobotModbusTcpServer.get().plcIsConnect) {
if (plcaddress.address.toUpperCase().startsWith("GI5"))//int
@@ -714,11 +712,11 @@ public class ModbusCenter {
if(ConfigName.TEST){
return 0;
}
- LogUtils.d("robotWritePlc name2="+name);
+// LogUtils.d("robotWritePlc name2="+name);
RobotModbusTcpServer.get().ReadShort(plcaddress.address, 1, ints -> {
ReturnsVariable[0] = ints[0];
});
- LogUtils.d("robotWritePlc name="+name+";GI5 ReturnsVariable[0]="+ReturnsVariable[0]);
+// LogUtils.d("robotWritePlc name="+name+";GI5 ReturnsVariable[0]="+ReturnsVariable[0]);
} else if (plcaddress.address.toUpperCase().startsWith("M"))//bool
{
if(ConfigName.TEST){
diff --git a/app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java b/app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java
index e532a2f0..ac7bd2a1 100644
--- a/app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java
+++ b/app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java
@@ -80,7 +80,7 @@ public class WokControlDialog extends DialogFragment {
Object val_wd = ModbusCenter.getWokListingValue(deviceNum,"当前锅底温度");
Object OBJ = ModbusCenter.getWokListingValue(deviceNum,"搅拌");
Object sudu = ModbusCenter.getWokListingValue(deviceNum,"搅拌速度");
- if (!(OBJ != null && (boolean) OBJ)) {
+ if (OBJ != null && (boolean) OBJ) {
if(sudu!=null){
viewBinding.tvJiaoban.setText("搅拌中 "+sudu);
}else {
@@ -94,38 +94,9 @@ public class WokControlDialog extends DialogFragment {
} else {
viewBinding.tvWokWendu.setText("??°C");
}
- String wokChaoXiang = "检测中";
-
- Object cx3 = ModbusCenter.getWokListingValue(deviceNum,"抽料位");
- Object cx1 = ModbusCenter.getWokListingValue(deviceNum,"原点位");
- Object cx2 = ModbusCenter.getWokListingValue(deviceNum,"倒菜位");
- Object cx4 = ModbusCenter.getWokListingValue(deviceNum,"维护位");
- Object cx5 = ModbusCenter.getWokListingValue(deviceNum,"清洗位");
- Object cx6 = ModbusCenter.getWokListingValue(deviceNum,"炒菜位1");
- Object cx7 = ModbusCenter.getWokListingValue(deviceNum,"炒菜位2");
- Object cx8 = ModbusCenter.getWokListingValue(deviceNum,"炒菜位3");
- if(cx1!=null){
- if((Boolean)cx1){
- wokChaoXiang = "原点位/抽料位";
- }else if((Boolean)cx3){
- wokChaoXiang = "抽料位/原点位";
- }else if((Boolean)cx2){
- wokChaoXiang = "倒菜位";
- }else if((Boolean)cx4){
- wokChaoXiang = "维护位";
- }else if((Boolean)cx5){
- wokChaoXiang = "清洗位";
- }else if((Boolean)cx6){
- wokChaoXiang = "炒菜位1/炒菜位高";
- }else if((Boolean)cx7){
- wokChaoXiang = "炒菜位2/炒菜位低";
- }else if((Boolean)cx8){
- wokChaoXiang = "炒菜位3";
- }
- }
- viewBinding.tvGuokoucaoxiang.setText("当前锅口朝向:"+wokChaoXiang);
freshFireNum();
+ freshChaoxiang();
if(handler.hasMessages(1)){
handler.removeMessages(1);
}
@@ -134,25 +105,101 @@ public class WokControlDialog extends DialogFragment {
}
};
- public void freshPlc(){
- ThreadManager.get().StartLong(TAG, true, () -> {
- for (Res_PLCADDRESS item : ConfigName.getInstance().PlcAddress_Wok) {
- if(item!=null){
- if (checkNames.contains(item.name)) {
- if(deviceNum==1){
- if(Wok2ModbusTcpServer.get().plcIsConnect){
- Object val = ModbusCenter.wokReadPlc(2,item.name);
- Wok2ModbusTcpServer.get().listeningValue.put(item.name, val);
- }
- }else if(deviceNum == 2){
- if(Wok1ModbusTcpServer.get().plcIsConnect){
- Object val = ModbusCenter.wokReadPlc(2,item.name);
- Wok1ModbusTcpServer.get().listeningValue.put(item.name, val);
- }
- }
+ private void freshChaoxiang(){
+ try{
+ String wokChaoXiang = "检测中";
+ Object cx3 = ModbusCenter.getWokListingValue(deviceNum,"抽料位反馈");
+ Object cx1 = ModbusCenter.getWokListingValue(deviceNum,"原点位反馈");
+ Object cx2 = ModbusCenter.getWokListingValue(deviceNum,"倒菜位反馈");
+ Object cx4 = ModbusCenter.getWokListingValue(deviceNum,"维护位反馈");
+ Object cx5 = ModbusCenter.getWokListingValue(deviceNum,"清洗位反馈");
+ Object cx6 = ModbusCenter.getWokListingValue(deviceNum,"炒菜位1反馈");
+ Object cx7 = ModbusCenter.getWokListingValue(deviceNum,"炒菜位2反馈");
+ Object cx8 = ModbusCenter.getWokListingValue(deviceNum,"炒菜位3反馈");
+ LogUtils.d("freshChaoxiang "+cx1+cx2+cx3+cx4+cx5+cx6+cx7+cx8);
+ if(cx1!=null) {
+ if ((boolean) cx1) {
+ wokChaoXiang = "原点位/抽料位";
+ }
+ }
+ if(cx3!=null) {
+ if ((boolean) cx3) {
+ wokChaoXiang = "抽料位/原点位";
+ }
+ }
+ if(cx2!=null) {
+ if ((boolean) cx2) {
+ wokChaoXiang = "倒菜位";
+ }
+ }
+ if(cx4!=null) {
+ if ((boolean) cx4) {
+ wokChaoXiang = "维护位";
+ }
+ }
+ if(cx5!=null) {
+ if ((boolean) cx5) {
+ wokChaoXiang = "清洗位";
+ }
+ }
+ if(cx6!=null) {
+ if ((boolean) cx6) {
+ wokChaoXiang = "炒菜位1/炒菜位高";
+ }
+ }
+ if(cx7!=null) {
+ if ((boolean) cx7) {
+ wokChaoXiang = "炒菜位2/炒菜位低";
+ }
+ }
+ if(cx8!=null) {
+ if ((boolean) cx8) {
+ wokChaoXiang = "炒菜位3";
+ }
+ }
+ viewBinding.tvGuokoucaoxiang.setText("当前锅口朝向:"+wokChaoXiang);
+ }catch (Exception e){
+ LogUtils.d("异常信息:" + e.getMessage());
+ }
- }
+ }
+
+ public void freshPlc(){
+ ThreadManager.get().StartLong(TAG, false, () -> {
+// "搅拌速度,抽料位,原点位,倒菜位,维护位,清洗位,炒菜位1,炒菜位2,炒菜位3"
+ try{
+ if(deviceNum==1){
+ Wok1ModbusTcpServer.get().listeningValue.put("加热功率", ModbusCenter.wokReadPlc(deviceNum,"加热功率"));
+ Wok1ModbusTcpServer.get().listeningValue.put("加热", ModbusCenter.wokReadPlc(deviceNum,"加热"));
+ Wok1ModbusTcpServer.get().listeningValue.put("搅拌", ModbusCenter.wokReadPlc(deviceNum,"搅拌"));
+ Wok1ModbusTcpServer.get().listeningValue.put("搅拌速度", ModbusCenter.wokReadPlc(deviceNum,"搅拌速度"));
+ Wok1ModbusTcpServer.get().listeningValue.put("抽料位反馈", ModbusCenter.wokReadPlc(deviceNum,"抽料位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("原点位反馈", ModbusCenter.wokReadPlc(deviceNum,"原点位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("倒菜位反馈", ModbusCenter.wokReadPlc(deviceNum,"倒菜位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("维护位反馈", ModbusCenter.wokReadPlc(deviceNum,"维护位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("清洗位反馈", ModbusCenter.wokReadPlc(deviceNum,"清洗位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("炒菜位1反馈", ModbusCenter.wokReadPlc(deviceNum,"炒菜位1反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("炒菜位2反馈", ModbusCenter.wokReadPlc(deviceNum,"炒菜位2反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("炒菜位3反馈", ModbusCenter.wokReadPlc(deviceNum,"炒菜位3反馈"));
+ }else if(deviceNum==2){
+ Wok2ModbusTcpServer.get().listeningValue.put("加热", ModbusCenter.wokReadPlc(deviceNum,"加热"));
+ Wok2ModbusTcpServer.get().listeningValue.put("加热功率", ModbusCenter.wokReadPlc(deviceNum,"加热功率"));
+ Wok2ModbusTcpServer.get().listeningValue.put("搅拌", ModbusCenter.wokReadPlc(deviceNum,"搅拌"));
+ Wok2ModbusTcpServer.get().listeningValue.put("搅拌速度", ModbusCenter.wokReadPlc(deviceNum,"搅拌速度"));
+ Wok1ModbusTcpServer.get().listeningValue.put("抽料位反馈", ModbusCenter.wokReadPlc(deviceNum,"抽料位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("原点位反馈", ModbusCenter.wokReadPlc(deviceNum,"原点位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("倒菜位反馈", ModbusCenter.wokReadPlc(deviceNum,"倒菜位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("维护位反馈", ModbusCenter.wokReadPlc(deviceNum,"维护位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("清洗位反馈", ModbusCenter.wokReadPlc(deviceNum,"清洗位反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("炒菜位1反馈", ModbusCenter.wokReadPlc(deviceNum,"炒菜位1反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("炒菜位2反馈", ModbusCenter.wokReadPlc(deviceNum,"炒菜位2反馈"));
+ Wok1ModbusTcpServer.get().listeningValue.put("炒菜位3反馈", ModbusCenter.wokReadPlc(deviceNum,"炒菜位3反馈"));
}
+
+ Thread.sleep(500);
+ }catch (Exception ex){
+ LogUtils.d("异常信息:" + ex.getMessage());
+
}
});
}
@@ -210,35 +257,33 @@ public class WokControlDialog extends DialogFragment {
}
private void initData(){
- if(!ConfigName.getInstance().guokouChaoxiang.isEmpty()){
- viewBinding.guokoucaoxiang.setText("锅口朝向\n"+ConfigName.getInstance().guokouChaoxiang);
- }
- if(!ConfigName.getInstance().fanchaoSpeed.isEmpty()){
- viewBinding.tvSpeed.setText(ConfigName.getInstance().fanchaoSpeed);
- }
+
viewBinding.fireControl.deviceNum = deviceNum;
freshFireNum();
}
private void freshFireNum(){
- Object object = ModbusCenter.ReadPlc(deviceNum,"加热功率");
- Object oOpen = ModbusCenter.ReadPlc(deviceNum,"加热");
- if(oOpen instanceof Boolean){
- if((Boolean)oOpen){
- if(object instanceof Short){
- short num = (short) object;
- int fire = (int) num;
- viewBinding.fireControl.SetLevel(fire);
+ try {
+ Object object = ModbusCenter.getWokListingValue(deviceNum,"加热功率");
+ Object oOpen = ModbusCenter.getWokListingValue(deviceNum,"加热");
+ if(oOpen instanceof Boolean){
+ if((Boolean)oOpen){
+ if(object instanceof Short){
+ short num = (short) object;
+ int fire = (int) num;
+ viewBinding.fireControl.SetLevel(fire);
+ }else {
+ viewBinding.fireControl.SetLevel(0);
+ }
}else {
viewBinding.fireControl.SetLevel(0);
}
}else {
viewBinding.fireControl.SetLevel(0);
}
- }else {
- viewBinding.fireControl.SetLevel(0);
- }
+ }catch (Exception e){
+ }
}
@SuppressLint("ClickableViewAccessibility")
@@ -504,6 +549,13 @@ public class WokControlDialog extends DialogFragment {
*/
public void SetFire(int data) {
ExecuteTheRecipe.Write_PLC_HuoLI(deviceNum,(int) data);
+ if(deviceNum==1){
+ Wok1ModbusTcpServer.get().listeningValue.put("加热功率", ModbusCenter.wokReadPlc(deviceNum,"加热功率"));
+ Wok1ModbusTcpServer.get().listeningValue.put("加热", ModbusCenter.wokReadPlc(deviceNum,"加热"));
+ }else if(deviceNum == 2){
+ Wok2ModbusTcpServer.get().listeningValue.put("加热功率", ModbusCenter.wokReadPlc(deviceNum,"加热功率"));
+ Wok2ModbusTcpServer.get().listeningValue.put("加热", ModbusCenter.wokReadPlc(deviceNum,"加热"));
+ }
if(data==0){
NewToastUtil.getInstance().showToast("关闭加热");
}else {
@@ -530,42 +582,34 @@ public class WokControlDialog extends DialogFragment {
case 原点位:
ExecuteTheRecipe.BottomClick(deviceNum,"原点位");
viewBinding.guokoucaoxiang.setText("锅口朝向\n原点位");
- ConfigName.getInstance().guokouChaoxiang = "原点位";
break;
case 炒菜位1:
ExecuteTheRecipe.BottomClick(deviceNum,"炒菜位1");
viewBinding.guokoucaoxiang.setText("锅口朝向\n炒菜位1");
- ConfigName.getInstance().guokouChaoxiang = "炒菜位1";
break;
case 炒菜位2:
ExecuteTheRecipe.BottomClick(deviceNum,"炒菜位2");
viewBinding.guokoucaoxiang.setText("锅口朝向\n炒菜位2");
- ConfigName.getInstance().guokouChaoxiang = "炒菜位2";
break;
case 炒菜位3:
ExecuteTheRecipe.BottomClick(deviceNum,"炒菜位3");
viewBinding.guokoucaoxiang.setText("锅口朝向\n炒菜位3");
- ConfigName.getInstance().guokouChaoxiang = "炒菜位3";
break;
case 维护位:
ExecuteTheRecipe.BottomClick(deviceNum,"维护位");
viewBinding.guokoucaoxiang.setText("锅口朝向\n维护位");
- ConfigName.getInstance().guokouChaoxiang = "维护位";
break;
case 抽料位:
ExecuteTheRecipe.BottomClick(deviceNum,"抽料位");
viewBinding.guokoucaoxiang.setText("锅口朝向\n抽料位");
- ConfigName.getInstance().guokouChaoxiang = "抽料位";
break;
case 倒菜位:
ExecuteTheRecipe.BottomClick(deviceNum,"倒菜位");
viewBinding.guokoucaoxiang.setText("锅口朝向\n倒菜位");
- ConfigName.getInstance().guokouChaoxiang = "倒菜位";
break;
case 清洗位:
ExecuteTheRecipe.BottomClick(deviceNum,"清洗位");
viewBinding.guokoucaoxiang.setText("锅口朝向\n清洗位");
- ConfigName.getInstance().guokouChaoxiang = "清洗位";
break;
}
@@ -583,22 +627,18 @@ public class WokControlDialog extends DialogFragment {
case 快:
_speed = 60;
viewBinding.tvSpeed.setText("翻炒速度:快-"+_speed);
- ConfigName.getInstance().fanchaoSpeed = "翻炒速度:快-"+_speed;
break;
case 中:
_speed = 40;
viewBinding.tvSpeed.setText("翻炒速度:中-"+_speed);
- ConfigName.getInstance().fanchaoSpeed = "翻炒速度:中-"+_speed;
break;
case 慢:
_speed = 20;
viewBinding.tvSpeed.setText("翻炒速度:慢-"+_speed);
- ConfigName.getInstance().fanchaoSpeed = "翻炒速度:慢-"+_speed;
break;
case 停:
_speed = 0;
viewBinding.tvSpeed.setText("翻炒速度:停-"+_speed);
- ConfigName.getInstance().fanchaoSpeed = "翻炒速度:停-"+_speed;
break;
}
@@ -613,6 +653,13 @@ public class WokControlDialog extends DialogFragment {
} else {
ModbusCenter.WritePlc(deviceNum,"搅拌", true, null);
}
+ if(deviceNum== 1){
+ Wok1ModbusTcpServer.get().listeningValue.put("搅拌速度", (short)final_speed);
+ Wok1ModbusTcpServer.get().listeningValue.put("搅拌", final_speed != 0);
+ }else if(deviceNum== 2){
+ Wok2ModbusTcpServer.get().listeningValue.put("搅拌速度", (short)final_speed);
+ Wok2ModbusTcpServer.get().listeningValue.put("搅拌", final_speed != 0);
+ }
}
@Override
diff --git a/app/src/main/res/layout/new/layout/dialog_chaoguo_control.xml b/app/src/main/res/layout/new/layout/dialog_chaoguo_control.xml
index 972512e2..b9f75f8a 100644
--- a/app/src/main/res/layout/new/layout/dialog_chaoguo_control.xml
+++ b/app/src/main/res/layout/new/layout/dialog_chaoguo_control.xml
@@ -215,7 +215,7 @@
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="28sp"
- android:text="翻炒速度:快"
+ android:text="翻炒速度:"
android:paddingStart="10dp"
android:paddingEnd="10dp"
/>