// @ts-nocheck import hilog from '@ohos.hilog'; import apiJudgeSdk from 'libJudgeSdk.so'; import Judge from '../../judgeSDK/utils/judge-real' import {Project,ProjectObj,MarkRule} from '../../judgeSDK/api/judgeSDK.d' import common from '@ohos.app.ability.common'; @Component struct RealTime { constructor() { super() } private height:number = 0 private width:number = 0 @State message: string = '开始绘制' // 控制XComponent组件的创建和销毁 @State draw: boolean = false //监管接口序列号 @State serialNumber:number = 0 //模拟考试项目 @State projects:Project[] = [] @State projectsObj:ProjectObj = {} @State markRuleListObj:MarkRule ={} private context = getContext(this) as common.UIAbilityContext; // xcomponentController: XComponentController = new XComponentController() build() { Row() { Column() { if (this.draw) { XComponent({ id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 type: 'surface', libraryname: 'JudgeSdk' }) .width(this.width) .height(this.height) .onLoad(() => { apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹,false:表示结束绘制 }) .onDestroy(() => { apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹,false:表示结束绘制 this.draw = false; clearInterval(globalThis.realTimer) }) } else { Column() {} .width(this.width) .height(this.height) } } .width('100%') .backgroundColor('#fff') } .height('100%') } async aboutToAppear() { const judge = new Judge(this) } aboutToDisappear() { //apiJudgeSdk.stopRender(); } } export default RealTime