|
@@ -33,7 +33,7 @@ public class DebugPresenter extends BasePresenter<DebugView> {
|
|
|
"0", "0", "0", "0", "0",
|
|
|
"0", "0", "0", "0", "0",
|
|
|
"0", "0", "0", "0", "0",
|
|
|
- "0", "0"));
|
|
|
+ "0", "0","0","0"));
|
|
|
|
|
|
public void setDebugParameter(String name, ArrayList<String> results, ThreadPoolDebugParameter threadGetParameter1) {
|
|
|
if (name.equals("M311")) {
|
|
@@ -41,8 +41,6 @@ public class DebugPresenter extends BasePresenter<DebugView> {
|
|
|
threadGetParameter1.setReceive1(true);
|
|
|
threadGetParameter1.stopReadM311();
|
|
|
//参数19 D218
|
|
|
- threadGetParameter1.getValues().set(0, results.get(7));
|
|
|
- threadGetParameter1.getValues().set(1, results.get(8));
|
|
|
threadGetParameter1.getValues().set(2, results.get(9));
|
|
|
threadGetParameter1.getValues().set(3, results.get(11));
|
|
|
threadGetParameter1.getValues().set(4, results.get(12));
|
|
@@ -50,11 +48,25 @@ public class DebugPresenter extends BasePresenter<DebugView> {
|
|
|
threadGetParameter1.getValues().set(6, results.get(14));
|
|
|
LogUtil.d(TAG, "setDebugParameter: " + threadGetParameter1.getValues());
|
|
|
}
|
|
|
+ } else if (name.equals("M320")) {
|
|
|
+ if (!threadGetParameter1.isReceive2()) {
|
|
|
+ threadGetParameter1.setReceive2(true);
|
|
|
+ threadGetParameter1.stopReadM320();
|
|
|
+ //参数19 D218
|
|
|
+ threadGetParameter1.getValues().set(7, results.get(0));
|
|
|
+ threadGetParameter1.getValues().set(8, results.get(1));
|
|
|
+ threadGetParameter1.getValues().set(9, results.get(2));
|
|
|
+ threadGetParameter1.getValues().set(10, results.get(3));
|
|
|
+ threadGetParameter1.getValues().set(11, results.get(4));
|
|
|
+ threadGetParameter1.getValues().set(12, results.get(5));
|
|
|
+ LogUtil.d(TAG, "setDebugParameter: " + threadGetParameter1.getValues());
|
|
|
+ }
|
|
|
}
|
|
|
- if (threadGetParameter1.isReceive1()) {
|
|
|
+ if (threadGetParameter1.isReceive1() && threadGetParameter1.isReceive2()) {
|
|
|
mvpView.getDataSuccess();
|
|
|
mvpView.hideLoading();
|
|
|
threadGetParameter1.setReceive1(false);
|
|
|
+ threadGetParameter1.setReceive2(false);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -62,7 +74,9 @@ public class DebugPresenter extends BasePresenter<DebugView> {
|
|
|
//通过校验
|
|
|
int id = messageEvent.getId();
|
|
|
String name = messageEvent.getName();
|
|
|
- if (id == 311) {
|
|
|
+ if (id == 1411) {
|
|
|
+ // 不需要读取数据。
|
|
|
+ } else if (id == 320) {
|
|
|
Log.d(TAG, "event: " + name);
|
|
|
ArrayList<String> results = HexadecimalUtil.flipString(result);
|
|
|
// 转成2进制
|
|
@@ -73,6 +87,20 @@ public class DebugPresenter extends BasePresenter<DebugView> {
|
|
|
ArrayList<String> list = new ArrayList(lis);
|
|
|
list.remove(0);
|
|
|
setDebugParameter(name, list, poolDebugParameter);
|
|
|
+ } else if (id == 311) {
|
|
|
+ Log.d(TAG, "event: " + name);
|
|
|
+ ArrayList<String> results = HexadecimalUtil.flipString(result);
|
|
|
+ // 转成2进制
|
|
|
+ String s = HexadecimalUtil.hexStringToByte(result);
|
|
|
+ //翻转后的数据
|
|
|
+ String s1 = HexadecimalUtil.flipString(s, 8);
|
|
|
+ List<String> lis = Arrays.asList(s1.split(""));
|
|
|
+ ArrayList<String> list = new ArrayList(lis);
|
|
|
+ list.remove(0);
|
|
|
+ for (String s2 : list) {
|
|
|
+ Log.d(TAG, "311setData: " + s2);
|
|
|
+ }
|
|
|
+ setDebugParameter(name, list, poolDebugParameter);
|
|
|
|
|
|
} else if (id == 1 || id == 2) {
|
|
|
List<String> strList = HexadecimalUtil.getStrList(result, 4);
|
|
@@ -88,28 +116,30 @@ public class DebugPresenter extends BasePresenter<DebugView> {
|
|
|
List<String> list1 = Arrays.asList(sb.toString().split(""));
|
|
|
ArrayList<String> list2 = new ArrayList(list1);
|
|
|
list2.remove(0);
|
|
|
+ for (String s : list2) {
|
|
|
+ Log.d(TAG, "list2setData: "+s);
|
|
|
+ }
|
|
|
if ("X0".equals(name)) {
|
|
|
- listX.set(0, list2.get(2));
|
|
|
- listX.set(1, list2.get(3));
|
|
|
- listX.set(2, list2.get(4));
|
|
|
- listX.set(3, list2.get(5));
|
|
|
- listX.set(4, list2.get(7));
|
|
|
- listX.set(5, list2.get(8));
|
|
|
- listX.set(6, list2.get(9));
|
|
|
- listX.set(7, list2.get(10));
|
|
|
- listX.set(8, list2.get(11));
|
|
|
- listX.set(9, list2.get(12));
|
|
|
- listX.set(10, list2.get(13));
|
|
|
- listX.set(11, list2.get(14));
|
|
|
- listX.set(12, list2.get(15));
|
|
|
- listX.set(13, list2.get(16));
|
|
|
- listX.set(14, list2.get(17));
|
|
|
- listX.set(15, list2.get(18));
|
|
|
- listX.set(16, list2.get(19));
|
|
|
- listX.set(17, list2.get(20));
|
|
|
- listX.set(18, list2.get(21));
|
|
|
- listX.set(19, list2.get(22));
|
|
|
- listX.set(20, list2.get(23));
|
|
|
+ listX.set(0, list2.get(3));
|
|
|
+ listX.set(1, list2.get(4));
|
|
|
+ listX.set(2, list2.get(5));
|
|
|
+ listX.set(3, list2.get(7));
|
|
|
+ listX.set(4, list2.get(8));
|
|
|
+ listX.set(5, list2.get(9));
|
|
|
+ listX.set(6, list2.get(10));
|
|
|
+ listX.set(7, list2.get(11));
|
|
|
+ listX.set(8, list2.get(12));
|
|
|
+ listX.set(9, list2.get(13));
|
|
|
+ listX.set(10, list2.get(14));
|
|
|
+ listX.set(11, list2.get(15));
|
|
|
+ listX.set(12, list2.get(16));
|
|
|
+ listX.set(13, list2.get(17));
|
|
|
+ listX.set(14, list2.get(18));
|
|
|
+ listX.set(15, list2.get(19));
|
|
|
+ listX.set(16, list2.get(20));
|
|
|
+ listX.set(17, list2.get(21));
|
|
|
+ listX.set(18, list2.get(22));
|
|
|
+ listX.set(19, list2.get(23));
|
|
|
mvpView.setXStatu(listX);
|
|
|
} else if ("Y0".equals(name)) {
|
|
|
listY.set(0, list2.get(0));
|
|
@@ -134,10 +164,12 @@ public class DebugPresenter extends BasePresenter<DebugView> {
|
|
|
listY.set(19, list2.get(19));
|
|
|
listY.set(20, list2.get(20));
|
|
|
listY.set(21, list2.get(21));
|
|
|
+ listY.set(22, list2.get(22));
|
|
|
+ listY.set(23, list2.get(23));
|
|
|
mvpView.setYStatu(listY);
|
|
|
Log.d(TAG, list2.size() + "setYStatu: " + list2);
|
|
|
}
|
|
|
mvpView.hideLoading();
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|