区段边界处信号机关联集中站不特殊处理
This commit is contained in:
parent
693e1de289
commit
d41843a10a
@ -162,7 +162,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import DrawProperties from 'src/components/draw-app/DrawProperties.vue';
|
import DrawProperties from 'src/components/draw-app/DrawProperties.vue';
|
||||||
import { getDrawApp, saveDrawDatas, saveDrawToServer } from 'src/drawApp';
|
import { getDrawApp, saveDrawDatas, saveDrawToServer } from 'src/drawApp';
|
||||||
import { distance2, IDrawApp } from 'jl-graphic';
|
import { IDrawApp } from 'jl-graphic';
|
||||||
import { useDrawStore } from 'src/stores/draw-store';
|
import { useDrawStore } from 'src/stores/draw-store';
|
||||||
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
|
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
@ -435,52 +435,6 @@ function oneClickRelateCentralizedStation() {
|
|||||||
const rightBoundary =
|
const rightBoundary =
|
||||||
concentrationDividingLines[concentrationDividingLines.length - 1];
|
concentrationDividingLines[concentrationDividingLines.length - 1];
|
||||||
handleRightBoundary(rightBoundary);
|
handleRightBoundary(rightBoundary);
|
||||||
//区段边界的信号机单独处理
|
|
||||||
const signals = drawApp.queryStore.queryByType<Signal>(Signal.Type);
|
|
||||||
concentrationDividingLines.forEach((concentrationDividingLine) => {
|
|
||||||
concentrationDividingLine.datas.nodeConWithSecs.forEach(
|
|
||||||
(nodeConWithSec) => {
|
|
||||||
const ids = [
|
|
||||||
nodeConWithSec.leftSection.id,
|
|
||||||
nodeConWithSec.rightSection.id,
|
|
||||||
];
|
|
||||||
if (ids[0] && ids[1]) {
|
|
||||||
if (
|
|
||||||
nodeConWithSec.leftSection.deviceType ==
|
|
||||||
graphicData.RelatedRef.DeviceType.Section
|
|
||||||
) {
|
|
||||||
handleNodeConWithSec(nodeConWithSec.leftSection, ids);
|
|
||||||
} else {
|
|
||||||
handleNodeConWithSec(nodeConWithSec.rightSection, ids);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleNodeConWithSec(
|
|
||||||
relatedRef: graphicData.RelatedRef,
|
|
||||||
ids: number[]
|
|
||||||
) {
|
|
||||||
const section = drawApp.queryStore.queryById<Section>(relatedRef.id);
|
|
||||||
const portPos =
|
|
||||||
relatedRef.devicePort == graphicData.RelatedRef.DevicePort.A
|
|
||||||
? section.localToCanvasPoint(section.getStartPoint())
|
|
||||||
: section.localToCanvasPoint(section.getEndPoint());
|
|
||||||
signals.forEach((signal) => {
|
|
||||||
if (
|
|
||||||
distance2(portPos, signal.position) < 100 &&
|
|
||||||
ids.includes(signal.datas.refDevice?.id as number)
|
|
||||||
) {
|
|
||||||
signal.datas.centralizedStation =
|
|
||||||
ids[0] == signal.datas.refDevice?.id
|
|
||||||
? drawApp.queryStore.queryById<Section>(ids[1]).datas
|
|
||||||
.centralizedStation
|
|
||||||
: drawApp.queryStore.queryById<Section>(ids[0]).datas
|
|
||||||
.centralizedStation;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleContainDevices(
|
function handleContainDevices(
|
||||||
containDeviceIds: number[],
|
containDeviceIds: number[],
|
||||||
|
Loading…
Reference in New Issue
Block a user