|
|
@@ -158,6 +158,8 @@ public class Home1Fragment extends BaseFragment { |
|
|
|
@BindView(R.id.rl_goods_detail) |
|
|
|
RelativeLayout rl_goods_detail; |
|
|
|
|
|
|
|
private boolean isOnTouch = false; |
|
|
|
|
|
|
|
private Handler handler = new Handler(Looper.getMainLooper()){ |
|
|
|
@Override |
|
|
|
public void handleMessage(@NonNull Message msg) { |
|
|
@@ -189,6 +191,9 @@ public class Home1Fragment extends BaseFragment { |
|
|
|
} |
|
|
|
} |
|
|
|
handler.sendEmptyMessageDelayed(1,500); |
|
|
|
}else if(msg.what == 2){ |
|
|
|
ExecuteTheRecipe.WritePLC("翻转反转", false, null); |
|
|
|
ExecuteTheRecipe.WritePLC("翻转正转", false, null); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
@@ -563,25 +568,31 @@ public class Home1Fragment extends BaseFragment { |
|
|
|
NewToastUtil.getInstance().showToastError("PLC未准备就绪!!!","PLC not connected"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if(!isOnTouch){ |
|
|
|
handler.removeMessages(2); |
|
|
|
isOnTouch = true; |
|
|
|
} |
|
|
|
int jd = (int) nifty_slider3.getValue(); |
|
|
|
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() { |
|
|
|
@Override |
|
|
|
public void onSuccess() { |
|
|
|
if (jd == 0) { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转正转", false, null); |
|
|
|
} else { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转正转", true, null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@Override |
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
} |
|
|
|
}); |
|
|
|
if (jd == 0) { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转正转", false, null); |
|
|
|
} else { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转正转", true, null); |
|
|
|
} |
|
|
|
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { |
|
|
|
isOnTouch = false; |
|
|
|
Log.e("鼠标", "松开: "); |
|
|
|
ExecuteTheRecipe.WritePLC("翻转反转", false, null); |
|
|
|
ExecuteTheRecipe.WritePLC("翻转正转", false, null); |
|
|
|
handler.sendEmptyMessageDelayed(2,100); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
@@ -600,24 +611,32 @@ public class Home1Fragment extends BaseFragment { |
|
|
|
NewToastUtil.getInstance().showToastError("PLC未准备就绪!!!","PLC not connected"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(!isOnTouch){ |
|
|
|
handler.removeMessages(2); |
|
|
|
isOnTouch = true; |
|
|
|
} |
|
|
|
int jd = (int) nifty_slider3.getValue(); |
|
|
|
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() { |
|
|
|
@Override |
|
|
|
public void onSuccess() { |
|
|
|
if (jd == 0) { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转反转", false, null); |
|
|
|
} else { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转反转", true, null); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
} |
|
|
|
}); |
|
|
|
if (jd == 0) { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转反转", false, null); |
|
|
|
} else { |
|
|
|
ExecuteTheRecipe.WritePLC("翻转反转", true, null); |
|
|
|
} |
|
|
|
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { |
|
|
|
isOnTouch = false; |
|
|
|
Log.e("鼠标", "松开: "); |
|
|
|
ExecuteTheRecipe.WritePLC("翻转正转", false, null); |
|
|
|
ExecuteTheRecipe.WritePLC("翻转反转", false, null); |
|
|
|
handler.sendEmptyMessageDelayed(2,100); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|