修改:列车信息调整,人工车显示调整

This commit is contained in:
fan 2019-08-19 13:21:29 +08:00
parent b025c78d67
commit 3fe9ffd451
6 changed files with 40 additions and 14 deletions

View File

@ -407,7 +407,17 @@ class SkinCode extends defaultStyle {
trainBody: { trainBody: {
trainBodyLineWidth: 0.1, // 车身line宽 trainBodyLineWidth: 0.1, // 车身line宽
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式 specialTrainType: [
{
type: '03',
serviceNumber: 'M0',
nameFormat: 'serviceNumber:groupNumber'
},
{
type: '02',
nameFormat: 'targetCode:groupNumber'
}
], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔 lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离 upPadding: 4, // 上边距离
trainBodyFillColor: '#725A64', // 列车车身填充颜色 trainBodyFillColor: '#725A64', // 列车车身填充颜色

View File

@ -369,7 +369,13 @@ class SkinCode extends defaultStyle {
trainBody: { trainBody: {
trainBodyLineWidth: 1, // 车身line宽 trainBodyLineWidth: 1, // 车身line宽
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式 specialTrainType: [
{
type: '03',
serviceNumber: '---',
nameFormat: 'groupNumber:serviceNumber'
}
], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔 lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离 upPadding: 4, // 上边距离
trainBodyFillColor: '#000099', // 列车车身填充颜色 trainBodyFillColor: '#000099', // 列车车身填充颜色

View File

@ -320,6 +320,10 @@ class SkinCode extends defaultStyle {
type: '03', type: '03',
serviceNumber: 'MM', serviceNumber: 'MM',
nameFormat: 'serviceNumber:groupNumber' nameFormat: 'serviceNumber:groupNumber'
},
{
type: '02',
nameFormat: 'targetCode:groupNumber'
} }
], // 特殊列车类型需设置显示格式 ], // 特殊列车类型需设置显示格式
lrPadding: 1, // 两边间隔 lrPadding: 1, // 两边间隔

View File

@ -17,6 +17,13 @@ class EMouse extends Group {
case '05': destinationText = '严重晚点'; break; case '05': destinationText = '严重晚点'; break;
default: destinationText = '未知'; break; default: destinationText = '未知'; break;
} }
let trainType = '';
switch (this.device.model.type) {
case '01': trainType = '计划车'; break;
case '02': trainType = '头码车'; break;
case '03': trainType = '人工车'; break;
default: trainType = '未知'; break;
}
// 文字描述 // 文字描述
this.arrowText = new Text({ this.arrowText = new Text({
zlevel: this.device.model.zlevel, zlevel: this.device.model.zlevel,
@ -24,7 +31,7 @@ class EMouse extends Group {
style: { style: {
x: this.device.model.point.x + 50, x: this.device.model.point.x + 50,
y: this.device.model.point.y + 25, y: this.device.model.point.y + 25,
text: `列车类型: 计划车\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`, text: `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`,
textFill: '#000', textFill: '#000',
textAlign: 'letf', textAlign: 'letf',
textFont: 10 + 'px consolas', textFont: 10 + 'px consolas',

View File

@ -96,7 +96,7 @@ export default class TrainBody extends Group {
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top'
}) : ''; }) : '';
let serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号) const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号)
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
?(model.directionCode||style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber) ?(model.directionCode||style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
:model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号 :model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
@ -155,16 +155,6 @@ export default class TrainBody extends Group {
textAlign: 'left', textAlign: 'left',
textVerticalAlign: 'top' textVerticalAlign: 'top'
}); });
// 根据列车类型设置显示格式
if ( style.Train.trainBody.specialTrainType.length > 0) {
style.Train.trainBody.specialTrainType.some((item) =>{
if (model.type === item.type) {
serviceNumber = item.serviceNumber;
this.nameFormat = item.nameFormat;
return true;
}
});
}
this.formatChangePosition(model, style); this.formatChangePosition(model, style);
this.add(this.trainBodyBox); this.add(this.trainBodyBox);
if (style.Train.common.haveTextHSDA) { if (style.Train.common.haveTextHSDA) {

View File

@ -19,6 +19,15 @@ export default class Train extends Group {
this.fontSize = style.Train.common.useSelfText?style.Train.common.nameFontSize || style.Train.common.trainTextFontSize:model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize; this.fontSize = style.Train.common.useSelfText?style.Train.common.nameFontSize || style.Train.common.trainTextFontSize:model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize;
this.newScale = this.fontSize / style.Train.common.trainTextFontSize; this.newScale = this.fontSize / style.Train.common.trainTextFontSize;
this.nameFormat = style.Train.common.useSelfFormat?style.Train.trainBody.trainNameFormat:model.nameFormat || style.Train.trainBody.trainNameFormat; this.nameFormat = style.Train.common.useSelfFormat?style.Train.trainBody.trainNameFormat:model.nameFormat || style.Train.trainBody.trainNameFormat;
if ( style.Train.trainBody.specialTrainType.length > 0) {
style.Train.trainBody.specialTrainType.some((item) =>{
if (model.type === item.type) {
this.nameFormat = item.nameFormat;
model.serviceNumber = item.serviceNumber?item.serviceNumber : model.serviceNumber;
return true;
}
});
}
this.create(); this.create();
this.setState(model); this.setState(model);
} }