Compare commits

...

3 Commits

Author SHA1 Message Date
c1363263b2 1 2024-12-24 16:43:59 +08:00
2de46a9d1a Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2024-12-20 13:28:18 +08:00
8e2b093a67 修改 2024-12-20 13:28:03 +08:00
13 changed files with 179 additions and 97 deletions

View File

@ -287,7 +287,10 @@ export async function takePhotoFn(context) {
console.log('拍照失败') console.log('拍照失败')
return return
} }
console.log('takePhototakePhoto',JSON.stringify(data))
const zdyz=globalThis.param854Str?Number(globalThis.param854Str):Number(param.zdyz) const zdyz=globalThis.param854Str?Number(globalThis.param854Str):Number(param.zdyz)
console.log('takePhototakePhoto',JSON.stringify(zdyz),)
if (Number(data.fileSize) <= (zdyz * 1000)) { if (Number(data.fileSize) <= (zdyz * 1000)) {
map[key1] = true map[key1] = true
promptAction.showToast({ promptAction.showToast({

View File

@ -33,7 +33,7 @@ const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI,
// const rtsp_server = record.createServer(); // const rtsp_server = record.createServer();
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) => {
// const fileUtil = new FileUtil(globalThis.context) // const fileUtil = new FileUtil(globalThis.context)
// const date=dateFormat(new Date).split(' ')[0] // const date=dateFormat(new Date).split(' ')[0]
@ -47,7 +47,7 @@ export async function startRecordVideo(param, td, context, dir, path?,index?) {
if (!path) { if (!path) {
fileName = `movie_record${num}.mp4` fileName = `movie_record${num}.mp4`
} else { } else {
fileName = `${path}_${index||num}.mp4` fileName = `${path}_${index || num}.mp4`
} }
// @ts-ignore // @ts-ignore
@ -99,20 +99,20 @@ export async function saveStartRecordVideo(path) {
} }
for (let i = 1; i <= 4; i++) { for (let i = 1; i <= 4; i++) {
if (param['videoRecord'+i]) { if (param['videoRecord'+i]) {
console.log('pathpath0',path) console.log('pathpath0', path)
record_handle[i] = await getfilehandleCode(i, param, date, path,i) record_handle[i] = await getfilehandleCode(i, param, date, path, i)
} }
} }
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)
const record_handle = await startRecordVideo(param, td, globalThis.context, dir, path,index) const record_handle = await startRecordVideo(param, td, globalThis.context, dir, path, index)
// this.rocordHandleObj['rocord_handle'+td] = record_handle // this.rocordHandleObj['rocord_handle'+td] = record_handle
reslove(record_handle) reslove(record_handle)
}) })
@ -120,7 +120,7 @@ async function getfilehandleCode(td, param, dir, path,index) {
} }
export async function getUserAlbumItemByDisplayName(displayName: string,day?,type?): Promise<photoAccessHelper.Album> { export async function getUserAlbumItemByDisplayName(displayName: string, day?, type?): Promise<photoAccessHelper.Album> {
let fetchResult = null let fetchResult = null
let album: photoAccessHelper.Album = null let album: photoAccessHelper.Album = null
try { try {
@ -137,10 +137,10 @@ export async function getUserAlbumItemByDisplayName(displayName: string,day?,typ
console.log('get getUserAlbumItemByDisplayName, count: ' + JSON.stringify(fetchResult)); console.log('get getUserAlbumItemByDisplayName, count: ' + JSON.stringify(fetchResult));
if (fetchResult.getCount() > 0) { if (fetchResult.getCount() > 0) {
const albums = await fetchResult.getLastObject(); const albums = await fetchResult.getLastObject();
console.log('get getUserAlbumItemByDisplayName album111',albums.albumName) console.log('get getUserAlbumItemByDisplayName album111', albums.albumName)
if(isSevenDaysAgo(albums.albumName,day)){ if (isSevenDaysAgo(albums.albumName, day)) {
deleteAllFileByPiC(albums.albumName,type) deleteAllFileByPiC(albums.albumName, type)
} }
console.log('get getUserAlbumItemByDisplayName album',) console.log('get getUserAlbumItemByDisplayName album',)
} }
@ -178,8 +178,33 @@ interface takePhotoParam {
*/ */
const fileHelper = new FileHelper(); const fileHelper = new FileHelper();
export async function takePhoto(param, context, dir, flag = 1, callback?) { export async function delPic(day,type) {
let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(globalThis.context);
console.info('albumGetAssetsDemoCallback');
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumFetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
predicates: predicates
};
let fetchOption: photoAccessHelper.FetchOptions = {
fetchColumns: [],
predicates: predicates
};
let albumList: photoAccessHelper.FetchResult<photoAccessHelper.Album> = await phAccessHelper.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC, albumFetchOptions);
let albums = await albumList.getAllObjects();
for(let i=0;i<=albums.length;i++){
let albumName=albums[i].albumName
console.log('albumNamealbumName',albumName)
if (isSevenDaysAgo(albumName, day)&&albumName!='jt'&&albumName!='pz') {
deleteAllFileByPiC(albums.albumName, type)
}
}
return
}
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`;
// var video_uri = `rtsp://admin:openharmony1@192.168.1.66:554/Streaming/Channels/3`; // var video_uri = `rtsp://admin:openharmony1@192.168.1.66:554/Streaming/Channels/3`;
@ -195,26 +220,31 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
console.log("baohaowen_detectLoop round end size1:" + snapResult.fileSize); console.log("baohaowen_detectLoop round end size1:" + snapResult.fileSize);
callback({ fileSize: snapResult.fileSize, errorCode: snapResult.errorCode }) callback({ fileSize: snapResult.fileSize, errorCode: snapResult.errorCode })
}); });
} }
else { else {
console.log('baoyihubaoyihu1', video_uri, flag) console.log('baoyihubaoyihu1', video_uri, flag)
return new Promise<takePhotoParam>(async (resolve, reject) => { return new Promise<takePhotoParam>(async (resolve, reject) => {
const time = await getCurrentTime() const time = await getCurrentTime()
const date = time.split(' ')[0] const date = time.split(' ')[0]
rtsp_server.getVideoSnapshot(context, video_uri, fileName, date, true, (err, snapResult) => { await fileHelper.createAlbum(date)
rtsp_server.getVideoSnapshot(context, video_uri, fileName, '/jt', true, (err, snapResult) => {
console.log('baoyihubaoyihu', video_uri, flag, JSON.stringify(snapResult)) console.log('baoyihubaoyihu', video_uri, flag, JSON.stringify(snapResult))
console.log('getPhtot', JSON.stringify(snapResult)) console.log('getPhtot', JSON.stringify(snapResult))
if(snapResult.result&&snapResult.errorCode==0){
resolve({ resolve({
base64: snapResult.dataString, base64: snapResult.dataString,
name: snapResult.fileName, name: snapResult.fileName,
fileSize: snapResult.fileSize, fileSize: snapResult.fileSize,
errorCode: snapResult.errorCode errorCode: snapResult.errorCode
}) })
}else{
takePhoto(param, context, dir, flag, callback)
// reject()
}
}); });
}) })
console.log('getmyLog02')
} }
console.log('getmyLog03') console.log('getmyLog03')

View File

@ -78,19 +78,24 @@ export default class FileUtil{
* @desc * @desc
* *
*/ */
public openFileSync=async(filePath)=>{
const { READ_WRITE,CREATE,APPEND }= fs.OpenMode
let file = fs.openSync(filePath, READ_WRITE | APPEND |CREATE);
return file
}
public editFileWidthOutOpen(file,content){
const newStr = content + '\n'
fs.writeSync(file.fd,newStr)
fs.closeSync(file)
console.error(LOGTAG,'写入文件成功')
}
public editFile = async (filePath:string,content:string,type?:string)=>{ public editFile = async (filePath:string,content:string,type?:string)=>{
const { READ_WRITE,CREATE,APPEND }= fs.OpenMode const { READ_WRITE,CREATE,APPEND }= fs.OpenMode
try { try {
let file = fs.openSync(filePath, READ_WRITE | APPEND |CREATE); let file = fs.openSync(filePath, READ_WRITE | APPEND |CREATE);
let index
// if(type=='overWrite'){
// //文件覆蓋
// index=0
// }else{
// //文件追加
// const str = fs.readTextSync(filePath);
// index= str.length
// }
const newStr = content + '\n' const newStr = content + '\n'
//追加写入文件 //追加写入文件
fs.writeSync(file.fd,newStr) fs.writeSync(file.fd,newStr)

View File

@ -61,6 +61,7 @@ export default class GetDistance {
setInterval(()=>{ setInterval(()=>{
const { carId } = globalThis.carInfo; const { carId } = globalThis.carInfo;
const {date,timeStr,totalDistance}= this; const {date,timeStr,totalDistance}= this;
return
//"carid":"1001","startTime":"2024-08-24 08:09:01","time":"111233", "mileage":"1222" //"carid":"1001","startTime":"2024-08-24 08:09:01","time":"111233", "mileage":"1222"
uploadHarmonyLiCheng({ uploadHarmonyLiCheng({
carid:carId, carid:carId,

View File

@ -3,7 +3,7 @@ import { getSyncData } from '../service/initable';
import hilog from '@ohos.hilog'; import hilog from '@ohos.hilog';
import FileUtil from '../../common/utils/File' import FileUtil from '../../common/utils/File'
import { GlobalConfig } from '../../config/index' import { GlobalConfig } from '../../config/index'
export async function getTCP() { export async function getTCP(flag=false) {
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');
if (data === '' || data === undefined) { if (data === '' || data === undefined) {
@ -12,14 +12,16 @@ export async function getTCP() {
} }
}else{ }else{
const result=JSON.parse(data) const result=JSON.parse(data)
if (globalThis.TcpClient && globalThis.TcpClient.closeTcp) { if (globalThis.TcpClient && globalThis.TcpClient.closeTcp&&!flag) {
globalThis.TcpClient.closeTcp(async () => { globalThis.TcpClient.closeTcp(async () => {
// const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort) // const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
// globalThis.TcpClient = tcpClient // globalThis.TcpClient = tcpClient
setTimeout(async () => { setTimeout(async () => {
await globalThis.TcpClient.rebindTcp(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort) const tcpClient: TcpClient = new TcpClient(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort)
globalThis.TcpClient = tcpClient
await globalThis.TcpClient.bindTcp()
// await globalThis.TcpClient.rebindTcp(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort)
await globalThis.TcpClient.connectTcp() await globalThis.TcpClient.connectTcp()
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
globalThis.TcpClient.onError((val) => { globalThis.TcpClient.onError((val) => {
setTimeout(() => { setTimeout(() => {
getTCP() getTCP()
@ -27,7 +29,6 @@ export async function getTCP() {
}) })
await globalThis.TcpClient.onMessage((val) => { await globalThis.TcpClient.onMessage((val) => {
setTimeout(() => { setTimeout(() => {
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
if (val) { if (val) {
// const msg=val.substring(5,val.length-1) // const msg=val.substring(5,val.length-1)
console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus()) console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus())
@ -46,6 +47,12 @@ export async function getTCP() {
await globalThis.TcpClient.bindTcp() await globalThis.TcpClient.bindTcp()
await globalThis.TcpClient.connectTcp() await globalThis.TcpClient.connectTcp()
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
clearInterval(globalThis.intervalSendmsg)
globalThis.intervalSendmsg=setInterval(()=>{
if(!globalThis.getCloseTcp){
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
}
},1000/3)
globalThis.TcpClient.onError((val) => { globalThis.TcpClient.onError((val) => {
setTimeout(() => { setTimeout(() => {
getTCP() getTCP()
@ -54,7 +61,6 @@ export async function getTCP() {
await globalThis.TcpClient.onMessage((val) => { await globalThis.TcpClient.onMessage((val) => {
hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val)); hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
setTimeout(() => { setTimeout(() => {
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
if (val && globalThis.udpClient?.sendMsg) { if (val && globalThis.udpClient?.sendMsg) {
globalThis.udpClient?.sendMsg(val) globalThis.udpClient?.sendMsg(val)
} }

View File

@ -33,6 +33,8 @@ export default class TcpClient {
// time:dateFormat(new Date()), // time:dateFormat(new Date()),
// PLC:`${TAG} tcpOnerror ${JSON.stringify(err)}`, // PLC:`${TAG} tcpOnerror ${JSON.stringify(err)}`,
// }) // })
globalThis.getCloseTcp = true
this.writeLog({ this.writeLog({
time:dateFormat(new Date()), time:dateFormat(new Date()),
message: `${TAG} tcponerror localIp${JSON.stringify(err)}`, message: `${TAG} tcponerror localIp${JSON.stringify(err)}`,
@ -62,7 +64,10 @@ export default class TcpClient {
time:dateFormat(new Date()), time:dateFormat(new Date()),
message: `${TAG} tcprebind tcpreBinderror${JSON.stringify(err)}`, message: `${TAG} tcprebind tcpreBinderror${JSON.stringify(err)}`,
}) })
globalThis.getCloseTcp = true setTimeout(async () => {
getTCP()
}, 2000)
// globalThis.getCloseTcp = true
hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err)); hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err));
resolve(true) resolve(true)
} }
@ -71,7 +76,7 @@ export default class TcpClient {
message: `${TAG} tcprebind success`, message: `${TAG} tcprebind success`,
}) })
console.log('testTag,rebindtestTag tcp bind success'); console.log('testTag,rebindtestTag tcp bind success');
globalThis.getCloseTcp = false // globalThis.getCloseTcp = false
resolve(false) resolve(false)
}) })
@ -104,13 +109,14 @@ export default class TcpClient {
time:dateFormat(new Date()), time:dateFormat(new Date()),
message: `${TAG} tcpbind error ${JSON.stringify(err)}`, message: `${TAG} tcpbind error ${JSON.stringify(err)}`,
}) })
setTimeout(async () => {
getTCP()
}, 2000)
console.log('testTag tcp bind faile'); console.log('testTag tcp bind faile');
globalThis.getCloseTcp = true
hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err)); hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err));
resolve(true) resolve(true)
return return
} }
globalThis.getCloseTcp = false
console.log('testTag tcp bind success'); console.log('testTag tcp bind success');
// this.writeLog({ // this.writeLog({
// time:dateFormat(new Date()), // time:dateFormat(new Date()),
@ -152,13 +158,12 @@ export default class TcpClient {
time:dateFormat(new Date()), time:dateFormat(new Date()),
message: `${TAG} TCPconnect error ${JSON.stringify(err)}`, message: `${TAG} TCPconnect error ${JSON.stringify(err)}`,
}) })
// this.writeLog({ // this.writeLog({
// time:dateFormat(new Date()), // time:dateFormat(new Date()),
// PLC:`${TAG} tcp connect rebind success`, // PLC:`${TAG} tcp connect rebind success`,
// }) // })
if(this.num>3){
return
}
setTimeout(() => { setTimeout(() => {
this.writeLog({ this.writeLog({
time:dateFormat(new Date()), time:dateFormat(new Date()),
@ -166,12 +171,11 @@ export default class TcpClient {
}) })
getTCP() getTCP()
resolve(false) resolve(false)
}, 2000) }, 9000)
return; return;
} }
}); });
console.log('socketTag','success') console.log('socketTag','success')
globalThis.getCloseTcp = false globalThis.getCloseTcp = false
resolve(true) resolve(true)
}).catch(err => { }).catch(err => {
@ -180,15 +184,12 @@ export default class TcpClient {
time:dateFormat(new Date()), time:dateFormat(new Date()),
message: `${TAG} TCPconnect error2 ${JSON.stringify(err)}`, message: `${TAG} TCPconnect error2 ${JSON.stringify(err)}`,
}) })
globalThis.getCloseTcp = true // globalThis.getCloseTcp = true
this.num++
if(this.num>3){
return
}
setTimeout(() => { setTimeout(() => {
getTCP() getTCP()
resolve(false) resolve(false)
}, 2000) }, 9000)
// this.writeLog({ // this.writeLog({
// time:dateFormat(new Date()), // time:dateFormat(new Date()),
// PLC:`${TAG} tcp connect error`, // PLC:`${TAG} tcp connect error`,
@ -206,10 +207,11 @@ export default class TcpClient {
promise.then(() => { promise.then(() => {
reslove(true) reslove(true)
}).catch(err => { }).catch(err => {
this.writeLog({ console.log(`${TAG} TCPsend error ${JSON.stringify(err)}`)
time:dateFormat(new Date()), // this.writeLog({
message: `${TAG} TCPsend error ${JSON.stringify(err)}`, // time:dateFormat(new Date()),
}) // message: `${TAG} TCPsend error ${JSON.stringify(err)}`,
// })
reslove(false) reslove(false)
}); });
}) })
@ -223,10 +225,7 @@ export default class TcpClient {
// }) // })
console.log(TAG, 'Tcponmessage', value) console.log(TAG, 'Tcponmessage', value)
globalThis.tcpUdpError = false globalThis.tcpUdpError = false
this.writeLog({
time:dateFormat(new Date()),
message: `${TAG} Tcponmessage ,${value}`,
})
// console.log('messageLengt',,value.message.length)) // console.log('messageLengt',,value.message.length))
console.log('testTagtcpmsg') console.log('testTagtcpmsg')
// console.log("on message, message:" + value.message+ ", remoteInfo:" ) // console.log("on message, message:" + value.message+ ", remoteInfo:" )
@ -244,7 +243,7 @@ export default class TcpClient {
//程序断开 //程序断开
if (globalThis.tcpUdpError) { if (globalThis.tcpUdpError) {
console.log(TAG,'tcp信号丢失') console.log(TAG,'tcp信号丢失')
getTCP() // getTCP()
prompt.showToast({ prompt.showToast({
message: 'tcp信号丢失', message: 'tcp信号丢失',
duration: 2000 duration: 2000
@ -276,7 +275,6 @@ export default class TcpClient {
} }
closeTcp(callback) { closeTcp(callback) {
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
console.log(TAG, 'tcpClose') console.log(TAG, 'tcpClose')
let promise = this.tcp.close(); let promise = this.tcp.close();
@ -290,6 +288,9 @@ export default class TcpClient {
callback() callback()
reslove(true) reslove(true)
}).catch(err => { }).catch(err => {
setTimeout(async () => {
getTCP(true)
}, 9000)
this.writeLog({ this.writeLog({
time:dateFormat(new Date()), time:dateFormat(new Date()),
message: `${TAG} tcpclose error ${JSON.stringify(err)}`, message: `${TAG} tcpclose error ${JSON.stringify(err)}`,

View File

@ -30,8 +30,10 @@ export default class EntryAbility extends UIAbility {
globalThis.deviceNo = ''; globalThis.deviceNo = '';
globalThis.hasAuth = false globalThis.hasAuth = false
globalThis.version = GlobalConfig.version.sz.km2[0]; // globalThis.judgeVersion ='2024.08.24.1'
globalThis.judgeVersion = GlobalConfig.version.sz.km2[1]; // globalThis.version ='2023.12.13.01';
globalThis.version = GlobalConfig.version.jn.km3[0];
globalThis.judgeVersion = GlobalConfig.version.jn.km3[1];
globalThis.videoVersion= '1.0' globalThis.videoVersion= '1.0'

View File

@ -313,8 +313,26 @@ export default struct Index {
this.getCheckList() this.getCheckList()
return return
} }
console.log('this.index',index,)
that.passArray[index]=true that.passArray[index]=true
if(index==2){
let flag=false
console.log('globalThis.spzd[key]',globalThis.spzd)
for(let key in globalThis.spzd){
console.log('globalThis.spzd[key]',globalThis.spzd[key])
if(globalThis.spzd[key]){
that.warnFlag[index]='1'
flag=true
}
}
if(!flag){
that.warnFlag[index]='2' that.warnFlag[index]='2'
}
}else{
that.warnFlag[index]='2'
}
that.passArray=JSON.parse(JSON.stringify(that.passArray)) that.passArray=JSON.parse(JSON.stringify(that.passArray))
that.warnFlag=JSON.parse(JSON.stringify(that.warnFlag)) that.warnFlag=JSON.parse(JSON.stringify(that.warnFlag))
index++ index++

View File

@ -23,8 +23,7 @@ import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
import { judgeConfig } from './judgeSDK/utils/judgeConfig'; import { judgeConfig } from './judgeSDK/utils/judgeConfig';
import { initJudgeUdp } from '../common/utils/UdpJudge'; import { initJudgeUdp } from '../common/utils/UdpJudge';
import errorMsgDialog from './compontents/errorMsgDialog' import errorMsgDialog from './compontents/errorMsgDialog'
import { delHilog } from '../common/service/indexService'; import { delPic } from '../common/service/videoService';
import { deleteAllFileByPiC, getUserAlbumItemByDisplayName } from '../common/service/videoService';
import { getCurrentHourTime } from '../common/utils/tools'; import { getCurrentHourTime } from '../common/utils/tools';
@Entry @Entry
@Component @Component
@ -32,7 +31,8 @@ struct UserInfo {
@State pageIndex: number = 0 @State pageIndex: number = 0
@State ratio: number = 1700 / 960 @State ratio: number = 1700 / 960
@State index: number = 0 @State index: number = 0
@State stepFlag: boolean = false; @State stepFlag:
boolean = false;
@State errorMsg: string = '' @State errorMsg: string = ''
@State ksxtbh: string = '' @State ksxtbh: string = ''
@State pic: string = '' @State pic: string = ''
@ -180,8 +180,7 @@ struct UserInfo {
if (this.dataList.length) { if (this.dataList.length) {
setTimeout(()=>{ setTimeout(()=>{
this.currentUser = this.dataList[0] this.currentUser = this.dataList[0]
this.currentUser.ksy2= globalThis.ksyxm this.currentUser.ksy2= globalThis.kgxm
globalThis.lsh=this.currentUser.lsh globalThis.lsh=this.currentUser.lsh
},200) },200)
} else { } else {
@ -253,7 +252,7 @@ struct UserInfo {
if (res.sfzmhm == id) { if (res.sfzmhm == id) {
flag = true flag = true
this.currentUser = res this.currentUser = res
this.currentUser.ksy2= globalThis.ksyxm this.currentUser.ksy2= globalThis.kgxm
this.lsh = this.currentUser.lsh this.lsh = this.currentUser.lsh
globalThis.lsh = this.currentUser.lsh globalThis.lsh = this.currentUser.lsh
@ -284,7 +283,7 @@ struct UserInfo {
await upDateTableByArray('USER', []) await upDateTableByArray('USER', [])
setTimeout(()=>{ setTimeout(()=>{
this.currentUser = this.list[0] this.currentUser = this.list[0]
this.currentUser.ksy2= globalThis.ksyxm this.currentUser.ksy2= globalThis.kgxm
globalThis.lsh = this.currentUser.lsh globalThis.lsh = this.currentUser.lsh
},200) },200)
@ -370,7 +369,7 @@ struct UserInfo {
this.pageIndex = 0 this.pageIndex = 0
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
this.currentUser = this.dataList[0] this.currentUser = this.dataList[0]
this.currentUser.ksy2= globalThis.ksyxm this.currentUser.ksy2= globalThis.kgxm
this.lsh = this.currentUser.lsh this.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm globalThis.ksyh = this.currentUser.ksy1sfzmhm
@ -487,9 +486,10 @@ struct UserInfo {
if(!Number(this.systemParam.Param305Str)){ if(!Number(this.systemParam.Param305Str)){
that.systemParam.Param305Str='2' that.systemParam.Param305Str='2'
} }
console.log('Param305Str',that.systemParam.Param305Str)
// delHilog(this.Param305Str) // delHilog(this.Param305Str)
getUserAlbumItemByDisplayName('', that.systemParam.Param305Str,1) delPic(that.systemParam.Param305Str,1)
getUserAlbumItemByDisplayName('',that.systemParam.Param305Str,2) delPic(that.systemParam.Param305Str,2)
} }
}) })
@ -602,9 +602,11 @@ struct UserInfo {
listData[i] = decodeURI(listData[i]) listData[i] = decodeURI(listData[i])
} }
if(this.systemParam.Param828Str=='1'||this.systemParam.Param828Str=='2'){ if(this.systemParam.Param828Str=='1'||this.systemParam.Param828Str=='2'){
listData.ksy2=listData.ksy1; // listData.ksy2=listData.ksy1;
listData.ksy2=globalThis.kgxm
}else{ }else{
listData.ksy2=listData.ksy2; // listData.ksy2=listData.ksy2;
listData.ksy2=globalThis.kgxm
} }
listData.kszp = this.photo + listData.kszp listData.kszp = this.photo + listData.kszp
listData.ksmjzp = this.photo + listData.ksmjzp listData.ksmjzp = this.photo + listData.ksmjzp
@ -616,7 +618,7 @@ struct UserInfo {
if (this.dataList.length) { if (this.dataList.length) {
setTimeout(()=>{ setTimeout(()=>{
this.currentUser = this.dataList[0] this.currentUser = this.dataList[0]
this.currentUser.ksy2= globalThis.ksyxm this.currentUser.ksy2= globalThis.kgxm
globalThis.lsh=this.currentUser.lsh globalThis.lsh=this.currentUser.lsh
},200) },200)
// this.currentUser = this.dataList[0] // this.currentUser = this.dataList[0]
@ -876,6 +878,11 @@ struct UserInfo {
const date = new Date() const date = new Date()
globalThis.startHourTime = await getCurrentHourTime() globalThis.startHourTime = await getCurrentHourTime()
const photoBase64 = await this.getPhoto(); const photoBase64 = await this.getPhoto();
if(photoBase64==''){
this.ksksLimit=false
this.isLoadingPopupVisible=false
return
}
const drvexam = { const drvexam = {
lsh: this.currentUser.lsh || '', lsh: this.currentUser.lsh || '',
kskm: examSubject, kskm: examSubject,
@ -896,7 +903,7 @@ struct UserInfo {
//接口标识 //接口标识
jkid: '17C51', jkid: '17C51',
} }
console.info('surenjun', JSON.stringify(param)) console.info('surenjunjianguan', JSON.stringify(param))
const temp = await writeObjectOut(param); const temp = await writeObjectOut(param);
globalThis.lsh = this.currentUser.lsh globalThis.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm globalThis.ksyh = this.currentUser.ksy1sfzmhm
@ -1022,7 +1029,7 @@ struct UserInfo {
globalThis.lsh = item.lsh; globalThis.lsh = item.lsh;
setTimeout(()=>{ setTimeout(()=>{
this.currentUser = item this.currentUser = item
this.currentUser.ksy2= globalThis.ksyxm this.currentUser.ksy2= globalThis.kgxm
},200) },200)

View File

@ -4,7 +4,8 @@ import FileLog from '../judgeSDK/utils/fileLog';
import RealTime from '../compontents/judge/RealTime'; import RealTime from '../compontents/judge/RealTime';
import { GPSData, SignalData } from '../../mock'; import { GPSData, SignalData } from '../../mock';
import { SignalDataType } from '../../model'; import { SignalDataType } from '../../model';
import FileUtil from '../../common/utils/File'
import { GlobalConfig } from '../../config/index'
@Component @Component
export default struct SignDisplayCom { export default struct SignDisplayCom {
@State showBack: boolean = false @State showBack: boolean = false
@ -13,6 +14,7 @@ export default struct SignDisplayCom {
@State signArr: Array<any> = [] @State signArr: Array<any> = []
@State sjxhColum: Array<SignalDataType> = SignalData @State sjxhColum: Array<SignalDataType> = SignalData
@State GPSColum: Array<SignalDataType> = GPSData @State GPSColum: Array<SignalDataType> = GPSData
@State udplocalIp: string = ''
@State ratio: number = 850 / 960 @State ratio: number = 850 / 960
@State gpsActive: number = 1 @State gpsActive: number = 1
@Prop active: number = 0 @Prop active: number = 0
@ -166,7 +168,7 @@ export default struct SignDisplayCom {
}.justifyContent(FlexAlign.Start).padding({ left: 10 * this.ratio }).margin({ top: 8 * this.ratio }) }.justifyContent(FlexAlign.Start).padding({ left: 10 * this.ratio }).margin({ top: 8 * this.ratio })
Row() { Row() {
Text("本机IP" + this.signArr[53] || '0') Text("本机IP" + '192.168.7.170')
.fontColor('#FFF5E5') .fontColor('#FFF5E5')
.fontSize(14 * this.ratio) .fontSize(14 * this.ratio)
.width('25%') .width('25%')
@ -219,7 +221,7 @@ export default struct SignDisplayCom {
Text('时分秒:' + this.signArr[94]).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.signArr[95]).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[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('速度:' +((Number((this.signArr[97]||0))*1.852).toFixed(2)).toString()).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
} }
.backgroundColor('#1A1A1A') .backgroundColor('#1A1A1A')
.width(170 * this.ratio) .width(170 * this.ratio)
@ -319,7 +321,10 @@ export default struct SignDisplayCom {
clearInterval(this.interval) clearInterval(this.interval)
} }
aboutToAppear() { async aboutToAppear() {
// const fileUtil = new FileUtil(globalThis.context)
// const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt')
// this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170'
this.ratio = this.ratio * (this.scaleNum || 1); this.ratio = this.ratio * (this.scaleNum || 1);
const that = this const that = this
const {showBack,getSignal} = this const {showBack,getSignal} = this
@ -369,7 +374,6 @@ export default struct SignDisplayCom {
} }
getSignal = (msg) => { getSignal = (msg) => {
console.log('msgmsgmsg', msg)
const that = this; const that = this;
that.msg = msg that.msg = msg
const strachArr = msg.split(',') const strachArr = msg.split(',')
@ -411,6 +415,12 @@ export default struct SignDisplayCom {
this.GPSColum[t].value = this.signArr[i] this.GPSColum[t].value = this.signArr[i]
t++ t++
} }
this.GPSColum[14].value = ((Number((this.signArr[97]||0))*1.852).toFixed(2)).toString()
const str0=this.signArr[93].substr(0,2)
const str1=this.signArr[93].substr(2,2)
const str2=this.signArr[93].substr(4.2)
this.signArr[93]=str2+str1+str0
// this.signArr[53]=192.168.7.170'
this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum)))
that.signArr = JSON.parse(JSON.stringify((this.signArr))) that.signArr = JSON.parse(JSON.stringify((this.signArr)))
that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum))) that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum)))

View File

@ -12,7 +12,7 @@ export default struct DeductedPopup {
super() super()
} }
@State fontSize:number = 24 @State fontSize:number = 30
@State unselected:SEL = {fontColor:'#000000', bgColor:'#CCC4B8'} @State unselected:SEL = {fontColor:'#000000', bgColor:'#CCC4B8'}
@State selected:SEL = {fontColor:'#FFAD33', bgColor:'#26231E'} @State selected:SEL = {fontColor:'#FFAD33', bgColor:'#26231E'}
@ -90,7 +90,7 @@ export default struct DeductedPopup {
Row(){ Row(){
Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500) Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500)
} }
.width(120).height(60) .width(140).height(60)
.backgroundColor(index === this.currentIndex ? this.selected.bgColor: this.unselected.bgColor ).justifyContent(FlexAlign.Center).justifyContent(FlexAlign.Center) .backgroundColor(index === this.currentIndex ? this.selected.bgColor: this.unselected.bgColor ).justifyContent(FlexAlign.Center).justifyContent(FlexAlign.Center)
.borderRadius({topLeft:20,topRight:20}).margin({right:10}) .borderRadius({topLeft:20,topRight:20}).margin({right:10})
.onClick(()=>{ .onClick(()=>{
@ -113,7 +113,7 @@ export default struct DeductedPopup {
Row(){ Row(){
Image($rawfile(`judge/km3/zuo_nor.png`)).height(15).margin({left:20,top:0}) Image($rawfile(`judge/km3/zuo_nor.png`)).height(15).margin({left:20,top:0})
Text('上一页'){}.fontColor('#FFF').fontSize(this.fontSize) Text('上一页'){}.fontColor('#FFF').fontSize(this.fontSize)
}.width(140).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:15}) }.width(150).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:30})
.onClick(()=>{this.goPage(0)}) .onClick(()=>{this.goPage(0)})
} }
@ -123,7 +123,7 @@ export default struct DeductedPopup {
Row(){ Row(){
Text('下一页'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:30}) Text('下一页'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:30})
Image($rawfile(`judge/km3/you_nor.png`)).height(15).margin({right:6,top:0}) Image($rawfile(`judge/km3/you_nor.png`)).height(15).margin({right:6,top:0})
}.width(140).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:15}) }.width(150).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:30})
.onClick(()=>{this.goPage(1)}) .onClick(()=>{this.goPage(1)})
} }
@ -138,12 +138,14 @@ export default struct DeductedPopup {
Column(){ Column(){
ForEach(this.getCurrentMarkRuleList(),(item,index) => { ForEach(this.getCurrentMarkRuleList(),(item,index) => {
Row(){ Row(){
Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(500)
Row(){ Row(){
Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(600)
}.width(1000)
Row(){
Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(600)
} }
} }
.width('100%').height(70).justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center) .width('100%').justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center).constraintSize({minHeight:70})
.padding({left:20,right:20}) .padding({left:20,right:20})
.backgroundColor(this.getSelectedLine(index)) .backgroundColor(this.getSelectedLine(index))
.onClick(()=>{this.selectedLine = index}) .onClick(()=>{this.selectedLine = index})

View File

@ -44,7 +44,7 @@ export default class FilePhoto{
return res.base64 return res.base64
} catch (e) { } catch (e) {
promptAction.showToast({ promptAction.showToast({
message: '拍照异常' + JSON.stringify(e), message: '拍照异常,请重新' + JSON.stringify(e),
duration: 2000 duration: 2000
}); });
return '' return ''

View File

@ -1,4 +1,3 @@
//考试回放开关 //考试回放开关
export const judgeConfig = { export const judgeConfig = {
//本地目录开关 //本地目录开关
@ -16,14 +15,12 @@ export const judgeConfig = {
// 本地模型地址 // 本地模型地址
modelPath: 'models/model_enc', modelPath: 'models/model_enc',
// 济南科目三 // 济南科目三
trajectoryPath: 'logs/2024_12_05/2024_12_05_14_35_24_0000000000000_342323199501470011_测试学员1/judge_exam_data.txt', trajectoryPath: 'logs/2024_12_20/2024_12_20_15_10_30_9999920215968_355757250887519616_段士婕/judge_exam_data.txt',
//四合一画面配置 //四合一画面配置
fourInOneScreen:{ fourInOneScreen:{
//gps位数 //gps位数
gpsDigit:6 gpsDigit:6
}, },
//后置机类型 0=>三代机 1=>一体机 2=>二代机
rearEndUnitsType:0,
// 杭州科目二 // 杭州科目二
// trajectoryPath: 'logs/2024_07_19/0000000000001_342323199501470011_测试学员1_2024_07_19_06_49_12/judge_exam_data.txt', // trajectoryPath: 'logs/2024_07_19/0000000000001_342323199501470011_测试学员1_2024_07_19_06_49_12/judge_exam_data.txt',
//TODO 济南临时特殊配置 //TODO 济南临时特殊配置