Browse Source

兼容展会演示项目

炒锅机器人_一拖多
liup 3 months ago
parent
commit
c55e111cda
10 changed files with 133 additions and 69 deletions
  1. +39
    -15
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +1
    -0
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  3. +3
    -10
      app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java
  4. +4
    -2
      app/src/main/java/com/bonait/bnframework/newui/activity/LogRecordHActivity.java
  5. +32
    -10
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodCheckDialog3.java
  6. +9
    -9
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog.java
  7. +9
    -9
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog2.java
  8. +32
    -10
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog3.java
  9. +2
    -2
      app/src/main/java/com/bonait/bnframework/newui/fragment/calssify/PropEditClassifyFragment.java
  10. +2
    -2
      app/src/main/res/layout/new/layout/dialog_food_check3.xml

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

@@ -982,6 +982,7 @@ public class ExecuteTheRecipe {
ModbusCenter.robotWritePlc(false,deviceNum+"号炒锅允许倒料",true,null);

ModbusCenter.robotWritePlc(true,foodPosition+"#库取原料倒至炒锅",true,null);
RobotModbusTcpServer.get().WriteShort("GI1", (short) deviceNum, null);
Thread.sleep(100);
ThreadWhile(deviceNum,deviceNum+"炒锅倒原料完成");

@@ -1106,6 +1107,7 @@ public class ExecuteTheRecipe {
ModbusCenter.robotWritePlc(false,deviceNum+"号炒锅允许倒料",true,null);

ModbusCenter.robotWritePlc(true,foodPosition+"#库取调料倒至炒锅",true,null);
RobotModbusTcpServer.get().WriteShort("GI2", (short) deviceNum, null);
Thread.sleep(100);
ThreadWhile(deviceNum,deviceNum+"炒锅倒调料完成");

@@ -1154,23 +1156,45 @@ public class ExecuteTheRecipe {
ConfigName.IsForcedEnd[deviceNum-1] = true;
break;
}else{
Object pan1 = ModbusCenter.ReadPlc(1,"1#空盆库位检测有无");
Object pan2 = ModbusCenter.ReadPlc(1,"2#空盆库位检测有无");
Object pan3 = ModbusCenter.ReadPlc(1,"3#空盆库位检测有无");
if(pan1 !=null){
isCheck = (Boolean) pan1|| (Boolean)pan2|| (Boolean)pan3;
if( (Boolean)pan1){
index = 21;
}else if( (Boolean)pan2){
index = 22;
}else if( (Boolean)pan3){
index = 23;
if(ConfigName.getInstance().isDemo){
Object pan1 = ModbusCenter.ReadPlc(1,"1#空盆库位检测有无");
Object pan2 = ModbusCenter.ReadPlc(1,"2#空盆库位检测有无");
if(pan1 !=null){
if(deviceNum == 1){
isCheck = (Boolean) pan1;
}else {
isCheck = (Boolean) pan2;
}
if( (Boolean)pan1){
index = 21;
}else if( (Boolean)pan2){
index = 22;
}
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-" + ",空盆库位检测有无:"+isCheck);
}else{
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-" + ",空盆库位检测有无:异常");
}
}else {
Object pan1 = ModbusCenter.ReadPlc(1,"1#空盆库位检测有无");
Object pan2 = ModbusCenter.ReadPlc(1,"2#空盆库位检测有无");
Object pan3 = ModbusCenter.ReadPlc(1,"3#空盆库位检测有无");
if(pan1 !=null){
isCheck = (Boolean) pan1|| (Boolean)pan2|| (Boolean)pan3;
if( (Boolean)pan1){
index = 21;
}else if( (Boolean)pan2){
index = 22;
}else if( (Boolean)pan3){
index = 23;
}
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-" + ",空盆库位检测有无:"+isCheck);
}else{
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-" + ",空盆库位检测有无:异常");
}
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-" + ",空盆库位检测有无:"+isCheck);
}else{
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-" + ",空盆库位检测有无:异常");
}

if(!isCheck){
NewToastUtil.getInstance().showToast("请放置出餐空盆!");
}
}
Thread.sleep(100);
}


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

@@ -40,6 +40,7 @@ public class ConfigName {
public final static boolean LOG_TEST = true;
//region 单例模式
private static volatile ConfigName mInstance = null; //实例变量设置私有,防止直接通过类名访问
public boolean isDemo = false;//是否是展会演示 出餐和空盆有区别

private ConfigName() { //默认构造函数私有,防止类外直接new创建对象
}


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

@@ -153,13 +153,6 @@ public class ModbusCenter {
if (item.isread == 1) {
if(Wok2ModbusTcpServer.get().plcIsConnect){
Object val = wokReadPlc(2,item.name);
if(item.name.equals("原点位反馈")||item.name.equals("投料位反馈")){
if(RobotModbusTcpServer.get().plcIsConnect){
if((boolean)val){
ModbusCenter.robotWritePlc(false,"2号炒锅允许倒料",true,null);
}
}
}
Wok2ModbusTcpServer.get().listeningValue.put(item.name, val);
}
}
@@ -169,7 +162,7 @@ public class ModbusCenter {
Object object2 = Wok2ModbusTcpServer.get().listeningValue.get("投料位反馈");
if(object1 instanceof Boolean){
if((Boolean) object2 || (Boolean)object1){
ModbusCenter.robotWritePlc(false,"1号炒锅允许倒料",true,null);
ModbusCenter.robotWritePlc(false,"2号炒锅允许倒料",true,null);
}
}
Object hotError = ModbusCenter.wokReadPlc(1,"异常加热故障信息");
@@ -701,7 +694,7 @@ public class ModbusCenter {
if(isMain){
if (ConfigName.getInstance().robotMainIndex.get(name)!=null) {
int index = ConfigName.getInstance().robotMainIndex.get(name);
LogUtils.d("robotWritePlc name="+name+";GI0 index="+index);
LogUtils.d("robotWritePlc name="+name+";GI0 index="+index+" value="+value);
if (RobotModbusTcpServer.get().plcIsConnect) {
RobotModbusTcpServer.get().WriteShort("GI0", (short) index, callback);
}
@@ -710,7 +703,7 @@ public class ModbusCenter {
if (plcAddress.get(name)!=null) {
BPA_PLCADDRESS plcaddress = plcAddress.get(name);
assert plcaddress != null;
LogUtils.d("robotWritePlc name="+name+";plcaddress.address="+plcaddress.address);
LogUtils.d("robotWritePlc name="+name+";plcaddress.address="+plcaddress.address+" value="+value);
if (!plcaddress.address.isEmpty() && RobotModbusTcpServer.get().plcIsConnect) {
if (plcaddress.address.toUpperCase().startsWith("M"))//bool
{


+ 4
- 2
app/src/main/java/com/bonait/bnframework/newui/activity/LogRecordHActivity.java View File

@@ -92,8 +92,10 @@ public class LogRecordHActivity extends BaseActivity {
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(this, R.layout.spinner_text_item,typeMap);
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinner.setAdapter(adapter2);
viewBinding.starttime.setText( new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(new Date()));
viewBinding.stoptime.setText(new SimpleDateFormat("yyyy-MM-dd 23:59:59").format(new Date()));
String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(new Date().getTime() - 60*60 * 1000));
String time2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(new Date().getTime() ));
viewBinding.starttime.setText(time);
viewBinding.stoptime.setText(time2);
viewBinding.starttime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {


+ 32
- 10
app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodCheckDialog3.java View File

@@ -232,22 +232,44 @@ public class FoodCheckDialog3 extends DialogFragment {
break;

case "出餐盆1":
if(value.exist){
viewBinding.tvChucan1.setText("出餐盘1有盆");
viewBinding.tvChucan1.setSelected(true);
if(ConfigName.getInstance().isDemo){
if(value.exist){
viewBinding.tvChucan2.setText("出餐盘1有盆");
viewBinding.tvChucan2.setSelected(true);
}else {
viewBinding.tvChucan2.setText("出餐盘1无盆");
viewBinding.tvChucan2.setSelected(false);
}
}else {
viewBinding.tvChucan1.setText("出餐盘1无盆");
viewBinding.tvChucan1.setSelected(false);
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);
if(ConfigName.getInstance().isDemo){
if(value.exist){
viewBinding.tvChucan1.setText("出餐盘2有盆");
viewBinding.tvChucan1.setSelected(true);
}else {
viewBinding.tvChucan1.setText("出餐盘2无盆");
viewBinding.tvChucan1.setSelected(false);
}
}else {
viewBinding.tvChucan2.setText("出餐盘2无盆");
viewBinding.tvChucan2.setSelected(false);
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){


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

@@ -258,28 +258,28 @@ public class RootTipDialog extends DialogFragment {
case "出餐盆1":
if(value.exist){
viewBinding.content2.tvChucan1.setText("出餐盆1有盆");
viewBinding.content2.right6.setSelected(true);
viewBinding.content2.tvChucan1.setSelected(true);
}else {
viewBinding.content2.right6.setText("出餐盆1无盆");
viewBinding.content2.right6.setSelected(false);
viewBinding.content2.tvChucan1.setText("出餐盆1无盆");
viewBinding.content2.tvChucan1.setSelected(false);
}
break;
case "出餐盆2":
if(value.exist){
viewBinding.content2.tvChucan2.setText("出餐盆2有盆");
viewBinding.content2.right6.setSelected(true);
viewBinding.content2.tvChucan2.setSelected(true);
}else {
viewBinding.content2.right6.setText("出餐盆2无盆");
viewBinding.content2.right6.setSelected(false);
viewBinding.content2.tvChucan2.setText("出餐盆2无盆");
viewBinding.content2.tvChucan2.setSelected(false);
}
break;
case "出餐盆3":
if(value.exist){
viewBinding.content2.tvChucan3.setText("出餐盆3有盆");
viewBinding.content2.right6.setSelected(true);
viewBinding.content2.tvChucan3.setSelected(true);
}else {
viewBinding.content2.right6.setText("出餐盆3无盆");
viewBinding.content2.right6.setSelected(false);
viewBinding.content2.tvChucan3.setText("出餐盆3无盆");
viewBinding.content2.tvChucan3.setSelected(false);
}
break;
}


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

@@ -258,28 +258,28 @@ public class RootTipDialog2 extends DialogFragment {
case "出餐盆1":
if(value.exist){
viewBinding.content2.tvChucan1.setText("出餐盆1有盆");
viewBinding.content2.right6.setSelected(true);
viewBinding.content2.tvChucan1.setSelected(true);
}else {
viewBinding.content2.right6.setText("出餐盆1无盆");
viewBinding.content2.right6.setSelected(false);
viewBinding.content2.tvChucan1.setText("出餐盆1无盆");
viewBinding.content2.tvChucan1.setSelected(false);
}
break;
case "出餐盆2":
if(value.exist){
viewBinding.content2.tvChucan2.setText("出餐盆2有盆");
viewBinding.content2.right6.setSelected(true);
viewBinding.content2.tvChucan2.setSelected(true);
}else {
viewBinding.content2.right6.setText("出餐盆2无盆");
viewBinding.content2.right6.setSelected(false);
viewBinding.content2.tvChucan2.setText("出餐盆2无盆");
viewBinding.content2.tvChucan2.setSelected(false);
}
break;
case "出餐盆3":
if(value.exist){
viewBinding.content2.tvChucan3.setText("出餐盆3有盆");
viewBinding.content2.right6.setSelected(true);
viewBinding.content2.tvChucan3.setSelected(true);
}else {
viewBinding.content2.right6.setText("出餐盆3无盆");
viewBinding.content2.right6.setSelected(false);
viewBinding.content2.tvChucan3.setText("出餐盆3无盆");
viewBinding.content2.tvChucan3.setSelected(false);
}
break;
}


+ 32
- 10
app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog3.java View File

@@ -255,22 +255,44 @@ public class RootTipDialog3 extends DialogFragment {
break;

case "出餐盆1":
if(value.exist){
viewBinding.content2.tvChucan1.setText("出餐盆1有盆");
viewBinding.content2.right6.setSelected(true);
if(ConfigName.getInstance().isDemo){
if(value.exist){
viewBinding.content2.tvChucan2.setText("出餐盆1有盆");
viewBinding.content2.tvChucan2.setSelected(true);
}else {
viewBinding.content2.tvChucan2.setText("出餐盆1无盆");
viewBinding.content2.tvChucan2.setSelected(false);
}
}else {
viewBinding.content2.right6.setText("出餐盆1无盆");
viewBinding.content2.right6.setSelected(false);
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.right6.setSelected(true);
if(ConfigName.getInstance().isDemo){
if(value.exist){
viewBinding.content2.tvChucan1.setText("出餐盆2有盆");
viewBinding.content2.tvChucan1.setSelected(true);
}else {
viewBinding.content2.tvChucan1.setText("出餐盆2无盆");
viewBinding.content2.tvChucan1.setSelected(false);
}
}else {
viewBinding.content2.right6.setText("出餐盆2无盆");
viewBinding.content2.right6.setSelected(false);
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;
default:
/*case "出餐盆3":


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

@@ -419,8 +419,8 @@ public class PropEditClassifyFragment extends BaseFragment {
NewToastUtil.getInstance().showToast("点击过快!");
return;
}
if(GoodsClassifyDBUtil.deleteById(classifyId)){
GoodsClassifyDBUtil.DeleteList(GoodsClassifyDBUtil.getListByName(classifyName));
if(PropClassifyDBUtil.deleteById(classifyId)){
PropClassifyDBUtil.DeleteList(PropClassifyDBUtil.getListByName(classifyName));
AttributeDBUtil.deleteByClassifyId(classifyId);
GoodsDBUtil.deleteByPropClassifyId(classifyId);
SubAttributeGroupDBUtil.deleteByClassifyId(classifyId);


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

@@ -204,7 +204,7 @@
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="出餐盆1有盆"
android:text="出餐盆2有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
/>
@@ -222,7 +222,7 @@
android:textSize="32sp"
android:maxLines="2"
android:ellipsize="end"
android:text="出餐盆2有盆"
android:text="出餐盆1有盆"
android:textColor="@color/black"
tools:background="@mipmap/ic_pen"
/>


Loading…
Cancel
Save