Update line_connection.ts
This commit is contained in:
parent
fef82cb233
commit
52ef8f192f
|
|
@ -10,8 +10,6 @@ import {
|
|||
sleep,
|
||||
} from '../ultils/helper.js'
|
||||
import Scenario from '#models/scenario'
|
||||
import Station from '#models/station'
|
||||
import APCController from './apc_connection.js'
|
||||
import path from 'node:path'
|
||||
import axios from 'axios'
|
||||
import redis from '@adonisjs/redis/services/main'
|
||||
|
|
@ -288,26 +286,6 @@ export default class LineConnection {
|
|||
// )
|
||||
|
||||
this.client.write(cmd)
|
||||
if (userName) {
|
||||
// appendLog(
|
||||
// `\n---${userName}---\n`,
|
||||
// this.config.stationId,
|
||||
// this.config.lineNumber,
|
||||
// this.config.port
|
||||
// )
|
||||
// for (const char of command) {
|
||||
// if (char === '\x7F') this.bufferCommand = this.bufferCommand.slice(0, -1)
|
||||
// else if (char === '\r' && cleanData(this.bufferCommand).length > 0) {
|
||||
// this.config.commands = [
|
||||
// cleanData(this.bufferCommand.replace('\r', '')),
|
||||
// ...this.config.commands.filter(
|
||||
// (el) => el !== cleanData(this.bufferCommand.replace('\r', ''))
|
||||
// ),
|
||||
// ].slice(0, 10)
|
||||
// this.bufferCommand = ''
|
||||
// } else this.bufferCommand += char
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
async disconnect() {
|
||||
|
|
@ -473,7 +451,7 @@ export default class LineConnection {
|
|||
console.log(pid, scenario?.title, this.listScenarios)
|
||||
if (scenario && scenario.id !== script.id) {
|
||||
this.listScenarios.push(scenario.id)
|
||||
this.outputScenario = ''
|
||||
// this.outputScenario = ''
|
||||
this.runScript(scenario, userName)
|
||||
// this.socketIO.emit('confirm_scenario', {
|
||||
// scenario: scenario,
|
||||
|
|
|
|||
Loading…
Reference in New Issue