From 72f730aaa62b5220403429952b3ad2cd6273cf27 Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 5 Dec 2023 10:34:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=99=E5=A4=A7=E7=BD=91=E6=96=B0=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 1ecab822f41300bfb704f16b0e6636d910ff962f) --- src/jmapNew/config/skinCode/xian_02.js | 6 +++- .../StationStand/detain/EDetainCircle.js | 18 ++++++++++- src/jmapNew/shape/graph/Train/TrainBody.js | 13 ++++---- src/jmapNew/shape/graph/Train/TrainBodyBox.js | 30 +++++++++++-------- src/jmapNew/shape/graph/Train/index.js | 30 +++++++------------ 5 files changed, 59 insertions(+), 38 deletions(-) diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 8037b3d0e..13cd7222f 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -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 // 直角梯形元素默认长度 diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js b/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js index 46c4dfe8a..82c02edfb 100644 --- a/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js +++ b/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js @@ -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(); } } } diff --git a/src/jmapNew/shape/graph/Train/TrainBody.js b/src/jmapNew/shape/graph/Train/TrainBody.js index 7fc7f5c8c..9d9262221 100644 --- a/src/jmapNew/shape/graph/Train/TrainBody.js +++ b/src/jmapNew/shape/graph/Train/TrainBody.js @@ -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); } diff --git a/src/jmapNew/shape/graph/Train/TrainBodyBox.js b/src/jmapNew/shape/graph/Train/TrainBodyBox.js index 819fc9c98..7278c9144 100644 --- a/src/jmapNew/shape/graph/Train/TrainBodyBox.js +++ b/src/jmapNew/shape/graph/Train/TrainBodyBox.js @@ -38,10 +38,10 @@ export default class TrainBodyBox extends Group { } } // 列车扣车 - buckleTrain() { + buckleTrain(parking) { if (this.trainBodyBox) { - this.trainBodyBox.setStyle('fill', 'yellow'); - if (!this.model.speed) { // 列车停稳状态下开始闪烁 + if (parking) { // 列车停稳状态下开始闪烁 + this.trainBodyBox.setStyle('fill', 'yellow'); 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); diff --git a/src/jmapNew/shape/graph/Train/index.js b/src/jmapNew/shape/graph/Train/index.js index 9c30f5b25..0805dbd5e 100644 --- a/src/jmapNew/shape/graph/Train/index.js +++ b/src/jmapNew/shape/graph/Train/index.js @@ -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); - } + // 西安二号线 列车停车状态 闪烁红色 + this.updateTrainBodyFault(model.orderStop); if (!model.groundCommunicable) { this.trainL && this.trainL.setColor('#f00'); this.trainR && this.trainR.setColor('#f00'); @@ -442,16 +441,9 @@ export default class Train extends Group { } updateTrainBodyFault(orderStop) { - if (orderStop) { - // 西安二号线 列车停车状态 闪烁红色 - if (this.trainB) { - this.trainB.trainBodyFault(); - } - } else { - // 西安二号线 列车取消停车状态 - if (this.trainB) { - this.trainB.untrainBodyFault(); - } + // 西安二号线 列车停车状态 闪烁红色 + if (this.style.Train.trainBody.trainBodyFaultFlashColor && orderStop && this.trainB) { + this.trainB.trainBodyFault(); } }