西安二号线站台 紧急停车状态 绘图调整

This commit is contained in:
joylink_cuiweidong 2020-04-20 10:12:17 +08:00
parent 53d94cee59
commit 074f6d647a
2 changed files with 38 additions and 4 deletions

View File

@ -245,10 +245,10 @@ class SkinCode extends defaultStyle {
doorOpenColor:'#007f00' // 车门开启状态颜色(西安二号线线路样式) doorOpenColor:'#007f00' // 车门开启状态颜色(西安二号线线路样式)
}, },
standEmergent: { // 紧急关闭 standEmergent: { // 紧急关闭
mergentR: 7, // 站台紧急关闭半径 mergentR: 9, // 站台紧急关闭半径
mergentN: 8, // 站台紧急关闭边数 mergentN: 8, // 站台紧急关闭边数(西安二号线特殊样式)
insideOffset: { x: 0, y: 40 }, // 内站台紧急关闭偏移量 insideOffset: { x: 0, y: 50 }, // 内站台紧急关闭偏移量
outsideOffset: { x: 0, y: -40}, // 外站台紧急关闭偏移量 outsideOffset: { x: 0, y: -50}, // 外站台紧急关闭偏移量
closeColor: 'red', // 站台紧急关闭颜色 closeColor: 'red', // 站台紧急关闭颜色
defaultColor:'#808080', // 西安二号线特殊样式(默认颜色) defaultColor:'#808080', // 西安二号线特殊样式(默认颜色)
special:true // 西安二号线特殊样式 special:true // 西安二号线特殊样式

View File

@ -1,6 +1,7 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Isogon from 'zrender/src/graphic/shape/Isogon'; import Isogon from 'zrender/src/graphic/shape/Isogon';
import Polygon from 'zrender/src/graphic/shape/Polygon'; import Polygon from 'zrender/src/graphic/shape/Polygon';
import Line from 'zrender/src/graphic/shape/Line';
import {arrow} from '../utils/ShapePoints'; import {arrow} from '../utils/ShapePoints';
class ESafeEmergent extends Group { class ESafeEmergent extends Group {
@ -58,9 +59,42 @@ class ESafeEmergent extends Group {
} }
this.add(this.emergent); this.add(this.emergent);
if (style.StationStand.standEmergent.special) { if (style.StationStand.standEmergent.special) {
// r*Math.r*cos(Math.PI/180*22.5)
// Math.sin(Math.PI/180*50)
// Math.cos(Math.PI/180*50)
this.emergent.rotation = Math.PI / 8; this.emergent.rotation = Math.PI / 8;
this.emergent.origin = [model.x, model.y]; this.emergent.origin = [model.x, model.y];
this.emergent.dirty(); this.emergent.dirty();
this.emergentLine1 = new Line({
zlevel: model.zlevel,
z: model.z,
shape:{
x1:model.x - model.r * 0.5939,
y1:model.y - model.r * 0.7077,
x2:model.x + model.r * 0.5939,
y2:model.y + model.r * 0.7077
},
style:{
lineWidth:2,
stroke:style.StationStand.standEmergent.defaultColor
}
});
this.emergentLine2 = new Line({
zlevel: model.zlevel,
z: model.z,
shape:{
x1:model.x + model.r * 0.5939,
y1:model.y - model.r * 0.7077,
x2:model.x - model.r * 0.5939,
y2:model.y + model.r * 0.7077
},
style:{
lineWidth:2,
stroke:style.StationStand.standEmergent.defaultColor
}
});
this.add(this.emergentLine1);
this.add(this.emergentLine2);
} }
} }
} }