大铁线路 列车 车次号显示 调整

This commit is contained in:
joylink_cuiweidong 2022-05-17 10:10:06 +08:00
parent 6e9ca25459
commit 81cdaafa58
2 changed files with 6 additions and 4 deletions

View File

@ -786,7 +786,7 @@ class SkinCode extends defaultStyle {
trainBody: { trainBody: {
fontFamily: 'consolas', fontFamily: 'consolas',
trainBodyLineWidth: 1, // 车身line宽 trainBodyLineWidth: 1, // 车身line宽
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [ specialTrainType: [
{ {
type: '03', type: '03',
@ -841,8 +841,9 @@ class SkinCode extends defaultStyle {
trainServerOffset: { x: 4, y: 4} // 列车服务号偏移 trainServerOffset: { x: 4, y: 4} // 列车服务号偏移
}, },
trainTarget: { trainTarget: {
tripNumberPrefix: '000', // 车次号前缀 tripNumberPrefix: '', // 车次号前缀
defaultTripNumber: 'DDD', // 默认车次号2 // defaultTripNumber: 'DDD', // 默认车次号2
defaultTripNumber: ' ', // 默认车次号
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移 trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
trainTargetTextAlign: 'right' // 车次号文字显示位置 trainTargetTextAlign: 'right' // 车次号文字显示位置
}, },

View File

@ -68,13 +68,14 @@ export default class TrainBody extends Group {
z: this.model.z + 1, z: this.model.z + 1,
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x), x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y), y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length), text: tripNumber.substring(tripNumber.length - (style.Train.trainTarget.tripNumberPrefix.length || tripNumber.length)),
textFill: model.style.Train.trainTarget.fontColor || style.trainTextColor, textFill: model.style.Train.trainTarget.fontColor || style.trainTextColor,
fontSize: model.style.Train.trainTarget.fontSize || model.fontSize, fontSize: model.style.Train.trainTarget.fontSize || model.fontSize,
fontFamily: style.Train.common.fontFamily, fontFamily: style.Train.common.fontFamily,
textAlign: 'left', textAlign: 'left',
textVerticalAlign: 'top' textVerticalAlign: 'top'
}); });
// console.log(model.fontSize, tripNumber.length - (style.Train.trainTarget.tripNumberPrefix.length || tripNumber.length), tripNumber, tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length || tripNumber.length);
this.textTrainTarget = new ETextName({ this.textTrainTarget = new ETextName({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z + 1, z: model.z + 1,