This commit is contained in:
fan 2023-06-30 09:34:00 +08:00
commit 1d552714a1
12 changed files with 239 additions and 167 deletions

View File

@ -3,7 +3,6 @@
<q-input outlined readonly v-model="separatorModel.id" label="id" hint="" />
<q-select
v-if="showType"
outlined
style="margin-top: 10px"
v-model="separatorModel.separatorType"
@ -11,7 +10,7 @@
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="分隔符方向"
label="分隔符类型"
></q-select>
</q-form>
</template>
@ -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,

View File

@ -7,6 +7,24 @@
@blur="onUpdate"
label="编号"
/>
<q-select
outlined
style="margin-top: 10px"
v-model="kilometerSystem.coordinateSystem"
:options="CoordinateSystemOptions"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="坐标系"
></q-select>
<q-input
outlined
style="margin-top: 10px"
v-model.number="kilometerSystem.kilometer"
type="number"
@blur="onUpdate"
label="公里标(mm):"
/>
<q-field class="q-mt-lg" outlined label="关联区段" readonly stack-label>
<template #control>
<q-chip
@ -39,11 +57,16 @@ import { TurnoutData } from 'src/drawApp/graphics/TurnoutInteraction';
import { Section } from 'src/graphics/section/Section';
import { Turnout } from 'src/graphics/turnout/Turnout';
import { useDrawStore } from 'src/stores/draw-store';
import { computed, shallowRef, watchEffect } from 'vue';
import { computed, reactive, shallowRef, watchEffect } from 'vue';
const drawStore = useDrawStore();
const CoordinateSystemOptions = [
{ label: '车辆段', value: 'DEPOT' },
{ label: '停车场', value: 'PARKING_LOT' },
{ label: '正线', value: 'MAIN_LINE' },
];
const turnoutModel = shallowRef(new TurnoutData());
const kilometerSystem = reactive({ coordinateSystem: '', kilometer: 0 });
const sectionRelations = computed(() => {
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);
}

View File

@ -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());
}

View File

@ -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>(section);
const refSectionPort = relation.getOtherRelationParam(section).param;
const refDevice = relation.getOtherGraphic<Section>(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<Turnout>(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);
});
}
});

View File

@ -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);

View File

@ -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();
}

View File

@ -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>(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>(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]);
}
});
}

View File

@ -16,7 +16,13 @@
<q-item-section>一键关联</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="oneClickGeneration">
<q-item-section>一键生成</q-item-section>
<q-item-section>一键生成车次窗</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="oneClickSeparator">
<q-item-section>一键生成分隔符</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="oneClickAxleCounting">
<q-item-section>一键生成计轴</q-item-section>
</q-item>
</q-list>
</q-menu>
@ -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();
}

View File

@ -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<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[];
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<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[];
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<typeof Section.prototype.toObject>;
pbSection?: ReturnType<typeof Section.prototype.toObject>;
pcSection?: ReturnType<typeof Section.prototype.toObject>;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
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<typeof Section.prototype.toObject>;
pbSection?: ReturnType<typeof Section.prototype.toObject>;
pcSection?: ReturnType<typeof Section.prototype.toObject>;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
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();
}

View File

@ -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<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -2766,6 +2779,7 @@ export namespace graphicData {
paRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
}): 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<typeof RelatedRef.prototype.toObject>;
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
} = {};
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();
}
}

View File

@ -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,

@ -1 +1 @@
Subproject commit 0e4f2bd6fbb5eae436685260e622ec7796ae479a
Subproject commit 83bba70b83094af84bc3fb0a7f9cd5e03219886f