diff --git a/src/components/draw-app/properties/SeparatorProperty.vue b/src/components/draw-app/properties/SeparatorProperty.vue
index 81003d2..f5434d9 100644
--- a/src/components/draw-app/properties/SeparatorProperty.vue
+++ b/src/components/draw-app/properties/SeparatorProperty.vue
@@ -3,7 +3,6 @@
@@ -20,23 +19,18 @@
import { SeparatorData } from 'src/drawApp/graphics/SeparatorInteraction';
import { Separator } from 'src/graphics/separator/Separator';
import { useDrawStore } from 'src/stores/draw-store';
-import { computed, onMounted, reactive, watch } from 'vue';
+import { onMounted, reactive, watch } from 'vue';
const drawStore = useDrawStore();
const separatorModel = reactive(new SeparatorData());
const typeOptions = [
- { label: '左方向', value: 'endA' },
- { label: '右方向', value: 'endB' },
+ { label: '区段分隔符', value: 'section' },
+ { label: '道岔分隔符', value: 'turnout' },
+ { label: '左断路分隔符', value: 'endA' },
+ { label: '右断路分隔符', value: 'endB' },
];
-const showType = computed(() => {
- const find = typeOptions.find((item) => {
- return item.value == separatorModel.separatorType;
- });
- return !!find;
-});
-
drawStore.$subscribe;
watch(
() => drawStore.selectedGraphic,
diff --git a/src/components/draw-app/properties/TurnoutProperty.vue b/src/components/draw-app/properties/TurnoutProperty.vue
index 75f0d41..10d703f 100644
--- a/src/components/draw-app/properties/TurnoutProperty.vue
+++ b/src/components/draw-app/properties/TurnoutProperty.vue
@@ -7,6 +7,24 @@
@blur="onUpdate"
label="编号"
/>
+
+
{
const turnout = drawStore.selectedGraphic as Turnout;
@@ -81,11 +104,20 @@ watchEffect(() => {
const turnout = drawStore.selectedGraphic;
if (turnout && turnout instanceof Turnout) {
turnoutModel.value = turnout.saveData();
+ if (turnoutModel.value.kilometerSystem) {
+ kilometerSystem.coordinateSystem =
+ turnoutModel.value.kilometerSystem.coordinateSystem;
+ kilometerSystem.kilometer = turnoutModel.value.kilometerSystem.kilometer;
+ }
}
});
const onUpdate = () => {
const turnout = drawStore.selectedGraphic as Turnout;
+ turnoutModel.value.kilometerSystem = {
+ coordinateSystem: kilometerSystem.coordinateSystem,
+ kilometer: kilometerSystem.kilometer,
+ };
if (turnout) {
drawStore.getDrawApp().updateGraphicAndRecord(turnout, turnoutModel.value);
}
diff --git a/src/drawApp/graphics/TurnoutInteraction.ts b/src/drawApp/graphics/TurnoutInteraction.ts
index 32a71e9..1fcc25c 100644
--- a/src/drawApp/graphics/TurnoutInteraction.ts
+++ b/src/drawApp/graphics/TurnoutInteraction.ts
@@ -3,6 +3,7 @@ import * as pb_1 from 'google-protobuf';
import { GraphicDataBase } from './GraphicDataBase';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { IPointData } from 'pixi.js';
+import { KilometerSystem } from 'src/graphics/signal/Signal';
function getDefaultEndPoint() {
return {
@@ -72,6 +73,12 @@ export class TurnoutData extends GraphicDataBase implements ITurnoutData {
set pcRef(ref: graphicData.RelatedRef) {
this.data.pcRef = ref;
}
+ get kilometerSystem(): KilometerSystem {
+ return this.data.kilometerSystem;
+ }
+ set kilometerSystem(v: KilometerSystem) {
+ this.data.kilometerSystem = new graphicData.KilometerSystem(v);
+ }
clone(): TurnoutData {
return new TurnoutData(this.data.cloneMessage());
}
diff --git a/src/graphics/axleCounting/AxleCountingDrawAssistant.ts b/src/graphics/axleCounting/AxleCountingDrawAssistant.ts
index 9071f8e..651c34d 100644
--- a/src/graphics/axleCounting/AxleCountingDrawAssistant.ts
+++ b/src/graphics/axleCounting/AxleCountingDrawAssistant.ts
@@ -170,16 +170,13 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
sections.forEach((section) => {
const sectionRelations =
- section.relationManage.getRelationsOfGraphicAndOtherType(
- section,
- Section.Type
- );
+ section.relationManage.getRelationsOfGraphic(section);
const ps = section.localToCanvasPoint(section.getStartPoint());
const pe = section.localToCanvasPoint(section.getEndPoint());
sectionRelations.forEach((relation) => {
const port = relation.getRelationParam(section).param;
- const refSection = relation.getOtherGraphic(section);
- const refSectionPort = relation.getOtherRelationParam(section).param;
+ const refDevice = relation.getOtherGraphic(section);
+ const refDevicePort = relation.getOtherRelationParam(section).param;
let direction = 1;
let axleCountingPs = ps;
if (port == 'B') {
@@ -188,19 +185,20 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
if (axleCountingPs.y > height.y) {
direction = -1;
}
- this.draw(
- axleCountingPs,
- direction,
- section,
- port,
- map,
- Section.Type,
- refSection,
- refSectionPort
- );
+ if (refDevice.type == Section.Type || refDevice.type == Turnout.Type)
+ this.draw(
+ axleCountingPs,
+ direction,
+ section,
+ port,
+ map,
+ refDevice.type,
+ refDevice,
+ refDevicePort
+ );
});
});
- //由区段生成计轴--区段和道岔或单独区段
+ //由区段生成计轴--单独区段
sections.forEach((section) => {
const axleCountingRelations =
section.relationManage.getRelationsOfGraphicAndOtherType(
@@ -225,29 +223,7 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
if (axleCountingPs.y > height.y) {
direction = -1;
}
- const addPortRelation = section.relationManage
- .getRelationsOfGraphic(section)
- .find(
- (relation) => relation.getRelationParam(section).param === addPort
- );
- if (addPortRelation == undefined) {
- this.drawAdd(axleCountingPs, direction, section, addPort, map);
- } else {
- const refTurnout =
- addPortRelation.getOtherGraphic(section);
- const refTurnoutPort =
- addPortRelation.getOtherRelationParam(section).param;
- this.draw(
- axleCountingPs,
- direction,
- section,
- addPort,
- map,
- Section.Type,
- refTurnout,
- refTurnoutPort
- );
- }
+ this.drawAdd(axleCountingPs, direction, section, addPort, map);
});
}
});
diff --git a/src/graphics/separator/SeparatorDrawAssistant.ts b/src/graphics/separator/SeparatorDrawAssistant.ts
index 799b1c7..0427d96 100644
--- a/src/graphics/separator/SeparatorDrawAssistant.ts
+++ b/src/graphics/separator/SeparatorDrawAssistant.ts
@@ -101,21 +101,22 @@ export class SeparatorDraw extends GraphicDrawAssistant<
const r = relation.getRelationParam(turnout);
port.push(r.param);
const other = relation.getOtherRelationParam(turnout);
+ let t = separatorTypeEnum.section;
+ if (
+ (r.param == 'C' && other.param == 'C') ||
+ (r.g.type == Turnout.Type &&
+ other.g.type == Turnout.Type &&
+ (r.param == 'C' || other.param == 'C'))
+ ) {
+ t = separatorTypeEnum.turnout;
+ }
if (!rMap.has(setKey(r))) {
- let t = separatorTypeEnum.section;
- if (r.param == 'C' && other.param == 'C') {
- t = separatorTypeEnum.turnout;
- }
rMap.set(setKey(r), {
...r,
separatorType: t,
});
}
if (!rMap.has(setKey(other))) {
- let t = separatorTypeEnum.section;
- if (r.param == 'C' && other.param == 'C') {
- t = separatorTypeEnum.turnout;
- }
rMap.set(setKey(other), {
...other,
separatorType: t,
@@ -161,7 +162,8 @@ export class SeparatorDraw extends GraphicDrawAssistant<
} else if (item.param == 'B') {
l = 1;
}
- p = ps[l][0];
+ const lps = ps[l];
+ p = lps[lps.length - 1];
}
const tps = item.g.localToCanvasPoint(p);
separator.position.set(tps.x, tps.y);
diff --git a/src/graphics/trainWindow/oneClickDrawAssistant.ts b/src/graphics/trainWindow/oneClickDrawAssistant.ts
index de16338..c0c52b9 100644
--- a/src/graphics/trainWindow/oneClickDrawAssistant.ts
+++ b/src/graphics/trainWindow/oneClickDrawAssistant.ts
@@ -10,6 +10,7 @@ import { TrainWindow } from './TrainWindow';
import { TrainWindowDraw } from './TrainWindowDrawAssistant';
import { AxleCounting } from '../axleCounting/AxleCounting';
import { AxleCountingDraw } from '../axleCounting/AxleCountingDrawAssistant';
+import { useDrawStore } from 'src/stores/draw-store';
interface IOneClickData extends GraphicData {
get code(): string; // 编号
@@ -56,14 +57,18 @@ export class OneClickGenerateDraw extends GraphicDrawAssistant<
this.lineGraph.doRepaint();
}
onLeftDown(e: FederatedPointerEvent): void {
- const trainWindowDraw = this.app.getDrawAssistant(
- TrainWindow.Type
- ) as TrainWindowDraw;
- trainWindowDraw.oneGenerates(this.toCanvasCoordinates(e.global));
- const axleCountingDraw = this.app.getDrawAssistant(
- AxleCounting.Type
- ) as AxleCountingDraw;
- axleCountingDraw.oneGenerates(this.toCanvasCoordinates(e.global));
+ const type = useDrawStore().$state.oneClickType;
+ if (type == 'TrainWindow') {
+ const trainWindowDraw = this.app.getDrawAssistant(
+ TrainWindow.Type
+ ) as TrainWindowDraw;
+ trainWindowDraw.oneGenerates(this.toCanvasCoordinates(e.global));
+ } else {
+ const axleCountingDraw = this.app.getDrawAssistant(
+ AxleCounting.Type
+ ) as AxleCountingDraw;
+ axleCountingDraw.oneGenerates(this.toCanvasCoordinates(e.global));
+ }
this.finish();
}
diff --git a/src/graphics/turnout/Turnout.ts b/src/graphics/turnout/Turnout.ts
index df906e7..e95a8ec 100644
--- a/src/graphics/turnout/Turnout.ts
+++ b/src/graphics/turnout/Turnout.ts
@@ -6,6 +6,7 @@ import {
JlGraphic,
JlGraphicTemplate,
VectorText,
+ angleOfIncludedAngle,
distance2,
} from 'src/jl-graphic';
import { Section, SectionPort } from '../section/Section';
@@ -15,6 +16,7 @@ import {
createRelatedRefProto,
protoPort2Data,
} from '../CommonGraphics';
+import { KilometerSystem } from '../signal/Signal';
export interface ITurnoutData extends GraphicData {
get code(): string;
@@ -31,6 +33,8 @@ export interface ITurnoutData extends GraphicData {
set pbRef(ref: IRelatedRefData);
get pcRef(): IRelatedRefData;
set pcRef(ref: IRelatedRefData);
+ get kilometerSystem(): KilometerSystem;
+ set kilometerSystem(v: KilometerSystem);
clone(): ITurnoutData;
copyFrom(data: ITurnoutData): void;
eq(other: ITurnoutData): boolean;
@@ -208,9 +212,11 @@ export class Turnout extends JlGraphic {
});
/** 道岔和道岔 */
- this.queryStore.queryByType(Turnout.Type).forEach((turnout) => {
- if (turnout.id === this.id) return;
- this.getPortPoints().forEach((thisPort, i) => {
+ this.getPortPoints().forEach((thisPort, i) => {
+ let params: GraphicRelationParam[] = [],
+ deflection = 180;
+ this.queryStore.queryByType(Turnout.Type).forEach((turnout) => {
+ if (turnout.id === this.id) return;
turnout.getPortPoints().forEach((otherPort, j) => {
if (
distance2(
@@ -218,19 +224,34 @@ export class Turnout extends JlGraphic {
turnout.localToCanvasPoint(otherPort[otherPort.length - 1])
) <= epsilon
) {
- this.relationManage.addRelation(
- new GraphicRelationParam(
- this,
- [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
- ),
- new GraphicRelationParam(
- turnout,
- [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][j]
- )
+ const angle = angleOfIncludedAngle(
+ this.localToCanvasPoint(thisPort[thisPort.length - 1]) /* 交点 */,
+ thisPort[thisPort.length - 2]
+ ? this.localToCanvasPoint(thisPort[thisPort.length - 2])
+ : this.position,
+ otherPort[otherPort.length - 2]
+ ? turnout.localToCanvasPoint(otherPort[otherPort.length - 2])
+ : turnout.position
);
+ if (180 - Math.abs(angle) <= deflection) {
+ deflection = 180 - Math.abs(angle);
+ params = [
+ new GraphicRelationParam(
+ this,
+ [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
+ ),
+ new GraphicRelationParam(
+ turnout,
+ [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][j]
+ ),
+ ];
+ }
}
});
});
+ if (params.length === 2) {
+ this.relationManage.addRelation(params[0], params[1]);
+ }
});
}
diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue
index c850163..e6b6726 100644
--- a/src/layouts/DrawLayout.vue
+++ b/src/layouts/DrawLayout.vue
@@ -16,7 +16,13 @@
一键关联
- 一键生成
+ 一键生成车次窗
+
+
+ 一键生成分隔符
+
+
+ 一键生成计轴
@@ -305,10 +311,21 @@ function buildRelations() {
}
function oneClickGeneration() {
+ // 一键生成车次窗
+ drawStore.oneClickType = 'TrainWindow';
+ drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume();
+}
+
+function oneClickSeparator() {
+ //一键生成分隔符
const separatorDraw = drawStore
.getDrawApp()
.getDrawAssistant(Separator.Type) as SeparatorDraw;
separatorDraw.oneGenerates();
+}
+function oneClickAxleCounting() {
+ //一键生成计轴
+ drawStore.oneClickType = 'AxleCounting';
drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume();
}
diff --git a/src/protos/device_info.ts b/src/protos/device_info.ts
index 3562e8f..fd8491b 100644
--- a/src/protos/device_info.ts
+++ b/src/protos/device_info.ts
@@ -12,11 +12,12 @@ export namespace state {
id?: string;
code?: string;
type?: dependency_1.graphicData.Section.SectionType;
- kilometerCode?: number[];
+ kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
children?: Section[];
+ convertKilometer?: number[];
}) {
super();
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5], this.#one_of_decls);
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 6], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
@@ -27,12 +28,15 @@ export namespace state {
if ("type" in data && data.type != undefined) {
this.type = data.type;
}
- if ("kilometerCode" in data && data.kilometerCode != undefined) {
- this.kilometerCode = data.kilometerCode;
+ if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
+ this.kilometerSystem = data.kilometerSystem;
}
if ("children" in data && data.children != undefined) {
this.children = data.children;
}
+ if ("convertKilometer" in data && data.convertKilometer != undefined) {
+ this.convertKilometer = data.convertKilometer;
+ }
}
}
get id() {
@@ -53,11 +57,11 @@ export namespace state {
set type(value: dependency_1.graphicData.Section.SectionType) {
pb_1.Message.setField(this, 3, value);
}
- get kilometerCode() {
- return pb_1.Message.getFieldWithDefault(this, 4, []) as number[];
+ get kilometerSystem() {
+ return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 4) as dependency_1.graphicData.KilometerSystem[];
}
- set kilometerCode(value: number[]) {
- pb_1.Message.setField(this, 4, value);
+ set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
+ pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get children() {
return pb_1.Message.getRepeatedWrapperField(this, Section, 5) as Section[];
@@ -65,12 +69,19 @@ export namespace state {
set children(value: Section[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
+ get convertKilometer() {
+ return pb_1.Message.getFieldWithDefault(this, 6, []) as number[];
+ }
+ set convertKilometer(value: number[]) {
+ pb_1.Message.setField(this, 6, value);
+ }
static fromObject(data: {
id?: string;
code?: string;
type?: dependency_1.graphicData.Section.SectionType;
- kilometerCode?: number[];
+ kilometerSystem?: ReturnType[];
children?: ReturnType[];
+ convertKilometer?: number[];
}): Section {
const message = new Section({});
if (data.id != null) {
@@ -82,12 +93,15 @@ export namespace state {
if (data.type != null) {
message.type = data.type;
}
- if (data.kilometerCode != null) {
- message.kilometerCode = data.kilometerCode;
+ if (data.kilometerSystem != null) {
+ message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
}
if (data.children != null) {
message.children = data.children.map(item => Section.fromObject(item));
}
+ if (data.convertKilometer != null) {
+ message.convertKilometer = data.convertKilometer;
+ }
return message;
}
toObject() {
@@ -95,8 +109,9 @@ export namespace state {
id?: string;
code?: string;
type?: dependency_1.graphicData.Section.SectionType;
- kilometerCode?: number[];
+ kilometerSystem?: ReturnType[];
children?: ReturnType[];
+ convertKilometer?: number[];
} = {};
if (this.id != null) {
data.id = this.id;
@@ -107,12 +122,15 @@ export namespace state {
if (this.type != null) {
data.type = this.type;
}
- if (this.kilometerCode != null) {
- data.kilometerCode = this.kilometerCode;
+ if (this.kilometerSystem != null) {
+ data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
}
if (this.children != null) {
data.children = this.children.map((item: Section) => item.toObject());
}
+ if (this.convertKilometer != null) {
+ data.convertKilometer = this.convertKilometer;
+ }
return data;
}
serialize(): Uint8Array;
@@ -125,10 +143,12 @@ export namespace state {
writer.writeString(2, this.code);
if (this.type != dependency_1.graphicData.Section.SectionType.Physical)
writer.writeEnum(3, this.type);
- if (this.kilometerCode.length)
- writer.writePackedInt64(4, this.kilometerCode);
+ if (this.kilometerSystem.length)
+ writer.writeRepeatedMessage(4, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.children.length)
writer.writeRepeatedMessage(5, this.children, (item: Section) => item.serialize(writer));
+ if (this.convertKilometer.length)
+ writer.writePackedInt64(6, this.convertKilometer);
if (!w)
return writer.getResultBuffer();
}
@@ -148,11 +168,14 @@ export namespace state {
message.type = reader.readEnum();
break;
case 4:
- message.kilometerCode = reader.readPackedInt64();
+ reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem));
break;
case 5:
reader.readMessage(message.children, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Section.deserialize(reader), Section));
break;
+ case 6:
+ message.convertKilometer = reader.readPackedInt64();
+ break;
default: reader.skipField();
}
}
@@ -170,12 +193,11 @@ export namespace state {
constructor(data?: any[] | {
id?: string;
code?: string;
- paSection?: Section;
- pbSection?: Section;
- pcSection?: Section;
+ kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
+ convertKilometer?: number[];
}) {
super();
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
@@ -183,14 +205,11 @@ export namespace state {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
- if ("paSection" in data && data.paSection != undefined) {
- this.paSection = data.paSection;
+ if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
+ this.kilometerSystem = data.kilometerSystem;
}
- if ("pbSection" in data && data.pbSection != undefined) {
- this.pbSection = data.pbSection;
- }
- if ("pcSection" in data && data.pcSection != undefined) {
- this.pcSection = data.pcSection;
+ if ("convertKilometer" in data && data.convertKilometer != undefined) {
+ this.convertKilometer = data.convertKilometer;
}
}
}
@@ -206,39 +225,23 @@ export namespace state {
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
- get paSection() {
- return pb_1.Message.getWrapperField(this, Section, 3) as Section;
+ get kilometerSystem() {
+ return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 3) as dependency_1.graphicData.KilometerSystem[];
}
- set paSection(value: Section) {
- pb_1.Message.setWrapperField(this, 3, value);
+ set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
+ pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
- get has_paSection() {
- return pb_1.Message.getField(this, 3) != null;
+ get convertKilometer() {
+ return pb_1.Message.getFieldWithDefault(this, 4, []) as number[];
}
- get pbSection() {
- return pb_1.Message.getWrapperField(this, Section, 4) as Section;
- }
- set pbSection(value: Section) {
- pb_1.Message.setWrapperField(this, 4, value);
- }
- get has_pbSection() {
- return pb_1.Message.getField(this, 4) != null;
- }
- get pcSection() {
- return pb_1.Message.getWrapperField(this, Section, 5) as Section;
- }
- set pcSection(value: Section) {
- pb_1.Message.setWrapperField(this, 5, value);
- }
- get has_pcSection() {
- return pb_1.Message.getField(this, 5) != null;
+ set convertKilometer(value: number[]) {
+ pb_1.Message.setField(this, 4, value);
}
static fromObject(data: {
id?: string;
code?: string;
- paSection?: ReturnType;
- pbSection?: ReturnType;
- pcSection?: ReturnType;
+ kilometerSystem?: ReturnType[];
+ convertKilometer?: number[];
}): Switch {
const message = new Switch({});
if (data.id != null) {
@@ -247,14 +250,11 @@ export namespace state {
if (data.code != null) {
message.code = data.code;
}
- if (data.paSection != null) {
- message.paSection = Section.fromObject(data.paSection);
+ if (data.kilometerSystem != null) {
+ message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
}
- if (data.pbSection != null) {
- message.pbSection = Section.fromObject(data.pbSection);
- }
- if (data.pcSection != null) {
- message.pcSection = Section.fromObject(data.pcSection);
+ if (data.convertKilometer != null) {
+ message.convertKilometer = data.convertKilometer;
}
return message;
}
@@ -262,9 +262,8 @@ export namespace state {
const data: {
id?: string;
code?: string;
- paSection?: ReturnType;
- pbSection?: ReturnType;
- pcSection?: ReturnType;
+ kilometerSystem?: ReturnType[];
+ convertKilometer?: number[];
} = {};
if (this.id != null) {
data.id = this.id;
@@ -272,14 +271,11 @@ export namespace state {
if (this.code != null) {
data.code = this.code;
}
- if (this.paSection != null) {
- data.paSection = this.paSection.toObject();
+ if (this.kilometerSystem != null) {
+ data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
}
- if (this.pbSection != null) {
- data.pbSection = this.pbSection.toObject();
- }
- if (this.pcSection != null) {
- data.pcSection = this.pcSection.toObject();
+ if (this.convertKilometer != null) {
+ data.convertKilometer = this.convertKilometer;
}
return data;
}
@@ -291,12 +287,10 @@ export namespace state {
writer.writeString(1, this.id);
if (this.code.length)
writer.writeString(2, this.code);
- if (this.has_paSection)
- writer.writeMessage(3, this.paSection, () => this.paSection.serialize(writer));
- if (this.has_pbSection)
- writer.writeMessage(4, this.pbSection, () => this.pbSection.serialize(writer));
- if (this.has_pcSection)
- writer.writeMessage(5, this.pcSection, () => this.pcSection.serialize(writer));
+ if (this.kilometerSystem.length)
+ writer.writeRepeatedMessage(3, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
+ if (this.convertKilometer.length)
+ writer.writePackedInt64(4, this.convertKilometer);
if (!w)
return writer.getResultBuffer();
}
@@ -313,13 +307,10 @@ export namespace state {
message.code = reader.readString();
break;
case 3:
- reader.readMessage(message.paSection, () => message.paSection = Section.deserialize(reader));
+ reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem));
break;
case 4:
- reader.readMessage(message.pbSection, () => message.pbSection = Section.deserialize(reader));
- break;
- case 5:
- reader.readMessage(message.pcSection, () => message.pcSection = Section.deserialize(reader));
+ message.convertKilometer = reader.readPackedInt64();
break;
default: reader.skipField();
}
diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts
index 7f078f6..22aa73c 100644
--- a/src/protos/stationLayoutGraphics.ts
+++ b/src/protos/stationLayoutGraphics.ts
@@ -2667,6 +2667,7 @@ export namespace graphicData {
paRef?: RelatedRef;
pbRef?: RelatedRef;
pcRef?: RelatedRef;
+ kilometerSystem?: KilometerSystem;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 7, 8], this.#one_of_decls);
@@ -2695,6 +2696,9 @@ export namespace graphicData {
if ("pcRef" in data && data.pcRef != undefined) {
this.pcRef = data.pcRef;
}
+ if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
+ this.kilometerSystem = data.kilometerSystem;
+ }
}
}
get common() {
@@ -2757,6 +2761,15 @@ export namespace graphicData {
get has_pcRef() {
return pb_1.Message.getField(this, 11) != null;
}
+ get kilometerSystem() {
+ return pb_1.Message.getWrapperField(this, KilometerSystem, 12) as KilometerSystem;
+ }
+ set kilometerSystem(value: KilometerSystem) {
+ pb_1.Message.setWrapperField(this, 12, value);
+ }
+ get has_kilometerSystem() {
+ return pb_1.Message.getField(this, 12) != null;
+ }
static fromObject(data: {
common?: ReturnType;
code?: string;
@@ -2766,6 +2779,7 @@ export namespace graphicData {
paRef?: ReturnType;
pbRef?: ReturnType;
pcRef?: ReturnType;
+ kilometerSystem?: ReturnType;
}): Turnout {
const message = new Turnout({});
if (data.common != null) {
@@ -2792,6 +2806,9 @@ export namespace graphicData {
if (data.pcRef != null) {
message.pcRef = RelatedRef.fromObject(data.pcRef);
}
+ if (data.kilometerSystem != null) {
+ message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
+ }
return message;
}
toObject() {
@@ -2804,6 +2821,7 @@ export namespace graphicData {
paRef?: ReturnType;
pbRef?: ReturnType;
pcRef?: ReturnType;
+ kilometerSystem?: ReturnType;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@@ -2829,6 +2847,9 @@ export namespace graphicData {
if (this.pcRef != null) {
data.pcRef = this.pcRef.toObject();
}
+ if (this.kilometerSystem != null) {
+ data.kilometerSystem = this.kilometerSystem.toObject();
+ }
return data;
}
serialize(): Uint8Array;
@@ -2851,6 +2872,8 @@ export namespace graphicData {
writer.writeMessage(10, this.pbRef, () => this.pbRef.serialize(writer));
if (this.has_pcRef)
writer.writeMessage(11, this.pcRef, () => this.pcRef.serialize(writer));
+ if (this.has_kilometerSystem)
+ writer.writeMessage(12, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@@ -2884,6 +2907,9 @@ export namespace graphicData {
case 11:
reader.readMessage(message.pcRef, () => message.pcRef = RelatedRef.deserialize(reader));
break;
+ case 12:
+ reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader));
+ break;
default: reader.skipField();
}
}
diff --git a/src/stores/draw-store.ts b/src/stores/draw-store.ts
index a9f14f7..e1a35af 100644
--- a/src/stores/draw-store.ts
+++ b/src/stores/draw-store.ts
@@ -8,6 +8,7 @@ export const useDrawStore = defineStore('draw', {
selectedGraphics: null as JlGraphic[] | null,
draftId: null as number | null,
draftType: 'Line',
+ oneClickType: '',
}),
getters: {
drawMode: (state) => state.drawAssistant != null,
diff --git a/xian-ncc-da-message b/xian-ncc-da-message
index 0e4f2bd..83bba70 160000
--- a/xian-ncc-da-message
+++ b/xian-ncc-da-message
@@ -1 +1 @@
-Subproject commit 0e4f2bd6fbb5eae436685260e622ec7796ae479a
+Subproject commit 83bba70b83094af84bc3fb0a7f9cd5e03219886f