From 49fe9c0799f711f6ed588e3614e1b3ae705a0b11 Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Thu, 21 Jan 2021 09:03:07 +0800 Subject: [PATCH] =?UTF-8?q?mongodb=E8=AE=BF=E9=97=AE=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DipperAstPosAsyncTaskServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java index b4f72e6..8de6387 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java @@ -181,6 +181,11 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS if (altLongValue < 0) { altLongValue = altLongValue + 4294967295L + 1; } + // 小端模式补码 + // FFFFFFFF - 439C3270 + 1= BC63CD90(补码) + lanLongValue = 4294967295L - lanLongValue + 1; + altLongValue = 4294967295L - altLongValue + 1; + // 数值换算举例(以经度举例。纬度、高度、位置精度换算方法一致): // (1)经度数值为 113.431,则换算方法如下: // 113.431/比例因子 = 1134310000(十进制) @@ -199,6 +204,8 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS // 10 00 表示长度为 16 // 70 32 9C 43 表示注入的辅助经度为 113.431 度 // D0 B2 CE 0D 表示注入的辅助纬度为 23.165 度 + // 70 17 00 00 表示注入的辅助高度为 60 米 + // 40 0D 03 00 表示注入的位置精度为 2000 米 // 00 2F 为校验和 // astTimeCmd 组装 @@ -206,6 +213,8 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS astTimeCmd += "1000"; astTimeCmd += HexConvert.encodeHEX(lanLongValue); astTimeCmd += HexConvert.encodeHEX(altLongValue); + astTimeCmd += "70170000"; + astTimeCmd += "400D0300"; return astTimeCmd + HexConvert.makeChecksum(astTimeCmd);