fix: 解决轨迹黑屏问题

This commit is contained in:
wangzhongjie 2025-07-29 15:35:26 +08:00
parent 2a2fd3767d
commit 93cec28b1f
3 changed files with 16 additions and 16 deletions

View File

@ -7,10 +7,9 @@ import {
WorkerBackMessage,
WorkerBackMessageType
} from '../../model';
import apiJudgeSdk from '@ohos.judgesdk';
import { DifferentialAndSignal } from '../../utils/business/DifferentialAndSignalWorker';
import { examJudgeMapSetScaling } from '../Judge/JudgeUtils';
import { examJudgeMapSetDrawing, examJudgeMapSetScaling } from '../Judge/JudgeUtils';
import { dConsole } from '../../utils/LogWorker';
import { SignDisplayTag } from '../../config';
@ -198,17 +197,18 @@ struct trajectoryComponent {
XComponent({
id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称注意这个ID要和C++侧一致,不能变
type: 'surface',
libraryname: 'JudgeSdk'
// libraryname: 'judgesdk'
// libraryname: 'JudgeSdk'
libraryname: 'judgesdk'
})
.width("100%")
.height("100%")
.onLoad(() => {
apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹false:表示结束绘制
dConsole.log("开始绘制")
examJudgeMapSetDrawing(true)
})
.onDestroy(() => {
apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹false:表示结束绘制
// clearInterval(globalThis.realTimer)
dConsole.log("结束绘制")
examJudgeMapSetDrawing(false)
})
Row() {
Image($rawfile('judge/big.png')).width(60).onClick(() => {

View File

@ -1876,7 +1876,7 @@ export default class Judge {
}
//日志回调
dConsole.info(JudgeTag, '1.进入评判入口')
await examJudgeSetLogCallback(3, async (level: number, info: string, len: number) => {
await examJudgeSetLogCallback(6, async (level: number, info: string, len: number) => {
dConsole.log(JudgeTag, '评判日志:' + info)
// await fileLog?.setExamJudgeLogData(info);
dConsole.writeProcessData(ProcessDataEnumType.JudgeLogData, info)

View File

@ -17,7 +17,6 @@ import { CenterUDPBusinessInstance } from './CenterUdpBusiness';
import { ObtainUdpBusinessInstance } from './ObtainUdpBusiness';
import systemTime from '@ohos.systemDateTime';
import { SerialNumberInstance } from '../SerialNumber';
import { examCalcGpsDistance } from '../../pages/Judge/JudgeUtils';
import { GetDwStatusType, GetTranslateSignals } from '../../pages/Judge/utils';
@ -194,13 +193,14 @@ class JudgeUdpBusiness {
const wd = this.convertGpsCoord2(Number(msgArr[95]) || 0);
this.sendData(bytes)
if (prevJd && Number(msgArr[83]) === 4) {
await examCalcGpsDistance({
jd1: prevJd,
wd1: preWd,
jd2: jd,
wd2: wd,
h: Number(msgArr[90]) || 1,
})
//TODO 解决轨迹黑屏
// await examCalcGpsDistance({
// jd1: prevJd,
// wd1: preWd,
// jd2: jd,
// wd2: wd,
// h: Number(msgArr[90]) || 1,
// })
}
prevJd = jd;
preWd = wd;