chanmin0723's picture
Initial obcon SCADA deploy
e4bf523
Raw
History Blame Contribute Delete
6.6 kB
'use strict'
/**
* Copyright (c) 2017~2019, OBCon Inc.
* All rights reserved.
*/
/**
* @file
* @copyright 2017~2019, OBCon Inc.
* @author gye hyun james kim [pnuskgh@gmail.com]
*/
let Sequelize = require('sequelize'); //--- http://docs.sequelizejs.com/
let Model = utils.getClass('include', 'model.js');
//--- 배관링크는 SKT LoRa를 사용하지 않는다. by 박광서 상무, 2020.09.14
class Devicedata3sModel extends Model {
constructor() {
super();
this._title = '배관링크 데이터';
this._database = db.db_scada;
this._tableName = 'devicedata3';
this._define = config.databases.scada.define;
this._timestamps = false; //--- createdAt, updatedAt 필드를 사용하지 않는다.
}
get fields() {
return {
siteKey: {
type: Sequelize.STRING(8),
allowNull: false,
unique: false,
validate: {
},
title: '사이트',
strType: 'string'
},
type: {
type: Sequelize.STRING(2),
allowNull: false,
defaultValue: '3',
validate: {
},
title: '단말기 타입',
strType: 'select',
enum: this.getTypeEnum()
},
deviceKey: { //--- 장비 아이디, RTU ID
type: Sequelize.STRING(8),
allowNull: false,
unique: false,
validate: {
},
title: '아이디',
strType: 'string'
},
statusDatetime: { //--- 장비 상태 수집 일자 (YYYYMMDDHHmmss)
type: Sequelize.STRING(14),
allowNull: true,
validate: {
},
title: '발생일자',
strType: 'string'
},
pipeControl: { //--- 1. 배관연결, 0. 배관연결 해제
type: Sequelize.INTEGER(1),
allowNull: true,
validate: {
},
title: '제어값',
strType: 'integer'
},
preventPotential: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '방식 전위 1',
strType: 'float'
},
preventPotential2: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '방식 전위 2',
strType: 'float'
},
batteryVoltage: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '배터리 전압',
strType: 'float'
},
sensitivity: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '수신 감도',
strType: 'float'
},
dataMode: {
type: Sequelize.STRING(1),
allowNull: true,
validate: {
},
title: '데이터 모드',
strType: 'string',
enum: [
['0', '0. 통신주기(분)/수집주기(분)'],
['1', '1. 통신주기(시)/수집주기(분)'],
['2', '2. 통신주기(시)/수집주기(시)'],
['4', '4. PEAK MODE : 통신주기(분)/수집주기(분)'],
// ['6', '6. 서버 아이피 & 포트 변경'],
['9', '9. 실시간모드(30초)']
]
},
dataCycle: {
type: Sequelize.INTEGER(2),
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '수집 주기',
strType: 'integer'
},
networkCycle: {
type: Sequelize.INTEGER(2),
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '통신 주기',
strType: 'integer'
},
electric: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '전류',
strType: 'float'
},
temperature: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: '장치 온도',
strType: 'float'
},
humidity: {
type: Sequelize.INTEGER(3),
allowNull: true,
defaultValue: 0,
validate: {
},
title: '습도',
strType: 'integer'
},
ac1: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: 'AC 1 측정값',
strType: 'float'
},
ac2: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: 0.0,
validate: {
},
title: 'AC 2 측정값',
strType: 'float'
}
};
}
}
module.exports = Devicedata3sModel;