宁波三号线站台样式调整

This commit is contained in:
fan 2020-08-19 18:27:36 +08:00
parent 3520e53679
commit d1cff9ff94
4 changed files with 87 additions and 10 deletions

View File

@ -350,10 +350,11 @@ class SkinCode extends defaultStyle {
lineWidth: 3, // 站台线宽
spareColor: '#0080C0', // 站台空闲颜色
spareStrokeColor: '#000000', // 站台空闲描边颜色
openStrokeColor: '#00FF00', // 站台开门描边颜色
doorOpenColor:'#00FF00', // 车门开启状态颜色
stopColor: 'yellow', // 站台列车停站颜色
jumpStopColor: '#6260f3', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
jumpStopColor: '#C00000', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue', // 站台指定列车跳停颜色
virtualColor: '#585858' // 虚拟站台颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径
@ -367,11 +368,12 @@ class SkinCode extends defaultStyle {
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: { x: -8, y: 10 }, // 扣车偏移量
centerTrainColor: 'white', // 中心扣车颜色
andCenterTrainColor: 'red', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
centerTrainColor: '#00FF00', // 中心扣车颜色
andCenterTrainColor: '#00FF00', // 车站+中心扣车颜色
detainTrainTextColor: '#FFFF00', // 车站扣除文字颜色
fontSize: 10,
fontWeight: 'normal'
fontWeight: 'normal',
specialShape: 'rect' // 扣车标志形状
},
stopTime: { // 停站时间
offset: { x: -8, y: 4 }, // 运行时间偏移量

View File

@ -288,7 +288,7 @@ class SkinCode extends defaultStyle {
fontWeight: 'normal',
circleWidth:14, // 西安二号线特殊样式 圆圈的宽度
defaultColor:'#808080', // 默认颜色
special:true // 西安二号线特殊样式
specialShape: 'circle' // 西安二号线特殊样式
},
stopTime: { // 停站时间
position: 1, // 停站时间方向

View File

@ -0,0 +1,54 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
class EDetainCircle extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
const style = this.model.style;
let y;
if (model.right && model.inside) {
y = model.y + model.height / 2;
} else if (model.right && !model.inside) {
y = model.y;
} else if (!model.right && model.inside) {
y = model.y;
} else if (!model.right && !model.inside) {
y = model.y + model.height / 2;
}
this.detainRect = new Rect({
zlevel: model.zlevel,
z: model.z + 1,
shape: {
x: model.x,
y: y,
width: model.width,
height: model.height / 2
},
style: {
lineWidth: style.StationStand.stand.lineWidth || 0,
stroke: style.StationStand.stand.spareStrokeColor,
fill: '#000'
}
});
this.add(this.detainRect);
this.detainRect.hide();
}
setColor(color) {
this.detainRect.setStyle('stroke', color);
}
setShow() {
this.detainRect.show();
}
setHide() {
this.detainRect.hide();
}
}
export default EDetainCircle;

View File

@ -12,6 +12,7 @@ import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl';
import EDetainCircle from './EDetainCircle';
import EDetainRect from './EDetainRect';
import EPatternFilter from './EPatternFilter';
import {isShowThePrdType} from '../../utils/handlePath';
@ -148,7 +149,7 @@ class StationStand extends Group {
this.add(this.reentry);
}
if (style.StationStand.detainCar.special) {
if (style.StationStand.detainCar.specialShape === 'circle') {
const detainD = model.right ? 1 : -1;
this.detainCircle = new EDetainCircle({
zlevel: this.zlevel,
@ -159,6 +160,19 @@ class StationStand extends Group {
radius:style.StationStand.detainCar.circleWidth / 2
});
this.add(this.detainCircle);
} else if (style.StationStand.detainCar.specialShape === 'rect') {
this.detainRect = new EDetainRect({
zlevel: this.zlevel,
z: this.z,
style: style,
x: standX,
y: standY,
inside: model.inside,
right: model.right,
width: model.width,
height: model.height
});
this.add(this.detainRect);
} else {
/** 站台扣车*/
const detainD = model.right ? 1 : -1;
@ -381,6 +395,7 @@ class StationStand extends Group {
this.reentry && this.reentry.hideMode();
this.jump && this.jump.hideMode();
this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.defaultColor);
this.detainRect.setHide();
}
/** 空闲*/
@ -402,7 +417,7 @@ class StationStand extends Group {
/** 车门开启 */
doorOpen() {
if (this.style.StationStand.common.standType && this.style.StationStand.common.standType == 'notFill') {
if (this.style.StationStand.stand.doorOpenColor) {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.doorOpenColor);
}
}
@ -439,6 +454,8 @@ class StationStand extends Group {
this.detain && this.detain.showMode();
this.detain && this.detain.setColor(this.style.StationStand.detainCar.detainTrainTextColor);
this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.centerTrainColor);
this.detainRect && this.detainRect.setShow();
this.detainRect && this.detainRect.setColor(this.style.StationStand.detainCar.detainTrainTextColor);
}
/** 中心扣车*/
@ -446,6 +463,8 @@ class StationStand extends Group {
this.detain && this.detain.showMode();
this.detain && this.detain.setColor(this.style.StationStand.detainCar.centerTrainColor);
this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.centerTrainColor);
this.detainRect && this.detainRect.setShow();
this.detainRect && this.detainRect.setColor(this.style.StationStand.detainCar.centerTrainColor);
}
/** 中心+车站扣车*/
@ -453,6 +472,8 @@ class StationStand extends Group {
this.detain && this.detain.showMode();
this.detain && this.detain.setColor(this.style.StationStand.detainCar.andCenterTrainColor);
this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.centerTrainColor);
this.detainRect && this.detainRect.setShow();
this.detainRect && this.detainRect.setColor(this.style.StationStand.detainCar.centerTrainColor);
}
/** 人工设置停战时间*/