Procházet zdrojové kódy

修改同时出餐问题

炒锅机器人_一拖多
liup před 2 měsíci
rodič
revize
74e50054fb
2 změnil soubory, kde provedl 53 přidání a 2 odebrání
  1. +26
    -0
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +27
    -2
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe2.java

+ 26
- 0
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java Zobrazit soubor

@@ -61,6 +61,11 @@ public class ExecuteTheRecipe {
*/
public static boolean IsPause = false;

/**
* 是否在投料
*/
public static boolean RobotIsWorking = false;

public static void reset1(){
IsForcedEnd = false;
IsPause = false;
@@ -345,6 +350,21 @@ public class ExecuteTheRecipe {
//endregion
//写入PLC
if (formulation.size() > 0) {
switch (processname){
case "主料":
case "辅料":
case "出菜":
while (!IsForcedEnd && !ExecuteTheRecipe2.RobotIsWorking) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
}
}
break;
}
if(IsForcedEnd){
return;
}
switch (processname) {
case "搅拌":
Write_PLC_Stir(formulation);
@@ -356,10 +376,14 @@ public class ExecuteTheRecipe {
Write_PLC_Heating(formulation);
break;
case "主料":
RobotIsWorking = true;
Write_PLC_MainIngredients(formulation);
RobotIsWorking = false;
break;
case "辅料":
RobotIsWorking = true;
Write_PLC_MainAccessory(formulation);
RobotIsWorking = false;
break;
case "并行出料":
Write_PLC_ParallelDischarge(formulation);
@@ -368,7 +392,9 @@ public class ExecuteTheRecipe {
Write_PLC_Delay(formulation);
break;
case "出菜":
RobotIsWorking = true;
Write_PLC_MainOutdishes(formulation);
RobotIsWorking = false;
break;
case "清洗":
Write_PLC_CleanPan(formulation);


+ 27
- 2
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe2.java Zobrazit soubor

@@ -21,7 +21,6 @@ import com.bonait.bnframework.modbus.ModbusCenter;
import com.bonait.bnframework.modbus.RackModbusTcpServer;
import com.bonait.bnframework.modbus.RobotModbusTcpServer;
import com.bonait.bnframework.modbus.Wok2ModbusTcpServer;
import com.bonait.bnframework.modbus.Wok2ModbusTcpServer;
import com.bonait.bnframework.newui.widget.NewToastUtil;

import org.greenrobot.eventbus.EventBus;
@@ -36,7 +35,7 @@ import java.util.Map;
*/
public class ExecuteTheRecipe2 {

private static final String TAG = "ExecuteTheRecipe2==>";
private static final String TAG = "ExecuteTheRecipe==>";
private static int deviceNum = 2;
/**
@@ -61,6 +60,11 @@ public class ExecuteTheRecipe2 {
*/
public static boolean IsPause = false;

/**
* 是否在投料
*/
public static boolean RobotIsWorking = false;

public static void reset1(){
IsForcedEnd = false;
IsPause = false;
@@ -345,6 +349,21 @@ public class ExecuteTheRecipe2 {
//endregion
//写入PLC
if (formulation.size() > 0) {
switch (processname){
case "主料":
case "辅料":
case "出菜":
while (!IsForcedEnd && !ExecuteTheRecipe2.RobotIsWorking) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
}
}
break;
}
if(IsForcedEnd){
return;
}
switch (processname) {
case "搅拌":
Write_PLC_Stir(formulation);
@@ -356,10 +375,14 @@ public class ExecuteTheRecipe2 {
Write_PLC_Heating(formulation);
break;
case "主料":
RobotIsWorking = true;
Write_PLC_MainIngredients(formulation);
RobotIsWorking = false;
break;
case "辅料":
RobotIsWorking = true;
Write_PLC_MainAccessory(formulation);
RobotIsWorking = false;
break;
case "并行出料":
Write_PLC_ParallelDischarge(formulation);
@@ -368,7 +391,9 @@ public class ExecuteTheRecipe2 {
Write_PLC_Delay(formulation);
break;
case "出菜":
RobotIsWorking = true;
Write_PLC_MainOutdishes(formulation);
RobotIsWorking = false;
break;
case "清洗":
Write_PLC_CleanPan(formulation);


Načítá se…
Zrušit
Uložit