diff --git a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java index 5903af3b..0a253ec0 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java +++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java @@ -564,7 +564,10 @@ public class ExecuteTheRecipe { Object sb = ReadPLC(name); if (sb != null) { IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog(name + ",接收到信号!"); + if(IsComplete[0]) + { + ExecuteTheRecipe.showlog(name + ",接收到信号!"); + } } } try { @@ -595,7 +598,10 @@ public class ExecuteTheRecipe { Object sb = ReadPLC(name); if (sb != null) { IsComplete[0] = (boolean) (sb); - ExecuteTheRecipe.showlog(name + ",接收到信号!"); + if(IsComplete[0]==false) + { + ExecuteTheRecipe.showlog(name + ",接收到信号!"); + } } } try { diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java index 200683b6..c42a4a14 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java @@ -76,6 +76,19 @@ public class MakeGoodFragment extends BaseFragment { @BindView(R.id.xzcp) Button xzcp; + @BindView(R.id.dialog_xtkz) + RelativeLayout dialog_xtkz; + + @BindView(R.id.dialog_hlkz) + RelativeLayout dialog_hlkz; + + @BindView(R.id.dialog_kbkz) + RelativeLayout dialog_kbkz; + + @BindView(R.id.dialog_jykz) + RelativeLayout dialog_jykz; + + /** * 当前制作商品信息 */ @@ -121,13 +134,35 @@ public class MakeGoodFragment extends BaseFragment { * * @param view */ - @OnClick({R.id.xzcp, R.id.startbutton}) + @OnClick({R.id.xzcp, R.id.startbutton + , R.id.btn_xtkz, R.id.btn_hlkz + , R.id.btn_sjkz, R.id.btn_jykz + , R.id.close_xtkz, R.id.close_hlkz + , R.id.close_kbkz, R.id.close_jykz}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.xzcp://选择菜谱按钮点击 skipToActivity(CpxzActivity.class); ToastUtils.info("打开菜谱选择界面"); break; + case R.id.btn_xtkz: + SetVisibility(1); + break; + case R.id.btn_hlkz: + SetVisibility(2); + break; + case R.id.btn_sjkz: + SetVisibility(3); + break; + case R.id.btn_jykz: + SetVisibility(4); + break; + case R.id.close_xtkz: + case R.id.close_hlkz: + case R.id.close_kbkz: + case R.id.close_jykz: + SetVisibility(0); + break; case R.id.startbutton: if (ExecuteTheRecipe.IsStart) { //按钮点击 @@ -180,7 +215,7 @@ public class MakeGoodFragment extends BaseFragment { SetProcesssUI(0); startbutton.setText("开始烹饪"); startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected); - + SetVisibility(0); //3.接收选择菜谱事件 DataBus.getInstance().mListener = new MyClickListener() { @Override @@ -271,23 +306,18 @@ public class MakeGoodFragment extends BaseFragment { public void run() { while (true) { try { - if(ConfigName.getInstance().PlcIsConnect) - { - for(StatusMode mode:sbzt) - { - Object obj= ExecuteTheRecipe.ReadPLC(mode.YName); - if(obj!=null) - { - mode.Status=(boolean)obj; + if (ConfigName.getInstance().PlcIsConnect) { + for (StatusMode mode : sbzt) { + Object obj = ExecuteTheRecipe.ReadPLC(mode.YName); + if (obj != null) { + mode.Status = (boolean) obj; } } - for(StatusMode mode:gzzt) - { - Object obj= ExecuteTheRecipe.ReadPLC(mode.YName); - if(obj!=null) - { - mode.Status=(boolean)obj; + for (StatusMode mode : gzzt) { + Object obj = ExecuteTheRecipe.ReadPLC(mode.YName); + if (obj != null) { + mode.Status = (boolean) obj; } } @@ -366,7 +396,7 @@ public class MakeGoodFragment extends BaseFragment { } //endregion - //region + //region 计时器 private CountDownTimerExt countDownTimer = null;//计时器 /** @@ -485,17 +515,55 @@ public class MakeGoodFragment extends BaseFragment { second = (int) ((millisecond / 1) % 60); if (minute < 10) { if (second < 10) { - return "0" + minute + "分" + "0" + second+"秒"; + return "0" + minute + "分" + "0" + second + "秒"; } else { return "0" + minute + " : " + second; } } else { if (second < 10) { - return minute + "分" + "0" + second+"秒"; + return minute + "分" + "0" + second + "秒"; } else { - return minute + "分" + second+"秒"; + return minute + "分" + second + "秒"; } } } + + /** + * 设置显示 + * + * @param index + */ + public void SetVisibility(int index) { + try { + if (index == 1) { + dialog_xtkz.setVisibility(View.VISIBLE); + dialog_hlkz.setVisibility(View.GONE); + dialog_kbkz.setVisibility(View.GONE); + dialog_jykz.setVisibility(View.GONE); + } else if (index == 2) { + dialog_xtkz.setVisibility(View.GONE); + dialog_hlkz.setVisibility(View.VISIBLE); + dialog_kbkz.setVisibility(View.GONE); + dialog_jykz.setVisibility(View.GONE); + } else if (index == 3) { + dialog_xtkz.setVisibility(View.GONE); + dialog_hlkz.setVisibility(View.GONE); + dialog_kbkz.setVisibility(View.VISIBLE); + dialog_jykz.setVisibility(View.GONE); + } else if (index == 4) { + dialog_xtkz.setVisibility(View.GONE); + dialog_hlkz.setVisibility(View.GONE); + dialog_kbkz.setVisibility(View.GONE); + dialog_jykz.setVisibility(View.VISIBLE); + } else { + dialog_xtkz.setVisibility(View.GONE); + dialog_hlkz.setVisibility(View.GONE); + dialog_kbkz.setVisibility(View.GONE); + dialog_jykz.setVisibility(View.GONE); + } + } catch (Exception ex) { + + } + } //endregion } \ No newline at end of file diff --git a/app/src/main/res/drawable/silosbj.xml b/app/src/main/res/drawable/silosbj.xml index 73c70a0a..b8046445 100644 --- a/app/src/main/res/drawable/silosbj.xml +++ b/app/src/main/res/drawable/silosbj.xml @@ -8,8 +8,8 @@ + android:width="10px" + android:color="@color/file_picker_des"/> diff --git a/app/src/main/res/layout/fragment_make_good.xml b/app/src/main/res/layout/fragment_make_good.xml index 503406c5..b92b194b 100644 --- a/app/src/main/res/layout/fragment_make_good.xml +++ b/app/src/main/res/layout/fragment_make_good.xml @@ -268,6 +268,7 @@ android:orientation="horizontal">