优化了部分代码
This commit is contained in:
parent
da6a85f02a
commit
e65c48f1eb
@ -1,5 +1,3 @@
|
|||||||
import UdpClient from '../common/utils/UdpClient';
|
|
||||||
import FileLog from './judgeSDK/utils/file-log';
|
|
||||||
import signDisplayCom from './compontents/signDisplayCom';
|
import signDisplayCom from './compontents/signDisplayCom';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ -7,50 +5,54 @@ import signDisplayCom from './compontents/signDisplayCom';
|
|||||||
export default struct Index {
|
export default struct Index {
|
||||||
@State signArr: Array<any> = []
|
@State signArr: Array<any> = []
|
||||||
@State sjxhColum: Array<any> = [
|
@State sjxhColum: Array<any> = [
|
||||||
{ key: '左方向灯', value: '0' }, { key: '右方向灯', value: '0' }, {
|
{ key: '左方向灯', value: '0' },
|
||||||
key: '喇叭',
|
{ key: '右方向灯', value: '0' },
|
||||||
value: '0'
|
{ key: '喇叭', value: '0' },
|
||||||
}, { key: '点火1', value: '0' }, { key: '点火2', value: '0' }, { key: '近光灯', value: '0' }, {
|
{ key: '点火1', value: '0' },
|
||||||
key: '远光灯',
|
{ key: '点火2', value: '0' },
|
||||||
value: '0'
|
{ key: '近光灯', value: '0' },
|
||||||
}, { key: '示廓灯', value: '0' }, { key: '雾灯', value: '0' }, { key: '雨刮器', value: '0' }, {
|
{ key: '远光灯', value: '0' },
|
||||||
key: '脚刹',
|
{ key: '示廓灯', value: '0' },
|
||||||
value: '0'
|
{ key: '雾灯', value: '0' },
|
||||||
}, { key: '手刹', value: '0' }, { key: '主驾驶门', value: '0' }, { key: '离合', value: '0' }, {
|
{ key: '雨刮器', value: '0' },
|
||||||
key: '副刹车',
|
{ key: '脚刹', value: '0' },
|
||||||
value: '0'
|
{ key: '手刹', value: '0' },
|
||||||
}, {
|
{ key: '主驾驶门', value: '0' },
|
||||||
key: '安全带',
|
{ key: '离合', value: '0' },
|
||||||
value: '0'
|
{ key: '副刹车', value: '0' },
|
||||||
}, { key: '双跳灯', value: '0' }, { key: '车速', value: '0' }, { key: '档位', value: '0' }, {
|
{ key: '安全带', value: '0' },
|
||||||
key: '超声波1',
|
{ key: '双跳灯', value: '0' },
|
||||||
value: '0'
|
{ key: '车速', value: '0' },
|
||||||
}, {
|
{ key: '档位', value: '0' },
|
||||||
key: '超声波2',
|
{ key: '超声波1', value: '0' },
|
||||||
value: '0'
|
{ key: '超声波2', value: '0' },
|
||||||
}, {
|
{ key: 'NC', value: '0' },
|
||||||
key: 'NC',
|
{ key: 'SA15', value: '0' },
|
||||||
value: '0'
|
{ key: '其他门', value: '0' },
|
||||||
}, { key: 'SA15', value: '0' }, { key: '其他门', value: '0' }, { key: '转速过高', value: '0' }, {
|
{ key: '转速过高', value: '0' },
|
||||||
key: '累计脉冲',
|
{ key: '累计脉冲', value: '0' },
|
||||||
value: '0'
|
{ key: '熄火次数', value: '0' },
|
||||||
}, { key: '熄火次数', value: '0' }, { key: '发动机转速', value: '0' }, { key: '方向盘角度', value: '0' }, {
|
{ key: '发动机转速', value: '0' },
|
||||||
key: '超声波3',
|
{ key: '方向盘角度', value: '0' },
|
||||||
value: '0'
|
{ key: '超声波3', value: '0' },
|
||||||
}, { key: '超声波4', value: '0' }, { key: '触摸1', value: '0' }, { key: '触摸2', value: '0' }, {
|
{ key: '超声波4', value: '0' },
|
||||||
key: '触摸3',
|
{ key: '触摸1', value: '0' },
|
||||||
value: '0'
|
{ key: '触摸2', value: '0' },
|
||||||
}, { key: 'SCIO', value: '0' }
|
{ key: '触摸3', value: '0' },
|
||||||
, { key: 'SC1A_C', value: '0' }, { key: 'SC1B_C', value: '0' }, { key: 'SC2A_C', value: '0' }, {
|
{ key: 'SCIO', value: '0' },
|
||||||
key: 'SC2B_C',
|
{ key: 'SC1A_C', value: '0' },
|
||||||
value: '0'
|
{ key: 'SC1B_C', value: '0' },
|
||||||
}, { key: 'SC3A_C', value: '0' }, { key: 'SC3B_C', value: '0' }, { key: 'SC4A_C', value: '0' }, {
|
{ key: 'SC2A_C', value: '0' },
|
||||||
key: 'SC4B_C',
|
{ key: 'SC2B_C', value: '0' },
|
||||||
value: '0'
|
{ key: 'SC3A_C', value: '0' },
|
||||||
}, { key: 'SC5A_C', value: '0' }, { key: 'SC5B_C', value: '0' }, { key: 'SC6A_C', value: '0' }, {
|
{ key: 'SC3B_C', value: '0' },
|
||||||
key: 'SC6B_C',
|
{ key: 'SC4A_C', value: '0' },
|
||||||
value: '0'
|
{ key: 'SC4B_C', value: '0' },
|
||||||
}]
|
{ key: 'SC5A_C', value: '0' },
|
||||||
|
{ key: 'SC5B_C', value: '0' },
|
||||||
|
{ key: 'SC6A_C', value: '0' },
|
||||||
|
{ key: 'SC6B_C', value: '0' }
|
||||||
|
];
|
||||||
@State GPSColum: Array<any> = [
|
@State GPSColum: Array<any> = [
|
||||||
{ key: '状态', value: '0' },
|
{ key: '状态', value: '0' },
|
||||||
{ key: '收星数', value: '0' },
|
{ key: '收星数', value: '0' },
|
||||||
@ -74,10 +76,6 @@ export default struct Index {
|
|||||||
@State msg: string = ''
|
@State msg: string = ''
|
||||||
@State @Watch('outClick') outFlag: boolean = false;
|
@State @Watch('outClick') outFlag: boolean = false;
|
||||||
@State url: string = ''
|
@State url: string = ''
|
||||||
private timer = null
|
|
||||||
private udpClient: UdpClient = null
|
|
||||||
private FileLog: FileLog
|
|
||||||
private vocObj = null;
|
|
||||||
|
|
||||||
// @State gpsList: Array<any> = []
|
// @State gpsList: Array<any> = []
|
||||||
build() {
|
build() {
|
||||||
|
|||||||
@ -1,14 +1,10 @@
|
|||||||
|
import TopLogo from './compontents/topLogo';
|
||||||
import router from '@ohos.router'
|
|
||||||
import TopLogo from './compontents/topLogo'
|
|
||||||
import ethernet from '@ohos.net.ethernet';
|
import ethernet from '@ohos.net.ethernet';
|
||||||
import prompt from '@ohos.prompt'
|
import prompt from '@ohos.prompt';
|
||||||
import { upDateTableByArray} from '../common/service/initable'
|
import { getSyncData, upDateTableByArray } from '../common/service/initable';
|
||||||
import { getSyncData} from '../common/service/initable'
|
import { getUDP, getUDP2 } from '../common/utils/GlobalUdp';
|
||||||
import { voiceService } from '../common/service/voiceService'
|
import { getTCP } from '../common/utils/GlobalTcp';
|
||||||
import { GlobalConfig } from '../config/index'
|
|
||||||
import { getUDP, getUDP2 } from '../common/utils/GlobleUdp';
|
|
||||||
import { getTCP } from '../common/utils/GlobleTcp';
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
struct Index {
|
struct Index {
|
||||||
@ -29,11 +25,10 @@ struct Index {
|
|||||||
// @State inputTextList2: string[] = ['192.168.36.139','20022']
|
// @State inputTextList2: string[] = ['192.168.36.139','20022']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@State @Watch('outClick') outFlag: boolean = false;
|
@State @Watch('outClick') outFlag: boolean = false;
|
||||||
private vocObj = null;
|
|
||||||
scroller: Scroller = new Scroller()
|
scroller: Scroller = new Scroller()
|
||||||
|
private vocObj = null;
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
TopLogo({ outFlag: $outFlag })
|
TopLogo({ outFlag: $outFlag })
|
||||||
@ -61,7 +56,8 @@ struct Index {
|
|||||||
.linearGradient({
|
.linearGradient({
|
||||||
angle: 0,
|
angle: 0,
|
||||||
colors: [[0x403C36, 0.0], [0x4D473D, 0.34], [0x3D3A34, 1.0]]
|
colors: [[0x403C36, 0.0], [0x4D473D, 0.34], [0x3D3A34, 1.0]]
|
||||||
}).onChange((value: string) => {
|
})
|
||||||
|
.onChange((value: string) => {
|
||||||
this.inputTextList1[index] = value
|
this.inputTextList1[index] = value
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -81,9 +77,24 @@ struct Index {
|
|||||||
.width('100%')
|
.width('100%')
|
||||||
.height('80%')
|
.height('80%')
|
||||||
.borderRadius('25px')
|
.borderRadius('25px')
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
Image($r('app.media.terminal_save')).width('20.5%').height('74%').onClick(() => {
|
Image($r('app.media.terminal_save')).width('20.5%').height('74%').onClick(() => {
|
||||||
upDateTableByArray('IpConfigTable',[{udplocalIp:this.inputTextList1[9],udplocalIpPort:this.inputTextList1[10],udpOppositeIp:this.inputTextList1[7],udpOppositeIpPort:this.inputTextList1[8],tcplocalIp:this.inputTextList1[9],tcplocalIpPort:'8088',tcpOppositeIp:this.inputTextList1[0],tcpOppositePort:this.inputTextList1[1],netMask:this.inputTextList1[4],gateway:this.inputTextList1[5],dnsServers:this.inputTextList1[6],centerIp:this.inputTextList1[2],centerPort:this.inputTextList1[3]}])
|
upDateTableByArray('IpConfigTable', [{
|
||||||
|
udplocalIp: this.inputTextList1[9],
|
||||||
|
udplocalIpPort: this.inputTextList1[10],
|
||||||
|
udpOppositeIp: this.inputTextList1[7],
|
||||||
|
udpOppositeIpPort: this.inputTextList1[8],
|
||||||
|
tcplocalIp: this.inputTextList1[9],
|
||||||
|
tcplocalIpPort: '8088',
|
||||||
|
tcpOppositeIp: this.inputTextList1[0],
|
||||||
|
tcpOppositePort: this.inputTextList1[1],
|
||||||
|
netMask: this.inputTextList1[4],
|
||||||
|
gateway: this.inputTextList1[5],
|
||||||
|
dnsServers: this.inputTextList1[6],
|
||||||
|
centerIp: this.inputTextList1[2],
|
||||||
|
centerPort: this.inputTextList1[3]
|
||||||
|
}])
|
||||||
ethernet.setIfaceConfig("eth0", {
|
ethernet.setIfaceConfig("eth0", {
|
||||||
mode: 0,
|
mode: 0,
|
||||||
ipAddr: this.inputTextList1[9],
|
ipAddr: this.inputTextList1[9],
|
||||||
@ -130,6 +141,7 @@ struct Index {
|
|||||||
.backgroundImage($r('app.media.index_bg'))
|
.backgroundImage($r('app.media.index_bg'))
|
||||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||||
}
|
}
|
||||||
|
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
getSyncData('IpConfigTable').then((result: Array<any>) => {
|
getSyncData('IpConfigTable').then((result: Array<any>) => {
|
||||||
console.log('result222', JSON.stringify(result))
|
console.log('result222', JSON.stringify(result))
|
||||||
@ -166,9 +178,11 @@ struct Index {
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onPageShow() {
|
onPageShow() {
|
||||||
console.info('Index onPageShow');
|
console.info('Index onPageShow');
|
||||||
}
|
}
|
||||||
|
|
||||||
outClick() {
|
outClick() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import USER from '../common/constants/USER';
|
|||||||
import { dateFormat, getCurrentTime, string2Bytes } from '../common/utils/tools';
|
import { dateFormat, getCurrentTime, string2Bytes } from '../common/utils/tools';
|
||||||
import MA_SYSSET from '../common//constants/MA_SYSSET';
|
import MA_SYSSET from '../common//constants/MA_SYSSET';
|
||||||
import FaceCompare from './compontents/FaceCompareByhaikang';
|
import FaceCompare from './compontents/FaceCompareByhaikang';
|
||||||
// import { initJudgeUdp } from '../common/utils/UdpJudge'
|
|
||||||
import { writeObjectOut } from '../api/judge';
|
import { writeObjectOut } from '../api/judge';
|
||||||
import testNapi from '@ohos.idcard';
|
import testNapi from '@ohos.idcard';
|
||||||
import common from '@ohos.app.ability.common';
|
import common from '@ohos.app.ability.common';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user