修改继电器布局

This commit is contained in:
joylink_zhaoerwei 2024-06-25 11:21:30 +08:00
parent 8e62b39f34
commit 94060bd5e8
2 changed files with 37 additions and 20 deletions

View File

@ -159,11 +159,15 @@ export function generateRelayLayout(relays: GenerateRelaysCongig[]) {
relays[i].deviceCode == relays[i - 1].deviceCode &&
relays[i].combinationCode == relays[i - 1].combinationCode &&
relays[i].code != 'GJ' &&
relays[i].combinationCode != 'GJ'
relays[i].combinationCode != 'GJ' &&
relays[i].code != 'IKCJ' &&
relays[i].combinationCode != 'IKC'
) {
relayGroupElement.push(relays[i]);
} else if (relays[i].code == 'GJ' && relays[i].combinationCode == 'GJ') {
relayGroupElement.push(relays[i]);
} else if (relays[i].code == 'IKCJ' && relays[i].combinationCode == 'IKC') {
relayGroupElement.push(relays[i]);
} else {
relayGroup.push(relayGroupElement);
relayGroupElement = [];
@ -175,7 +179,9 @@ export function generateRelayLayout(relays: GenerateRelaysCongig[]) {
(item) =>
item.deviceCode !== undefined &&
item.code !== 'GJ' &&
item.combinationCode !== 'GJ'
item.combinationCode !== 'GJ' &&
item.code !== 'IKCJ' &&
item.combinationCode !== 'IKC'
);
const LSCombination = relayGroupElement.filter(
(item) => item.deviceCode == undefined
@ -183,15 +189,21 @@ export function generateRelayLayout(relays: GenerateRelaysCongig[]) {
const allSectionCombination = relayGroupElement.filter(
(item) => item.code == 'GJ' && item.combinationCode == 'GJ'
);
const allPlatfoemCombination = relayGroupElement.filter(
(item) => item.code == 'IKCJ' && item.combinationCode == 'IKC'
);
relayGroup.push(lastCombination);
if (allSectionCombination.length) {
relayGroup.push(lastCombination);
for (let i = 0; i < allSectionCombination.length; i += 11) {
relayGroup.push(allSectionCombination.slice(i, i + 11));
}
relayGroup.push(LSCombination);
} else {
relayGroup.push(lastCombination, LSCombination);
}
if (allPlatfoemCombination.length) {
for (let i = 0; i < allPlatfoemCombination.length; i += 11) {
relayGroup.push(allPlatfoemCombination.slice(i, i + 11));
}
}
relayGroup.push(LSCombination);
const relayCabinet = generateRelayCabinet(relayGroup.length / 10);
for (let i = 0; i < relayCabinet.length; i++) {

View File

@ -287,6 +287,7 @@ import {
import { ciCjMap, CjData, PostionType } from './GeneraterCiCjConfig';
import { ciQdMap, QdData } from './GeneraterCiQdConfig';
import { ibpGraphicData } from 'src/protos/ibpGraphics';
import { platform } from 'os';
const $q = useQuasar();
const route = useRoute();
@ -670,6 +671,7 @@ function oneClickGeneraterRelayLayout() {
hasMKX: false,
hasSPKS: false,
};
const allNeedGenaratePlatform: graphicData.Platform[] = [];
storage.stations.forEach((station) => {
const deviceCombinations = combinationsMap.get(`${DeviceType.station}`);
if (manageStations.includes(station.common.id) && deviceCombinations) {
@ -683,20 +685,7 @@ function oneClickGeneraterRelayLayout() {
stationManagePlatformsRefEsb = Array.from(
new Set(stationManagePlatformsRefEsb)
);
//--
const deviceCombinationsOfPlatform = combinationsMap.get(
`${DeviceType.Platform}`
);
if (
generaterRelayLayout.value.generateIKCJRelay &&
deviceCombinationsOfPlatform
) {
creatDeviceRelateRelays(
deviceCombinationsOfPlatform,
DeviceType.Platform,
platform.code
);
}
allNeedGenaratePlatform.push(platform);
}
});
const stationManageScreenDoor: number[] = [];
@ -864,6 +853,7 @@ function oneClickGeneraterRelayLayout() {
);
}
});
//
if (generaterRelayLayout.value.generateSectionRelay) {
storage.section.forEach((section) => {
@ -881,6 +871,21 @@ function oneClickGeneraterRelayLayout() {
);
}
});
}
//--
if (generaterRelayLayout.value.generateIKCJRelay) {
const deviceCombinationsOfPlatform = combinationsMap.get(
`${DeviceType.Platform}`
);
if (deviceCombinationsOfPlatform) {
allNeedGenaratePlatform.forEach((platform) => {
creatDeviceRelateRelays(
deviceCombinationsOfPlatform,
DeviceType.Platform,
platform.code
);
});
}
}
//---LS
const aboveCombinations = [