This commit is contained in:
zyy 2019-07-24 14:33:56 +08:00
commit 42ae0b4a0d
20 changed files with 113 additions and 59 deletions

View File

@ -36,11 +36,13 @@ export default class LcControl extends Group {
position: [0, 0], position: [0, 0],
x: model.position.x, x: model.position.x,
y: model.position.y + this.style.zcControlmodeR + this.style.nameDistance, y: model.position.y + this.style.zcControlmodeR + this.style.nameDistance,
fontWeight: 'normal',
fontSize: this.style.stationControlTextSize,
fontFamily: this.style.textFontFormat,
text: model.name, text: model.name,
textFill: '#fff', textFill: '#fff',
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top'
textFont: this.style.stationControlTextSize + 'px ' + this.style.textFontFormat
}, },
style: this.style style: this.style
}); });

View File

@ -35,11 +35,13 @@ export default class LimitControl extends Group {
position: [0, 0], position: [0, 0],
x: model.position.x, x: model.position.x,
y: model.position.y + this.style.zcControlmodeR + this.style.nameDistance, y: model.position.y + this.style.zcControlmodeR + this.style.nameDistance,
fontWeight: 'normal',
fontSize: this.style.stationControlTextSize,
fontFamily: this.style.textFontFormat,
text: model.name, text: model.name,
textFill: '#fff', textFill: '#fff',
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top'
textFont: this.style.stationControlTextSize + 'px ' + this.style.textFontFormat
}, },
style: this.style style: this.style
}); });

View File

@ -161,20 +161,22 @@ export default class Section extends Group {
} }
// 创建区段名称 // 创建区段名称
const fontSize = style.type == '02' ? style.Section.text.fontSize + 2 : style.Section.text.fontSize; const fontSize = model.type == '02' ? style.Section.text.fontSize + 2: style.Section.text.fontSize;
this.sectionText = new ETextName({ this.sectionText = new ETextName({
_subType: 'Text',
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 6, z: this.z + 6,
style: this.style,
silent: false,
x: tempx, x: tempx,
y: tempy, y: tempy,
fontWeight: 'bold',
fontSize: fontSize,
fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textFont: fontSize + 'px ' + style.Section.text.fontFormat,
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
style: this.style
}); });
this.add(this.sectionText); this.add(this.sectionText);
} }
@ -195,8 +197,10 @@ export default class Section extends Group {
z: 6, z: 6,
x: tempx + model.standTrackNamePosition.x, x: tempx + model.standTrackNamePosition.x,
y: tempy + model.standTrackNamePosition.y, y: tempy + model.standTrackNamePosition.y,
fontWeight: 'bold',
fontSize: style.Section.text.fontSize,
fontFamily: style.textFontFormat,
text: model.standTrackName, text: model.standTrackName,
textFont: style.Section.text.fontSize + 'px ' + style.Section.text.fontFormat,
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,
@ -214,8 +218,10 @@ export default class Section extends Group {
z: 6, z: 6,
x: x + model.reentryTrackNamePosition.x, x: x + model.reentryTrackNamePosition.x,
y: y + model.reentryTrackNamePosition.y + style.nameDistance + style.Section.text.fontSize, y: y + model.reentryTrackNamePosition.y + style.nameDistance + style.Section.text.fontSize,
fontWeight: 'bold',
fontSize: style.Section.text.fontSize,
fontFamily: style.textFontFormat,
text: model.reentryTrackName, text: model.reentryTrackName,
textFont: style.Section.text.fontSize + 'px ' + style.Section.text.fontFormat,
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,
@ -233,8 +239,10 @@ export default class Section extends Group {
z: 6, z: 6,
x: x + model.transferTrackNamePosition.x, x: x + model.transferTrackNamePosition.x,
y: y + model.transferTrackNamePosition.y + style.nameDistance + style.Section.text.fontSize * 2, y: y + model.transferTrackNamePosition.y + style.nameDistance + style.Section.text.fontSize * 2,
fontWeight: 'bold',
fontSize: style.Section.text.fontSize,
fontFamily: style.textFontFormat,
text: model.transferTrackName, text: model.transferTrackName,
textFont: style.Section.text.fontSize + 'px ' + style.Section.text.fontFormat,
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,
@ -252,8 +260,10 @@ export default class Section extends Group {
z: 6, z: 6,
x: x + model.destinationCodePoint.x, x: x + model.destinationCodePoint.x,
y: y + model.destinationCodePoint.y, y: y + model.destinationCodePoint.y,
fontWeight: 'bold',
fontSize: style.Section.text.fontSize,
fontFamily: style.textFontFormat,
text: model.destinationCode, text: model.destinationCode,
textFont: style.Section.text.fontSize + 'px ' + style.Section.text.fontFormat,
textFill: style.destinationTextFontColor, textFill: style.destinationTextFontColor,
textAlign: style.Section.text.textAlign, textAlign: style.Section.text.textAlign,
textPosition: style.Section.text.textPosition, textPosition: style.Section.text.textPosition,

View File

@ -21,8 +21,10 @@ class ESigDelay extends Group {
style: { style: {
x: model.x, x: model.x,
y: model.y, y: model.y,
fontWeight: model.fontWeight,
fontSize: model.fontSize,
fontFamily: model.fontFamily,
text: model.text, text: model.text,
textFont: model.textFont,
textFill: model.textFill, textFill: model.textFill,
textAlign: model.textAlign, textAlign: model.textAlign,
textPosition: model.textPosition || 'inside', textPosition: model.textPosition || 'inside',

View File

@ -11,15 +11,16 @@ class ESigName extends Group {
_create() { _create() {
const model = this.model; const model = this.model;
this.name = new Text({ this.name = new Text({
_subType: model._subType,
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
silent: model.silent, silent: model.silent,
style: { style: {
x: model.x, x: model.x,
y: model.y, y: model.y,
fontWeight: model.fontWeight,
fontSize: model.fontSize,
fontFamily: model.fontFamily,
text: model.text, text: model.text,
textFont: model.textFont,
textFill: model.textFill, textFill: model.textFill,
textAlign: model.textAlign, textAlign: model.textAlign,
textPosition: model.textPosition || 'inside', textPosition: model.textPosition || 'inside',

View File

@ -71,11 +71,14 @@ class Signal extends Group {
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
silent: false, silent: false,
isNoRotation: style.Signal.text.isNoRotation,
style: style, style: style,
x: sigNameX, x: sigNameX,
y: sigNameY, y: sigNameY,
text: model.name, text: model.name,
textFont: `bold ${style.Signal.text.signalTextFontSize} px ${style.textFontFormat}`, fontWeight: 'bold',
fontSize: style.Signal.text.signalTextFontSize,
fontFamily: style.textFontFormat,
textFill: style.Signal.text.signalDefaultTextColor, textFill: style.Signal.text.signalDefaultTextColor,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: posit == 1 ? 'top' : 'bottom' textVerticalAlign: posit == 1 ? 'top' : 'bottom'
@ -122,8 +125,10 @@ class Signal extends Group {
style: style, style: style,
x: sigDelayX, x: sigDelayX,
y: sigDelayY, y: sigDelayY,
fontWeight: 'bold',
fontSize: style.Signal.delay.signalDelayTextFontSize,
fontFamily: style.textFontFormat,
text: this.state.delayCount || '0', text: this.state.delayCount || '0',
textFont: `bold ${style.Signal.delay.signalDelayTextFontSize} px ${style.textFontFormat}`,
textFill: style.Signal.delay.signalDelayTextColor, textFill: style.Signal.delay.signalDelayTextColor,
textAlign: drict > 0 ? 'right' : 'left', textAlign: drict > 0 ? 'right' : 'left',
textVerticalAlign: 'middle' textVerticalAlign: 'middle'
@ -155,7 +160,7 @@ class Signal extends Group {
device.eachChild(item => { device.eachChild(item => {
if (item instanceof Group) { if (item instanceof Group) {
this.transformRotation(item); this.transformRotation(item);
} else { } else if (item && item.model && item.model.isNoRotation) {
item.origin = [this.model.position.x, this.model.position.y]; item.origin = [this.model.position.x, this.model.position.y];
item.rotation = -Math.PI / 180 * Number(this.model.rotate); item.rotation = -Math.PI / 180 * Number(this.model.rotate);
item.dirty(); item.dirty();

View File

@ -29,10 +29,12 @@ export default class Station extends Group {
position: [0, 0], position: [0, 0],
x: model.position.x, x: model.position.x,
y: model.position.y, y: model.position.y,
fontWeight: 'bold',
fontSize: model.nameFont || 18,
fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top',
textFont: model.nameFont || '18px ' + style.textFontFormat,
textFill: model.nameFontColor textFill: model.nameFontColor
}); });
let direction = 1; let direction = 1;
@ -45,10 +47,12 @@ export default class Station extends Group {
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: 'bold',
fontSize: model.kmPostFont || 18,
fontFamily: style.textFontFormat,
text: model.kmPost, text: model.kmPost,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top',
textFont: model.kmPostFont || '18px ' + style.textFontFormat,
textFill: model.kmPostFontColor textFill: model.kmPostFontColor
}); });

View File

@ -48,9 +48,11 @@ export default class ESingleControl extends Group {
style: { style: {
x: model.point.x, x: model.point.x,
y: model.point.y + model.style.StationControl.stationControlmodeR + model.style.nameDistance, y: model.point.y + model.style.StationControl.stationControlmodeR + model.style.nameDistance,
fontWeight: 'normal',
fontSize: model.style.textFontSize,
fontFamily: model.style.textFontFormat,
text: model.context, text: model.context,
textFill: model.style.textFontColor, textFill: model.style.textFontColor,
textFont: model.style.textFontSize + 'px ' + model.style.textFontFormat,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top'
} }

View File

@ -29,11 +29,13 @@ export default class StationCounter extends Group {
style: { style: {
x: model.position.x, x: model.position.x,
y: model.position.y, y: model.position.y,
fontWeight: 'normal',
fontSize: style.textFontSize,
fontFamily: style.textFontFormat,
text: model.val, text: model.val,
textFill: style.stationCounterTextColor, textFill: style.stationCounterTextColor,
textAlign: 'middle', textAlign: 'middle',
textStrokeWidth: 1, textStrokeWidth: 1
textFont: style.textFontSize + 'px ' + style.textFontFormat
} }
}); });
@ -64,12 +66,14 @@ export default class StationCounter extends Group {
style: { style: {
x: model.position.x, x: model.position.x,
y: model.position.y + this.rect.width + this.vPadding + style.textFontSize + style.nameDistance, y: model.position.y + this.rect.width + this.vPadding + style.textFontSize + style.nameDistance,
fontWeight: 'bold',
fontSize: style.textFontSize,
fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textFill: style.stationCounterTextColor, textFill: style.stationCounterTextColor,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top',
textStrokeWidth: 1, textStrokeWidth: 1
textFont: style.textFontSize + 'px ' + style.textFontFormat
} }
}); });
this.add(this.counterName); this.add(this.counterName);

View File

@ -29,10 +29,12 @@ export default class StationDelayUnlock extends Group {
style: { style: {
x: model.position.x, x: model.position.x,
y: model.position.y, y: model.position.y,
fontWeight: 'normal',
fontSize: model.textFont,
fontFamily: style.textFontFormat,
text: model.deviceName + ' ', text: model.deviceName + ' ',
textFill: style.stationDelayUnlockTextColor, textFill: style.stationDelayUnlockTextColor,
textStrokeWidth: 1, textStrokeWidth: 1,
textFont: model.textFont + 'px ' + style.textFontFormat,
textAlign: 'left' textAlign: 'left'
} }
}); });
@ -45,10 +47,12 @@ export default class StationDelayUnlock extends Group {
style: { style: {
x: model.position.x, x: model.position.x,
y: model.position.y + fontSize + style.stationDelayUnlockDistance, y: model.position.y + fontSize + style.stationDelayUnlockDistance,
fontWeight: 'normal',
fontSize: model.textFont,
fontFamily: style.textFontFormat,
text: model.remainTime || '', text: model.remainTime || '',
textFill: style.stationDelayUnlockTextColor, textFill: style.stationDelayUnlockTextColor,
textStrokeWidth: 1, textStrokeWidth: 1,
textFont: model.textFont + 'px ' + style.textFontFormat,
textAlign: 'left' textAlign: 'left'
} }
}); });

View File

@ -20,10 +20,12 @@ class EJump extends Group {
style: { style: {
x: model.x, x: model.x,
y: model.y, y: model.y,
fontWeight: 'normal',
fontSize: style.StationStand.common.textFontSize,
fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textFill: style.StationStand.level.textColor, textFill: style.StationStand.level.textColor,
textAlign: 'middle', textAlign: 'middle'
textFont: `${style.StationStand.common.textFontSize} px ${style.textFontFormat}`
} }
}); });

View File

@ -20,10 +20,12 @@ class ELevel extends Group {
style: { style: {
x: model.x, x: model.x,
y: model.y, y: model.y,
fontWeight: 'normal',
fontSize: style.StationStand.common.textFontSize,
fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textFill: style.StationStand.level.textColor, textFill: style.StationStand.level.textColor,
textAlign: 'middle', textAlign: 'middle'
textFont: `${style.StationStand.common.textFontSize} px ${style.textFontFormat}`
} }
}); });

View File

@ -20,10 +20,12 @@ class ETime extends Group {
style: { style: {
x: model.x, x: model.x,
y: model.y, y: model.y,
fontWeight: 'normal',
fontSize: style.StationStand.common.textFontSize,
fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textFill: style.StationStand.stopTime.textColor, textFill: style.StationStand.stopTime.textColor,
textAlign: 'middle', textAlign: 'middle'
textFont: `${style.StationStand.common.textFontSize} px ${style.textFontFormat}`
} }
}); });

View File

@ -19,10 +19,12 @@ class ESwName extends Group {
style: { style: {
x: model.nameTextX, x: model.nameTextX,
y: model.nameTextY, y: model.nameTextY,
fontWeight: 'normal',
fontSize: style.textFontSize,
fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textAlign: model.triangle.drictx === 1 ? 'left' : 'right', textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
textVerticalAlign: model.triangle.dricty === 1 ? 'top' : 'bottom', textVerticalAlign: model.triangle.dricty === 1 ? 'top' : 'bottom',
textFont: style.textFontSize + 'px ' + style.textFontFormat,
textFill: style.Switch.text.switchTextLossColor textFill: style.Switch.text.switchTextLossColor
} }
}); });
@ -58,10 +60,12 @@ class ESwName extends Group {
style: { style: {
x: model.arrowTextX, x: model.arrowTextX,
y: model.arrowTextY, y: model.arrowTextY,
fontWeight: 'normal',
fontSize: 10,
fontFamily: style.textFontFormat,
text: `道岔区段名称: ${model.sectionName}`, text: `道岔区段名称: ${model.sectionName}`,
textFill: '#000', textFill: '#000',
textAlign: 'letf', textAlign: 'letf',
textFont: 10 + 'px consolas',
textPadding: 3, textPadding: 3,
textBackgroundColor: style.tipBackgroundColor textBackgroundColor: style.tipBackgroundColor
} }

View File

@ -35,10 +35,10 @@ class TrainBody extends Group {
style: { style: {
x: model.point.x + 50, x: model.point.x + 50,
y: model.point.y + 25, y: model.point.y + 25,
font: 10 + 'px consolas',
text: `列车类型: 计划车\n\0\0\0\0号: ${model.serviceNumber}\n\0\0号: ${model.tripNumber}\n目的地号: ${model.targetCode ? model.targetCode : ''}\n\0\0号: ${model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${model.sectionModel ? model.sectionModel.trackName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${model.runControlStatus == '01' ? '正常' : model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${model.speed || 0} km/h\n列车移动授权距离: ${model.maLen || 0} m`, text: `列车类型: 计划车\n\0\0\0\0号: ${model.serviceNumber}\n\0\0号: ${model.tripNumber}\n目的地号: ${model.targetCode ? model.targetCode : ''}\n\0\0号: ${model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${model.sectionModel ? model.sectionModel.trackName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${model.runControlStatus == '01' ? '正常' : model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${model.speed || 0} km/h\n列车移动授权距离: ${model.maLen || 0} m`,
textFill: '#000', textFill: '#000',
textAlign: 'letf', textAlign: 'letf',
textFont: 10 + 'px consolas',
textPadding: 3, textPadding: 3,
textBackgroundColor: style.tipBackgroundColor textBackgroundColor: style.tipBackgroundColor
} }
@ -72,9 +72,9 @@ class TrainBody extends Group {
style: { style: {
x: parseInt(beginX + margin * 0), x: parseInt(beginX + margin * 0),
y: parseInt(beginY), y: parseInt(beginY),
font: TextFontHSDA,
text: 'H', text: 'H',
textFill: style.trainYellowColor, textFill: style.trainYellowColor,
textFont: TextFontHSDA,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top'
} }
@ -86,9 +86,9 @@ class TrainBody extends Group {
style: { style: {
x: parseInt(beginX + margin * 1), x: parseInt(beginX + margin * 1),
y: parseInt(beginY), y: parseInt(beginY),
font: TextFontHSDA,
text: 'S', text: 'S',
textFill: style.trainBlueColor, textFill: style.trainBlueColor,
textFont: TextFontHSDA,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top'
} }
@ -100,9 +100,9 @@ class TrainBody extends Group {
style: { style: {
x: parseInt(beginX + margin * 2), x: parseInt(beginX + margin * 2),
y: parseInt(beginY), y: parseInt(beginY),
font: TextFontHSDA,
text: 'D', text: 'D',
textFill: style.trainGreenColor, textFill: style.trainGreenColor,
textFont: TextFontHSDA,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top'
} }
@ -114,9 +114,9 @@ class TrainBody extends Group {
style: { style: {
x: parseInt(beginX + margin * 3), x: parseInt(beginX + margin * 3),
y: parseInt(beginY), y: parseInt(beginY),
font: TextFontHSDA,
text: 'A', text: 'A',
textFill: style.trainRedColor, textFill: style.trainRedColor,
textFont: TextFontHSDA,
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top'
} }
@ -135,9 +135,9 @@ class TrainBody extends Group {
style: { style: {
x: parseInt(model.point.x + lrPadding), x: parseInt(model.point.x + lrPadding),
y: parseInt(model.point.y + upPadding), y: parseInt(model.point.y + upPadding),
font: textFont,
text: serviceNumber.substring(serviceNumber.length - 2), text: serviceNumber.substring(serviceNumber.length - 2),
textFill: style.trainBrownColor, textFill: style.trainBrownColor,
textFont: textFont,
textAlign: 'left', textAlign: 'left',
textVerticalAlign: 'top' textVerticalAlign: 'top'
} }
@ -149,9 +149,9 @@ class TrainBody extends Group {
style: { style: {
x: parseInt(model.point.x + style.trainWidth - lrPadding), x: parseInt(model.point.x + style.trainWidth - lrPadding),
y: parseInt(model.point.y + upPadding), y: parseInt(model.point.y + upPadding),
font: textFont,
text: tripNumber.substring(tripNumber.length - 3), text: tripNumber.substring(tripNumber.length - 3),
textFill: style.trainYellowColor, textFill: style.trainYellowColor,
textFont: textFont,
textAlign: 'right', textAlign: 'right',
textVerticalAlign: 'top' textVerticalAlign: 'top'
} }

View File

@ -34,11 +34,13 @@ export default class ZcControl extends Group {
position: [0, 0], position: [0, 0],
x: model.position.x, x: model.position.x,
y: model.position.y + this.style.zcControlmodeR + this.style.nameDistance, y: model.position.y + this.style.zcControlmodeR + this.style.nameDistance,
fontWeight: 'normal',
fontSize: this.style.stationControlTextSize,
fontFamily: this.style.textFontFormat,
text: model.name, text: model.name,
textFill: '#fff', textFill: '#fff',
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top'
textFont: this.style.stationControlTextSize + 'px ' + this.style.textFontFormat
}, },
style: this.style style: this.style
}); });

View File

@ -35,11 +35,13 @@ export default class EControl extends Group {
style: { style: {
x: this.textStyle.x, x: this.textStyle.x,
y: this.textStyle.y, y: this.textStyle.y,
fontWeight: this.textStyle.fontWeight,
fontSize: this.textStyle.fontSize,
fontFamily: this.textStyle.fontFamily,
text: this.textStyle.text, text: this.textStyle.text,
textFill: this.textStyle.textFill, textFill: this.textStyle.textFill,
textAlign: this.textStyle.textAlign, textAlign: this.textStyle.textAlign,
textVerticalAlign: this.textStyle.textVerticalAlign, textVerticalAlign: this.textStyle.textVerticalAlign
textFont: this.textStyle.textFont
} }
}); });

View File

@ -4,15 +4,16 @@ import Text from 'zrender/src/graphic/Text';
/** 名称元素*/ /** 名称元素*/
export default function ETextName(model) { export default function ETextName(model) {
const TextName = new Text({ const TextName = new Text({
_subType: model._subType,
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
silent: model.silent || false, silent: model.silent || false,
style: { style: {
x: model.x, x: model.x,
y: model.y, y: model.y,
fontWeight: model.fontWeight,
fontSize: model.fontSize,
fontFamily: model.fontFamily,
text: model.text, text: model.text,
textFont: model.textFont,
textFill: model.textFill, textFill: model.textFill,
textAlign: model.textAlign, textAlign: model.textAlign,
textPosition: model.textPosition || 'inside', textPosition: model.textPosition || 'inside',

View File

@ -22,7 +22,7 @@ class Beijing extends defaultSkin {
textAlign: 'center', // 水平对齐方式 textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置 textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle', // 文字垂直对齐方式 textVerticalAlign: 'middle', // 文字垂直对齐方式
position: 0 // 区段名称位置 1 上行 -1 下面 0 默认 position: 1 // 区段名称位置 1 上面 -1 下面 0 默认
}, },
line: { line: {
width: 5, // 区段宽度 width: 5, // 区段宽度
@ -57,8 +57,8 @@ class Beijing extends defaultSkin {
lineColor: '#FFFF00' // 限速线颜色 lineColor: '#FFFF00' // 限速线颜色
}, },
separator: { separator: {
width: 1.2, // 分隔符宽度 width: 1.5, // 分隔符宽度
endWidth: 1.2, // 尽头分隔符宽度 endWidth: 1.5, // 尽头分隔符宽度
endColor: '#7F7F7F', // 尽头分隔符颜色 endColor: '#7F7F7F', // 尽头分隔符颜色
color: '#7F7F7F' // 区段边界符颜色 color: '#7F7F7F' // 区段边界符颜色
} }
@ -72,8 +72,10 @@ class Beijing extends defaultSkin {
signalLampStandardWidth: 1.5 signalLampStandardWidth: 1.5
}, },
text: { text: {
/** 是否禁止旋转*/
isNoRotation: true,
/** 信号机名称字体大小*/ /** 信号机名称字体大小*/
signalTextFontSize: 12, signalTextFontSize: 10,
/** 信号灯字体默认色*/ /** 信号灯字体默认色*/
signalDefaultTextColor: '#C0C0C0', signalDefaultTextColor: '#C0C0C0',
/** 信号灯字体锁定颜色*/ /** 信号灯字体锁定颜色*/
@ -87,7 +89,7 @@ class Beijing extends defaultSkin {
/** 信号灯边框线颜色*/ /** 信号灯边框线颜色*/
signalBorderColor: '#3149C3', signalBorderColor: '#3149C3',
/** 信号机宽度 */ /** 信号机宽度 */
signalR: 7, signalR: 6,
/** 信号灯锁闭*/ /** 信号灯锁闭*/
signalBlockColor: '#EF0C08', signalBlockColor: '#EF0C08',
/** 信号灯灰色*/ /** 信号灯灰色*/
@ -194,12 +196,12 @@ class Beijing extends defaultSkin {
this[deviceType.StationControl] = { this[deviceType.StationControl] = {
singleControlNum: 3, singleControlNum: 3,
stationOffset: {x: 20, y: 0}, stationOffset: { x: 20, y: 0 },
arrowsShow: false, // 控制模式箭头显隐 arrowsShow: false, // 控制模式箭头显隐
/** 控制模式字体大小*/ /** 控制模式字体大小*/
stationControlTextSize: 10, stationControlTextSize: 10,
/** 控制模式灯的半径 */ /** 控制模式灯的半径 */
stationControlmodeR: 4, stationControlmodeR: 6,
/** 控制模式之间灯之间的距离*/ /** 控制模式之间灯之间的距离*/
stationControlDistance: 36, stationControlDistance: 36,
/** 控制模式灰色*/ /** 控制模式灰色*/

View File

@ -17,8 +17,7 @@ class Fuzhou extends defaultSkin {
this[deviceType.Section] = { this[deviceType.Section] = {
text: { // 区段文字属性 text: { // 区段文字属性
fontSize: 10, // 字体大小 fontSize: 10, // 字体大小
fontFormat: 'consolas', // 字体族类 fontColor: '#FFFFFF', // 字体颜色
fontColor: '#C0C0C0', // 字体颜色
textAlign: 'center', // 水平对齐方式 textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置 textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle', // 文字垂直对齐方式 textVerticalAlign: 'middle', // 文字垂直对齐方式
@ -71,8 +70,10 @@ class Fuzhou extends defaultSkin {
signalLampStandardWidth: 2 signalLampStandardWidth: 2
}, },
text: { text: {
/** 是否禁止旋转*/
isNoRotation: true,
/** 信号机名称字体大小*/ /** 信号机名称字体大小*/
signalTextFontSize: 8, signalTextFontSize: 10,
/** 信号灯字体默认色*/ /** 信号灯字体默认色*/
signalDefaultTextColor: '#FFFFFF', signalDefaultTextColor: '#FFFFFF',
/** 信号灯字体锁定颜色*/ /** 信号灯字体锁定颜色*/