@@ -982,6 +982,7 @@ public class ExecuteTheRecipe { | |||||
ModbusCenter.robotWritePlc(false,deviceNum+"号炒锅允许倒料",true,null); | ModbusCenter.robotWritePlc(false,deviceNum+"号炒锅允许倒料",true,null); | ||||
ModbusCenter.robotWritePlc(true,foodPosition+"#库取原料倒至炒锅",true,null); | ModbusCenter.robotWritePlc(true,foodPosition+"#库取原料倒至炒锅",true,null); | ||||
RobotModbusTcpServer.get().WriteShort("GI1", (short) deviceNum, null); | |||||
Thread.sleep(100); | Thread.sleep(100); | ||||
ThreadWhile(deviceNum,deviceNum+"炒锅倒原料完成"); | ThreadWhile(deviceNum,deviceNum+"炒锅倒原料完成"); | ||||
@@ -1106,6 +1107,7 @@ public class ExecuteTheRecipe { | |||||
ModbusCenter.robotWritePlc(false,deviceNum+"号炒锅允许倒料",true,null); | ModbusCenter.robotWritePlc(false,deviceNum+"号炒锅允许倒料",true,null); | ||||
ModbusCenter.robotWritePlc(true,foodPosition+"#库取调料倒至炒锅",true,null); | ModbusCenter.robotWritePlc(true,foodPosition+"#库取调料倒至炒锅",true,null); | ||||
RobotModbusTcpServer.get().WriteShort("GI2", (short) deviceNum, null); | |||||
Thread.sleep(100); | Thread.sleep(100); | ||||
ThreadWhile(deviceNum,deviceNum+"炒锅倒调料完成"); | ThreadWhile(deviceNum,deviceNum+"炒锅倒调料完成"); | ||||
@@ -1154,23 +1156,45 @@ public class ExecuteTheRecipe { | |||||
ConfigName.IsForcedEnd[deviceNum-1] = true; | ConfigName.IsForcedEnd[deviceNum-1] = true; | ||||
break; | break; | ||||
}else{ | }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); | Thread.sleep(100); | ||||
} | } | ||||
@@ -40,6 +40,7 @@ public class ConfigName { | |||||
public final static boolean LOG_TEST = true; | public final static boolean LOG_TEST = true; | ||||
//region 单例模式 | //region 单例模式 | ||||
private static volatile ConfigName mInstance = null; //实例变量设置私有,防止直接通过类名访问 | private static volatile ConfigName mInstance = null; //实例变量设置私有,防止直接通过类名访问 | ||||
public boolean isDemo = false;//是否是展会演示 出餐和空盆有区别 | |||||
private ConfigName() { //默认构造函数私有,防止类外直接new创建对象 | private ConfigName() { //默认构造函数私有,防止类外直接new创建对象 | ||||
} | } | ||||
@@ -153,13 +153,6 @@ public class ModbusCenter { | |||||
if (item.isread == 1) { | if (item.isread == 1) { | ||||
if(Wok2ModbusTcpServer.get().plcIsConnect){ | if(Wok2ModbusTcpServer.get().plcIsConnect){ | ||||
Object val = wokReadPlc(2,item.name); | 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); | Wok2ModbusTcpServer.get().listeningValue.put(item.name, val); | ||||
} | } | ||||
} | } | ||||
@@ -169,7 +162,7 @@ public class ModbusCenter { | |||||
Object object2 = Wok2ModbusTcpServer.get().listeningValue.get("投料位反馈"); | Object object2 = Wok2ModbusTcpServer.get().listeningValue.get("投料位反馈"); | ||||
if(object1 instanceof Boolean){ | if(object1 instanceof Boolean){ | ||||
if((Boolean) object2 || (Boolean)object1){ | if((Boolean) object2 || (Boolean)object1){ | ||||
ModbusCenter.robotWritePlc(false,"1号炒锅允许倒料",true,null); | |||||
ModbusCenter.robotWritePlc(false,"2号炒锅允许倒料",true,null); | |||||
} | } | ||||
} | } | ||||
Object hotError = ModbusCenter.wokReadPlc(1,"异常加热故障信息"); | Object hotError = ModbusCenter.wokReadPlc(1,"异常加热故障信息"); | ||||
@@ -701,7 +694,7 @@ public class ModbusCenter { | |||||
if(isMain){ | if(isMain){ | ||||
if (ConfigName.getInstance().robotMainIndex.get(name)!=null) { | if (ConfigName.getInstance().robotMainIndex.get(name)!=null) { | ||||
int index = ConfigName.getInstance().robotMainIndex.get(name); | 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) { | if (RobotModbusTcpServer.get().plcIsConnect) { | ||||
RobotModbusTcpServer.get().WriteShort("GI0", (short) index, callback); | RobotModbusTcpServer.get().WriteShort("GI0", (short) index, callback); | ||||
} | } | ||||
@@ -710,7 +703,7 @@ public class ModbusCenter { | |||||
if (plcAddress.get(name)!=null) { | if (plcAddress.get(name)!=null) { | ||||
BPA_PLCADDRESS plcaddress = plcAddress.get(name); | BPA_PLCADDRESS plcaddress = plcAddress.get(name); | ||||
assert plcaddress != null; | 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.isEmpty() && RobotModbusTcpServer.get().plcIsConnect) { | ||||
if (plcaddress.address.toUpperCase().startsWith("M"))//bool | if (plcaddress.address.toUpperCase().startsWith("M"))//bool | ||||
{ | { | ||||
@@ -92,8 +92,10 @@ public class LogRecordHActivity extends BaseActivity { | |||||
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(this, R.layout.spinner_text_item,typeMap); | ArrayAdapter<String> adapter2 = new ArrayAdapter<>(this, R.layout.spinner_text_item,typeMap); | ||||
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | ||||
viewBinding.spinner.setAdapter(adapter2); | 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() { | viewBinding.starttime.setOnClickListener(new View.OnClickListener() { | ||||
@Override | @Override | ||||
public void onClick(View view) { | public void onClick(View view) { | ||||
@@ -232,22 +232,44 @@ public class FoodCheckDialog3 extends DialogFragment { | |||||
break; | break; | ||||
case "出餐盆1": | 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 { | }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; | break; | ||||
case "出餐盆2": | 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 { | }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; | break; | ||||
// case "出餐盘3": | // case "出餐盘3": | ||||
// if(value.exist){ | // if(value.exist){ | ||||
@@ -258,28 +258,28 @@ public class RootTipDialog extends DialogFragment { | |||||
case "出餐盆1": | case "出餐盆1": | ||||
if(value.exist){ | if(value.exist){ | ||||
viewBinding.content2.tvChucan1.setText("出餐盆1有盆"); | viewBinding.content2.tvChucan1.setText("出餐盆1有盆"); | ||||
viewBinding.content2.right6.setSelected(true); | |||||
viewBinding.content2.tvChucan1.setSelected(true); | |||||
}else { | }else { | ||||
viewBinding.content2.right6.setText("出餐盆1无盆"); | |||||
viewBinding.content2.right6.setSelected(false); | |||||
viewBinding.content2.tvChucan1.setText("出餐盆1无盆"); | |||||
viewBinding.content2.tvChucan1.setSelected(false); | |||||
} | } | ||||
break; | break; | ||||
case "出餐盆2": | case "出餐盆2": | ||||
if(value.exist){ | if(value.exist){ | ||||
viewBinding.content2.tvChucan2.setText("出餐盆2有盆"); | viewBinding.content2.tvChucan2.setText("出餐盆2有盆"); | ||||
viewBinding.content2.right6.setSelected(true); | |||||
viewBinding.content2.tvChucan2.setSelected(true); | |||||
}else { | }else { | ||||
viewBinding.content2.right6.setText("出餐盆2无盆"); | |||||
viewBinding.content2.right6.setSelected(false); | |||||
viewBinding.content2.tvChucan2.setText("出餐盆2无盆"); | |||||
viewBinding.content2.tvChucan2.setSelected(false); | |||||
} | } | ||||
break; | break; | ||||
case "出餐盆3": | case "出餐盆3": | ||||
if(value.exist){ | if(value.exist){ | ||||
viewBinding.content2.tvChucan3.setText("出餐盆3有盆"); | viewBinding.content2.tvChucan3.setText("出餐盆3有盆"); | ||||
viewBinding.content2.right6.setSelected(true); | |||||
viewBinding.content2.tvChucan3.setSelected(true); | |||||
}else { | }else { | ||||
viewBinding.content2.right6.setText("出餐盆3无盆"); | |||||
viewBinding.content2.right6.setSelected(false); | |||||
viewBinding.content2.tvChucan3.setText("出餐盆3无盆"); | |||||
viewBinding.content2.tvChucan3.setSelected(false); | |||||
} | } | ||||
break; | break; | ||||
} | } | ||||
@@ -258,28 +258,28 @@ public class RootTipDialog2 extends DialogFragment { | |||||
case "出餐盆1": | case "出餐盆1": | ||||
if(value.exist){ | if(value.exist){ | ||||
viewBinding.content2.tvChucan1.setText("出餐盆1有盆"); | viewBinding.content2.tvChucan1.setText("出餐盆1有盆"); | ||||
viewBinding.content2.right6.setSelected(true); | |||||
viewBinding.content2.tvChucan1.setSelected(true); | |||||
}else { | }else { | ||||
viewBinding.content2.right6.setText("出餐盆1无盆"); | |||||
viewBinding.content2.right6.setSelected(false); | |||||
viewBinding.content2.tvChucan1.setText("出餐盆1无盆"); | |||||
viewBinding.content2.tvChucan1.setSelected(false); | |||||
} | } | ||||
break; | break; | ||||
case "出餐盆2": | case "出餐盆2": | ||||
if(value.exist){ | if(value.exist){ | ||||
viewBinding.content2.tvChucan2.setText("出餐盆2有盆"); | viewBinding.content2.tvChucan2.setText("出餐盆2有盆"); | ||||
viewBinding.content2.right6.setSelected(true); | |||||
viewBinding.content2.tvChucan2.setSelected(true); | |||||
}else { | }else { | ||||
viewBinding.content2.right6.setText("出餐盆2无盆"); | |||||
viewBinding.content2.right6.setSelected(false); | |||||
viewBinding.content2.tvChucan2.setText("出餐盆2无盆"); | |||||
viewBinding.content2.tvChucan2.setSelected(false); | |||||
} | } | ||||
break; | break; | ||||
case "出餐盆3": | case "出餐盆3": | ||||
if(value.exist){ | if(value.exist){ | ||||
viewBinding.content2.tvChucan3.setText("出餐盆3有盆"); | viewBinding.content2.tvChucan3.setText("出餐盆3有盆"); | ||||
viewBinding.content2.right6.setSelected(true); | |||||
viewBinding.content2.tvChucan3.setSelected(true); | |||||
}else { | }else { | ||||
viewBinding.content2.right6.setText("出餐盆3无盆"); | |||||
viewBinding.content2.right6.setSelected(false); | |||||
viewBinding.content2.tvChucan3.setText("出餐盆3无盆"); | |||||
viewBinding.content2.tvChucan3.setSelected(false); | |||||
} | } | ||||
break; | break; | ||||
} | } | ||||
@@ -255,22 +255,44 @@ public class RootTipDialog3 extends DialogFragment { | |||||
break; | break; | ||||
case "出餐盆1": | 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 { | }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; | break; | ||||
case "出餐盆2": | 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 { | }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; | break; | ||||
default: | default: | ||||
/*case "出餐盆3": | /*case "出餐盆3": | ||||
@@ -419,8 +419,8 @@ public class PropEditClassifyFragment extends BaseFragment { | |||||
NewToastUtil.getInstance().showToast("点击过快!"); | NewToastUtil.getInstance().showToast("点击过快!"); | ||||
return; | return; | ||||
} | } | ||||
if(GoodsClassifyDBUtil.deleteById(classifyId)){ | |||||
GoodsClassifyDBUtil.DeleteList(GoodsClassifyDBUtil.getListByName(classifyName)); | |||||
if(PropClassifyDBUtil.deleteById(classifyId)){ | |||||
PropClassifyDBUtil.DeleteList(PropClassifyDBUtil.getListByName(classifyName)); | |||||
AttributeDBUtil.deleteByClassifyId(classifyId); | AttributeDBUtil.deleteByClassifyId(classifyId); | ||||
GoodsDBUtil.deleteByPropClassifyId(classifyId); | GoodsDBUtil.deleteByPropClassifyId(classifyId); | ||||
SubAttributeGroupDBUtil.deleteByClassifyId(classifyId); | SubAttributeGroupDBUtil.deleteByClassifyId(classifyId); | ||||
@@ -204,7 +204,7 @@ | |||||
android:textSize="32sp" | android:textSize="32sp" | ||||
android:maxLines="2" | android:maxLines="2" | ||||
android:ellipsize="end" | android:ellipsize="end" | ||||
android:text="出餐盆1有盆" | |||||
android:text="出餐盆2有盆" | |||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
tools:background="@mipmap/ic_pen" | tools:background="@mipmap/ic_pen" | ||||
/> | /> | ||||
@@ -222,7 +222,7 @@ | |||||
android:textSize="32sp" | android:textSize="32sp" | ||||
android:maxLines="2" | android:maxLines="2" | ||||
android:ellipsize="end" | android:ellipsize="end" | ||||
android:text="出餐盆2有盆" | |||||
android:text="出餐盆1有盆" | |||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
tools:background="@mipmap/ic_pen" | tools:background="@mipmap/ic_pen" | ||||
/> | /> | ||||