tro 轨道总览

This commit is contained in:
fan 2021-05-18 13:36:06 +08:00
parent 4b83445624
commit df68e9a969
10 changed files with 169 additions and 101 deletions

View File

@ -1,3 +1,3 @@
# jl-nclient
showMode 01 行调&现地;02 行调; 03 现地; 04 大屏; 05 轨道预览;
Copyright (c) 2018-present Joylink

View File

@ -81,6 +81,8 @@ class SkinCode extends defaultStyle {
line: {
z: 0,
width: 5, // 区段宽度
troWidth: 2, // 轨道总览区段宽度
troColor: '#c0c0c0', // 轨道总览区段颜色
beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#EF0C08', // 区段侵入颜色
routeBlockFlashing: true, // 进路锁闭且封锁时闪烁
@ -259,10 +261,10 @@ class SkinCode extends defaultStyle {
},
transmission: { // 传输信号机
fillColor: '#f00',
fillColorVirtual: '#000080',
fillColorVirtual: '#000080',
sideLength: 20,
textColor: '#fff',
strokeColor: '#00FFFF',
strokeColor: '#00FFFF'
}
};
@ -933,7 +935,7 @@ class SkinCode extends defaultStyle {
// textFill: '#fff'
// }
// };
this[deviceType.IndicatorLight] = {};
this[deviceType.IndicatorLight] = {};
}
}

View File

@ -6,7 +6,7 @@ import EblockLines from './EblockLines'; // 区段封锁特有
import ESeparator from './ESeparator'; // 分隔符 (私有)
import EMouse from './EMouse';
import EAxle from './EAxle'; // 创建计轴
import EDerailer from './EDerailer'; //脱轨器
import EDerailer from './EDerailer'; // 脱轨器
// import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
import EBackArrowGroup from './EBackArrow'; // 折返进路箭头
import ELimitName from './ELimitName'; // 成都三号线 限速名称
@ -14,41 +14,40 @@ import ELimitName from './ELimitName'; // 成都三号线 限速名称
import { drawSectionStyle } from '../../config/defaultStyle';
import EStopRouteImg from './EStopRouteImg';
import EBadShunt from './EBadShunt';
import store from '@/store/index';
const exec = (f,...args) => { f && f(...args); };
const exec = (f, ...args) => { f && f(...args); };
const DerailerMap = {
0: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'green'});
derailer.setSymbolStyle({fill: 'red'});
},
1: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'yellow'});
derailer.setSymbolStyle({fill: 'red'});
},
2: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'green'});
derailer.setSymbolStyle({fill: 'green'});
},
3: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'yellow'});
derailer.setSymbolStyle({fill: 'green'});
},
4: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'red'});
derailer.setSymbolStyle({fill: 'red'});
},
5: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'red'});
derailer.setSymbolStyle({fill: 'gray'});
}
}
0: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'green'});
derailer.setSymbolStyle({fill: 'red'});
},
1: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'yellow'});
derailer.setSymbolStyle({fill: 'red'});
},
2: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'green'});
derailer.setSymbolStyle({fill: 'green'});
},
3: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'yellow'});
derailer.setSymbolStyle({fill: 'green'});
},
4: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'red'});
derailer.setSymbolStyle({fill: 'red'});
},
5: (derailer, style) => {
derailer.show();
derailer.setTextStyle({textFill: 'red'});
derailer.setSymbolStyle({fill: 'gray'});
}
};
/** 区段*/
export default class Section extends Group {
@ -67,6 +66,7 @@ export default class Section extends Group {
this.create();
this.createMouseEvent();
this.setState(model);
this.setShowMode();
}
create() {
@ -99,7 +99,7 @@ export default class Section extends Group {
'speedLimitName': ELimitName, // 限速线名称
'shuttleBack': EBackArrowGroup, // 折返箭头 (成都三号线显示)
'badShunt':EBadShunt, // 大铁项目 分路不良
'derailer': EDerailer
'derailer': EDerailer
};
// 遍历当前线路下的绘图元素
const model = this.model;
@ -141,7 +141,7 @@ export default class Section extends Group {
// this.line.setRunLineDefault();
}
this.name && this.name.recover();
this.derailer && this.derailer.hide();
this.derailer && this.derailer.hide();
this.speedLimit && this.speedLimit.hide();
this.speedLimitName && this.speedLimitName.hide();
this.badShunt && this.badShunt.hide();
@ -465,8 +465,8 @@ export default class Section extends Group {
model.faultLock && this.faultLock();
// 设置灰显
model.noStatus && this.setAshShow();
// 设置脱轨器
model.signalDerailer && exec(DerailerMap[model.signalDerailer], this.derailer, this.style);
// 设置脱轨器
model.signalDerailer && exec(DerailerMap[model.signalDerailer], this.derailer, this.style);
/** 道岔区段更新岔心颜色 */
if (model.type === '03' && model.switch) {
@ -573,7 +573,14 @@ export default class Section extends Group {
mouseover() {
this.line && this.line.setStyle({ stroke: 'rgba(255,255,255,0.8)' });
}
setShowMode() { }
setShowMode() {
if (this.model.showMode === '05') {
this.line.setStyle({stroke: this.style.Section.line.troColor, lineWidth: this.style.Section.line.troWidth});
if (this.model.type === '05') {
this.line.hide();
}
}
}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {
this.eachChild(item => {

View File

@ -31,6 +31,7 @@ export default class Switch extends Group {
this.createMouseEvent();
this.setState(model);
this.checkIsDrawMap();
this.setShowMode();
}
createMouseEvent() {
@ -722,7 +723,7 @@ export default class Switch extends Group {
// this.interlockingReserved(); // 联锁预留道岔
model.preReset && this.preReset(model.normalPosition, model.reversePosition); // 道岔预复位
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
if (this.style.Switch.sectionAction.flag && this.model.showMode !== '05') { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = this.mapDevice[model.code];
const sectionB = this.mapDevice[switchModel.sectionBCode];
sectionB && sectionB.instance && sectionB.instance.setState(sectionB);
@ -797,7 +798,13 @@ export default class Switch extends Group {
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
setShowMode() {}
setShowMode() {
if ( this.model.showMode === '05') {
this.eachChild(item => {
item.hide();
});
}
}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {
this.eachChild(item => {

View File

@ -79,7 +79,7 @@
<el-button size="mini" plain :disabled="trainOperateType==='update'" @click="handleTrainOperate('update')">车次号修改</el-button>
<el-button size="mini" plain :disabled="trainOperateType==='delete'" @click="handleTrainOperate('delete')">车次号删除</el-button>
<el-button size="mini" plain :disabled="trainOperateType==='create'" @click="handleTrainOperate('create')">车次号创建</el-button>
<el-button size="mini" plain :disabled="trainOperateType==='move'" @click="handleTrainOperate('create')">车次号步进</el-button>
<el-button size="mini" plain :disabled="trainOperateType==='move'" @click="handleTrainOperate('move')">车次号步进</el-button>
</div>
</el-row>
<el-row style="height: 25px;line-height: 25px;border-top: 2px solid #7E8076;border-left: 2px solid #6A6B64;border-right: 2px solid #FBFBFA;">

View File

@ -2,7 +2,6 @@
<div
ref="jlmapCanvas"
class="jlmap-canvas"
style="width: 100%;height:960px;"
>
<div :id="canvasId" class="display_canvas" />
</div>
@ -10,10 +9,10 @@
<script>
import Jlmap from '@/jmapNew/map';
import { parser } from '@/jmapNew/utils/parser';
import { deepAssign } from '@/utils/index';
import deviceType from '@/jmapNew/constant/deviceType';
import { mapGetters } from 'vuex';
import { parser } from '@/jmapNew/utils/parser';
export default {
name: 'JLocalmapVisual',
@ -41,7 +40,7 @@ export default {
'bigScreenConfig'
]),
width() {
return this.$store.state.app.width - 40;
return this.$store.state.app.width - 30;
},
height() {
return this.$store.state.app.height - 60;
@ -58,7 +57,6 @@ export default {
}
},
created() {
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
},
mounted() {
this.init();
@ -102,12 +100,15 @@ export default {
return false;
};
if (this.mapData.skinVO) {
this.mapDevice = parser(this.mapData, this.mapData.skinVO.code, this.map.getShowConfig());
}
},
loadData() {
loadData(mapData, showMode) {
try {
this.mapData = mapData;
if (this.mapData.skinVO) {
const config = this.map.getShowConfig();
config.showMode = showMode;
this.mapDevice = parser(this.mapData, this.mapData.skinVO.code, config);
}
this.setMap(this.mapData, this.mapDevice);
} catch (error) {
console.log('[ERROR] ', error);
@ -122,9 +123,7 @@ export default {
routeData: this.routeData,
autoReentryData: this.autoReentryData
});
setTimeout(() => {
this.handleUpdateScreen();
}, 2000);
this.handleUpdateScreen();
} else {
this.mapDevice = {};
this.map.clear();
@ -132,7 +131,6 @@ export default {
},
handleUpdateScreen() {
this.maskOpen = false;
console.log(this.bigScreenConfig, '--0000');
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
@ -144,7 +142,6 @@ export default {
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
console.log(size, '=----1');
this.map.setUpdateScreen(size);
} else {
const size = {
@ -153,7 +150,6 @@ export default {
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
console.log(size, '=----');
this.map.setUpdateScreen(size);
}
} else {

View File

@ -1,7 +1,7 @@
<template>
<el-dialog
v-dialogDrag
class="haerbin-01__systerm"
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
@ -13,50 +13,20 @@
</template>
<script>
import { mapGetters } from 'vuex';
import MapVisual from './mapVisual';
export default {
name: 'TrainMove',
name: 'RPS',
components: {
MapVisual
},
data() {
return {
trainNoList: [],
addModel: {
tripNumber: '',
trainSource: '',
stationStandSource: '',
trainGoal: '',
stationStandGoal: ''
},
rules: {
tripNumber: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
],
trainSource: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
stationStandSource: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
],
trainGoal: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
]
},
dialogShow: false,
loading: false
mapData: null
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -65,10 +35,11 @@ export default {
}
},
methods: {
doShow(operate, selected) {
doShow() {
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.map.loadData(this.mapData);
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
this.$refs.map.loadData(this.mapData, '02');
});
},
doClose() {
@ -82,11 +53,14 @@ export default {
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1);
background: rgba(100, 100, 100, 1) !important;
position: relative;
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1) !important;
border: 0 !important;
}
</style>

View File

@ -0,0 +1,76 @@
<template>
<el-dialog
class="haerbin-01__systerm"
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
:before-close="doClose"
:z-index="2000"
>
<map-visual ref="map" />
</el-dialog>
</template>
<script>
import MapVisual from './mapVisual';
export default {
name: 'TRO',
components: {
MapVisual
},
data() {
return {
dialogShow: false,
mapData: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '轨道总览';
}
},
methods: {
doShow() {
this.dialogShow = true;
this.$nextTick(function () {
const map = this.$store.state.map.map;
const data = {
sectionList: map.sectionList,
scaling: map.scaling,
skinVO: map.skinVO,
stationList: map.stationList,
origin: map.origin,
bigScreenConfig: map.bigScreenConfig,
switchList: map.switchList
};
this.mapData = JSON.parse(JSON.stringify(data));
this.$refs.map.loadData(this.mapData, '05');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
}
}
};
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1) !important;
position: relative;
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1) !important;
border: 0 !important;
}
</style>

View File

@ -93,7 +93,7 @@
<div>
<div class="div-simulate-button" style="width: 40px;" @click="rpsClick">背投</div>
<div class="div-simulate-button" style="width: 40px;">车场</div>
<div class="div-simulate-button" style="width: 40px;">轨道</div>
<div class="div-simulate-button" style="width: 40px;" @click="troClick">轨道</div>
<div class="div-simulate-button" style="width: 40px;">系统</div>
<div class="div-simulate-button" style="width: 40px;">列车</div>
</div>
@ -171,6 +171,7 @@
<train-control ref="trainControl" :offset="10" />
<log-detail ref="logDetail" />
<rps-dialog ref="rpsDialog" />
<tro-dialog ref="troDialog" />
<audio id="buzzer" controls loop="loop" style="width: 0;height: 0">
<source :src="buzzerAudio" type="audio/mpeg">
</audio>
@ -187,6 +188,7 @@ import AlarmTableHmi from './menuDialog/alarmTableHmi';
import AlarmTableLow from './menuDialog/alarmTableLow';
import TrainControl from './dialog/trainControl';
import RpsDialog from './dialog/rps';
import TroDialog from './dialog/tro';
import LogDetail from './menuDialog/logDetail';
export default {
@ -196,7 +198,8 @@ export default {
AlarmTableHmi,
TrainControl,
LogDetail,
RpsDialog
RpsDialog,
TroDialog
},
props: {
selected: {
@ -483,6 +486,9 @@ export default {
rpsClick() {
this.$refs.rpsDialog.doShow();
},
troClick() {
this.$refs.troDialog.doShow();
},
controlAudio(val) {
const audio = document.getElementById('buzzer');
this.sound = val;

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// 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.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康