Compare commits
	
		
			4 Commits
		
	
	
		
			16853a2cc5
			...
			ef2e07d1ac
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					ef2e07d1ac | ||
| 
						 | 
					bf7a06333d | ||
| 
						 | 
					175f9273c9 | ||
| 
						 | 
					78ed717b9e | 
@ -101,7 +101,6 @@ struct Index {
 | 
				
			|||||||
              gateway: this.inputTextList1[5], //value.gateway网关
 | 
					              gateway: this.inputTextList1[5], //value.gateway网关
 | 
				
			||||||
              netMask: this.inputTextList1[4], //value.netMask网络掩码
 | 
					              netMask: this.inputTextList1[4], //value.netMask网络掩码
 | 
				
			||||||
              dnsServers: this.inputTextList1[6],
 | 
					              dnsServers: this.inputTextList1[6],
 | 
				
			||||||
              domain: ""
 | 
					 | 
				
			||||||
            }, (error: BusinessError) => {
 | 
					            }, (error: BusinessError) => {
 | 
				
			||||||
              if (error) {
 | 
					              if (error) {
 | 
				
			||||||
                Prompt.showToast({
 | 
					                Prompt.showToast({
 | 
				
			||||||
 | 
				
			|||||||
@ -1,15 +1,15 @@
 | 
				
			|||||||
import router from '@ohos.router';
 | 
					import router from '@ohos.router';
 | 
				
			||||||
import FileLog from '../judgeSDK/utils/fileLog';
 | 
					 | 
				
			||||||
import RealTime from '../compontents/judge/RealTime';
 | 
					import RealTime from '../compontents/judge/RealTime';
 | 
				
			||||||
import { GPSData, SignalData } from '../../mock';
 | 
					import { GPSData, SignalData } from '../../mock';
 | 
				
			||||||
import { SignalDataType } from '../../model';
 | 
					import { SignalDataType } from '../../model';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component
 | 
					@Component
 | 
				
			||||||
export default struct SignDisplayCom {
 | 
					export default struct SignDisplayCom {
 | 
				
			||||||
  @State showBack: boolean = false
 | 
					  @State showBack: boolean = false
 | 
				
			||||||
  @Prop showTrajectory:boolean = false
 | 
					  @Prop showTrajectory: boolean = false
 | 
				
			||||||
  @State scaleNum: number = 1
 | 
					  @State scaleNum: number = 1
 | 
				
			||||||
  @State msg: string = ''
 | 
					  @State msg: string = ''
 | 
				
			||||||
  @State signArr: Array<any> = []
 | 
					  @State signArr: Array<string> = []
 | 
				
			||||||
  @State sjxhColum: Array<SignalDataType> = SignalData
 | 
					  @State sjxhColum: Array<SignalDataType> = SignalData
 | 
				
			||||||
  @State GPSColum: Array<SignalDataType> = GPSData
 | 
					  @State GPSColum: Array<SignalDataType> = GPSData
 | 
				
			||||||
  @State udplocalIp: string = ''
 | 
					  @State udplocalIp: string = ''
 | 
				
			||||||
@ -181,7 +181,7 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
          Row() {
 | 
					          Row() {
 | 
				
			||||||
            Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) {
 | 
					            Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) {
 | 
				
			||||||
              ForEach(this.sjxhColum, (item) => {
 | 
					              ForEach(this.sjxhColum, (item: SignalDataType) => {
 | 
				
			||||||
                Column() {
 | 
					                Column() {
 | 
				
			||||||
                  Text(`${item.key}:${item.value}`)
 | 
					                  Text(`${item.key}:${item.value}`)
 | 
				
			||||||
                    .fontSize(14 * this.ratio)
 | 
					                    .fontSize(14 * this.ratio)
 | 
				
			||||||
@ -216,7 +216,10 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
              Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
 | 
					              Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
 | 
				
			||||||
              Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
 | 
					              Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
 | 
				
			||||||
              Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
 | 
					              Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
 | 
				
			||||||
              Text('速度:' +((Number((this.signArr[97]||0))*1.852).toFixed(2)).toString()).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
 | 
					              Text('速度:' + ((Number((this.signArr[97] || 0)) * 1.852).toFixed(2)).toString())
 | 
				
			||||||
 | 
					                .fontColor('#FFB433')
 | 
				
			||||||
 | 
					                .fontSize(14 * this.ratio)
 | 
				
			||||||
 | 
					                .height(18 * this.ratio)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            .backgroundColor('#1A1A1A')
 | 
					            .backgroundColor('#1A1A1A')
 | 
				
			||||||
            .width(170 * this.ratio)
 | 
					            .width(170 * this.ratio)
 | 
				
			||||||
@ -231,9 +234,10 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
        .backgroundImage($r('app.media.km_open'))
 | 
					        .backgroundImage($r('app.media.km_open'))
 | 
				
			||||||
        .backgroundImageSize({ width: '100%', height: '100%' })
 | 
					        .backgroundImageSize({ width: '100%', height: '100%' })
 | 
				
			||||||
        .visibility(this.active == 0 ? Visibility.Visible : Visibility.None)
 | 
					        .visibility(this.active == 0 ? Visibility.Visible : Visibility.None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Column() {
 | 
					        Column() {
 | 
				
			||||||
          Column() {
 | 
					          Column() {
 | 
				
			||||||
            Text( this.msg || '0')
 | 
					            Text(this.msg || '0')
 | 
				
			||||||
              .fontColor('#FFF5E5')
 | 
					              .fontColor('#FFF5E5')
 | 
				
			||||||
              .fontSize(14 * this.ratio)
 | 
					              .fontSize(14 * this.ratio)
 | 
				
			||||||
              .width('100%')
 | 
					              .width('100%')
 | 
				
			||||||
@ -253,6 +257,7 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
        .backgroundImage($r('app.media.km_open'))
 | 
					        .backgroundImage($r('app.media.km_open'))
 | 
				
			||||||
        .backgroundImageSize({ width: '100%', height: '100%' })
 | 
					        .backgroundImageSize({ width: '100%', height: '100%' })
 | 
				
			||||||
        .visibility(this.active == 2 ? Visibility.Visible : Visibility.None)
 | 
					        .visibility(this.active == 2 ? Visibility.Visible : Visibility.None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Row() {
 | 
					        Row() {
 | 
				
			||||||
          Flex({ direction: FlexDirection.Column }) {
 | 
					          Flex({ direction: FlexDirection.Column }) {
 | 
				
			||||||
            Row() {
 | 
					            Row() {
 | 
				
			||||||
@ -271,7 +276,7 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
            }.margin({ top: 10 * this.ratio })
 | 
					            }.margin({ top: 10 * this.ratio })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Flex({ direction: FlexDirection.Column }) {
 | 
					            Flex({ direction: FlexDirection.Column }) {
 | 
				
			||||||
              ForEach(this.GPSColum, (item) => {
 | 
					              ForEach(this.GPSColum, (item: SignalDataType) => {
 | 
				
			||||||
                Column() {
 | 
					                Column() {
 | 
				
			||||||
                  Text(`${item.key}:${item.value}`)
 | 
					                  Text(`${item.key}:${item.value}`)
 | 
				
			||||||
                    .fontSize(12 * this.ratio)
 | 
					                    .fontSize(12 * this.ratio)
 | 
				
			||||||
@ -295,7 +300,7 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
          .width(550 * this.ratio)
 | 
					          .width(550 * this.ratio)
 | 
				
			||||||
          .height(380 * this.ratio)
 | 
					          .height(380 * this.ratio)
 | 
				
			||||||
          .backgroundColor('#1A1A1A')
 | 
					          .backgroundColor('#1A1A1A')
 | 
				
			||||||
          .margin({ top: 6 * this.ratio,})
 | 
					          .margin({ top: 6 * this.ratio, })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        .width(936 * this.ratio)
 | 
					        .width(936 * this.ratio)
 | 
				
			||||||
@ -322,12 +327,12 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
    // this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170'
 | 
					    // this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170'
 | 
				
			||||||
    this.ratio = this.ratio * (this.scaleNum || 1);
 | 
					    this.ratio = this.ratio * (this.scaleNum || 1);
 | 
				
			||||||
    const that = this
 | 
					    const that = this
 | 
				
			||||||
    const {showBack,getSignal} = this
 | 
					    const { showBack, getSignal } = this
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (showBack) {
 | 
					    if (showBack) {
 | 
				
			||||||
      this.ratio = 1.4
 | 
					      this.ratio = 1.4
 | 
				
			||||||
      globalThis.udpClient.onMessage_1&&globalThis.udpClient.onMessage_1((msg) => {
 | 
					      globalThis.udpClient.onMessage_1 && globalThis.udpClient.onMessage_1((msg) => {
 | 
				
			||||||
        console.log('getUDPonMessage_1bysignDisplay0', msg)
 | 
					        console.log('getUDPonMessage_1bysignDisplay0', msg)
 | 
				
			||||||
        if (msg) {
 | 
					        if (msg) {
 | 
				
			||||||
          getSignal(msg)
 | 
					          getSignal(msg)
 | 
				
			||||||
@ -336,7 +341,7 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      clearInterval(this.signalTimer)
 | 
					      clearInterval(this.signalTimer)
 | 
				
			||||||
      this.signalTimer = setInterval(() => {
 | 
					      this.signalTimer = setInterval(() => {
 | 
				
			||||||
        const msgStr = AppStorage.get('msgStr')
 | 
					        const msgStr = AppStorage.get<string>('msgStr')
 | 
				
			||||||
        if (msgStr) {
 | 
					        if (msgStr) {
 | 
				
			||||||
          getSignal(msgStr)
 | 
					          getSignal(msgStr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -352,7 +357,7 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
    const that = this
 | 
					    const that = this
 | 
				
			||||||
    const showBack = this.showBack;
 | 
					    const showBack = this.showBack;
 | 
				
			||||||
    if (showBack) {
 | 
					    if (showBack) {
 | 
				
			||||||
      globalThis.udpClient.onMessage_1&&globalThis.udpClient.onMessage_1((msg) => {
 | 
					      globalThis.udpClient.onMessage_1 && globalThis.udpClient.onMessage_1((msg) => {
 | 
				
			||||||
        console.log('getUDPonMessage_1bysignDisplay2', msg)
 | 
					        console.log('getUDPonMessage_1bysignDisplay2', msg)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        getSignal(msg)
 | 
					        getSignal(msg)
 | 
				
			||||||
@ -361,14 +366,14 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
      clearInterval(this.signalTimer)
 | 
					      clearInterval(this.signalTimer)
 | 
				
			||||||
      this.signalTimer = setInterval(() => {
 | 
					      this.signalTimer = setInterval(() => {
 | 
				
			||||||
        //TODO 临时方案
 | 
					        //TODO 临时方案
 | 
				
			||||||
        const msgStr =  AppStorage.get('msgStr')
 | 
					        const msgStr = AppStorage.get<string>('msgStr')
 | 
				
			||||||
        getSignal(msgStr)
 | 
					        getSignal(msgStr)
 | 
				
			||||||
      }, 200)
 | 
					      }, 200)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getSignal = (msg) => {
 | 
					  getSignal = (msg: string) => {
 | 
				
			||||||
    const that = this;
 | 
					    const that = this;
 | 
				
			||||||
    that.msg = msg
 | 
					    that.msg = msg
 | 
				
			||||||
    const strachArr = msg.split(',')
 | 
					    const strachArr = msg.split(',')
 | 
				
			||||||
@ -410,12 +415,12 @@ export default struct SignDisplayCom {
 | 
				
			|||||||
      this.GPSColum[t].value = this.signArr[i]
 | 
					      this.GPSColum[t].value = this.signArr[i]
 | 
				
			||||||
      t++
 | 
					      t++
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this.GPSColum[14].value = ((Number((this.signArr[97]||0))*1.852).toFixed(2)).toString()
 | 
					    this.GPSColum[14].value = ((Number((this.signArr[97] || 0)) * 1.852).toFixed(2)).toString()
 | 
				
			||||||
    const str0=this.signArr[93].substr(0,2)
 | 
					    const str0 = this.signArr[93].substr(0, 2)
 | 
				
			||||||
    const str1=this.signArr[93].substr(2,2)
 | 
					    const str1 = this.signArr[93].substr(2, 2)
 | 
				
			||||||
    const str2=this.signArr[93].substr(4.2)
 | 
					    const str2 = this.signArr[93].substr(4.2)
 | 
				
			||||||
    this.signArr[93]=str2+str1+str0
 | 
					    this.signArr[93] = str2 + str1 + str0
 | 
				
			||||||
    this.GPSColum[10].value =  this.signArr[93]
 | 
					    this.GPSColum[10].value = this.signArr[93]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // this.signArr[53]=192.168.7.170'
 | 
					    // this.signArr[53]=192.168.7.170'
 | 
				
			||||||
    this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum)))
 | 
					    this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum)))
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
import libJudgeSdk from 'libjudgesdk.so';
 | 
					import libJudgeSdk from 'libjudgesdk.so';
 | 
				
			||||||
import { JudgeInitObj } from '../../../model';
 | 
					import { JudgeBeginObj, JudgeInitObj, Plc } from '../../../model';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// import libJudgeSdk from '@ohos.judgesdk'
 | 
					// import libJudgeSdk from '@ohos.judgesdk'
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@ -44,7 +44,7 @@ export async function examJudgeInit(data: JudgeInitObj) {
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * @desc 执行实时考试过程 实时传递传感信息
 | 
					 * @desc 执行实时考试过程 实时传递传感信息
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
export async function examJudgeRealExam(data) {
 | 
					export async function examJudgeRealExam(data: Plc) {
 | 
				
			||||||
  const str = JSON.stringify(data);
 | 
					  const str = JSON.stringify(data);
 | 
				
			||||||
  const temp: number = libJudgeSdk.examJudgeRealExam(str, str.length);
 | 
					  const temp: number = libJudgeSdk.examJudgeRealExam(str, str.length);
 | 
				
			||||||
  return await handle(temp, 'examJudgeRealExam')
 | 
					  return await handle(temp, 'examJudgeRealExam')
 | 
				
			||||||
@ -115,7 +115,7 @@ export async function examJudgeMapSetDrawing(bool: boolean) {
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * @desc开始考试
 | 
					 * @desc开始考试
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
export async function examJudgeBeginExam(data) {
 | 
					export async function examJudgeBeginExam(data: JudgeBeginObj) {
 | 
				
			||||||
  const str = JSON.stringify(data);
 | 
					  const str = JSON.stringify(data);
 | 
				
			||||||
  const temp: number = libJudgeSdk.examJudgeBeginExam(str, str.length);
 | 
					  const temp: number = libJudgeSdk.examJudgeBeginExam(str, str.length);
 | 
				
			||||||
  return await handle(temp, 'examJudgeBeginExam')
 | 
					  return await handle(temp, 'examJudgeBeginExam')
 | 
				
			||||||
@ -169,7 +169,7 @@ export async function examJudgeMapSetScaling(scaling?: number) {
 | 
				
			|||||||
 *@desc设置考试过程数据回调
 | 
					 *@desc设置考试过程数据回调
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
export async function examJudgeSetPerformCallback(fn) {
 | 
					export async function examJudgeSetPerformCallback(fn: Function) {
 | 
				
			||||||
  const temp: number = libJudgeSdk.examJudgeSetPerformCallback(fn);
 | 
					  const temp: number = libJudgeSdk.examJudgeSetPerformCallback(fn);
 | 
				
			||||||
  return await handle(temp, 'examJudgeSetPerformCallback')
 | 
					  return await handle(temp, 'examJudgeSetPerformCallback')
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user