调整福州线路顶部栏显示名称字段

This commit is contained in:
zyy 2020-04-15 14:19:22 +08:00
parent 39d32b8f5c
commit 0091a593e5
21 changed files with 1223 additions and 1201 deletions

View File

@ -230,78 +230,66 @@ export default class Section extends Group {
const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2; const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1; const drict = model.trainPosType != '01' ? 1 : -1;
/** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/ if (model.type == '01' && style.Section.text.show && model.nameShow) { // 物理区段名称
if (style.Section.logicText.show || style.Section.text.show) { const opposite = style.Section.text.opposite ? -1 : 1;
let tempx = x; const tempx = x + traingle.getSin(style.Section.text.distance);
let tempy = y; const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
// 创建区段名称 this.name = new ETextName({
if (model.type !== '03') { zlevel: this.zlevel,
if (model.type == '02') { z: this.z + 2,
const opposite = style.Section.logicText.opposite ? -1 : 1; style: this.style,
tempx += traingle.getSin(style.Section.logicText.distance); silent: false,
tempy += traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict); x: tempx + model.namePosition.x,
if (style.Section.logicText.show) { y: tempy + model.namePosition.y,
this.name = new ETextName({ fontWeight: style.Section.text.fontWeight,
zlevel: this.zlevel, fontSize: style.Section.text.fontSize,
z: this.z + 2, fontFamily: style.fontFamily,
style: this.style, text: model.name,
silent: false, textFill: style.Section.text.fontColor,
x: tempx + model.namePosition.x, textAlign: style.Section.text.textAlign,
y: tempy + model.namePosition.y, textPosition: style.Section.text.textPosition,
fontWeight: style.Section.logicText.fontWeight, textVerticalAlign: style.Section.text.textVerticalAlign
fontSize: style.Section.logicText.fontSize, });
fontFamily: style.fontFamily, this.add(this.name);
text: model.name, } else if (model.type == '02' && style.Section.logicText.show && model.nameShow) { // 逻辑区段
textFill: style.Section.logicText.fontColor, const opposite = style.Section.logicText.opposite ? -1 : 1;
textAlign: style.Section.logicText.textAlign, const tempx = x + traingle.getSin(style.Section.logicText.distance);
textPosition: style.Section.logicText.textPosition, const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
textVerticalAlign: style.Section.logicText.textVerticalAlign this.name = new ETextName({
}); zlevel: this.zlevel,
this.add(this.name); z: this.z + 2,
} style: this.style,
} else if (style.Section.text.show && !model.isSwitchSection) { silent: false,
const opposite = style.Section.text.opposite ? -1 : 1; x: tempx + model.namePosition.x,
tempx += traingle.getSin(style.Section.text.distance); y: tempy + model.namePosition.y,
tempy += traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict); fontWeight: style.Section.logicText.fontWeight,
this.name = new ETextName({ fontSize: style.Section.logicText.fontSize,
zlevel: this.zlevel, fontFamily: style.fontFamily,
z: this.z + 2, text: model.name,
style: this.style, textFill: style.Section.logicText.fontColor,
silent: false, textAlign: style.Section.logicText.textAlign,
x: tempx + model.namePosition.x, textPosition: style.Section.logicText.textPosition,
y: tempy + model.namePosition.y, textVerticalAlign: style.Section.logicText.textVerticalAlign
fontWeight: style.Section.text.fontWeight, });
fontSize: style.Section.text.fontSize, this.add(this.name);
fontFamily: style.fontFamily, } else if (model.type == '03' && model.nameShow) { // 道岔计轴区段
text: model.name, this.name = new ETextName({
textFill: style.Section.text.fontColor, zlevel: this.zlevel,
textAlign: style.Section.text.textAlign, z: this.z + 2,
textPosition: style.Section.text.textPosition, style: this.style,
textVerticalAlign: style.Section.text.textVerticalAlign silent: false,
}); x: x + model.namePosition.x,
this.add(this.name); y: y + model.namePosition.y + style.Section.text.distance * drict,
} fontWeight: style.Section.text.fontWeight,
} else { fontSize: style.Section.text.fontSize,
if (style.Section.text.show) { fontFamily: style.fontFamily,
this.name = new ETextName({ text: model.name,
zlevel: this.zlevel, textFill: style.Section.text.fontColor,
z: this.z + 2, textAlign: style.Section.text.textAlign,
style: this.style, textPosition: style.Section.text.textPosition,
silent: false, textVerticalAlign: style.Section.text.textVerticalAlign
x: tempx + model.namePosition.x, });
y: tempy + model.namePosition.y + style.Section.text.distance * drict, this.add(this.name);
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.text.fontColor,
textAlign: style.Section.text.textAlign,
textPosition: style.Section.text.textPosition,
textVerticalAlign: style.Section.text.textVerticalAlign
});
this.add(this.name);
}
}
} }
/** 站台轨名称*/ /** 站台轨名称*/
@ -374,7 +362,7 @@ export default class Section extends Group {
} }
/** 目的码名称*/ /** 目的码名称*/
if (model.destinationCode && style.Section.destinationText.show) { if (model.destinationCode && model.destinationNameShow && style.Section.destinationText.show) {
const opposite = style.Section.destinationText.opposite ? -1 : 1; const opposite = style.Section.destinationText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.destinationText.distance); const tempx = x + traingle.getSin(style.Section.destinationText.distance);
const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict); const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict);

View File

@ -5,70 +5,71 @@ import Group from 'zrender/src/container/Group';
import ETextName from '../element/ETextName'; // 名称文字 (共有) import ETextName from '../element/ETextName'; // 名称文字 (共有)
export default class Station extends Group { export default class Station extends Group {
constructor(model, style) { constructor(model, style) {
super(); super();
this._code = model.code; this._code = model.code;
this._type = model._type; this._type = model._type;
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.z = 40; this.z = 40;
this.model = model; this.model = model;
this.style = style; this.style = style;
this.create(); this.create();
this.setState(model); this.setState(model);
} }
create() { create() {
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
if (model.visible) { if (model.visible) {
// 公里标名称是否显示 // 公里标名称是否显示
this.stationText = new ETextName({ this.stationText = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
position: [0, 0], position: [0, 0],
x: model.position.x, x: model.position.x,
y: model.position.y, y: model.position.y,
fontWeight: model.fontWeight, fontWeight: model.fontWeight,
fontSize: model.nameFont || 18, fontSize: model.nameFont || 18,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
text: model.name, text: model.name,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top',
textFill: model.nameFontColor textFill: model.nameFontColor
}); });
this.add(this.stationText); this.add(this.stationText);
const path = window.location.href; const path = window.location.href;
if (style.Station.kmPostShow || path.includes('/map/draw')) { if (style.Station.kmPostShow || path.includes('/map/draw')) {
// 公里标是否显示 // 公里标是否显示
let direction = 1; let direction = 1;
if (this.style.Station.kilometerPosition == 'up') { if (this.style.Station.kilometerPosition == 'up') {
direction = -1; direction = -1;
} }
this.mileageText = new ETextName({ this.mileageText = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
position: [0, 0], position: [0, 0],
x: model.position.x, x: model.position.x,
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction), y: model.position.y + ((parseInt(model.nameFont) + 2) * direction),
fontWeight: model.fontWeight, fontWeight: model.fontWeight,
fontSize: model.kmPostFont || 18, fontSize: model.kmPostFont || 18,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
text: model.kmPost, text: model.kmPost,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top',
textFill: model.kmPostFontColor textFill: model.kmPostFontColor
}); });
this.add(this.mileageText); this.add(this.mileageText);
} model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
} }
} }
}
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
setState(model) { setState(model) {
} }
getShapeTipPoint() { getShapeTipPoint() {
return null; return null;
} }
} }

View File

@ -144,6 +144,7 @@ export default class Switch extends Group {
this.add(this.relocShelter); this.add(this.relocShelter);
this.add(this.releaseBackground); this.add(this.releaseBackground);
this.add(this.name); this.add(this.name);
style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide();
} }
createLockRect() { createLockRect() {

View File

@ -1,63 +1,67 @@
import deviceType from '../../constant/deviceType'; import deviceType from '../../constant/deviceType';
class Model { class Model {
constructor() { constructor() {
// 公共字段部分默认初始值 // 公共字段部分默认初始值
this['public'] = {}; this['public'] = {};
this['public'][deviceType.Signal] = { this['public'][deviceType.Signal] = {
lampPositionType: '02', lampPositionType: '02',
lampPostType: '02' lampPostType: '02'
}; };
// 私有字段部分默认初始值 // 私有字段部分默认初始值
this['private'] = {}; this['private'] = {};
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Section] = { this['private'][deviceType.Switch] = {
borderBorderShow: true, // 区段边界显示 nameShow: true
standTrackNameShow: true, // 站台轨名称显示 };
reentryTrackNameShow: true, // 折返轨名称显示 this['private'][deviceType.Section] = {
transferTrackNameShow: true // 转换轨名称显示 borderBorderShow: true, // 区段边界显示
}; destinationNameShow: true, // 目的地码名称显示
this['private'][deviceType.Signal] = { standTrackNameShow: true, // 站台轨名称显示
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 reentryTrackNameShow: true, // 折返轨名称显示
atsAutoTriggerShow: true // ATS自动触发表示灯显示 transferTrackNameShow: true // 转换轨名称显示
}; };
this['private'][deviceType.Train] = { this['private'][deviceType.Signal] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
nameFontSize: 10 // 字体大小 atsAutoTriggerShow: true // ATS自动触发表示灯显示
}; };
this['private'][deviceType.TrainWindow] = { this['private'][deviceType.Train] = {
trainWindowShow: true nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
}; nameFontSize: 10 // 字体大小
} };
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true
};
}
initPublicProps(model) { initPublicProps(model) {
if (model) { if (model) {
var modelInitial = this.public[model._type]; var modelInitial = this.public[model._type];
if (modelInitial) { if (modelInitial) {
for (var prop in modelInitial) { for (var prop in modelInitial) {
model[prop] = modelInitial[prop]; model[prop] = modelInitial[prop];
} }
} }
} }
return model; return model;
} }
initPrivateProps(model) { initPrivateProps(model) {
if (model) { if (model) {
var modelInitial = this.private[model._type]; var modelInitial = this.private[model._type];
if (modelInitial) { if (modelInitial) {
for (var prop in modelInitial) { for (var prop in modelInitial) {
model[prop] = modelInitial[prop]; model[prop] = modelInitial[prop];
} }
} }
} }
return model; return model;
} }
} }
export default new Model(); export default new Model();

View File

@ -37,53 +37,53 @@ import PassiveContorl from './passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout'; import PassiveTimeout from './passiveDialog/timeout';
export default { export default {
name: 'Menus', name: 'Menus',
components: { components: {
MenuBar, MenuBar,
MenuButton, MenuButton,
MenuCancel, MenuCancel,
MenuSignal, MenuSignal,
MenuSwitch, MenuSwitch,
MenuSection, MenuSection,
MenuStationControl, MenuStationControl,
MenuStationStand, MenuStationStand,
MenuStation, MenuStation,
MenuTrain, MenuTrain,
PassiveAlarm, PassiveAlarm,
PassiveContorl, PassiveContorl,
PassiveTimeout PassiveTimeout
}, },
props: { props: {
selected: { selected: {
type: Object, type: Object,
default() { default() {
return null; return null;
} }
} }
}, },
computed: { computed: {
...mapGetters('config', [ ...mapGetters('config', [
'width' 'width'
]), ]),
isShowAll() { isShowAll() {
return this.$route.params.mode !== 'dp' && return this.$route.params.mode !== 'dp' &&
this.$route.params.mode !== 'plan' && this.$route.params.mode !== 'plan' &&
this.$store.state.training.roles != 'BigScreen'; this.$store.state.training.roles != 'BigScreen';
}, },
isShowBar() { isShowBar() {
return this.$store.state.training.prdType; return this.$store.state.training.prdType;
} }
}, },
watch: { watch: {
isShowBar(val) { isShowBar(val) {
val && this.$store.dispatch('config/updateMenuBar'); val && this.$store.dispatch('config/updateMenuBar');
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar'); this.$store.dispatch('config/updateMenuBar');
}); });
} }
}; };
</script> </script>

File diff suppressed because it is too large Load Diff

View File

@ -1,63 +1,67 @@
import deviceType from '../../constant/deviceType'; import deviceType from '../../constant/deviceType';
class Model { class Model {
constructor() { constructor() {
// 公共字段部分默认初始值 // 公共字段部分默认初始值
this['public'] = {}; this['public'] = {};
this['public'][deviceType.Signal] = { this['public'][deviceType.Signal] = {
lampPositionType: '02', lampPositionType: '02',
lampPostType: '02' lampPostType: '02'
}; };
// 私有字段部分默认初始值 // 私有字段部分默认初始值
this['private'] = {}; this['private'] = {};
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Section] = { this['private'][deviceType.Switch] = {
borderBorderShow: true, // 区段边界显示 nameShow: true
standTrackNameShow: true, // 站台轨名称显示 };
reentryTrackNameShow: true, // 折返轨名称显示 this['private'][deviceType.Section] = {
transferTrackNameShow: true // 转换轨名称显示 borderBorderShow: true, // 区段边界显示
}; destinationNameShow: true, // 目的地码名称显示
this['private'][deviceType.Signal] = { standTrackNameShow: true, // 站台轨名称显示
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 reentryTrackNameShow: true, // 折返轨名称显示
atsAutoTriggerShow: true // ATS自动触发表示灯显示 transferTrackNameShow: true // 转换轨名称显示
}; };
this['private'][deviceType.Train] = { this['private'][deviceType.Signal] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
nameFontSize: 10 // 字体大小 atsAutoTriggerShow: true // ATS自动触发表示灯显示
}; };
this['private'][deviceType.TrainWindow] = { this['private'][deviceType.Train] = {
trainWindowShow: true nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
}; nameFontSize: 10 // 字体大小
} };
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true
};
}
initPublicProps(model) { initPublicProps(model) {
if (model) { if (model) {
var modelInitial = this.public[model._type]; var modelInitial = this.public[model._type];
if (modelInitial) { if (modelInitial) {
for (var prop in modelInitial) { for (var prop in modelInitial) {
model[prop] = modelInitial[prop]; model[prop] = modelInitial[prop];
} }
} }
} }
return model; return model;
} }
initPrivateProps(model) { initPrivateProps(model) {
if (model) { if (model) {
var modelInitial = this.private[model._type]; var modelInitial = this.private[model._type];
if (modelInitial) { if (modelInitial) {
for (var prop in modelInitial) { for (var prop in modelInitial) {
model[prop] = modelInitial[prop]; model[prop] = modelInitial[prop];
} }
} }
} }
return model; return model;
} }
} }
export default new Model(); export default new Model();

View File

@ -1,63 +1,67 @@
import deviceType from '../../constant/deviceType'; import deviceType from '../../constant/deviceType';
class Model { class Model {
constructor() { constructor() {
// 公共字段部分默认初始值 // 公共字段部分默认初始值
this['public'] = {}; this['public'] = {};
this['public'][deviceType.Signal] = { this['public'][deviceType.Signal] = {
lampPositionType: '02', lampPositionType: '02',
lampPostType: '02' lampPostType: '02'
}; };
// 私有字段部分默认初始值 // 私有字段部分默认初始值
this['private'] = {}; this['private'] = {};
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Section] = { this['private'][deviceType.Switch] = {
borderBorderShow: true, // 区段边界显示 nameShow: true
standTrackNameShow: true, // 站台轨名称显示 };
reentryTrackNameShow: true, // 折返轨名称显示 this['private'][deviceType.Section] = {
transferTrackNameShow: true // 转换轨名称显示 borderBorderShow: true, // 区段边界显示
}; destinationNameShow: true, // 目的地码名称显示
this['private'][deviceType.Signal] = { standTrackNameShow: true, // 站台轨名称显示
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 reentryTrackNameShow: true, // 折返轨名称显示
atsAutoTriggerShow: true // ATS自动触发表示灯显示 transferTrackNameShow: true // 转换轨名称显示
}; };
this['private'][deviceType.Train] = { this['private'][deviceType.Signal] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
nameFontSize: 10 // 字体大小 atsAutoTriggerShow: true // ATS自动触发表示灯显示
}; };
this['private'][deviceType.TrainWindow] = { this['private'][deviceType.Train] = {
trainWindowShow: true nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
}; nameFontSize: 10 // 字体大小
} };
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true
};
}
initPublicProps(model) { initPublicProps(model) {
if (model) { if (model) {
var modelInitial = this.public[model._type]; var modelInitial = this.public[model._type];
if (modelInitial) { if (modelInitial) {
for (var prop in modelInitial) { for (var prop in modelInitial) {
model[prop] = modelInitial[prop]; model[prop] = modelInitial[prop];
} }
} }
} }
return model; return model;
} }
initPrivateProps(model) { initPrivateProps(model) {
if (model) { if (model) {
var modelInitial = this.private[model._type]; var modelInitial = this.private[model._type];
if (modelInitial) { if (modelInitial) {
for (var prop in modelInitial) { for (var prop in modelInitial) {
model[prop] = modelInitial[prop]; model[prop] = modelInitial[prop];
} }
} }
} }
return model; return model;
} }
} }
export default new Model(); export default new Model();

View File

@ -190,9 +190,10 @@ export default {
// //
nameShow = false; nameShow = false;
let standTrackNameShow = false; const standTrackNameShow = this.nameLevels.indexOf(2) !== -1; //
let reentryTrackNameShow = false; const reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1; //
let transferTrackNameShow = false; const transferTrackNameShow = this.nameLevels.indexOf(6) !== -1; //
const destinationNameShow = this.nameLevels.indexOf(10) !== -1;
const sectionList = this.$store.getters['map/sectionList']; const sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
@ -213,22 +214,7 @@ export default {
} }
} }
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow, destinationNameShow }));
if (elem.isStandTrack) {
standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
}
//
if (elem.isReentryTrack) {
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1;
}
//
if (elem.isTransferTrack) {
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
}
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
}); });
} }

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -98,53 +98,49 @@ export default class Section extends Group {
const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2; const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1; const drict = model.trainPosType != '01' ? 1 : -1;
if (model.type == '01') { // 物理区段名称 if (model.type == '01' && model.nameShow && style.Section.text.show) { // 物理区段名称
if (style.Section.text.show) { const opposite = style.Section.text.opposite ? -1 : 1;
const opposite = style.Section.text.opposite ? -1 : 1; const tempx = x + traingle.getSin(style.Section.text.distance);
const tempx = x + traingle.getSin(style.Section.text.distance); const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict); this.name = new ETextName({
this.name = new ETextName({ zlevel: this.zlevel,
zlevel: this.zlevel, z: this.z + 2,
z: this.z + 2, style: this.style,
style: this.style, silent: false,
silent: false, x: tempx + model.namePosition.x,
x: tempx + model.namePosition.x, y: tempy + model.namePosition.y,
y: tempy + model.namePosition.y, fontWeight: style.Section.text.fontWeight,
fontWeight: style.Section.text.fontWeight, fontSize: style.Section.text.fontSize,
fontSize: style.Section.text.fontSize, fontFamily: style.fontFamily,
fontFamily: style.fontFamily, text: model.name,
text: model.name, textFill: style.Section.text.fontColor,
textFill: style.Section.text.fontColor, textAlign: style.Section.text.textAlign,
textAlign: style.Section.text.textAlign, textPosition: style.Section.text.textPosition,
textPosition: style.Section.text.textPosition, textVerticalAlign: style.Section.text.textVerticalAlign
textVerticalAlign: style.Section.text.textVerticalAlign });
}); this.add(this.name);
this.add(this.name); } else if (model.type == '02' && model.nameShow && style.Section.logicText.show) { // 逻辑区段
} const opposite = style.Section.logicText.opposite ? -1 : 1;
} else if (model.type == '02') { // 逻辑区段 const tempx = x + traingle.getSin(style.Section.logicText.distance);
if (style.Section.logicText.show) { const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
const opposite = style.Section.logicText.opposite ? -1 : 1; this.name = new ETextName({
const tempx = x + traingle.getSin(style.Section.logicText.distance); zlevel: this.zlevel,
const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict); z: this.z + 2,
this.name = new ETextName({ style: this.style,
zlevel: this.zlevel, silent: false,
z: this.z + 2, x: tempx + model.namePosition.x,
style: this.style, y: tempy + model.namePosition.y,
silent: false, fontWeight: style.Section.logicText.fontWeight,
x: tempx + model.namePosition.x, fontSize: style.Section.logicText.fontSize,
y: tempy + model.namePosition.y, fontFamily: style.fontFamily,
fontWeight: style.Section.logicText.fontWeight, text: model.name,
fontSize: style.Section.logicText.fontSize, textFill: style.Section.logicText.fontColor,
fontFamily: style.fontFamily, textAlign: style.Section.logicText.textAlign,
text: model.name, textPosition: style.Section.logicText.textPosition,
textFill: style.Section.logicText.fontColor, textVerticalAlign: style.Section.logicText.textVerticalAlign
textAlign: style.Section.logicText.textAlign, });
textPosition: style.Section.logicText.textPosition, this.add(this.name);
textVerticalAlign: style.Section.logicText.textVerticalAlign } else if (model.type == '04' && model.nameShow) { // 道岔计轴区段
});
this.add(this.name);
}
} else if (model.type == '04') { // 道岔计轴区段
this.name = new ETextName({ this.name = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 2, z: this.z + 2,
@ -234,7 +230,7 @@ export default class Section extends Group {
} }
/** 目的码名称*/ /** 目的码名称*/
if (model.destinationCode && style.Section.destinationText.show) { if (model.destinationCode && model.destinationNameShow && style.Section.destinationText.show) {
const opposite = style.Section.destinationText.opposite ? -1 : 1; const opposite = style.Section.destinationText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.destinationText.distance); const tempx = x + traingle.getSin(style.Section.destinationText.distance);
const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict); const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict);

View File

@ -82,6 +82,7 @@ export default class Station extends Group {
textFill: model.kmPostFontColor textFill: model.kmPostFontColor
}); });
this.add(this.mileageText); this.add(this.mileageText);
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
} }
if (model.subheadDisplay) { // 副标题 if (model.subheadDisplay) { // 副标题
this.subheadText = new ETextName({ this.subheadText = new ETextName({

View File

@ -161,6 +161,7 @@ export default class Switch extends Group {
this.add(this.sheltertriangle); this.add(this.sheltertriangle);
this.add(this.releaseBackground); this.add(this.releaseBackground);
this.add(this.name); this.add(this.name);
style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide();
} }
createLockRect() { createLockRect() {

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = { this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示 indicatorShow: true // 标识灯名称显示
}; };
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = { this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示 borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示 standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示 transferTrackNameShow: true // 转换轨名称显示