lv #16

Merged
wangzhongjie merged 14 commits from lv into main 2024-06-04 16:16:59 +08:00
17 changed files with 103 additions and 286 deletions
Showing only changes of commit 168a2f5eac - Show all commits

View File

@ -4,13 +4,13 @@
{
"name": "default",
"material": {
"certpath": "/Users/surenjun/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.cer",
"storePassword": "0000001B0C5B52D8C8C6F415D4216EAD2848AA4A376B36FD72006E4072C15BA3D11E6E65C0D1FFA92A6D86",
"certpath": "C:\\Users\\lvyuankang\\.ohos\\config\\openharmony\\auto_ohos_default_subject-two_com.oh.dts.cer",
"storePassword": "00000019D92C7CDCC6FC0B360DC78BB6597770355E0E9BA7057FB08232B3169B719F8B43FE52F5A6D5",
"keyAlias": "debugKey",
"keyPassword": "0000001B8DCA3C8913C86858A0CDEAEB6BEE0DC29FCE9932930CA1FFE68FFF84341736AADF81F056CDD683",
"profile": "/Users/surenjun/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p7b",
"keyPassword": "000000195EB18D1B848934488E0ED4C0FB63DBF4560DAF395E4960ABBC91B27DF741AD5E9EC9808856",
"profile": "C:\\Users\\lvyuankang\\.ohos\\config\\openharmony\\auto_ohos_default_subject-two_com.oh.dts.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/Users/surenjun/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p12"
"storeFile": "C:\\Users\\lvyuankang\\.ohos\\config\\openharmony\\auto_ohos_default_subject-two_com.oh.dts.p12"
}
}
],

View File

@ -1 +0,0 @@
../../@ohos+hypium@1.0.6/oh_modules/@ohos/hypium

View File

@ -1 +0,0 @@
../.ohpm/@ohos+hypium@1.0.6/oh_modules/@ohos/hypium

View File

@ -261,14 +261,6 @@ let fd
const devPath="/dev/ttyS3"
function openChuankouFn(callback) {
console.log('SerialOpen in indexservice, path=' + devPath)
// fd = testNapi.SerialOpen(devPath);
// globalThis.num=0
// globalThis.fd=fd
// console.log('fdfd1111',globalThis.fd)
//
// let parity = 0x4e; // 'N'
// let ret = testNapi.SerialSet(globalThis.fd, 115200, 0, 8, 1, parity);
testNapi.SerialOpenAsync(devPath, (fd)=> {
globalThis.fd = fd;

View File

@ -7,12 +7,7 @@ import { getSyncData } from '../../common/service/initable'
//获取设备信息
export async function getDeviceInfo() {
globalThis.deviceNo = 'HM-AC76'; //科目三设备
// globalThis.deviceNo = 'J43405J003101'; //科目二设备
// globalThis.deviceNo = '00-E2-69-0A-9F-6E'; //设备mac
// // globalThis.deviceNo = 'FE-FC-FE-7C-5C-77'; //设备mac
// globalThis.diskId = '1231231231'; //硬盘号
// globalThis.hasAuth = true;
// // return null
return new Promise((resolve, reject) => {
getSyncData('DeviceInfoTable').then((result: Array<any>) => {
if (result.length) {

View File

@ -12,17 +12,8 @@ export async function timeSynchronize() {
res = res.timeSynchronizationRsp;
globalThis.timeInfo=res.body
// globalThis.timeInfo.url='http://112.80.35.83:11054/der2/services'
// globalThis.timeInfo.url='http://112.80.35.83:11054/der2/services'
console.info('jiangsong1:timeSynchronization '+ JSON.stringify(res) );
// {"timeSynchronizationRsp":
// {"head":
// {"resultCode":"0","resultMessage":"%E6%97%B6%E9%97%B4%E5%90%8C%E6%AD%A5%E6%8E%A5%E5%8F%A3-%E6%88%90%E5%8A%9F","time":"2023-03-07 11:08:09"},
// "body":
// {"carid":"1003","kdid":"2","ksdd":"6224J252","mode":"3","paraKdid":"122","url":"http://192.168.32.167:8084/der2/services"}
// }
// }
return res;
}

View File

@ -108,15 +108,7 @@ export async function takePhoto(param, context,dir,flag=1,callback?) {
console.log("baohaowen_detectLoop round end size1:"+snapResult.fileSize);
callback({fileSize:snapResult.fileSize })
});
// rtsp_server.getVideoSnapshot(context, video_uri, fileName,dir,false,(err,snapResult)=>{
// console.log(`baoyihu getVideoSnapshot return `);
// console.log(`baoyihu getVideoSnapshot file_name` + snapResult.fileName);
// console.log(`baoyihu getVideoSnapshot file_path` + snapResult.filePath);
// console.log(`baoyihu getVideoSnapshot fileSize` + snapResult.fileSize);
// fileHelper.addFile(fileName,1)
// callback({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize })
// console.log('getmyLog01')
// });
}
else{
return new Promise<takePhotoParam>((resolve,reject)=>{
@ -183,37 +175,3 @@ export async function deleteAllVideos(context,type: photoAccessHelper.AlbumType,
}
}
}
// export async function takePhoto(param, context, type = 0, dir) {
// return new Promise((reslove, reject) => {
// console.log('mmmmmmmttt,04', type)
//
// // const rtsp_server = record.createServer();
// var video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${param.pztd}/main/av_stream`;
// // var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, dir);
// // console.log(`baoyihu Rtsprecord getVideoSnapshot file` + snapResult.dataString);
//
// console.log(`baoyihu Rtsprecord getVideoSnapshot begin`);
// // const num = Math.floor(Math.random() * 10000)
// console.log('mmmmmmmttt,05', video_uri)
//
// const num = Math.floor(Math.random() * 10000)
// const fileName = `picture_record${num}.jpg`
// console.log(`baoyihu Rtsprecord baohaowen getVideoSnapshot fileName` + fileName);
// // @ts-ignore
// var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, fileName, dir, (ret) => {
// const str = ret.dataString
// if (type == 1) {
// console.log('mmmmmmmttt',str.length)
// reslove(str)
// } else {
// reslove('')
// }
// })
// // console.log('mmmmmmmttt,06',snapResult.dataString)
//
// // console.log(`baoyihu Rtsprecord getVideoSnapshot file` + snapResult.fileName);
// // console.log(`baoyihu Rtsprecord getVideoSnapshot dataLen` + snapResult.dataString.length);
// // console.log('datadata1',snapResult.dataString.length)
// })
//
// }

View File

@ -12,9 +12,6 @@ export async function getUDP(flag?) {
getSyncData('IpConfigTable').then((result:Array<any>)=>{
if(result.length){
if(globalThis.udpClient&&globalThis.udpClient.closeUdp){
if(!flag){
return
}
globalThis.udpClient.closeUdp(()=>{
setTimeout(()=>{
globalThis.udpClient.rebindUdp(result[0].udplocalIp, result[0].udplocalIpPort,result[0].udpOppositeIp,result[0].udpOppositeIpPort)

View File

@ -41,9 +41,9 @@ export default class EntryAbility extends UIAbility {
const windowClass = await windowStage.getMainWindow();
globalThis.windowClass = windowClass
await windowClass.setWindowLayoutFullScreen(true)
// await windowClass.setWindowLayoutFullScreen(true)
await windowClass.setWindowSystemBarEnable([]) //全屏
// await windowClass.setWindowSystemBarEnable(['navigation'])
await windowClass.setWindowSystemBarEnable(['navigation'])
windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) {

View File

@ -254,4 +254,28 @@ export const EmptyCandidateObject = {
xh: '',
xldm: '',
yycs: ''
}
export const VideoConfig={
spls: '',
faceFlag: false,
pztd: '2',
ljlx: '',
ip: '192.168.7.112',
port: '554',
userName: 'admin',
pwd: '12345qwe',
td1: '1',
td2: '2',
td3: '3',
td4: '4',
videoRecord1: false,
videoRecord2: false,
videoRecord3: false,
videoRecord4: false,
rlls: '1',
spzd4:false,
spzd3:false,
spzd2:false,
spzd1:false,
zdyz:'500'
}

View File

@ -212,17 +212,7 @@ struct Index {
});
this.carConfigurationInfoFn()
// //todo串口
// this.openChuankouFn()
// // this.getChuankouFn()
//
// this.interval=setInterval(()=>{
// const dwArr=[14,15,16,17,18,19,20]
// // if(dwArr.indexOf(this.index)>=0&&!this.stopFlag){
// this.getChuankouFn()
// return
// // }
// },1000)
}
openChuankouFn() {
@ -275,47 +265,47 @@ struct Index {
}
//
carConfigurationInfoFn() {
if (globalThis.singlePlay) {
//
const str = "1:5;2:5;3:5;4:5;5:5;6:5;7:5;8:5;9:5;10:5;11:5;12:5;13:5;14:5;15:5;16:5;17:5;18:5;19:5;20:5;21:5;22:2;23:5;24:5;25:5;"
const data = str.split(';')
this.checkList = []
const list = data
list.map(res => {
const arr = res.split(':')
this.checkList.push({
'key': parseInt(arr[0]) + 2, 'time': arr[1]
})
if (globalThis.singlePlay) {
//
const str = "1:5;2:5;3:5;4:5;5:5;6:5;7:5;8:5;9:5;10:5;11:5;12:5;13:5;14:5;15:5;16:5;17:5;18:5;19:5;20:5;21:5;22:2;23:5;24:5;25:5;"
const data = str.split(';')
this.checkList = []
const list = data
list.map(res => {
const arr = res.split(':')
this.checkList.push({
'key': parseInt(arr[0]) + 2, 'time': arr[1]
})
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
return
}
//模拟真实数据
const param = {
"body":
{
"carIdString": globalThis.carInfo.carId, //考车ID
"deviceNo": globalThis.deviceNo
}
}
carConfigurationInfo(param).then(res => {
const data = res.body.ES_CHECK_CAR_ITEM[0].ITEMS.split(';')
this.checkList = []
const list = data
list.map(res => {
const arr = res.split(':')
this.checkList.push({
'key': parseInt(arr[0]) + 2, 'time': arr[1]
})
})
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
// this.checkList = JSON.parse(res).body.ES_CHECK_CAR_ITEM[0].split(';')
console.log('this.checkList' + this.checkList)
}).catch((error) => {
console.log('error12error' + error)
})
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
return
}
//模拟真实数据
const param = {
"body":
{
"carIdString": globalThis.carInfo.carId, //考车ID
"deviceNo": globalThis.deviceNo
}
}
carConfigurationInfo(param).then(res => {
const data = res.body.ES_CHECK_CAR_ITEM[0].ITEMS.split(';')
this.checkList = []
const list = data
list.map(res => {
const arr = res.split(':')
this.checkList.push({
'key': parseInt(arr[0]) + 2, 'time': arr[1]
})
})
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
// this.checkList = JSON.parse(res).body.ES_CHECK_CAR_ITEM[0].split(';')
console.log('this.checkList' + this.checkList)
}).catch((error) => {
console.log('error12error' + error)
})
}
async kszj() {
this.breakFlag = true

View File

@ -33,38 +33,6 @@ struct Index {
@State loading: boolean = true
@State fd: number = -1;
private context = getContext(this) as common.UIAbilityContext;
@State param: VideoConfig = {
videoNum:'1',
spls: '1',
wz: '0,0',
faceFlag: false,
shuiying: true,
pztd: '2',
ljlx: '',
ip: '192.168.36.94',
port: '554',
userName: 'admin',
pwd: '12345qwe',
td1: '1',
td2: '2',
td3: '3',
td4: '4',
videoRecord1: false,
videoRecord2: true,
videoRecord3: false,
videoRecord4: false,
text1: '',
text2: '',
text3: '',
dolt: '',
fontSize: '',
rlls: '1',
spzd4:false,
spzd3:false,
spzd2:false,
spzd1:false,
zdyz:'5',
}
fileHelper =null;
build() {
Column() {
@ -241,26 +209,26 @@ struct Index {
this.loading = false
this.createAlbum()
this.userAuth();
//初始化PLCudp
getUDP()
//中心udp初始化
getUDP2()
clearInterval(this.interval)
this.interval=setInterval(() => {
// setliushuiNum()
setliushuiNum()
getliushuiNum()
this.heartMsg()
}, 1000)
// takePhotoFn(this.context)
takePhotoFn(this.context)
//
//差分转发如果从tcp转发则需要从后置机则可以注释
getTCP()
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
globalThis.singlePlay = false
}
this.isSingle = globalThis.singlePlay
console.info('Index onPageShow');
}
@ -268,7 +236,6 @@ struct Index {
this.fileHelper = new FileHelper();
this.fileHelper.createAlbum('jt')
this.fileHelper.createAlbum('pz');
}
userAuth() {
const permissions: Array<Permissions> = ["ohos.permission.READ_IMAGEVIDEO", "ohos.permission.DISTRIBUTED_DATASYNC" ,'ohos.permission.CONNECTIVITY_INTERNAL','ohos.permission.CAMERA','ohos.permission.READ_MEDIA','ohos.permission.WRITE_MEDIA','ohos.permission.FILE_ACCESS_MANAGER'];

View File

@ -134,7 +134,7 @@ struct Index {
this.manualMarkRules.push(tempObj)
}
this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
...tempObj,
...tempObj,
markserial: mark.markserial,
};
})
@ -376,10 +376,10 @@ struct Index {
pointItemPoints.forEach(itemPoint => {
const {point_no,itemno,itemno1,subname} = itemPoint
this.mapPointItemArr.push({
point_no:point_no * 1,
itemno:itemno * 1,
itemno1:itemno1 * 1,
subname
point_no:point_no * 1,
itemno:itemno * 1,
itemno1:itemno1 * 1,
subname
})
})
}
@ -502,11 +502,11 @@ struct Index {
})
}.padding({left:15,right:15,top:30,bottom:5})
}
.backgroundImage($rawfile('judge/score_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width(514)
.height(618)
.padding({ top: 18, bottom: 15, left: 13, right: 14 })
.backgroundImage($rawfile('judge/score_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width(514)
.height(618)
.padding({ top: 18, bottom: 15, left: 13, right: 14 })
//科目二
if(this.examSubject == 2){
@ -620,10 +620,10 @@ struct Index {
Row(){}.width(60).height(60).backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' })
Text('人工评判').fontColor('#FFF').fontSize(32).padding({right:12})
}.width(334).height(110).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center)
.backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({bottom:10})
.onClick(()=>{
.backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({bottom:10})
.onClick(()=>{
if(this.judgeConfigObj['342'] == 0){
this.isDeductedPopShow = true
}else{

View File

@ -1,12 +1,9 @@
import router from '@ohos.router'
import TopLogo from './compontents/topLogo'
import ethernet from '@ohos.net.ethernet';
import prompt from '@ohos.prompt'
import { upDateTableByArray} from '../common/service/initable'
import { getSyncData} from '../common/service/initable'
import { voiceService } from '../common/service/voiceService'
import { GlobalConfig } from '../config/index'
import { getUDP, getUDP2 } from '../common/utils/GlobleUdp';
import { getTCP } from '../common/utils/GlobleTcp';
@Entry
@ -91,7 +88,7 @@ struct Index {
gateway: this.inputTextList1[5],//value.gateway网关
netMask: this.inputTextList1[4],//value.netMask网络掩码
dnsServers: this.inputTextList1[6],
// domain: ""
domain: ""
}, (error) => {
if (error) {
prompt.showToast({
@ -105,9 +102,6 @@ struct Index {
});
}
});
getUDP(true)
getUDP2(true)
getTCP(true)
})
}
.backgroundColor('#CCC4B8')
@ -130,6 +124,11 @@ struct Index {
.backgroundImage($r('app.media.index_bg'))
.backgroundImageSize({ width: '100%', height: '100%' })
}
aboutToDisappear() {
getUDP(true)
getUDP2(true)
getTCP(true)
}
aboutToAppear() {
getSyncData('IpConfigTable').then((result:Array<any>)=>{
console.log('result222',JSON.stringify(result))

View File

@ -11,7 +11,7 @@ import FaceCompare from './compontents/faceCompareByhaikang'
import { writeObjectOut } from '../api/judge'
import testNapi from "@ohos.idcard";
import common from '@ohos.app.ability.common';
import { VideoConfig, User } from './interfaces'
import { User } from './interfaces'
import WebRTCVoice from './webRTC/'
import promptAction from '@ohos.promptAction'
import { CandidateData, EmptyCandidateObject } from "../mock/CandidateData"
@ -38,30 +38,6 @@ struct UserInfo {
@State currentUser: User = EmptyCandidateObject
@State dataList: Array<User> = []
@State list: Array<User> = []
@State param: VideoConfig = {
spls: '',
faceFlag: false,
pztd: '2',
ljlx: '',
ip: '192.168.7.112',
port: '554',
userName: 'admin',
pwd: '12345qwe',
td1: '1',
td2: '2',
td3: '3',
td4: '4',
videoRecord1: false,
videoRecord2: false,
videoRecord3: false,
videoRecord4: false,
rlls: '1',
spzd4:false,
spzd3:false,
spzd2:false,
spzd1:false,
zdyz:'500'
}
private AccountTable = new AccountTable(() => {
}, USER);
private context = getContext(this) as common.UIAbilityContext;

View File

@ -13,7 +13,7 @@ import { takePhoto } from '../../common/service/videoService'
import { GlobalConfig } from '../../config/index'
@Component
struct FaceCompare {
export default struct FaceCompare {
constructor() {
super()
}
@ -350,4 +350,3 @@ struct FaceCompare {
}
}
export default FaceCompare

View File

@ -5,7 +5,7 @@ import { voiceService } from '../../common/service/voiceService'
import prompt from '@ohos.prompt'
import RealTime from '../compontents/judge/real-time'
@Component
struct SignDisplayCom {
export default struct SignDisplayCom {
constructor() {
super()
}
@ -88,11 +88,9 @@ struct SignDisplayCom {
private FileLog: FileLog
private vocObj = null;
@State url: string = ''
// @State gpsList: Array<any> = []
build() {
Column(){
Column() {
// TopLogo({outFlag:$outFlag})
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Row() {
Image($r('app.media.signal_logoS')).width(30 * this.ratio).height(24 * this.ratio)
@ -106,10 +104,7 @@ struct SignDisplayCom {
.justifyContent(FlexAlign.Center)
.onClick(() => {
this.active = 0
// this.vocObj.playAudio({
// type: 1,
// name: 'media_button.wav'
// })
})
Row() {
@ -138,10 +133,6 @@ struct SignDisplayCom {
.justifyContent(FlexAlign.Center)
.onClick(() => {
this.active = 2
// this.vocObj.playAudio({
// type: 1,
// name: 'media_button.wav'
// })
})
}
@ -158,26 +149,6 @@ struct SignDisplayCom {
this.outFlag = true
})
}
// Row(){
// Text('保存日志').fontSize(21*this.ratio).fontColor('#fff')
// }.width(137*this.ratio).height(36*this.ratio).margin({left:12*this.ratio}).backgroundImageSize({width:'100%',height:'100%'}).backgroundImage($r('app.media.button_nor')).justifyContent(FlexAlign.Center).onClick(()=>{
// this.saveLog()
// })
// Row() {
// Text('关闭').fontSize(21 * this.ratio).fontColor('#fff')
// }
// .width(137 * this.ratio)
// .height(36 * this.ratio)
// .margin({ left: 12 * this.ratio })
// .backgroundImageSize({ width: '100%', height: '100%' })
// .backgroundImage($r('app.media.button_nor'))
// .justifyContent(FlexAlign.Center)
// .onClick(() => {
// // globalThis.udpClient.closeUdp(()=>{
// router.back()
// // })
// })
}
}.width(936 * this.ratio)
@ -331,16 +302,6 @@ struct SignDisplayCom {
this.gpsActive = 0
})
// Row() {
// Text('GPS2').fontColor(this.gpsActive == 1 ? '#2D3C5A' : '#fff')
// }
// .width(72)
// .height(24)
// .backgroundColor(this.gpsActive == 1 ? '#fff' : '#1A1A1A')
// .justifyContent(FlexAlign.Center)
// .onClick(() => {
// this.gpsActive = 1
// })
}.margin({ top: 10*this.ratio })
Flex({ direction: FlexDirection.Column }) {
ForEach(this.GPSColum, (item) => {
@ -418,15 +379,6 @@ struct SignDisplayCom {
onPageShow() {
console.info('SURENJUN',123)
// this.vocObj = new voiceService(async (status, val) => {
// if (status == 'idle') {
// if (this.url == 'back') {
// router.back()
// // that.udpClient.sendMsg('111')
// } else {
// }
// }
// });
const getSignal = this.getSignal;
const that = this
@ -443,11 +395,7 @@ struct SignDisplayCom {
getSignal(msgStr)
},200)
}
// this.getDeviceNo();
// this.initTime();
// this.initCarInfo();
// globalThis.isRegist = false; //是否已经注册
}
getSignal= (msg)=> {
@ -501,24 +449,7 @@ struct SignDisplayCom {
}
saveLog() {
// this.FileLog.initFileLogo('d .0ateLog')
// this.FileLog.createFile('123')
}
// getDeviceNo() {
// globalThis.deviceNo = 'FE-FC-FE-7C-5C-72'; //设备号
// }
// initTime() {
//
// }
//
// initCarInfo() {
//
// }
//
// getData() {
//
// }
}
export default SignDisplayCom