From 3fade2df2435acd53df909facaece5d91f964688 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Mon, 21 Oct 2024 09:34:27 +0800 Subject: [PATCH 1/8] =?UTF-8?q?tcp=20carno=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/utils/GlobalTcp.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entry/src/main/ets/common/utils/GlobalTcp.ts b/entry/src/main/ets/common/utils/GlobalTcp.ts index 5cf440f1..acc5a373 100644 --- a/entry/src/main/ets/common/utils/GlobalTcp.ts +++ b/entry/src/main/ets/common/utils/GlobalTcp.ts @@ -19,7 +19,7 @@ export async function getTCP() { setTimeout(async () => { await globalThis.TcpClient.rebindTcp(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort) await globalThis.TcpClient.connectTcp() - await globalThis.TcpClient.sendMsg('1002') //1002 + await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() @@ -27,7 +27,7 @@ export async function getTCP() { }) await globalThis.TcpClient.onMessage((val) => { setTimeout(() => { - globalThis.TcpClient.sendMsg('1002') //1002 + globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 if (val) { // const msg=val.substring(5,val.length-1) console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus()) @@ -45,7 +45,7 @@ export async function getTCP() { globalThis.TcpClient = tcpClient await globalThis.TcpClient.bindTcp() await globalThis.TcpClient.connectTcp() - await globalThis.TcpClient.sendMsg('1002') //1002 + await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() @@ -54,7 +54,7 @@ export async function getTCP() { await globalThis.TcpClient.onMessage((val) => { hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val)); setTimeout(() => { - globalThis.TcpClient.sendMsg('1002') //1002 + globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 if (val && globalThis.udpClient?.sendMsg) { globalThis.udpClient?.sendMsg(val) } From abdd7664d4bfaa0daf7761c6cda2d709bc873fde Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Wed, 30 Oct 2024 17:18:39 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=8F=8C=E4=B8=AD=E5=BF=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/service/initable.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entry/src/main/ets/common/service/initable.ts b/entry/src/main/ets/common/service/initable.ts index 29f647db..5a40f621 100644 --- a/entry/src/main/ets/common/service/initable.ts +++ b/entry/src/main/ets/common/service/initable.ts @@ -166,10 +166,10 @@ export async function getDataBaseTable(params, reqParam) { } if (params.tableName == 'MA_SYSSET') { res.body[params.tableName] = res.body[params.tableName].filter(res => { - return res['v_no'] >= 300 && res['v_no'] <= 700 + return res['v_no'] < 300 || res['v_no'] > 700 }) } - sqlInsertCommonFn(param.tableName, res.body[params.tableName]).then((val) => { + sqlInsertCommonFn(param.tableName, res.body[params.tableName],reqParam.context).then((val) => { reslove(val) }) }) @@ -245,7 +245,7 @@ export async function getMySystemSetTable(params, reqParam) { } if (params.tableName == 'MA_SYSSET') { res.body[params.tableName] = res.body[params.tableName].filter(res => { - return res['v_no'] < 300 || res['v_no'] > 700 + return res['v_no'] >= 300 && res['v_no'] <= 700 }) } sqlInsertCommonFn(params.tableName, res.body[params.tableName], reqParam.context, false).then((result) => { From 2d562dd3f7f1991e00b95f7fd137e2b82315584a Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Thu, 31 Oct 2024 08:14:43 +0800 Subject: [PATCH 3/8] 1 --- entry/src/main/ets/common/service/initable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entry/src/main/ets/common/service/initable.ts b/entry/src/main/ets/common/service/initable.ts index 5a40f621..ab398c03 100644 --- a/entry/src/main/ets/common/service/initable.ts +++ b/entry/src/main/ets/common/service/initable.ts @@ -90,7 +90,7 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) { console.log('teststet3',) // console.log('表长度',result.length,tableName) - if (result.length == 0) { + if (result.length == 0||!delFlag) { console.log('sqlsqlinsert',resultArr.length) if(resultArr.length==0){ resolve(true) @@ -100,7 +100,7 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) { + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES " resultArr.map((data, i) => { - data.id = `${i}` + data.id = !delFlag?`${i+result.length }`:`${i}` let str = '(' map[tableName].ACCOUNT_TABLE.columns.map((res, index) => { if (map[tableName].ACCOUNT_TABLE.columns.length - 1 == index) { From 8732b4f9ccf5a7cd7718282c01f393a315585df1 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Thu, 31 Oct 2024 15:59:47 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ets/pages/compontents/SignDisplayCom.ets | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 4e85bf27..2b394e88 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -20,6 +20,8 @@ export default struct SignDisplayCom { @State interval: number = 0 @State @Watch('outClick') outFlag: boolean = false; @State url: string = '' + @State date: string = '' + @State time: string = '' private timer = null private udpClient: UdpClient = null private FileLog: FileLog @@ -215,8 +217,8 @@ export default struct SignDisplayCom { .fontColor('#FFB433') .fontSize(14 * this.ratio) .height(18 * this.ratio) - Text('年月日:' + this.signArr[93]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('年月日:' + this.date).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('时分秒:' + this.time]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('速度:' + this.signArr[97]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) @@ -414,6 +416,16 @@ export default struct SignDisplayCom { this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) that.signArr = JSON.parse(JSON.stringify((this.signArr))) that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum))) + if(this.signArr.length){ + this.date=this.signArr[93].substr(4,2)+this.signArr[93].substr(2,2)+this.signArr[93].substr(0,2) + const hours=(Number(this.signArr[94].substr(0,2))+8).toString() + if(hours.length<2){ + this.time='0'+hours+this.signArr[93].substr(2,this.signArr[93].length) + }else{ + this.time=hours+this.signArr[93].substr(2,this.signArr[93].length) + } + + } outClick() { From 4ee1c95f3b8050fdbcab841c5911e3029b267777 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Fri, 1 Nov 2024 10:30:10 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 1 - .../ets/pages/compontents/SignDisplayCom.ets | 28 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index b95daba7..a53c2797 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -388,7 +388,6 @@ struct Index { console.log('globalThis.singlePlay', globalThis.singlePlay) if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) { this.context.resourceManager.getRawFileContent("welcome.wav").then(value => { - console.log('tttttttt') this.vocObj.playAudio({ type: 1, name: 'welcome.wav' diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 2b394e88..c7cbc606 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -4,6 +4,8 @@ import FileLog from '../judgeSDK/utils/fileLog'; import RealTime from '../compontents/judge/RealTime'; import { GPSData, SignalData } from '../../mock'; import { SignalDataType } from '../../model'; +// import { getSyncData } from '../../common/service/initable'; +import common from '@ohos.app.ability.common'; @Component export default struct SignDisplayCom { @@ -22,10 +24,13 @@ export default struct SignDisplayCom { @State url: string = '' @State date: string = '' @State time: string = '' + // @State sd: string = '' + @State param350Str: string = '' private timer = null private udpClient: UdpClient = null private FileLog: FileLog private vocObj = null; + private context = getContext(this) as common.UIAbilityContext; constructor() { super() @@ -168,7 +173,7 @@ export default struct SignDisplayCom { }.justifyContent(FlexAlign.Start).padding({ left: 10 * this.ratio }).margin({ top: 8 * this.ratio }) Row() { - Text("本机IP:" + this.signArr[53] || '0') + Text("后置机IP:" + this.signArr[53] || '0') .fontColor('#FFF5E5') .fontSize(14 * this.ratio) .width('25%') @@ -218,7 +223,7 @@ export default struct SignDisplayCom { .fontSize(14 * this.ratio) .height(18 * this.ratio) Text('年月日:' + this.date).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('时分秒:' + this.time]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('时分秒:' + this.time).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('速度:' + this.signArr[97]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) @@ -348,8 +353,6 @@ export default struct SignDisplayCom { } onPageShow() { - console.info('SURENJUN', 123) - const getSignal = this.getSignal; const that = this const showBack = this.showBack; @@ -416,15 +419,16 @@ export default struct SignDisplayCom { this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) that.signArr = JSON.parse(JSON.stringify((this.signArr))) that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum))) - if(this.signArr.length){ - this.date=this.signArr[93].substr(4,2)+this.signArr[93].substr(2,2)+this.signArr[93].substr(0,2) - const hours=(Number(this.signArr[94].substr(0,2))+8).toString() - if(hours.length<2){ - this.time='0'+hours+this.signArr[93].substr(2,this.signArr[93].length) - }else{ - this.time=hours+this.signArr[93].substr(2,this.signArr[93].length) + if(this.signArr.length) { + this.date = this.signArr[93].substr(4, 2) + this.signArr[93].substr(2, 2) + this.signArr[93].substr(0, 2) + const hours = (Number(this.signArr[94].substr(0, 2)) + 8).toString() + if (hours.length < 2) { + this.time = '0' + hours + this.signArr[93].substr(2, this.signArr[93].length) + } else { + this.time = hours + this.signArr[93].substr(2, this.signArr[93].length) } - + } + // this.sd=this.param350Str=='0'? this.signArr[97]: this.signArr[23] } From f68a521f8c2132e46765f167caa078ef4e1d4375 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Fri, 1 Nov 2024 13:37:14 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E9=80=9F=E5=BA=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/compontents/SignDisplayCom.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index c7cbc606..22d9c8b3 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -226,7 +226,7 @@ export default struct SignDisplayCom { Text('时分秒:' + this.time).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('速度:' + this.signArr[97]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('速度:' + (this.signArr[97]*1.852).toFixed(2)).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) } .backgroundColor('#1A1A1A') .width(170 * this.ratio) From 0140c2197cf01765f8e98f5bf2b6eff5fbe59867 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Fri, 1 Nov 2024 13:44:14 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E9=80=9F=E5=BA=A6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/compontents/SignDisplayCom.ets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 22d9c8b3..eddb8b63 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -226,7 +226,7 @@ export default struct SignDisplayCom { Text('时分秒:' + this.time).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('速度:' + (this.signArr[97]*1.852).toFixed(2)).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('速度:' + (Number(this.signArr[97])*1.852).toFixed(2)).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) } .backgroundColor('#1A1A1A') .width(170 * this.ratio) @@ -416,6 +416,7 @@ export default struct SignDisplayCom { this.GPSColum[t].value = this.signArr[i] t++ } + this.GPSColum[97].value= ((Number(this.GPSColum[97])*1.852).toFixed(2)).toString() this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) that.signArr = JSON.parse(JSON.stringify((this.signArr))) that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum))) From 64264506aa695a6fd923ff5c0596a941fbdfcafe Mon Sep 17 00:00:00 2001 From: surenjun Date: Wed, 6 Nov 2024 14:49:56 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat=EF=BC=9AfileLog=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/judgeSDK/utils/fileLog.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/entry/src/main/ets/pages/judgeSDK/utils/fileLog.ts b/entry/src/main/ets/pages/judgeSDK/utils/fileLog.ts index f804608a..a6b2881b 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/fileLog.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/fileLog.ts @@ -81,6 +81,17 @@ export default class FileLog { await fileUtil.editFile(`${folderPath}/judge_log_data.txt`,str); } + // 设置四合一画面数据 + public setFourAndOneLogData = async (str:string) => { + const {fileUtil,folderPath} = this; + await fileUtil.editFile(`${folderPath}/four_one_log_data.txt`,str); + } + + public setFourAndOneLogDataBytes = async (str:string) => { + const {fileUtil,folderPath} = this; + await fileUtil.editFile(`${folderPath}/four_one_log_byte_data.txt`,str); + } + // 无锡所轨迹数据 public setExamLineData = async (plcStr) => { const {fileUtil,folderPath} = this;