|
|
@@ -12,6 +12,7 @@ import android.os.Bundle; |
|
|
|
import android.os.CountDownTimer; |
|
|
|
import android.os.SystemClock; |
|
|
|
import android.view.View; |
|
|
|
import android.widget.Button; |
|
|
|
import android.widget.Chronometer; |
|
|
|
import android.widget.ImageView; |
|
|
|
import android.widget.LinearLayout; |
|
|
@@ -75,6 +76,9 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
// @BindView(R.id.nifty_slider3) |
|
|
|
// NiftySlider nifty_slider3;//移动挡位 |
|
|
|
|
|
|
|
|
|
|
|
@BindView(R.id.zhuliaotouliao) |
|
|
|
LinearLayout zhuliaotouliao;// |
|
|
|
private Context context; |
|
|
|
|
|
|
|
@Override |
|
|
@@ -91,6 +95,13 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
*/ |
|
|
|
private void initData() { |
|
|
|
try { |
|
|
|
|
|
|
|
if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本") || ConfigName.getInstance().versionSelectionEnum.contains("一拖")) { |
|
|
|
zhuliaotouliao.setVisibility(View.GONE); |
|
|
|
} else { |
|
|
|
zhuliaotouliao.setVisibility(View.VISIBLE); |
|
|
|
} |
|
|
|
|
|
|
|
DataBus.getInstance().bpa_goodsrecipes.clear(); |
|
|
|
gxchid.removeAllViews(); |
|
|
|
ArrayList<BPA_MATERIAL> materials = QueryDB.GetMaterialALL(); |
|
|
@@ -113,9 +124,8 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
public void onClick(View view) { |
|
|
|
if (isRun) { |
|
|
|
ToastUtils.warning("请先结束烹饪!!!"); |
|
|
|
}else |
|
|
|
{ |
|
|
|
finish(); |
|
|
|
} else { |
|
|
|
finish(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@@ -149,21 +159,20 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
huoli.mListener = new MyClickListener() { |
|
|
|
@Override |
|
|
|
public void clickListener(View v, Object data) { |
|
|
|
if(isRunClick()) |
|
|
|
{ |
|
|
|
if (isRunClick()) { |
|
|
|
long elapsedMillis = SystemClock.elapsedRealtime() - runtime.getBase(); |
|
|
|
int time = (int) (elapsedMillis / 1000);//当前点击多少秒 |
|
|
|
int time_c=time-ClikTime; |
|
|
|
int time_c = time - ClikTime; |
|
|
|
|
|
|
|
if(time_c>0)//如果大于0,那么加一个延迟 |
|
|
|
if (time_c > 0)//如果大于0,那么加一个延迟 |
|
|
|
{ |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); |
|
|
|
} |
|
|
|
|
|
|
|
String sdstr= Get挡位((int) data); |
|
|
|
BPA_GOODSRECIPE data1=Get加热(sdstr); |
|
|
|
String sdstr = Get挡位((int) data); |
|
|
|
BPA_GOODSRECIPE data1 = Get加热(sdstr); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data1); |
|
|
|
ClikTime=time; |
|
|
|
ClikTime = time; |
|
|
|
ExecuteTheRecipe.Write_PLC_HuoLI((int) data); |
|
|
|
} |
|
|
|
|
|
|
@@ -177,22 +186,26 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int TimeOut=0;//当前运行总时长 |
|
|
|
public int ClikTime=0;//上一次点击时间 |
|
|
|
public int TimeOut = 0;//当前运行总时长 |
|
|
|
public int ClikTime = 0;//上一次点击时间 |
|
|
|
|
|
|
|
@OnClick({R.id.startbutton, R.id.querendangwei, |
|
|
|
R.id.chuliao, R.id.touliao1,R.id.touliao0, |
|
|
|
R.id.chuliao, R.id.touliao1, R.id.touliao0, |
|
|
|
R.id.touliao2, R.id.touliao3, |
|
|
|
R.id.touliao4 |
|
|
|
, R.id.ydw, R.id.dcw, R.id.clw |
|
|
|
, R.id.qxw, R.id.ccw1, R.id.ccw2, R.id.ccw3 |
|
|
|
,R.id.zidongchucan}) |
|
|
|
, R.id.zidongchucan |
|
|
|
, R.id.touliao_sd}) |
|
|
|
public void onViewClicked(View view) { |
|
|
|
long elapsedMillis = SystemClock.elapsedRealtime() - runtime.getBase(); |
|
|
|
int time = (int) (elapsedMillis / 1000);//当前点击多少秒 |
|
|
|
int time_c=time-ClikTime; |
|
|
|
int time_c = time - ClikTime; |
|
|
|
|
|
|
|
switch (view.getId()) { |
|
|
|
case R.id.touliao_sd://手动投料 |
|
|
|
ShouDongMainDish(); |
|
|
|
break; |
|
|
|
case R.id.startbutton://启动 停止 |
|
|
|
if (isRun) { |
|
|
|
String title = "停止操作提示!"; |
|
|
@@ -218,16 +231,15 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
} |
|
|
|
break; |
|
|
|
case R.id.querendangwei://确认搅拌挡位 |
|
|
|
if(isRunClick()) |
|
|
|
{ |
|
|
|
if(time_c>0)//如果大于0,那么加一个延迟 |
|
|
|
if (isRunClick()) { |
|
|
|
if (time_c > 0)//如果大于0,那么加一个延迟 |
|
|
|
{ |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); |
|
|
|
} |
|
|
|
|
|
|
|
int sd = (int) nifty_slider2.getValue(); |
|
|
|
String sdstr= Get速度(sd); |
|
|
|
BPA_GOODSRECIPE data=Get搅拌(sdstr); |
|
|
|
String sdstr = Get速度(sd); |
|
|
|
BPA_GOODSRECIPE data = Get搅拌(sdstr); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data); |
|
|
|
ExecuteTheRecipe.WritePLC("搅拌速度", sd, new IWriteCallBack() { |
|
|
|
@Override |
|
|
@@ -238,72 +250,70 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
ExecuteTheRecipe.WritePLC("搅拌", true, null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
} |
|
|
|
}); |
|
|
|
ClikTime=time; |
|
|
|
ClikTime = time; |
|
|
|
} |
|
|
|
break; |
|
|
|
case R.id.chuliao://出料 |
|
|
|
if(isRunClick()) |
|
|
|
{ |
|
|
|
if (isRunClick()) { |
|
|
|
BPA_GOODSRECIPE data = GetSelectItemFromValue(); |
|
|
|
if (data != null) { |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data); |
|
|
|
MakeRecipe(data); |
|
|
|
ClikTime=time; |
|
|
|
ClikTime = time; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case R.id.touliao0://主料1 |
|
|
|
if(isRunClick()) |
|
|
|
{ |
|
|
|
if (isRunClick()) { |
|
|
|
ExecuteTheRecipe.BottomClick("平移-去1号位"); |
|
|
|
} |
|
|
|
break; |
|
|
|
case R.id.touliao1://主料1 |
|
|
|
ClickZL(time,time_c,1); |
|
|
|
ClickZL(time, time_c, 1); |
|
|
|
break; |
|
|
|
case R.id.touliao2://主料2 |
|
|
|
ClickZL(time,time_c,2); |
|
|
|
ClickZL(time, time_c, 2); |
|
|
|
break; |
|
|
|
case R.id.touliao3://主料3 |
|
|
|
ClickZL(time,time_c,3); |
|
|
|
ClickZL(time, time_c, 3); |
|
|
|
break; |
|
|
|
case R.id.touliao4://主料4 |
|
|
|
ClickZL(time,time_c,4); |
|
|
|
ClickZL(time, time_c, 4); |
|
|
|
break; |
|
|
|
case R.id.ydw://原点位 |
|
|
|
ClickWZ(time,time_c,"原点位"); |
|
|
|
ClickWZ(time, time_c, "原点位"); |
|
|
|
break; |
|
|
|
case R.id.dcw://到菜位 |
|
|
|
ClickWZ(time,time_c,"倒菜位"); |
|
|
|
ClickWZ(time, time_c, "倒菜位"); |
|
|
|
break; |
|
|
|
case R.id.clw://出料位置 |
|
|
|
ClickWZ(time,time_c,"抽料位"); |
|
|
|
ClickWZ(time, time_c, "抽料位"); |
|
|
|
break; |
|
|
|
case R.id.qxw://清洗位置 |
|
|
|
ClickWZ(time,time_c,"清洗位"); |
|
|
|
ClickWZ(time, time_c, "清洗位"); |
|
|
|
break; |
|
|
|
case R.id.ccw1://炒菜位1 |
|
|
|
ClickWZ(time,time_c,"炒菜位1"); |
|
|
|
ClickWZ(time, time_c, "炒菜位1"); |
|
|
|
break; |
|
|
|
case R.id.ccw2://炒菜位2 |
|
|
|
ClickWZ(time,time_c,"炒菜位2"); |
|
|
|
ClickWZ(time, time_c, "炒菜位2"); |
|
|
|
break; |
|
|
|
case R.id.ccw3://炒菜位3 |
|
|
|
ClickWZ(time,time_c,"炒菜位3"); |
|
|
|
ClickWZ(time, time_c, "炒菜位3"); |
|
|
|
break; |
|
|
|
case R.id.zidongchucan://自动出餐 |
|
|
|
if(isRunClick()) |
|
|
|
{ |
|
|
|
BPA_GOODSRECIPE data1=Get出菜(time_c); |
|
|
|
if (isRunClick()) { |
|
|
|
BPA_GOODSRECIPE data1 = Get出菜(time_c); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data1); |
|
|
|
BPA_GOODSRECIPE data2 = Get清洗(0); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data2); |
|
|
|
// BPA_GOODSRECIPE data2 = Get清洗(0); |
|
|
|
// DataBus.getInstance().bpa_goodsrecipes.add(data2); |
|
|
|
MakeRecipe(data1); |
|
|
|
ClikTime=time; |
|
|
|
ClikTime = time; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
@@ -313,10 +323,10 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
|
|
|
|
/** |
|
|
|
* 是否运行 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public boolean isRunClick() |
|
|
|
{ |
|
|
|
public boolean isRunClick() { |
|
|
|
if (!isRun) { |
|
|
|
ToastUtils.warning("请先开始计时器!!!"); |
|
|
|
return false; |
|
|
@@ -335,8 +345,8 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
public void ClickZL(int time,int time_c,int num) |
|
|
|
{ |
|
|
|
|
|
|
|
public void ClickZL(int time, int time_c, int num) { |
|
|
|
// Object sb = ExecuteTheRecipe.ReadPLC("平移轴在1号位"); |
|
|
|
// if (sb != null) { |
|
|
|
// if ((boolean) (sb)) { |
|
|
@@ -348,80 +358,108 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
// ToastUtils.warning("PLC未连接!!!"); |
|
|
|
// } |
|
|
|
|
|
|
|
if(isRunClick()) |
|
|
|
{ |
|
|
|
if(time_c>0)//如果大于0,那么加一个延迟 |
|
|
|
if (isRunClick()) { |
|
|
|
if (time_c > 0)//如果大于0,那么加一个延迟 |
|
|
|
{ |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); |
|
|
|
} |
|
|
|
|
|
|
|
//控制去炒菜位 |
|
|
|
BPA_GOODSRECIPE data1=Get位置("高速","炒菜位1"); |
|
|
|
BPA_GOODSRECIPE data1 = Get位置("高速", "炒菜位1"); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data1); |
|
|
|
|
|
|
|
BPA_GOODSRECIPE data=Get主料(num); |
|
|
|
BPA_GOODSRECIPE data = Get主料(num); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data); |
|
|
|
MakeRecipe(data);//执行主料 |
|
|
|
ClikTime=time; |
|
|
|
ClikTime = time; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
public void ClickWZ(int time,int time_c,String name) |
|
|
|
{ |
|
|
|
if(isRunClick()) |
|
|
|
{ |
|
|
|
if(time_c>0)//如果大于0,那么加一个延迟 |
|
|
|
|
|
|
|
public void ClickWZ(int time, int time_c, String name) { |
|
|
|
if (isRunClick()) { |
|
|
|
if (time_c > 0)//如果大于0,那么加一个延迟 |
|
|
|
{ |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); |
|
|
|
} |
|
|
|
|
|
|
|
// int sd = (int) nifty_slider3.getValue(); |
|
|
|
// String sdstr= Get速度(sd); |
|
|
|
BPA_GOODSRECIPE data=Get位置("高速",name); |
|
|
|
BPA_GOODSRECIPE data = Get位置("高速", name); |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(data); |
|
|
|
MakeRecipe(data); |
|
|
|
ClikTime=time; |
|
|
|
ClikTime = time; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isMake=false; |
|
|
|
public void MakeRecipe(BPA_GOODSRECIPE recipe) |
|
|
|
{ |
|
|
|
isMake=true; |
|
|
|
public boolean isMake = false; |
|
|
|
|
|
|
|
public void MakeRecipe(BPA_GOODSRECIPE recipe) { |
|
|
|
isMake = true; |
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
if (recipe.materialType == 0)//正常物料 |
|
|
|
{ |
|
|
|
BPA_GOODSRECIPE data1=Get位置("高速","抽料位"); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname,data1.processvalue); |
|
|
|
BPA_GOODSRECIPE data1 = Get位置("高速", "抽料位"); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname, data1.processvalue); |
|
|
|
|
|
|
|
ExecuteTheRecipe.ExecuteMaterialIssuance(recipe.processvalue); |
|
|
|
} else if (recipe.materialType == 1)//工序模型 |
|
|
|
{ |
|
|
|
if(recipe.processname.equals("主料")) |
|
|
|
{ |
|
|
|
BPA_GOODSRECIPE data1=Get位置("高速","炒菜位1"); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname,data1.processvalue); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(recipe.processname,recipe.processvalue); |
|
|
|
}else |
|
|
|
{ |
|
|
|
if(recipe.processname.equals("出菜")) |
|
|
|
{ |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(recipe.processname,recipe.processvalue); |
|
|
|
if (recipe.processname.equals("主料")) { |
|
|
|
BPA_GOODSRECIPE data1 = Get位置("高速", "炒菜位1"); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname, data1.processvalue); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(recipe.processname, recipe.processvalue); |
|
|
|
} else { |
|
|
|
if (recipe.processname.equals("出菜")) { |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(recipe.processname, recipe.processvalue); |
|
|
|
BPA_GOODSRECIPE data2 = Get清洗(0); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(data2.processname,data2.processvalue); |
|
|
|
}else |
|
|
|
{ |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(recipe.processname,recipe.processvalue); |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(data2.processname, data2.processvalue); |
|
|
|
} else { |
|
|
|
ExecuteTheRecipe.ExecuteOperationSteps(recipe.processname, recipe.processvalue); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
isMake=false; |
|
|
|
isMake = false; |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 手动投主菜品 |
|
|
|
* |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public void ShouDongMainDish() { |
|
|
|
int time = (int) ((SystemClock.elapsedRealtime() - runtime.getBase()) / 1000);//当前点击多少秒 |
|
|
|
int time_c = time - ClikTime; |
|
|
|
|
|
|
|
if (time_c > 0)//如果大于0,那么加一个延迟 |
|
|
|
{ |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); |
|
|
|
} |
|
|
|
DataBus.getInstance().bpa_goodsrecipes.add(Get手动主料()); |
|
|
|
ExecuteTheRecipe.WritePLC("暂停开关", true, null); |
|
|
|
String title = "手动投料-温馨提示!"; |
|
|
|
String message = "客官请投入主料,投入后点击[确定]继续流程!"; |
|
|
|
new QMUIDialog.MessageDialogBuilder(context) |
|
|
|
.setCancelable(false) |
|
|
|
.setCanceledOnTouchOutside(false) |
|
|
|
.setTitle(title) |
|
|
|
.setMessage(message) |
|
|
|
.addAction("确定", new QMUIDialogAction.ActionListener() { |
|
|
|
@Override |
|
|
|
public void onClick(QMUIDialog dialog, int index) { |
|
|
|
ExecuteTheRecipe.WritePLC("暂停开关", false, null); |
|
|
|
ClikTime = (int) ((SystemClock.elapsedRealtime() - runtime.getBase()) / 1000); |
|
|
|
dialog.dismiss(); |
|
|
|
} |
|
|
|
}) |
|
|
|
.create(com.qmuiteam.qmui.R.style.QMUI_Dialog).show(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取选中行的变量 |
|
|
|
* |
|
|
@@ -468,18 +506,19 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取延迟 |
|
|
|
* |
|
|
|
* @param time |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BPA_GOODSRECIPE Get延迟(int time) |
|
|
|
{ |
|
|
|
public BPA_GOODSRECIPE Get延迟(int time) { |
|
|
|
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); |
|
|
|
pf.materialType=1; |
|
|
|
pf.processname="延迟"; |
|
|
|
pf.processms="延迟("+time+")"; |
|
|
|
pf.processvalue="延迟(秒),"+time; |
|
|
|
pf.materialType = 1; |
|
|
|
pf.processname = "延迟"; |
|
|
|
pf.processms = "延迟(" + time + ")"; |
|
|
|
pf.processvalue = "延迟(秒)," + time; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取清洗 |
|
|
|
* |
|
|
@@ -493,142 +532,143 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
pf.processvalue = "等待(秒)," + k; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取主料 |
|
|
|
* |
|
|
|
* @param wz |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BPA_GOODSRECIPE Get主料(int wz) |
|
|
|
{ |
|
|
|
public BPA_GOODSRECIPE Get主料(int wz) { |
|
|
|
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); |
|
|
|
pf.materialType=1; |
|
|
|
pf.processname="主料"; |
|
|
|
pf.processms="主料(未知,"+wz+"号位,0,直接投出,0)"; |
|
|
|
pf.processvalue="主料名称,未知|主料位置,"+wz+"号位|主料重量,0|投料动作,直接投出|烹饪(秒),0"; |
|
|
|
pf.materialType = 1; |
|
|
|
pf.processname = "主料"; |
|
|
|
pf.processms = "主料(未知," + wz + "号位,0,直接投出,0)"; |
|
|
|
pf.processvalue = "主料名称,未知|主料位置," + wz + "号位|主料重量,0|投料动作,直接投出|烹饪(秒),0"; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取手动主料 |
|
|
|
* |
|
|
|
* @param |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BPA_GOODSRECIPE Get手动主料() { |
|
|
|
String ms = "未知"; |
|
|
|
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); |
|
|
|
pf.materialType = 1; |
|
|
|
pf.processname = "主料"; |
|
|
|
pf.processms = "主料(" + ms + ",1号位,0,手动投料,0)"; |
|
|
|
pf.processvalue = "主料名称," + ms + "|主料位置,1号位|主料重量,0|投料动作,手动投料|烹饪(秒),0"; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取位置 |
|
|
|
* |
|
|
|
* @param sd |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BPA_GOODSRECIPE Get位置(String sd,String name) |
|
|
|
{ |
|
|
|
public BPA_GOODSRECIPE Get位置(String sd, String name) { |
|
|
|
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); |
|
|
|
pf.materialType=1; |
|
|
|
pf.processname="位置"; |
|
|
|
pf.processms="位置("+sd+","+name+",0)"; |
|
|
|
pf.processvalue="转动速度,"+sd+"|位置动作,"+name+"|延迟(秒),0"; |
|
|
|
pf.materialType = 1; |
|
|
|
pf.processname = "位置"; |
|
|
|
pf.processms = "位置(" + sd + "," + name + ",0)"; |
|
|
|
pf.processvalue = "转动速度," + sd + "|位置动作," + name + "|延迟(秒),0"; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取搅拌 |
|
|
|
* |
|
|
|
* @param sd |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BPA_GOODSRECIPE Get搅拌(String sd) |
|
|
|
{ |
|
|
|
public BPA_GOODSRECIPE Get搅拌(String sd) { |
|
|
|
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); |
|
|
|
pf.materialType=1; |
|
|
|
pf.processname="搅拌"; |
|
|
|
pf.processms="搅拌("+sd+",0)"; |
|
|
|
pf.processvalue="搅拌速度,"+sd+"|延迟(秒),0"; |
|
|
|
pf.materialType = 1; |
|
|
|
pf.processname = "搅拌"; |
|
|
|
pf.processms = "搅拌(" + sd + ",0)"; |
|
|
|
pf.processvalue = "搅拌速度," + sd + "|延迟(秒),0"; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取加热 |
|
|
|
* |
|
|
|
* @param sd |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BPA_GOODSRECIPE Get加热(String sd) |
|
|
|
{ |
|
|
|
public BPA_GOODSRECIPE Get加热(String sd) { |
|
|
|
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); |
|
|
|
pf.materialType=1; |
|
|
|
pf.processname="加热"; |
|
|
|
pf.processms="加热("+sd+",0)"; |
|
|
|
pf.processvalue="加热功率,"+sd+"|延迟(秒),0"; |
|
|
|
pf.materialType = 1; |
|
|
|
pf.processname = "加热"; |
|
|
|
pf.processms = "加热(" + sd + ",0)"; |
|
|
|
pf.processvalue = "加热功率," + sd + "|延迟(秒),0"; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取出菜 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BPA_GOODSRECIPE Get出菜(int k) |
|
|
|
{ |
|
|
|
public BPA_GOODSRECIPE Get出菜(int k) { |
|
|
|
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); |
|
|
|
pf.materialType=1; |
|
|
|
pf.processname="出菜"; |
|
|
|
pf.processms="出菜("+k+")"; |
|
|
|
pf.processvalue="等待(秒),"+k; |
|
|
|
pf.materialType = 1; |
|
|
|
pf.processname = "出菜"; |
|
|
|
pf.processms = "出菜(" + k + ")"; |
|
|
|
pf.processvalue = "等待(秒)," + k; |
|
|
|
return pf; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取速度 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String Get速度(int speed) |
|
|
|
{ |
|
|
|
if(speed>=0 && speed<5) |
|
|
|
{ |
|
|
|
public String Get速度(int speed) { |
|
|
|
if (speed >= 0 && speed < 5) { |
|
|
|
return "停止"; |
|
|
|
}else if(speed>=5 && speed<15) |
|
|
|
{ |
|
|
|
} else if (speed >= 5 && speed < 15) { |
|
|
|
return "最低"; |
|
|
|
}else if(speed>=15 && speed<25) |
|
|
|
{ |
|
|
|
} else if (speed >= 15 && speed < 25) { |
|
|
|
return "低速"; |
|
|
|
}else if(speed>=25 && speed<35) |
|
|
|
{ |
|
|
|
} else if (speed >= 25 && speed < 35) { |
|
|
|
return "中速"; |
|
|
|
}else if(speed>=35 && speed<45) |
|
|
|
{ |
|
|
|
} else if (speed >= 35 && speed < 45) { |
|
|
|
return "高速"; |
|
|
|
}else if(speed>=45 && speed<55) |
|
|
|
{ |
|
|
|
} else if (speed >= 45 && speed < 55) { |
|
|
|
return "最高"; |
|
|
|
}else |
|
|
|
{ |
|
|
|
} else { |
|
|
|
return "极高"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取挡位 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String Get挡位(int speed) |
|
|
|
{ |
|
|
|
if(speed==0) |
|
|
|
{ |
|
|
|
public String Get挡位(int speed) { |
|
|
|
if (speed == 0) { |
|
|
|
return "停止"; |
|
|
|
}else if(speed==1) |
|
|
|
{ |
|
|
|
} else if (speed == 1) { |
|
|
|
return "一档"; |
|
|
|
}else if(speed==2) |
|
|
|
{ |
|
|
|
} else if (speed == 2) { |
|
|
|
return "二档"; |
|
|
|
}else if(speed==3) |
|
|
|
{ |
|
|
|
} else if (speed == 3) { |
|
|
|
return "三档"; |
|
|
|
}else if(speed==4) |
|
|
|
{ |
|
|
|
} else if (speed == 4) { |
|
|
|
return "四档"; |
|
|
|
}else if(speed==5) |
|
|
|
{ |
|
|
|
} else if (speed == 5) { |
|
|
|
return "五档"; |
|
|
|
}else if(speed==6) |
|
|
|
{ |
|
|
|
} else if (speed == 6) { |
|
|
|
return "六档"; |
|
|
|
}else if(speed==7) |
|
|
|
{ |
|
|
|
} else if (speed == 7) { |
|
|
|
return "七档"; |
|
|
|
}else |
|
|
|
{ |
|
|
|
} else { |
|
|
|
return "八档"; |
|
|
|
} |
|
|
|
} |
|
|
@@ -651,8 +691,8 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
start_bj.setBackgroundColor(Color.parseColor("#5700FF22")); |
|
|
|
|
|
|
|
DataBus.getInstance().bpa_goodsrecipes.clear();//清空所有工序 |
|
|
|
TimeOut=0; |
|
|
|
ClikTime=0; |
|
|
|
TimeOut = 0; |
|
|
|
ClikTime = 0; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@@ -674,15 +714,14 @@ public class DiyMemoryActivity extends BaseActivity { |
|
|
|
|
|
|
|
long elapsedMillis = SystemClock.elapsedRealtime() - runtime.getBase(); |
|
|
|
TimeOut = (int) (elapsedMillis / 1000);//当前点击多少秒 |
|
|
|
DataBus.getInstance().TimeOut=TimeOut; |
|
|
|
if(DataBus.getInstance().bpa_goodsrecipes.size()>=0) |
|
|
|
{ |
|
|
|
MessageManager.getInstance().sendMessage(MessageName.DIY,"DIY"); |
|
|
|
DataBus.getInstance().TimeOut = TimeOut; |
|
|
|
if (DataBus.getInstance().bpa_goodsrecipes.size() >= 0) { |
|
|
|
MessageManager.getInstance().sendMessage(MessageName.DIY, "DIY"); |
|
|
|
} |
|
|
|
|
|
|
|
ExecuteTheRecipe.WritePLC("搅拌", false, null); |
|
|
|
ExecuteTheRecipe.WritePLC("加热", false, null); |
|
|
|
ConfigName.getInstance().IsOpenHuoLi= false; |
|
|
|
ConfigName.getInstance().IsOpenHuoLi = false; |
|
|
|
ExecuteTheRecipe.BottomClick("平移-去1号位"); |
|
|
|
} |
|
|
|
}); |
|
|
|