fix: 济南后置机方案
This commit is contained in:
		
							parent
							
								
									912f5636db
								
							
						
					
					
						commit
						0d6b3c7c07
					
				| @ -1,8 +1,8 @@ | ||||
| import { getSyncData } from '../common/service/initable'; | ||||
| import request from "../common/utils/request" | ||||
| let baseHost = globalThis.host; | ||||
| import request from '../common/utils/request'; | ||||
| import FileUtil from '../common/utils/File'; | ||||
| import FileLog from '../pages/judgeSDK/utils/fileLog'; | ||||
| 
 | ||||
| let baseHost = globalThis.host; | ||||
| 
 | ||||
| //监管接口序列号映射
 | ||||
| const gjxlhObj = { | ||||
| @ -28,9 +28,15 @@ export default async function writeObjectOutNew(data,filePath): Promise<WR> { | ||||
| 
 | ||||
|   if (filePath) { | ||||
|     await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify({ | ||||
|       wglb,jkxlh,glbm,jgbh,sjbs, | ||||
|       wglb, | ||||
|       jkxlh, | ||||
|       glbm, | ||||
|       jgbh, | ||||
|       sjbs, | ||||
|       data: params.data, | ||||
|       file:{...params.file,param:[]}, | ||||
|       file: { | ||||
|         ...params.file, param: [] | ||||
|       }, | ||||
|     })); | ||||
|   } | ||||
| 
 | ||||
|  | ||||
| @ -13,13 +13,13 @@ | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| // @ts-ignore
 | ||||
| import socket, { UDPSocket } from '@ohos.net.socket'; | ||||
| import { Array2Byte, dateFormat, fillZero, string2Bytes } from '../utils/tools'; | ||||
| import FileUtil from '../../common/utils/File'; | ||||
| import prompt from '@ohos.prompt'; | ||||
| import promptAction from '@ohos.promptAction'; | ||||
| import { getUDP } from './GlobalUdp'; | ||||
| import UdpByOne from './UdpByOne'; | ||||
| 
 | ||||
| const TAG = '[UdpDemo.UdpClient]' | ||||
| 
 | ||||
| @ -47,7 +47,6 @@ export default class UdpClientByCenter { | ||||
|   private isWorking: Boolean = false | ||||
|   private plcUdpError = false; | ||||
|   private initParam | ||||
|   private UPDOne: any | ||||
| 
 | ||||
|   constructor(udplocalIp: string, udplocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) { | ||||
|     this.localIp = udplocalIp | ||||
| @ -58,7 +57,6 @@ export default class UdpClientByCenter { | ||||
|     } | ||||
|     this.udp = socket.constructUDPSocketInstance(); | ||||
|     this.initPath() | ||||
|     this.UPDOne = new UdpByOne() | ||||
|   } | ||||
| 
 | ||||
|   getStatus() { | ||||
| @ -257,16 +255,10 @@ export default class UdpClientByCenter { | ||||
|         list.push(arr[i]) | ||||
|       } | ||||
|       this.stashFn({ | ||||
|         id, | ||||
|         length, | ||||
|         body: list, | ||||
|         sendId: this.sendId | ||||
|         id, length, body: list, sendId: this.sendId | ||||
|       }) | ||||
|       callback({ | ||||
|         id, | ||||
|         length, | ||||
|         body: list, | ||||
|         sendId: this.sendId | ||||
|         id, length, body: list, sendId: this.sendId | ||||
|       }) | ||||
| 
 | ||||
| 
 | ||||
| @ -298,15 +290,12 @@ export default class UdpClientByCenter { | ||||
|     }) | ||||
|   } | ||||
| 
 | ||||
|   // TODO 赋值onMessage_1
 | ||||
|   //plc
 | ||||
|   onMessage_1(callback?) { | ||||
|     this.onMessage_1Callback = callback; | ||||
|     this.UPDOne.receiveMsg(callback); | ||||
|     // this.udp && this.udp.on('message', this.message_1Fn);
 | ||||
|     this.udp && this.udp.on('message', this.message_1Fn); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   closeMessage_1() { | ||||
|     console.info('surenjun', 'getUDP关闭udp message监听事件') | ||||
|     this.udp.off('message', this.message_1Fn); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user