2019-11-29 12:51:58 +08:00
|
|
|
import deviceType from '../../constant/deviceType';
|
|
|
|
|
|
|
|
class Model {
|
2020-03-13 16:35:03 +08:00
|
|
|
constructor() {
|
2020-05-09 18:48:08 +08:00
|
|
|
this.screenLine = 3;
|
2020-03-13 16:35:03 +08:00
|
|
|
// 公共字段部分默认初始值
|
|
|
|
this['public'] = {};
|
|
|
|
this['public'][deviceType.Signal] = {
|
|
|
|
lampPositionType: '02',
|
|
|
|
lampPostType: '02'
|
|
|
|
};
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-03-13 16:35:03 +08:00
|
|
|
// 私有字段部分默认初始值
|
|
|
|
this['private'] = {};
|
|
|
|
this['private'][deviceType.StationControl] = {
|
|
|
|
indicatorShow: true // 标识灯名称显示
|
|
|
|
};
|
2020-04-22 16:17:35 +08:00
|
|
|
this['private'][deviceType.Station] = {
|
|
|
|
kmPostShow: true // 公里标显示
|
|
|
|
};
|
2020-04-15 14:19:22 +08:00
|
|
|
this['private'][deviceType.Switch] = {
|
|
|
|
nameShow: true
|
|
|
|
};
|
2020-03-13 16:35:03 +08:00
|
|
|
this['private'][deviceType.Section] = {
|
2020-04-15 14:27:39 +08:00
|
|
|
nameShow: true,
|
2020-03-13 16:35:03 +08:00
|
|
|
borderBorderShow: true, // 区段边界显示
|
2020-04-15 14:19:22 +08:00
|
|
|
destinationNameShow: true, // 目的地码名称显示
|
2020-03-13 16:35:03 +08:00
|
|
|
standTrackNameShow: true, // 站台轨名称显示
|
|
|
|
reentryTrackNameShow: true, // 折返轨名称显示
|
|
|
|
transferTrackNameShow: true // 转换轨名称显示
|
|
|
|
};
|
|
|
|
this['private'][deviceType.Signal] = {
|
2020-04-03 18:09:07 +08:00
|
|
|
nameShow: true, // 信号机名称显示
|
2020-03-13 16:35:03 +08:00
|
|
|
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
|
|
|
|
atsAutoTriggerShow: true // ATS自动触发表示灯显示
|
|
|
|
};
|
|
|
|
this['private'][deviceType.Train] = {
|
|
|
|
};
|
|
|
|
this['private'][deviceType.TrainWindow] = {
|
|
|
|
trainWindowShow: true
|
|
|
|
};
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-03-13 16:35:03 +08:00
|
|
|
initPublicProps(model) {
|
|
|
|
if (model) {
|
|
|
|
var modelInitial = this.public[model._type];
|
|
|
|
if (modelInitial) {
|
|
|
|
for (var prop in modelInitial) {
|
|
|
|
model[prop] = modelInitial[prop];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-03-13 16:35:03 +08:00
|
|
|
return model;
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-03-13 16:35:03 +08:00
|
|
|
initPrivateProps(model) {
|
|
|
|
if (model) {
|
|
|
|
var modelInitial = this.private[model._type];
|
|
|
|
if (modelInitial) {
|
|
|
|
for (var prop in modelInitial) {
|
|
|
|
model[prop] = modelInitial[prop];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-03-13 16:35:03 +08:00
|
|
|
return model;
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new Model();
|