Compare commits

..

No commits in common. "4e3c3bf46552901245e463c119c3e8159bbeb998" and "4f93ec0c9a1cb0fdea25b6e0754156b6d2642885" have entirely different histories.

9 changed files with 67 additions and 90 deletions

View File

@ -5,9 +5,9 @@
"name": "default", "name": "default",
"material": { "material": {
"certpath": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.cer", "certpath": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.cer",
"storePassword": "0000001A1173A56391B52980E84237B06A106777310E419AF46EBEB63A7D126BCA0F5657D119081FE3C9", "storePassword": "0000001AC0C49320C84ECD6C7BA0119428C66297EAF08E5011B23EBA83794F0FA803077D0F4848203ADD",
"keyAlias": "debugKey", "keyAlias": "debugKey",
"keyPassword": "0000001A5FF060362EBE093828B7604C511B827EB8C93BAD85C9745AA07A084FBAEB8687CC941F8CC0B7", "keyPassword": "0000001A7A1DB8B37DA86FBA8DBDDE9B6E4DC5801A351175FB4980E662677BB08D6E02D623FAD2EB993B",
"profile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p7b", "profile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p7b",
"signAlg": "SHA256withECDSA", "signAlg": "SHA256withECDSA",
"storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p12" "storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p12"

View File

@ -285,7 +285,6 @@ export async function takePhotoFn(context) {
let fd let fd
const devPath="/dev/ttyS1" const devPath="/dev/ttyS1"
async function openChuankouFn() { async function openChuankouFn() {
fd =await testNapi.SerialOpen(devPath); fd =await testNapi.SerialOpen(devPath);
globalThis.fd=fd globalThis.fd=fd
@ -295,7 +294,6 @@ async function openChuankouFn() {
let ret =await testNapi.SerialSet(fd, 115200,0, 8, 1, 0) let ret =await testNapi.SerialSet(fd, 115200,0, 8, 1, 0)
console.log('daihairet',ret) console.log('daihairet',ret)
} }
async function getChuankouFnMsg() { async function getChuankouFnMsg() {
let timeout = 5000; // 2秒超时 let timeout = 5000; // 2秒超时
let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
@ -308,7 +306,6 @@ async function getChuankouFnMsg() {
testNapi.SerialRecv(globalThis.fd, timeout,12).then(revTestInfo=>{ testNapi.SerialRecv(globalThis.fd, timeout,12).then(revTestInfo=>{
console.log('daihai',revTestInfo?.recevedBuf?.toString()) console.log('daihai',revTestInfo?.recevedBuf?.toString())
const message = revTestInfo?.recevedBuf?.toString() const message = revTestInfo?.recevedBuf?.toString()
console.log("chuankou xinxi",message)
if (message == '') { if (message == '') {
return return
} }
@ -319,22 +316,18 @@ async function getChuankouFnMsg() {
if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) { if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) {
return return
} }
console.log("chuankou 档位", msg[9])
if(msg[9]==0||msg[9]==1||msg[9]==2||msg[9]==3||msg[9]==4||msg[9]==5){
globalThis.chuankoMsg=msg[9] globalThis.chuankoMsg=msg[9]
}
}).catch((err)=>{ }).catch((err)=>{
console.log('daihaierror',JSON.stringify(err)) console.log('daihaierror',JSON.stringify(err))
}) })
} }
export async function getChuankouFn(){ export async function getChuankouFn(){
if (!globalThis.fd) { if(globalThis.fd){
console.log("chuankou 没有fd")
openChuankouFn()
return return
} }
console.log("chuankou 定时器") openChuankouFn()
setInterval(()=>{
getChuankouFnMsg() getChuankouFnMsg()
},1000)
} }

View File

@ -6,13 +6,13 @@ import fs from '@ohos.file.fs'
import photoAccessHelper from '@ohos.file.photoAccessHelper' import photoAccessHelper from '@ohos.file.photoAccessHelper'
import dataSharePredicates from '@ohos.data.dataSharePredicates' import dataSharePredicates from '@ohos.data.dataSharePredicates'
import { dateFormat, getCurrentTime } from '../utils/tools' import { dateFormat, getCurrentTime } from '../utils/tools'
import record from '@ohos.rtsprecord'; import rtsp_server from '@ohos.rtsprecord';
// import record from '@ohos.rtsprecord'; // import record from '@ohos.rtsprecord';
import { FileHelper } from './FileHelper'; import { FileHelper } from './FileHelper';
import FileUtil from '../utils/File'; import FileUtil from '../utils/File';
import { GlobalConfig } from '../../config'; import { GlobalConfig } from '../../config';
const rtsp_server = record.createServer(); // const rtsp_server = record.createServer();
//开始录屏 //开始录屏
const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI, const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI,
photoAccessHelper.PhotoKeys.PHOTO_TYPE, photoAccessHelper.PhotoKeys.PHOTO_TYPE,
@ -30,7 +30,6 @@ const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI,
photoAccessHelper.PhotoKeys.POSITION, photoAccessHelper.PhotoKeys.POSITION,
photoAccessHelper.PhotoKeys.DATE_TRASHED, photoAccessHelper.PhotoKeys.DATE_TRASHED,
photoAccessHelper.PhotoKeys.HIDDEN]; photoAccessHelper.PhotoKeys.HIDDEN];
// const rtsp_server = record.createServer(); // const rtsp_server = record.createServer();
export async function saveStartRecordVideo(path) { export async function saveStartRecordVideo(path) {
@ -58,7 +57,6 @@ export async function saveStartRecordVideo(path) {
reslove(record_handle) reslove(record_handle)
}) })
} }
async function getfilehandleCode(td, param, dir, path, index) { async function getfilehandleCode(td, param, dir, path, index) {
return new Promise(async (reslove, reject) => { return new Promise(async (reslove, reject) => {
console.log('pathpath1', path) console.log('pathpath1', path)
@ -69,7 +67,6 @@ async function getfilehandleCode(td, param, dir, path, index) {
}) })
} }
export async function startRecordVideo(param?, td?, context?, dir?,path?,index?) { export async function startRecordVideo(param?, td?, context?, dir?,path?,index?) {
return new Promise(async(reslove, reject) => { return new Promise(async(reslove, reject) => {
@ -116,7 +113,6 @@ export async function endRecordVideo(record_handleObj) {
} }
} }
} }
/** /**
* *
* @param param * @param param
@ -128,7 +124,6 @@ interface takePhotoParam {
base64?:string, base64?:string,
fileSize?:number, fileSize?:number,
} }
/** /**
* *
* @param param * @param param
@ -139,7 +134,6 @@ interface takePhotoParam {
* @returns * @returns
*/ */
const fileHelper = new FileHelper(); const fileHelper = new FileHelper();
export async function takePhoto(param, context,dir,flag=1,callback?) { export async function takePhoto(param, context,dir,flag=1,callback?) {
var video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${param.pztd}/main/av_stream`; var video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${param.pztd}/main/av_stream`;
@ -167,10 +161,11 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
// callback({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize }) // callback({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize })
// console.log('getmyLog01') // console.log('getmyLog01')
// }); // });
} else { }
else{
return new Promise<takePhotoParam>((resolve,reject)=>{ return new Promise<takePhotoParam>((resolve,reject)=>{
// @ts-ignore // @ts-ignore
rtsp_server.getVideoSnapshot(context, video_uri, fileName, dir, true, (err, snapResult) => { rtsp_server.getVideoSnapshot(context, video_uri, fileName,dir,true,(snapResult,err)=>{
console.log('getPhtot') console.log('getPhtot')
resolve({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize }) resolve({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize })
}); });
@ -179,6 +174,8 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
} }
console.log('getmyLog03') console.log('getmyLog03')
} }
export async function deleteAllFileByPiC(dirName) { export async function deleteAllFileByPiC(dirName) {

View File

@ -36,7 +36,6 @@ export default class UdpClient {
this.oppositeIp = udpOppositeIp this.oppositeIp = udpOppositeIp
this.localIpPort = udplocalIpPort this.localIpPort = udplocalIpPort
this.oppositeIpPort = udpOppositeIpPort this.oppositeIpPort = udpOppositeIpPort
console.log("chuankou 初始化",)
getChuankouFn() getChuankouFn()
console.log(TAG,'newUdp') console.log(TAG,'newUdp')
// this.stashFn=()=>{} // this.stashFn=()=>{}

View File

@ -164,7 +164,7 @@ async function xmlToJson(result, url) {
let res = deeml(xmlArr); let res = deeml(xmlArr);
console.log("xmlToJson end",JSON.stringify(res) ); console.log("xmlToJson end",JSON.stringify(res) );
resolve(res) resolve(res)
}, 10000) }, 100)
} else { } else {
let res = deeml(xmlArr); let res = deeml(xmlArr);
console.log("xmlToJson end",JSON.stringify(res) ); console.log("xmlToJson end",JSON.stringify(res) );

View File

@ -33,7 +33,6 @@ import FileUtil from '../common/utils/File';
import SignDisplayCom from './compontents/signDisplayCom'; import SignDisplayCom from './compontents/signDisplayCom';
import promptAction from '@ohos.promptAction'; import promptAction from '@ohos.promptAction';
import { voiceService } from '../common/service/voiceService'; import { voiceService } from '../common/service/voiceService';
import { getChuankouFn } from '../common/service/indexService';
@Entry @Entry
@Component @Component
@ -43,11 +42,6 @@ struct Index {
} }
async aboutToAppear() { async aboutToAppear() {
getChuankouFn()
setInterval(() => {
console.log("chuankou 定时器2")
getChuankouFn()
}, 1000)
globalThis.windowClass.setWindowSystemBarEnable([]) globalThis.windowClass.setWindowSystemBarEnable([])
const time = await getCurrentTime() const time = await getCurrentTime()

View File

@ -6,8 +6,6 @@ import { GPSData, SignalData } from '../../mock';
import { SignalDataType } from '../../model'; import { SignalDataType } from '../../model';
import FileUtil from '../../common/utils/File' import FileUtil from '../../common/utils/File'
import { GlobalConfig } from '../../config/index' import { GlobalConfig } from '../../config/index'
import { getChuankouFn } from '../../common/service/indexService';
@Component @Component
export default struct SignDisplayCom { export default struct SignDisplayCom {
@State showBack: boolean = false @State showBack: boolean = false
@ -324,14 +322,10 @@ export default struct SignDisplayCom {
} }
aboutToDisappear() { aboutToDisappear() {
// clearInterval(this.interval) clearInterval(this.interval)
} }
async aboutToAppear() { async aboutToAppear() {
setInterval(() => {
console.log("chuankou 定时器2")
getChuankouFn()
}, 1000)
// const fileUtil = new FileUtil(globalThis.context) // const fileUtil = new FileUtil(globalThis.context)
// const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt') // const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt')
// this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170' // this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170'
@ -366,20 +360,20 @@ export default struct SignDisplayCom {
const getSignal = this.getSignal; const getSignal = this.getSignal;
const that = this const that = this
const showBack = this.showBack; const showBack = this.showBack;
// if (showBack) { if (showBack) {
// globalThis.udpClient.onMessage_1&&globalThis.udpClient.onMessage_1((msg) => { globalThis.udpClient.onMessage_1&&globalThis.udpClient.onMessage_1((msg) => {
// console.log('getUDPonMessage_1bysignDisplay2', msg) console.log('getUDPonMessage_1bysignDisplay2', msg)
//
// getSignal(msg) getSignal(msg)
// }) })
// } else { } else {
// clearInterval(globalThis.signalTimer) clearInterval(globalThis.signalTimer)
// globalThis.signalTimer = setInterval(() => { globalThis.signalTimer = setInterval(() => {
// //TODO 临时方案 //TODO 临时方案
// const msgStr = globalThis.msgStr const msgStr = globalThis.msgStr
// getSignal(msgStr) getSignal(msgStr)
// }, 200) }, 200)
// } }
} }

Binary file not shown.

View File

@ -16,7 +16,7 @@ export const judgeConfig = {
// 本地模型地址 // 本地模型地址
// modelPath: 'models/model_enc', // modelPath: 'models/model_enc',
// 济南科目三 // 济南科目三
trajectoryPath: 'logs/2024_10_12_11_50_10_9999427676823_744299437502336256_隋统/judge_exam_data.txt', trajectoryPath: 'logs/2025_04_23_09_50_55_2504755332926_320924199111132926_陈静/judge_exam_data.txt',
//四合一画面配置 //四合一画面配置
fourInOneScreen:{ fourInOneScreen:{
//gps位数 //gps位数