diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck.java index 2bbb2a73..3cc51239 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck.java @@ -340,29 +340,46 @@ public class add_silos_ck extends LinearLayout { } } }); - control_switch_shoudong.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View view, MotionEvent motionEvent) { - if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { - Log.e("鼠标", "按下: "); - ExecuteTheRecipe.WritePLC("手自切换", false, new IWriteCallBack() { - @Override - public void onSuccess() { - ExecuteTheRecipe.WritePLC("手动控制" + lcMode.num, true, null); - } - @Override - public void onFailure(String ErrorMsg) { - } - }); - } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { - Log.e("鼠标", "松开: "); - ExecuteTheRecipe.WritePLC("手动控制" + lcMode.num, false, null); - } - return false; + + control_switch_shoudong.setOnTouchListener((view,motionEvent)->{ + String name = lcMode.name + lcMode.num+"启停控制"; + if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { + Log.e("鼠标", "按下:2222 "); + ExecuteTheRecipe.WritePLC("清洗模式", true,null); + ExecuteTheRecipe.WritePLC(name, true, null); + } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { + Log.e("鼠标", "松开:33333 "); + ExecuteTheRecipe.WritePLC("清洗模式", false,null); + ExecuteTheRecipe.WritePLC(name, false, null); } + return false; }); + +// control_switch_shoudong.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// Log.e("鼠标", "按下: "); +// ExecuteTheRecipe.WritePLC("手自切换", false, new IWriteCallBack() { +// @Override +// public void onSuccess() { +// ExecuteTheRecipe.WritePLC("手动控制" + lcMode.num, true, null); +// } +// +// @Override +// public void onFailure(String ErrorMsg) { +// } +// }); +// } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { +// Log.e("鼠标", "松开: "); +// ExecuteTheRecipe.WritePLC("手动控制" + lcMode.num, false, null); +// } +// return false; +// } +// }); + control_huishou.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck_edit.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck_edit.java index 0397da3d..d6c026cc 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck_edit.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck_edit.java @@ -333,11 +333,11 @@ public class add_silos_ck_edit extends LinearLayout { control_switch_shoudong.setOnTouchListener((view,motionEvent)->{ String name = lcMode.name + lcMode.num+"启停控制"; if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { - Log.e("鼠标", "按下: "); + Log.e("鼠标", "按下:2222 "); ExecuteTheRecipe.WritePLC("清洗模式", true,null); ExecuteTheRecipe.WritePLC(name, true, null); } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { - Log.e("鼠标", "松开: "); + Log.e("鼠标", "松开:33333 "); ExecuteTheRecipe.WritePLC("清洗模式", false,null); ExecuteTheRecipe.WritePLC(name, false, null); }