增加指定的道岔组不生成计轴
This commit is contained in:
parent
b7ebddaaad
commit
7a8b5c2eb4
@ -92,6 +92,12 @@ const axleCountingConfig = ref<{
|
||||
refTurnoutCode: [],
|
||||
expanded: false,
|
||||
},
|
||||
{
|
||||
code: '不生成计轴的道岔组',
|
||||
refTurnout: [],
|
||||
refTurnoutCode: [],
|
||||
expanded: false,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@ -126,6 +132,12 @@ onMounted(() => {
|
||||
const g = drawStore.getDrawApp().queryStore.queryById(id);
|
||||
generate.refTurnoutCode.push(g.code);
|
||||
});
|
||||
} else if (generate.code == '不生成计轴的道岔组') {
|
||||
generate.refTurnout = generateAxleCountingConfig.noGenerateGroup;
|
||||
generateAxleCountingConfig.noGenerateGroup.forEach((id) => {
|
||||
const g = drawStore.getDrawApp().queryStore.queryById(id);
|
||||
generate.refTurnoutCode.push(g.code);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -141,6 +153,8 @@ async function onSubmit() {
|
||||
axleCountingConfig.value.generate.forEach((generate) => {
|
||||
if (generate.code == 'bb连接的道岔') {
|
||||
generateAxleCountingConfig.bbConnect = generate.refTurnout;
|
||||
} else if (generate.code == '不生成计轴的道岔组') {
|
||||
generateAxleCountingConfig.noGenerateGroup = generate.refTurnout;
|
||||
}
|
||||
});
|
||||
setGenerateAxleCountingConfig(generateAxleCountingConfig);
|
||||
|
@ -80,6 +80,25 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
refGraphic: Section | Turnout,
|
||||
refPort: TurnoutPort | SectionPort
|
||||
) {
|
||||
const generateAxleCountingConfig = loadGenerateAxleCountingConfig();
|
||||
let hasNoGenerateGroup = false;
|
||||
if (generateAxleCountingConfig?.noGenerateGroup !== undefined) {
|
||||
const noGenerateGroup = generateAxleCountingConfig.noGenerateGroup;
|
||||
for (let i = 0; i < noGenerateGroup.length; i++) {
|
||||
if (
|
||||
noGenerateGroup[i] == graphic.id &&
|
||||
((i % 2 == 0 && refGraphic.id == noGenerateGroup[i + 1]) ||
|
||||
(i % 2 == 1 && refGraphic.id == noGenerateGroup[i - 1]))
|
||||
) {
|
||||
hasNoGenerateGroup = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasNoGenerateGroup) {
|
||||
map.set(`${graphic.id}-${port}`, 1);
|
||||
map.set(`${refGraphic.id}-${refPort}`, 1);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
graphic.type == 'Turnout' &&
|
||||
reftype == 'Turnout' &&
|
||||
@ -88,7 +107,6 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
) {
|
||||
//查看生成计轴bb配置
|
||||
let hasBB = false;
|
||||
const generateAxleCountingConfig = loadGenerateAxleCountingConfig();
|
||||
if (generateAxleCountingConfig !== undefined) {
|
||||
const bbConnect = generateAxleCountingConfig.bbConnect;
|
||||
if (
|
||||
|
@ -2436,13 +2436,17 @@ export namespace graphicData {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
bbConnect?: string[];
|
||||
noGenerateGroup?: string[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bbConnect" in data && data.bbConnect != undefined) {
|
||||
this.bbConnect = data.bbConnect;
|
||||
}
|
||||
if ("noGenerateGroup" in data && data.noGenerateGroup != undefined) {
|
||||
this.noGenerateGroup = data.noGenerateGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bbConnect() {
|
||||
@ -2451,22 +2455,36 @@ export namespace graphicData {
|
||||
set bbConnect(value: string[]) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get noGenerateGroup() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, []) as string[];
|
||||
}
|
||||
set noGenerateGroup(value: string[]) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
bbConnect?: string[];
|
||||
noGenerateGroup?: string[];
|
||||
}): GenerateAxleCountingConfig {
|
||||
const message = new GenerateAxleCountingConfig({});
|
||||
if (data.bbConnect != null) {
|
||||
message.bbConnect = data.bbConnect;
|
||||
}
|
||||
if (data.noGenerateGroup != null) {
|
||||
message.noGenerateGroup = data.noGenerateGroup;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
bbConnect?: string[];
|
||||
noGenerateGroup?: string[];
|
||||
} = {};
|
||||
if (this.bbConnect != null) {
|
||||
data.bbConnect = this.bbConnect;
|
||||
}
|
||||
if (this.noGenerateGroup != null) {
|
||||
data.noGenerateGroup = this.noGenerateGroup;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -2475,6 +2493,8 @@ export namespace graphicData {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bbConnect.length)
|
||||
writer.writeRepeatedString(1, this.bbConnect);
|
||||
if (this.noGenerateGroup.length)
|
||||
writer.writeRepeatedString(2, this.noGenerateGroup);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -2487,6 +2507,9 @@ export namespace graphicData {
|
||||
case 1:
|
||||
pb_1.Message.addToRepeatedField(message, 1, reader.readString());
|
||||
break;
|
||||
case 2:
|
||||
pb_1.Message.addToRepeatedField(message, 2, reader.readString());
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user