继电器状态图显示调整+spks生成调整

This commit is contained in:
joylink_zhaoerwei 2024-06-25 09:16:17 +08:00
parent 059a333370
commit 8e62b39f34
2 changed files with 44 additions and 10 deletions

View File

@ -119,7 +119,10 @@ let ciQdList = sceneCiCjQdListMap.get(
) as relayCabinetGraphicData.CiQd; ) as relayCabinetGraphicData.CiQd;
const dialogWidth = computed(() => { const dialogWidth = computed(() => {
if (setCellMessage.value.cols * 134 + 85 <= 1157) {
return setCellMessage.value.cols * 134 + 85; return setCellMessage.value.cols * 134 + 85;
}
return 1157;
}); });
watch( watch(
@ -143,8 +146,11 @@ watch(
); );
onMounted(() => { onMounted(() => {
setCellMessage.value.rows = ciCjList.dsCount; setCellMessage.value.rows = Math.max(ciCjList.dsCount, ciQdList.dsCount);
setCellMessage.value.cols = ciCjList.cjList.length; setCellMessage.value.cols = Math.max(
ciCjList.cjList.length,
ciQdList.qdList.length
);
tabList.value[0].ListMap = updateCiCjListMap(); tabList.value[0].ListMap = updateCiCjListMap();
tabList.value[1].ListMap = updateCiQdListMap(); tabList.value[1].ListMap = updateCiQdListMap();
}); });

View File

@ -279,9 +279,14 @@ import {
ShowCodeType, ShowCodeType,
} from './GeneraterRelayLayoutConfig'; } from './GeneraterRelayLayoutConfig';
import { generateRelayLayout, GenerateRelaysCongig } from './GeneraterDevice'; import { generateRelayLayout, GenerateRelaysCongig } from './GeneraterDevice';
import { getPublishMapInfoById, pageQuery } from 'src/api/PublishApi'; import {
getPublishMapInfoById,
getPublishMapInfoByName,
pageQuery,
} from 'src/api/PublishApi';
import { ciCjMap, CjData, PostionType } from './GeneraterCiCjConfig'; import { ciCjMap, CjData, PostionType } from './GeneraterCiCjConfig';
import { ciQdMap, QdData } from './GeneraterCiQdConfig'; import { ciQdMap, QdData } from './GeneraterCiQdConfig';
import { ibpGraphicData } from 'src/protos/ibpGraphics';
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
@ -533,6 +538,7 @@ async function openGeneraterRelayLayoutDialog() {
let storage: graphicData.RtssGraphicStorage; let storage: graphicData.RtssGraphicStorage;
const stationMap = new Map<number, string>(); const stationMap = new Map<number, string>();
let hasSPKS = false;
async function onChoosePublishId() { async function onChoosePublishId() {
const response = await getPublishMapInfoById( const response = await getPublishMapInfoById(
+generaterRelayLayout.value.publishId +generaterRelayLayout.value.publishId
@ -555,6 +561,31 @@ async function onChoosePublishId() {
screenDoorGroup.unshift(config.trainGroupAmount); screenDoorGroup.unshift(config.trainGroupAmount);
}); });
changeScreenDoorGroup.value = screenDoorGroup; changeScreenDoorGroup.value = screenDoorGroup;
if (storage.ibpBoxs.length) {
checkIbpSpks(storage.ibpBoxs[0].refIbpMapCode).then((has) => {
if (has) {
hasSPKS = true;
}
});
}
}
async function checkIbpSpks(refIbpMapCode: string) {
const { proto } = await getPublishMapInfoByName({
name: refIbpMapCode,
detail: true,
});
if (proto) {
const storage = ibpGraphicData.IBPGraphicStorage.deserialize(
toUint8Array(proto)
);
for (let i = 0; i < storage.ibpKeys.length; i++) {
if (storage.ibpKeys[i].code.includes('SPKS')) {
return true;
}
}
return false;
}
} }
const myForm = ref<QForm | null>(null); const myForm = ref<QForm | null>(null);
@ -692,12 +723,9 @@ function oneClickGeneraterRelayLayout() {
} }
} }
//ibpBoxibpspks //ibpBoxibpspks
for (let i = 0; i < storage.ibpBoxs.length; i++) { if (hasSPKS) {
if (station.common.id == storage.ibpBoxs[i].refStationId) {
hasEMP_MKX_SPKS.hasSPKS = true; hasEMP_MKX_SPKS.hasSPKS = true;
handleDeviceCombinations.push(deviceCombinations[1]); handleDeviceCombinations.push(deviceCombinations[1]);
break;
}
} }
creatDeviceRelateRelays( creatDeviceRelateRelays(
handleDeviceCombinations, handleDeviceCombinations,