“wangzhongjie” e6420a333d 1111
2024-02-23 10:43:11 +08:00

76 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @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