'换火20min,缩放校正,换火时间预置'

This commit is contained in:
gtz
2023-09-11 16:04:44 +08:00
parent b9f191459f
commit 448082e74f
4 changed files with 14 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ import utils from './utils';
const wss = new WebSocketServer({ port: 9800 });
const frequency = 10; // seconds
const frequency1 = 1200; // seconds
wss.on('connection', function (ws, req) {
// console.log("ws", ws);
console.log(
@@ -26,7 +27,6 @@ wss.on('connection', function (ws, req) {
const timer = setInterval(() => {
sendMsg(ws, 'kiln-info'); // 窑炉信息
sendMsg(ws, 'run-state'); // 运行状态
sendMsg(ws, 'energy-cost'); // 运行状态
sendMsg(ws, 'realtime');
sendMsg(ws, 'his-trend');
@@ -35,9 +35,14 @@ wss.on('connection', function (ws, req) {
// sendMsg(ws, 'kiln-bottom');
}, frequency * 1000);
const timer1 = setInterval(() => {
sendMsg(ws, 'run-state'); // 运行状态
}, frequency1 * 1000);
ws.on('close', function () {
console.log('停止监听');
clearInterval(timer);
clearInterval(timer1);
});
});

View File

@@ -17,9 +17,9 @@
"gasii": "...m³"
},
"runState": {
"lastFireChangeTime": "3分28秒",
"fireChangeTime": "20:00",
"fireDirection": "火"
"lastFireChangeTime": "19分28秒",
"fireChangeTime": "19:56",
"fireDirection": "火"
},
"fan": [
["8#压延冷却风机", "4373Hz", "正常"],