信号机坐标编辑显示

This commit is contained in:
fan 2021-04-28 18:46:04 +08:00
parent edbd6d55cf
commit 5678d8dfad
6 changed files with 56 additions and 9 deletions

View File

@ -78,3 +78,17 @@ export function timesSpeedPlayback(group, speed) {
method: 'put' method: 'put'
}); });
} }
/** 仿真暂停 */
export function simulationPause(group) {
return request({
url: `/common/simulation/${group}/pause`,
method: 'put'
});
}
/** 仿真开始 */
export function simulationStart(group) {
return request({
url: `/common/simulation/${group}/start`,
method: 'put'
});
}

View File

@ -186,12 +186,13 @@ class SkinCode extends defaultStyle {
blockColor: '#FFFFFF', // 信号灯字体锁定颜色 blockColor: '#FFFFFF', // 信号灯字体锁定颜色
checkColor: '#00FF00' // 信号保护区段检查颜色 checkColor: '#00FF00' // 信号保护区段检查颜色
}, },
remainTimeColor: '#F00',
tText: { tText: {
offsetX: 0, offsetX: 0,
offsetY: -30, offsetY: -30,
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: '#FFFFFF', // 信号灯字体默认色 defaultColor: '#F00', // 信号灯字体默认色
defaultText: 0 defaultText: 0
}, },
lamp: { lamp: {

View File

@ -376,7 +376,7 @@ class Signal extends Group {
fontWeight: style.Signal.text.fontWeight, fontWeight: style.Signal.text.fontWeight,
fontSize: 12, fontSize: 12,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
textFill: '#FFF', textFill: style.Signal.remainTimeColor || '#FFF',
textAlign: 'center', textAlign: 'center',
textVerticalAlign: 'middle' textVerticalAlign: 'middle'
}); });

View File

@ -16,7 +16,7 @@
<center><b>总取消</b></center> <center><b>总取消</b></center>
</span> </span>
</button> </button>
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, ['SignalButton'])"> <button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, ['Signal','SignalButton'])">
<span style="color: #800000"> <span style="color: #800000">
<center><b>总人解</b></center> <center><b>总人解</b></center>
</span> </span>
@ -503,7 +503,7 @@ export default {
code: model.code, code: model.code,
operation: this.$store.state.menuOperation.buttonOperation operation: this.$store.state.menuOperation.buttonOperation
}; };
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode); const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code);
if (model._type === 'SignalButton' && model.type === 'PICK' && signal.routeLock) { if (model._type === 'SignalButton' && model.type === 'PICK' && signal.routeLock) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE; operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
operate.param = {signalId: model.signalCode}; operate.param = {signalId: model.signalCode};
@ -513,6 +513,15 @@ export default {
console.error(error); console.error(error);
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}).finally(() =>{ this.clearOperate(); }); }).finally(() =>{ this.clearOperate(); });
} else if (model._type === 'Signal' && model.type === 'SHUNTING' && signal.routeLock) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
operate.param = {signalId: model.code};
operate.val = model.code;
this.deviceList = [];
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
}).finally(() =>{ this.clearOperate(); });
} }
}, },
handelControlRoute(model) { // button handelControlRoute(model) { // button

View File

@ -11,11 +11,12 @@ function handleSockInfo(state, msg, type) {
function handleSimulationStateMsg(state, type) { function handleSimulationStateMsg(state, type) {
switch (type) { switch (type) {
case 0: case 0:
state.simulationPause = true;
store.dispatch('scriptRecord/updateSimulationPause', true); store.dispatch('scriptRecord/updateSimulationPause', true);
break; break;
case 1: case 1:
state.simulationStart++; store.dispatch('scriptRecord/updateSimulationPause', true);
store.dispatch('scriptRecord/updateSimulationPause', false); state.simulationPause = false;
break; break;
case 4: case 4:
state.simulationError++; state.simulationError++;
@ -331,7 +332,8 @@ const socket = {
competitionPracticeFinish:0, // 竞赛场景结束标识 competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: [], // 仿真报警信息 simulationAlarmInfo: [], // 仿真报警信息
deviceStateMessages: null, // 新版订阅设备状态消息 deviceStateMessages: null, // 新版订阅设备状态消息
simulationSpeed: 1 // 仿真倍速 simulationSpeed: 1, // 仿真倍速
simulationPause: false
}, },
getters: { getters: {
}, },

View File

@ -25,6 +25,8 @@
<el-button-group class="button-group-box"> <el-button-group class="button-group-box">
<template v-if="!dataError"> <template v-if="!dataError">
<template v-if="!projectDevice"> <template v-if="!projectDevice">
<el-button v-if="simulationPause" v-loading="pauseLoading" type="primary" size="small" @click="start">开始</el-button>
<el-button v-if="!simulationPause" v-loading="pauseLoading" type="warning" size="small" @click="pause">暂停</el-button>
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button> <el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
</template> </template>
</template> </template>
@ -49,6 +51,7 @@ import { TrainingMode } from '@/scripts/ConstDic';
import { setGoodsTryUse } from '@/api/management/goods'; import { setGoodsTryUse } from '@/api/management/goods';
// import {loadScriptNew } from '@/api/simulation'; // import {loadScriptNew } from '@/api/simulation';
import StatusIcon from '@/views/components/StatusIcon/statusIcon'; import StatusIcon from '@/views/components/StatusIcon/statusIcon';
import { simulationPause, simulationStart } from '../../../api/rtSimulation';
// import Vue from 'vue'; // import Vue from 'vue';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
// import { EventBus } from '@/scripts/event-bus'; // import { EventBus } from '@/scripts/event-bus';
@ -103,6 +106,7 @@ export default {
isShow3dmodel :true, isShow3dmodel :true,
isGoback: false, isGoback: false,
runing:false, runing:false,
pauseLoading: false,
prdTypeMap: { prdTypeMap: {
'01': '01', // => '01': '01', // =>
'02': '02', // => '02': '02', // =>
@ -126,6 +130,9 @@ export default {
}, },
project() { project() {
return getSessionStorage('project'); return getSessionStorage('project');
},
simulationPause() {
return this.$store.state.socket.simulationPause;
} }
}, },
watch: { watch: {
@ -213,8 +220,22 @@ export default {
selectBeginTime() { selectBeginTime() {
this.$refs.setTime.doShow(); this.$refs.setTime.doShow();
}, },
start(model) { start() {
this.$emit('start', model); this.pauseLoading = true;
simulationStart(this.$route.query.group).then(resp => {
this.pauseLoading = false;
}).catch((e) =>{
this.$message.error('仿真开始失败!');
});
},
pause() {
this.pauseLoading = true;
simulationPause(this.$route.query.group).then(resp => {
this.pauseLoading = false;
}).catch((e) => {
this.pauseLoading = false;
this.$message.error('仿真暂停失败!');
});
}, },
setRuning(run) { setRuning(run) {
this.runing = run; this.runing = run;