修改继电器布局

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

View File

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