ibp编辑UniqueID

This commit is contained in:
Yuan 2023-10-12 16:21:55 +08:00
parent 05d72039bd
commit 7f96abf20e
7 changed files with 1021 additions and 95 deletions

@ -1 +1 @@
Subproject commit a8fa6fec188ad3df19952e298a1f846d581ca200
Subproject commit 5604ad84ed5c6af4206937f5bbba9b2debfbfb6f

View File

@ -32,7 +32,6 @@ import { TextContentDraw } from 'src/graphics/textContent/TextContentDrawAssista
import { IbpTextData } from './graphics/IbpTextInteraction';
import { MenuItemOptions } from 'src/jl-graphic/ui/Menu';
import { ContextMenu } from 'src/jl-graphic/ui/ContextMenu';
import { savePslDrawToServer } from './pslApp';
let drawApp: IDrawApp | null = null;
const UndoOptions: MenuItemOptions = {
@ -107,6 +106,18 @@ export function initIBPDrawApp() {
return drawApp;
}
//所属集中站
let uniqueIdPrefix = new ibpGraphicData.UniqueIdType();
export function loadUniqueIdPrefix() {
return uniqueIdPrefix;
}
export function setUniqueIdPrefix(
newUniqueIdPrefix: ibpGraphicData.UniqueIdType
) {
uniqueIdPrefix = newUniqueIdPrefix;
}
export function saveIBPDrawToServer(app: IDrawApp) {
const base64 = saveIBPDrawDatas(app);
const ibpDrawStore = useIBPDrawStore();
@ -123,7 +134,7 @@ export function saveIBPDrawToServer(app: IDrawApp) {
});
}
function saveIBPDrawDatas(app: IDrawApp) {
export function saveIBPDrawDatas(app: IDrawApp) {
const storage = new ibpGraphicData.IBPGraphicStorage();
const canvasData = app.canvas.saveData();
storage.canvas = new graphicData.Canvas({
@ -145,6 +156,7 @@ function saveIBPDrawDatas(app: IDrawApp) {
storage.IBPTexts.push(g.saveData<IbpTextData>().data);
}
});
storage.UniqueIdPrefix = uniqueIdPrefix;
const base64 = fromUint8Array(storage.serialize());
return base64;
}
@ -176,6 +188,9 @@ async function IBPDrawDataLoader() {
storage.IBPTexts.forEach((ibpText) => {
datas.push(new IbpTextData(ibpText));
});
if (storage.UniqueIdPrefix) {
setUniqueIdPrefix(storage.UniqueIdPrefix);
}
return {
canvasProperty: storage.canvas,
datas: datas,

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, reactive, ref, watch } from 'vue';
import { onMounted, reactive, ref, shallowRef, toRaw, watch } from 'vue';
import { useIBPDrawStore } from '../stores/ibp-draw-store';
import { useRoute, useRouter } from 'vue-router';
import { IBPButton } from 'src/graphics/IBPButton/IBPButton';
@ -7,8 +7,15 @@ import { IbpAlarm } from 'src/graphics/ibpAlarm/IbpAlarm';
import { IbpKey } from 'src/graphics/ibpKey/IbpKey';
import { Arrow } from 'src/graphics/arrow/Arrow';
import { TextContent } from 'src/graphics/textContent/TextContent';
import { getIBPDrawApp, saveIBPDrawToServer } from 'src/drawApp/ibpDrawApp';
import {
getIBPDrawApp,
saveIBPDrawToServer,
loadUniqueIdPrefix,
setUniqueIdPrefix,
saveIBPDrawDatas,
} from 'src/drawApp/ibpDrawApp';
import IbpDrawProperties from 'src/components/draw-app/IbpDrawProperties.vue';
import { ibpGraphicData } from 'src/protos/ibpGraphics';
const ibpDrawStore = useIBPDrawStore();
const route = useRoute();
@ -119,6 +126,20 @@ function saveData() {
saveIBPDrawToServer(app);
}
}
const isPrefixDialogOpen = ref(false);
const uniqueIdPrefix = ref(new ibpGraphicData.UniqueIdType().toObject());
function openUniqueIdPrefixDialog() {
isPrefixDialogOpen.value = true;
uniqueIdPrefix.value = loadUniqueIdPrefix();
}
function saveUniqueIdPrefix() {
setUniqueIdPrefix(new ibpGraphicData.UniqueIdType(uniqueIdPrefix.value));
isPrefixDialogOpen.value = false;
saveData();
}
function backConfirm() {
router.go(-1);
}
@ -135,6 +156,13 @@ function backConfirm() {
<QItem clickable @click="saveData" v-close-popup>
<QItemSection>保存</QItemSection>
</QItem>
<QItem
clickable
@click="openUniqueIdPrefixDialog"
v-close-popup
>
<QItemSection>UniqueId配置</QItemSection>
</QItem>
</QList>
</QMenu>
</QBtn>
@ -170,4 +198,41 @@ function backConfirm() {
<div id="draw-app-container" class="overflow-hidden"></div>
</QPageContainer>
</QLayout>
<QDialog
v-model="isPrefixDialogOpen"
persistent
transition-show="scale"
transition-hide="scale"
>
<QCard style="width: 300px">
<QCardSection>
<div class="text-h6">UniqueId配置</div>
</QCardSection>
<QCardSection>
<QInput
outlined
label="所属城市"
v-model="uniqueIdPrefix.city"
:rules="[(val) => val.trim() != '' || '城市不能为空']"
/>
<QInput
outlined
label="线路号"
v-model="uniqueIdPrefix.lineId"
:rules="[(val) => val.trim() != '' || '线路号不能为空']"
/>
<QInput
outlined
label="所属车站"
v-model="uniqueIdPrefix.belongsStation"
:rules="[(val) => val.trim() != '' || '所属车站不能为空']"
/>
</QCardSection>
<QCardActions align="right">
<QBtn color="primary" label="提交" @click="saveUniqueIdPrefix()" />
<QBtn label="取消" v-close-popup />
</QCardActions>
</QCard>
</QDialog>
</template>

View File

@ -15,6 +15,7 @@ export namespace ibpGraphicData {
ibpKeys?: IbpKey[];
ibpArrows?: IbpArrow[];
IBPTexts?: IBPText[];
UniqueIdPrefix?: UniqueIdType;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], this.#one_of_decls);
@ -37,6 +38,9 @@ export namespace ibpGraphicData {
if ("IBPTexts" in data && data.IBPTexts != undefined) {
this.IBPTexts = data.IBPTexts;
}
if ("UniqueIdPrefix" in data && data.UniqueIdPrefix != undefined) {
this.UniqueIdPrefix = data.UniqueIdPrefix;
}
}
}
get canvas() {
@ -78,6 +82,15 @@ export namespace ibpGraphicData {
set IBPTexts(value: IBPText[]) {
pb_1.Message.setRepeatedWrapperField(this, 6, value);
}
get UniqueIdPrefix() {
return pb_1.Message.getWrapperField(this, UniqueIdType, 7) as UniqueIdType;
}
set UniqueIdPrefix(value: UniqueIdType) {
pb_1.Message.setWrapperField(this, 7, value);
}
get has_UniqueIdPrefix() {
return pb_1.Message.getField(this, 7) != null;
}
static fromObject(data: {
canvas?: ReturnType<typeof dependency_1.graphicData.Canvas.prototype.toObject>;
ibpButtons?: ReturnType<typeof IBPButton.prototype.toObject>[];
@ -85,6 +98,7 @@ export namespace ibpGraphicData {
ibpKeys?: ReturnType<typeof IbpKey.prototype.toObject>[];
ibpArrows?: ReturnType<typeof IbpArrow.prototype.toObject>[];
IBPTexts?: ReturnType<typeof IBPText.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>;
}): IBPGraphicStorage {
const message = new IBPGraphicStorage({});
if (data.canvas != null) {
@ -105,6 +119,9 @@ export namespace ibpGraphicData {
if (data.IBPTexts != null) {
message.IBPTexts = data.IBPTexts.map(item => IBPText.fromObject(item));
}
if (data.UniqueIdPrefix != null) {
message.UniqueIdPrefix = UniqueIdType.fromObject(data.UniqueIdPrefix);
}
return message;
}
toObject() {
@ -115,6 +132,7 @@ export namespace ibpGraphicData {
ibpKeys?: ReturnType<typeof IbpKey.prototype.toObject>[];
ibpArrows?: ReturnType<typeof IbpArrow.prototype.toObject>[];
IBPTexts?: ReturnType<typeof IBPText.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>;
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@ -134,6 +152,9 @@ export namespace ibpGraphicData {
if (this.IBPTexts != null) {
data.IBPTexts = this.IBPTexts.map((item: IBPText) => item.toObject());
}
if (this.UniqueIdPrefix != null) {
data.UniqueIdPrefix = this.UniqueIdPrefix.toObject();
}
return data;
}
serialize(): Uint8Array;
@ -152,6 +173,8 @@ export namespace ibpGraphicData {
writer.writeRepeatedMessage(5, this.ibpArrows, (item: IbpArrow) => item.serialize(writer));
if (this.IBPTexts.length)
writer.writeRepeatedMessage(6, this.IBPTexts, (item: IBPText) => item.serialize(writer));
if (this.has_UniqueIdPrefix)
writer.writeMessage(7, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -179,6 +202,9 @@ export namespace ibpGraphicData {
case 6:
reader.readMessage(message.IBPTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 6, IBPText.deserialize(reader), IBPText));
break;
case 7:
reader.readMessage(message.UniqueIdPrefix, () => message.UniqueIdPrefix = UniqueIdType.deserialize(reader));
break;
default: reader.skipField();
}
}
@ -893,4 +919,117 @@ export namespace ibpGraphicData {
return IbpArrow.deserialize(bytes);
}
}
export class UniqueIdType extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
city?: string;
lineId?: string;
belongsStation?: string;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("city" in data && data.city != undefined) {
this.city = data.city;
}
if ("lineId" in data && data.lineId != undefined) {
this.lineId = data.lineId;
}
if ("belongsStation" in data && data.belongsStation != undefined) {
this.belongsStation = data.belongsStation;
}
}
}
get city() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set city(value: string) {
pb_1.Message.setField(this, 1, value);
}
get lineId() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
}
set lineId(value: string) {
pb_1.Message.setField(this, 2, value);
}
get belongsStation() {
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
}
set belongsStation(value: string) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
city?: string;
lineId?: string;
belongsStation?: string;
}): UniqueIdType {
const message = new UniqueIdType({});
if (data.city != null) {
message.city = data.city;
}
if (data.lineId != null) {
message.lineId = data.lineId;
}
if (data.belongsStation != null) {
message.belongsStation = data.belongsStation;
}
return message;
}
toObject() {
const data: {
city?: string;
lineId?: string;
belongsStation?: string;
} = {};
if (this.city != null) {
data.city = this.city;
}
if (this.lineId != null) {
data.lineId = this.lineId;
}
if (this.belongsStation != null) {
data.belongsStation = this.belongsStation;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.city.length)
writer.writeString(1, this.city);
if (this.lineId.length)
writer.writeString(2, this.lineId);
if (this.belongsStation.length)
writer.writeString(3, this.belongsStation);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UniqueIdType {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UniqueIdType();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.city = reader.readString();
break;
case 2:
message.lineId = reader.readString();
break;
case 3:
message.belongsStation = reader.readString();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): UniqueIdType {
return UniqueIdType.deserialize(bytes);
}
}
}

View File

@ -19,9 +19,10 @@ export namespace pslGraphicData {
pslButtons?: PslButton[];
pslKeys?: PslKey[];
pslTexts?: PslText[];
gatedRelateDeviceList?: GatedRelateDevice[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
@ -38,6 +39,9 @@ export namespace pslGraphicData {
if ("pslTexts" in data && data.pslTexts != undefined) {
this.pslTexts = data.pslTexts;
}
if ("gatedRelateDeviceList" in data && data.gatedRelateDeviceList != undefined) {
this.gatedRelateDeviceList = data.gatedRelateDeviceList;
}
}
}
get canvas() {
@ -73,12 +77,19 @@ export namespace pslGraphicData {
set pslTexts(value: PslText[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
get gatedRelateDeviceList() {
return pb_1.Message.getRepeatedWrapperField(this, GatedRelateDevice, 6) as GatedRelateDevice[];
}
set gatedRelateDeviceList(value: GatedRelateDevice[]) {
pb_1.Message.setRepeatedWrapperField(this, 6, value);
}
static fromObject(data: {
canvas?: ReturnType<typeof dependency_1.graphicData.Canvas.prototype.toObject>;
pslLights?: ReturnType<typeof PslLight.prototype.toObject>[];
pslButtons?: ReturnType<typeof PslButton.prototype.toObject>[];
pslKeys?: ReturnType<typeof PslKey.prototype.toObject>[];
pslTexts?: ReturnType<typeof PslText.prototype.toObject>[];
gatedRelateDeviceList?: ReturnType<typeof GatedRelateDevice.prototype.toObject>[];
}): PslGraphicStorage {
const message = new PslGraphicStorage({});
if (data.canvas != null) {
@ -96,6 +107,9 @@ export namespace pslGraphicData {
if (data.pslTexts != null) {
message.pslTexts = data.pslTexts.map(item => PslText.fromObject(item));
}
if (data.gatedRelateDeviceList != null) {
message.gatedRelateDeviceList = data.gatedRelateDeviceList.map(item => GatedRelateDevice.fromObject(item));
}
return message;
}
toObject() {
@ -105,6 +119,7 @@ export namespace pslGraphicData {
pslButtons?: ReturnType<typeof PslButton.prototype.toObject>[];
pslKeys?: ReturnType<typeof PslKey.prototype.toObject>[];
pslTexts?: ReturnType<typeof PslText.prototype.toObject>[];
gatedRelateDeviceList?: ReturnType<typeof GatedRelateDevice.prototype.toObject>[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@ -121,6 +136,9 @@ export namespace pslGraphicData {
if (this.pslTexts != null) {
data.pslTexts = this.pslTexts.map((item: PslText) => item.toObject());
}
if (this.gatedRelateDeviceList != null) {
data.gatedRelateDeviceList = this.gatedRelateDeviceList.map((item: GatedRelateDevice) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
@ -137,6 +155,8 @@ export namespace pslGraphicData {
writer.writeRepeatedMessage(4, this.pslKeys, (item: PslKey) => item.serialize(writer));
if (this.pslTexts.length)
writer.writeRepeatedMessage(5, this.pslTexts, (item: PslText) => item.serialize(writer));
if (this.gatedRelateDeviceList.length)
writer.writeRepeatedMessage(6, this.gatedRelateDeviceList, (item: GatedRelateDevice) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -161,6 +181,9 @@ export namespace pslGraphicData {
case 5:
reader.readMessage(message.pslTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 5, PslText.deserialize(reader), PslText));
break;
case 6:
reader.readMessage(message.gatedRelateDeviceList, () => pb_1.Message.addToRepeatedWrapperField(message, 6, GatedRelateDevice.deserialize(reader), GatedRelateDevice));
break;
default: reader.skipField();
}
}
@ -660,4 +683,207 @@ export namespace pslGraphicData {
return PslText.deserialize(bytes);
}
}
export class GatedRelateDevice extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
code?: string;
combinationtypes?: Combinationtype[];
deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("combinationtypes" in data && data.combinationtypes != undefined) {
this.combinationtypes = data.combinationtypes;
}
if ("deviceType" in data && data.deviceType != undefined) {
this.deviceType = data.deviceType;
}
}
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 1, value);
}
get combinationtypes() {
return pb_1.Message.getRepeatedWrapperField(this, Combinationtype, 2) as Combinationtype[];
}
set combinationtypes(value: Combinationtype[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
get deviceType() {
return pb_1.Message.getFieldWithDefault(this, 3, dependency_1.graphicData.RelatedRef.DeviceType.Section) as dependency_1.graphicData.RelatedRef.DeviceType;
}
set deviceType(value: dependency_1.graphicData.RelatedRef.DeviceType) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[];
deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
}): GatedRelateDevice {
const message = new GatedRelateDevice({});
if (data.code != null) {
message.code = data.code;
}
if (data.combinationtypes != null) {
message.combinationtypes = data.combinationtypes.map(item => Combinationtype.fromObject(item));
}
if (data.deviceType != null) {
message.deviceType = data.deviceType;
}
return message;
}
toObject() {
const data: {
code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[];
deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
} = {};
if (this.code != null) {
data.code = this.code;
}
if (this.combinationtypes != null) {
data.combinationtypes = this.combinationtypes.map((item: Combinationtype) => item.toObject());
}
if (this.deviceType != null) {
data.deviceType = this.deviceType;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.code.length)
writer.writeString(1, this.code);
if (this.combinationtypes.length)
writer.writeRepeatedMessage(2, this.combinationtypes, (item: Combinationtype) => item.serialize(writer));
if (this.deviceType != dependency_1.graphicData.RelatedRef.DeviceType.Section)
writer.writeEnum(3, this.deviceType);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GatedRelateDevice {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GatedRelateDevice();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.code = reader.readString();
break;
case 2:
reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Combinationtype.deserialize(reader), Combinationtype));
break;
case 3:
message.deviceType = reader.readEnum();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): GatedRelateDevice {
return GatedRelateDevice.deserialize(bytes);
}
}
export class Combinationtype extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
code?: string;
refDevices?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("refDevices" in data && data.refDevices != undefined) {
this.refDevices = data.refDevices;
}
}
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 1, value);
}
get refDevices() {
return pb_1.Message.getFieldWithDefault(this, 2, []) as string[];
}
set refDevices(value: string[]) {
pb_1.Message.setField(this, 2, value);
}
static fromObject(data: {
code?: string;
refDevices?: string[];
}): Combinationtype {
const message = new Combinationtype({});
if (data.code != null) {
message.code = data.code;
}
if (data.refDevices != null) {
message.refDevices = data.refDevices;
}
return message;
}
toObject() {
const data: {
code?: string;
refDevices?: string[];
} = {};
if (this.code != null) {
data.code = this.code;
}
if (this.refDevices != null) {
data.refDevices = this.refDevices;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.code.length)
writer.writeString(1, this.code);
if (this.refDevices.length)
writer.writeRepeatedString(2, this.refDevices);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Combinationtype {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Combinationtype();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.code = reader.readString();
break;
case 2:
pb_1.Message.addToRepeatedField(message, 2, reader.readString());
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): Combinationtype {
return Combinationtype.deserialize(bytes);
}
}
}

View File

@ -38,9 +38,11 @@ export namespace graphicData {
trackLogicSections?: TrackLogicSection[];
UniqueIdPrefix?: UniqueIdOfStationLayout;
kilometerConvertList?: KilometerConvert[];
screenDoors?: ScreenDoor[];
stationRelateDeviceList?: StationRelateDevice[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
@ -120,6 +122,12 @@ export namespace graphicData {
if ("kilometerConvertList" in data && data.kilometerConvertList != undefined) {
this.kilometerConvertList = data.kilometerConvertList;
}
if ("screenDoors" in data && data.screenDoors != undefined) {
this.screenDoors = data.screenDoors;
}
if ("stationRelateDeviceList" in data && data.stationRelateDeviceList != undefined) {
this.stationRelateDeviceList = data.stationRelateDeviceList;
}
}
}
get canvas() {
@ -284,6 +292,18 @@ export namespace graphicData {
set kilometerConvertList(value: KilometerConvert[]) {
pb_1.Message.setRepeatedWrapperField(this, 32, value);
}
get screenDoors() {
return pb_1.Message.getRepeatedWrapperField(this, ScreenDoor, 33) as ScreenDoor[];
}
set screenDoors(value: ScreenDoor[]) {
pb_1.Message.setRepeatedWrapperField(this, 33, value);
}
get stationRelateDeviceList() {
return pb_1.Message.getRepeatedWrapperField(this, StationRelateDevice, 34) as StationRelateDevice[];
}
set stationRelateDeviceList(value: StationRelateDevice[]) {
pb_1.Message.setRepeatedWrapperField(this, 34, value);
}
static fromObject(data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
Platforms?: ReturnType<typeof Platform.prototype.toObject>[];
@ -311,6 +331,8 @@ export namespace graphicData {
trackLogicSections?: ReturnType<typeof TrackLogicSection.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
kilometerConvertList?: ReturnType<typeof KilometerConvert.prototype.toObject>[];
screenDoors?: ReturnType<typeof ScreenDoor.prototype.toObject>[];
stationRelateDeviceList?: ReturnType<typeof StationRelateDevice.prototype.toObject>[];
}): RtssGraphicStorage {
const message = new RtssGraphicStorage({});
if (data.canvas != null) {
@ -391,6 +413,12 @@ export namespace graphicData {
if (data.kilometerConvertList != null) {
message.kilometerConvertList = data.kilometerConvertList.map(item => KilometerConvert.fromObject(item));
}
if (data.screenDoors != null) {
message.screenDoors = data.screenDoors.map(item => ScreenDoor.fromObject(item));
}
if (data.stationRelateDeviceList != null) {
message.stationRelateDeviceList = data.stationRelateDeviceList.map(item => StationRelateDevice.fromObject(item));
}
return message;
}
toObject() {
@ -421,6 +449,8 @@ export namespace graphicData {
trackLogicSections?: ReturnType<typeof TrackLogicSection.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
kilometerConvertList?: ReturnType<typeof KilometerConvert.prototype.toObject>[];
screenDoors?: ReturnType<typeof ScreenDoor.prototype.toObject>[];
stationRelateDeviceList?: ReturnType<typeof StationRelateDevice.prototype.toObject>[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@ -500,6 +530,12 @@ export namespace graphicData {
if (this.kilometerConvertList != null) {
data.kilometerConvertList = this.kilometerConvertList.map((item: KilometerConvert) => item.toObject());
}
if (this.screenDoors != null) {
data.screenDoors = this.screenDoors.map((item: ScreenDoor) => item.toObject());
}
if (this.stationRelateDeviceList != null) {
data.stationRelateDeviceList = this.stationRelateDeviceList.map((item: StationRelateDevice) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
@ -558,6 +594,10 @@ export namespace graphicData {
writer.writeMessage(31, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer));
if (this.kilometerConvertList.length)
writer.writeRepeatedMessage(32, this.kilometerConvertList, (item: KilometerConvert) => item.serialize(writer));
if (this.screenDoors.length)
writer.writeRepeatedMessage(33, this.screenDoors, (item: ScreenDoor) => item.serialize(writer));
if (this.stationRelateDeviceList.length)
writer.writeRepeatedMessage(34, this.stationRelateDeviceList, (item: StationRelateDevice) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -645,6 +685,12 @@ export namespace graphicData {
case 32:
reader.readMessage(message.kilometerConvertList, () => pb_1.Message.addToRepeatedWrapperField(message, 32, KilometerConvert.deserialize(reader), KilometerConvert));
break;
case 33:
reader.readMessage(message.screenDoors, () => pb_1.Message.addToRepeatedWrapperField(message, 33, ScreenDoor.deserialize(reader), ScreenDoor));
break;
case 34:
reader.readMessage(message.stationRelateDeviceList, () => pb_1.Message.addToRepeatedWrapperField(message, 34, StationRelateDevice.deserialize(reader), StationRelateDevice));
break;
default: reader.skipField();
}
}
@ -1268,14 +1314,11 @@ export namespace graphicData {
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
hasdoor?: boolean;
direction?: string;
index?: number;
refStation?: string;
sonDoorAmount?: number;
platformRef?: RelatedRef[];
}) {
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, [8], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -1283,20 +1326,11 @@ export namespace graphicData {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("hasdoor" in data && data.hasdoor != undefined) {
this.hasdoor = data.hasdoor;
}
if ("direction" in data && data.direction != undefined) {
this.direction = data.direction;
}
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
if ("refStation" in data && data.refStation != undefined) {
this.refStation = data.refStation;
}
if ("sonDoorAmount" in data && data.sonDoorAmount != undefined) {
this.sonDoorAmount = data.sonDoorAmount;
if ("platformRef" in data && data.platformRef != undefined) {
this.platformRef = data.platformRef;
}
}
}
@ -1315,44 +1349,23 @@ export namespace graphicData {
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get hasdoor() {
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
}
set hasdoor(value: boolean) {
pb_1.Message.setField(this, 3, value);
}
get direction() {
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
}
set direction(value: string) {
pb_1.Message.setField(this, 4, value);
}
get index() {
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
}
set index(value: number) {
pb_1.Message.setField(this, 5, value);
}
get refStation() {
return pb_1.Message.getFieldWithDefault(this, 8, "") as string;
get platformRef() {
return pb_1.Message.getRepeatedWrapperField(this, RelatedRef, 8) as RelatedRef[];
}
set refStation(value: string) {
pb_1.Message.setField(this, 8, value);
}
get sonDoorAmount() {
return pb_1.Message.getFieldWithDefault(this, 9, 0) as number;
}
set sonDoorAmount(value: number) {
pb_1.Message.setField(this, 9, value);
set platformRef(value: RelatedRef[]) {
pb_1.Message.setRepeatedWrapperField(this, 8, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
hasdoor?: boolean;
direction?: string;
index?: number;
refStation?: string;
sonDoorAmount?: number;
platformRef?: ReturnType<typeof RelatedRef.prototype.toObject>[];
}): Platform {
const message = new Platform({});
if (data.common != null) {
@ -1361,20 +1374,11 @@ export namespace graphicData {
if (data.code != null) {
message.code = data.code;
}
if (data.hasdoor != null) {
message.hasdoor = data.hasdoor;
}
if (data.direction != null) {
message.direction = data.direction;
}
if (data.index != null) {
message.index = data.index;
}
if (data.refStation != null) {
message.refStation = data.refStation;
}
if (data.sonDoorAmount != null) {
message.sonDoorAmount = data.sonDoorAmount;
if (data.platformRef != null) {
message.platformRef = data.platformRef.map(item => RelatedRef.fromObject(item));
}
return message;
}
@ -1382,11 +1386,8 @@ export namespace graphicData {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
hasdoor?: boolean;
direction?: string;
index?: number;
refStation?: string;
sonDoorAmount?: number;
platformRef?: ReturnType<typeof RelatedRef.prototype.toObject>[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -1394,20 +1395,11 @@ export namespace graphicData {
if (this.code != null) {
data.code = this.code;
}
if (this.hasdoor != null) {
data.hasdoor = this.hasdoor;
}
if (this.direction != null) {
data.direction = this.direction;
}
if (this.index != null) {
data.index = this.index;
}
if (this.refStation != null) {
data.refStation = this.refStation;
}
if (this.sonDoorAmount != null) {
data.sonDoorAmount = this.sonDoorAmount;
if (this.platformRef != null) {
data.platformRef = this.platformRef.map((item: RelatedRef) => item.toObject());
}
return data;
}
@ -1419,16 +1411,10 @@ export namespace graphicData {
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.hasdoor != false)
writer.writeBool(3, this.hasdoor);
if (this.direction.length)
writer.writeString(4, this.direction);
if (this.index != 0)
writer.writeInt32(5, this.index);
if (this.refStation.length)
writer.writeString(8, this.refStation);
if (this.sonDoorAmount != 0)
writer.writeInt32(9, this.sonDoorAmount);
if (this.platformRef.length)
writer.writeRepeatedMessage(8, this.platformRef, (item: RelatedRef) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -1444,20 +1430,11 @@ export namespace graphicData {
case 2:
message.code = reader.readString();
break;
case 3:
message.hasdoor = reader.readBool();
break;
case 4:
message.direction = reader.readString();
break;
case 5:
message.index = reader.readInt32();
break;
case 8:
message.refStation = reader.readString();
break;
case 9:
message.sonDoorAmount = reader.readInt32();
reader.readMessage(message.platformRef, () => pb_1.Message.addToRepeatedWrapperField(message, 8, RelatedRef.deserialize(reader), RelatedRef));
break;
default: reader.skipField();
}
@ -1471,6 +1448,281 @@ export namespace graphicData {
return Platform.deserialize(bytes);
}
}
export class ScreenDoor extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
sonDoorAmount?: number;
refPlatform?: string;
screenDoorGroupList?: ScreenDoorGroup[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [5], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("sonDoorAmount" in data && data.sonDoorAmount != undefined) {
this.sonDoorAmount = data.sonDoorAmount;
}
if ("refPlatform" in data && data.refPlatform != undefined) {
this.refPlatform = data.refPlatform;
}
if ("screenDoorGroupList" in data && data.screenDoorGroupList != undefined) {
this.screenDoorGroupList = data.screenDoorGroupList;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo;
}
set common(value: CommonInfo) {
pb_1.Message.setWrapperField(this, 1, value);
}
get has_common() {
return pb_1.Message.getField(this, 1) != null;
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get sonDoorAmount() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set sonDoorAmount(value: number) {
pb_1.Message.setField(this, 3, value);
}
get refPlatform() {
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
}
set refPlatform(value: string) {
pb_1.Message.setField(this, 4, value);
}
get screenDoorGroupList() {
return pb_1.Message.getRepeatedWrapperField(this, ScreenDoorGroup, 5) as ScreenDoorGroup[];
}
set screenDoorGroupList(value: ScreenDoorGroup[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
sonDoorAmount?: number;
refPlatform?: string;
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
}): ScreenDoor {
const message = new ScreenDoor({});
if (data.common != null) {
message.common = CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
if (data.sonDoorAmount != null) {
message.sonDoorAmount = data.sonDoorAmount;
}
if (data.refPlatform != null) {
message.refPlatform = data.refPlatform;
}
if (data.screenDoorGroupList != null) {
message.screenDoorGroupList = data.screenDoorGroupList.map(item => ScreenDoorGroup.fromObject(item));
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
sonDoorAmount?: number;
refPlatform?: string;
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
if (this.sonDoorAmount != null) {
data.sonDoorAmount = this.sonDoorAmount;
}
if (this.refPlatform != null) {
data.refPlatform = this.refPlatform;
}
if (this.screenDoorGroupList != null) {
data.screenDoorGroupList = this.screenDoorGroupList.map((item: ScreenDoorGroup) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.has_common)
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.sonDoorAmount != 0)
writer.writeInt32(3, this.sonDoorAmount);
if (this.refPlatform.length)
writer.writeString(4, this.refPlatform);
if (this.screenDoorGroupList.length)
writer.writeRepeatedMessage(5, this.screenDoorGroupList, (item: ScreenDoorGroup) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoor {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScreenDoor();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
case 3:
message.sonDoorAmount = reader.readInt32();
break;
case 4:
message.refPlatform = reader.readString();
break;
case 5:
reader.readMessage(message.screenDoorGroupList, () => pb_1.Message.addToRepeatedWrapperField(message, 5, ScreenDoorGroup.deserialize(reader), ScreenDoorGroup));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): ScreenDoor {
return ScreenDoor.deserialize(bytes);
}
}
export class ScreenDoorGroup extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
trainGroupAmount?: number;
startSmallDoor?: number;
endSmallDoor?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("trainGroupAmount" in data && data.trainGroupAmount != undefined) {
this.trainGroupAmount = data.trainGroupAmount;
}
if ("startSmallDoor" in data && data.startSmallDoor != undefined) {
this.startSmallDoor = data.startSmallDoor;
}
if ("endSmallDoor" in data && data.endSmallDoor != undefined) {
this.endSmallDoor = data.endSmallDoor;
}
}
}
get trainGroupAmount() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set trainGroupAmount(value: number) {
pb_1.Message.setField(this, 1, value);
}
get startSmallDoor() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set startSmallDoor(value: number) {
pb_1.Message.setField(this, 2, value);
}
get endSmallDoor() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set endSmallDoor(value: number) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
trainGroupAmount?: number;
startSmallDoor?: number;
endSmallDoor?: number;
}): ScreenDoorGroup {
const message = new ScreenDoorGroup({});
if (data.trainGroupAmount != null) {
message.trainGroupAmount = data.trainGroupAmount;
}
if (data.startSmallDoor != null) {
message.startSmallDoor = data.startSmallDoor;
}
if (data.endSmallDoor != null) {
message.endSmallDoor = data.endSmallDoor;
}
return message;
}
toObject() {
const data: {
trainGroupAmount?: number;
startSmallDoor?: number;
endSmallDoor?: number;
} = {};
if (this.trainGroupAmount != null) {
data.trainGroupAmount = this.trainGroupAmount;
}
if (this.startSmallDoor != null) {
data.startSmallDoor = this.startSmallDoor;
}
if (this.endSmallDoor != null) {
data.endSmallDoor = this.endSmallDoor;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.trainGroupAmount != 0)
writer.writeInt32(1, this.trainGroupAmount);
if (this.startSmallDoor != 0)
writer.writeInt32(2, this.startSmallDoor);
if (this.endSmallDoor != 0)
writer.writeInt32(3, this.endSmallDoor);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoorGroup {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScreenDoorGroup();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.trainGroupAmount = reader.readInt32();
break;
case 2:
message.startSmallDoor = reader.readInt32();
break;
case 3:
message.endSmallDoor = reader.readInt32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): ScreenDoorGroup {
return ScreenDoorGroup.deserialize(bytes);
}
}
export class Station extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
@ -3159,7 +3411,9 @@ export namespace graphicData {
TrainWindow = 2,
AxleCounting = 3,
SectionLink = 4,
signal = 5
signal = 5,
station = 6,
ScreenDoor = 7
}
export enum DevicePort {
A = 0,
@ -5322,6 +5576,7 @@ export namespace graphicData {
code?: string;
flip?: boolean;
index?: number;
refScreenDoor?: string;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -5338,6 +5593,9 @@ export namespace graphicData {
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
if ("refScreenDoor" in data && data.refScreenDoor != undefined) {
this.refScreenDoor = data.refScreenDoor;
}
}
}
get common() {
@ -5367,11 +5625,18 @@ export namespace graphicData {
set index(value: number) {
pb_1.Message.setField(this, 4, value);
}
get refScreenDoor() {
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
}
set refScreenDoor(value: string) {
pb_1.Message.setField(this, 5, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
flip?: boolean;
index?: number;
refScreenDoor?: string;
}): GatedBox {
const message = new GatedBox({});
if (data.common != null) {
@ -5386,6 +5651,9 @@ export namespace graphicData {
if (data.index != null) {
message.index = data.index;
}
if (data.refScreenDoor != null) {
message.refScreenDoor = data.refScreenDoor;
}
return message;
}
toObject() {
@ -5394,6 +5662,7 @@ export namespace graphicData {
code?: string;
flip?: boolean;
index?: number;
refScreenDoor?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -5407,6 +5676,9 @@ export namespace graphicData {
if (this.index != null) {
data.index = this.index;
}
if (this.refScreenDoor != null) {
data.refScreenDoor = this.refScreenDoor;
}
return data;
}
serialize(): Uint8Array;
@ -5421,6 +5693,8 @@ export namespace graphicData {
writer.writeBool(3, this.flip);
if (this.index != 0)
writer.writeInt32(4, this.index);
if (this.refScreenDoor.length)
writer.writeString(5, this.refScreenDoor);
if (!w)
return writer.getResultBuffer();
}
@ -5442,6 +5716,9 @@ export namespace graphicData {
case 4:
message.index = reader.readInt32();
break;
case 5:
message.refScreenDoor = reader.readString();
break;
default: reader.skipField();
}
}
@ -6502,4 +6779,207 @@ export namespace graphicData {
return KilometerConvert.deserialize(bytes);
}
}
export class StationRelateDevice extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
code?: string;
combinationtypes?: Combinationtype[];
deviceType?: RelatedRef.DeviceType;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("combinationtypes" in data && data.combinationtypes != undefined) {
this.combinationtypes = data.combinationtypes;
}
if ("deviceType" in data && data.deviceType != undefined) {
this.deviceType = data.deviceType;
}
}
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 1, value);
}
get combinationtypes() {
return pb_1.Message.getRepeatedWrapperField(this, Combinationtype, 2) as Combinationtype[];
}
set combinationtypes(value: Combinationtype[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
get deviceType() {
return pb_1.Message.getFieldWithDefault(this, 3, RelatedRef.DeviceType.Section) as RelatedRef.DeviceType;
}
set deviceType(value: RelatedRef.DeviceType) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[];
deviceType?: RelatedRef.DeviceType;
}): StationRelateDevice {
const message = new StationRelateDevice({});
if (data.code != null) {
message.code = data.code;
}
if (data.combinationtypes != null) {
message.combinationtypes = data.combinationtypes.map(item => Combinationtype.fromObject(item));
}
if (data.deviceType != null) {
message.deviceType = data.deviceType;
}
return message;
}
toObject() {
const data: {
code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[];
deviceType?: RelatedRef.DeviceType;
} = {};
if (this.code != null) {
data.code = this.code;
}
if (this.combinationtypes != null) {
data.combinationtypes = this.combinationtypes.map((item: Combinationtype) => item.toObject());
}
if (this.deviceType != null) {
data.deviceType = this.deviceType;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.code.length)
writer.writeString(1, this.code);
if (this.combinationtypes.length)
writer.writeRepeatedMessage(2, this.combinationtypes, (item: Combinationtype) => item.serialize(writer));
if (this.deviceType != RelatedRef.DeviceType.Section)
writer.writeEnum(3, this.deviceType);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StationRelateDevice {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StationRelateDevice();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.code = reader.readString();
break;
case 2:
reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Combinationtype.deserialize(reader), Combinationtype));
break;
case 3:
message.deviceType = reader.readEnum();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): StationRelateDevice {
return StationRelateDevice.deserialize(bytes);
}
}
export class Combinationtype extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
code?: string;
refDevices?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("refDevices" in data && data.refDevices != undefined) {
this.refDevices = data.refDevices;
}
}
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 1, value);
}
get refDevices() {
return pb_1.Message.getFieldWithDefault(this, 2, []) as string[];
}
set refDevices(value: string[]) {
pb_1.Message.setField(this, 2, value);
}
static fromObject(data: {
code?: string;
refDevices?: string[];
}): Combinationtype {
const message = new Combinationtype({});
if (data.code != null) {
message.code = data.code;
}
if (data.refDevices != null) {
message.refDevices = data.refDevices;
}
return message;
}
toObject() {
const data: {
code?: string;
refDevices?: string[];
} = {};
if (this.code != null) {
data.code = this.code;
}
if (this.refDevices != null) {
data.refDevices = this.refDevices;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.code.length)
writer.writeString(1, this.code);
if (this.refDevices.length)
writer.writeRepeatedString(2, this.refDevices);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Combinationtype {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Combinationtype();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.code = reader.readString();
break;
case 2:
pb_1.Message.addToRepeatedField(message, 2, reader.readString());
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): Combinationtype {
return Combinationtype.deserialize(bytes);
}
}
}

View File

@ -1,6 +1,7 @@
import { defineStore } from 'pinia';
import { getIBPDrawApp, initIBPDrawApp } from 'src/drawApp/ibpDrawApp';
import { DrawAssistant, IDrawApp, IJlCanvas, JlGraphic } from 'src/jl-graphic';
import { markRaw } from 'vue';
export const useIBPDrawStore = defineStore('ibpDraw', {
state: () => ({
@ -60,7 +61,7 @@ export const useIBPDrawStore = defineStore('ibpDraw', {
}
});
app.on('graphicselectedchange', () => {
this.selectedGraphics = app.selectedGraphics;
this.selectedGraphics = markRaw(app.selectedGraphics);
});
this.selectedGraphics = [];
return app;