export const monitorDataGroupArr = [ [1, 2], [3, 4], [5, 6], ]; export const prefix = ['Compressor', 'Compressor', 'PreFan']; export const preMonitorList = [ { title: `供气压力`, code: `CompressorGasSupplyPressure`, unit: 'MPa', child: [], }, { title: `排气温度`, code: `CompressorExhaustTemp`, unit: '℃', child: [], }, { title: `电机电流`, code: `CompressorCurrentA`, unit: 'A', child: [], }, { title: `加载时间`, code: `CompressorLoadTime`, unit: 'h', child: [], }, { title: `运行时间`, code: `CompressorRunTime`, unit: 'h', child: [], }, { code: 'signal', child: [ { title: `运行信号`, code: `CompressorWorking`, }, { title: `故障信号`, code: `CompressorFault`, }, ], }, { code: 'signal', child: [ { title: `闸阀关到位`, code: `CompressorGateValveOpen`, }, { title: `闸阀关到位`, code: `CompressorGateValveShut`, }, ], }, ]; export const cqgMonitorList = [ { title: `风包压力`, code: `CompressorWindBagPressure`, unit: 'MPa', child: [], }, { title: `风包温度`, code: `CompressorWindBagTemp`, unit: '℃', child: [], }, ]; export const preFanMonitorData = [ { title: '前轴温度', code: 'PreFanFrontTemp', unit: '℃', }, { title: '后轴温度', code: 'PreFanBehindTemp', unit: '℃', }, { title: '垂直振动值', code: 'PreFanVerticalVibration', unit: 'mm', }, { title: '水平振动值', code: 'PreFanLevelVibration', unit: 'mm', }, { title: '外壳温度', code: 'PreFanShellTemp', unit: '℃', }, { title: '系统故障', code: 'PreFanSystemFault', unit: 'signal', }, { title: '启动故障', code: 'PreFanStartFault', unit: 'signal', }, { title: '阀门故障', code: 'PreFanValveFault', unit: 'signal', }, ]; export const totalData = [ { title: '总压力', code: 'MainPipePressure', unit: 'MPa', }, ]; export type State = { isRun: boolean; fault: boolean; }; export function getSysState(monitorData) { const stateArr = []; monitorDataGroupArr.forEach((group) => { const stateObj = { isRun: false, fault: false }; group.forEach((item) => { if (monitorData['CompressorWorking'.replace('Compressor', 'Compressor' + item)]) { stateObj.isRun = monitorData['CompressorWorking'.replace('Compressor', 'Compressor' + item)] == '1'; } monitorData['CompressorFault'.replace('Compressor', 'Compressor' + item)] === undefined ? '-' : monitorData['CompressorFault'.replace('Compressor', 'Compressor' + item)]; monitorData['PreFanSystemFault'.replace('PreFan', 'PreFan' + item)] === undefined ? '-' : monitorData['PreFanSystemFault'.replace('PreFan', 'PreFan' + item)]; monitorData['PreFanStartFault'.replace('PreFan', 'PreFan' + item)] === undefined ? '-' : monitorData['PreFanStartFault'.replace('PreFan', 'PreFan' + item)]; monitorData['PreFanValveFault'.replace('PreFan', 'PreFan' + item)] === undefined ? '-' : monitorData['PreFanValveFault'.replace('PreFan', 'PreFan' + item)]; stateObj.fault = monitorData['CompressorFault'.replace('Compressor', 'Compressor' + item)] == '1' || monitorData['PreFanSystemFault'.replace('PreFan', 'PreFan' + item)] == '1' || monitorData['PreFanStartFault'.replace('PreFan', 'PreFan' + item)] == '1' || monitorData['PreFanValveFault'.replace('PreFan', 'PreFan' + item)] == '1'; }); stateArr.push(stateObj); }); return stateArr; }