清空其它线设备的集中站
This commit is contained in:
parent
0fd5aa1382
commit
0f4da5f62b
@ -26,6 +26,14 @@
|
||||
@update:model-value="onUpdate"
|
||||
label="右边关联的集中站"
|
||||
/>
|
||||
<q-toggle
|
||||
v-model="
|
||||
concentrationDividingLineModel.isOtherLineConcentrationDividingLine
|
||||
"
|
||||
label="是否与其它线的边界处"
|
||||
emit-value
|
||||
@update:model-value="onUpdate"
|
||||
/>
|
||||
<q-list bordered separator class="rounded-borders">
|
||||
<q-item
|
||||
v-for="sectionRelation in sectionRelations"
|
||||
@ -74,6 +82,7 @@ const sectionRelations = computed(() => {
|
||||
enum devicePort {
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
}
|
||||
const concentrationDividingLine =
|
||||
drawStore.selectedGraphic as ConcentrationDividingLine;
|
||||
|
@ -59,6 +59,12 @@ export class ConcentrationDividingLineData
|
||||
set nodeConWithSecs(nodes: graphicData.NodeConWithSec[]) {
|
||||
this.data.nodeConWithSecs = nodes;
|
||||
}
|
||||
get isOtherLineConcentrationDividingLine(): boolean {
|
||||
return this.data.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
set isOtherLineConcentrationDividingLine(v: boolean) {
|
||||
this.data.isOtherLineConcentrationDividingLine = v;
|
||||
}
|
||||
clone(): ConcentrationDividingLineData {
|
||||
return new ConcentrationDividingLineData(this.data.cloneMessage());
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ export interface IConcentrationDividingLineData extends GraphicData {
|
||||
set refRightStationId(v: string);
|
||||
get nodeConWithSecs(): graphicData.NodeConWithSec[]; // 集中区分割线与区段的交点
|
||||
set nodeConWithSecs(nodes: graphicData.NodeConWithSec[]);
|
||||
get isOtherLineConcentrationDividingLine(): boolean; //集中区分割线绘制在其它线的边界处
|
||||
set isOtherLineConcentrationDividingLine(v: boolean);
|
||||
clone(): IConcentrationDividingLineData;
|
||||
copyFrom(data: IConcentrationDividingLineData): void;
|
||||
eq(other: IConcentrationDividingLineData): boolean;
|
||||
|
@ -198,9 +198,11 @@ import {
|
||||
setUniqueIdPrefix,
|
||||
creatStationRelateDevice,
|
||||
deleteStationRelateDeviceByType,
|
||||
loadOtherLineList,
|
||||
} from 'src/drawApp/commonApp';
|
||||
import { saveJkDrawDatas, loadLinkDatas } from 'src/drawApp/jkApp';
|
||||
import { RelateDevicelistItem, saveThDrawDatas } from 'src/drawApp/thApp';
|
||||
import { RelateDevicelistItem } from 'src/drawApp/commonApp';
|
||||
import { saveThDrawDatas } from 'src/drawApp/thApp';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
@ -268,7 +270,7 @@ import OtherLineList from 'src/components/draw-app/dialogs/OtherLineList.vue';
|
||||
import OtherLineConfig from 'src/components/draw-app/properties/OtherLineConfig.vue';
|
||||
import SectionDirectionConfig from 'src/components/draw-app/properties/SectionDirectionConfig.vue';
|
||||
import SignalDirectionConfig from 'src/components/draw-app/properties/SignalDirectionConfig.vue';
|
||||
import { distance2 } from 'src/jl-graphic';
|
||||
import { distance2, JlGraphic } from 'src/jl-graphic';
|
||||
import { Point } from 'pixi.js';
|
||||
|
||||
const $q = useQuasar();
|
||||
@ -647,6 +649,7 @@ function oneClickRelateCentralizedStation() {
|
||||
const drawApp = drawStore.getDrawApp();
|
||||
const concentrationDividingLines = drawApp.queryStore
|
||||
.queryByType<ConcentrationDividingLine>(ConcentrationDividingLine.Type)
|
||||
.filter((g) => !g.datas.isOtherLineConcentrationDividingLine)
|
||||
.sort((a, b) => a.datas.points[0].x - b.datas.points[0].x);
|
||||
const hasHandleStation: string[] = [];
|
||||
for (let i = 0; i < concentrationDividingLines.length - 1; i++) {
|
||||
@ -654,7 +657,7 @@ function oneClickRelateCentralizedStation() {
|
||||
//右边
|
||||
const rightDatas = concentrationDividingLines[i].datas;
|
||||
if (hasHandleStation.includes(rightDatas.refRightStationId)) {
|
||||
break;
|
||||
continue;
|
||||
} else {
|
||||
hasHandleStation.push(rightDatas.refRightStationId);
|
||||
}
|
||||
@ -761,6 +764,16 @@ function oneClickRelateCentralizedStation() {
|
||||
}
|
||||
);
|
||||
});
|
||||
//其它线路设备集中站置空
|
||||
const otherLineList = loadOtherLineList();
|
||||
const otherLineListDevice: JlGraphic[] = [];
|
||||
otherLineList.forEach((otherLine) => {
|
||||
otherLine.ids.forEach((id) => {
|
||||
const device = drawApp.queryStore.queryById(id);
|
||||
otherLineListDevice.push(device);
|
||||
});
|
||||
});
|
||||
handleCentralizedStationsData(otherLineListDevice, []);
|
||||
|
||||
function handleNodeConWithSec(
|
||||
relatedRef: graphicData.RelatedRef,
|
||||
@ -823,60 +836,64 @@ function oneClickRelateCentralizedStation() {
|
||||
);
|
||||
}
|
||||
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));
|
||||
});
|
||||
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));
|
||||
});
|
||||
if (leftBoundary.datas.refLeftStationId == '') {
|
||||
handleContainDevices(containDeviceIds, []);
|
||||
} else {
|
||||
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));
|
||||
});
|
||||
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));
|
||||
});
|
||||
if (rightBoundary.datas.refRightStationId == '') {
|
||||
handleContainDevices(containDeviceIds, []);
|
||||
} else {
|
||||
handleContainDevices(containDeviceIds, [
|
||||
rightBoundary.datas.refRightStationId,
|
||||
]);
|
||||
|
@ -1698,6 +1698,7 @@ export namespace graphicData {
|
||||
refLeftStationId?: string;
|
||||
refRightStationId?: string;
|
||||
nodeConWithSecs?: NodeConWithSec[];
|
||||
isOtherLineConcentrationDividingLine?: boolean;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 6], this.#one_of_decls);
|
||||
@ -1720,6 +1721,9 @@ export namespace graphicData {
|
||||
if ("nodeConWithSecs" in data && data.nodeConWithSecs != undefined) {
|
||||
this.nodeConWithSecs = data.nodeConWithSecs;
|
||||
}
|
||||
if ("isOtherLineConcentrationDividingLine" in data && data.isOtherLineConcentrationDividingLine != undefined) {
|
||||
this.isOtherLineConcentrationDividingLine = data.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
get common() {
|
||||
@ -1761,6 +1765,12 @@ export namespace graphicData {
|
||||
set nodeConWithSecs(value: NodeConWithSec[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 6, value);
|
||||
}
|
||||
get isOtherLineConcentrationDividingLine() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean;
|
||||
}
|
||||
set isOtherLineConcentrationDividingLine(value: boolean) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
@ -1768,6 +1778,7 @@ export namespace graphicData {
|
||||
refLeftStationId?: string;
|
||||
refRightStationId?: string;
|
||||
nodeConWithSecs?: ReturnType<typeof NodeConWithSec.prototype.toObject>[];
|
||||
isOtherLineConcentrationDividingLine?: boolean;
|
||||
}): ConcentrationDividingLine {
|
||||
const message = new ConcentrationDividingLine({});
|
||||
if (data.common != null) {
|
||||
@ -1788,6 +1799,9 @@ export namespace graphicData {
|
||||
if (data.nodeConWithSecs != null) {
|
||||
message.nodeConWithSecs = data.nodeConWithSecs.map(item => NodeConWithSec.fromObject(item));
|
||||
}
|
||||
if (data.isOtherLineConcentrationDividingLine != null) {
|
||||
message.isOtherLineConcentrationDividingLine = data.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -1798,6 +1812,7 @@ export namespace graphicData {
|
||||
refLeftStationId?: string;
|
||||
refRightStationId?: string;
|
||||
nodeConWithSecs?: ReturnType<typeof NodeConWithSec.prototype.toObject>[];
|
||||
isOtherLineConcentrationDividingLine?: boolean;
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
@ -1817,6 +1832,9 @@ export namespace graphicData {
|
||||
if (this.nodeConWithSecs != null) {
|
||||
data.nodeConWithSecs = this.nodeConWithSecs.map((item: NodeConWithSec) => item.toObject());
|
||||
}
|
||||
if (this.isOtherLineConcentrationDividingLine != null) {
|
||||
data.isOtherLineConcentrationDividingLine = this.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -1835,6 +1853,8 @@ export namespace graphicData {
|
||||
writer.writeString(5, this.refRightStationId);
|
||||
if (this.nodeConWithSecs.length)
|
||||
writer.writeRepeatedMessage(6, this.nodeConWithSecs, (item: NodeConWithSec) => item.serialize(writer));
|
||||
if (this.isOtherLineConcentrationDividingLine != false)
|
||||
writer.writeBool(7, this.isOtherLineConcentrationDividingLine);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -1862,6 +1882,9 @@ export namespace graphicData {
|
||||
case 6:
|
||||
reader.readMessage(message.nodeConWithSecs, () => pb_1.Message.addToRepeatedWrapperField(message, 6, NodeConWithSec.deserialize(reader), NodeConWithSec));
|
||||
break;
|
||||
case 7:
|
||||
message.isOtherLineConcentrationDividingLine = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user