76 lines
1.9 KiB
Plaintext
Raw Normal View History

2024-01-05 11:11:15 +08:00
// @ts-nocheck
import hilog from '@ohos.hilog';
import apiJudgeSdk from 'libJudgeSdk.so';
2024-02-23 10:43:11 +08:00
import Judge from '../../judgeSDK/utils/judge-real'
2024-01-05 11:11:15 +08:00
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