浙大网新操作调整

This commit is contained in:
fan 2023-12-05 10:34:14 +08:00
parent a9f18f6d61
commit 1ecab822f4
5 changed files with 59 additions and 38 deletions

View File

@ -282,6 +282,7 @@ class SkinCode extends defaultStyle {
position: -1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: {x: 8, y: 0}, // 扣车偏移量
ibpTrainColor: '#E4EF50', // ibp扣车颜色
centerTrainColor: '#E400E4', // 中心扣车颜色
andCenterTrainColor: 'red', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除颜色
@ -475,7 +476,10 @@ class SkinCode extends defaultStyle {
spareColor: '#5b5b5b' // 区段显示颜色
},
core: {
length: 10 // 道岔单边长度
length: 10, // 道岔单边长度
graphShow: true, // 图形显示
graphInversionColor: '#FFFF00', // 反位颜色
graphLocalColor: '#00FF00' // 定位颜色
},
jointImg: { // 道岔 A B C D四元素属性配置
trapezoidLength: 8 // 直角梯形元素默认长度

View File

@ -18,7 +18,19 @@ class EDetainCircle extends Group {
const x = computedPosition.x + (model.width / 2) * detainD + detainD * style.StationStand.detainCircle.offset.x + detainD * style.StationStand.detainCircle.circleWidth / 2;
const y = computedPosition.y;
const radius = style.StationStand.detainCircle.circleWidth / 2;
this.ibpDetainCircle = new Circle({
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
cx: x + detainD * 12,
cy: y,
r: 3
},
style:{
lineWidth:2,
stroke: '#ffff00'
}
});
this.detainCircle = new Circle({
zlevel: this.model.zlevel,
z: this.model.z,
@ -61,6 +73,7 @@ class EDetainCircle extends Group {
}
});
this.add(this.detainCircle);
this.add(this.ibpDetainCircle);
this.add(this.line1);
this.add(this.line2);
}
@ -74,6 +87,7 @@ class EDetainCircle extends Group {
recover() {
const style = this.model.style;
this.detainCircle && this.detainCircle.show();
this.ibpDetainCircle && this.ibpDetainCircle.hide();
this.line1 && this.line1.show();
this.line2 && this.line2.show();
this.setColor(style.StationStand.detainCircle.defaultColor);
@ -88,6 +102,8 @@ class EDetainCircle extends Group {
this.setColor(style.StationStand.detainCircle.centerTrainColor);
} else if (model.centerHoldTrain) {
this.setColor(style.StationStand.detainCircle.centerTrainColor);
} else if (model.ibpHoldTrain) {
this.ibpDetainCircle && this.ibpDetainCircle.show();
}
}
}

View File

@ -309,12 +309,12 @@ export default class TrainBody extends Group {
setTrainBorderColor(color) {
this.trainBodyBox && this.trainBodyBox.setColor('stroke', color);
}
setHShow(isShow) {
setHShow(isShow, parking) {
if (this.textH) {
isShow ? this.textH.show() : this.textH.hide();
}
if (this.style.Train.common.HSDASpliceShow) {
isShow ? this.trainBodyBox.buckleTrain() : this.trainBodyBox.release();
if (this.style.Train.common.HSDASpliceShow && isShow) {
this.trainBodyBox.buckleTrain(parking);
}
}
setSShow(isShow) {
@ -551,9 +551,12 @@ export default class TrainBody extends Group {
trainBodyFault() {
this.trainBodyBox && this.trainBodyBox.trainBodyFault();
}
untrainBodyFault() {
this.trainBodyBox && this.trainBodyBox.untrainBodyFault();
recoverTrainBoxAnimation() {
this.trainBodyBox && this.trainBodyBox.recoverAnimation();
}
// untrainBodyFault() {
// this.trainBodyBox && this.trainBodyBox.untrainBodyFault();
// }
updateTextPosition(point) {
this.mouseEvent.updateTextPosition(point);
}

View File

@ -38,10 +38,10 @@ export default class TrainBodyBox extends Group {
}
}
// 列车扣车
buckleTrain() {
buckleTrain(parking) {
if (this.trainBodyBox) {
if (parking) { // 列车停稳状态下开始闪烁
this.trainBodyBox.setStyle('fill', 'yellow');
if (!this.model.speed) { // 列车停稳状态下开始闪烁
this.trainBodyBox.animateStyle(true)
.when(0, { fill: this.model.style.backgroundColor })
.when(1000, { fill: 'yellow' })
@ -50,13 +50,13 @@ export default class TrainBodyBox extends Group {
}
}
}
// 列车放行
release() {
if (this.trainBodyBox) {
this.trainBodyBox.setStyle('fill', this.model.style.Train.trainBody.trainBodyFillColor);
this.trainBodyBox.stopAnimation(false);
}
}
// // 列车放行
// release() {
// if (this.trainBodyBox) {
// this.trainBodyBox.setStyle('fill', this.model.style.Train.trainBody.trainBodyFillColor);
// this.trainBodyBox.stopAnimation(false);
// }
// }
// 西安二号线 列车停车状态 闪烁红色
trainBodyFault() {
if (this.trainBodyBox) {
@ -69,8 +69,14 @@ export default class TrainBodyBox extends Group {
}
}
// 西安二号线 列车取消停车状态
untrainBodyFault() {
// // 西安二号线 列车取消停车状态
// untrainBodyFault() {
// if (this.trainBodyBox) {
// this.trainBodyBox.setStyle('fill', this.model.style.Train.trainBody.trainBodyFillColor);
// this.trainBodyBox.stopAnimation(false);
// }
// }
recoverAnimation() {
if (this.trainBodyBox) {
this.trainBodyBox.setStyle('fill', this.model.style.Train.trainBody.trainBodyFillColor);
this.trainBodyBox.stopAnimation(false);

View File

@ -221,7 +221,7 @@ export default class Train extends Group {
// 恢复颜色状态
recover() {
this.trainB && this.trainB.setHShow(false);
this.trainB && this.trainB.setHShow(false, false);
this.trainB && this.trainB.setSShow(false);
this.trainB && this.trainB.setDShow(false);
this.trainB && this.trainB.setAShow(false);
@ -231,6 +231,7 @@ export default class Train extends Group {
this.trainL && this.trainL.setArrowShow(false);
this.trainR && this.trainR.setArrowShow(false);
this.trainB && this.trainB.setTrainBorderColor(this.style.Train.trainBody.trainSidelineColor || this.style.trainSidelineColor);
this.trainB && this.trainB.recoverTrainBoxAnimation();
}
// 设置运行方向状态类型
@ -327,11 +328,11 @@ export default class Train extends Group {
this.trainB && this.trainB.setSoonerOrLater(dt);
}
// 设置扣车状态
setHoldStatus(status) {
setHoldStatus(status, parking) {
if (status) {
this.trainB && this.trainB.setHShow(true);
this.trainB && this.trainB.setHShow(true, parking);
} else {
this.trainB && this.trainB.setHShow(false);
this.trainB && this.trainB.setHShow(false, parking);
}
}
@ -408,7 +409,7 @@ export default class Train extends Group {
}
this.setDoorStatus(model.doorCloseLock);
this.setAlarmStatus(model.alarmStatus);
this.setHoldStatus(model.hold);
this.setHoldStatus(model.hold, model.parking);
this.setJumpStatus(model.jump);
// this.setSoonerOrLater(model.dt);
this.setTrainTypeColor(model.type);
@ -421,10 +422,8 @@ export default class Train extends Group {
if (store.state.map.picture == 'largePassengerView') {
this.handlePassagerColor(model.num);
}
if (style.Train.trainBody.trainBodyFaultFlashColor) {
// 西安二号线 列车停车状态 闪烁红色
this.updateTrainBodyFault(model.orderStop);
}
if (!model.groundCommunicable) {
this.trainL && this.trainL.setColor('#f00');
this.trainR && this.trainR.setColor('#f00');
@ -442,17 +441,10 @@ export default class Train extends Group {
}
updateTrainBodyFault(orderStop) {
if (orderStop) {
// 西安二号线 列车停车状态 闪烁红色
if (this.trainB) {
if (this.style.Train.trainBody.trainBodyFaultFlashColor && orderStop && this.trainB) {
this.trainB.trainBodyFault();
}
} else {
// 西安二号线 列车取消停车状态
if (this.trainB) {
this.trainB.untrainBodyFault();
}
}
}
handlePassagerColor(num) {