Browse Source

修改调试

上海闵中
liup 5 months ago
parent
commit
f27d3d867a
24 changed files with 211 additions and 207 deletions
  1. +2
    -2
      .idea/deploymentTargetSelector.xml
  2. +23
    -0
      app/src/main/java/com/bonait/bnframework/HBL/Thread/ThreadManager.java
  3. +21
    -37
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  4. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  5. +18
    -8
      app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java
  6. +5
    -0
      app/src/main/java/com/bonait/bnframework/modbus/OvenModbusTcpServer.java
  7. +4
    -0
      app/src/main/java/com/bonait/bnframework/modbus/RobotModbusTcpServer.java
  8. +5
    -0
      app/src/main/java/com/bonait/bnframework/modbus/WokModbusTcpServer.java
  9. +1
    -1
      app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java
  10. +1
    -1
      app/src/main/java/com/bonait/bnframework/newui/adapter/WarnInfoAdapter.java
  11. +16
    -9
      app/src/main/java/com/bonait/bnframework/newui/dialog/OvenControlDialog.java
  12. +1
    -1
      app/src/main/java/com/bonait/bnframework/newui/dialog/RobotControlDialog.java
  13. +40
    -40
      app/src/main/java/com/bonait/bnframework/newui/dialog/RootTipDialog.java
  14. +2
    -2
      app/src/main/java/com/bonait/bnframework/newui/fragment/HomeDevicesFragment.java
  15. +1
    -1
      app/src/main/java/com/bonait/bnframework/newui/fragment/HomeOrderFragment.java
  16. +29
    -27
      app/src/main/java/com/bonait/bnframework/newui/fragment/HomeWarnFragment.java
  17. +33
    -12
      app/src/main/java/com/bonait/bnframework/newui/fragment/LocalGoodsHFragment.java
  18. +1
    -41
      app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java
  19. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/goods/LocalGoodsAdapter.java
  20. +0
    -20
      app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java
  21. +1
    -1
      app/src/main/res/layout/item/layout/item_local_goods.xml
  22. +1
    -1
      app/src/main/res/layout/new/layout/dialog_food_control.xml
  23. +2
    -1
      app/src/main/res/layout/new/layout/item_warn_info.xml
  24. +2
    -0
      app/src/main/res/layout/new/layout/layout_root_tip2.xml

+ 2
- 2
.idea/deploymentTargetSelector.xml View File

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-07-27T09:26:40.211839900Z">
<DropdownSelection timestamp="2024-08-06T08:23:56.428245900Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="Default" identifier="serial=192.168.100.194:5555;connection=22694e5e" />
<DeviceId pluginId="Default" identifier="serial=192.168.100.199:5555;connection=462c196c" />
</handle>
</Target>
</DropdownSelection>


+ 23
- 0
app/src/main/java/com/bonait/bnframework/HBL/Thread/ThreadManager.java View File

@@ -58,6 +58,29 @@ public class ThreadManager {
if (!tm.containsKey(Key)) {
tm.put(Key, new ThreadModel());
tm.get(Key).Task = _thread;
// executorService.execute(new Runnable() {
// @Override
// public void run() {
// MessageLog.ShowInfo("启动线程:" + Key);
// while (!tm.get(Key).IsCancel) {
// if (IsRestart) {
// try {
// tm.get(Key).Task.Run();
// } catch (Exception ex) {
// MessageLog.ShowError("多线程:[" + Key + "] 运行发生异常,已重启,错误信息:" + ex.toString());
// Sleep(RestartInterval);
// }
// } else {
// try {
// tm.get(Key).Task.Run();
// } catch (Exception e) {
// MessageLog.ShowError("多线程:[" + Key + "] 运行发生异常,已重启,错误信息:" + e.toString());
// }
// }
// }
// tm.remove(Key);
// }
// });
tm.get(Key).ThreadObj = new Thread(() -> {
MessageLog.ShowInfo("启动线程:" + Key);
while (!tm.get(Key).IsCancel) {


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

@@ -282,7 +282,9 @@ public class ExecuteTheRecipe {
}
}
ExecuteTheRecipe.WritePLC("档位选择", 0, null);
ExecuteTheRecipe.WritePLC("档位选择触发", true, null);
ExecuteTheRecipe.WritePLC("温度选择", 0, null);
ExecuteTheRecipe.WritePLC("温度选择触发", true, null);
ConfigName.getInstance().oven_wendu = 0+"";
reset2();
}
@@ -1058,6 +1060,7 @@ public class ExecuteTheRecipe {
ExecuteTheRecipe.showlog("准备清洗!");
String qx_type = "一般清洗";
int val_csl=0;
int clearTime = 150;

//先延迟
for (HashMap.Entry<String, String> entry : data.entrySet()) {
@@ -1069,33 +1072,25 @@ public class ExecuteTheRecipe {
ThreadDelay(val);
} else if (key.contains("清洗方式")) {
qx_type = value;
}else if (key.contains("清洗时间(秒)")) {
clearTime = Integer.parseInt(value) * 10;
}else if (key.contains("抽水量")) {
val_csl = Integer.parseInt(value);
}
}

if(clearTime<150){
clearTime = 150;
}
//复位反馈信号
ExecuteTheRecipe.WritePLC("炒锅清洗反馈", false, null);

if (qx_type.equals("深度清洗")) {
WritePLC("清洗抽水量", val_csl, null);

Thread.sleep(500);//等待写入成功
WritePLC("清洗时间", clearTime, null);
BottomClick1("深度清洗");
WritePLC("加热功率", "一档", new IWriteCallBack() {
@Override
public void onSuccess() {
WritePLC("加热", true, null);
}

@Override
public void onFailure(String ErrorMsg) {
WritePLC("加热", true, null);
}
});
ThreadDelay(10000);//todo 实际情况 加热蒸发水汽
WritePLC("加热", false, null);
} else //开始清洗
{
BottomClick1("炒锅清洗");
@@ -1104,22 +1099,6 @@ public class ExecuteTheRecipe {
//等待清洗完成
ThreadWhile3("炒锅清洗反馈", 5);
Make位置("原点位");

//写加热挡位
WritePLC("加热功率", "一档", new IWriteCallBack() {
@Override
public void onSuccess() {
WritePLC("加热", true, null);
}

@Override
public void onFailure(String ErrorMsg) {
WritePLC("加热", true, null);
}
});
NewToastUtil.getInstance().showToast("炒锅正在加热蒸发水汽,10秒后自动关闭加热");
ThreadDelay(10000);//todo 实际情况 加热蒸发水汽
WritePLC("加热", false, null);
ExecuteTheRecipe.showlog("炒锅清洗完成!");
NewToastUtil.getInstance().showToast("炒锅清洗完成");
} catch (Exception ex) {
@@ -1153,6 +1132,7 @@ public class ExecuteTheRecipe {
Thread.sleep(100);
ConfigName.getInstance().oven_wendu = 0+"";
ExecuteTheRecipe.WritePLC("温度选择", 0, null);
Thread.sleep(10);
ExecuteTheRecipe.WritePLC("温度选择触发", true, null);
ThreadWhile2("温度设置完成");
Thread.sleep(100);
@@ -1178,13 +1158,15 @@ public class ExecuteTheRecipe {
//<<关门流程
Thread.sleep(100);
ExecuteTheRecipe.WritePLC("烤箱门关闭控制", true, null);
Wait_Robot2_No_Working();//等待机器人空闲
ModbusCenter.robotWritePlc(true,"机器人烤箱关门",true,null);
ThreadWhile2("机器人烤箱关门完成");
Thread.sleep(100);
Thread.sleep(3000);
boolean isClose2 = (boolean) ModbusCenter.ReadPlc("烤箱门关到位检测");
if(!isClose2){
Wait_Robot2_No_Working();//等待机器人空闲
ModbusCenter.robotWritePlc(true,"机器人烤箱关门",true,null);
ThreadWhile2("机器人烤箱关门完成");
Thread.sleep(100);
}
ThreadWhile2("烤箱门关到位检测");
//>>

} catch (Exception ex) {
BPA_ORDER_DETAIL bean = OrderDetailUtil.getByMaking(1);
assert bean != null;
@@ -1237,7 +1219,7 @@ public class ExecuteTheRecipe {
}
}
if(dangwei==0){
wendu = 0;//todo
wendu = 0;
}else {
if(wendu < 60){
wendu = 0;
@@ -1268,6 +1250,7 @@ public class ExecuteTheRecipe {

Thread.sleep(100);
ExecuteTheRecipe.WritePLC("温度选择", wendu, null);
Thread.sleep(10);
ExecuteTheRecipe.WritePLC("温度选择触发", true, null);
ThreadWhile2("温度设置完成");

@@ -1325,6 +1308,7 @@ public class ExecuteTheRecipe {
Thread.sleep(100);
ConfigName.getInstance().oven_wendu = 0+"";
ExecuteTheRecipe.WritePLC("温度选择", 0, null);
Thread.sleep(10);
ExecuteTheRecipe.WritePLC("温度选择触发", true, null);
ThreadWhile2("温度设置完成");
Thread.sleep(100);


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

@@ -307,7 +307,7 @@ public class ConfigName {
add(new Res_PLCADDRESS("烤箱门开到位检测", "M12.0", 1, 0,3));
add(new Res_PLCADDRESS("烤箱门关到位检测", "M12.1", 1, 0,3));
add(new Res_PLCADDRESS("烤箱门中间位检测", "M12.4", 1, 0,3));
add(new Res_PLCADDRESS("烤箱开门动作超时", "M1100.5", 1, 0,3));//todo
add(new Res_PLCADDRESS("烤箱开门动作超时", "M1100.5", 1, 0,3));
add(new Res_PLCADDRESS("烤箱关门动作超时", "M1100.6", 1, 0,3));

add(new Res_PLCADDRESS("出料空盆检测有无", "M12.2", 1, 0,3));


+ 18
- 8
app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java View File

@@ -99,8 +99,11 @@ public class ModbusCenter {

});

WritePlc("温度选择",false,null);
WritePlc("档位选择",false,null);
WritePlc("温度选择",0,null);
WritePlc("温度选择触发",true,null);

WritePlc("档位选择",0,null);
WritePlc("档位选择触发",true,null);
}
} catch (InterruptedException e) {
NewToastUtil.getInstance().showToast("异常信息:" + e.getMessage());
@@ -186,6 +189,11 @@ public class ModbusCenter {
ModbusCenter.robotWritePlc(false,"允许机器人出餐放盆",!(boolean)val,null);
}
}
if(item.name.contains("超时")){
if((Boolean) val){
NewToastUtil.getInstance().showToastError(item.name+",请前往设备报警信息栏目,手动复位");
}
}
if(ConfigName.LOG_TEST){
LogUtils.d("烤箱PLC设备数据监听 name="+item.name +" plcaddress.address="+item.address+" ;val="+val);
}
@@ -221,11 +229,6 @@ public class ModbusCenter {
if (item.isread == 1) {
if(RobotModbusTcpServer.get().plcIsConnect){
Object val = robotReadPlc(item.name);
if(item.name.equals("机器人光栅")){
if((Boolean) val){
NewToastUtil.getInstance().showToast("光栅检测到物体,机器人已暂停工作,请按复位按钮后重试!");
}
}
if(ConfigName.LOG_TEST){
LogUtils.d("机器人PLC设备数据监听 ovenReadPlc item="+item.name+" plcaddress.address="+item.address+" val="+val);
}
@@ -365,6 +368,7 @@ public class ModbusCenter {
}
}
} catch (Exception ex) {
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
} finally {
return ReturnsVariable[0];
@@ -392,6 +396,7 @@ public class ModbusCenter {
}
}
} catch (Exception ex) {
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
} finally {

@@ -419,6 +424,7 @@ public class ModbusCenter {
});
}
} catch (Exception ex) {
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
} finally {
}
@@ -482,6 +488,7 @@ public class ModbusCenter {
}
}
} catch (Exception ex) {
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
} finally {
return ReturnsVariable[0];
@@ -512,6 +519,7 @@ public class ModbusCenter {
}

} catch (Exception ex) {
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
} finally {

@@ -552,6 +560,7 @@ public class ModbusCenter {
}
}
} catch (Exception ex) {
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
} finally {
return ReturnsVariable[0];
@@ -572,7 +581,8 @@ public class ModbusCenter {
}
}
} catch (Exception ex) {
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
LogUtils.d("异常信息:ovenWritePlc name=" +name+ " "+ ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息: name=" +name+ " "+ ex.getMessage());
} finally {

}


+ 5
- 0
app/src/main/java/com/bonait/bnframework/modbus/OvenModbusTcpServer.java View File

@@ -7,6 +7,7 @@ import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.HBL.Logs.MessageLog;
import com.bonait.bnframework.HBL.Thread.IThread;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.helper.DataFormat;
import com.bonait.bnframework.common.helper.I.IReadCallBack;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
@@ -72,6 +73,10 @@ public class OvenModbusTcpServer {
* @param error
*/
public void ReConnect(String error){
if(ConfigName.TEST){
plcIsConnect = true;
return;
}
plcIsConnect = false;
if(error.contains("Connection refused")||error.contains("SocketException")){
ConnectPLC();


+ 4
- 0
app/src/main/java/com/bonait/bnframework/modbus/RobotModbusTcpServer.java View File

@@ -98,6 +98,10 @@ public class RobotModbusTcpServer {
* @param error
*/
public void ReConnect(String error){
if(ConfigName.TEST){
plcIsConnect = true;
return;
}
plcIsConnect = false;
if(error.contains("Connection refused")||error.contains("SocketException")){
ConnectPLC();


+ 5
- 0
app/src/main/java/com/bonait/bnframework/modbus/WokModbusTcpServer.java View File

@@ -6,6 +6,7 @@ import android.util.Log;
import com.bonait.bnframework.HBL.Logs.MessageLog;
import com.bonait.bnframework.HBL.Thread.IThread;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.helper.DataFormat;
import com.bonait.bnframework.common.helper.I.IReadCallBack;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
@@ -61,6 +62,10 @@ public class WokModbusTcpServer {
* @param error
*/
public void ReConnect(String error){
if(ConfigName.TEST){
plcIsConnect = true;
return;
}
plcIsConnect = false;
if(error.contains("Connection refused")||error.contains("SocketException")){
ConnectPLC();


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

@@ -239,7 +239,7 @@ public class MainHActivity extends BaseActivity {
// changeTextView(viewBinding.tvBuliaoBox,"补盆位:","异常",true);
// }
if(object3 != null){
changeTextView(viewBinding.tvWokWendu,"炒锅温度:",object3+"°C",true);
changeTextView(viewBinding.tvWokWendu,"炒锅温度:",object3+"°C",false);
}else {
changeTextView(viewBinding.tvWokWendu,"炒锅温度:","??°C",true);
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/newui/adapter/WarnInfoAdapter.java View File

@@ -40,7 +40,7 @@ public abstract class WarnInfoAdapter extends BaseAdapter<String, WarnInfoAdapte
}

if(!holder.binding.name.getText().toString().contains("无故障")){
if(holder.binding.name.getText().toString().contains("补盆动作超时")){
if(holder.binding.name.getText().toString().contains("超时")){
holder.binding.btnReset.setVisibility(View.VISIBLE);
}else {
holder.binding.btnReset.setVisibility(View.GONE);


+ 16
- 9
app/src/main/java/com/bonait/bnframework/newui/dialog/OvenControlDialog.java View File

@@ -26,6 +26,7 @@ import com.bonait.bnframework.R;
import com.bonait.bnframework.Service.ControlAdress;
import com.bonait.bnframework.Service.PLCModel;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.utils.AdbCommandUtil;
@@ -35,6 +36,7 @@ import com.bonait.bnframework.databinding.DialogOvenControlBinding;
import com.bonait.bnframework.databinding.DialogTipBinding;
import com.bonait.bnframework.modbus.ModbusCenter;
import com.bonait.bnframework.modbus.OvenModbusTcpServer;
import com.bonait.bnframework.modbus.RobotModbusTcpServer;
import com.bonait.bnframework.newui.widget.NewToastUtil;
import com.bonait.bnframework.newui.widget.WaitProcessUtil;

@@ -168,6 +170,7 @@ public class OvenControlDialog extends DialogFragment {
Thread.sleep(100);
ConfigName.getInstance().oven_wendu = 0+"";
ExecuteTheRecipe.WritePLC("温度选择", 0, null);
Thread.sleep(10);
ExecuteTheRecipe.WritePLC("温度选择触发", true, null);
ExecuteTheRecipe.ThreadWhile2("温度设置完成");
Thread.sleep(100);
@@ -176,9 +179,9 @@ public class OvenControlDialog extends DialogFragment {
ExecuteTheRecipe.Wait_Robot2_No_Working();//等待机器人空闲
ModbusCenter.robotWritePlc(true,"机器人烤箱开门",true,null);
ExecuteTheRecipe.ThreadWhile2("机器人烤箱开门完成");
Thread.sleep(100);
ExecuteTheRecipe.WritePLC("烤箱门打开控制", true, null);
Thread.sleep(100);
ExecuteTheRecipe.ThreadWhile2("烤箱门开到位检测");
}
//>>
}catch (Exception e){
@@ -206,7 +209,7 @@ public class OvenControlDialog extends DialogFragment {
DialogTipBinding binding = DialogTipBinding.bind(layoutView);
DisplayManager.scaleViewGroup(binding.getRoot());
binding.title.setText("确认指令");
binding.message.setText("是否打开烤箱门");
binding.message.setText("是否关闭烤箱门");
binding.close.setOnClickListener(view1->{
xCom.dismissX();
});
@@ -220,11 +223,13 @@ public class OvenControlDialog extends DialogFragment {
//<<关门流程
Thread.sleep(100);
ExecuteTheRecipe.WritePLC("烤箱门关闭控制", true, null);
ExecuteTheRecipe.Wait_Robot2_No_Working();//等待机器人空闲
ModbusCenter.robotWritePlc(true,"机器人烤箱关门",true,null);
ExecuteTheRecipe.ThreadWhile2("机器人烤箱关门完成");
Thread.sleep(100);
ExecuteTheRecipe.ThreadWhile2("烤箱门关到位检测");
Thread.sleep(3000);
boolean isClose2 = (boolean) ModbusCenter.ReadPlc("烤箱门关到位检测");
if(!isClose2){
ExecuteTheRecipe.Wait_Robot2_No_Working();//等待机器人空闲
ModbusCenter.robotWritePlc(true,"机器人烤箱关门",true,null);
ExecuteTheRecipe.ThreadWhile2("机器人烤箱关门完成");
}
//>>
}catch (Exception e){
LogUtils.d("异常信息:"+e.getMessage());
@@ -282,9 +287,9 @@ public class OvenControlDialog extends DialogFragment {
tv1 = tv1+"\n其他";
}
viewBinding.tvModel.setText(tv1);
viewBinding.tvWendu.setText("当前温度:\n"+ConfigName.getInstance().oven_wendu+"°C");
}
});
viewBinding.tvWendu.setText("当前温度:\n"+ConfigName.getInstance().oven_wendu+"°C");
}
});

@@ -314,6 +319,7 @@ public class OvenControlDialog extends DialogFragment {
@Override
public void onSuccess() {
NewToastUtil.getInstance().showToast("档位选择"+num+":成功");
ExecuteTheRecipe.WritePLC("档位选择触发", true, null);
handler.post(new Runnable() {
@Override
public void run() {
@@ -347,11 +353,12 @@ public class OvenControlDialog extends DialogFragment {
@Override
public void onSuccess() {
ConfigName.getInstance().oven_wendu = num+"";
ExecuteTheRecipe.WritePLC("温度选择触发", true, null);
NewToastUtil.getInstance().showToast("温度选择"+num+":成功");
handler.post(new Runnable() {
@Override
public void run() {
viewBinding.tvModel.setText("当前温度:\n"+num+"°C");
viewBinding.tvWendu.setText("当前温度:\n"+num+"°C");
}
});
}


app/src/main/java/com/bonait/bnframework/newui/dialog/FoodControlDialog.java → app/src/main/java/com/bonait/bnframework/newui/dialog/RobotControlDialog.java View File

@@ -49,7 +49,7 @@ import butterknife.OnClick;
* @description: 机器人投料控制
* @date: 2024/6/3 17:59.
*/
public class FoodControlDialog extends DialogFragment {
public class RobotControlDialog extends DialogFragment {
private String TAG = " FoodControlDialog =>";
private DialogFoodControlBinding viewBinding;


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

@@ -147,11 +147,11 @@ public class RootTipDialog extends DialogFragment {
switch (key){
case "辅料位置1号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.top1.setText("有盒");
}else {
viewBinding.content2.top1.setText("有盒/未补料");
}
// }else {
// viewBinding.content2.top1.setText("有盒/未补料");
// }
viewBinding.content2.icTop1.setSelected(true);
}else {
viewBinding.content2.top1.setText("无盒");
@@ -160,11 +160,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "辅料位置2号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.top2.setText("有盒");
}else {
viewBinding.content2.top2.setText("有盒/未补料");
}
// }else {
// viewBinding.content2.top2.setText("有盒/未补料");
// }
viewBinding.content2.icTop2.setSelected(true);
}else {
viewBinding.content2.top2.setText("无盒");
@@ -173,11 +173,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "辅料位置3号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.top3.setText("有盒");
}else {
viewBinding.content2.top3.setText("有盒/未补料");
}
// }else {
// viewBinding.content2.top3.setText("有盒/未补料");
// }
viewBinding.content2.icTop3.setSelected(true);
}else {
viewBinding.content2.top3.setText("无盒");
@@ -186,11 +186,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "辅料位置4号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.top4.setText("有盒");
}else {
viewBinding.content2.top4.setText("有盒/未补料");
}
// }else {
// viewBinding.content2.top4.setText("有盒/未补料");
// }
viewBinding.content2.icTop4.setSelected(true);
}else {
viewBinding.content2.top4.setText("无盒");
@@ -199,11 +199,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "主料位置1号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.right1.setText("有盆");
}else {
viewBinding.content2.right1.setText("有盆/未补料");
}
// }else {
// viewBinding.content2.right1.setText("有盆/未补料");
// }
viewBinding.content2.right1.setSelected(true);
}else {
viewBinding.content2.right1.setText("无盆");
@@ -212,11 +212,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "主料位置2号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.right2.setText("有盆");
}else {
viewBinding.content2.right2.setText("有盆/未补料");
}
// }else {
// viewBinding.content2.right2.setText("有盆/未补料");
// }
viewBinding.content2.right2.setSelected(true);
}else {
viewBinding.content2.right2.setText("无盆");
@@ -225,11 +225,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "主料位置3号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.right3.setText("有盆");
}else {
viewBinding.content2.right3.setText("有盆/未补料");
}
// }else {
// viewBinding.content2.right3.setText("有盆/未补料");
// }
viewBinding.content2.right3.setSelected(true);
}else {
viewBinding.content2.right3.setText("无盆");
@@ -238,11 +238,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "主料位置4号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.right4.setText("有盆");
}else {
viewBinding.content2.right4.setText("有盆/未补料");
}
// }else {
// viewBinding.content2.right4.setText("有盆/未补料");
// }
viewBinding.content2.right4.setSelected(true);
}else {
viewBinding.content2.right4.setText("无盆");
@@ -251,11 +251,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "主料位置5号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.right5.setText("有盆");
}else {
viewBinding.content2.right5.setText("有盆/未补料");
}
// }else {
// viewBinding.content2.right5.setText("有盆/未补料");
// }
viewBinding.content2.right5.setSelected(true);
}else {
viewBinding.content2.right5.setText("无盆");
@@ -264,11 +264,11 @@ public class RootTipDialog extends DialogFragment {
break;
case "主料位置6号位":
if(value.exist){
if(value.number%2==0){
// if(value.number%2==0){
viewBinding.content2.right6.setText("有盆");
}else {
viewBinding.content2.right6.setText("有盆/未补料");
}
// }else {
// viewBinding.content2.right6.setText("有盆/未补料");
// }
viewBinding.content2.right6.setSelected(true);
}else {
viewBinding.content2.right6.setText("无盆");


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

@@ -26,7 +26,7 @@ import com.bonait.bnframework.modbus.RobotModbusTcpServer;
import com.bonait.bnframework.modbus.WokModbusTcpServer;
import com.bonait.bnframework.newui.dialog.ChuCanCheckDialog;
import com.bonait.bnframework.newui.dialog.FoodCheckDialog;
import com.bonait.bnframework.newui.dialog.FoodControlDialog;
import com.bonait.bnframework.newui.dialog.RobotControlDialog;
import com.bonait.bnframework.newui.dialog.OvenControlDialog;
import com.bonait.bnframework.newui.dialog.WokControlDialog;
import com.bonait.bnframework.newui.widget.NewToastUtil;
@@ -169,7 +169,7 @@ public class HomeDevicesFragment extends BaseFragment {
NewToastUtil.getInstance().showToastError("机器人未连接!");
return;
}
FoodControlDialog dialog = new FoodControlDialog();
RobotControlDialog dialog = new RobotControlDialog();
if(getActivity()!=null){
dialog.show(getActivity().getSupportFragmentManager(),"投料控制");
}


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

@@ -442,7 +442,7 @@ public class HomeOrderFragment extends BaseFragment {
case 0:
desc = "【"+name+"】订单准备就绪,是否开始制作?";
binding.cancel.setText("开始制作");
binding.submit.setText("制作并观看");
binding.submit.setText("制作并查看流程");
break;
case 1:
break;


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

@@ -101,6 +101,8 @@ public class HomeWarnFragment extends BaseFragment {
ovenWarnList.add("温度回原点超时");
ovenWarnList.add("温度定位超时");
ovenWarnList.add("补盆动作超时");
ovenWarnList.add("烤箱开门动作超时");
ovenWarnList.add("烤箱关门动作超时");
viewBinding.titleChaoguo.setSelected(true);

viewBinding.titleChaoguo.setOnClickListener(v->{
@@ -138,8 +140,8 @@ public class HomeWarnFragment extends BaseFragment {
DialogTipBinding binding = DialogTipBinding.bind(layoutView);
DisplayManager.scaleViewGroup(binding.getRoot());
binding.title.setText("确认机器人指令");
if(value.contains("补盆动作超时")){
binding.message.setText("补盆动作超时,请检查出料通道是否正常,是否复位?");
if(value.contains("超时")){
binding.message.setText(value+",请检查,是否复位?");
}
binding.close.setOnClickListener(view1->{
xCom.dismissX();
@@ -147,7 +149,7 @@ public class HomeWarnFragment extends BaseFragment {
binding.submit.setOnClickListener(view1 -> {
xCom.dismissX();
if(OvenModbusTcpServer.get().plcIsConnect){
ModbusCenter.WritePlc("补盆动作超时",false,null);
ModbusCenter.WritePlc(value,false,null);
}else {
NewToastUtil.getInstance().showToastError("烤箱/货架设备未连接,请稍后重试");
}
@@ -224,7 +226,7 @@ public class HomeWarnFragment extends BaseFragment {
}
}
Object object2 = ModbusCenter.listeningValue.get("机器人急停");
Object object3 = ModbusCenter.listeningValue.get("机器人光栅");
// Object object3 = ModbusCenter.listeningValue.get("机器人光栅");
if(object2 instanceof Boolean){
if((Boolean) object2){
if(type==3){
@@ -246,29 +248,29 @@ public class HomeWarnFragment extends BaseFragment {
rightDataList.add("机器人急停:检测异常");
}
}
if(object3 instanceof Boolean){
if((Boolean) object3){
if(type==3){
warnInfoList.add("机器人光栅:光栅检测到物体");
}
if(!rightDataList.contains("机器人光栅:光栅检测到物体")){
rightDataList.add("机器人光栅:光栅检测到物体");
}
}else {
if(type==3){
warnInfoList.add("机器人光栅:无故障");
}
}
}else {
if(type==3){
warnInfoList.add("机器人光栅:检测异常");
}
if(!rightDataList.contains("机器人光栅:检测异常")){
rightDataList.add("机器人光栅:检测异常");
}
}
// if(object3 instanceof Boolean){
// if((Boolean) object3){
// if(type==3){
// warnInfoList.add("机器人光栅:光栅检测到物体");
// }
//
// if(!rightDataList.contains("机器人光栅:光栅检测到物体")){
// rightDataList.add("机器人光栅:光栅检测到物体");
// }
// }else {
// if(type==3){
// warnInfoList.add("机器人光栅:无故障");
// }
//
// }
// }else {
// if(type==3){
// warnInfoList.add("机器人光栅:检测异常");
// }
// if(!rightDataList.contains("机器人光栅:检测异常")){
// rightDataList.add("机器人光栅:检测异常");
// }
// }
//烤箱
LogUtils.d(TAG+ " ovenWarnList="+ovenWarnList.toString() + " type="+type);
for(String res : ovenWarnList){


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

@@ -241,23 +241,44 @@ public class LocalGoodsHFragment extends BaseFragment {

@Override
protected void addGoods() {
if(!classifyList.isEmpty() && getActivity()!=null){
if(classifyList.size()>classifyAdapter.getCurrentPosition()){
BPA_GOODS_CLASSIFY classify = classifyList.get(classifyAdapter.getCurrentPosition());
List<BPA_ATTRIBUTE> attributes = AttributeDBUtil.getByClassify(classify.id);
if(attributes.isEmpty()){
NewToastUtil.getInstance().showToast("当前分类没有属性,请先创建分类父属性");
return;
}else {
for(BPA_ATTRIBUTE attribute:attributes){
if(SubAttributeDBUtil.getByParentAttributeId(attribute.id).isEmpty()){
NewToastUtil.getInstance().showToast("当前分类父属性["+attribute.name+"]没有子属性,无法创建");
return;
if(type.equals("0")){
if(!classifyList.isEmpty() && getActivity()!=null){
if(classifyList.size()>classifyAdapter.getCurrentPosition()){
BPA_GOODS_CLASSIFY classify = classifyList.get(classifyAdapter.getCurrentPosition());
List<BPA_ATTRIBUTE> attributes = AttributeDBUtil.getByClassify(classify.id);
if(attributes.isEmpty()){
NewToastUtil.getInstance().showToast("当前分类没有属性,请先创建分类父属性");
return;
}else {
for(BPA_ATTRIBUTE attribute:attributes){
if(SubAttributeDBUtil.getByParentAttributeId(attribute.id).isEmpty()){
NewToastUtil.getInstance().showToast("当前分类父属性["+attribute.name+"]没有子属性,无法创建");
return;
}
}
}
}
}
}else{
if(!classifyList2.isEmpty() && getActivity()!=null){
if(classifyList2.size()>classifyAdapter2.getCurrentPosition()){
BPA_GOODS_CLASSIFY classify = classifyList2.get(classifyAdapter2.getCurrentPosition());
List<BPA_ATTRIBUTE> attributes = AttributeDBUtil.getByClassify(classify.id);
if(attributes.isEmpty()){
NewToastUtil.getInstance().showToast("当前分类没有属性,请先创建分类父属性");
return;
}else {
for(BPA_ATTRIBUTE attribute:attributes){
if(SubAttributeDBUtil.getByParentAttributeId(attribute.id).isEmpty()){
NewToastUtil.getInstance().showToast("当前分类父属性["+attribute.name+"]没有子属性,无法创建");
return;
}
}
}
}
}
}

addGoodsDialog();
}
};


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

@@ -62,10 +62,6 @@ public class DiyProcessActivity extends BaseActivity {

private String TAG = "DiyProcessActivity==>";
private ActivityEditProcessBinding viewBinding;
/**
* 1-6个主料仓名称
*/
private ArrayList<String> mainFoods = new ArrayList<>();

/**
* 商品id
@@ -143,9 +139,6 @@ public class DiyProcessActivity extends BaseActivity {
DisplayManager.scaleViewGroup(viewBinding.getRoot());
Intent intent = getIntent();
if(intent != null){
if(intent.getStringArrayListExtra("mainFoods")!=null){
mainFoods = intent.getStringArrayListExtra("mainFoods");
}
goodId = intent.getStringExtra("goodId");
subAttributeGroupId = intent.getStringExtra("subAttributeGroupId");
subAttributeGroupName = intent.getStringExtra("subAttributeGroupName");
@@ -153,14 +146,6 @@ public class DiyProcessActivity extends BaseActivity {
subAttributeGroupName = "";
}
}
if(mainFoods.isEmpty()){
mainFoods.add("");
mainFoods.add("");
mainFoods.add("");
mainFoods.add("");
mainFoods.add("");
mainFoods.add("");
}
initView();
initTopBar();
}
@@ -289,7 +274,6 @@ public class DiyProcessActivity extends BaseActivity {
intent.putExtra("subAttributeGroupId",subAttributeGroupId);
intent.putExtra("subAttributeGroupName",subAttributeGroupName);
intent.putExtra("goodId",goodId);
intent.putStringArrayListExtra("mainFoods",mainFoods);
startActivity(intent);
});
viewBinding.llInsert.setVisibility(View.GONE);
@@ -551,11 +535,6 @@ public class DiyProcessActivity extends BaseActivity {
mainFoodName = values;
}
}
if(position>0){
LogUtils.d(TAG+" getSelectItemFromValue 修改主料名称 old mainFoods="+mainFoods.toString());
mainFoods.set(position-1,mainFoodName);
LogUtils.d(TAG+" getSelectItemFromValue 修改主料名称 new mainFoods="+mainFoods.toString());
}
}
if (IsVerify) {
processDetail.processname = name;
@@ -681,17 +660,8 @@ public class DiyProcessActivity extends BaseActivity {

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


}
};

/**
@@ -715,9 +685,6 @@ public class DiyProcessActivity extends BaseActivity {
if (res != null) {
processValueView.SetValues(res);
}else {
if(processValueView.model.name.equals("主料名称")){
processValueView.setMainFoodName(mainFoods.get(0));
}
if(processValueView.model.name.contains("正转时间")||processValueView.model.name.contains("反转时间")){
processValueView.SetValues("3");
}
@@ -731,7 +698,6 @@ public class DiyProcessActivity extends BaseActivity {
}

private void changeMainFoods(){
mainFoods.clear();
String main1 = "";
String main2 = "";
String main3 = "";
@@ -784,12 +750,6 @@ public class DiyProcessActivity extends BaseActivity {
}
}
}
mainFoods.add(main1);
mainFoods.add(main2);
mainFoods.add(main3);
mainFoods.add(main4);
mainFoods.add(main5);
mainFoods.add(main6);
}

private boolean isFirst = true;


+ 1
- 1
app/src/main/java/com/bonait/bnframework/ui/adapter/goods/LocalGoodsAdapter.java View File

@@ -74,7 +74,7 @@ public abstract class LocalGoodsAdapter extends BaseAdapter<BPA_GOODS,LocalGoods
@Override
public void onClick(View view) {
// ConfigData.getInstance().UploadGoods(holder.itemView.getContext(), goods.id);
uploadGoods(view,position);
// uploadGoods(view,position);
}
});



+ 0
- 20
app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java View File

@@ -63,26 +63,6 @@ public class HomeGoodsViewModel extends ViewModel {
GetGoodsInfo();
GetMaterialInfo();
}));
// if (ConfigName.getInstance().organizeMode == null) {
// return;
// }
// OkGo.<ResListAPI<GoodsClassifyBean>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetGoods,
// ConfigName.getInstance().organizeMode.id, ConfigName.getInstance().DeviceId))
// .tag(context)
// .headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId))
// .execute(new JsonDialogCallback<ResListAPI<GoodsClassifyBean>>(context) {
// @Override
// public void onSuccess(Response<ResListAPI<GoodsClassifyBean>> response) {
// ResListAPI<GoodsClassifyBean> allDataResAPI = response.body();
//
// if (allDataResAPI.succeeded && allDataResAPI.data != null && allDataResAPI.data.size() > 0) {
//// ConfigName.getInstance().cloudGoodsList.clear();
//// ConfigName.getInstance().cloudGoodsList.addAll(allDataResAPI.data);
// cloudGoodsList.setValue(allDataResAPI.data);
// hasData = true;
// }
// }
// });
}
}



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

@@ -56,7 +56,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:visibility="visible"
android:visibility="gone"
android:layout_centerHorizontal="true">

<ImageView


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

@@ -78,7 +78,7 @@
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="机器人在维护位"
tools:text="机器人在维护位"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:textSize="32sp"


+ 2
- 1
app/src/main/res/layout/new/layout/item_warn_info.xml View File

@@ -9,7 +9,8 @@
<TextView
android:id="@+id/btn_reset"
android:layout_width="200dp"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:layout_height="65dp"
style="@style/TextView_btn_blue"
android:text="请复位"
android:textSize="36sp"


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

@@ -369,11 +369,13 @@
android:text="补盆位检测:异常"
android:textStyle="bold"
android:textSize="32sp"
android:visibility="gone"
android:textColor="@color/black"
/>
<TextView
android:layout_width="80dp"
android:layout_height="5dp"
android:visibility="gone"
android:background="@color/black"
app:layout_constraintEnd_toStartOf="@id/tvBuliaoBox"
app:layout_constraintTop_toTopOf="@id/tvBuliaoBox"


Loading…
Cancel
Save