Update line_connection.ts
This commit is contained in:
parent
6e2f7e756d
commit
ae7050a719
|
|
@ -131,6 +131,7 @@ export default class LineConnection {
|
||||||
private outputLoadIosLicense: string | boolean
|
private outputLoadIosLicense: string | boolean
|
||||||
private listDeviceIos: string[]
|
private listDeviceIos: string[]
|
||||||
private debounceTimer: NodeJS.Timeout | null = null
|
private debounceTimer: NodeJS.Timeout | null = null
|
||||||
|
private testingPortPoE: boolean
|
||||||
|
|
||||||
constructor(config: LineConfig, socketIO: any, handleClearLine: () => void) {
|
constructor(config: LineConfig, socketIO: any, handleClearLine: () => void) {
|
||||||
this.config = config
|
this.config = config
|
||||||
|
|
@ -161,6 +162,7 @@ export default class LineConnection {
|
||||||
this.outputLoadIosLicense = ''
|
this.outputLoadIosLicense = ''
|
||||||
this.listDeviceIos = []
|
this.listDeviceIos = []
|
||||||
this.debounceTimer = null
|
this.debounceTimer = null
|
||||||
|
this.testingPortPoE = false
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Connect to line with socket
|
* Connect to line with socket
|
||||||
|
|
@ -213,16 +215,10 @@ export default class LineConnection {
|
||||||
this.outputPhysicalTest += message
|
this.outputPhysicalTest += message
|
||||||
if (this.debounceTimer) clearTimeout(this.debounceTimer)
|
if (this.debounceTimer) clearTimeout(this.debounceTimer)
|
||||||
|
|
||||||
this.debounceTimer = setTimeout(() => {
|
if (this.testingPortPoE)
|
||||||
this.flushLogBuffer()
|
this.debounceTimer = setTimeout(() => {
|
||||||
}, 1000) // 1s debounce
|
this.flushLogBuffer()
|
||||||
// const ports = this.physicalTest.handleLog(message)
|
}, 1000) // 1s debounce
|
||||||
// if (ports?.length)
|
|
||||||
// this.socketIO.emit('test_port_physical', {
|
|
||||||
// stationId,
|
|
||||||
// lineId: id,
|
|
||||||
// data: ports,
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
if (data.toString().includes('More') || data.toString().includes('MORE'))
|
if (data.toString().includes('More') || data.toString().includes('MORE'))
|
||||||
this.writeCommand(' ')
|
this.writeCommand(' ')
|
||||||
|
|
@ -1057,6 +1053,7 @@ export default class LineConnection {
|
||||||
this.config.runningPhysical = true
|
this.config.runningPhysical = true
|
||||||
this.config.runningScenario = 'Physical Test'
|
this.config.runningScenario = 'Physical Test'
|
||||||
const listPorts = await this.getPorts()
|
const listPorts = await this.getPorts()
|
||||||
|
this.testingPortPoE = true
|
||||||
this.socketIO.emit('running_scenario', {
|
this.socketIO.emit('running_scenario', {
|
||||||
stationId: this.config.stationId,
|
stationId: this.config.stationId,
|
||||||
lineId: this.config.id,
|
lineId: this.config.id,
|
||||||
|
|
@ -1110,6 +1107,7 @@ export default class LineConnection {
|
||||||
this.physicalTest.resetTestedPorts()
|
this.physicalTest.resetTestedPorts()
|
||||||
this.config.runningPhysical = false
|
this.config.runningPhysical = false
|
||||||
this.config.runningScenario = ''
|
this.config.runningScenario = ''
|
||||||
|
this.testingPortPoE = false
|
||||||
this.outputBuffer = ''
|
this.outputBuffer = ''
|
||||||
this.outputScenario = ''
|
this.outputScenario = ''
|
||||||
this.outputPhysicalTest = ''
|
this.outputPhysicalTest = ''
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue