diff --git a/src/components/draw-app/dialogs/DeviceRelateRelayList.vue b/src/components/draw-app/dialogs/DeviceRelateRelayList.vue index b49c731..3e8d79b 100644 --- a/src/components/draw-app/dialogs/DeviceRelateRelayList.vue +++ b/src/components/draw-app/dialogs/DeviceRelateRelayList.vue @@ -59,6 +59,7 @@ const relayCabinetStore = useRelayCabinetStore(); const $q = useQuasar(); const tableRef = ref(); const deviceTypeMap = { + 0: '区段', 1: '道岔', 5: '信号机', 6: '车站', diff --git a/src/components/draw-app/properties/RelateRelayConfig.vue b/src/components/draw-app/properties/RelateRelayConfig.vue index fc53996..e4fc775 100644 --- a/src/components/draw-app/properties/RelateRelayConfig.vue +++ b/src/components/draw-app/properties/RelateRelayConfig.vue @@ -89,6 +89,7 @@ const optionsType = [ { label: '车库门', value: graphicData.RelatedRef.DeviceType.GarageDoor }, { label: '洗车机', value: graphicData.RelatedRef.DeviceType.CarWashing }, { label: '防淹门', value: graphicData.RelatedRef.DeviceType.FloodGate }, + { label: '区段', value: graphicData.RelatedRef.DeviceType.Section }, ]; const noShowType = [ diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts index 63b21aa..cf6d47c 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts @@ -793,6 +793,27 @@ const carWashingCjList = [ }, ]; +//区段继电器 +const sectionCjList = [ + { + code: 'GJ', + refDeviceCodesAndPos: [ + [ + { + code: 'GJ', + position: PostionType.Q, + }, + ], + [ + { + code: 'GJ', + position: PostionType.H, + }, + ], + ], + }, +]; + const DeviceType = graphicData.RelatedRef.DeviceType; export const ciCjMap = new Map([ [ @@ -838,4 +859,5 @@ export const ciCjMap = new Map([ [`${DeviceType.GarageDoor}+undefined`, garageDoorCjList], [`${DeviceType.CarWashing}+undefined`, carWashingCjList], [`${DeviceType.FloodGate}+undefined`, floodGateCjList], + [`${DeviceType.Section}+undefined`, sectionCjList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts index 4fa8855..92252e0 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts @@ -138,6 +138,14 @@ watch(changeScreenDoorGroup, (group) => { }); }); +//区段继电器 +const sectionQdList = [ + { + code: 'GJ', + refDeviceCodes: [['GJ']], + }, +]; + const DeviceType = graphicData.RelatedRef.DeviceType; export const ciQdMap = new Map([ [ @@ -179,4 +187,5 @@ export const ciQdMap = new Map([ [`${DeviceType.GarageDoor}+undefined`, garageDoorQdList], [`${DeviceType.CarWashing}+undefined`, carWashingQdList], [`${DeviceType.FloodGate}+undefined`, floodGateQdList], + [`${DeviceType.Section}+undefined`, sectionQdList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterDevice.ts b/src/layouts/RelayCabinetLayout/GeneraterDevice.ts index 625362b..60497a7 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterDevice.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterDevice.ts @@ -150,22 +150,42 @@ export function generateRelayLayout(relays: GenerateRelaysCongig[]) { relayGroupElement.push(relays[i]); } else if ( 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].combinationCode != 'GJ' ) { relayGroupElement.push(relays[i]); + } else if (relays[i].code == 'GJ' && relays[i].combinationCode == 'GJ') { + relayGroupElement.push(relays[i]); } else { relayGroup.push(relayGroupElement); relayGroupElement = []; relayGroupElement.push(relays[i]); } } + const lastCombination = relayGroupElement.filter( - (item) => item.deviceCode !== undefined + (item) => + item.deviceCode !== undefined && + item.code !== 'GJ' && + item.combinationCode !== 'GJ' ); const LSCombination = relayGroupElement.filter( (item) => item.deviceCode == undefined ); - relayGroup.push(lastCombination, LSCombination); + const allSectionCombination = relayGroupElement.filter( + (item) => item.code == 'GJ' && item.combinationCode == 'GJ' + ); + 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); + } + const relayCabinet = generateRelayCabinet(relayGroup.length / 10); for (let i = 0; i < relayCabinet.length; i++) { generateRelaysFormat( diff --git a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts index 97cc5f8..a51cad3 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts @@ -513,6 +513,19 @@ const carWashingCombinations = [ }, ]; +//区段继电器 +const sectionCombinations = [ + { + code: 'GJ', + refDeviceCodesAndModel: [ + { + code: 'GJ', + model: RelayModelType.JWXC_1700, + }, + ], + }, +]; + const DeviceType = graphicData.RelatedRef.DeviceType; export const combinationsMap = new Map([ [ @@ -558,4 +571,5 @@ export const combinationsMap = new Map([ [`${DeviceType.GarageDoor}`, garageDoorCombinations], [`${DeviceType.CarWashing}`, carWashingCombinations], [`${DeviceType.FloodGate}`, floodGateCombinations], + [`${DeviceType.Section}`, sectionCombinations], ]); diff --git a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue index 5032f4a..2511a03 100644 --- a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue +++ b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue @@ -201,6 +201,10 @@ v-model="generaterRelayLayout.generateCJQD" label="是否覆盖采集驱动数据" /> +
({ publishId: '', centralizedStation: 0, generateCJQD: true }); + generateSectionRelay: boolean; +}>({ + publishId: '', + centralizedStation: 0, + generateCJQD: true, + generateSectionRelay: false, +}); let publishIdOption = ref<{ label: string; value: number }[]>(); let centralizedStationsOption = ref<{ label: string; value: number }[]>([ @@ -809,6 +819,26 @@ function oneClickGeneraterRelayLayout() { ); } }); + //区段继电器 + if (generaterRelayLayout.value.generateSectionRelay) { + storage.section.forEach((section) => { + if (section.sectionType == graphicData.Section.SectionType.Physical) { + const deviceCombinations = combinationsMap.get( + `${DeviceType.Section}` + ); + if ( + section.centralizedStations.includes(concentrationStation) && + deviceCombinations + ) { + creatDeviceRelateRelays( + deviceCombinations, + DeviceType.Section, + section.code + ); + } + } + }); + } //信号机故障报警仪-电源屏-断路器 const aboveCombinations = [ {