carcheck超声波

This commit is contained in:
lvyuankang 2025-03-27 15:36:57 +08:00
parent a75f8eb796
commit d5ddd183e4
2 changed files with 37 additions and 35 deletions

View File

@ -107,8 +107,8 @@ export const WarnFlagTipData = {
9: ['dianhuoVideo.wav', 'xihuoVideo.wav'], 9: ['dianhuoVideo.wav', 'xihuoVideo.wav'],
10: ['check31.wav'], 10: ['check31.wav'],
11: ['check30.wav'], 11: ['check30.wav'],
12: ['check28.wav'], 12: ['check29.wav'],
13: ['check29.wav'], 13: ['check28.wav'],
14: ['check11.wav'], 14: ['check11.wav'],
15: ['check12.wav'], 15: ['check12.wav'],
16: ['check13.wav'], 16: ['check13.wav'],

View File

@ -118,7 +118,7 @@ export default struct Index {
} }
// //
async carConfigurationInfoFn() { async carConfigurationInfoFn() {
const fileUtil = new FileUtil(this.context) const fileUtil = new FileUtil(this.context)
const checkListStr = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/carcheck.txt'); const checkListStr = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/carcheck.txt');
@ -243,8 +243,10 @@ export default struct Index {
this.warnFlag[26] = '2' this.warnFlag[26] = '2'
} }
} }
console.log('msgmsgmsg',msg)
if (that.index == 10 || that.index == 11 || that.index == 12 || that.index == 13) { if (that.index == 10 || that.index == 11 || that.index == 12 || that.index == 13) {
console.log('msgmsgmsg000',that.index,that.signArr[that.realNum[that.index]])
if (that.signArr[that.realNum[that.index]] != '1200') { if (that.signArr[that.realNum[that.index]] != '1200') {
that.warnFlag[that.index] = '2' that.warnFlag[that.index] = '2'
} else { } else {
@ -327,37 +329,37 @@ export default struct Index {
} }
initfackCheck(index){ initfackCheck(index){
const that=this const that=this
setTimeout(()=>{ setTimeout(()=>{
console.log('indexindex',index) console.log('indexindex',index)
if(index>=3){ if(index>=3){
this.getCheckList() this.getCheckList()
return return
} }
console.log('this.index',index,) console.log('this.index',index,)
that.passArray[index]=true that.passArray[index]=true
if(index==2){ if(index==2){
let flag=false let flag=false
console.log('globalThis.spzd[key]',globalThis.spzd) console.log('globalThis.spzd[key]',globalThis.spzd)
for(let key in globalThis.spzd){ for(let key in globalThis.spzd){
console.log('globalThis.spzd[key]',globalThis.spzd[key]) console.log('globalThis.spzd[key]',globalThis.spzd[key])
if(globalThis.spzd[key]){ if(globalThis.spzd[key]){
that.warnFlag[index]='1' that.warnFlag[index]='1'
flag=true flag=true
}
} }
if(!flag){ }
that.warnFlag[index]='2' if(!flag){
}
}else{
that.warnFlag[index]='2' that.warnFlag[index]='2'
} }
that.passArray=JSON.parse(JSON.stringify(that.passArray)) }else{
that.warnFlag=JSON.parse(JSON.stringify(that.warnFlag)) that.warnFlag[index]='2'
index++ }
this.initfackCheck(index) that.passArray=JSON.parse(JSON.stringify(that.passArray))
},1000) that.warnFlag=JSON.parse(JSON.stringify(that.warnFlag))
index++
this.initfackCheck(index)
},1000)
} }
async getCheckList() { async getCheckList() {
@ -475,14 +477,14 @@ export default struct Index {
} }
Row() { Row() {
Image(this.warnFlag[12] == '1' ? $r('app.media.zh_r') : this.warnFlag[12] == '2' ? $r('app.media.zh') : '') Image(this.warnFlag[13] == '1' ? $r('app.media.zh_r') : this.warnFlag[13] == '2' ? $r('app.media.zh') : '')
.width(103 * this.ratio)
.height(118.5 * this.ratio)
.visibility(this.passArray[12] ? Visibility.Visible : Visibility.Hidden)
Image(this.warnFlag[13] == '1' ? $r('app.media.yh_r') : this.warnFlag[13] == '2' ? $r('app.media.yh') : '')
.width(103 * this.ratio) .width(103 * this.ratio)
.height(118.5 * this.ratio) .height(118.5 * this.ratio)
.visibility(this.passArray[13] ? Visibility.Visible : Visibility.Hidden) .visibility(this.passArray[13] ? Visibility.Visible : Visibility.Hidden)
Image(this.warnFlag[12] == '1' ? $r('app.media.yh_r') : this.warnFlag[12] == '2' ? $r('app.media.yh') : '')
.width(103 * this.ratio)
.height(118.5 * this.ratio)
.visibility(this.passArray[12] ? Visibility.Visible : Visibility.Hidden)
} }
} }
.backgroundImage($r('app.media.rc')) .backgroundImage($r('app.media.rc'))