车辆段关联集中站特殊处理
This commit is contained in:
parent
f9fc9f058e
commit
39235cbc6d
@ -108,7 +108,7 @@ onMounted(() => {
|
||||
.queryStore.queryByType<Station>(Station.Type);
|
||||
centralizedStations.value = [];
|
||||
stations.forEach((station) => {
|
||||
if (station.datas.concentrationStations) {
|
||||
if (station.datas.concentrationStations || station.datas.depots) {
|
||||
centralizedStations.value.push({
|
||||
label: station.datas.stationName,
|
||||
value: station.datas.id,
|
||||
|
@ -648,67 +648,6 @@ function oneClickRelateCentralizedStation() {
|
||||
const concentrationDividingLines = drawApp.queryStore
|
||||
.queryByType<ConcentrationDividingLine>(ConcentrationDividingLine.Type)
|
||||
.sort((a, b) => a.datas.points[0].x - b.datas.points[0].x);
|
||||
//需要考虑是否绘制左边界
|
||||
const leftBoundary = concentrationDividingLines[0];
|
||||
if (leftBoundary.datas.refLeftStationId) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const leftSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
leftBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.leftSection.id !== '') {
|
||||
leftSections.push({
|
||||
section: drawApp.queryStore.queryById(node.leftSection.id),
|
||||
port: node.leftSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...leftSections.map((g) => g.section.id)];
|
||||
leftSections.forEach((leftSection) => {
|
||||
findContainDevice(
|
||||
leftSection.section,
|
||||
leftSection.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
handleContainDevices(containDeviceIds, [
|
||||
leftBoundary.datas.refLeftStationId,
|
||||
]);
|
||||
}
|
||||
//需要考虑是否绘制右边界
|
||||
const rightBoundary =
|
||||
concentrationDividingLines[concentrationDividingLines.length - 1];
|
||||
if (rightBoundary.datas.refRightStationId) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const rightSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
rightBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.rightSection.id !== '') {
|
||||
rightSections.push({
|
||||
section: drawApp.queryStore.queryById(node.rightSection.id),
|
||||
port: node.rightSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...rightSections.map((g) => g.section.id)];
|
||||
rightSections.forEach((rightSections) => {
|
||||
findContainDevice(
|
||||
rightSections.section,
|
||||
rightSections.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
handleContainDevices(containDeviceIds, [
|
||||
rightBoundary.datas.refRightStationId,
|
||||
]);
|
||||
}
|
||||
for (let i = 0; i < concentrationDividingLines.length - 1; i++) {
|
||||
let containDeviceIds: string[] = [];
|
||||
//右边
|
||||
@ -755,6 +694,27 @@ function oneClickRelateCentralizedStation() {
|
||||
handleContainDevices(containDeviceIds, [rightDatas.refRightStationId]);
|
||||
}
|
||||
}
|
||||
//需要考虑是否绘制左右边界和车辆段这种
|
||||
const leftBoundary = concentrationDividingLines[0];
|
||||
handleLeftBoundary(leftBoundary);
|
||||
const rightBoundary =
|
||||
concentrationDividingLines[concentrationDividingLines.length - 1];
|
||||
handleRightBoundary(rightBoundary);
|
||||
concentrationDividingLines.forEach((concentrationDividingLine) => {
|
||||
const datas = concentrationDividingLine.datas;
|
||||
if (
|
||||
datas.refLeftStationId &&
|
||||
drawApp.queryStore.queryById<Station>(datas.refLeftStationId).datas.depots
|
||||
) {
|
||||
handleLeftBoundary(concentrationDividingLine);
|
||||
} else if (
|
||||
datas.refRightStationId &&
|
||||
drawApp.queryStore.queryById<Station>(datas.refRightStationId).datas
|
||||
.depots
|
||||
) {
|
||||
handleRightBoundary(concentrationDividingLine);
|
||||
}
|
||||
});
|
||||
//区段边界的计轴和信号机单独处理
|
||||
const axleCountings = drawApp.queryStore
|
||||
.queryByType<AxleCounting>(AxleCounting.Type)
|
||||
@ -856,6 +816,66 @@ function oneClickRelateCentralizedStation() {
|
||||
centralizedStations
|
||||
);
|
||||
}
|
||||
function handleLeftBoundary(leftBoundary: ConcentrationDividingLine) {
|
||||
if (leftBoundary.datas.refLeftStationId) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const leftSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
leftBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.leftSection.id !== '') {
|
||||
leftSections.push({
|
||||
section: drawApp.queryStore.queryById(node.leftSection.id),
|
||||
port: node.leftSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...leftSections.map((g) => g.section.id)];
|
||||
leftSections.forEach((leftSection) => {
|
||||
findContainDevice(
|
||||
leftSection.section,
|
||||
leftSection.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
handleContainDevices(containDeviceIds, [
|
||||
leftBoundary.datas.refLeftStationId,
|
||||
]);
|
||||
}
|
||||
}
|
||||
function handleRightBoundary(rightBoundary: ConcentrationDividingLine) {
|
||||
if (rightBoundary.datas.refRightStationId) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const rightSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
rightBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.rightSection.id !== '') {
|
||||
rightSections.push({
|
||||
section: drawApp.queryStore.queryById(node.rightSection.id),
|
||||
port: node.rightSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...rightSections.map((g) => g.section.id)];
|
||||
rightSections.forEach((rightSections) => {
|
||||
findContainDevice(
|
||||
rightSections.section,
|
||||
rightSections.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
handleContainDevices(containDeviceIds, [
|
||||
rightBoundary.datas.refRightStationId,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function oneClickGeneratePlatformType() {
|
||||
|
Loading…
Reference in New Issue
Block a user