Update log

This commit is contained in:
andrew.ng 2026-05-25 14:09:13 +07:00
parent 9bae73193d
commit 7e43a0edc4
1 changed files with 8 additions and 1 deletions

View File

@ -131,6 +131,7 @@ export default class LineConnection {
private waitingScenario: boolean private waitingScenario: boolean
private outputInventory: string private outputInventory: string
private outputScenario: string private outputScenario: string
private outputALLScenario: string
private bufferLog: LogStreamBuffer private bufferLog: LogStreamBuffer
public dataDPELP: DataDPELP | string public dataDPELP: DataDPELP | string
private listScenarios: number[] private listScenarios: number[]
@ -161,6 +162,7 @@ export default class LineConnection {
this.waitingScenario = false this.waitingScenario = false
this.outputInventory = '' this.outputInventory = ''
this.outputScenario = '' this.outputScenario = ''
this.outputALLScenario = ''
this.bufferLog = new LogStreamBuffer() this.bufferLog = new LogStreamBuffer()
this.dataDPELP = { this.dataDPELP = {
line: this.config.lineNumber, line: this.config.lineNumber,
@ -234,6 +236,7 @@ export default class LineConnection {
this.outputBuffer += message this.outputBuffer += message
this.outputScenario += message this.outputScenario += message
this.outputTestLog += cleanData(data.toString()) this.outputTestLog += cleanData(data.toString())
this.outputALLScenario += cleanData(data.toString())
if (!this.config.inventory) if (!this.config.inventory)
this.outputInventory = this.outputInventory.slice(-3000) + message this.outputInventory = this.outputInventory.slice(-3000) + message
} }
@ -321,6 +324,8 @@ export default class LineConnection {
this.config.latestScenario = undefined this.config.latestScenario = undefined
this.physicalTest = new PhysicalPortTest([]) this.physicalTest = new PhysicalPortTest([])
this.config.isReady = false this.config.isReady = false
this.outputALLScenario = ''
this.outputTestLog = ''
// this.config.inventory = undefined // this.config.inventory = undefined
this.socketIO.emit('line_disconnected', { this.socketIO.emit('line_disconnected', {
stationId, stationId,
@ -491,6 +496,7 @@ export default class LineConnection {
}) })
this.outputBuffer = '' this.outputBuffer = ''
this.outputScenario = '' this.outputScenario = ''
this.outputALLScenario = ''
this.config.output += '\nTimeout run scenario\n' this.config.output += '\nTimeout run scenario\n'
this.dataDPELP = { this.dataDPELP = {
line: this.config.lineNumber, line: this.config.lineNumber,
@ -610,7 +616,7 @@ export default class LineConnection {
return return
} }
if (script?.send_result || script?.sendResult) { if (script?.send_result || script?.sendResult) {
const detectLog = await this.detectLogWithAI(this.outputTestLog) const detectLog = await this.detectLogWithAI(this.outputALLScenario)
const result = mapToLineFormat({ const result = mapToLineFormat({
lineNumber: this.config.lineNumber, lineNumber: this.config.lineNumber,
inventory: this.config.inventory, inventory: this.config.inventory,
@ -628,6 +634,7 @@ export default class LineConnection {
this.config.listFeatureTested = [ this.config.listFeatureTested = [
...new Set([...this.config.listFeatureTested, 'DPELP']), ...new Set([...this.config.listFeatureTested, 'DPELP']),
] ]
this.outputALLScenario = ''
// if (!this.config.listFeatureTested.includes('PHYSICAL')) this.runPhysicalTest() // if (!this.config.listFeatureTested.includes('PHYSICAL')) this.runPhysicalTest()
this.sendFeatureTested() this.sendFeatureTested()