dev #63
@ -294,6 +294,7 @@ const devPath = "/dev/ttyS3"
|
|||||||
function openChuankouFn(callback) {
|
function openChuankouFn(callback) {
|
||||||
console.log('SerialOpen in indexservice, path=' + devPath)
|
console.log('SerialOpen in indexservice, path=' + devPath)
|
||||||
|
|
||||||
|
//TODO 自动挡车不读取串口
|
||||||
testNapi.SerialOpenAsync(devPath, (fd) => {
|
testNapi.SerialOpenAsync(devPath, (fd) => {
|
||||||
globalThis.fd = fd;
|
globalThis.fd = fd;
|
||||||
globalThis.num = 0
|
globalThis.num = 0
|
||||||
@ -325,7 +326,9 @@ function getChuankouFnMsg() {
|
|||||||
// clearInterval(chuankou)
|
// clearInterval(chuankou)
|
||||||
testNapi.SerialClose(globalThis.fd);
|
testNapi.SerialClose(globalThis.fd);
|
||||||
globalThis.fd = null
|
globalThis.fd = null
|
||||||
|
setTimeout(()=>{
|
||||||
getChuankouFn()
|
getChuankouFn()
|
||||||
|
},2000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const msg = message?.split(',')
|
const msg = message?.split(',')
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export default class FileUtil{
|
|||||||
private fileAccessHelper: fileAccess.FileAccessHelper
|
private fileAccessHelper: fileAccess.FileAccessHelper
|
||||||
|
|
||||||
//后续文件路径待替换
|
//后续文件路径待替换
|
||||||
private absolutePath = '/mnt/hmdfs/100/account/device_view/local/files'
|
private absolutePath = '/mnt/hmdfs/100/account/device_view/local/files/duolun'
|
||||||
|
|
||||||
public destFile:string
|
public destFile:string
|
||||||
public filePathFdObj:Object = {}
|
public filePathFdObj:Object = {}
|
||||||
@ -21,6 +21,7 @@ export default class FileUtil{
|
|||||||
const {requestPermission} = this;
|
const {requestPermission} = this;
|
||||||
this.wantInfos = wantInfos;
|
this.wantInfos = wantInfos;
|
||||||
requestPermission();
|
requestPermission();
|
||||||
|
fs.mkdir(this.absolutePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
* @Email: shutdown0630@163.com
|
* @Email: shutdown0630@163.com
|
||||||
*/
|
*/
|
||||||
export const GlobalConfig={
|
export const GlobalConfig={
|
||||||
comoonfileWriteAddress:'/mnt/hmdfs/100/account/device_view/local/files',
|
comoonfileWriteAddress:'/mnt/hmdfs/100/account/device_view/local/files/duolun',
|
||||||
picSavePath:'/storage/cloud/100/files/Photo/',
|
picSavePath:'/storage/cloud/100/files/Photo/',
|
||||||
videoSavePath:'/storage/cloud/100/files/Videos/',
|
videoSavePath:'/storage/cloud/100/files/Videos/',
|
||||||
host:'http://172.37.55.1912:8082',
|
host:'http://172.37.55.1912:8082',
|
||||||
|
|||||||
@ -986,6 +986,7 @@ struct Index {
|
|||||||
},
|
},
|
||||||
confirmFn: async () => {
|
confirmFn: async () => {
|
||||||
if(this.isErrorMsgEnd){
|
if(this.isErrorMsgEnd){
|
||||||
|
this.judge.closeAllFiles()
|
||||||
router.back()
|
router.back()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -639,10 +639,13 @@ export default class Judge {
|
|||||||
// 考试结束
|
// 考试结束
|
||||||
case 5:
|
case 5:
|
||||||
console.info(judgeTag, '考试结束')
|
console.info(judgeTag, '考试结束')
|
||||||
|
//关闭录像
|
||||||
|
if(!globalThis.singlePlay){
|
||||||
|
await endRecordVideo(this.videoData)
|
||||||
|
}
|
||||||
judgeTask.addTask(async () => {
|
judgeTask.addTask(async () => {
|
||||||
console.info(judgeTag, '考试结束 start')
|
console.info(judgeTag, '考试结束 start')
|
||||||
globalThis.isJudge = false;
|
globalThis.isJudge = false;
|
||||||
closeAllFiles()
|
|
||||||
await handEndExam(ksjs)
|
await handEndExam(ksjs)
|
||||||
})
|
})
|
||||||
clearInterval(globalThis.judgeTimer)
|
clearInterval(globalThis.judgeTimer)
|
||||||
@ -983,7 +986,7 @@ export default class Judge {
|
|||||||
this.judgeUI.endPopupVisible = false;
|
this.judgeUI.endPopupVisible = false;
|
||||||
this.judgeUI.isDeductedPopShow = false;
|
this.judgeUI.isDeductedPopShow = false;
|
||||||
const {qjjl,dcjl} = ksjs
|
const {qjjl,dcjl} = ksjs
|
||||||
const {judgeUI,endExam,handleSEP,kfArr,avPlayer,judgeTask,isManual} = this;
|
const {judgeUI,endExam,handleSEP,kfArr,avPlayer,judgeTask,isManual,closeAllFiles} = this;
|
||||||
const {judgeConfigObj,examSubject,isAllProjectsEnd,totalScore,passingScore} = judgeUI;
|
const {judgeConfigObj,examSubject,isAllProjectsEnd,totalScore,passingScore} = judgeUI;
|
||||||
//计算考试分数
|
//计算考试分数
|
||||||
// this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
|
// this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
|
||||||
@ -998,6 +1001,8 @@ export default class Judge {
|
|||||||
//联网模式下手动结束的直接退出
|
//联网模式下手动结束的直接退出
|
||||||
if (!singlePlay && isManual && !isAllProjectsEnd) {
|
if (!singlePlay && isManual && !isAllProjectsEnd) {
|
||||||
avPlayer.playAudio(['voice/empty.mp3'], true, () => {
|
avPlayer.playAudio(['voice/empty.mp3'], true, () => {
|
||||||
|
this.isUdpEnd = true;
|
||||||
|
setTimeout(()=>{ closeAllFiles();},1000)
|
||||||
router.back();
|
router.back();
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -1037,7 +1042,7 @@ export default class Judge {
|
|||||||
const carInfo = globalThis.carInfo;
|
const carInfo = globalThis.carInfo;
|
||||||
const singlePlay = globalThis.singlePlay
|
const singlePlay = globalThis.singlePlay
|
||||||
const { examSubject ,plateNo} = carInfo;
|
const { examSubject ,plateNo} = carInfo;
|
||||||
const {judgeUI,ksjs,getPhoto,uploadProgressData,uploadDisConnectData,avPlayer,kfArr,judgeTask,filePath} = this;
|
const {judgeUI,ksjs,getPhoto,uploadProgressData,uploadDisConnectData,avPlayer,kfArr,judgeTask,filePath,closeAllFiles} = this;
|
||||||
const {lsh,idCard,serialNumber,kssycs,totalScore,judgeConfigObj,isAllProjectsEnd,passingScore} = judgeUI
|
const {lsh,idCard,serialNumber,kssycs,totalScore,judgeConfigObj,isAllProjectsEnd,passingScore} = judgeUI
|
||||||
//TODO 断网考试结束补传
|
//TODO 断网考试结束补传
|
||||||
// await uploadDisConnectData();
|
// await uploadDisConnectData();
|
||||||
@ -1066,7 +1071,8 @@ export default class Judge {
|
|||||||
if(code != 1){
|
if(code != 1){
|
||||||
avPlayer.playAudio(['voice/监管失败.mp3'])
|
avPlayer.playAudio(['voice/监管失败.mp3'])
|
||||||
this.judgeUI.errorMsg = decodeURIComponent(message)
|
this.judgeUI.errorMsg = decodeURIComponent(message)
|
||||||
this.isUdpEnd = true
|
this.isUdpEnd = true;
|
||||||
|
setTimeout(()=>{ closeAllFiles();},1000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1134,7 +1140,6 @@ export default class Judge {
|
|||||||
|
|
||||||
console.info(judgeTag, `考试成绩:${totalScore}`)
|
console.info(judgeTag, `考试成绩:${totalScore}`)
|
||||||
if(!singlePlay){
|
if(!singlePlay){
|
||||||
await endRecordVideo(this.videoData)
|
|
||||||
await uploadProgressData();
|
await uploadProgressData();
|
||||||
}
|
}
|
||||||
//语音播放扣分项
|
//语音播放扣分项
|
||||||
@ -1150,7 +1155,8 @@ export default class Judge {
|
|||||||
if (score <= (examSubject == 3 ? 10 : 20)) {
|
if (score <= (examSubject == 3 ? 10 : 20)) {
|
||||||
if (kfArr.length - 1 === index) {
|
if (kfArr.length - 1 === index) {
|
||||||
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
|
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
|
||||||
this.isUdpEnd = true
|
this.isUdpEnd = true;
|
||||||
|
setTimeout(()=>{ closeAllFiles();},1000)
|
||||||
router.back();
|
router.back();
|
||||||
})
|
})
|
||||||
throw new Error('End Loop')
|
throw new Error('End Loop')
|
||||||
@ -1158,6 +1164,8 @@ export default class Judge {
|
|||||||
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`])
|
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`])
|
||||||
} else {
|
} else {
|
||||||
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
|
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
|
||||||
|
this.isUdpEnd = true;
|
||||||
|
setTimeout(()=>{ closeAllFiles();},1000)
|
||||||
router.back();
|
router.back();
|
||||||
})
|
})
|
||||||
throw new Error('End Loop')
|
throw new Error('End Loop')
|
||||||
@ -1171,6 +1179,7 @@ export default class Judge {
|
|||||||
avPlayer.playAudio([voiceURL], true, () => {
|
avPlayer.playAudio([voiceURL], true, () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.isUdpEnd = true
|
this.isUdpEnd = true
|
||||||
|
setTimeout(()=>{ closeAllFiles();},1000)
|
||||||
router.back();
|
router.back();
|
||||||
}, param302 == 8 ? 3000 : 0)
|
}, param302 == 8 ? 3000 : 0)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export default class FilePhoto{
|
|||||||
(async ()=>{
|
(async ()=>{
|
||||||
//TODO 309参数 获取拍照摄像头拍照通道
|
//TODO 309参数 获取拍照摄像头拍照通道
|
||||||
const fileUtil = new FileUtil(context)
|
const fileUtil = new FileUtil(context)
|
||||||
const strConfig = await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/config/config3.txt');
|
const strConfig = await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt');
|
||||||
const config = JSON.parse(strConfig)
|
const config = JSON.parse(strConfig)
|
||||||
const {userName,ip,pwd,port,rlls,pztd} = config
|
const {userName,ip,pwd,port,rlls,pztd} = config
|
||||||
this.params = {userName,pwd,ip,port,rlls,pztd}
|
this.params = {userName,pwd,ip,port,rlls,pztd}
|
||||||
@ -39,7 +39,7 @@ export default class FilePhoto{
|
|||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
console.info('surenjun','拍照开始')
|
console.info('surenjun','拍照开始')
|
||||||
const res = await takePhoto(params, this.context, null,2);
|
const res = await takePhoto(params, this.context, 'pz/',2);
|
||||||
console.info('surenjun','拍照结束' + JSON.stringify(res))
|
console.info('surenjun','拍照结束' + JSON.stringify(res))
|
||||||
return res.base64
|
return res.base64
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user