Browse Source

弹窗修改

炒锅机器人_一拖四_带投料
liup 1 week ago
parent
commit
c1078edbe8
33 changed files with 647 additions and 2491 deletions
  1. +0
    -329
      .idea/other.xml
  2. +1
    -2
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  3. +1
    -60
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  4. +0
    -3
      app/src/main/java/com/bonait/bnframework/common/utils/DisplayManager.java
  5. +33
    -3
      app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java
  6. +1
    -1
      app/src/main/java/com/bonait/bnframework/modbus/ModbusTcpHelper.java
  7. +1
    -19
      app/src/main/java/com/bonait/bnframework/newui/activity/DiyProcessHActivity.java
  8. +69
    -304
      app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java
  9. +56
    -0
      app/src/main/java/com/bonait/bnframework/newui/adapter/order/WokNameAdapter.java
  10. +0
    -280
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodCheckDialog.java
  11. +119
    -98
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodInfoDialog.java
  12. +40
    -160
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog.java
  13. +1
    -1
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/SubOrderDialog.java
  14. +0
    -180
      app/src/main/java/com/bonait/bnframework/newui/dialog/control/ChuCanCheckDialog.java
  15. +0
    -120
      app/src/main/java/com/bonait/bnframework/newui/dialog/control/RobotControlDialog.java
  16. +1
    -1
      app/src/main/java/com/bonait/bnframework/newui/dialog/control/SilosInfoDialog.java
  17. +0
    -1
      app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java
  18. +0
    -12
      app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeDevicesFragment.java
  19. +32
    -78
      app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeOrderFragment.java
  20. +50
    -93
      app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeWarnFragment.java
  21. +2
    -0
      app/src/main/java/com/bonait/bnframework/newui/fragment/setting/SilosSettingFragment.java
  22. +1
    -1
      app/src/main/res/drawable/bg_order.xml
  23. +3
    -3
      app/src/main/res/layout/activity_system_set.xml
  24. +1
    -16
      app/src/main/res/layout/new/layout/activity_edit_process_h.xml
  25. +42
    -42
      app/src/main/res/layout/new/layout/activity_main_h.xml
  26. +0
    -130
      app/src/main/res/layout/new/layout/dialog_chucan_check.xml
  27. +72
    -86
      app/src/main/res/layout/new/layout/dialog_food_info.xml
  28. +0
    -39
      app/src/main/res/layout/new/layout/dialog_root2_tip.xml
  29. +0
    -39
      app/src/main/res/layout/new/layout/dialog_root3_tip.xml
  30. +35
    -5
      app/src/main/res/layout/new/layout/fragment_home_warn_info.xml
  31. +33
    -0
      app/src/main/res/layout/new/layout/item_wok_name.xml
  32. +42
    -384
      app/src/main/res/layout/new/layout/layout_root_tip2.xml
  33. +11
    -1
      app/src/main/res/layout/new/layout/layout_root_tip3.xml

+ 0
- 329
.idea/other.xml View File

@@ -1,329 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="direct_access_persist.xml">
<option name="deviceSelectionList">
<list>
<PersistentDeviceSelectionData>
<option name="api" value="27" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="F01L" />
<option name="id" value="F01L" />
<option name="manufacturer" value="FUJITSU" />
<option name="name" value="F-01L" />
<option name="screenDensity" value="360" />
<option name="screenX" value="720" />
<option name="screenY" value="1280" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="28" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="SH-01L" />
<option name="id" value="SH-01L" />
<option name="manufacturer" value="SHARP" />
<option name="name" value="AQUOS sense2 SH-01L" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="Lenovo" />
<option name="codename" value="TB370FU" />
<option name="id" value="TB370FU" />
<option name="manufacturer" value="Lenovo" />
<option name="name" value="Tab P12" />
<option name="screenDensity" value="340" />
<option name="screenX" value="1840" />
<option name="screenY" value="2944" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="samsung" />
<option name="codename" value="a51" />
<option name="id" value="a51" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A51" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="akita" />
<option name="id" value="akita" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="b0q" />
<option name="id" value="b0q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S22 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="32" />
<option name="brand" value="google" />
<option name="codename" value="bluejay" />
<option name="id" value="bluejay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="caiman" />
<option name="id" value="caiman" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro" />
<option name="screenDensity" value="360" />
<option name="screenX" value="960" />
<option name="screenY" value="2142" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="comet" />
<option name="id" value="comet" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro Fold" />
<option name="screenDensity" value="390" />
<option name="screenX" value="2076" />
<option name="screenY" value="2152" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="29" />
<option name="brand" value="samsung" />
<option name="codename" value="crownqlteue" />
<option name="id" value="crownqlteue" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Note9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2220" />
<option name="screenY" value="1080" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="dm3q" />
<option name="id" value="dm3q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S23 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="e1q" />
<option name="id" value="e1q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S24" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix_camera" />
<option name="id" value="felix_camera" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold (Camera-enabled)" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="gts8uwifi" />
<option name="id" value="gts8uwifi" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Tab S8 Ultra" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1848" />
<option name="screenY" value="2960" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="husky" />
<option name="id" value="husky" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8 Pro" />
<option name="screenDensity" value="390" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="motorola" />
<option name="codename" value="java" />
<option name="id" value="java" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="G20" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="komodo" />
<option name="id" value="komodo" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro XL" />
<option name="screenDensity" value="360" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="lynx" />
<option name="id" value="lynx" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="google" />
<option name="codename" value="oriole" />
<option name="id" value="oriole" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="panther" />
<option name="id" value="panther" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q5q" />
<option name="id" value="q5q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold5" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1812" />
<option name="screenY" value="2176" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q6q" />
<option name="id" value="q6q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1856" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="r11" />
<option name="id" value="r11" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Watch" />
<option name="screenDensity" value="320" />
<option name="screenX" value="384" />
<option name="screenY" value="384" />
<option name="type" value="WEAR_OS" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="redfin" />
<option name="id" value="redfin" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 5" />
<option name="screenDensity" value="440" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="shiba" />
<option name="id" value="shiba" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="tangorpro" />
<option name="id" value="tangorpro" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Tablet" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1600" />
<option name="screenY" value="2560" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="tokay" />
<option name="id" value="tokay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2424" />
</PersistentDeviceSelectionData>
</list>
</option>
</component>
</project>

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

@@ -111,8 +111,7 @@ public class MainInit {

//cx_cp();
ErrorCodeManager.getInstance().initData();
//初始化菜盘位置
ConfigName.getInstance().resetPositionList();

}




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

@@ -32,7 +32,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class ConfigName {
//是否是测试模式
public final static boolean TEST = false;
public final static boolean TEST = true;
//崩溃重启
public final static boolean ERROR_ROOT = false;
//日志打印
@@ -511,65 +511,6 @@ public class ConfigName {
*/
public int AutoQXTime=10;


public static HashMap<String,CheckPositionBean> positionList = new HashMap<>();

public void resetPositionList(){
positionList.clear();
positionList.put("主料位置1号位",new CheckPositionBean("1#料仓检测有无",-1,false));
positionList.put("主料位置2号位",new CheckPositionBean("2#料仓检测有无",-1,false));
positionList.put("主料位置3号位",new CheckPositionBean("3#料仓检测有无",-1,false));
positionList.put("主料位置4号位",new CheckPositionBean("4#料仓检测有无",-1,false));
positionList.put("主料位置5号位",new CheckPositionBean("5#料仓检测有无",-1,false));
positionList.put("主料位置6号位",new CheckPositionBean("6#料仓检测有无",-1,false));

positionList.put("辅料位置1号位",new CheckPositionBean("1#调料检测有无",-1,false));
positionList.put("辅料位置2号位",new CheckPositionBean("2#调料检测有无",-1,false));
positionList.put("辅料位置3号位",new CheckPositionBean("3#调料检测有无",-1,false));
positionList.put("辅料位置4号位",new CheckPositionBean("4#调料检测有无",-1,false));
positionList.put("辅料位置5号位",new CheckPositionBean("5#调料检测有无",-1,false));
positionList.put("辅料位置6号位",new CheckPositionBean("6#调料检测有无",-1,false));

positionList.put("出餐盆1",new CheckPositionBean("1#空盆库位检测有无",-1,false));
positionList.put("出餐盆2",new CheckPositionBean("2#空盆库位检测有无",-1,false));
positionList.put("出餐盆3",new CheckPositionBean("3#空盆库位检测有无",-1,false));

}

public void checkPositionList(){
// LogUtils.d("ReadPositionStatusPLC positionList="+positionList.size());
for (Map.Entry<String, CheckPositionBean> entry : positionList.entrySet()) {
String key = entry.getKey();
CheckPositionBean value = entry.getValue();
positionList.put(key,ReadPositionStatusPLC(value));
}
}

/**
* 读菜盘PLC数据
*
* @return
*/
public CheckPositionBean ReadPositionStatusPLC(CheckPositionBean bean) {
CheckPositionBean newBean = new CheckPositionBean(bean.name,bean.number,bean.exist);
if(ConfigName.TEST){
newBean.exist=true;
newBean.number = newBean.number+1;
return newBean;
}
try {
boolean exist = (boolean) ModbusCenter.getRobotListingValue(bean.name);
newBean.exist = exist;
if(!bean.exist&&exist){
newBean.number = newBean.number+1;
}
return newBean;
} catch (Exception ex) {
LogUtils.d("ReadPositionStatusPLC ex.getMessage()="+ex.getMessage());
return newBean;
}
}

/**
* Bottom 按钮
*/


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

@@ -476,9 +476,6 @@ public class DisplayManager
}

public static float scale32(){
if(ConfigName.getInstance().versionSelectionEnum.equals(SceneSetFragment.deviceName4)){
return 21;
}
return 32;
}
}

+ 33
- 3
app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java View File

@@ -209,19 +209,19 @@ public class ModbusCenter {
}
LogUtils.d("设备数据监听 1");
if (Wok2ModbusTcpServer.get().plcIsConnect) {
wokListener(1);
wokListener(2);
}else {
Wok2ModbusTcpServer.get().ReConnect("Connection refused");
}
LogUtils.d("设备数据监听 2");
if (Wok3ModbusTcpServer.get().plcIsConnect) {
wokListener(1);
wokListener(3);
}else {
Wok3ModbusTcpServer.get().ReConnect("Connection refused");
}
LogUtils.d("设备数据监听 3");
if (Wok4ModbusTcpServer.get().plcIsConnect) {
wokListener(1);
wokListener(4);
}else {
Wok4ModbusTcpServer.get().ReConnect("Connection refused");
}
@@ -436,8 +436,38 @@ public class ModbusCenter {
}
break;
case 3:
if (plcaddress!=null &&!plcaddress.address.isEmpty() && Wok3ModbusTcpServer.get().plcIsConnect) {
if (plcaddress.address.toUpperCase().startsWith("VD"))//int
{
Wok3ModbusTcpServer.get().WriteInt(plcaddress.address, (int) value, callback);
} else if (plcaddress.address.toUpperCase().startsWith("M"))//bool
{
Wok3ModbusTcpServer.get().WriteBool(plcaddress.address, (boolean) value, callback);
} else if (plcaddress.address.toUpperCase().startsWith("VW"))//short
{
Wok3ModbusTcpServer.get().WriteShort(plcaddress.address, Short.parseShort(value.toString()), callback);
} else if (plcaddress.address.toUpperCase().startsWith("VR"))//float
{
Wok3ModbusTcpServer.get().WriteFloat(plcaddress.address, Float.parseFloat(value.toString()), callback);
}
}
break;
case 4:
if (plcaddress!=null &&!plcaddress.address.isEmpty() && Wok4ModbusTcpServer.get().plcIsConnect) {
if (plcaddress.address.toUpperCase().startsWith("VD"))//int
{
Wok4ModbusTcpServer.get().WriteInt(plcaddress.address, (int) value, callback);
} else if (plcaddress.address.toUpperCase().startsWith("M"))//bool
{
Wok4ModbusTcpServer.get().WriteBool(plcaddress.address, (boolean) value, callback);
} else if (plcaddress.address.toUpperCase().startsWith("VW"))//short
{
Wok4ModbusTcpServer.get().WriteShort(plcaddress.address, Short.parseShort(value.toString()), callback);
} else if (plcaddress.address.toUpperCase().startsWith("VR"))//float
{
Wok4ModbusTcpServer.get().WriteFloat(plcaddress.address, Float.parseFloat(value.toString()), callback);
}
}
break;
}
}


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

@@ -56,7 +56,6 @@ public abstract class ModbusTcpHelper {
public void ReConnect(String error){
if(error.contains("Connection refused")||error.contains("SocketException")){
if(plcIsConnect){
RecordManager.getInstance().addLogRecord("设备异常日志",getDeviceName()+" error:"+error+"-开始重连");
ConnectPLC();
}
}
@@ -79,6 +78,7 @@ public abstract class ModbusTcpHelper {
}
ThreadManager.get().StartLong(getDeviceName(),false, () -> {
while (!plcIsConnect){
RecordManager.getInstance().addLogRecord("设备异常日志",getDeviceName()+"-开始连接");
param = TcpParam.create(getAddress(), getPort())
.setTimeout(1000)
.setRetries(0)


+ 1
- 19
app/src/main/java/com/bonait/bnframework/newui/activity/DiyProcessHActivity.java View File

@@ -425,27 +425,9 @@ public class DiyProcessHActivity extends BaseActivity {

private void showHuoJia(boolean show){
if(show){
switch (ConfigName.getInstance().versionSelectionEnum){
case "鸿鹄中江":
viewBinding.layoutHuojia.getRoot().setVisibility(View.GONE);
viewBinding.layoutHuojia2.getRoot().setVisibility(View.VISIBLE);
viewBinding.layoutHuojia3.getRoot().setVisibility(View.GONE);
break;
case "鸿鹄青白江":
viewBinding.layoutHuojia.getRoot().setVisibility(View.GONE);
viewBinding.layoutHuojia2.getRoot().setVisibility(View.GONE);
viewBinding.layoutHuojia3.getRoot().setVisibility(View.VISIBLE);
break;
default:
viewBinding.layoutHuojia.getRoot().setVisibility(View.VISIBLE);
viewBinding.layoutHuojia2.getRoot().setVisibility(View.GONE);
viewBinding.layoutHuojia3.getRoot().setVisibility(View.GONE);
break;
}
viewBinding.layoutHuojia.getRoot().setVisibility(View.VISIBLE);
}else{
viewBinding.layoutHuojia.getRoot().setVisibility(View.GONE);
viewBinding.layoutHuojia2.getRoot().setVisibility(View.GONE);
viewBinding.layoutHuojia3.getRoot().setVisibility(View.GONE);
}
}



+ 69
- 304
app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java View File

@@ -18,7 +18,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.api.ServerManager;
import com.bonait.bnframework.business.ConfigData;
@@ -31,34 +30,22 @@ import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.NetworkUtils;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.databinding.ActivityMainHBinding;
import com.bonait.bnframework.event.SerialButtonEvent;
import com.bonait.bnframework.modbus.ModbusCenter;
import com.bonait.bnframework.modbus.RobotModbusTcpServer;
import com.bonait.bnframework.modbus.Wok2ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok1ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok3ModbusTcpServer;
import com.bonait.bnframework.newui.adapter.base.GuidePageAdapter;
import com.bonait.bnframework.newui.adapter.other.TabAdapter;
import com.bonait.bnframework.newui.dialog.check.FoodCheckDialog;
import com.bonait.bnframework.newui.dialog.check.RootTipDialog;
import com.bonait.bnframework.newui.fragment.main.HomeDevicesFragment;
import com.bonait.bnframework.newui.fragment.main.HomeGoodsFragment;
import com.bonait.bnframework.newui.fragment.main.HomeMainsFragment;
import com.bonait.bnframework.newui.fragment.main.HomeOrderFragment;
import com.bonait.bnframework.newui.fragment.main.HomeWarnFragment;
import com.bonait.bnframework.newui.fragment.setting.SceneSetFragment;
import com.bonait.bnframework.newui.widget.NewToastUtil;
import com.bonait.bnframework.serial.ComBean;
import com.bonait.bnframework.serial.SerialHelper;

import org.greenrobot.eventbus.EventBus;

import java.io.File;
import java.io.IOException;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

/**
* @author: liup
@@ -69,11 +56,6 @@ public class MainHActivity extends BaseActivity {
private ActivityMainHBinding viewBinding;
private TabAdapter tabAdapter;
private ArrayList<Fragment> pages;
SerialControl com0;
private boolean tabSelect = true;
private static final int MSG_Click_EVENT = 100;
private int enconger = 0;
private long mlLastVewClickTime;

private Handler handler = new Handler(Looper.getMainLooper()){
@Override
@@ -86,6 +68,8 @@ public class MainHActivity extends BaseActivity {
}
BPA_ORDER_DETAIL detail1 = OrderDetailUtil.getByMaking(1);
BPA_ORDER_DETAIL detail2 = OrderDetailUtil.getByMaking(2);
BPA_ORDER_DETAIL detail3 = OrderDetailUtil.getByMaking(3);
BPA_ORDER_DETAIL detail4 = OrderDetailUtil.getByMaking(4);

if(detail1!=null){
String desc = "烹饪中...";
@@ -96,11 +80,11 @@ public class MainHActivity extends BaseActivity {
}else if(detail1.status==3){
desc = "烹饪异常";
}
viewBinding.tvWok.setVisibility(View.VISIBLE);
viewBinding.tvWok.setText("1号炒锅:菜品【"+detail1.goodsName+(detail1.groupName==null?"":detail1.groupName)+"】"+desc);
viewBinding.tvWok1.setVisibility(View.VISIBLE);
viewBinding.tvWok1.setText("1号炒锅:菜品【"+detail1.goodsName+(detail1.groupName==null?"":detail1.groupName)+"】"+desc);
}else {
viewBinding.tvWok.setVisibility(View.GONE);
viewBinding.tvWok.setText("");
viewBinding.tvWok1.setVisibility(View.GONE);
viewBinding.tvWok1.setText("");
}
if(detail2!=null){
String desc = "烹饪中...";
@@ -117,27 +101,41 @@ public class MainHActivity extends BaseActivity {
viewBinding.tvWok2.setVisibility(View.GONE);
viewBinding.tvWok2.setText("");
}
if(detail3!=null){
String desc = "烹饪中...";
if(detail3.status==1){
desc = "烹饪中...";
}else if(detail3.status==2){
desc = "烹饪完成";
}else if(detail3.status==3){
desc = "烹饪异常";
}
viewBinding.tvWok3.setVisibility(View.VISIBLE);
viewBinding.tvWok3.setText("3号炒锅:菜品【"+detail3.goodsName+(detail3.groupName==null?"":detail3.groupName)+"】"+desc);
}else {
viewBinding.tvWok3.setVisibility(View.GONE);
viewBinding.tvWok3.setText("");
}
if(detail4!=null){
String desc = "烹饪中...";
if(detail4.status==1){
desc = "烹饪中...";
}else if(detail4.status==2){
desc = "烹饪完成";
}else if(detail4.status==3){
desc = "烹饪异常";
}
viewBinding.tvWok4.setVisibility(View.VISIBLE);
viewBinding.tvWok4.setText("4号炒锅:菜品【"+detail4.goodsName+(detail4.groupName==null?"":detail4.groupName)+"】"+desc);
}else {
viewBinding.tvWok4.setVisibility(View.GONE);
viewBinding.tvWok4.setText("");
}
if(handler.hasMessages(1)){
handler.removeMessages(1);
}
handler.sendEmptyMessageDelayed(1,500);
}
else if(msg.what == MSG_Click_EVENT){
if(tabAdapter.getCurrentPosition() == 0){
if(ConfigName.getInstance().focusPageType == 1){
ConfigName.getInstance().focusPageType = 2;
EventBus.getDefault().post(new SerialButtonEvent(0,true));
}else if(ConfigName.getInstance().focusPageType == 2){
ConfigName.getInstance().focusPageType = 3;
EventBus.getDefault().post(new SerialButtonEvent(0,true));
}else if(ConfigName.getInstance().focusPageType == 3){
EventBus.getDefault().post(new SerialButtonEvent(0,true,true));
}
tabSelect = false;
tabAdapter.setSelectPos(-1);
tabAdapter.notifyItemChanged(tabAdapter.getCurrentPosition());
}
}
}
};

@@ -158,14 +156,6 @@ public class MainHActivity extends BaseActivity {
}else {
PreferenceUtils.setInt("loginNum",loginNum+1);
}

if(ConfigName.SERIAL_TEST){
com0 = new SerialControl();
com0.setiDelay(Integer.parseInt("100"));
DispQueue = new DispQueueThread();
DispQueue.start();
OpenComPort(com0);
}
}

private void init(){
@@ -179,17 +169,11 @@ public class MainHActivity extends BaseActivity {
}

private void initView(){
if(ConfigName.getInstance().versionSelectionEnum.equals(SceneSetFragment.deviceName4)){
viewBinding.tvShusongLine.setVisibility(View.GONE);
viewBinding.tvLineEnter.setVisibility(View.GONE);
viewBinding.tvLineOut.setVisibility(View.GONE);
}
tabAdapter = new TabAdapter(){
@Override
protected void onItemClick(View v, int position) {
viewBinding.viewpager.setCurrentItem(position);
ConfigName.getInstance().focusPageType = 1;
tabSelect = true;
}
};
List<String> data = new ArrayList<>();
@@ -206,29 +190,17 @@ public class MainHActivity extends BaseActivity {
viewBinding.viewpager.setOnPageChangeListener(pageChangeListener);
viewBinding.viewpager.setOffscreenPageLimit(1);

viewBinding.tvWok.setOnClickListener(v->{
viewBinding.tvWok1.setOnClickListener(v->{
viewBinding.viewpager.setCurrentItem(1);
});
viewBinding.tvWok2.setOnClickListener(v->{
viewBinding.viewpager.setCurrentItem(1);
});

viewBinding.btnBoxCheck.setOnClickListener(v->{
switch (ConfigName.getInstance().versionSelectionEnum){
case "鸿鹄中江":
FoodCheckDialog2 dialog2 = new FoodCheckDialog2();
dialog2.show(getSupportFragmentManager(),"料盒检测");
break;
case "鸿鹄青白江":
FoodCheckDialog3 dialog3 = new FoodCheckDialog3();
dialog3.show(getSupportFragmentManager(),"料盒检测");
break;
default:
FoodCheckDialog dialog = new FoodCheckDialog();
dialog.show(getSupportFragmentManager(),"料盒检测");
break;
}

viewBinding.tvWok3.setOnClickListener(v->{
viewBinding.viewpager.setCurrentItem(1);
});
viewBinding.tvWok4.setOnClickListener(v->{
viewBinding.viewpager.setCurrentItem(1);
});
}

@@ -239,72 +211,39 @@ public class MainHActivity extends BaseActivity {
, content.length()-3, content.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.deviceStatusWok.setText(spannable);
String content4 = "2号炒锅:"+(Wok2ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable4 = new SpannableStringBuilder(content4);
spannable4.setSpan(new ForegroundColorSpan(Wok2ModbusTcpServer.get().plcIsConnect? Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
, content4.length()-3, content4.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.deviceStatusWok2.setText(spannable4);

String content2 = "货架:"+(RackModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
String content2 = "2号炒锅:"+(Wok2ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable2 = new SpannableStringBuilder(content2);
spannable2.setSpan(new ForegroundColorSpan(RackModbusTcpServer.get().plcIsConnect?Color.parseColor("#567722"):Color.parseColor("#DA5A17")), content2.length()-3, content2.length(),
spannable2.setSpan(new ForegroundColorSpan(Wok2ModbusTcpServer.get().plcIsConnect?
Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
, content2.length()-3, content2.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.deviceStatusRack.setText(spannable2);

String content3 = "机器人:"+(RobotModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
viewBinding.deviceStatusWok2.setText(spannable2);
String content3 = "3号炒锅:"+(Wok3ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable3 = new SpannableStringBuilder(content3);
spannable3.setSpan(new ForegroundColorSpan(RobotModbusTcpServer.get().plcIsConnect?Color.parseColor("#567722"):Color.parseColor("#DA5A17")), content3.length()-3, content3.length(),
spannable3.setSpan(new ForegroundColorSpan(Wok3ModbusTcpServer.get().plcIsConnect?
Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
, content3.length()-3, content3.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.deviceStatusRobot.setText(spannable3);
viewBinding.deviceStatusWok3.setText(spannable3);
String content4 = "4号炒锅:"+(Wok2ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable4 = new SpannableStringBuilder(content4);
spannable4.setSpan(new ForegroundColorSpan(Wok2ModbusTcpServer.get().plcIsConnect?
Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
, content4.length()-3, content4.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.deviceStatusWok4.setText(spannable4);


if(!ConfigName.getInstance().versionSelectionEnum.equals(SceneSetFragment.deviceName4)){
Object object1 = ModbusCenter.getRobotListingValue("输送线进料菜盆检测");
Object object3 = ModbusCenter.getRobotListingValue("输送线出料菜盆检测");
Object object4 = ModbusCenter.getRobotListingValue("输送线运行中");
if(object3 instanceof Boolean){
if((boolean) object3){
changeTextView(viewBinding.tvLineOut,"输送线出料盆:","有盆",true);
}else{
changeTextView(viewBinding.tvLineOut,"输送线出料盆:","无盆",false);
}
}else {
changeTextView(viewBinding.tvLineOut,"输送线出料盆:","异常",true);
}
String content5 = "机器人:"+(RobotModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable5 = new SpannableStringBuilder(content5);
spannable5.setSpan(new ForegroundColorSpan(RobotModbusTcpServer.get().plcIsConnect?
Color.parseColor("#567722"):Color.parseColor("#DA5A17")), content5.length()-3, content5.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.deviceStatusRobot.setText(spannable5);

if(object1 instanceof Boolean){
if((boolean) object1){
changeTextView(viewBinding.tvLineEnter,"输送线进料盆:","有盆",true);
}else{
changeTextView(viewBinding.tvLineEnter,"输送线进料盆:","无盆",false);
}
}else {
changeTextView(viewBinding.tvLineEnter,"输送线进料盆:","异常",true);
}
if(object4 instanceof Boolean){
if((Boolean)object4){
changeTextView(viewBinding.tvShusongLine,"输送线:","运行中",false);
}else {
changeTextView(viewBinding.tvShusongLine,"输送线:","已停止",false);
}
}else {
changeTextView(viewBinding.tvShusongLine,"输送线:","异常",true);
}
}
}

private void changeTextView(TextView textView,String content1,String content2,boolean hasColor){
String content3 = content1+content2;
SpannableStringBuilder spannable3 = new SpannableStringBuilder(content3);
if(hasColor){
spannable3.setSpan(new ForegroundColorSpan(Color.parseColor("#DA5A17"))
, content1.length(), content3.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
}

textView.setText(spannable3);
}

/**
* viewPager里添加fragment
@@ -381,20 +320,8 @@ public class MainHActivity extends BaseActivity {
if(isFirst){
isFirst = false;
if(PreferenceUtils.getBoolean(ConfigName.rootTip,true)){
switch (ConfigName.getInstance().versionSelectionEnum){
case "鸿鹄中江":
RootTipDialog2 dialog2 = new RootTipDialog2();
dialog2.show(getSupportFragmentManager(),"开机自检");
break;
case "鸿鹄青白江":
RootTipDialog3 dialog3 = new RootTipDialog3();
dialog3.show(getSupportFragmentManager(),"开机自检");
break;
default:
RootTipDialog dialog = new RootTipDialog();
dialog.show(getSupportFragmentManager(),"开机自检");
break;
}
RootTipDialog dialog = new RootTipDialog();
dialog.show(getSupportFragmentManager(),"开机自检");
}
}
}
@@ -409,9 +336,6 @@ public class MainHActivity extends BaseActivity {

@Override
protected void onDestroy() {
if(ConfigName.SERIAL_TEST){
CloseComPort(com0);
}
reset();
super.onDestroy();
if(handler!=null){
@@ -426,163 +350,4 @@ public class MainHActivity extends BaseActivity {
ExecuteTheRecipe.reset1(2);
OrderDetailUtil.resetOrder();
}


//----------------------------------------------------串口控制类
DispQueueThread DispQueue;//刷新显示线程
//----------------------------------------------------刷新显示线程
private class DispQueueThread extends Thread {
private final Queue<ComBean> QueueList = new LinkedList<ComBean>();

@Override
public void run() {
super.run();
while (!isInterrupted()) {
final ComBean ComData;
while ((ComData = QueueList.poll()) != null) {
runOnUiThread(new Runnable() {
public void run() {
DispRecData(ComData);
}
});
try {
Thread.sleep(100);//显示性能高的话,可以把此数值调小。
} catch (Exception e) {
e.printStackTrace();
}
break;
}
}
}

public synchronized void AddQueue(ComBean ComData) {
QueueList.add(ComData);
}
}


private class SerialControl extends SerialHelper {

// public SerialControl(String sPort, String sBaudRate){
// super(sPort, sBaudRate);
// }
public SerialControl() {
}

@Override
protected void onDataReceived(final ComBean ComRecData) {
//数据接收量大或接收时弹出软键盘,界面会卡顿,可能和6410的显示性能有关
//直接刷新显示,接收数据量大时,卡顿明显,但接收与显示同步。
//用线程定时刷新显示可以获得较流畅的显示效果,但是接收数据速度快于显示速度时,显示会滞后。
//最终效果差不多-_-,线程定时刷新稍好一些。
DispQueue.AddQueue(ComRecData);//线程定时刷新显示(推荐)
/*
runOnUiThread(new Runnable()//直接刷新显示
{
public void run()
{
DispRecData(ComRecData);
}
});*/
}
}
//----------------------------------------------------打开串口
private void OpenComPort(SerialHelper ComPort) {
try {
ComPort.open();
} catch (SecurityException e) {
NewToastUtil.getInstance().showToastError("打开串口失败:没有串口读/写权限!");
} catch (IOException e) {
NewToastUtil.getInstance().showToastError("打开串口失败:未知错误!");
} catch (InvalidParameterException e) {
NewToastUtil.getInstance().showToastError("打开串口失败:参数错误!");
}
}
//----------------------------------------------------关闭串口
private void CloseComPort(SerialHelper ComPort) {
if (ComPort != null) {
ComPort.stopSend();
ComPort.close();
}
}
//----------------------------------------------------显示接收数据
private void DispRecData(ComBean ComRecData) {
String value = new String(ComRecData.bRec);
String sMsg = ComRecData.sRecTime +
"[" +
ComRecData.sComPort +
"]" +
"[Txt] " +
new String(ComRecData.bRec) +
"\r\n";
LogUtils.d("DispRecData sMsg = " + sMsg);
if(value.contains("enconger")){
if(value.contains("true")){
long lCurrentTime = System.currentTimeMillis();
if (abs(lCurrentTime - mlLastVewClickTime) <= 1000) {
handler.removeMessages(MSG_Click_EVENT);
mlLastVewClickTime = 0L;
ConfigName.getInstance();
LogUtils.d("DispRecData 连续两次点击 ");
if(ConfigName.getInstance().focusPageType == 2){
ConfigName.getInstance().focusPageType = 1;
handler.post(new Runnable() {
@Override
public void run() {
tabSelect = true;
tabAdapter.setSelectPos(0);
tabAdapter.notifyItemChanged(0);
}
});
EventBus.getDefault().post(new SerialButtonEvent(0,true));
}else if(ConfigName.getInstance().focusPageType == 3){
ConfigName.getInstance().focusPageType = 2;
EventBus.getDefault().post(new SerialButtonEvent(0,true));
}
} else {
LogUtils.d("DispRecData 单次点击 延迟1s ");
mlLastVewClickTime = lCurrentTime;
handler.sendEmptyMessageDelayed(MSG_Click_EVENT, 500);
}
}else {
int oldEnconger = enconger;
LogUtils.d("DispRecData "+value.substring(value.indexOf(":"),value.indexOf(",")));
enconger = Integer.parseInt(value.substring(value.indexOf(":")+2,value.indexOf(",")));
if(tabSelect){
handler.post(new Runnable() {
@Override
public void run() {
tabAdapter.setSelectPos(0);
tabAdapter.notifyItemChanged(0);
int pos = tabAdapter.getCurrentPosition();
tabAdapter.setSelectPos(pos);
if(enconger>oldEnconger){
if(pos<tabAdapter.getItemCount()-1){
tabAdapter.setCurrentPosition(pos+1);
tabAdapter.setSelectPos(pos+1);
viewBinding.viewpager.setCurrentItem(pos+1);
}
}else {
if(pos>0){
tabAdapter.setCurrentPosition(pos-1);
tabAdapter.setSelectPos(pos-1);
viewBinding.viewpager.setCurrentItem(pos-1);
}
}
tabAdapter.notifyItemChanged(pos);
tabAdapter.notifyItemChanged(tabAdapter.getCurrentPosition());
}
});
}else {
if(enconger>oldEnconger){
EventBus.getDefault().post(new SerialButtonEvent(1,false));
}else {
EventBus.getDefault().post(new SerialButtonEvent(2,false));
}
}

}
}
}

}

+ 56
- 0
app/src/main/java/com/bonait/bnframework/newui/adapter/order/WokNameAdapter.java View File

@@ -0,0 +1,56 @@
package com.bonait.bnframework.newui.adapter.order;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ItemFoodInfoBinding;
import com.bonait.bnframework.databinding.ItemWokNameBinding;
import com.bonait.bnframework.newui.adapter.base.BaseAdapter;

/**
* @author: liup
* @description: 炒锅名称
* @date: 2024/5/9 9:02.
*/
public abstract class WokNameAdapter extends BaseAdapter<String, WokNameAdapter.ViewHolder> {

@NonNull
@Override
public WokNameAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new WokNameAdapter.ViewHolder(ItemWokNameBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}

@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull WokNameAdapter.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
if(holder.binding.getRoot().getWidth()==0){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
holder.binding.name.setText(mData.get(position));
holder.binding.name.setOnClickListener(v->{
onItemClick(v,position);
});
}

@Override
protected void onItemClick(View v, int position) {

}

public static class ViewHolder extends RecyclerView.ViewHolder {
private ItemWokNameBinding binding;


public ViewHolder(ItemWokNameBinding view) {
super(view.getRoot());
binding = view;
}
}

}

+ 0
- 280
app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodCheckDialog.java View File

@@ -1,280 +0,0 @@
package com.bonait.bnframework.newui.dialog.check;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import com.bonait.bnframework.Model.CheckPositionBean;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.utils.AdbCommandUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.DialogFoodCheckBinding;
import com.bonait.bnframework.newui.fragment.setting.SceneSetFragment;

import java.util.Map;

import butterknife.ButterKnife;

/**
* @author: liup
* @description: 机器人投料控制
* @date: 2024/6/3 17:59.
*/
public class FoodCheckDialog extends DialogFragment {
private String TAG = " FoodCheckDialog =>";
private DialogFoodCheckBinding viewBinding;

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.DialogScale);
}
private Handler handler = new Handler(Looper.getMainLooper()){
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if(msg.what==1){
freshView();
if(handler.hasMessages(1)){
handler.removeMessages(1);
}
handler.sendEmptyMessageDelayed(1,500);
}
}
};

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
viewBinding = DialogFoodCheckBinding.inflate(inflater, container, false);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
ButterKnife.bind(this, viewBinding.getRoot());
return viewBinding.getRoot();
}
private void fullScreen(Window window){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// 全屏显示,隐藏状态栏和导航栏,拉出状态栏和导航栏显示一会儿后消失。
// 启动游戏模式,设置状态栏和导航栏中的图标变小,变模糊或者弱化其效果
window.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
// 全屏显示,隐藏状态栏
window.getDecorView().setSystemUiVisibility(View.INVISIBLE);
}
}
}
@Override
public void onStart() {
super.onStart();
if (getDialog() != null) {
Window window = getDialog().getWindow();
assert window != null;
fullScreen(window);
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.gravity = Gravity.CENTER;
params.width = ViewGroup.LayoutParams.WRAP_CONTENT;
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
window.setAttributes(params);
}
AdbCommandUtil.hideStatusBar(true);

initView();
}

private void initView(){
viewBinding.btnClose1.setOnClickListener(v->{
dismiss();
});

freshView();
handler.sendEmptyMessageDelayed(1,200);
}

@SuppressLint("SetTextI18n")
private void freshView(){
for (Map.Entry<String, CheckPositionBean> entry : ConfigName.getInstance().positionList.entrySet()) {
String key = entry.getKey();
CheckPositionBean value = entry.getValue();
TextView view;
switch (key){
case "辅料位置1号位":
if(value.exist){
viewBinding.top1.setText("辅料F1\n有盒");
viewBinding.icTop1.setSelected(true);
}else {
viewBinding.top1.setText("辅料F1\n无盒");
viewBinding.icTop1.setSelected(false);
}
break;
case "辅料位置2号位":
if(value.exist){
viewBinding.top2.setText("辅料F2\n有盒");
viewBinding.icTop2.setSelected(true);
}else {
viewBinding.top2.setText("辅料F2\n无盒");
viewBinding.icTop2.setSelected(false);
}
break;
case "辅料位置3号位":
if(value.exist){
viewBinding.top3.setText("辅料F3\n有盒");
viewBinding.icTop3.setSelected(true);
}else {
viewBinding.top3.setText("辅料F3\n无盒");
viewBinding.icTop3.setSelected(false);
}
break;
case "辅料位置4号位":
if(value.exist){
viewBinding.top4.setText("辅料F4\n有盒");
viewBinding.icTop4.setSelected(true);
}else {
viewBinding.top4.setText("辅料F4\n无盒");
viewBinding.icTop4.setSelected(false);
}
break;
case "辅料位置5号位":
if(value.exist){
viewBinding.top5.setText("辅料F5\n有盒");
viewBinding.icTop5.setSelected(true);
}else {
viewBinding.top5.setText("辅料F5\n无盒");
viewBinding.icTop5.setSelected(false);
}
break;
case "辅料位置6号位":
if(value.exist){
viewBinding.top6.setText("辅料F6\n有盒");
viewBinding.icTop6.setSelected(true);
}else {
viewBinding.top6.setText("辅料F6\n无盒");
viewBinding.icTop6.setSelected(false);
}
break;
case "主料位置1号位":
if(value.exist){
viewBinding.right1.setText("主料Z1有盆");
viewBinding.right1.setSelected(true);
}else {
viewBinding.right1.setText("主料Z1无盆");
viewBinding.right1.setSelected(false);
}
break;
case "主料位置2号位":
if(value.exist){
viewBinding.right2.setText("主料Z2有盆");
viewBinding.right2.setSelected(true);
}else {
viewBinding.right2.setText("主料Z2无盆");
viewBinding.right2.setSelected(false);
}
break;
case "主料位置3号位":
if(value.exist){
viewBinding.right3.setText("主料Z3有盆");
viewBinding.right3.setSelected(true);
}else {
viewBinding.right3.setText("主料Z3无盆");
viewBinding.right3.setSelected(false);
}
break;
case "主料位置4号位":
if(value.exist){
viewBinding.right4.setText("主料Z4有盆");
viewBinding.right4.setSelected(true);
}else {
viewBinding.right4.setText("主料Z4无盆");
viewBinding.right4.setSelected(false);
}
break;
case "主料位置5号位":
if(value.exist){
viewBinding.right5.setText("主料Z5有盆");
viewBinding.right5.setSelected(true);
}else {
viewBinding.right5.setText("主料Z5无盆");
viewBinding.right5.setSelected(false);
}
break;
case "主料位置6号位":
if(value.exist){
viewBinding.right6.setText("主料Z6有盆");
viewBinding.right6.setSelected(true);
}else {
viewBinding.right6.setText("主料Z6无盆");
viewBinding.right6.setSelected(false);
}
break;

case "出餐盆1":
if(value.exist){
viewBinding.tvChucan1.setText("出餐盘1有盆");
viewBinding.tvChucan1.setSelected(true);
}else {
viewBinding.tvChucan1.setText("出餐盘1无盆");
viewBinding.tvChucan1.setSelected(false);
}
break;
case "出餐盆2":
if(value.exist){
viewBinding.tvChucan2.setText("出餐盘2有盆");
viewBinding.tvChucan2.setSelected(true);
}else {
viewBinding.tvChucan2.setText("出餐盘2无盆");
viewBinding.tvChucan2.setSelected(false);
}
break;
case "出餐盆3":
if(value.exist){
viewBinding.tvChucan3.setText("出餐盘3有盆");
viewBinding.tvChucan3.setSelected(true);
}else {
viewBinding.tvChucan3.setText("出餐盘3无盆");
viewBinding.tvChucan3.setSelected(false);
}
break;
}
}
}
@Override
public void dismiss() {
super.dismiss();
if(handler!=null){
handler.removeCallbacksAndMessages(null);
handler = null;
}
}
@Override
public void onDestroy() {
super.onDestroy();
if(handler!=null){
handler.removeCallbacksAndMessages(null);
handler = null;
}
}
}

+ 119
- 98
app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodInfoDialog.java View File

@@ -18,7 +18,6 @@ import androidx.fragment.app.DialogFragment;

import com.apkfuns.logutils.LogUtils;
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.common.db.mode.BPA_ORDER_DETAIL;
import com.bonait.bnframework.common.db.util.GoodsProcessDetailDBUtil;
@@ -29,8 +28,8 @@ import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.DialogFoodInfoBinding;
import com.bonait.bnframework.databinding.DialogFoodPosSelectBinding;
import com.bonait.bnframework.newui.adapter.order.WokNameAdapter;
import com.bonait.bnframework.newui.adapter.other.FoodPosSelectAdapter;
import com.bonait.bnframework.newui.fragment.setting.SceneSetFragment;

import java.util.ArrayList;
import java.util.Arrays;
@@ -47,7 +46,7 @@ public class FoodInfoDialog extends DialogFragment {
private String TAG = " FoodInfoDialog =>";
private DialogFoodInfoBinding viewBinding;
private String orderId = "";
private HashMap<String,String> ovenMap = new LinkedHashMap<>();
private BPA_ORDER_DETAIL orderDetail;

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
@@ -106,6 +105,7 @@ public class FoodInfoDialog extends DialogFragment {
viewBinding.btnClose1.setOnClickListener(v->{
dismiss();
});
orderDetail = OrderDetailUtil.getById(orderId);
freshView();
initClick();
}
@@ -117,20 +117,41 @@ public class FoodInfoDialog extends DialogFragment {
viewBinding.top4.setText("");
viewBinding.top5.setText("");
viewBinding.top6.setText("");
viewBinding.right1.setText("");
viewBinding.right2.setText("");
viewBinding.right3.setText("");
viewBinding.right4.setText("");
viewBinding.right5.setText("");
viewBinding.right6.setText("");
BPA_ORDER_DETAIL order = OrderDetailUtil.getById(orderId);
if(order==null){
viewBinding.mainFood1.setText("");
viewBinding.mainFood2.setText("");
viewBinding.mainFood3.setText("");
viewBinding.mainFood4.setText("");
viewBinding.mainFood5.setText("");
viewBinding.mainFood6.setText("");
if(orderDetail==null){
dismiss();
return;
}
List<BPA_GOODS_PROCESS_DETAIL> details = GoodsProcessDetailDBUtil.getByGroupId(order.groupId);
if(orderDetail.mainPosition!=0 && orderDetail.type!=0){
switch (orderDetail.mainPosition){
case 1:
viewBinding.mainFood1.setText(orderDetail.type+"号炒锅");
break;
case 2:
viewBinding.mainFood2.setText(orderDetail.type+"号炒锅");
break;
case 3:
viewBinding.mainFood3.setText(orderDetail.type+"号炒锅");
break;
case 4:
viewBinding.mainFood4.setText(orderDetail.type+"号炒锅");
break;
case 5:
viewBinding.mainFood5.setText(orderDetail.type+"号炒锅");
break;
case 6:
viewBinding.mainFood6.setText(orderDetail.type+"号炒锅");
break;
}
}
List<BPA_GOODS_PROCESS_DETAIL> details = GoodsProcessDetailDBUtil.getByGroupId(orderDetail.groupId);
for(BPA_GOODS_PROCESS_DETAIL detail:details){
if(detail.processname.equals("主料")||detail.processname.equals("辅料")){
if(detail.processname.equals("辅料")){
if(!detail.processvalue.isEmpty()){
List<String> data = new ArrayList<>();
if (detail.processvalue.contains("|")) {
@@ -147,9 +168,9 @@ public class FoodInfoDialog extends DialogFragment {
if (wl.length == 2) {
String name = wl[0];
String val = wl[1];
if(name.equals("主料名称")||name.equals("辅料名称")||name.equals("烤菜名称")){
if(name.equals("辅料名称")){
foodName = val;
}else if(name.equals("主料位置")||name.equals("辅料位置")||name.equals("菜盘位置")){
}else if(name.equals("辅料位置")){
foodPos = val;
}
}
@@ -157,22 +178,6 @@ public class FoodInfoDialog extends DialogFragment {
}
updateName(detail.processname,foodName,foodPos);
}
}else if(detail.processname.equals("放入烤盘")){
String processvalue = detail.processvalue;
String[] res1 = processvalue.split("\\|");
int position = -1;//货架位置
for(String s:res1){
String[] res2 = s.split(",");
if(res2.length==2){
ovenMap.put(res2[0],res2[1]);
}else {
ovenMap.put(res2[0],"");
}
if(s.contains("烤盘位置")){
position = Integer.parseInt(res2[1].replace("K",""));
}
updateName("烤箱","", position+"");
}
}
}
}
@@ -213,33 +218,13 @@ public class FoodInfoDialog extends DialogFragment {
viewBinding.top6.setText("辅料F6\n"+name);
viewBinding.top6.setVisibility(View.VISIBLE);
break;
}
break;
case "主料":
switch (position){
case 1:
viewBinding.right1.setText("主料Z1\n"+name);
viewBinding.right1.setVisibility(View.VISIBLE);
break;
case 2:
viewBinding.right2.setText("主料Z2\n"+name);
viewBinding.right2.setVisibility(View.VISIBLE);
case 7:
viewBinding.top7.setText("辅料F7\n"+name);
viewBinding.top7.setVisibility(View.VISIBLE);
break;
case 3:
viewBinding.right3.setText("主料Z3\n"+name);
viewBinding.right3.setVisibility(View.VISIBLE);
break;
case 4:
viewBinding.right4.setText("主料Z4\n"+name);
viewBinding.right4.setVisibility(View.VISIBLE);
break;
case 5:
viewBinding.right5.setText("主料Z5\n"+name);
viewBinding.right5.setVisibility(View.VISIBLE);
break;
case 6:
viewBinding.right6.setText("主料Z6\n"+name);
viewBinding.right6.setVisibility(View.VISIBLE);
case 8:
viewBinding.top8.setText("辅料F8\n"+name);
viewBinding.top8.setVisibility(View.VISIBLE);
break;
}
break;
@@ -248,49 +233,56 @@ public class FoodInfoDialog extends DialogFragment {

private void initClick(){
viewBinding.top1.setOnClickListener(v->{
showDialog("辅料位置","F1");
showFuLiaoDialog("辅料位置","F1");
});
viewBinding.top2.setOnClickListener(v->{
showDialog("辅料位置","F2");
showFuLiaoDialog("辅料位置","F2");
});
viewBinding.top3.setOnClickListener(v->{
showDialog("辅料位置","F3");
showFuLiaoDialog("辅料位置","F3");
});
viewBinding.top4.setOnClickListener(v->{
showDialog("辅料位置","F4");
showFuLiaoDialog("辅料位置","F4");
});
viewBinding.top5.setOnClickListener(v->{
showDialog("辅料位置","F5");
showFuLiaoDialog("辅料位置","F5");
});
viewBinding.top6.setOnClickListener(v->{
showFuLiaoDialog("辅料位置","F6");
});
viewBinding.top7.setOnClickListener(v->{
showFuLiaoDialog("辅料位置","F7");
});
viewBinding.top8.setOnClickListener(v->{
showFuLiaoDialog("辅料位置","F8");
});
if(!ConfigName.getInstance().versionSelectionEnum.equals(SceneSetFragment.deviceName4)){
viewBinding.top6.setOnClickListener(v->{
showDialog("辅料位置","F6");
});
}else {
viewBinding.top6.setVisibility(View.GONE);
}

viewBinding.right1.setOnClickListener(v->{
showDialog("主料位置","Z1");
viewBinding.mainFood1.setOnClickListener(v->{
showMainFoodDialog("主料位置",1);
});
viewBinding.right2.setOnClickListener(v->{
showDialog("主料位置","Z2");
viewBinding.mainFood2.setOnClickListener(v->{
showMainFoodDialog("主料位置",2);
});
viewBinding.right3.setOnClickListener(v->{
showDialog("主料位置","Z3");
viewBinding.mainFood3.setOnClickListener(v->{
showMainFoodDialog("主料位置",3);
});
viewBinding.right4.setOnClickListener(v->{
showDialog("主料位置","Z4");
viewBinding.mainFood4.setOnClickListener(v->{
showMainFoodDialog("主料位置",4);
});
viewBinding.right5.setOnClickListener(v->{
showDialog("主料位置","Z5");
viewBinding.mainFood5.setOnClickListener(v->{
showMainFoodDialog("主料位置",5);
});
viewBinding.right6.setOnClickListener(v->{
showDialog("主料位置","Z6");
viewBinding.mainFood6.setOnClickListener(v->{
showMainFoodDialog("主料位置",6);
});
}

private void showDialog(String name,String positionName){
/**
* 辅料位置
* @param name
* @param positionName
*/
private void showFuLiaoDialog(String name, String positionName){
AlertDialogUtils.showCancelAndConfirmDialog(getActivity(), R.layout.dialog_food_pos_select, (layoutView, xCom) -> {
DialogFoodPosSelectBinding binding = DialogFoodPosSelectBinding.bind(layoutView);
DisplayManager.scaleViewGroup(binding.getRoot());
@@ -307,11 +299,7 @@ public class FoodInfoDialog extends DialogFragment {

List<BPA_GOODS_PROCESS_DETAIL> details = GoodsProcessDetailDBUtil.getByGroupId(order.groupId);
for(BPA_GOODS_PROCESS_DETAIL detail:details){
if(name.contains("主料")){
if(detail.processname.equals("主料")){
data1.add(detail);
}
}else if(name.contains("辅料")){
if(name.contains("辅料")){
if(detail.processname.equals("辅料")){
data1.add(detail);
}
@@ -327,26 +315,17 @@ public class FoodInfoDialog extends DialogFragment {
String posInfo = "";
String[] res2 = new String[0];
for (String s:res){
if(name.contains("主料")){
if(s.contains("主料位置")){
posInfo = s;
res2 = s.split(",");
}
}else if(name.contains("辅料")){
if(name.contains("辅料")){
if(s.contains("辅料位置")){
posInfo = s;
res2 = s.split(",");
}
}

}
if(posInfo.isEmpty()||res2.length==0){
return;
}
if(name.contains("主料")){
detail.processvalue = detail.processvalue.replace(posInfo,"主料位置,"+positionName);
detail.processms = detail.processms.replace(res2[1],positionName);
}else if(name.contains("辅料")){
if(name.contains("辅料")){
detail.processvalue = detail.processvalue.replace(posInfo,"辅料位置,"+positionName);
detail.processms = detail.processms.replace(res2[1],positionName);
}
@@ -361,6 +340,48 @@ public class FoodInfoDialog extends DialogFragment {
});
}

/**
* 主料位置
* @param name
* @param mainPosition
*/
private void showMainFoodDialog(String name, int mainPosition){
AlertDialogUtils.showCancelAndConfirmDialog(getActivity(), R.layout.dialog_food_pos_select, (layoutView, xCom) -> {
DialogFoodPosSelectBinding binding = DialogFoodPosSelectBinding.bind(layoutView);
DisplayManager.scaleViewGroup(binding.getRoot());
binding.title.setText(name+" Z"+mainPosition);
binding.btnClose.setOnClickListener(v->{
xCom.dismissX();
});
BPA_ORDER_DETAIL order = OrderDetailUtil.getById(orderId);
if(order==null){
dismiss();
return;
}
List<String> data1 = new ArrayList<>();
if(mainPosition==1||mainPosition==2||mainPosition==3){
data1.add("1号炒锅");
data1.add("4号炒锅");
}else {
data1.add("2号炒锅");
data1.add("3号炒锅");
}

WokNameAdapter adapter = new WokNameAdapter(){
@Override
protected void onItemClick(View v, int position) {
orderDetail.type = Integer.parseInt(mData.get(position).substring(0,1));
orderDetail.mainPosition = mainPosition;
OrderDetailUtil.update(orderDetail);
freshView();
}
};

adapter.setNewData(data1);
binding.recycleView.setAdapter(adapter);
});
}

private MyClickListener listener;

public void setListener(MyClickListener listener) {


+ 40
- 160
app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog.java View File

@@ -32,6 +32,8 @@ import com.bonait.bnframework.modbus.ModbusCenter;
import com.bonait.bnframework.modbus.RobotModbusTcpServer;
import com.bonait.bnframework.modbus.Wok2ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok1ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok3ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok4ModbusTcpServer;
import com.bonait.bnframework.newui.fragment.setting.SceneSetFragment;

import java.util.Map;
@@ -141,162 +143,40 @@ public class RootTipDialog extends DialogFragment {
}

private void freshView(){
for (Map.Entry<String, CheckPositionBean> entry : ConfigName.getInstance().positionList.entrySet()) {
String key = entry.getKey();
CheckPositionBean value = entry.getValue();
TextView view;
switch (key){
case "辅料位置1号位":
if(value.exist){
viewBinding.content2.top1.setText("辅料F1\n有盒");
viewBinding.content2.icTop1.setSelected(true);
}else {
viewBinding.content2.top1.setText("辅料F1\n无盒");
viewBinding.content2.icTop1.setSelected(false);
}
break;
case "辅料位置2号位":
if(value.exist){
viewBinding.content2.top2.setText("辅料F2\n有盒");
viewBinding.content2.icTop2.setSelected(true);
}else {
viewBinding.content2.top2.setText("辅料F2\n无盒");
viewBinding.content2.icTop2.setSelected(false);
}
break;
case "辅料位置3号位":
if(value.exist){
viewBinding.content2.top3.setText("辅料F3\n有盒");
viewBinding.content2.icTop3.setSelected(true);
}else {
viewBinding.content2.top3.setText("辅料F3\n无盒");
viewBinding.content2.icTop3.setSelected(false);
}
break;
case "辅料位置4号位":
if(value.exist){
viewBinding.content2.top4.setText("辅料F4\n有盒");
viewBinding.content2.icTop4.setSelected(true);
}else {
viewBinding.content2.top4.setText("辅料F4\n无盒");
viewBinding.content2.icTop4.setSelected(false);
}
break;
case "辅料位置5号位":
if(value.exist){
viewBinding.content2.top5.setText("辅料F5\n有盒");
viewBinding.content2.icTop5.setSelected(true);
}else {
viewBinding.content2.top5.setText("辅料F5\n无盒");
viewBinding.content2.icTop5.setSelected(false);
}
break;
case "辅料位置6号位":
if(value.exist){
viewBinding.content2.top6.setText("辅料F6\n有盒");
viewBinding.content2.icTop6.setSelected(true);
}else {
viewBinding.content2.top6.setText("辅料F6\n无盒");
viewBinding.content2.icTop6.setSelected(false);
}
break;
case "主料位置1号位":
if(value.exist){
viewBinding.content2.right1.setText("主料Z1有盆");
viewBinding.content2.right1.setSelected(true);
}else {
viewBinding.content2.right1.setText("主料Z1无盆");
viewBinding.content2.right1.setSelected(false);
}
break;
case "主料位置2号位":
if(value.exist){
viewBinding.content2.right2.setText("主料Z2有盆");
viewBinding.content2.right2.setSelected(true);
}else {
viewBinding.content2.right2.setText("主料Z2无盆");
viewBinding.content2.right2.setSelected(false);
}
break;
case "主料位置3号位":
if(value.exist){
viewBinding.content2.right3.setText("主料Z3有盆");
viewBinding.content2.right3.setSelected(true);
}else {
viewBinding.content2.right3.setText("主料Z3无盆");
viewBinding.content2.right3.setSelected(false);
}
break;
case "主料位置4号位":
if(value.exist){
viewBinding.content2.right4.setText("主料Z4有盆");
viewBinding.content2.right4.setSelected(true);
}else {
viewBinding.content2.right4.setText("主料Z4无盆");
viewBinding.content2.right4.setSelected(false);
}
break;
case "主料位置5号位":
if(value.exist){
viewBinding.content2.right5.setText("主料Z5有盆");
viewBinding.content2.right5.setSelected(true);
}else {
viewBinding.content2.right5.setText("主料Z5无盆");
viewBinding.content2.right5.setSelected(false);
}
break;
case "主料位置6号位":
if(value.exist){
viewBinding.content2.right6.setText("主料Z6有盆");
viewBinding.content2.right6.setSelected(true);
}else {
viewBinding.content2.right6.setText("主料Z6无盆");
viewBinding.content2.right6.setSelected(false);
}
break;

case "出餐盆1":
if(value.exist){
viewBinding.content2.tvChucan1.setText("出餐盆1有盆");
viewBinding.content2.tvChucan1.setSelected(true);
}else {
viewBinding.content2.tvChucan1.setText("出餐盆1无盆");
viewBinding.content2.tvChucan1.setSelected(false);
}

break;
case "出餐盆2":
if(value.exist){
viewBinding.content2.tvChucan2.setText("出餐盆2有盆");
viewBinding.content2.tvChucan2.setSelected(true);
}else {
viewBinding.content2.tvChucan2.setText("出餐盆2无盆");
viewBinding.content2.tvChucan2.setSelected(false);
}
break;
case "出餐盆3":
if(value.exist){
viewBinding.content2.tvChucan3.setText("出餐盆3有盆");
viewBinding.content2.tvChucan3.setSelected(true);
}else {
viewBinding.content2.tvChucan3.setText("出餐盆3无盆");
viewBinding.content2.tvChucan3.setSelected(false);
}
break;
}
}
//出餐盆1 2 3 4
try {
Object object1 = ModbusCenter.getRobotListingValue("输送线进料菜盆检测");
Object object4 = ModbusCenter.getRobotListingValue("输送线出料菜盆检测");
if(object1 instanceof Boolean){
viewBinding.content2.tvEnter.setText("输送线进料菜盆:"+(((Boolean)object1)?"有盆":"无盆"));
}else {
viewBinding.content2.tvEnter.setText("输送线进料菜盆:检测异常");
}
if(object4 instanceof Boolean){
viewBinding.content2.tvOut.setText("输送线出料菜盆:"+(((Boolean)object4)?"有盆":"无盆"));
}else {
viewBinding.content2.tvOut.setText("输送线出料菜盆:检测异常");
for (int i=1;i<=4;i++){
Object kongPen = ModbusCenter.ReadPlc(0,i+"#空盆库位检测有无");
switch (i){
case 1:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen1.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
}else {
viewBinding.content2.tvKongPen1.setText("炒锅"+i+"出餐盆:异常");
}
break;
case 2:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen2.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
}else {
viewBinding.content2.tvKongPen2.setText("炒锅"+i+"出餐盆:异常");
}
break;
case 3:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen3.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
}else {
viewBinding.content2.tvKongPen3.setText("炒锅"+i+"出餐盆:异常");
}
break;
case 4:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen4.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
}else {
viewBinding.content2.tvKongPen4.setText("炒锅"+i+"出餐盆:异常");
}
break;
}
}
}catch (Exception ignored){
}
@@ -317,19 +197,19 @@ public class RootTipDialog extends DialogFragment {
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.content0.deviceStatusWok2.setText(spannable2);

String content3 = "3号炒锅:"+(Wok2ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
String content3 = "3号炒锅:"+(Wok3ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable3 = new SpannableStringBuilder(content3);
spannable3.setSpan(new ForegroundColorSpan(Wok2ModbusTcpServer.get().plcIsConnect? Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
spannable3.setSpan(new ForegroundColorSpan(Wok3ModbusTcpServer.get().plcIsConnect? Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
, content3.length()-3, content3.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.content0.deviceStatusWok3.setText(spannable3);

String content4 = "4号炒锅:"+(Wok2ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
String content4 = "4号炒锅:"+(Wok4ModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable4 = new SpannableStringBuilder(content4);
spannable4.setSpan(new ForegroundColorSpan(Wok2ModbusTcpServer.get().plcIsConnect? Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
spannable4.setSpan(new ForegroundColorSpan(Wok4ModbusTcpServer.get().plcIsConnect? Color.parseColor("#567722"):Color.parseColor("#DA5A17"))
, content4.length()-3, content4.length(),
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE前面不包括后面包括
viewBinding.content0.deviceStatusWok2.setText(spannable4);
viewBinding.content0.deviceStatusWok4.setText(spannable4);

String content5 = "机器人:"+(RobotModbusTcpServer.get().plcIsConnect?"已连接":"未连接");
SpannableStringBuilder spannable5 = new SpannableStringBuilder(content5);


+ 1
- 1
app/src/main/java/com/bonait/bnframework/newui/dialog/check/SubOrderDialog.java View File

@@ -32,7 +32,7 @@ import java.util.List;

/**
* @author: liup
* @description:
* @description: 订单记录
* @date: 2024/6/3 17:59.
*/
public class SubOrderDialog extends DialogFragment {


+ 0
- 180
app/src/main/java/com/bonait/bnframework/newui/dialog/control/ChuCanCheckDialog.java View File

@@ -1,180 +0,0 @@
package com.bonait.bnframework.newui.dialog.control;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.utils.AdbCommandUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.DialogChucanCheckBinding;
import com.bonait.bnframework.modbus.ModbusCenter;
import com.bonait.bnframework.newui.widget.NewToastUtil;

import butterknife.ButterKnife;

/**
* @author: liup
* @description: 机器人投料控制 出餐架
* @date: 2024/6/3 17:59.
*/
public class ChuCanCheckDialog extends DialogFragment {
private String TAG = " ChuCanCheckDialog =>";
private DialogChucanCheckBinding viewBinding;

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.DialogScale);
}
private Handler handler = new Handler(Looper.getMainLooper()){
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if(msg.what==1){
freshView();
if(handler.hasMessages(1)){
handler.removeMessages(1);
}
handler.sendEmptyMessageDelayed(1,500);
}
}
};

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
viewBinding = DialogChucanCheckBinding.inflate(inflater, container, false);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
ButterKnife.bind(this, viewBinding.getRoot());
return viewBinding.getRoot();
}
private void fullScreen(Window window){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// 全屏显示,隐藏状态栏和导航栏,拉出状态栏和导航栏显示一会儿后消失。
// 启动游戏模式,设置状态栏和导航栏中的图标变小,变模糊或者弱化其效果
window.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
// 全屏显示,隐藏状态栏
window.getDecorView().setSystemUiVisibility(View.INVISIBLE);
}
}
}
@Override
public void onStart() {
super.onStart();
if (getDialog() != null) {
Window window = getDialog().getWindow();
assert window != null;
fullScreen(window);
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.gravity = Gravity.CENTER;
params.width = ViewGroup.LayoutParams.WRAP_CONTENT;
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
window.setAttributes(params);
}
AdbCommandUtil.hideStatusBar(true);

initView();
}

private void initView(){
viewBinding.btnClose1.setOnClickListener(v->{
dismiss();
});

freshView();
handler.sendEmptyMessageDelayed(1,200);
viewBinding.btnStart.setOnClickListener(v->{
if(ConfigName.getInstance().isFastClick()){
NewToastUtil.getInstance().showToast("点击过快!");
return;
}
if(!RackModbusTcpServer.get().plcIsConnect&&!ConfigName.TEST){
NewToastUtil.getInstance().showToastError("货架设备未连接!");
return;
}
try{
ModbusCenter.rackWritePlc("输送线启动",true,null);
Thread.sleep(500);
ModbusCenter.rackWritePlc("输送线启动",false,null);
}catch (Exception e){
}
});
viewBinding.btnStop.setOnClickListener(v->{
if(ConfigName.getInstance().isFastClick()){
NewToastUtil.getInstance().showToast("点击过快!");
return;
}
if(!RackModbusTcpServer.get().plcIsConnect&&!ConfigName.TEST){
NewToastUtil.getInstance().showToastError("货架设备未连接!");
return;
}
try{
ModbusCenter.rackWritePlc("输送线停止",true,null);
Thread.sleep(500);
ModbusCenter.rackWritePlc("输送线停止",false,null);
}catch (Exception e){
}
});

}

private void freshView(){
try {
Object object1 = ModbusCenter.getRobotListingValue("输送线进料菜盆检测");
Object object4 = ModbusCenter.getRobotListingValue("输送线出料菜盆检测");
if(object1 instanceof Boolean){
viewBinding.tvEnter.setText("输送线进料菜盆:"+(((Boolean)object1)?"有盆":"无盆"));
}else {
viewBinding.tvEnter.setText("输送线进料菜盆:检测异常");
}
if(object4 instanceof Boolean){
viewBinding.tvOut.setText("输送线出料菜盆:"+(((Boolean)object4)?"有盆":"无盆"));
}else {
viewBinding.tvOut.setText("输送线出料菜盆:检测异常");
}
}catch (Exception ignored){
}
}
@Override
public void dismiss() {
super.dismiss();
if(handler!=null){
handler.removeCallbacksAndMessages(null);
handler = null;
}
}
@Override
public void onDestroy() {
super.onDestroy();
if(handler!=null){
handler.removeCallbacksAndMessages(null);
handler = null;
}
}
}

+ 0
- 120
app/src/main/java/com/bonait/bnframework/newui/dialog/control/RobotControlDialog.java View File

@@ -71,7 +71,6 @@ public class RobotControlDialog extends DialogFragment {
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if(msg.what==1){
freshView();
Object object = ModbusCenter.getRobotListingValue("机器人到达维护位");
Object object2 = ModbusCenter.getRobotListingValue("机器人在原点");
if(object instanceof Boolean){
@@ -186,125 +185,6 @@ public class RobotControlDialog extends DialogFragment {
});
}

@SuppressLint("SetTextI18n")
private void freshView(){
for (Map.Entry<String, CheckPositionBean> entry : ConfigName.getInstance().positionList.entrySet()) {
String key = entry.getKey();
CheckPositionBean value = entry.getValue();
TextView view;
switch (key){
case "辅料位置1号位":
if(value.exist){
viewBinding.top1.setText("辅料F1\n有盒");
// viewBinding.icTop1.setSelected(true);
}else {
viewBinding.top1.setText("辅料F1\n无盒");
// viewBinding.icTop1.setSelected(false);
}
break;
case "辅料位置2号位":
if(value.exist){
viewBinding.top2.setText("辅料F2\n有盒");
// viewBinding.icTop2.setSelected(true);
}else {
viewBinding.top2.setText("辅料F2\n无盒");
// viewBinding.icTop2.setSelected(false);
}
break;
case "辅料位置3号位":
if(value.exist){
viewBinding.top3.setText("辅料F3\n有盒");
// viewBinding.icTop3.setSelected(true);
}else {
viewBinding.top3.setText("辅料F3\n无盒");
// viewBinding.icTop3.setSelected(false);
}
break;
case "辅料位置4号位":
if(value.exist){
viewBinding.top4.setText("辅料F4\n有盒");
// viewBinding.icTop4.setSelected(true);
}else {
viewBinding.top4.setText("辅料F4\n无盒");
// viewBinding.icTop4.setSelected(false);
}
break;
case "辅料位置5号位":
if(value.exist){
viewBinding.top5.setText("辅料F5\n有盒");
// viewBinding.icTop3.setSelected(true);
}else {
viewBinding.top5.setText("辅料F5\n无盒");
// viewBinding.icTop3.setSelected(false);
}
break;
case "辅料位置6号位":
if(value.exist){
viewBinding.top6.setText("辅料F6\n有盒");
// viewBinding.icTop4.setSelected(true);
}else {
viewBinding.top6.setText("辅料F6\n无盒");
// viewBinding.icTop4.setSelected(false);
}
break;
case "主料位置1号位":
if(value.exist){
viewBinding.right6.setText("主料Z1有盆");
// viewBinding.right1.setSelected(true);
}else {
viewBinding.right6.setText("主料Z1无盆");
// viewBinding.right1.setSelected(false);
}
break;
case "主料位置2号位":
if(value.exist){
viewBinding.right5.setText("主料Z2有盆");
// viewBinding.right2.setSelected(true);
}else {
viewBinding.right5.setText("主料Z2无盆");
// viewBinding.right2.setSelected(false);
}
break;
case "主料位置3号位":
if(value.exist){
viewBinding.right4.setText("主料Z3有盆");
// viewBinding.right3.setSelected(true);
}else {
viewBinding.right4.setText("主料Z3无盆");
// viewBinding.right3.setSelected(false);
}
break;
case "主料位置4号位":
if(value.exist){
viewBinding.right3.setText("主料Z4有盆");
// viewBinding.right4.setSelected(true);
}else {
viewBinding.right3.setText("主料Z4无盆");
// viewBinding.right4.setSelected(false);
}
break;
case "主料位置5号位":
if(value.exist){
viewBinding.right2.setText("主料Z5有盆");
// viewBinding.right5.setSelected(true);
}else {
viewBinding.right2.setText("主料Z5无盆");
// viewBinding.right5.setSelected(false);
}
break;
case "主料位置6号位":
if(value.exist){
viewBinding.right1.setText("主料Z6有盆");
// viewBinding.right6.setSelected(true);
}else {
viewBinding.right1.setText("主料Z6无盆");
// viewBinding.right6.setSelected(false);
}
break;
}
}
}

private HashMap<String, String> data = new HashMap<>();;
@SuppressLint("NonConstantResourceId")
@OnClick({R.id.top1, R.id.top2,R.id.top3,R.id.top4,R.id.top5,R.id.top6,R.id.top7,R.id.top8,


+ 1
- 1
app/src/main/java/com/bonait/bnframework/newui/dialog/control/SilosInfoDialog.java View File

@@ -47,7 +47,7 @@ import butterknife.OnClick;

/**
* @author: liup
* @description: 机器人投料控制
* @description: 料仓设置 校准
* @date: 2024/6/3 17:59.
*/
public class SilosInfoDialog extends DialogFragment {


+ 0
- 1
app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java View File

@@ -66,7 +66,6 @@ public class WokControlDialog extends DialogFragment {
private DialogChaoguoControlBinding viewBinding;
private int deviceNum = 1;
private boolean showRobot = true;
private static final String checkNames = "搅拌速度,抽料位,原点位,倒菜位,维护位,清洗位,炒菜位1,炒菜位2,炒菜位3";

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {


+ 0
- 12
app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeDevicesFragment.java View File

@@ -23,8 +23,6 @@ import com.bonait.bnframework.modbus.Wok2ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok1ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok3ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok4ModbusTcpServer;
import com.bonait.bnframework.newui.dialog.control.ChuCanCheckDialog;
import com.bonait.bnframework.newui.dialog.check.FoodCheckDialog;
import com.bonait.bnframework.newui.dialog.control.RobotControlDialog;
import com.bonait.bnframework.newui.dialog.control.WokControlDialog;
import com.bonait.bnframework.newui.widget.NewToastUtil;
@@ -82,16 +80,6 @@ public class HomeDevicesFragment extends BaseFragment {
}
showWokDialog(2);
});

viewBinding.btnDishCheck.setOnClickListener(v->{
if(ConfigName.getInstance().isFastClick()){
return;
}
FoodCheckDialog dialog = new FoodCheckDialog();
if(getActivity()!=null){
dialog.show(getActivity().getSupportFragmentManager(),"料盒检测");
}
});
}

/**


+ 32
- 78
app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeOrderFragment.java View File

@@ -67,7 +67,7 @@ public class HomeOrderFragment extends BaseFragment {
private List<BPA_ORDER_DETAIL> orderDetails1;
private List<String> foodInfoList = new ArrayList<>();
private BPA_ORDER_DETAIL orderDetail;
private DeviceStatusView deviceStatusView1,deviceStatusView2;
private DeviceStatusView deviceStatusView1,deviceStatusView2,deviceStatusView3,deviceStatusView4;

@Override
protected View onCreateView() {
@@ -84,10 +84,16 @@ public class HomeOrderFragment extends BaseFragment {
viewBinding.llDevices.removeAllViews();
deviceStatusView1 = new DeviceStatusView(getContext(),null,1);
deviceStatusView2 = new DeviceStatusView(getContext(),null,2);
deviceStatusView3 = new DeviceStatusView(getContext(),null,3);
deviceStatusView4 = new DeviceStatusView(getContext(),null,4);
getLifecycle().addObserver((LifecycleObserver) deviceStatusView1);
getLifecycle().addObserver((LifecycleObserver) deviceStatusView2);
getLifecycle().addObserver((LifecycleObserver) deviceStatusView3);
getLifecycle().addObserver((LifecycleObserver) deviceStatusView4);
viewBinding.llDevices.addView(deviceStatusView1);
viewBinding.llDevices.addView(deviceStatusView2);
viewBinding.llDevices.addView(deviceStatusView3);
viewBinding.llDevices.addView(deviceStatusView4);
LogUtils.d("Home4Fragment onViewCreated");
}

@@ -101,6 +107,12 @@ public class HomeOrderFragment extends BaseFragment {
if(deviceStatusView2!=null){
getLifecycle().removeObserver(deviceStatusView2);
}
if(deviceStatusView3!=null){
getLifecycle().removeObserver(deviceStatusView3);
}
if(deviceStatusView4!=null){
getLifecycle().removeObserver(deviceStatusView4);
}
}catch (Exception e){

}
@@ -469,36 +481,29 @@ public class HomeOrderFragment extends BaseFragment {
*
**/
private void makingOrderDialog(BPA_ORDER_DETAIL orderDetail,int status,String name,String error,int position){
Object isClose = ModbusCenter.listeningValue.get("电柜门关到位检测");
if(isClose instanceof Boolean){
if((Boolean) isClose){
NewToastUtil.getInstance().showToastError("电柜门未关闭,请关闭!");
return;
}
}
// Object isClose = ModbusCenter.listeningValue.get("电柜门关到位检测");
// if(isClose instanceof Boolean){
// if((Boolean) isClose){
// NewToastUtil.getInstance().showToastError("电柜门未关闭,请关闭!");
// return;
// }
// }
AlertDialogUtils.showCancelAndConfirmDialog((AppCompatActivity) getActivity(), R.layout.dialog_order, (layoutView, xCom) -> {
DialogOrderBinding binding = DialogOrderBinding.bind(layoutView);
String desc = "【"+name+"】订单";
switch (status){
case -1:
if(error.contains("未放置")){
binding.submit.setText("确认已放料盆,开始制作");
}else {
binding.submit.setText("确认已补料,开始制作");
}
desc = "【"+name+"】检测到配料位不正确,请确认\n"+error;
binding.submit.setText("确认");
desc = error;
binding.cancel.setVisibility(View.GONE);

break;
case 0:
desc = "【"+name+"】订单准备就绪,是否开始制作?";
binding.cancel.setText("开始制作");
binding.submit.setText("制作并查看流程");
break;
case 1:
break;
case 2:
desc = "【"+name+"】订单已完成,是否确认?";
desc = "【"+name+"】订单已完成,是否删除?";
binding.cancel.setText("取消");
binding.submit.setText("确认");
break;
@@ -517,7 +522,6 @@ public class HomeOrderFragment extends BaseFragment {
return;
}
switch (status){
case -1:
case 0:
orderDetails1.get(position).status = 1;
BPA_ORDER_DETAIL bean = orderDetails1.get(position);
@@ -530,7 +534,7 @@ public class HomeOrderFragment extends BaseFragment {
startMakingThread(bean);
jumpToCook(bean);
break;
case 1:
case -1:
break;
case 2:
case 3:
@@ -585,67 +589,17 @@ public class HomeOrderFragment extends BaseFragment {
return "";
}
try {
StringBuilder check = new StringBuilder();
String check = "";
boolean hasMainFood = false;
List<BPA_GOODS_PROCESS_DETAIL> processDetails = GoodsProcessDetailDBUtil.getByGroupId(orderDetail.groupId);
for(BPA_GOODS_PROCESS_DETAIL processDetail:processDetails){
if(processDetail.processname.equals("主料")){
String[] res = processDetail.processvalue.split("\\|");
String[] res2= res[1].split(",");
for(String s : res){
if(s.contains("主料位置")){
res2 = s.split(",");
}
}
String pos = res2[1].replace("Z","");
CheckPositionBean positionBean = ConfigName.getInstance().positionList.get("主料位置"+pos+"号位");
if(positionBean!=null){
if(positionBean.exist){
if(positionBean.number%2 != 0){
check.append("主料Z").append(res2[1]).append("未补料;");
}
}else {
check.append("主料Z").append(res2[1]).append("未放置;");
}
}else {
check.append("主料位置解析失败;");
}
}else if(processDetail.processname.equals("辅料")){
String[] res = processDetail.processvalue.split("\\|");
String[] res2= res[1].split(",");
for(String s : res){
if(s.contains("辅料位置")){
res2 = s.split(",");
}
}
String pos = res2[1].replace("F","");
CheckPositionBean positionBean = ConfigName.getInstance().positionList.get("辅料位置"+pos+"号位");
if(positionBean!=null){
if(positionBean.exist){
if(positionBean.number%2 != 0){
check.append("辅料F").append(res2[1]).append("未补料;");
}
}else {
check.append("辅料F").append(res2[1]).append("未放置;");
}
}else {
check.append("辅料位置解析失败;");
}
}else if(processDetail.processname.equals("放入烤盘")){
String[] res = processDetail.processvalue.split("\\|");
for(String s : res){
if(s.equals("烤盘位置")){
String[] res2= s.split(",");
String pos = res2[1].replace("K","");
CheckPositionBean positionBean = ConfigName.getInstance().positionList.get("烤盘位置"+pos+"号位");
if(positionBean!=null && positionBean.exist){
check.append("烤盘K").append(res2[1]).append("未放置;");
}else {
check.append("烤盘位置解析失败;");
}
break;
}
}

hasMainFood = true;
}
}
if(hasMainFood){
if(orderDetail.type==0||orderDetail.mainPosition==0){
check = "请先设置主料位置以及炒锅位置!";
}
}
return check.toString();


+ 50
- 93
app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeWarnFragment.java View File

@@ -85,7 +85,7 @@ public class HomeWarnFragment extends BaseFragment {
}

public void freshPlc(){
ThreadManager.get().StartLong(TAG, false, () -> {
ThreadManager.get().execute(()->{
try{
ModbusCenter.ReadPLCStatus(deviceNum);
ModbusCenter.setWokListeningValue(deviceNum,"搅拌电机");
@@ -100,25 +100,47 @@ public class HomeWarnFragment extends BaseFragment {
private void initView(){
warnInfoList = new ArrayList<>();
rightDataList = new ArrayList<>();
viewBinding.titleChaoguo.setSelected(true);
viewBinding.titleWok1.setSelected(true);

viewBinding.titleChaoguo.setOnClickListener(v->{
viewBinding.titleChaoguo.setSelected(true);
viewBinding.titleKaoxiang.setSelected(false);
viewBinding.titleWok1.setOnClickListener(v->{
viewBinding.titleWok1.setSelected(true);
viewBinding.titleWok2.setSelected(false);
viewBinding.titleWok3.setSelected(false);
viewBinding.titleWok4.setSelected(false);
viewBinding.titleRobot.setSelected(false);
changeContent(1);
});
viewBinding.titleKaoxiang.setOnClickListener(v->{
viewBinding.titleChaoguo.setSelected(false);
viewBinding.titleKaoxiang.setSelected(true);
viewBinding.titleWok2.setOnClickListener(v->{
viewBinding.titleWok1.setSelected(false);
viewBinding.titleWok2.setSelected(true);
viewBinding.titleWok3.setSelected(false);
viewBinding.titleWok4.setSelected(false);
viewBinding.titleRobot.setSelected(false);
changeContent(2);
});
viewBinding.titleWok3.setOnClickListener(v->{
viewBinding.titleWok1.setSelected(false);
viewBinding.titleWok2.setSelected(false);
viewBinding.titleWok3.setSelected(true);
viewBinding.titleWok4.setSelected(false);
viewBinding.titleRobot.setSelected(false);
changeContent(3);
});
viewBinding.titleWok4.setOnClickListener(v->{
viewBinding.titleWok1.setSelected(false);
viewBinding.titleWok2.setSelected(false);
viewBinding.titleWok3.setSelected(false);
viewBinding.titleWok4.setSelected(true);
viewBinding.titleRobot.setSelected(false);
changeContent(4);
});
viewBinding.titleRobot.setOnClickListener(v->{
viewBinding.titleChaoguo.setSelected(false);
viewBinding.titleKaoxiang.setSelected(false);
viewBinding.titleWok1.setSelected(false);
viewBinding.titleWok2.setSelected(false);
viewBinding.titleWok3.setSelected(false);
viewBinding.titleWok4.setSelected(false);
viewBinding.titleRobot.setSelected(true);
changeContent(3);
changeContent(5);
});
viewBinding.btnReset.setOnClickListener(v->{

@@ -133,20 +155,6 @@ public class HomeWarnFragment extends BaseFragment {
warnInfoAdapter = new WarnInfoAdapter() {
@Override
protected void onResetItemClick(View v, String value) {
// AlertDialogUtils.showCancelAndConfirmDialog(getActivity(), R.layout.dialog_tip, (layoutView, xCom) -> {
// DialogTipBinding binding = DialogTipBinding.bind(layoutView);
// DisplayManager.scaleViewGroup(binding.getRoot());
// binding.title.setText("确认机器人指令");
// if(value.contains("超时")){
// binding.message.setText(value+",请检查,是否复位?");
// }
// binding.close.setOnClickListener(view1->{
// xCom.dismissX();
// });
// binding.submit.setOnClickListener(view1 -> {
// xCom.dismissX();
// });
// });
}
};
warnInfoAdapter.setNewData(warnInfoList);
@@ -188,73 +196,22 @@ public class HomeWarnFragment extends BaseFragment {
}

private void updateRobotInfo(){
Object object2 = ModbusCenter.listeningValue.get("机器人急停");
Object object3 = ModbusCenter.listeningValue.get("机器人光栅");
Object object4 = ModbusCenter.listeningValue.get("输送电机过载");
Object object5 = ModbusCenter.listeningValue.get("输送电机通讯异常");
if(object2 instanceof Boolean){
if((Boolean) object2){
warnInfoList.add("机器人急停:检测到急停");
if(!rightDataList.contains("机器人急停:检测到急停")){
rightDataList.add("机器人急停:检测到急停");
}
}else {
warnInfoList.add("机器人急停:无故障");
}
}else {
warnInfoList.add("机器人急停:检测异常");
if(!rightDataList.contains("机器人急停:检测异常")){
rightDataList.add("机器人急停:检测异常");
}
}
if(object3 instanceof Boolean){
if((Boolean) object3){
warnInfoList.add("机器人光栅:光栅检测到物体");
if(!rightDataList.contains("机器人光栅:光栅检测到物体")){
rightDataList.add("机器人光栅:光栅检测到物体");
}
}else {
warnInfoList.add("机器人光栅:无故障");
}
}else {
warnInfoList.add("机器人光栅:检测异常");
if(!rightDataList.contains("机器人光栅:检测异常")){
rightDataList.add("机器人光栅:检测异常");
}
}
if(ConfigName.getInstance().versionSelectionEnum.equals("鸿鹄大邑")||ConfigName.getInstance().versionSelectionEnum.equals("鸿鹄中江")){
if(object4 instanceof Boolean){
if((Boolean) object4){
warnInfoList.add("输送电机过载:过载");
if(!rightDataList.contains("输送电机过载:过载")){
rightDataList.add("输送电机过载:过载");
}
}else {
warnInfoList.add("输送电机过载:无故障");
}
}else {
warnInfoList.add("输送电机过载:检测异常");
if(!rightDataList.contains("输送电机过载:检测异常")){
rightDataList.add("输送电机过载:检测异常");
}
}
if(object5 instanceof Boolean){
if((Boolean) object5){
warnInfoList.add("输送电机通讯:异常");
if(!rightDataList.contains("输送电机通讯:异常")){
rightDataList.add("输送电机通讯:异常");
}
}else {
warnInfoList.add("输送电机通讯:无故障");
}
}else {
warnInfoList.add("输送电机通讯:检测异常");
if(!rightDataList.contains("输送电机通讯:检测异常")){
rightDataList.add("输送电机通讯:检测异常");
}
}
}

// Object object2 = ModbusCenter.listeningValue.get("机器人急停");
// if(object2 instanceof Boolean){
// if((Boolean) object2){
// warnInfoList.add("机器人急停:检测到急停");
// if(!rightDataList.contains("机器人急停:检测到急停")){
// rightDataList.add("机器人急停:检测到急停");
// }
// }else {
// warnInfoList.add("机器人急停:无故障");
// }
// }else {
// warnInfoList.add("机器人急停:检测异常");
// if(!rightDataList.contains("机器人急停:检测异常")){
// rightDataList.add("机器人急停:检测异常");
// }
// }
}

private void updateWokInfo(int deviceNum){
@@ -329,7 +286,7 @@ public class HomeWarnFragment extends BaseFragment {

/**
* 切换标题内容
* @param type 1炒锅 2烤箱 3机器人
* @param type 1 2 3 4炒锅 5机器人
*/
private void changeContent(int type){
this.type = type;


+ 2
- 0
app/src/main/java/com/bonait/bnframework/newui/fragment/setting/SilosSettingFragment.java View File

@@ -49,6 +49,8 @@ public class SilosSettingFragment extends BaseFragment {
List<String> devices = new ArrayList<>();
devices.add("1号炒锅");
devices.add("2号炒锅");
devices.add("3号炒锅");
devices.add("4号炒锅");
ArrayAdapter<String> spinnerAdapter2 = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, devices);
spinnerAdapter2.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinnerWok.setAdapter(spinnerAdapter2);


+ 1
- 1
app/src/main/res/drawable/bg_order.xml View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

<solid android:color="#80BEAA6A"/>
<solid android:color="#A0BEAA6A"/>
<corners android:radius="10dp"/>
</shape>

+ 3
- 3
app/src/main/res/layout/activity_system_set.xml View File

@@ -70,7 +70,7 @@
>

<LinearLayout
android:id="@+id/ll3"
android:id="@+id/ll1"
android:layout_width="150dp"
android:orientation="vertical"
android:layout_gravity="center"
@@ -94,7 +94,7 @@


<LinearLayout
android:id="@+id/ll1"
android:id="@+id/ll2"
android:layout_width="150dp"
android:orientation="vertical"
android:layout_marginStart="50dp"
@@ -118,7 +118,7 @@
</LinearLayout>

<LinearLayout
android:id="@+id/ll2"
android:id="@+id/ll3"
android:layout_width="150dp"
android:orientation="vertical"
android:layout_gravity="center"


+ 1
- 16
app/src/main/res/layout/new/layout/activity_edit_process_h.xml View File

@@ -293,22 +293,7 @@
android:layout_marginTop="25dp"
android:visibility="gone"
/>
<include
android:id="@+id/layout_huojia2"
android:layout_width="700dp"
android:layout_height="350dp"
layout="@layout/layout_huojia2"
android:layout_marginTop="25dp"
android:visibility="gone"
/>
<include
android:id="@+id/layout_huojia3"
android:layout_width="700dp"
android:layout_height="350dp"
layout="@layout/layout_huojia3"
android:layout_marginTop="25dp"
android:visibility="gone"
/>

<FrameLayout
android:layout_width="wrap_content"
android:layout_height="350dp">


+ 42
- 42
app/src/main/res/layout/new/layout/activity_main_h.xml View File

@@ -36,7 +36,7 @@
android:paddingBottom="10dp"
>
<TextView
android:id="@+id/tv_wok"
android:id="@+id/tv_wok1"
android:layout_width="wrap_content"
android:layout_height="50dp"
tools:text="炒锅:123465炒锅"
@@ -55,7 +55,37 @@
android:gravity="end"
tools:text="炒锅:123465"
android:textSize="32sp"
android:layout_below="@id/tv_wok"
android:layout_below="@id/tv_wok1"
android:textColor="@color/textcolor_subtile"
android:paddingBottom="10dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:visibility="gone"
tools:visibility="visible"
/>
<TextView
android:id="@+id/tv_wok3"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:gravity="end"
tools:text="炒锅:123465"
android:textSize="32sp"
android:layout_below="@id/tv_wok2"
android:textColor="@color/textcolor_subtile"
android:paddingBottom="10dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:visibility="gone"
tools:visibility="visible"
/>
<TextView
android:id="@+id/tv_wok4"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:gravity="end"
tools:text="炒锅:123465"
android:textSize="32sp"
android:layout_below="@id/tv_wok3"
android:textColor="@color/textcolor_subtile"
android:paddingBottom="10dp"
android:paddingStart="15dp"
@@ -65,6 +95,7 @@
/>
</RelativeLayout>


<LinearLayout
android:layout_width="match_parent"
android:layout_gravity="bottom"
@@ -77,7 +108,7 @@
android:textSize="32sp"
android:textColor="#cc000000"
android:text="1号炒锅:未连接"
android:layout_marginStart="5dp"
android:layout_marginStart="15dp"
android:gravity="center_vertical"
android:layout_height="match_parent"/>
<TextView
@@ -89,68 +120,37 @@
android:layout_marginStart="30dp"
android:gravity="center_vertical"
android:layout_height="match_parent"/>

<TextView
android:id="@+id/device_status_rack"
android:id="@+id/device_status_wok3"
android:layout_width="wrap_content"
android:layout_below="@id/device_status_wok"
android:layout_marginStart="30dp"
android:gravity="center_vertical"
android:layout_height="match_parent"
android:textSize="32sp"
android:textColor="#cc000000"
android:text="货架:未连接"
/>
<TextView
android:id="@+id/device_status_robot"
android:layout_width="wrap_content"
android:layout_below="@id/device_status_rack"
android:text="3号炒锅:未连接"
android:layout_marginStart="30dp"
android:textSize="32sp"
android:textColor="#cc000000"
android:text="机器人:未连接"
android:gravity="center_vertical"
android:layout_height="match_parent"/>


<TextView
android:id="@+id/tv_shusong_line"
android:id="@+id/device_status_wok4"
android:layout_width="wrap_content"
android:layout_marginStart="30dp"
android:textSize="32sp"
android:textColor="#cc000000"
android:text="输送线:异常"
android:gravity="center_vertical"
android:layout_height="match_parent"/>

<TextView
android:id="@+id/tv_line_enter"
android:layout_width="wrap_content"
android:text="4号炒锅:未连接"
android:layout_marginStart="30dp"
android:textSize="32sp"
android:textColor="#cc000000"
android:text="输送线进料盆:异常"
android:gravity="center_vertical"
android:layout_height="match_parent"/>

<TextView
android:id="@+id/tv_line_out"
android:id="@+id/device_status_robot"
android:layout_width="wrap_content"
android:layout_marginStart="30dp"
android:textSize="32sp"
android:textColor="#cc000000"
android:text="输送线出料盆:异常"
android:text="机器人:未连接"
android:gravity="center_vertical"
android:layout_height="match_parent"/>

<TextView
android:id="@+id/btn_box_check"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="货架检测"
android:textColor="#0088FF"
android:textSize="32sp"
android:gravity="center"
android:layout_gravity="end"
/>

</LinearLayout>


+ 0
- 130
app/src/main/res/layout/new/layout/dialog_chucan_check.xml View File

@@ -1,130 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_gravity="center"
android:gravity="center"
android:background="@color/transparent"
android:layout_height="wrap_content">

<RelativeLayout
android:layout_width="900dp"
android:background="@drawable/bg_round25_white"
android:layout_height="800dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="900dp"
android:id="@+id/cl_content2"
android:background="@drawable/bg_round25_white"
android:layout_height="800dp">

<ImageView
android:layout_width="600dp"
android:layout_height="600dp"
android:layout_marginTop="80dp"
android:src="@mipmap/ic_shusong_line"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
/>

<TextView
android:id="@+id/btn_start"
android:layout_width="220dp"
android:textSize="32sp"
android:textColor="@color/white"
android:text="启动输送线"
android:gravity="center"
android:background="@drawable/bg_round15_yellow_btn"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="650dp"
android:layout_marginEnd="300dp"
android:layout_height="100dp"/>

<TextView
android:id="@+id/btn_stop"
android:layout_width="220dp"
android:textSize="32sp"
android:textColor="@color/white"
android:text="停止输送线"
android:gravity="center"
android:background="@drawable/bg_round15_yellow_btn"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="650dp"
android:layout_marginStart="300dp"
android:layout_height="100dp"/>


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_enter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="400dp"
android:text="输送线进料菜盆检测"
android:layout_marginEnd="20dp"
android:textStyle="bold"
android:textSize="36sp"
android:textColor="@color/black"
/>
<TextView
android:layout_width="50dp"
android:layout_height="5dp"
android:background="@color/black"
app:layout_constraintEnd_toStartOf="@id/tv_enter"
app:layout_constraintTop_toTopOf="@id/tv_enter"
app:layout_constraintBottom_toBottomOf="@id/tv_enter"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_out"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="200dp"
android:text="输送线出料菜盆检测"
android:layout_marginEnd="20dp"
android:textStyle="bold"
android:textSize="36sp"
android:textColor="@color/black"
/>
<TextView
android:layout_width="350dp"
android:layout_height="5dp"
android:background="@color/black"
app:layout_constraintEnd_toStartOf="@id/tv_out"
app:layout_constraintTop_toTopOf="@id/tv_out"
app:layout_constraintBottom_toBottomOf="@id/tv_out"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title1"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:background="@drawable/bg_round25_top_yellow"
style="@style/TextView_btn_dialog"
android:text="输送线检测"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
/>

<ImageView
android:id="@+id/btn_close1"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
style="@style/TextView_btn_dialog"
android:layout_marginEnd="20dp"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_clear_white_48dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
</RelativeLayout>

</LinearLayout>

+ 72
- 86
app/src/main/res/layout/new/layout/dialog_food_info.xml View File

@@ -33,145 +33,131 @@

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="130dp"
android:layout_height="120dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="135dp"
android:layout_marginStart="415dp"
android:layout_marginStart="230dp"
app:layout_constraintStart_toStartOf="parent"
android:orientation="horizontal"
android:paddingStart="50dp"
android:paddingEnd="50dp"
>
<TextView
android:id="@+id/top6"
android:layout_width="100dp"
android:id="@+id/top8"
android:layout_width="90dp"
android:layout_height="100dp"
android:gravity="center"
android:maxLines="2"
android:ellipsize="end"
android:textSize="28sp"
android:textColor="@color/black"
tools:text="调料"
/>
<TextView
android:id="@+id/ic_top6"
android:layout_width="75dp"
android:layout_height="40dp"
android:background="@drawable/bg_liaohe_check"
android:layout_marginStart="17dp"
android:layout_alignParentBottom="true"
/>
<TextView
android:id="@+id/top5"
android:layout_width="100dp"
android:id="@+id/top7"
android:layout_toEndOf="@id/top8"
android:layout_marginStart="30dp"
tools:text="调料"
android:layout_width="90dp"
android:layout_height="100dp"
android:layout_marginLeft="125dp"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:textSize="28sp"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top5"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="140dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:id="@+id/top6"
android:layout_width="90dp"
android:layout_height="100dp"
android:layout_toEndOf="@id/top7"
android:layout_marginStart="30dp"
tools:text="调料"
android:gravity="center"
android:maxLines="2"
android:ellipsize="end"
android:textSize="28sp"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/top4"
android:layout_width="100dp"
android:id="@+id/top5"
android:layout_width="90dp"
android:layout_height="100dp"
android:layout_marginLeft="230dp"
android:layout_marginStart="30dp"
tools:text="调料"
android:layout_marginLeft="125dp"
android:layout_toEndOf="@id/top6"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top4"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="240dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:id="@+id/top4"
android:layout_width="90dp"
android:layout_height="100dp"
android:layout_marginStart="30dp"
tools:text="调料"
android:layout_marginLeft="220dp"
android:gravity="center"
android:layout_toEndOf="@id/top5"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/top3"
android:layout_width="100dp"
android:layout_width="90dp"
android:layout_height="100dp"
android:layout_marginStart="30dp"
tools:text="调料"
android:layout_marginLeft="355dp"
android:layout_toEndOf="@id/top4"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top3"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="370dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
/>

<TextView
android:id="@+id/top2"
android:layout_width="100dp"
android:layout_width="90dp"
android:layout_height="100dp"
android:layout_marginStart="30dp"
tools:text="调料"
android:layout_marginLeft="455dp"
android:gravity="center"
android:textSize="28sp"
android:layout_toEndOf="@id/top3"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top2"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="470dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
/>

<TextView
android:id="@+id/top1"
android:layout_width="100dp"
android:layout_width="90dp"
android:layout_height="100dp"
android:layout_marginLeft="580dp"
android:layout_marginStart="30dp"
tools:text="调料"
android:gravity="center"
android:layout_toEndOf="@id/top2"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top1"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="595dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
/>
</RelativeLayout>


<TextView
android:id="@+id/right6"
android:id="@+id/mainFood6"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
@@ -188,13 +174,13 @@
/>
<TextView
android:id="@+id/right5"
android:id="@+id/mainFood5"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toEndOf="@id/right6"
app:layout_constraintTop_toTopOf="@id/right6"
app:layout_constraintStart_toEndOf="@id/mainFood6"
app:layout_constraintTop_toTopOf="@id/mainFood6"
android:layout_marginStart="60dp"
android:gravity="center"
android:textSize="32sp"
@@ -203,13 +189,13 @@
android:textColor="@color/black"
/>
<TextView
android:id="@+id/right4"
android:id="@+id/mainFood4"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintEnd_toEndOf="@id/right6"
app:layout_constraintTop_toBottomOf="@id/right6"
app:layout_constraintEnd_toEndOf="@id/mainFood6"
app:layout_constraintTop_toBottomOf="@id/mainFood6"
android:layout_marginTop="70dp"
android:gravity="center"
android:textSize="32sp"
@@ -219,12 +205,12 @@
/>
<TextView
android:id="@+id/right3"
android:id="@+id/mainFood3"
android:layout_width="270dp"
android:layout_height="80dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="@id/right5"
app:layout_constraintTop_toTopOf="@id/right4"
app:layout_constraintStart_toStartOf="@id/mainFood5"
app:layout_constraintTop_toTopOf="@id/mainFood4"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
@@ -233,13 +219,13 @@
/>
<TextView
android:id="@+id/right2"
android:id="@+id/mainFood2"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintEnd_toEndOf="@id/right6"
app:layout_constraintTop_toBottomOf="@id/right3"
app:layout_constraintEnd_toEndOf="@id/mainFood6"
app:layout_constraintTop_toBottomOf="@id/mainFood3"
android:layout_marginTop="74dp"
android:gravity="center"
android:textSize="32sp"
@@ -249,18 +235,18 @@
/>
<TextView
android:id="@+id/right1"
android:id="@+id/mainFood1"
android:layout_width="270dp"
android:layout_height="80dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="@id/right5"
app:layout_constraintTop_toTopOf="@id/right2"
app:layout_constraintStart_toStartOf="@id/mainFood5"
app:layout_constraintTop_toTopOf="@id/mainFood2"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/black"
tools:text="1号炒锅"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView


+ 0
- 39
app/src/main/res/layout/new/layout/dialog_root2_tip.xml View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_gravity="center"
android:gravity="center"
android:background="@color/transparent"
android:layout_height="wrap_content">

<include
android:id="@+id/content0"
android:layout_width="1000dp"
android:layout_height="700dp"
layout="@layout/layout_root_tip0"
/>
<include
android:id="@+id/content1"
android:layout_width="1000dp"
android:layout_height="700dp"
layout="@layout/layout_root_tip1"
android:visibility="gone"
/>
<include
android:id="@+id/content2"
android:layout_width="1850dp"
android:layout_height="950dp"
layout="@layout/layout_root_tip2_2"
android:visibility="gone"
/>
<include
android:id="@+id/content3"
android:layout_width="1000dp"
android:layout_height="600dp"
layout="@layout/layout_root_tip3"
android:visibility="gone"
/>

</FrameLayout>

+ 0
- 39
app/src/main/res/layout/new/layout/dialog_root3_tip.xml View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_gravity="center"
android:gravity="center"
android:background="@color/transparent"
android:layout_height="wrap_content">

<include
android:id="@+id/content0"
android:layout_width="1000dp"
android:layout_height="700dp"
layout="@layout/layout_root_tip0"
/>
<include
android:id="@+id/content1"
android:layout_width="1000dp"
android:layout_height="700dp"
layout="@layout/layout_root_tip1"
android:visibility="gone"
/>
<include
android:id="@+id/content2"
android:layout_width="1850dp"
android:layout_height="950dp"
layout="@layout/layout_root_tip2_3"
android:visibility="gone"
/>
<include
android:id="@+id/content3"
android:layout_width="1000dp"
android:layout_height="600dp"
layout="@layout/layout_root_tip3"
android:visibility="gone"
/>

</FrameLayout>

+ 35
- 5
app/src/main/res/layout/new/layout/fragment_home_warn_info.xml View File

@@ -16,12 +16,12 @@
android:orientation="vertical"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="580dp"
android:layout_width="880dp"
android:orientation="horizontal"
android:background="@drawable/bg_tab_title"
android:layout_height="70dp">
<TextView
android:id="@+id/title_chaoguo"
android:id="@+id/title_wok1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
@@ -36,7 +36,37 @@
android:background="#BBBBBB"
/>
<TextView
android:id="@+id/title_kaoxiang"
android:id="@+id/title_wok2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_tab_title_select"
android:text="2号炒锅"
style="@style/TextView_desc"
android:textColor="@drawable/bg_tab_title_textcolor_select"
/>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#BBBBBB"
/>
<TextView
android:id="@+id/title_wok3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_tab_title_select"
android:text="2号炒锅"
style="@style/TextView_desc"
android:textColor="@drawable/bg_tab_title_textcolor_select"
/>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#BBBBBB"
/>
<TextView
android:id="@+id/title_wok4"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
@@ -54,9 +84,9 @@
android:id="@+id/title_robot"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:layout_weight="1"
android:background="@drawable/bg_tab_title_select"
android:text="机器人+输送线"
android:text="机器人"
style="@style/TextView_desc"
android:textColor="@drawable/bg_tab_title_textcolor_select"
/>


+ 33
- 0
app/src/main/res/layout/new/layout/item_wok_name.xml View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/root"
android:background="@color/transparent"
xmlns:tools="http://schemas.android.com/tools">

<FrameLayout
android:id="@+id/content_bg"
android:layout_width="match_parent"
android:background="@color/transparent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_gravity="center"
android:layout_height="100dp">


<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_100"
tools:text="1号炒锅"
android:textSize="@dimen/sp_36"
android:gravity="center"
android:textColor="@color/blue_primary"
android:textStyle="bold"
android:background="@drawable/bg_round_white_btn"
/>

</FrameLayout>

</FrameLayout>

+ 42
- 384
app/src/main/res/layout/new/layout/layout_root_tip2.xml View File

@@ -6,13 +6,12 @@
android:layout_gravity="center"
android:gravity="center"
android:background="@color/transparent"
tools:layout_height="1008dp"
android:layout_height="wrap_content">

<androidx.constraintlayout.widget.ConstraintLayout
android:background="@drawable/bg_round25_white"
android:layout_width="1850dp"
android:layout_height="950dp">
android:layout_width="1000dp"
android:layout_height="900dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -36,408 +35,67 @@
app:layout_constraintLeft_toLeftOf="parent"
/>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="1200dp"
android:id="@+id/cl_content2"
android:layout_marginTop="40dp"
app:layout_constraintStart_toStartOf="parent"
<RelativeLayout
app:layout_constraintTop_toTopOf="parent"
android:layout_height="900dp">

<ImageView
android:layout_width="1100dp"
android:layout_height="550dp"
android:layout_marginTop="220dp"
android:src="@mipmap/ic_huojia"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:scaleY="1.1"
android:scaleX="1.1"
/>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="130dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="135dp"
android:layout_marginStart="415dp"
app:layout_constraintStart_toStartOf="parent"
android:orientation="horizontal"
android:paddingStart="50dp"
android:paddingEnd="50dp"
>
<TextView
android:id="@+id/top6"
android:layout_width="100dp"
android:layout_height="100dp"
android:gravity="center"
android:maxLines="2"
android:ellipsize="end"
android:textSize="28sp"
android:text="辅料F6\n有盒"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top6"
android:layout_width="75dp"
android:layout_height="40dp"
android:background="@drawable/bg_liaohe_check"
android:layout_marginStart="17dp"
android:layout_alignParentBottom="true"
tools:background="@mipmap/ic_he"
/>
<TextView
android:id="@+id/top5"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="125dp"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:text="辅料F5\n有盒"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top5"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="140dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
tools:background="@mipmap/ic_he"
/>
<TextView
android:id="@+id/top4"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="230dp"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:text="辅料F4\n有盒"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top4"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="240dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
tools:background="@mipmap/ic_he"
/>
<TextView
android:id="@+id/top3"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="355dp"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:text="辅料F3\n有盒"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top3"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="370dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
tools:background="@mipmap/ic_he"
/>

<TextView
android:id="@+id/top2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="455dp"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:text="辅料F2\n有盒"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top2"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="470dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
tools:background="@mipmap/ic_he"
/>

<TextView
android:id="@+id/top1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="580dp"
android:gravity="center"
android:textSize="28sp"
android:maxLines="2"
android:ellipsize="end"
android:text="辅料F1\n有盒"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/ic_top1"
android:layout_width="75dp"
android:layout_height="40dp"
android:layout_marginStart="595dp"
android:background="@drawable/bg_liaohe_check"
android:layout_alignParentBottom="true"
android:textColor="@color/black"
tools:background="@mipmap/ic_he"
/>
</RelativeLayout>

<TextView
android:id="@+id/tv_chucan3"
android:layout_width="270dp"
android:layout_height="80dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="340dp"
android:layout_marginStart="140dp"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="出餐盆3有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
/>
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="250dp"
android:layout_marginStart="100dp"
android:layout_marginEnd="100dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_chucan2"
android:layout_width="270dp"
android:layout_height="80dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="490dp"
android:layout_marginStart="140dp"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="出餐盆2有盆"
android:id="@+id/tv_kongPen1"
android:layout_width="350dp"
android:layout_height="100dp"
android:text="炒锅1出餐盆:无"
android:textSize="36sp"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
/>

<TextView
android:id="@+id/tv_chucan1"
android:layout_width="270dp"
android:layout_height="80dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="645dp"
android:layout_marginStart="140dp"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="出餐盆1有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
android:background="@mipmap/ic_pen"
/>


<TextView
android:id="@+id/right6"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="340dp"
android:layout_marginStart="460dp"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="主料Z6有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
/>
<TextView
android:id="@+id/right5"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toEndOf="@id/right6"
app:layout_constraintTop_toTopOf="@id/right6"
android:layout_marginStart="60dp"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="主料Z5有盆"
tools:background="@mipmap/ic_pen"
android:id="@+id/tv_kongPen2"
android:layout_width="350dp"
android:layout_height="100dp"
android:layout_alignParentEnd="true"
android:text="炒锅2出餐盆:无"
android:textSize="36sp"
android:textColor="@color/black"
/>
<TextView
android:id="@+id/right4"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintEnd_toEndOf="@id/right6"
app:layout_constraintTop_toBottomOf="@id/right6"
android:layout_marginTop="70dp"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="主料Z4有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
android:background="@mipmap/ic_pen"
/>

<TextView
android:id="@+id/right3"
android:layout_width="270dp"
android:layout_height="80dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="@id/right5"
app:layout_constraintTop_toTopOf="@id/right4"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="主料Z3有盆"
android:id="@+id/tv_kongPen3"
android:layout_width="350dp"
android:layout_height="100dp"
android:layout_below="@id/tv_kongPen1"
android:text="炒锅3出餐盆:无"
android:textSize="36sp"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
/>
<TextView
android:id="@+id/right2"
android:layout_width="270dp"
android:layout_height="80dp"
android:layout_marginLeft="40dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintEnd_toEndOf="@id/right6"
app:layout_constraintTop_toBottomOf="@id/right3"
android:layout_marginTop="74dp"
android:layout_marginTop="100dp"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="主料Z2有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
android:background="@mipmap/ic_pen"
/>
<TextView
android:id="@+id/right1"
android:layout_width="270dp"
android:layout_height="80dp"
android:background="@drawable/bg_pen_check"
app:layout_constraintStart_toStartOf="@id/right5"
app:layout_constraintTop_toTopOf="@id/right2"
android:gravity="center"
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="主料Z1有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
android:layout_width="630dp"
android:layout_marginEnd="20dp"
android:layout_height="match_parent"
android:layout_marginTop="150dp"
android:layout_marginBottom="50dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:orientation="vertical"
>
<TextView
android:layout_below="@id/device_status_robot"
android:layout_width="match_parent"
android:layout_marginStart="5dp"
android:layout_marginTop="25dp"
android:id="@+id/tv_kongPen4"
android:layout_width="350dp"
android:layout_height="100dp"
android:layout_below="@id/tv_kongPen1"
android:layout_alignParentEnd="true"
android:layout_marginTop="100dp"
android:text="炒锅4出餐盆:无"
android:textSize="36sp"
android:textColor="@color/black"
android:text=" 输送线:"
android:textStyle="bold"
android:layout_height="wrap_content"/>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="630dp"
android:layout_height="600dp">

<ImageView
android:layout_width="400dp"
android:layout_height="400dp"
android:layout_marginTop="80dp"
android:src="@mipmap/ic_shusong_line"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
/>


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_enter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="290dp"
android:text="输送线进料菜盆检测"
android:layout_marginEnd="20dp"
android:textStyle="bold"
android:textSize="36sp"
android:textColor="@color/black"
/>
<TextView
android:layout_width="10dp"
android:layout_height="5dp"
android:background="@color/black"
app:layout_constraintEnd_toStartOf="@id/tv_enter"
app:layout_constraintTop_toTopOf="@id/tv_enter"
app:layout_constraintBottom_toBottomOf="@id/tv_enter"
/>
android:gravity="center"
android:background="@mipmap/ic_pen"
/>
</RelativeLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_out"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="130dp"
android:text="输送线出料菜盆检测"
android:layout_marginEnd="20dp"
android:textStyle="bold"
android:textSize="36sp"
android:textColor="@color/black"
/>
<TextView
android:layout_width="200dp"
android:layout_height="5dp"
android:background="@color/black"
app:layout_constraintEnd_toStartOf="@id/tv_out"
app:layout_constraintTop_toTopOf="@id/tv_out"
app:layout_constraintBottom_toBottomOf="@id/tv_out"
/>
</androidx.constraintlayout.widget.ConstraintLayout>


</LinearLayout>
<TextView
android:id="@+id/btn_next"
android:layout_width="150dp"


+ 11
- 1
app/src/main/res/layout/new/layout/layout_root_tip3.xml View File

@@ -42,7 +42,7 @@
android:textStyle="bold"
android:textSize="42sp"
android:gravity="center"
android:text="1.请确认烹饪室内无人"
android:text="1.请确认菜油是否充足"
android:textColor="@color/black"
/>
<TextView
@@ -55,6 +55,16 @@
android:text="2.请确认设备状况正常"
android:textColor="@color/black"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="42sp"
android:gravity="center"
android:layout_marginTop="20dp"
android:text="3.请确认烹饪室内无人"
android:textColor="@color/black"
/>
</LinearLayout>




Loading…
Cancel
Save