调整站台显示问题

This commit is contained in:
zyy 2020-02-17 17:50:15 +08:00
parent 2b5ac01556
commit 73b51bd385
12 changed files with 52 additions and 40 deletions

View File

@ -222,7 +222,7 @@ class SkinCode extends defaultStyle {
}, },
standEmergent: { // 紧急关闭 standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径 mergentR: 4, // 站台紧急关闭半径
offset: { x: 0, y: 0 }, // 站台紧急关闭偏移量 offset: { x: 0, y: 0 }, // 站台紧急关闭偏移量
closeColor: '#F61107' // 站台紧急关闭颜色 closeColor: '#F61107' // 站台紧急关闭颜色
}, },
reentry: { // 站台折返策略 reentry: { // 站台折返策略
@ -247,7 +247,7 @@ class SkinCode extends defaultStyle {
}, },
level: { // 运行等级 level: { // 运行等级
position: 1, // 运行等级方向 position: 1, // 运行等级方向
offset: { x: -8, y: 22 }, // 运行等级偏移量 offset: { x: -8, y: 10 }, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色 textColor: '#FFFFFF' // 停站等级字体颜色
}, },
mouseOverStyle: { mouseOverStyle: {

View File

@ -220,8 +220,9 @@ class SkinCode extends defaultStyle {
designatedJumpStopColor: '#808080' // 站台指定列车跳停颜色 designatedJumpStopColor: '#808080' // 站台指定列车跳停颜色
}, },
standEmergent: { // 紧急关闭 standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径 flicker: true, // 闪烁
offset: {x: 0, y: 40}, // 站台紧急关闭偏移量 mergentR: 5, // 站台紧急关闭半径
offset: {x: 0, y: 15}, // 站台紧急关闭偏移量
closeColor: '#F61107' // 站台紧急关闭颜色 closeColor: '#F61107' // 站台紧急关闭颜色
}, },
reentry: { // 站台折返策略 reentry: { // 站台折返策略
@ -242,12 +243,13 @@ class SkinCode extends defaultStyle {
stopTime: { // 停站时间 stopTime: { // 停站时间
position: 1, // 运行时间方向 position: 1, // 运行时间方向
offset: {x: -8, y: -4}, // 运行时间偏移量 offset: {x: -8, y: -4}, // 运行时间偏移量
textColor: '#C0C0C0' // 停站时间字体颜色 textColor: '#C0C0C0', // 停站时间字体颜色
textFontSize: 12
}, },
jump: { jump: {
text: '跳', // 停跳显示内容 text: '跳', // 停跳显示内容
position: -1, // 停跳方向 position: -1, // 停跳方向
offset: {x: -8, y: 0}, offset: {x: -8, y: 10},
textColor: '#0000FF', // 停跳文字颜色 textColor: '#0000FF', // 停跳文字颜色
arcColor: '#0000FF', // 停跳圆圈颜色 arcColor: '#0000FF', // 停跳圆圈颜色
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色 fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
@ -255,7 +257,7 @@ class SkinCode extends defaultStyle {
}, },
level: { // 运行等级 level: { // 运行等级
position: 1, // 运行等级方向 position: 1, // 运行等级方向
offset: {x: -8, y: 30}, // 运行等级偏移量 offset: {x: -8, y: 15}, // 运行等级偏移量
textColor: '#FFF000' // 停站等级字体颜色 textColor: '#FFF000' // 停站等级字体颜色
} }
}; };

View File

@ -218,7 +218,7 @@ class SkinCode extends defaultStyle {
}, },
standEmergent: { // 紧急关闭 standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径 mergentR: 4, // 站台紧急关闭半径
offset: {x: 0, y: 0}, // 站台紧急关闭偏移量 offset: {x: 0, y: 3}, // 站台紧急关闭偏移量
closeColor: 'red' // 站台紧急关闭颜色 closeColor: 'red' // 站台紧急关闭颜色
}, },
reentry: { // 站台折返策略 reentry: { // 站台折返策略

View File

@ -84,6 +84,7 @@ deviceState[deviceType.Psd] = {
// State03: '03' /** 切除 */ // State03: '03' /** 切除 */
// }, // },
// /** 屏蔽门开门状态*/ // /** 屏蔽门开门状态*/
screenDoorOpenStatus: 0,
// screenDoorOpenStatus: { // screenDoorOpenStatus: {
// Default: '01', /** 关门(缺省值)*/ // Default: '01', /** 关门(缺省值)*/
// State01: '01', /** 关门 */ // State01: '01', /** 关门 */

View File

@ -1,4 +1,5 @@
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
import deviceType from './deviceType';
// 所有默认状态在这里都要有 用来转换后台发送的数据状态 // 所有默认状态在这里都要有 用来转换后台发送的数据状态
class Status { class Status {
@ -60,6 +61,7 @@ class Status {
} }
handlePsd(device) { handlePsd(device) {
this.statusObj = { this.statusObj = {
screenDoorOpenStatus: device.screenDoorOpenStatus, // 屏蔽门是否开门
fault: device.fault /** 非故障*/ fault: device.fault /** 非故障*/
}; };
} }

View File

@ -65,14 +65,8 @@ export default class Line2 extends Group {
setState(model) { setState(model) {
/** 设置屏蔽门开关*/ /** 设置屏蔽门开关*/
// switch (model.screenDoorOpenStatus) { model.screenDoorOpenStatus != 0 && this.openDoor(); /** 开门*/
// case '01': model.screenDoorOpenStatus == 0 && this.closeDoor(); /** 关门*/
// this.closeDoor(); /** 关门*/
// break;
// case '02':
// this.openDoor(); /** 开门*/
// break;
// }
// /** 设置屏蔽门状态*/ // /** 设置屏蔽门状态*/
// switch (model.screenDoorStatus) { // switch (model.screenDoorStatus) {

View File

@ -21,11 +21,12 @@ class ELevel extends Group {
x: model.x, x: model.x,
y: model.y, y: model.y,
fontWeight: 'normal', fontWeight: 'normal',
fontSize: style.StationStand.common.textFontSize, fontSize: style.StationStand.stopTime.textFontSize || style.StationStand.common.textFontSize,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
text: model.name, text: model.name,
textFill: style.StationStand.level.textColor, textFill: style.StationStand.level.textColor,
textAlign: 'middle' textAlign: 'center',
textVerticalAlign: 'middle'
} }
}); });

View File

@ -74,6 +74,10 @@ class ESafeEmergent extends Group {
this.create(); this.create();
this.emergent.show(); this.emergent.show();
} }
getElement() {
return this.emergent;
}
} }
export default ESafeEmergent; export default ESafeEmergent;

View File

@ -25,7 +25,8 @@ class ETime extends Group {
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
text: model.name, text: model.name,
textFill: style.StationStand.stopTime.textColor, textFill: style.StationStand.stopTime.textColor,
textAlign: 'middle' textAlign: 'center',
textVerticalAlign: 'middle'
} }
}); });

View File

@ -51,9 +51,9 @@ class StationStand extends Group {
this.add(this.safeStand); this.add(this.safeStand);
/** 站台紧急关闭*/ /** 站台紧急关闭*/
const emergentH = model.right ? 1 : -1; const emergentH = model.inside ? model.right ? 1 : -1 : model.right ? -1 : 1;
let emergentX = model.position.x + drict * (style.StationStand.standEmergent.offset.x); let emergentX = model.position.x + style.StationStand.standEmergent.offset.x;
let emergentY = model.position.y + emergentH * (model.height / 2 + style.StationStand.standEmergent.mergentR); let emergentY = model.position.y + emergentH * (model.height / 2 + style.StationStand.standEmergent.offset.y);
if (style.StationStand.common.special) { if (style.StationStand.common.special) {
emergentX = model.position.x; emergentX = model.position.x;
emergentY = model.position.y; emergentY = model.position.y;
@ -140,9 +140,9 @@ class StationStand extends Group {
}); });
/** 停站时间*/ /** 停站时间*/
const timeH = style.StationStand.standEmergent.mergentR; const timeDrict = model.right ? 1 : -1;
const timeX = model.position.x - (style.StationStand.stopTime.position || drict) * (style.StationStand.stopTime.offset.x - model.width / 2); const timeX = model.position.x - timeDrict * (style.StationStand.stopTime.offset.x - model.width / 2);
const timeY = model.position.y + (style.StationStand.stopTime.position || drict) * (style.StationStand.stopTime.offset.y) + drict * timeH; const timeY = model.position.y + timeDrict * style.StationStand.stopTime.offset.y;
this.time = new ETime({ this.time = new ETime({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
@ -153,9 +153,9 @@ class StationStand extends Group {
}); });
/** 运行等级*/ /** 运行等级*/
const levelH = style.StationStand.standEmergent.mergentR; const levelDrict = model.right ? 1 : -1;
const levelX = model.position.x - (style.StationStand.level.position || drict) * (style.StationStand.level.offset.x - model.width / 2); const levelX = model.position.x - levelDrict * (style.StationStand.level.offset.x - model.width / 2);
const levelY = model.position.y + (style.StationStand.level.position || drict) * (style.StationStand.level.offset.y) + drict * levelH; const levelY = model.position.y + levelDrict * (style.StationStand.level.offset.y);
this.level = new ELevel({ this.level = new ELevel({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
@ -167,11 +167,11 @@ class StationStand extends Group {
/** 列车停跳 */ /** 列车停跳 */
if (style.StationStand.common.haveJumpShow) { if (style.StationStand.common.haveJumpShow) {
const jumpH = style.StationStand.standEmergent.mergentR; const jumpDirct = model.right ? -1 : 1;
const jumpX = model.position.x - (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.x - model.width / 2); const jumpX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
const jumpY = model.position.y + (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.y) + drict * jumpH; const jumpY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
const jumpCX = model.position.x - (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.x - model.width / 2); const jumpCX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
const jumpCY = model.position.y + (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.y - style.StationStand.common.textFontSize / 2) + drict * jumpH; const jumpCY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
this.jump = new EJump({ this.jump = new EJump({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
@ -180,8 +180,8 @@ class StationStand extends Group {
y: jumpY, y: jumpY,
cx: jumpCX, cx: jumpCX,
cy: jumpCY, cy: jumpCY,
textAlign: 'middle', textAlign: 'center',
textVerticalAlign: 'top', textVerticalAlign: 'middle',
allSkip: model.allSkip, allSkip: model.allSkip,
assignSkip: model.assignSkip assignSkip: model.assignSkip
}); });
@ -240,9 +240,10 @@ class StationStand extends Group {
stop() { stop() {
if (!this.style.StationStand.common.special) { if (!this.style.StationStand.common.special) {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.stopColor); this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.stopColor);
} else {
this.trainStop && this.trainStop.show();
this.trainDepart && this.trainDepart.show();
} }
this.trainStop && this.trainStop.show();
this.trainDepart && this.trainDepart.show();
} }
/** 站台紧急关闭*/ /** 站台紧急关闭*/
@ -251,6 +252,13 @@ class StationStand extends Group {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor); this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
} }
this.emergent && this.emergent.show(); this.emergent && this.emergent.show();
if (this.style.StationStand.standEmergent.flicker) {
this.emergent.getElement().animateStyle(true)
.when(0, { fill: this.style.backgroundColor })
.when(1000, { fill: this.style.StationStand.standEmergent.closeColor })
.when(2000, { fill: this.style.backgroundColor })
.start();
}
} }
/** 指定列车跳站*/ /** 指定列车跳站*/

View File

@ -122,7 +122,6 @@ export default class Switch extends Group {
onmouseout: () => { this.name.getArrowText().hide(); } onmouseout: () => { this.name.getArrowText().hide(); }
}); });
this.releaseBackground = new Line({ // 区段上遮盖段 this.releaseBackground = new Line({ // 区段上遮盖段
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,

View File

@ -3,12 +3,12 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.82:9000'; // 杜康
BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;