南京二号线 控制模式none 车站字体闪烁

This commit is contained in:
fan 2021-01-18 14:10:55 +08:00
parent f60054ccad
commit 6aea2334e6
4 changed files with 29 additions and 19 deletions

View File

@ -389,7 +389,8 @@ class SkinCode extends defaultStyle {
fontWeight:'normal', // 字体粗细
textPadding:[2, 6], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:1 // 字体边框宽度
textBorderWidth:1, // 字体边框宽度
noneModeColor: '#FF0' // 无模式时字体颜色
},
syncCentralizeStation: true, // 集中站和下辖车站控制权状态同步
kmPostShow: true, // 公里标显示

View File

@ -428,14 +428,17 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.Station] = {
// 哈尔滨一号线 车站元素 车站名称
// 车站元素 车站名称
elemnetType:['stationText'],
stationText:{
z:0,
fontWeight:'normal', // 字体粗细
textPadding:[2, 6], // 字体边距
borderColor:'', // 字体边框颜色
textBorderWidth:1 // 字体边框宽度
textBorderWidth:1, // 字体边框宽度
noneModeFlash: true, // 无控制权模式字体闪烁
centerModeColor: '#1fdc1f', // 中控字体颜色
localModeColor: '#fff'// 站控字体颜色
},
syncCentralizeStation: true, // 集中站和下辖车站控制权状态同步
kmPostShow: true, // 公里标显示

View File

@ -5,6 +5,7 @@ class EStationText extends Group {
constructor(model) {
super();
this.model = model;
this.style = model.style;
this.create();
}
@ -64,7 +65,14 @@ class EStationText extends Group {
setState() {
}
setAnimateStyle(noneBeforeMode) {
this.stopAnimate();
const color = noneBeforeMode === 'Center' ? this.style.Station.stationText.centerModeColor : this.style.Station.stationText.localModeColor;
this.stationName.animateStyle(true).when(500, {textFill: '#000'}).when(1000, {textFill: color}).when(1500, {textFill: '#000'}).start();
}
stopAnimate() {
this.stationName.stopAnimation(true);
}
setColor(color) {
const style = this.model.style;
if (style.Station.StationControl.disPlayNone) {

View File

@ -26,6 +26,7 @@ export default class Station extends Group {
this.z = 40;
this.model = model;
this.style = style;
this.noneBeforeMode = '';
this.isShowShape = true;
this.create();
this.createTurnBack(); // 创建按图折返
@ -351,6 +352,7 @@ export default class Station extends Group {
}
handleCenter() { // 中控
this.noneBeforeMode = 'Center';
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
@ -368,6 +370,7 @@ export default class Station extends Group {
}
handleLocal() { // 站控
this.noneBeforeMode = 'Local';
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色
@ -400,22 +403,14 @@ export default class Station extends Group {
}
handleNone() { // 空
// if (this.style.Station.StationControl.disPlayNone) { // 没有控制时显示 黄色
// this.stationText && this.stationText.setStyle('textFill', '#FFFF00');
// if (this.model.subheadDisplay) { // 副标题
// this.subheadText && this.subheadText.setStyle('textFill', '#FFFF00');
// }
// }
this.stationText.setColor('#FFFF00');
if (this.style.Station.stationText.noneModeColor) {
this.stationText.setColor(this.style.Station.stationText.noneModeColor);
}
if (this.style.Station.stationText.noneModeFlash) {
this.stationText.setAnimateStyle(this.noneBeforeMode);
}
}
// /** 恢复初始状态*/
// recover() {
// const currentTypeList = this.style.Station.elemnetType;
// currentTypeList.forEach(element => {
// this[element].recover();
// });
// }
recover() {
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyControl && this.emergencyControl.setTextColor(this.style.Station.StationControl.text.fontColor);
@ -426,6 +421,7 @@ export default class Station extends Group {
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.stationText && this.stationText.stopAnimate();
}
// 设置状态
@ -433,9 +429,11 @@ export default class Station extends Group {
if (!this.isShowShape) return;
this.recover();
model.controlMode && this['handle' + model.controlMode]();
if (this.style.Station.syncCentralizeStation && model.controlMode) {
if (this.style.Station.syncCentralizeStation && model.controlMode && model.centralized) {
model.chargeStationCodeList.forEach(item => {
const device = store.getters['map/getDeviceByCode'](item);
device.controlMode = model.controlMode;
device && device.instance && device.instance.recover();
device && device.instance && device.instance['handle' + model.controlMode]();
});
}