diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java index b7fd21fd..d3db0d83 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java @@ -18,6 +18,7 @@ import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.AdapterView; +import android.widget.CheckBox; import android.widget.Chronometer; import android.widget.EditText; import android.widget.ImageView; @@ -198,6 +199,28 @@ public class DishTestActivity extends BaseActivity { @BindView(R.id.shoudong_touliao) imagebuttom3 shoudong_touliao;//手动投料 + + + @BindView(R.id.guokoucaoxiang_1) + LinearLayout guokoucaoxiang_1; + + @BindView(R.id.guokoucaoxiang) + imagebuttom3 guokoucaoxiang; + + @BindView(R.id.guokoucaoxiang_cc) + imagebuttom3 guokoucaoxiang_cc; + + @BindView(R.id.guokoucaoxiang_cl) + imagebuttom3 guokoucaoxiang_cl; + + @BindView(R.id.guokoucaoxiang_dc) + imagebuttom3 guokoucaoxiang_dc; + + @BindView(R.id.guokoucaoxiang_qx) + imagebuttom3 guokoucaoxiang_qx; + + @BindView(R.id.check_PF) + CheckBox check_PF; //endregion //region 界面实例 @@ -243,6 +266,12 @@ public class DishTestActivity extends BaseActivity { fanchaoshudu_m.mListener = myClickListener; fanchaoshudu_t.mListener = myClickListener; + guokoucaoxiang.mListener = myClickListener; + guokoucaoxiang_cc.mListener = myClickListener; + guokoucaoxiang_cl.mListener = myClickListener; + guokoucaoxiang_dc.mListener = myClickListener; + guokoucaoxiang_qx.mListener = myClickListener; + //chushui.mListener = myClickListener; touliao1.mListener = myClickListener; @@ -428,6 +457,22 @@ public class DishTestActivity extends BaseActivity { ShouDongMainDish(); break; + case R.id.guokoucaoxiang: + guokoucaoxiang_1.setVisibility(isclick ? View.VISIBLE : View.GONE); + break; + case R.id.guokoucaoxiang_cc: + SetMouthFacing(MouthFacingEnum.炒菜位); + break; + case R.id.guokoucaoxiang_cl: + SetMouthFacing(MouthFacingEnum.抽料位); + break; + case R.id.guokoucaoxiang_dc: + SetMouthFacing(MouthFacingEnum.倒菜位); + break; + case R.id.guokoucaoxiang_qx: + SetMouthFacing(MouthFacingEnum.清洗位); + break; + } } @@ -941,6 +986,7 @@ public class DishTestActivity extends BaseActivity { String message = "客官请投入主料,投入后点击[确定]继续流程!"; new QMUIDialog.MessageDialogBuilder(context) .setCancelable(false) + .setCanceledOnTouchOutside(false) .setTitle(title) .setMessage(message) .addAction("确定", new QMUIDialogAction.ActionListener() { @@ -955,6 +1001,54 @@ public class DishTestActivity extends BaseActivity { } + /** + * 设置锅口朝向 + * + * @param + */ + public void SetMouthFacing(MouthFacingEnum mouth) { + SetZhiXingZhong(true); + guokoucaoxiang_1.setVisibility(View.GONE); + String name="原点位"; + switch (mouth) { + case 炒菜位: + name="炒菜位1"; + break; + case 抽料位: + name="抽料位"; + break; + case 倒菜位: + name="倒菜位"; + break; + case 清洗位: + name="清洗位"; + break; + } + int time = (int) ((SystemClock.elapsedRealtime() - runtime.getBase()) / 1000);//当前点击多少秒 + int time_c = time - ClikTime; + String finalName = name; + new Thread(new Runnable() { + @Override + public void run() { + BPA_GOODSRECIPE data1 = Get位置("高速", finalName); + ExecuteTheRecipe.ExecuteOperationSteps(data1.processname, data1.processvalue); + runOnUiThread(new Runnable() { + @Override + public void run() { + if (time_c > 0)//如果大于0,那么加一个延迟 + { + DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); + } + DataBus.getInstance().bpa_goodsrecipes.add(data1); + SetZhiXingZhong(false); + //刷新工序 + RefreshProcedure(); + } + }); + } + }).start(); + } + /** * 抽料 * @@ -1076,13 +1170,21 @@ public class DishTestActivity extends BaseActivity { int time_c = time - ClikTime; BPA_GOODSRECIPE data = Get出菜(time_c); DataBus.getInstance().bpa_goodsrecipes.add(data); + BPA_GOODSRECIPE data2 = Get清洗(0); - DataBus.getInstance().bpa_goodsrecipes.add(data2); + if(check_PF.isChecked()) + { + DataBus.getInstance().bpa_goodsrecipes.add(data2); + } + new Thread(new Runnable() { @Override public void run() { ExecuteTheRecipe.ExecuteOperationSteps(data.processname, data.processvalue); - ExecuteTheRecipe.ExecuteOperationSteps(data2.processname, data2.processvalue); + if(check_PF.isChecked()) + { + ExecuteTheRecipe.ExecuteOperationSteps(data2.processname, data2.processvalue); + } } }).start(); } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java index 2d449600..18297174 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java @@ -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 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号位"); } }); diff --git a/app/src/main/res/layout/activity_dishtest.xml b/app/src/main/res/layout/activity_dishtest.xml index 163da8aa..41f3b220 100644 --- a/app/src/main/res/layout/activity_dishtest.xml +++ b/app/src/main/res/layout/activity_dishtest.xml @@ -54,16 +54,35 @@ android:textColor="#BEAA6A" android:textSize="45dp" /> - + android:layout_height="wrap_content"> + + + + + + @@ -398,9 +417,67 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" - android:layout_marginTop="130dp" - android:layout_marginRight="120dp" - android:orientation="vertical"> + android:layout_marginTop="10dp" + android:layout_marginRight="80dp" + android:orientation="vertical"> + + + + + + + + + + + + + + @@ -554,19 +556,24 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="@dimen/dp_10"> - -