Browse Source

ALL改为all

tags/v1.0.0^2
林万龙 3 years ago
parent
commit
dad267be98
2 changed files with 19 additions and 1 deletions
  1. +10
    -1
      src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java
  2. +9
    -0
      src/main/java/com/telpo/dipperposition/service/impl/DipperAstTimeAsyncTaskServiceImpl.java

+ 10
- 1
src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java View File

@@ -217,6 +217,16 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS
astPosCmd += "70170000"; astPosCmd += "70170000";
astPosCmd += "A0860100"; astPosCmd += "A0860100";


log.info(astPosCmd);
String checkSum = HexConvert.makeChecksum(astPosCmd).toUpperCase();
StringBuffer astCheckSumBuf = new StringBuffer();
astCheckSumBuf.append(checkSum);
while (astCheckSumBuf.length()<4) {
astCheckSumBuf.insert(0,"0");
}
checkSum = astCheckSumBuf.toString();
log.info(checkSum);

byte[] astPosCmdBytes = HexConvert.hexStringToBytes(astPosCmd); byte[] astPosCmdBytes = HexConvert.hexStringToBytes(astPosCmd);
StringBuffer astPosCmdBuf = new StringBuffer(); StringBuffer astPosCmdBuf = new StringBuffer();
for(int i=0; i<astPosCmdBytes.length; i++) { for(int i=0; i<astPosCmdBytes.length; i++) {
@@ -227,7 +237,6 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS
astPosCmdBuf.append(s + " "); astPosCmdBuf.append(s + " ");
} }


String checkSum = HexConvert.makeChecksum(astPosCmd).toUpperCase();
return astPosCmdBuf.toString() + checkSum.substring(0,1) + " " + checkSum.substring(2,3); return astPosCmdBuf.toString() + checkSum.substring(0,1) + " " + checkSum.substring(2,3);


} }


+ 9
- 0
src/main/java/com/telpo/dipperposition/service/impl/DipperAstTimeAsyncTaskServiceImpl.java View File

@@ -94,7 +94,16 @@ public class DipperAstTimeAsyncTaskServiceImpl implements IDipperAstTimeAsyncTas
astTimeCmdBuf.append(s + " "); astTimeCmdBuf.append(s + " ");
} }


log.info(astTimeCmd);
String checkSum = HexConvert.makeChecksum(astTimeCmd).toUpperCase(); String checkSum = HexConvert.makeChecksum(astTimeCmd).toUpperCase();
StringBuffer astCheckSumBuf = new StringBuffer();
astCheckSumBuf.append(checkSum);
while (astCheckSumBuf.length()<4) {
astCheckSumBuf.insert(0,"0");
}
checkSum = astCheckSumBuf.toString();
log.info(checkSum);

return astTimeCmdBuf.toString() + checkSum.substring(0,1) + " " + checkSum.substring(2,3); return astTimeCmdBuf.toString() + checkSum.substring(0,1) + " " + checkSum.substring(2,3);
//String hexIn = astTimeCmd + HexConvert.makeChecksum(astTimeCmd); //String hexIn = astTimeCmd + HexConvert.makeChecksum(astTimeCmd);
//log.info("DipperAstTimeAsyncTaskServiceImpl 返回时间:" + hexIn); //log.info("DipperAstTimeAsyncTaskServiceImpl 返回时间:" + hexIn);


Loading…
Cancel
Save