obcon-scada / app /modules /devices /setting.js
chanmin0723's picture
Initial obcon SCADA deploy
e4bf523
Raw
History Blame Contribute Delete
5.3 kB
'use strict'
/**
* Copyright (c) 2017~2023, OBCon Inc.
* All rights reserved.
*/
/**
* @file
* @copyright 2017~2023, OBCon Inc.
* @author gye hyun james kim [pnuskgh@gmail.com]
*/
const Setting = utils.getClass('include', 'setting.js');
class DevicesSetting extends Setting {
constructor() {
super();
}
getSettings() {
return {
//--- To-Do: 사용하는 type만 설정할 것 (검토 필요)
types: [ //--- 주의: 사용하지 않더라도 모든 타입이 표시되어야 한다 .
{ name: '1', title: '정류기', use: true, color: 'blue' },
{ name: '2', title: '원격 TB', use: true, color: 'green' },
{ name: '3', title: '배관링크', use: true, color: '#E675C4' },
{ name: '4', title: '수위센서', use: true, color: '#BDC000' },
{ name: '5', title: '관말압력', use: true, color: '#5E4485' },
{ name: '6', title: '특정정압기', use: true, color: '#8E5547' },
{ name: '7', title: '수신감도', use: true, color: '#00BFD2' },
{ name: '8', title: '범용장비1', use: true, color: '#00BFFF' }, //--- #FF8000
{ name: 'A', title: '두께측정장비', use: true, color: '#FF8000' },
{ name: 'B', title: '정압기 압력 자동 조절 장치', use: true, color: '#9664C0' }
],
typeEnum: [ //--- 사용하는 type만 정의 한다.
['1', '정류기'], ['2', '원격 TB'], ['3', '배관링크'], ['4', '수위센서'], ['5', '관말압력'],
['6', '특정정압기'], ['7', '수신감도'], ['8', '범용장비1'], ['A', '두께측정장비'], , ['B', '정압기 압력 자동 조절 장치']
],
interfaces: {
versionDefault: '1.00',
folders: { //--- Folder에서 Interface를 찾는 version의 순서
type_default: [ '1.03', '1.02', '1.01', '1.00' ], //--- 타입 지정이 안되어 있는 경우
type_1: [ '1.02', '1.01', '1.00' ],
type_2: [ '1.03', '1.02', '1.01', '1.00' ],
type_3: [ '1.02', '1.01', '1.00' ],
type_4: [ '1.00' ],
type_5: [ '1.02', '1.01', '1.00' ],
type_6: [ '1.00' ],
type_7: [ '1.00' ],
type_8: [ '1.00' ],
type_A: [ '1.00' ],
type_B: [ '1.00' ]
},
versionEnum: [
['1.03', '버전 1.03'],
['1.02', '버전 1.02'],
['1.01', '버전 1.01'],
['1.00', '버전 1.00']
]
},
dashboardDetail: { //--- 모듈의 action별 설정
maxSelect: 1
},
map: {
layout: 'map_1.ejs' //--- map_1.ejs, map_2.ejs. 2020년 1월 22일 현재, 더이상 사용하지 않는 기능임
},
};
}
getInterfaceVersionEnum(type) {
const versions = this.getSettings().interfaces.folders[`type_${type}`];
const rtEnum = [];
for (let idx = versions.length - 1; idx >= 0; idx--) {
let version = versions[idx];
rtEnum.push([ version, `버전 ${version}` ]);
}
return rtEnum;
}
getDataModeEnum(type) {
switch(`${type}`) {
case '7': //--- 수신감도
return [
['0', '통신주기(분)'],
['1', '통신주기(시)']
];
break;
case '8': //--- 범용장비
case 'B': //--- SPC
return [
['1', '통신주기(초)/수집주기(초)'],
['2', '통신주기(분)/수집주기(초)'],
['3', '통신주기(분)/수집주기(분)'],
// ['4', '통신주기(시)/수집주기(초)'],
// ['5', '통신주기(시)/수집주기(분)'],
// ['6', '통신주기(시)/수집주기(시)']
];
break;
case 'A': //--- 두께측정장비
return [
['3', '통신주기(분)/수집주기(분)'],
['5', '통신주기(시)/수집주기(분)'],
['6', '통신주기(시)/수집주기(시)']
];
break;
default:
return [
['0', '통신주기(분)/수집주기(분)'],
['1', '통신주기(시)/수집주기(분)'],
['2', '통신주기(시)/수집주기(시)']
];
break;
}
}
}
module.exports = DevicesSetting;