优化udp

This commit is contained in:
lixiao 2025-02-17 10:30:31 +08:00
parent 78755f3eae
commit dcbcf9d1ad
2 changed files with 11 additions and 1 deletions

View File

@ -10,6 +10,7 @@ export async function sendMsg(val) {
// globalThis.udpClient1&&globalThis.udpClient1.sendMsg(val) // globalThis.udpClient1&&globalThis.udpClient1.sendMsg(val)
} }
// obj
export async function getUDP(context, errorFlag?) { export async function getUDP(context, errorFlag?) {
return new Promise(async (reslove, reject) => { return new Promise(async (reslove, reject) => {
const fileUtil = new FileUtil(context) const fileUtil = new FileUtil(context)
@ -76,6 +77,7 @@ export async function getUDP(context, errorFlag?) {
} }
// 中心
export async function getUDP2(context, errorFlag?) { export async function getUDP2(context, errorFlag?) {
const fileUtil = new FileUtil(context) const fileUtil = new FileUtil(context)
const carInfo=AppStorage.get('carInfo') const carInfo=AppStorage.get('carInfo')
@ -159,6 +161,7 @@ export async function getUDP2(context, errorFlag?) {
} }
// 灯光
export async function setTopLineUdp() { export async function setTopLineUdp() {
const context=AppStorage.get('context') const context=AppStorage.get('context')
const fileUtil = new FileUtil(context) const fileUtil = new FileUtil(context)
@ -181,6 +184,7 @@ export async function setTopLineUdp() {
// //
let judgeUdpTimer let judgeUdpTimer
// 评判
export async function setJudgeUdp() { export async function setJudgeUdp() {
const context=AppStorage.get('context') const context=AppStorage.get('context')
const fileUtil = new FileUtil(context) const fileUtil = new FileUtil(context)

View File

@ -72,4 +72,10 @@ class UdpClient {
} }
} }
export const udpClient = new UdpClient() export const objUDPClient = new UdpClient()
export const centerUDPClient = new UdpClient()
export const lightUDPClient = new UdpClient()
export const judgeUDPClient = new UdpClient()