调整:列车成都线调整

This commit is contained in:
fan 2019-08-05 15:13:49 +08:00
parent 824c6ed834
commit fd8b2402ad
5 changed files with 26 additions and 60 deletions

View File

@ -351,11 +351,11 @@ class SkinStyle extends defaultStyle {
textTrainTargetNumber: false
}, // 车身鼠标移出事件
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
dynamicLoadingDisplay: false, // 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离
trainBodyFillColor: '#725A64'// 列车车身填充颜色
trainBodyFillColor: '#725A64', // 列车车身填充颜色
trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式
},
hsda: {
lrPaddingHSDA: 3, // HSDA两边间隔
@ -377,9 +377,10 @@ class SkinStyle extends defaultStyle {
tripNumberPrefix: '000', // 车次号前缀
defaultTripNumber: 'DDD', // 默认车次号2
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
trainTargetTextAlign: 'right'// 目的地码文字显示位置
trainTargetTextAlign: 'right'// 车次号文字显示位置
},
trainTargetNumber: {
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
},
trainHead: {
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框

View File

@ -313,7 +313,6 @@ class SkinStyle extends defaultStyle {
textTrainTargetNumber: false
}, // 车身鼠标移出事件
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
dynamicLoadingDisplay: true, // 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离
@ -332,7 +331,8 @@ class SkinStyle extends defaultStyle {
trainNumber: {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'DDD', // 默认目的地码
trainTargetTextAlign: 'left'// 目的地码文字显示位置
trainTargetTextAlign: 'left', // 目的地码文字显示位置
trainNumberOffset: { x: 24, y: 4}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '000', // 服务号(表号)前缀
@ -344,9 +344,10 @@ class SkinStyle extends defaultStyle {
tripNumberPrefix: '000', // 车次号前缀
defaultTripNumber: 'DDD', // 默认车次号2
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
trainTargetTextAlign: 'right' // 目的地码文字显示位置
trainTargetTextAlign: 'right' // 车次号文字显示位置
},
trainTargetNumber: {
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
},
trainHead: {
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
@ -358,10 +359,9 @@ class SkinStyle extends defaultStyle {
trainHeadRectHeight: 20 // 列车车头矩形高度
},
common: {
trainHeight: 20, // 列车高度
trainHeadDistance: 4, // 列车和车头之间的间距
trainWidth: 40, // 列车长度
trainWidth: 48, // 列车长度
trainTextFontSize: 12, // 列车字号
textFontFormat: 'consolas', // 默认字体 族类
haveTextHSDA: true, // 是否需创建textHSDA对象

View File

@ -261,7 +261,6 @@ class SkinStyle extends defaultStyle {
textTrainTargetNumber: false
}, // 车身鼠标移出事件
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
dynamicLoadingDisplay: true, // 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码
specialTrainType: [
{
type: '03',
@ -280,22 +279,24 @@ class SkinStyle extends defaultStyle {
trainNumber: {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'AAA', // 默认目的地码
trainTargetTextAlign: 'left'// 目的地码文字显示位置
trainTargetTextAlign: 'left', // 车次号文字显示位置
trainNumberOffset: { x: 0, y: 1}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀
defaultServiceNumber: 'BB', // 默认服务号(表号)
trainServerOffset: { x: -1, y: 1}// 列车服务号偏移
trainServerOffset: { x: 16, y: 1}// 列车服务号偏移
},
trainTarget: {
tripNumberPrefix: '0000', // 车次号前缀
defaultDirectionCode: 'D', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: -1, y: 1}// 列车车次号偏移
trainTargetOffset: { x: 26, y: 1}// 列车车次号偏移
},
trainTargetNumber: {
groupNumberPrefix: '000', // 车组号前缀
defaultGroupNumber: 'EEE'// 默认车组号
defaultGroupNumber: 'EEE', // 默认车组号
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
},
trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框

View File

@ -146,16 +146,10 @@ export default class TrainBody extends Group {
}
});
}
if ( style.Train.trainBody.dynamicLoadingDisplay ) {
this.formatChangePosition(model, style);
} else {
this.add(this.textTrainServer);
this.add(this.textTrainTarget);
this.add(this.textHSDA);
}
this.add(this.train);
this.add(this.arrowText);
this.add(this.textHSDA);
}
removeTrainDetail() {
@ -194,47 +188,19 @@ export default class TrainBody extends Group {
const arr = style.Train.trainBody.trainNameFormat.split(':');
arr.forEach(ele => {
if (ele == 'targetCode') {
this.textTrainNumber.setShapeStyle('x', parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x));
this.add(this.textTrainNumber);
} else if (ele == 'serviceNumber') {
const show = arr.includes('targetCode');
if (show) {
this.textTrainServer.setShapeStyle('x', parseInt(model.point.x + (3 * model.fontSize * (2 / 3)) - 3 - style.Train.trainBody.lrPadding));
}
this.textTrainServer.setShapeStyle('x', parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x));
this.add(this.textTrainServer);
} else if (ele == 'tripNumber') {
const show = arr.includes('targetCode');
const serverNoShow = arr.includes('serviceNumber');
if (show) {
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + (3 * model.fontSize * (2 / 3)) - 3 - style.Train.trainBody.lrPadding));
}
if (serverNoShow) {
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + (2 * model.fontSize * (2 / 3)) - 3 - style.Train.trainBody.lrPadding));
}
if (serverNoShow && show) {
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + (5 * model.fontSize * (2 / 3)) - 6.5 - style.Train.trainBody.lrPadding));
}
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + style.Train.trainTarget.trainTargetOffset.x));
this.add(this.textTrainTarget);
} else if (ele == 'groupNumber') {
const show = arr.includes('targetCode');
const serverNoShow = arr.includes('serviceNumber');
if (show) {
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + (3 * model.fontSize * (2 / 3)) - 3 - style.Train.trainBody.lrPadding));
}
if (serverNoShow) {
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + (2 * model.fontSize * (2 / 3)) - 3 - style.Train.trainBody.lrPadding));
}
if (serverNoShow && show) {
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + (5 * model.fontSize * (2 / 3)) - 6.5 - style.Train.trainBody.lrPadding));
}
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + style.Train.textTrainTargetNumber.trainTargetNumberOffset.x));
this.add(this.textTrainTargetNumber);
}
});
} else {
this.textTrainServer.setShapeStyle('x', parseInt(model.point.x + 27 - style.Train.trainBody.lrPadding));
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + 43 - style.Train.trainBody.lrPadding));
this.add(this.textTrainServer);
this.add(this.textTrainTarget);
this.add(this.textTrainNumber);
}
}
}

View File

@ -30,7 +30,6 @@ export default class Train extends Group {
x: model.trainWindowModel.point.x,
y: model.trainWindowModel.point.y
};
switch (model.directionType) {
case '01': // 未知方向
this.point.x = this.point.x + model.trainWindowModel.width / 2 + Math.abs((style.Train.common.trainWidth - model.trainWindowModel.width) / 2);
@ -292,19 +291,19 @@ export default class Train extends Group {
arr.forEach(ele => {
switch (ele) {
case 'targetCode': {
this.size += 3;
this.size += style.Train.trainNumber.targetCodePrefix.length || 0;
break;
}
case 'serviceNumber': {
this.size += 2;
this.size += style.Train.trainServer.serviceNumberPrefix.length || 0;
break;
}
case 'tripNumber': {
this.size += 4;
this.size += style.Train.trainTarget.tripNumberPrefix.length || 0;
break;
}
case 'groupNumber': {
this.size += 3;
this.size += style.Train.trainTargetNumber.groupNumberPrefix.length || 0;
break;
}
}
@ -312,8 +311,7 @@ export default class Train extends Group {
} else {
this.size = 9;
}
this.style.Train.common.trainWidth = this.size * this.fontSize * (2 / 3) - 16;
this.style.Train.common.trainWidth = this.size * this.fontSize * (2 / 3) -16;
}
removeTrainDetail() {
this.trainB.removeTrainDetail();