diff --git a/entry/src/main/ets/common/rearEndUnitsTool/tool/UdpByOne.ts b/entry/src/main/ets/common/rearEndUnitsTool/tool/UdpByOne.ts index 2a7eeebb..2dd9a61c 100644 --- a/entry/src/main/ets/common/rearEndUnitsTool/tool/UdpByOne.ts +++ b/entry/src/main/ets/common/rearEndUnitsTool/tool/UdpByOne.ts @@ -82,7 +82,6 @@ export default class UdpByOne { address: this.OppositeIp, port: parseInt(this.PLCOppositeIpPort), } - }) } @@ -119,6 +118,8 @@ export default class UdpByOne { public handleMsg() { let newMessage = PLCGPSData; if (this.GPSMsg) { + //let GPRMCMsgArr = GPRMCMatch ? GPRMCMatch === null || GPRMCMatch === void 0 ? void 0 : GPRMCMatch.split(",").slice(0, 14) : []; + let GPGGAMatch = this.GPSMsg.match(/\$GPGGA[^$]*/); let GPGGAMsgArr = GPGGAMatch ? GPGGAMatch[0]?.split(",").slice(0, 15) : []; // 使用正则提取$GPRMC消息 @@ -131,29 +132,33 @@ export default class UdpByOne { let PTNLMatch = this.GPSMsg.match(/\$PTNL[^$]*/); let PTNLMsgArr = PTNLMatch ? PTNLMatch[0].split(",")?.slice(0, 14) : []; + // 组合GPS数据 // 状态83 newMessage[83] = GPGGAMsgArr[6]; // 收星数84 newMessage[84] = GPGGAMsgArr[7]; // 海拔高85 - newMessage[80] = GPGGAMsgArr[9]; + newMessage[85] = GPGGAMsgArr[9]; // 高度差86 + newMessage[86] = GPGGAMsgArr[11]; // 龄期87 newMessage[87] = GPGGAMsgArr[13]; // 维度因子88 + newMessage[88] = GPGSTMsgArr[6]; // 经度因子89 + newMessage[89] = GPGSTMsgArr[7]; // 航向角90 newMessage[90] = PTNLMsgArr[3]; // 俯仰角91 newMessage[91] = PTNLMsgArr[5]; // 航向角状态-收星数92 - newMessage[92] = PTNLMsgArr[10] + '-' + PTNLMsgArr[12].split('*')[0]; + newMessage[92] = PTNLMsgArr[10] + '-' + (PTNLMsgArr[12] && PTNLMsgArr[12].split('*')[0]); // 年月日93 RMCMsgArr[9]为ddmmyy 日月年 转换为年月日 newMessage[93] = - GPRMCMsgArr[9].slice(0, 2) + GPRMCMsgArr[9].slice(2, 4) + GPRMCMsgArr[9].slice(4, 6); + GPRMCMsgArr[9] && (GPRMCMsgArr[9].slice(0, 2) + GPRMCMsgArr[9].slice(2, 4) + GPRMCMsgArr[9].slice(4, 6)); // 时分秒94 GPGGAMsgArr[1]为021126.00去掉小数点后的时间 - newMessage[94] = GPGGAMsgArr[1].replace(".", ""); + newMessage[94] = GPGGAMsgArr[1] && GPGGAMsgArr[1].replace(".", ""); // 经度95 newMessage[95] = GPGGAMsgArr[4]; // 纬度96 @@ -274,7 +279,7 @@ export default class UdpByOne { // 改正数数据长度*数据长度-基准站RTCM改正数类型 62 } return newMessage.map(i=>{ - return i === undefined?'':i + return i === undefined ? '' : i }).join(",") } diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index 3b8851c2..3c5f4b86 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -111,6 +111,7 @@ struct Index { FLAG: carInfo.flag, BK1: carInfo.bk1, BK2: carInfo.bk2, + X_MCH:carInfo.x_mch, }) console.info('surenjun =>carinfoArrr',JSON.stringify( this.carinfoArr)) } diff --git a/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts b/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts index f398950e..b953d198 100644 --- a/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts +++ b/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts @@ -73,6 +73,8 @@ export interface CARINFO { FLAG: string, BK1: string, BK2: string + //脉冲里程设置 + X_MCH: string } export interface MAPPOINT {