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-input outlined readonly v-model="separatorModel.id" label="id" hint="" />
<q-select <q-select
v-if="showType"
outlined outlined
style="margin-top: 10px" style="margin-top: 10px"
v-model="separatorModel.separatorType" v-model="separatorModel.separatorType"
@ -11,7 +10,7 @@
:map-options="true" :map-options="true"
:emit-value="true" :emit-value="true"
@update:model-value="onUpdate" @update:model-value="onUpdate"
label="分隔符方向" label="分隔符类型"
></q-select> ></q-select>
</q-form> </q-form>
</template> </template>
@ -20,23 +19,18 @@
import { SeparatorData } from 'src/drawApp/graphics/SeparatorInteraction'; import { SeparatorData } from 'src/drawApp/graphics/SeparatorInteraction';
import { Separator } from 'src/graphics/separator/Separator'; import { Separator } from 'src/graphics/separator/Separator';
import { useDrawStore } from 'src/stores/draw-store'; import { useDrawStore } from 'src/stores/draw-store';
import { computed, onMounted, reactive, watch } from 'vue'; import { onMounted, reactive, watch } from 'vue';
const drawStore = useDrawStore(); const drawStore = useDrawStore();
const separatorModel = reactive(new SeparatorData()); const separatorModel = reactive(new SeparatorData());
const typeOptions = [ const typeOptions = [
{ label: '左方向', value: 'endA' }, { label: '区段分隔符', value: 'section' },
{ label: '右方向', value: 'endB' }, { 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; drawStore.$subscribe;
watch( watch(
() => drawStore.selectedGraphic, () => drawStore.selectedGraphic,

View File

@ -7,6 +7,24 @@
@blur="onUpdate" @blur="onUpdate"
label="编号" 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> <q-field class="q-mt-lg" outlined label="关联区段" readonly stack-label>
<template #control> <template #control>
<q-chip <q-chip
@ -39,11 +57,16 @@ import { TurnoutData } from 'src/drawApp/graphics/TurnoutInteraction';
import { Section } from 'src/graphics/section/Section'; import { Section } from 'src/graphics/section/Section';
import { Turnout } from 'src/graphics/turnout/Turnout'; import { Turnout } from 'src/graphics/turnout/Turnout';
import { useDrawStore } from 'src/stores/draw-store'; import { useDrawStore } from 'src/stores/draw-store';
import { computed, shallowRef, watchEffect } from 'vue'; import { computed, reactive, shallowRef, watchEffect } from 'vue';
const drawStore = useDrawStore(); const drawStore = useDrawStore();
const CoordinateSystemOptions = [
{ label: '车辆段', value: 'DEPOT' },
{ label: '停车场', value: 'PARKING_LOT' },
{ label: '正线', value: 'MAIN_LINE' },
];
const turnoutModel = shallowRef(new TurnoutData()); const turnoutModel = shallowRef(new TurnoutData());
const kilometerSystem = reactive({ coordinateSystem: '', kilometer: 0 });
const sectionRelations = computed(() => { const sectionRelations = computed(() => {
const turnout = drawStore.selectedGraphic as Turnout; const turnout = drawStore.selectedGraphic as Turnout;
@ -81,11 +104,20 @@ watchEffect(() => {
const turnout = drawStore.selectedGraphic; const turnout = drawStore.selectedGraphic;
if (turnout && turnout instanceof Turnout) { if (turnout && turnout instanceof Turnout) {
turnoutModel.value = turnout.saveData(); turnoutModel.value = turnout.saveData();
if (turnoutModel.value.kilometerSystem) {
kilometerSystem.coordinateSystem =
turnoutModel.value.kilometerSystem.coordinateSystem;
kilometerSystem.kilometer = turnoutModel.value.kilometerSystem.kilometer;
}
} }
}); });
const onUpdate = () => { const onUpdate = () => {
const turnout = drawStore.selectedGraphic as Turnout; const turnout = drawStore.selectedGraphic as Turnout;
turnoutModel.value.kilometerSystem = {
coordinateSystem: kilometerSystem.coordinateSystem,
kilometer: kilometerSystem.kilometer,
};
if (turnout) { if (turnout) {
drawStore.getDrawApp().updateGraphicAndRecord(turnout, turnoutModel.value); drawStore.getDrawApp().updateGraphicAndRecord(turnout, turnoutModel.value);
} }

View File

@ -3,6 +3,7 @@ import * as pb_1 from 'google-protobuf';
import { GraphicDataBase } from './GraphicDataBase'; import { GraphicDataBase } from './GraphicDataBase';
import { graphicData } from 'src/protos/stationLayoutGraphics'; import { graphicData } from 'src/protos/stationLayoutGraphics';
import { IPointData } from 'pixi.js'; import { IPointData } from 'pixi.js';
import { KilometerSystem } from 'src/graphics/signal/Signal';
function getDefaultEndPoint() { function getDefaultEndPoint() {
return { return {
@ -72,6 +73,12 @@ export class TurnoutData extends GraphicDataBase implements ITurnoutData {
set pcRef(ref: graphicData.RelatedRef) { set pcRef(ref: graphicData.RelatedRef) {
this.data.pcRef = ref; this.data.pcRef = ref;
} }
get kilometerSystem(): KilometerSystem {
return this.data.kilometerSystem;
}
set kilometerSystem(v: KilometerSystem) {
this.data.kilometerSystem = new graphicData.KilometerSystem(v);
}
clone(): TurnoutData { clone(): TurnoutData {
return new TurnoutData(this.data.cloneMessage()); return new TurnoutData(this.data.cloneMessage());
} }

View File

@ -170,16 +170,13 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
sections.forEach((section) => { sections.forEach((section) => {
const sectionRelations = const sectionRelations =
section.relationManage.getRelationsOfGraphicAndOtherType( section.relationManage.getRelationsOfGraphic(section);
section,
Section.Type
);
const ps = section.localToCanvasPoint(section.getStartPoint()); const ps = section.localToCanvasPoint(section.getStartPoint());
const pe = section.localToCanvasPoint(section.getEndPoint()); const pe = section.localToCanvasPoint(section.getEndPoint());
sectionRelations.forEach((relation) => { sectionRelations.forEach((relation) => {
const port = relation.getRelationParam(section).param; const port = relation.getRelationParam(section).param;
const refSection = relation.getOtherGraphic<Section>(section); const refDevice = relation.getOtherGraphic<Section>(section);
const refSectionPort = relation.getOtherRelationParam(section).param; const refDevicePort = relation.getOtherRelationParam(section).param;
let direction = 1; let direction = 1;
let axleCountingPs = ps; let axleCountingPs = ps;
if (port == 'B') { if (port == 'B') {
@ -188,19 +185,20 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
if (axleCountingPs.y > height.y) { if (axleCountingPs.y > height.y) {
direction = -1; direction = -1;
} }
this.draw( if (refDevice.type == Section.Type || refDevice.type == Turnout.Type)
axleCountingPs, this.draw(
direction, axleCountingPs,
section, direction,
port, section,
map, port,
Section.Type, map,
refSection, refDevice.type,
refSectionPort refDevice,
); refDevicePort
);
}); });
}); });
//由区段生成计轴--区段和道岔或单独区段 //由区段生成计轴--单独区段
sections.forEach((section) => { sections.forEach((section) => {
const axleCountingRelations = const axleCountingRelations =
section.relationManage.getRelationsOfGraphicAndOtherType( section.relationManage.getRelationsOfGraphicAndOtherType(
@ -225,29 +223,7 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
if (axleCountingPs.y > height.y) { if (axleCountingPs.y > height.y) {
direction = -1; direction = -1;
} }
const addPortRelation = section.relationManage this.drawAdd(axleCountingPs, direction, section, addPort, map);
.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
);
}
}); });
} }
}); });

View File

@ -101,21 +101,22 @@ export class SeparatorDraw extends GraphicDrawAssistant<
const r = relation.getRelationParam(turnout); const r = relation.getRelationParam(turnout);
port.push(r.param); port.push(r.param);
const other = relation.getOtherRelationParam(turnout); 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))) { if (!rMap.has(setKey(r))) {
let t = separatorTypeEnum.section;
if (r.param == 'C' && other.param == 'C') {
t = separatorTypeEnum.turnout;
}
rMap.set(setKey(r), { rMap.set(setKey(r), {
...r, ...r,
separatorType: t, separatorType: t,
}); });
} }
if (!rMap.has(setKey(other))) { if (!rMap.has(setKey(other))) {
let t = separatorTypeEnum.section;
if (r.param == 'C' && other.param == 'C') {
t = separatorTypeEnum.turnout;
}
rMap.set(setKey(other), { rMap.set(setKey(other), {
...other, ...other,
separatorType: t, separatorType: t,
@ -161,7 +162,8 @@ export class SeparatorDraw extends GraphicDrawAssistant<
} else if (item.param == 'B') { } else if (item.param == 'B') {
l = 1; l = 1;
} }
p = ps[l][0]; const lps = ps[l];
p = lps[lps.length - 1];
} }
const tps = item.g.localToCanvasPoint(p); const tps = item.g.localToCanvasPoint(p);
separator.position.set(tps.x, tps.y); separator.position.set(tps.x, tps.y);

View File

@ -10,6 +10,7 @@ import { TrainWindow } from './TrainWindow';
import { TrainWindowDraw } from './TrainWindowDrawAssistant'; import { TrainWindowDraw } from './TrainWindowDrawAssistant';
import { AxleCounting } from '../axleCounting/AxleCounting'; import { AxleCounting } from '../axleCounting/AxleCounting';
import { AxleCountingDraw } from '../axleCounting/AxleCountingDrawAssistant'; import { AxleCountingDraw } from '../axleCounting/AxleCountingDrawAssistant';
import { useDrawStore } from 'src/stores/draw-store';
interface IOneClickData extends GraphicData { interface IOneClickData extends GraphicData {
get code(): string; // 编号 get code(): string; // 编号
@ -56,14 +57,18 @@ export class OneClickGenerateDraw extends GraphicDrawAssistant<
this.lineGraph.doRepaint(); this.lineGraph.doRepaint();
} }
onLeftDown(e: FederatedPointerEvent): void { onLeftDown(e: FederatedPointerEvent): void {
const trainWindowDraw = this.app.getDrawAssistant( const type = useDrawStore().$state.oneClickType;
TrainWindow.Type if (type == 'TrainWindow') {
) as TrainWindowDraw; const trainWindowDraw = this.app.getDrawAssistant(
trainWindowDraw.oneGenerates(this.toCanvasCoordinates(e.global)); TrainWindow.Type
const axleCountingDraw = this.app.getDrawAssistant( ) as TrainWindowDraw;
AxleCounting.Type trainWindowDraw.oneGenerates(this.toCanvasCoordinates(e.global));
) as AxleCountingDraw; } else {
axleCountingDraw.oneGenerates(this.toCanvasCoordinates(e.global)); const axleCountingDraw = this.app.getDrawAssistant(
AxleCounting.Type
) as AxleCountingDraw;
axleCountingDraw.oneGenerates(this.toCanvasCoordinates(e.global));
}
this.finish(); this.finish();
} }

View File

@ -6,6 +6,7 @@ import {
JlGraphic, JlGraphic,
JlGraphicTemplate, JlGraphicTemplate,
VectorText, VectorText,
angleOfIncludedAngle,
distance2, distance2,
} from 'src/jl-graphic'; } from 'src/jl-graphic';
import { Section, SectionPort } from '../section/Section'; import { Section, SectionPort } from '../section/Section';
@ -15,6 +16,7 @@ import {
createRelatedRefProto, createRelatedRefProto,
protoPort2Data, protoPort2Data,
} from '../CommonGraphics'; } from '../CommonGraphics';
import { KilometerSystem } from '../signal/Signal';
export interface ITurnoutData extends GraphicData { export interface ITurnoutData extends GraphicData {
get code(): string; get code(): string;
@ -31,6 +33,8 @@ export interface ITurnoutData extends GraphicData {
set pbRef(ref: IRelatedRefData); set pbRef(ref: IRelatedRefData);
get pcRef(): IRelatedRefData; get pcRef(): IRelatedRefData;
set pcRef(ref: IRelatedRefData); set pcRef(ref: IRelatedRefData);
get kilometerSystem(): KilometerSystem;
set kilometerSystem(v: KilometerSystem);
clone(): ITurnoutData; clone(): ITurnoutData;
copyFrom(data: ITurnoutData): void; copyFrom(data: ITurnoutData): void;
eq(other: ITurnoutData): boolean; eq(other: ITurnoutData): boolean;
@ -208,9 +212,11 @@ export class Turnout extends JlGraphic {
}); });
/** 道岔和道岔 */ /** 道岔和道岔 */
this.queryStore.queryByType<Turnout>(Turnout.Type).forEach((turnout) => { this.getPortPoints().forEach((thisPort, i) => {
if (turnout.id === this.id) return; let params: GraphicRelationParam[] = [],
this.getPortPoints().forEach((thisPort, i) => { deflection = 180;
this.queryStore.queryByType<Turnout>(Turnout.Type).forEach((turnout) => {
if (turnout.id === this.id) return;
turnout.getPortPoints().forEach((otherPort, j) => { turnout.getPortPoints().forEach((otherPort, j) => {
if ( if (
distance2( distance2(
@ -218,19 +224,34 @@ export class Turnout extends JlGraphic {
turnout.localToCanvasPoint(otherPort[otherPort.length - 1]) turnout.localToCanvasPoint(otherPort[otherPort.length - 1])
) <= epsilon ) <= epsilon
) { ) {
this.relationManage.addRelation( const angle = angleOfIncludedAngle(
new GraphicRelationParam( this.localToCanvasPoint(thisPort[thisPort.length - 1]) /* 交点 */,
this, thisPort[thisPort.length - 2]
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i] ? this.localToCanvasPoint(thisPort[thisPort.length - 2])
), : this.position,
new GraphicRelationParam( otherPort[otherPort.length - 2]
turnout, ? turnout.localToCanvasPoint(otherPort[otherPort.length - 2])
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][j] : 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-section>一键关联</q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="oneClickGeneration"> <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-item>
</q-list> </q-list>
</q-menu> </q-menu>
@ -305,10 +311,21 @@ function buildRelations() {
} }
function oneClickGeneration() { function oneClickGeneration() {
//
drawStore.oneClickType = 'TrainWindow';
drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume();
}
function oneClickSeparator() {
//
const separatorDraw = drawStore const separatorDraw = drawStore
.getDrawApp() .getDrawApp()
.getDrawAssistant(Separator.Type) as SeparatorDraw; .getDrawAssistant(Separator.Type) as SeparatorDraw;
separatorDraw.oneGenerates(); separatorDraw.oneGenerates();
}
function oneClickAxleCounting() {
//
drawStore.oneClickType = 'AxleCounting';
drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume(); drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume();
} }

View File

@ -12,11 +12,12 @@ export namespace state {
id?: string; id?: string;
code?: string; code?: string;
type?: dependency_1.graphicData.Section.SectionType; type?: dependency_1.graphicData.Section.SectionType;
kilometerCode?: number[]; kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
children?: Section[]; children?: Section[];
convertKilometer?: number[];
}) { }) {
super(); 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 (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -27,12 +28,15 @@ export namespace state {
if ("type" in data && data.type != undefined) { if ("type" in data && data.type != undefined) {
this.type = data.type; this.type = data.type;
} }
if ("kilometerCode" in data && data.kilometerCode != undefined) { if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerCode = data.kilometerCode; this.kilometerSystem = data.kilometerSystem;
} }
if ("children" in data && data.children != undefined) { if ("children" in data && data.children != undefined) {
this.children = data.children; this.children = data.children;
} }
if ("convertKilometer" in data && data.convertKilometer != undefined) {
this.convertKilometer = data.convertKilometer;
}
} }
} }
get id() { get id() {
@ -53,11 +57,11 @@ export namespace state {
set type(value: dependency_1.graphicData.Section.SectionType) { set type(value: dependency_1.graphicData.Section.SectionType) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get kilometerCode() { get kilometerSystem() {
return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 4) as dependency_1.graphicData.KilometerSystem[];
} }
set kilometerCode(value: number[]) { set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
pb_1.Message.setField(this, 4, value); pb_1.Message.setRepeatedWrapperField(this, 4, value);
} }
get children() { get children() {
return pb_1.Message.getRepeatedWrapperField(this, Section, 5) as Section[]; return pb_1.Message.getRepeatedWrapperField(this, Section, 5) as Section[];
@ -65,12 +69,19 @@ export namespace state {
set children(value: Section[]) { set children(value: Section[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value); 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: { static fromObject(data: {
id?: string; id?: string;
code?: string; code?: string;
type?: dependency_1.graphicData.Section.SectionType; type?: dependency_1.graphicData.Section.SectionType;
kilometerCode?: number[]; kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[]; children?: ReturnType<typeof Section.prototype.toObject>[];
convertKilometer?: number[];
}): Section { }): Section {
const message = new Section({}); const message = new Section({});
if (data.id != null) { if (data.id != null) {
@ -82,12 +93,15 @@ export namespace state {
if (data.type != null) { if (data.type != null) {
message.type = data.type; message.type = data.type;
} }
if (data.kilometerCode != null) { if (data.kilometerSystem != null) {
message.kilometerCode = data.kilometerCode; message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
} }
if (data.children != null) { if (data.children != null) {
message.children = data.children.map(item => Section.fromObject(item)); message.children = data.children.map(item => Section.fromObject(item));
} }
if (data.convertKilometer != null) {
message.convertKilometer = data.convertKilometer;
}
return message; return message;
} }
toObject() { toObject() {
@ -95,8 +109,9 @@ export namespace state {
id?: string; id?: string;
code?: string; code?: string;
type?: dependency_1.graphicData.Section.SectionType; type?: dependency_1.graphicData.Section.SectionType;
kilometerCode?: number[]; kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[]; children?: ReturnType<typeof Section.prototype.toObject>[];
convertKilometer?: number[];
} = {}; } = {};
if (this.id != null) { if (this.id != null) {
data.id = this.id; data.id = this.id;
@ -107,12 +122,15 @@ export namespace state {
if (this.type != null) { if (this.type != null) {
data.type = this.type; data.type = this.type;
} }
if (this.kilometerCode != null) { if (this.kilometerSystem != null) {
data.kilometerCode = this.kilometerCode; data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
} }
if (this.children != null) { if (this.children != null) {
data.children = this.children.map((item: Section) => item.toObject()); data.children = this.children.map((item: Section) => item.toObject());
} }
if (this.convertKilometer != null) {
data.convertKilometer = this.convertKilometer;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -125,10 +143,12 @@ export namespace state {
writer.writeString(2, this.code); writer.writeString(2, this.code);
if (this.type != dependency_1.graphicData.Section.SectionType.Physical) if (this.type != dependency_1.graphicData.Section.SectionType.Physical)
writer.writeEnum(3, this.type); writer.writeEnum(3, this.type);
if (this.kilometerCode.length) if (this.kilometerSystem.length)
writer.writePackedInt64(4, this.kilometerCode); writer.writeRepeatedMessage(4, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.children.length) if (this.children.length)
writer.writeRepeatedMessage(5, this.children, (item: Section) => item.serialize(writer)); writer.writeRepeatedMessage(5, this.children, (item: Section) => item.serialize(writer));
if (this.convertKilometer.length)
writer.writePackedInt64(6, this.convertKilometer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -148,11 +168,14 @@ export namespace state {
message.type = reader.readEnum(); message.type = reader.readEnum();
break; break;
case 4: 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; break;
case 5: case 5:
reader.readMessage(message.children, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Section.deserialize(reader), Section)); reader.readMessage(message.children, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Section.deserialize(reader), Section));
break; break;
case 6:
message.convertKilometer = reader.readPackedInt64();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -170,12 +193,11 @@ export namespace state {
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
code?: string; code?: string;
paSection?: Section; kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
pbSection?: Section; convertKilometer?: number[];
pcSection?: Section;
}) { }) {
super(); 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 (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -183,14 +205,11 @@ export namespace state {
if ("code" in data && data.code != undefined) { if ("code" in data && data.code != undefined) {
this.code = data.code; this.code = data.code;
} }
if ("paSection" in data && data.paSection != undefined) { if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.paSection = data.paSection; this.kilometerSystem = data.kilometerSystem;
} }
if ("pbSection" in data && data.pbSection != undefined) { if ("convertKilometer" in data && data.convertKilometer != undefined) {
this.pbSection = data.pbSection; this.convertKilometer = data.convertKilometer;
}
if ("pcSection" in data && data.pcSection != undefined) {
this.pcSection = data.pcSection;
} }
} }
} }
@ -206,39 +225,23 @@ export namespace state {
set code(value: string) { set code(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get paSection() { get kilometerSystem() {
return pb_1.Message.getWrapperField(this, Section, 3) as Section; return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 3) as dependency_1.graphicData.KilometerSystem[];
} }
set paSection(value: Section) { set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
pb_1.Message.setWrapperField(this, 3, value); pb_1.Message.setRepeatedWrapperField(this, 3, value);
} }
get has_paSection() { get convertKilometer() {
return pb_1.Message.getField(this, 3) != null; return pb_1.Message.getFieldWithDefault(this, 4, []) as number[];
} }
get pbSection() { set convertKilometer(value: number[]) {
return pb_1.Message.getWrapperField(this, Section, 4) as Section; pb_1.Message.setField(this, 4, value);
}
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;
} }
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
code?: string; code?: string;
paSection?: ReturnType<typeof Section.prototype.toObject>; kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
pbSection?: ReturnType<typeof Section.prototype.toObject>; convertKilometer?: number[];
pcSection?: ReturnType<typeof Section.prototype.toObject>;
}): Switch { }): Switch {
const message = new Switch({}); const message = new Switch({});
if (data.id != null) { if (data.id != null) {
@ -247,14 +250,11 @@ export namespace state {
if (data.code != null) { if (data.code != null) {
message.code = data.code; message.code = data.code;
} }
if (data.paSection != null) { if (data.kilometerSystem != null) {
message.paSection = Section.fromObject(data.paSection); message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
} }
if (data.pbSection != null) { if (data.convertKilometer != null) {
message.pbSection = Section.fromObject(data.pbSection); message.convertKilometer = data.convertKilometer;
}
if (data.pcSection != null) {
message.pcSection = Section.fromObject(data.pcSection);
} }
return message; return message;
} }
@ -262,9 +262,8 @@ export namespace state {
const data: { const data: {
id?: string; id?: string;
code?: string; code?: string;
paSection?: ReturnType<typeof Section.prototype.toObject>; kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
pbSection?: ReturnType<typeof Section.prototype.toObject>; convertKilometer?: number[];
pcSection?: ReturnType<typeof Section.prototype.toObject>;
} = {}; } = {};
if (this.id != null) { if (this.id != null) {
data.id = this.id; data.id = this.id;
@ -272,14 +271,11 @@ export namespace state {
if (this.code != null) { if (this.code != null) {
data.code = this.code; data.code = this.code;
} }
if (this.paSection != null) { if (this.kilometerSystem != null) {
data.paSection = this.paSection.toObject(); data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
} }
if (this.pbSection != null) { if (this.convertKilometer != null) {
data.pbSection = this.pbSection.toObject(); data.convertKilometer = this.convertKilometer;
}
if (this.pcSection != null) {
data.pcSection = this.pcSection.toObject();
} }
return data; return data;
} }
@ -291,12 +287,10 @@ export namespace state {
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (this.code.length) if (this.code.length)
writer.writeString(2, this.code); writer.writeString(2, this.code);
if (this.has_paSection) if (this.kilometerSystem.length)
writer.writeMessage(3, this.paSection, () => this.paSection.serialize(writer)); writer.writeRepeatedMessage(3, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.has_pbSection) if (this.convertKilometer.length)
writer.writeMessage(4, this.pbSection, () => this.pbSection.serialize(writer)); writer.writePackedInt64(4, this.convertKilometer);
if (this.has_pcSection)
writer.writeMessage(5, this.pcSection, () => this.pcSection.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -313,13 +307,10 @@ export namespace state {
message.code = reader.readString(); message.code = reader.readString();
break; break;
case 3: 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; break;
case 4: case 4:
reader.readMessage(message.pbSection, () => message.pbSection = Section.deserialize(reader)); message.convertKilometer = reader.readPackedInt64();
break;
case 5:
reader.readMessage(message.pcSection, () => message.pcSection = Section.deserialize(reader));
break; break;
default: reader.skipField(); default: reader.skipField();
} }

View File

@ -2667,6 +2667,7 @@ export namespace graphicData {
paRef?: RelatedRef; paRef?: RelatedRef;
pbRef?: RelatedRef; pbRef?: RelatedRef;
pcRef?: RelatedRef; pcRef?: RelatedRef;
kilometerSystem?: KilometerSystem;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 7, 8], this.#one_of_decls); 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) { if ("pcRef" in data && data.pcRef != undefined) {
this.pcRef = data.pcRef; this.pcRef = data.pcRef;
} }
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem;
}
} }
} }
get common() { get common() {
@ -2757,6 +2761,15 @@ export namespace graphicData {
get has_pcRef() { get has_pcRef() {
return pb_1.Message.getField(this, 11) != null; 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: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
@ -2766,6 +2779,7 @@ export namespace graphicData {
paRef?: ReturnType<typeof RelatedRef.prototype.toObject>; paRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
}): Turnout { }): Turnout {
const message = new Turnout({}); const message = new Turnout({});
if (data.common != null) { if (data.common != null) {
@ -2792,6 +2806,9 @@ export namespace graphicData {
if (data.pcRef != null) { if (data.pcRef != null) {
message.pcRef = RelatedRef.fromObject(data.pcRef); message.pcRef = RelatedRef.fromObject(data.pcRef);
} }
if (data.kilometerSystem != null) {
message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
}
return message; return message;
} }
toObject() { toObject() {
@ -2804,6 +2821,7 @@ export namespace graphicData {
paRef?: ReturnType<typeof RelatedRef.prototype.toObject>; paRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -2829,6 +2847,9 @@ export namespace graphicData {
if (this.pcRef != null) { if (this.pcRef != null) {
data.pcRef = this.pcRef.toObject(); data.pcRef = this.pcRef.toObject();
} }
if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.toObject();
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -2851,6 +2872,8 @@ export namespace graphicData {
writer.writeMessage(10, this.pbRef, () => this.pbRef.serialize(writer)); writer.writeMessage(10, this.pbRef, () => this.pbRef.serialize(writer));
if (this.has_pcRef) if (this.has_pcRef)
writer.writeMessage(11, this.pcRef, () => this.pcRef.serialize(writer)); writer.writeMessage(11, this.pcRef, () => this.pcRef.serialize(writer));
if (this.has_kilometerSystem)
writer.writeMessage(12, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -2884,6 +2907,9 @@ export namespace graphicData {
case 11: case 11:
reader.readMessage(message.pcRef, () => message.pcRef = RelatedRef.deserialize(reader)); reader.readMessage(message.pcRef, () => message.pcRef = RelatedRef.deserialize(reader));
break; break;
case 12:
reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader));
break;
default: reader.skipField(); default: reader.skipField();
} }
} }

View File

@ -8,6 +8,7 @@ export const useDrawStore = defineStore('draw', {
selectedGraphics: null as JlGraphic[] | null, selectedGraphics: null as JlGraphic[] | null,
draftId: null as number | null, draftId: null as number | null,
draftType: 'Line', draftType: 'Line',
oneClickType: '',
}), }),
getters: { getters: {
drawMode: (state) => state.drawAssistant != null, drawMode: (state) => state.drawAssistant != null,

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