Ver a proveniência

tiaoz 样式23

tags/old_version_1
fyf há 1 ano
ascendente
cometimento
43cefe7b63
4 ficheiros alterados com 73 adições e 51 eliminações
  1. +1
    -3
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  2. +57
    -43
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  3. +10
    -5
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  4. +5
    -0
      app/src/main/java/com/bonait/bnframework/common/model/mode/UpdateCloudGood.java

+ 1
- 3
app/src/main/java/com/bonait/bnframework/business/ConfigData.java Ver ficheiro

@@ -625,6 +625,7 @@ public class ConfigData {
try {
BPA_GOODS good = QueryDB.GetGoodsId(goodid);
update.storeId = ConfigName.getInstance().organizeMode.id;
update.deviceId = ConfigName.getInstance().DeviceId;
update.goodsInfo = new CloudGood();
update.bomTechnologyActionInfo = new ArrayList<BomTechnologyActionInfo>();
update.goodsInfo.id = good.id;
@@ -883,7 +884,6 @@ public class ConfigData {
//endregion

//region PLC初始化

/**
* 连接PLC
*/
@@ -907,14 +907,12 @@ public class ConfigData {
}
}).start();
}

/**
* 关闭PLC
*/
public void ColsePLC() {
ModbusTcpHelper.get().release();//释放modbus
}

/**
* PLC初始化完成时,需要注册的服务
*/


+ 57
- 43
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java Ver ficheiro

@@ -301,6 +301,9 @@ public class ExecuteTheRecipe {
}
Thread.sleep(100);//10 *6
}

ToastUtils.info("炒锅到达"+value+",继续制作!!!");

}
}
} catch (Exception ex) {
@@ -388,9 +391,9 @@ public class ExecuteTheRecipe {
}else
{
//自动投料
if(ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本"))
if(ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本") || ConfigName.getInstance().versionSelectionEnum.equals("小炒版本"))
{
String writeValue = "1#位置";
String writeValue = "1号位";
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
@@ -398,49 +401,44 @@ public class ExecuteTheRecipe {
writeValue=value;
}
}
WritePLC(writeValue, true, new IWriteCallBack() {
@Override
public void onSuccess() {
WritePLC("主料", true, new IWriteCallBack() {
@Override
public void onSuccess() {
ToastUtils.info("主料倒入完成,继续制作!");
}
@Override
public void onFailure(String ErrorMsg) {
}
});
}
@Override
public void onFailure(String ErrorMsg) {
}
});
} else if (ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) {
String writeValue = "1#位置";
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if (key.contains("主料位置")) {
writeValue=value;

//1.去某一个位置
WritePLC("平移-去"+writeValue,true,null);

//一直等待机器移动到该位置,否则就一直等待 6s超时
String name = "平移轴在"+writeValue;
final boolean[] IsComplete = {false};
long a = System.currentTimeMillis();
while (!IsComplete[0]) {
if ((System.currentTimeMillis() - a) > 1000 * whileTime) {
break;
} else {
Object sb = ListeningValue.get(name);
if (sb != null) {
IsComplete[0] = (boolean) (sb);
}
}
Thread.sleep(100);//10 *6
}
WritePLC(writeValue, true, new IWriteCallBack() {
@Override
public void onSuccess() {
WritePLC("主料", true, new IWriteCallBack() {
@Override
public void onSuccess() {
ToastUtils.info("主料倒入完成,继续制作!");
}
@Override
public void onFailure(String ErrorMsg) {
}
});
}
@Override
public void onFailure(String ErrorMsg) {

//2.给倒菜启动
WritePLC("主料", true, null);
name = "倒菜完成";
IsComplete[0]=false;
a = System.currentTimeMillis();
while (!IsComplete[0]) {
if ((System.currentTimeMillis() - a) > 1000 * whileTime) {
break;
} else {
Object sb = ListeningValue.get(name);
if (sb != null) {
IsComplete[0] = (boolean) (sb);
}
}
});
Thread.sleep(100);//10 *6
}
//
ToastUtils.info("主料倒入完成,继续制作!");
}
}
} catch (Exception ex) {
@@ -533,6 +531,23 @@ public class ExecuteTheRecipe {
}
}
WritePLC("出菜", true, null);

//一直等待机器移动到该位置,否则就一直等待 6s超时
String name = "出餐启动反馈";
final boolean[] IsComplete = {false};
long a = System.currentTimeMillis();
while (!IsComplete[0]) {
if ((System.currentTimeMillis() - a) > 1000 * whileTime) {
break;
} else {
Object sb = ListeningValue.get(name);
if (sb != null) {
IsComplete[0] = (boolean) (sb);
}
}
Thread.sleep(100);//10 *6
}
ToastUtils.info("出菜完成,结束制作!");
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
}
@@ -799,7 +814,6 @@ public class ExecuteTheRecipe {
//endregion

//region 获取基础挡位变量

/**
* 获取挡位变量
*


+ 10
- 5
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java Ver ficheiro

@@ -525,10 +525,15 @@ public class ConfigName {
add(new Res_PLCADDRESS("炒锅清洗反馈", "M41.5", 1, 0));
add(new Res_PLCADDRESS("出餐启动反馈", "M41.6", 1, 0));
add(new Res_PLCADDRESS("炒锅倒菜减速位", "M41.7", 1, 0));
add(new Res_PLCADDRESS("轴在1号位", "M43.0", 1, 0));
add(new Res_PLCADDRESS("轴在2号位", "M43.1", 1, 0));
add(new Res_PLCADDRESS("轴在3号位", "M43.2", 1, 0));
add(new Res_PLCADDRESS("轴在4号位", "M43.3", 1, 0));
add(new Res_PLCADDRESS("平移轴在1号位", "M43.0", 1, 0));
add(new Res_PLCADDRESS("平移轴在2号位", "M43.1", 1, 0));
add(new Res_PLCADDRESS("平移轴在3号位", "M43.2", 1, 0));
add(new Res_PLCADDRESS("平移轴在4号位", "M43.3", 1, 0));
add(new Res_PLCADDRESS("翻转轴在1号位", "M44.0", 1, 0));
add(new Res_PLCADDRESS("翻转轴在2号位", "M44.1", 1, 0));
add(new Res_PLCADDRESS("翻转轴在3号位", "M44.2", 1, 0));
add(new Res_PLCADDRESS("翻转轴在4号位", "M44.3", 1, 0));
add(new Res_PLCADDRESS("倒菜完成", "M44.4", 1, 0));


//检测信号
@@ -731,7 +736,7 @@ public class ConfigName {
//data = "投出抖动三次、投出等待三秒、直接投出、手动投料";
data = "投出等待三秒、直接投出、手动投料";
} else if (item.equals("主料位置")) {
data = "1#位置、2#位置、3#位置、4#位置";
data = "1号位、2号位、3号位、4号位";
} else if (item.equals("正转速度") || item.equals("反转速度") || item.equals("转动速度") || item.equals("搅拌速度")) {
data = "停止、最低、低速、中速、高速、最高、极高";
} else if (item.equals("加热功率") || item.equals("热锅功率")) {


+ 5
- 0
app/src/main/java/com/bonait/bnframework/common/model/mode/UpdateCloudGood.java Ver ficheiro

@@ -27,4 +27,9 @@ public class UpdateCloudGood {
* 店铺id
*/
public String storeId;

/**
* 设备id
*/
public String deviceId;
}

Carregando…
Cancelar
Guardar