ibp绘制增加关联设备管理

This commit is contained in:
Yuan 2023-10-13 14:02:52 +08:00
parent 56d857a7b1
commit c0b1d057ec
11 changed files with 847 additions and 369 deletions

@ -1 +1 @@
Subproject commit 5604ad84ed5c6af4206937f5bbba9b2debfbfb6f Subproject commit 7d027a7e5e284dc2f20e3380472efad533435ace

View File

@ -0,0 +1,135 @@
<script setup lang="ts">
import { QTable, useQuasar } from 'quasar';
import DraggableDialog from 'src/components/common/DraggableDialog.vue';
import {
RelateDevicelistItem,
deleteIbpRelateDevice,
loadIbpRelateDeviceList,
} from 'src/drawApp/ibpDrawApp';
import { useIBPDrawStore } from 'src/stores/ibp-draw-store';
import { errorNotify, successNotify } from 'src/utils/CommonNotify';
import { ref } from 'vue';
const $q = useQuasar();
const tableRef = ref<QTable>();
const rows = ref<RelateDevicelistItem[]>([]);
const loading = ref(false);
const pagination = ref({
sortBy: 'desc',
descending: false,
page: 1,
rowsPerPage: 10,
rowsNumber: 10,
});
const deviceTypeMap = {
6: '车站',
};
const columns: QTable['columns'] = [
{
name: 'deviceType',
label: '设备类型',
field: (row) => deviceTypeMap[row.deviceType as keyof typeof deviceTypeMap],
align: 'center',
},
{ name: 'code', label: '设备编号', field: 'code', align: 'center' },
{
name: 'combinationtypes',
label: '关联的组合类型',
field: (row: RelateDevicelistItem) => {
if (row.combinationtypes) {
return row.combinationtypes.map((type) => type.code).join('\\');
}
},
align: 'center',
},
{ name: 'operations', label: '操作', field: 'operations', align: 'center' },
];
const ibpDrawStore = useIBPDrawStore();
const onRequest: QTable['onRequest'] = async (props) => {
const { page, rowsPerPage } = props.pagination;
loading.value = true;
const data = loadIbpRelateDeviceList();
pagination.value.rowsNumber = data.length;
pagination.value.page = page;
pagination.value.rowsPerPage = rowsPerPage;
rows.value = data.slice((page - 1) * rowsPerPage, page * rowsPerPage);
loading.value = false;
};
const onDialogShow = () => {
tableRef.value?.requestServerInteraction();
ibpDrawStore.table = tableRef.value;
};
const props = defineProps<{
onEditClick: (row: RelateDevicelistItem) => void;
}>();
function onEdit(row: RelateDevicelistItem) {
ibpDrawStore.showRelateDeviceConfig = true;
setTimeout(() => {
props.onEditClick(row);
}, 0);
}
function createData() {
ibpDrawStore.showRelateDeviceConfig = true;
}
function deleteData(row: RelateDevicelistItem) {
$q.dialog({ message: `确定删除 "${row.code}" 吗?`, cancel: true }).onOk(
async () => {
try {
deleteIbpRelateDevice(row);
successNotify('删除数据成功!');
} catch (err) {
errorNotify('删除失败:', err);
} finally {
tableRef.value?.requestServerInteraction();
}
}
);
}
</script>
<template>
<DraggableDialog
seamless
@show="onDialogShow"
title="IBP关联的车站"
:width="600"
:height="0"
>
<template #footer>
<QTable
ref="tableRef"
ref_key="id"
v-model:pagination="pagination"
:rows="rows"
:columns="columns"
:loading="loading"
@request="onRequest"
:rows-per-page-options="[5, 10, 20, 50]"
>
<template v-slot:body-cell="props">
<QTd :props="props" class="custom-column">
{{ props.value }}
</QTd>
</template>
<template v-slot:body-cell-operations="props">
<QTd :props="props">
<div class="q-gutter-sm row justify-center">
<QBtn color="primary" label="编辑" @click="onEdit(props.row)" />
<QBtn color="red" label="删除" @click="deleteData(props.row)" />
</div>
</QTd> </template
></QTable>
</template>
<template #titleButton>
<QBtn
color="primary"
label="新建"
class="q-mr-md"
@click="createData"
></QBtn>
</template>
</DraggableDialog>
</template>
<style scoped></style>

View File

@ -0,0 +1,326 @@
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue';
import { QForm, useQuasar } from 'quasar';
import { JlGraphic } from 'src/jl-graphic';
import { useIBPDrawStore } from 'src/stores/ibp-draw-store';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { IbpAlarm } from 'src/graphics/ibpAlarm/IbpAlarm';
import { IBPButton } from 'src/graphics/IBPButton/IBPButton';
import { IbpKey } from 'src/graphics/ibpKey/IbpKey';
import { ibpGraphicData } from 'src/protos/ibpGraphics';
import {
editIbpRelateDevice,
createIbpRelateDevice,
RelateDevicelistItem,
} from 'src/drawApp/ibpDrawApp';
defineExpose({ editRelateDevices });
const ibpDrawStore = useIBPDrawStore();
const $q = useQuasar();
const showRangeConfig = ref(true);
const relateDeviceConfig = ref<{
deviceType: graphicData.RelatedRef.DeviceType | undefined;
code: string;
combinationtypes: {
code: string;
refDevices: string[];
refDevicesCode: string[];
expanded: boolean;
}[];
}>({
deviceType: undefined,
code: '',
combinationtypes: [
{ code: '组合类型', refDevices: [], refDevicesCode: [], expanded: false },
],
});
const handleState = ref('新建门控箱关联设备');
const optionsType = [
{ label: '车站', value: graphicData.RelatedRef.DeviceType.station },
];
let selectGraphic: JlGraphic[] = [];
watch(
() => ibpDrawStore.selectedGraphics,
(val) => {
if (val && val.length > 0 && clickIndex !== null) {
const selectFilter = ibpDrawStore.selectedGraphics?.filter(
(g) =>
g.type == IBPButton.Type ||
g.type == IbpAlarm.Type ||
g.type == IbpKey.Type
) as JlGraphic[];
selectGraphic.push(...selectFilter);
selectGraphic = Array.from(new Set(selectGraphic));
ibpDrawStore.getDrawApp().updateSelected(...selectGraphic);
relateDeviceConfig.value.combinationtypes[clickIndex].refDevicesCode =
selectGraphic.map((g) =>
(g as IBPButton | IbpAlarm | IbpKey).datas.code == ''
? g.id
: (g as IBPButton | IbpAlarm | IbpKey).datas.code
);
relateDeviceConfig.value.combinationtypes[clickIndex].refDevices =
selectGraphic.map((g) => g.id) as string[];
}
}
);
onMounted(() => {
onReset();
});
const myForm = ref<QForm | null>(null);
let editRow: RelateDevicelistItem;
let handle = ref('');
let handleError = ref('');
async function onSubmit() {
myForm.value?.validate().then(async (res) => {
if (res) {
try {
const combinationtypes: ibpGraphicData.Combinationtype[] = [];
relateDeviceConfig.value.combinationtypes.forEach((combinationtype) => {
combinationtypes.push(
new ibpGraphicData.Combinationtype({
code: combinationtype.code,
refDevices: combinationtype.refDevices,
})
);
});
const ibpRelateDevice = new ibpGraphicData.IbpRelatedDevice({
deviceType: relateDeviceConfig.value.deviceType,
code: relateDeviceConfig.value.code,
combinationtypes: combinationtypes,
});
if (handleState.value == '新建门控箱关联设备') {
handle.value = '创建成功';
handleError.value = '创建失败';
createIbpRelateDevice(ibpRelateDevice);
} else {
handle.value = '更新成功';
handleError.value = '更新失败';
editIbpRelateDevice(editRow, ibpRelateDevice);
}
ibpDrawStore.table?.requestServerInteraction();
$q.notify({
type: 'positive',
message: handle.value,
});
onReset();
showRangeConfig.value = false;
} catch (err) {
$q.notify({
type: 'negative',
message: handleError.value,
});
} finally {
setTimeout(() => {
showRangeConfig.value = true;
}, 0);
}
}
});
}
async function editRelateDevices(row: RelateDevicelistItem) {
try {
const drawApp = ibpDrawStore.getDrawApp();
handleState.value = '编辑门控箱关联设备';
selectGraphic = [];
drawApp.updateSelected();
editRow = row;
relateDeviceConfig.value.deviceType = row.deviceType;
relateDeviceConfig.value.code = row.code;
row.combinationtypes.forEach((combinationtype) => {
const refCode: string[] = [];
combinationtype.refDevices.forEach((id) => {
const g = drawApp.queryStore.queryById(id);
refCode.push(g.code);
});
combinationtype.refDevicesCode = refCode;
combinationtype.expanded = false;
});
relateDeviceConfig.value.combinationtypes = [];
row.combinationtypes.forEach((combinationtype) => {
const { code, refDevices, refDevicesCode, expanded } = combinationtype;
relateDeviceConfig.value.combinationtypes.push({
code,
refDevices,
refDevicesCode: refDevicesCode as string[],
expanded: expanded as boolean,
});
});
} catch (err) {
$q.notify({
type: 'negative',
message: '没有需要编辑的详细信息',
});
}
}
let clickIndex: null | number = null;
function toggleItem(index: number) {
const drawApp = ibpDrawStore.getDrawApp();
selectGraphic = [];
drawApp.updateSelected();
const combinationtypes = relateDeviceConfig.value.combinationtypes;
if (combinationtypes[index].expanded == true) {
clickIndex = index;
const select: JlGraphic[] = [];
combinationtypes[index].refDevices.forEach((id: string) => {
const g = drawApp.queryStore.queryById(id);
select.push(g);
});
drawApp.updateSelected(...select);
} else {
clickIndex = null;
}
}
function removeSelect(code: string) {
const clickTarget =
relateDeviceConfig.value.combinationtypes[clickIndex as number];
const removeIndex = clickTarget.refDevicesCode.findIndex(
(item) => item == code
);
selectGraphic.splice(removeIndex, 1);
clickTarget.refDevicesCode.splice(removeIndex, 1);
clickTarget.refDevices.splice(removeIndex, 1);
ibpDrawStore.getDrawApp().updateSelected(...selectGraphic);
}
function clearAllSelect(index: number) {
relateDeviceConfig.value.combinationtypes[index].refDevices = [];
relateDeviceConfig.value.combinationtypes[index].refDevicesCode = [];
clearAllSelectAtCanvas();
}
function clearAllSelectAtCanvas() {
selectGraphic = [];
ibpDrawStore.getDrawApp().updateSelected();
}
function addCombinationtype() {
relateDeviceConfig.value.combinationtypes.push({
code: '组合类型',
refDevices: [],
refDevicesCode: [],
expanded: false,
});
}
function deleteCombinationtype(index: number) {
relateDeviceConfig.value.combinationtypes.splice(index, 1);
clearAllSelectAtCanvas();
}
function onReset() {
clickIndex = null;
handleState.value = '新建门控箱关联设备';
relateDeviceConfig.value = {
deviceType: undefined,
code: '',
combinationtypes: [
{ code: '组合类型', refDevices: [], refDevicesCode: [], expanded: false },
],
};
clearAllSelectAtCanvas();
}
function goBack() {
onReset();
ibpDrawStore.showRelateDeviceConfig = false;
}
</script>
<template>
<div v-if="showRangeConfig">
<QCard class="q-gutter-sm q-pa-sm">
<QCardSection>
<div class="text-h6">{{ handleState }}</div>
</QCardSection>
<QSeparator inset></QSeparator>
<QForm ref="myForm" @submit="onSubmit" @reset="onReset">
<QSelect
outlined
v-model="relateDeviceConfig.deviceType"
:options="optionsType"
label="设备类型"
:map-options="true"
:emit-value="true"
:rules="[(val) => val != '' || '设备类型不能为空']"
/>
<QInput
outlined
label="设备编号"
v-model="relateDeviceConfig.code"
:rules="[(val) => val.trim() != '' || '名称不能为空']"
/>
<QList bordered separator class="rounded-borders">
<QExpansionItem
expand-separator
v-for="(
combinationtype, index
) in relateDeviceConfig.combinationtypes"
:key="index"
v-model="combinationtype.expanded"
:label="combinationtype.code"
@click="toggleItem(index)"
>
<QCard>
<QItem>
<QItemSection no-wrap class="q-gutter-y-sm column">
<QInput
outlined
v-model="combinationtype.code"
label="组合类型"
lazy-rules
/>
<div class="q-gutter-sm row">
<QChip
v-for="item in combinationtype.refDevicesCode"
:key="item"
square
color="primary"
text-color="white"
removable
@remove="removeSelect(item)"
>
{{ item }}
</QChip>
</div>
<div>
<QBtn
v-show="combinationtype.refDevicesCode.length > 0"
style="width: 130px"
label="清空框选的设备"
color="red"
class="q-mr-md"
@click="clearAllSelect(index)"
/>
<QBtn
label="删除组合类型"
color="secondary"
@click="deleteCombinationtype(index)"
/>
</div>
</QItemSection>
</QItem>
</QCard>
</QExpansionItem>
</QList>
<QBtn
class="q-mt-md"
label="增加组合类型"
color="secondary"
@click="addCombinationtype"
/>
<div class="q-gutter-sm q-pa-md row justify-center">
<QBtn label="提交" type="submit" color="primary" class="q-mr-md" />
<QBtn label="重置" type="reset" color="primary" class="q-mr-md" />
<QBtn label="返回" color="primary" @click="goBack" />
</div>
</QForm>
</QCard>
</div>
</template>

View File

@ -106,18 +106,6 @@ export function initIBPDrawApp() {
return drawApp; 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) { export function saveIBPDrawToServer(app: IDrawApp) {
const base64 = saveIBPDrawDatas(app); const base64 = saveIBPDrawDatas(app);
const ibpDrawStore = useIBPDrawStore(); const ibpDrawStore = useIBPDrawStore();
@ -156,7 +144,6 @@ export function saveIBPDrawDatas(app: IDrawApp) {
storage.IBPTexts.push(g.saveData<IbpTextData>().data); storage.IBPTexts.push(g.saveData<IbpTextData>().data);
} }
}); });
storage.UniqueIdPrefix = uniqueIdPrefix;
const base64 = fromUint8Array(storage.serialize()); const base64 = fromUint8Array(storage.serialize());
return base64; return base64;
} }
@ -188,9 +175,6 @@ async function IBPDrawDataLoader() {
storage.IBPTexts.forEach((ibpText) => { storage.IBPTexts.forEach((ibpText) => {
datas.push(new IbpTextData(ibpText)); datas.push(new IbpTextData(ibpText));
}); });
if (storage.UniqueIdPrefix) {
setUniqueIdPrefix(storage.UniqueIdPrefix);
}
return { return {
canvasProperty: storage.canvas, canvasProperty: storage.canvas,
datas: datas, datas: datas,
@ -201,3 +185,52 @@ async function IBPDrawDataLoader() {
}); });
} }
} }
export interface RelateDevicelistItem {
deviceType: graphicData.RelatedRef.DeviceType | undefined;
code: string;
combinationtypes: {
code: string;
refDevices: string[];
refDevicesCode?: string[];
expanded?: boolean;
}[];
}
const refDevicesList: ibpGraphicData.IbpRelatedDevice[] = [];
export function loadIbpRelateDeviceList() {
return refDevicesList;
}
export function createIbpRelateDevice(row: ibpGraphicData.IbpRelatedDevice) {
refDevicesList.push(row);
drawApp?.emit('postdataloaded');
}
export function editIbpRelateDevice(
editRow: RelateDevicelistItem,
newData: ibpGraphicData.IbpRelatedDevice
) {
for (let i = 0; i < refDevicesList.length; i++) {
if (
refDevicesList[i].deviceType == editRow.deviceType &&
refDevicesList[i].code == editRow.code
) {
refDevicesList[i] = newData;
break;
}
}
drawApp?.emit('postdataloaded');
}
export function deleteIbpRelateDevice(row: RelateDevicelistItem) {
for (let i = 0; i < refDevicesList.length; i++) {
if (
refDevicesList[i].deviceType == row.deviceType &&
refDevicesList[i].code == row.code
) {
refDevicesList.splice(i, 1);
break;
}
}
}

View File

@ -35,7 +35,6 @@ export class IBPButton extends JlGraphic {
} }
doRepaint(): void { doRepaint(): void {
console.log(1);
this.sprite.texture = this.textures.get(this.datas.color, false, false); this.sprite.texture = this.textures.get(this.datas.color, false, false);
} }
} }

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, reactive, ref, shallowRef, toRaw, watch } from 'vue'; import { onMounted, reactive, ref, watch } from 'vue';
import { useIBPDrawStore } from '../stores/ibp-draw-store'; import { useIBPDrawStore } from '../stores/ibp-draw-store';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { IBPButton } from 'src/graphics/IBPButton/IBPButton'; import { IBPButton } from 'src/graphics/IBPButton/IBPButton';
@ -8,14 +8,14 @@ import { IbpKey } from 'src/graphics/ibpKey/IbpKey';
import { Arrow } from 'src/graphics/arrow/Arrow'; import { Arrow } from 'src/graphics/arrow/Arrow';
import { TextContent } from 'src/graphics/textContent/TextContent'; import { TextContent } from 'src/graphics/textContent/TextContent';
import { import {
RelateDevicelistItem,
getIBPDrawApp, getIBPDrawApp,
saveIBPDrawToServer, saveIBPDrawToServer,
loadUniqueIdPrefix,
setUniqueIdPrefix,
saveIBPDrawDatas,
} from 'src/drawApp/ibpDrawApp'; } from 'src/drawApp/ibpDrawApp';
import IbpDrawProperties from 'src/components/draw-app/IbpDrawProperties.vue'; import IbpDrawProperties from 'src/components/draw-app/IbpDrawProperties.vue';
import { ibpGraphicData } from 'src/protos/ibpGraphics'; import { DialogChainObject, useQuasar } from 'quasar';
import IBpRelatedDeviceList from 'src/components/draw-app/dialogs/IBpRelatedDeviceList.vue';
import RelateIbpConfig from 'src/components/draw-app/properties/RelateIbpConfig.vue';
const ibpDrawStore = useIBPDrawStore(); const ibpDrawStore = useIBPDrawStore();
const route = useRoute(); const route = useRoute();
@ -127,22 +127,29 @@ function saveData() {
} }
} }
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() { function backConfirm() {
router.go(-1); router.go(-1);
} }
const $q = useQuasar();
let relateDeviceDialogInstance: DialogChainObject | null = null;
const relateDeviceConfigEdit = ref<InstanceType<typeof RelateIbpConfig>>();
function openDeviceRelateList() {
if (relateDeviceDialogInstance) return;
relateDeviceDialogInstance = $q
.dialog({
component: IBpRelatedDeviceList,
componentProps: {
onEditClick: (row: RelateDevicelistItem) => {
relateDeviceConfigEdit.value?.editRelateDevices(row);
},
},
})
.onCancel(() => {
relateDeviceDialogInstance = null;
});
}
</script> </script>
<template> <template>
@ -156,13 +163,6 @@ function backConfirm() {
<QItem clickable @click="saveData" v-close-popup> <QItem clickable @click="saveData" v-close-popup>
<QItemSection>保存</QItemSection> <QItemSection>保存</QItemSection>
</QItem> </QItem>
<QItem
clickable
@click="openUniqueIdPrefixDialog"
v-close-popup
>
<QItemSection>UniqueId配置</QItemSection>
</QItem>
</QList> </QList>
</QMenu> </QMenu>
</QBtn> </QBtn>
@ -185,6 +185,19 @@ function backConfirm() {
</template></QBtnToggle </template></QBtnToggle
> >
</QToolbarTitle> </QToolbarTitle>
<QBtnDropdown
color="orange"
label="数据管理"
style="margin-right: 10px"
>
<QList>
<QItem clickable v-close-popup @click="openDeviceRelateList">
<QItemSection>
<QItemLabel>关联设备列表</QItemLabel>
</QItemSection>
</QItem>
</QList>
</QBtnDropdown>
<QBtn color="info" label="返回" @click="backConfirm" /> <QBtn color="info" label="返回" @click="backConfirm" />
<QBtn dense flat round icon="menu" @click="toggleRightDrawer" /> <QBtn dense flat round icon="menu" @click="toggleRightDrawer" />
</QToolbar> </QToolbar>
@ -192,47 +205,11 @@ function backConfirm() {
</QHeader> </QHeader>
<QDrawer show-if-above bordered v-model="rightDrawerOpen" side="right"> <QDrawer show-if-above bordered v-model="rightDrawerOpen" side="right">
<QResizeObserver @resize="onRightResize" /> <QResizeObserver @resize="onRightResize" />
<IbpDrawProperties /> <IbpDrawProperties v-if="!ibpDrawStore.showRelateDeviceConfig" />
<RelateIbpConfig v-else ref="relateDeviceConfigEdit" />
</QDrawer> </QDrawer>
<QPageContainer> <QPageContainer>
<div id="draw-app-container" class="overflow-hidden"></div> <div id="draw-app-container" class="overflow-hidden"></div>
</QPageContainer> </QPageContainer>
</QLayout> </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> </template>

View File

@ -440,6 +440,58 @@ export namespace state {
return SignalState.deserialize(bytes); return SignalState.deserialize(bytes);
} }
} }
export class Signal extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { }
}
static fromObject(data: {}): Signal {
const message = new Signal({});
return message;
}
toObject() {
const data: {} = {};
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 (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signal {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Signal();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): Signal {
return Signal.deserialize(bytes);
}
}
export namespace Signal {
export enum Aspect {
OFF = 0,
ON = 1,
L = 2,
H = 3,
U = 4,
HU = 5,
B = 6,
A = 7
}
}
export class PlatformState extends pb_1.Message { export class PlatformState extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {

View File

@ -15,10 +15,10 @@ export namespace ibpGraphicData {
ibpKeys?: IbpKey[]; ibpKeys?: IbpKey[];
ibpArrows?: IbpArrow[]; ibpArrows?: IbpArrow[];
IBPTexts?: IBPText[]; IBPTexts?: IBPText[];
UniqueIdPrefix?: UniqueIdType; ibpRelatedDevices?: IbpRelatedDevice[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 8], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) { if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas; this.canvas = data.canvas;
@ -38,8 +38,8 @@ export namespace ibpGraphicData {
if ("IBPTexts" in data && data.IBPTexts != undefined) { if ("IBPTexts" in data && data.IBPTexts != undefined) {
this.IBPTexts = data.IBPTexts; this.IBPTexts = data.IBPTexts;
} }
if ("UniqueIdPrefix" in data && data.UniqueIdPrefix != undefined) { if ("ibpRelatedDevices" in data && data.ibpRelatedDevices != undefined) {
this.UniqueIdPrefix = data.UniqueIdPrefix; this.ibpRelatedDevices = data.ibpRelatedDevices;
} }
} }
} }
@ -82,14 +82,11 @@ export namespace ibpGraphicData {
set IBPTexts(value: IBPText[]) { set IBPTexts(value: IBPText[]) {
pb_1.Message.setRepeatedWrapperField(this, 6, value); pb_1.Message.setRepeatedWrapperField(this, 6, value);
} }
get UniqueIdPrefix() { get ibpRelatedDevices() {
return pb_1.Message.getWrapperField(this, UniqueIdType, 7) as UniqueIdType; return pb_1.Message.getRepeatedWrapperField(this, IbpRelatedDevice, 8) as IbpRelatedDevice[];
} }
set UniqueIdPrefix(value: UniqueIdType) { set ibpRelatedDevices(value: IbpRelatedDevice[]) {
pb_1.Message.setWrapperField(this, 7, value); pb_1.Message.setRepeatedWrapperField(this, 8, value);
}
get has_UniqueIdPrefix() {
return pb_1.Message.getField(this, 7) != null;
} }
static fromObject(data: { static fromObject(data: {
canvas?: ReturnType<typeof dependency_1.graphicData.Canvas.prototype.toObject>; canvas?: ReturnType<typeof dependency_1.graphicData.Canvas.prototype.toObject>;
@ -98,7 +95,7 @@ export namespace ibpGraphicData {
ibpKeys?: ReturnType<typeof IbpKey.prototype.toObject>[]; ibpKeys?: ReturnType<typeof IbpKey.prototype.toObject>[];
ibpArrows?: ReturnType<typeof IbpArrow.prototype.toObject>[]; ibpArrows?: ReturnType<typeof IbpArrow.prototype.toObject>[];
IBPTexts?: ReturnType<typeof IBPText.prototype.toObject>[]; IBPTexts?: ReturnType<typeof IBPText.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>; ibpRelatedDevices?: ReturnType<typeof IbpRelatedDevice.prototype.toObject>[];
}): IBPGraphicStorage { }): IBPGraphicStorage {
const message = new IBPGraphicStorage({}); const message = new IBPGraphicStorage({});
if (data.canvas != null) { if (data.canvas != null) {
@ -119,8 +116,8 @@ export namespace ibpGraphicData {
if (data.IBPTexts != null) { if (data.IBPTexts != null) {
message.IBPTexts = data.IBPTexts.map(item => IBPText.fromObject(item)); message.IBPTexts = data.IBPTexts.map(item => IBPText.fromObject(item));
} }
if (data.UniqueIdPrefix != null) { if (data.ibpRelatedDevices != null) {
message.UniqueIdPrefix = UniqueIdType.fromObject(data.UniqueIdPrefix); message.ibpRelatedDevices = data.ibpRelatedDevices.map(item => IbpRelatedDevice.fromObject(item));
} }
return message; return message;
} }
@ -132,7 +129,7 @@ export namespace ibpGraphicData {
ibpKeys?: ReturnType<typeof IbpKey.prototype.toObject>[]; ibpKeys?: ReturnType<typeof IbpKey.prototype.toObject>[];
ibpArrows?: ReturnType<typeof IbpArrow.prototype.toObject>[]; ibpArrows?: ReturnType<typeof IbpArrow.prototype.toObject>[];
IBPTexts?: ReturnType<typeof IBPText.prototype.toObject>[]; IBPTexts?: ReturnType<typeof IBPText.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>; ibpRelatedDevices?: ReturnType<typeof IbpRelatedDevice.prototype.toObject>[];
} = {}; } = {};
if (this.canvas != null) { if (this.canvas != null) {
data.canvas = this.canvas.toObject(); data.canvas = this.canvas.toObject();
@ -152,8 +149,8 @@ export namespace ibpGraphicData {
if (this.IBPTexts != null) { if (this.IBPTexts != null) {
data.IBPTexts = this.IBPTexts.map((item: IBPText) => item.toObject()); data.IBPTexts = this.IBPTexts.map((item: IBPText) => item.toObject());
} }
if (this.UniqueIdPrefix != null) { if (this.ibpRelatedDevices != null) {
data.UniqueIdPrefix = this.UniqueIdPrefix.toObject(); data.ibpRelatedDevices = this.ibpRelatedDevices.map((item: IbpRelatedDevice) => item.toObject());
} }
return data; return data;
} }
@ -173,8 +170,8 @@ export namespace ibpGraphicData {
writer.writeRepeatedMessage(5, this.ibpArrows, (item: IbpArrow) => item.serialize(writer)); writer.writeRepeatedMessage(5, this.ibpArrows, (item: IbpArrow) => item.serialize(writer));
if (this.IBPTexts.length) if (this.IBPTexts.length)
writer.writeRepeatedMessage(6, this.IBPTexts, (item: IBPText) => item.serialize(writer)); writer.writeRepeatedMessage(6, this.IBPTexts, (item: IBPText) => item.serialize(writer));
if (this.has_UniqueIdPrefix) if (this.ibpRelatedDevices.length)
writer.writeMessage(7, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer)); writer.writeRepeatedMessage(8, this.ibpRelatedDevices, (item: IbpRelatedDevice) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -202,8 +199,8 @@ export namespace ibpGraphicData {
case 6: case 6:
reader.readMessage(message.IBPTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 6, IBPText.deserialize(reader), IBPText)); reader.readMessage(message.IBPTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 6, IBPText.deserialize(reader), IBPText));
break; break;
case 7: case 8:
reader.readMessage(message.UniqueIdPrefix, () => message.UniqueIdPrefix = UniqueIdType.deserialize(reader)); reader.readMessage(message.ibpRelatedDevices, () => pb_1.Message.addToRepeatedWrapperField(message, 8, IbpRelatedDevice.deserialize(reader), IbpRelatedDevice));
break; break;
default: reader.skipField(); default: reader.skipField();
} }
@ -713,102 +710,12 @@ export namespace ibpGraphicData {
return IbpKey.deserialize(bytes); return IbpKey.deserialize(bytes);
} }
} }
export class Point extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
x?: number;
y?: 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 ("x" in data && data.x != undefined) {
this.x = data.x;
}
if ("y" in data && data.y != undefined) {
this.y = data.y;
}
}
}
get x() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set x(value: number) {
pb_1.Message.setField(this, 1, value);
}
get y() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set y(value: number) {
pb_1.Message.setField(this, 2, value);
}
static fromObject(data: {
x?: number;
y?: number;
}): Point {
const message = new Point({});
if (data.x != null) {
message.x = data.x;
}
if (data.y != null) {
message.y = data.y;
}
return message;
}
toObject() {
const data: {
x?: number;
y?: number;
} = {};
if (this.x != null) {
data.x = this.x;
}
if (this.y != null) {
data.y = this.y;
}
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.x != 0)
writer.writeFloat(1, this.x);
if (this.y != 0)
writer.writeFloat(2, this.y);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Point {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Point();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.x = reader.readFloat();
break;
case 2:
message.y = reader.readFloat();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): Point {
return Point.deserialize(bytes);
}
}
export class IbpArrow extends pb_1.Message { export class IbpArrow extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
common?: dependency_1.graphicData.CommonInfo; common?: dependency_1.graphicData.CommonInfo;
code?: string; code?: string;
points?: Point[]; points?: dependency_1.graphicData.Point[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
@ -840,15 +747,15 @@ export namespace ibpGraphicData {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get points() { get points() {
return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.Point, 3) as dependency_1.graphicData.Point[];
} }
set points(value: Point[]) { set points(value: dependency_1.graphicData.Point[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value); pb_1.Message.setRepeatedWrapperField(this, 3, value);
} }
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>; common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string; code?: string;
points?: ReturnType<typeof Point.prototype.toObject>[]; points?: ReturnType<typeof dependency_1.graphicData.Point.prototype.toObject>[];
}): IbpArrow { }): IbpArrow {
const message = new IbpArrow({}); const message = new IbpArrow({});
if (data.common != null) { if (data.common != null) {
@ -858,7 +765,7 @@ export namespace ibpGraphicData {
message.code = data.code; message.code = data.code;
} }
if (data.points != null) { if (data.points != null) {
message.points = data.points.map(item => Point.fromObject(item)); message.points = data.points.map(item => dependency_1.graphicData.Point.fromObject(item));
} }
return message; return message;
} }
@ -866,7 +773,7 @@ export namespace ibpGraphicData {
const data: { const data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>; common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string; code?: string;
points?: ReturnType<typeof Point.prototype.toObject>[]; points?: ReturnType<typeof dependency_1.graphicData.Point.prototype.toObject>[];
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -875,7 +782,7 @@ export namespace ibpGraphicData {
data.code = this.code; data.code = this.code;
} }
if (this.points != null) { if (this.points != null) {
data.points = this.points.map((item: Point) => item.toObject()); data.points = this.points.map((item: dependency_1.graphicData.Point) => item.toObject());
} }
return data; return data;
} }
@ -888,7 +795,7 @@ export namespace ibpGraphicData {
if (this.code.length) if (this.code.length)
writer.writeString(2, this.code); writer.writeString(2, this.code);
if (this.points.length) if (this.points.length)
writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer)); writer.writeRepeatedMessage(3, this.points, (item: dependency_1.graphicData.Point) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -905,7 +812,7 @@ export namespace ibpGraphicData {
message.code = reader.readString(); message.code = reader.readString();
break; break;
case 3: case 3:
reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point)); reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.graphicData.Point.deserialize(reader), dependency_1.graphicData.Point));
break; break;
default: reader.skipField(); default: reader.skipField();
} }
@ -919,76 +826,76 @@ export namespace ibpGraphicData {
return IbpArrow.deserialize(bytes); return IbpArrow.deserialize(bytes);
} }
} }
export class UniqueIdType extends pb_1.Message { export class IbpRelatedDevice extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
city?: string; code?: string;
lineId?: string; combinationtypes?: Combinationtype[];
belongsStation?: string; deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
}) { }) {
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, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("city" in data && data.city != undefined) { if ("code" in data && data.code != undefined) {
this.city = data.city; this.code = data.code;
} }
if ("lineId" in data && data.lineId != undefined) { if ("combinationtypes" in data && data.combinationtypes != undefined) {
this.lineId = data.lineId; this.combinationtypes = data.combinationtypes;
} }
if ("belongsStation" in data && data.belongsStation != undefined) { if ("deviceType" in data && data.deviceType != undefined) {
this.belongsStation = data.belongsStation; this.deviceType = data.deviceType;
} }
} }
} }
get city() { get code() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set city(value: string) { set code(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get lineId() { get combinationtypes() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string; return pb_1.Message.getRepeatedWrapperField(this, Combinationtype, 2) as Combinationtype[];
} }
set lineId(value: string) { set combinationtypes(value: Combinationtype[]) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setRepeatedWrapperField(this, 2, value);
} }
get belongsStation() { get deviceType() {
return pb_1.Message.getFieldWithDefault(this, 3, "") as string; return pb_1.Message.getFieldWithDefault(this, 3, dependency_1.graphicData.RelatedRef.DeviceType.Section) as dependency_1.graphicData.RelatedRef.DeviceType;
} }
set belongsStation(value: string) { set deviceType(value: dependency_1.graphicData.RelatedRef.DeviceType) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
static fromObject(data: { static fromObject(data: {
city?: string; code?: string;
lineId?: string; combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[];
belongsStation?: string; deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
}): UniqueIdType { }): IbpRelatedDevice {
const message = new UniqueIdType({}); const message = new IbpRelatedDevice({});
if (data.city != null) { if (data.code != null) {
message.city = data.city; message.code = data.code;
} }
if (data.lineId != null) { if (data.combinationtypes != null) {
message.lineId = data.lineId; message.combinationtypes = data.combinationtypes.map(item => Combinationtype.fromObject(item));
} }
if (data.belongsStation != null) { if (data.deviceType != null) {
message.belongsStation = data.belongsStation; message.deviceType = data.deviceType;
} }
return message; return message;
} }
toObject() { toObject() {
const data: { const data: {
city?: string; code?: string;
lineId?: string; combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[];
belongsStation?: string; deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
} = {}; } = {};
if (this.city != null) { if (this.code != null) {
data.city = this.city; data.code = this.code;
} }
if (this.lineId != null) { if (this.combinationtypes != null) {
data.lineId = this.lineId; data.combinationtypes = this.combinationtypes.map((item: Combinationtype) => item.toObject());
} }
if (this.belongsStation != null) { if (this.deviceType != null) {
data.belongsStation = this.belongsStation; data.deviceType = this.deviceType;
} }
return data; return data;
} }
@ -996,29 +903,29 @@ export namespace ibpGraphicData {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.city.length) if (this.code.length)
writer.writeString(1, this.city); writer.writeString(1, this.code);
if (this.lineId.length) if (this.combinationtypes.length)
writer.writeString(2, this.lineId); writer.writeRepeatedMessage(2, this.combinationtypes, (item: Combinationtype) => item.serialize(writer));
if (this.belongsStation.length) if (this.deviceType != dependency_1.graphicData.RelatedRef.DeviceType.Section)
writer.writeString(3, this.belongsStation); writer.writeEnum(3, this.deviceType);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UniqueIdType { static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IbpRelatedDevice {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UniqueIdType(); const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IbpRelatedDevice();
while (reader.nextField()) { while (reader.nextField()) {
if (reader.isEndGroup()) if (reader.isEndGroup())
break; break;
switch (reader.getFieldNumber()) { switch (reader.getFieldNumber()) {
case 1: case 1:
message.city = reader.readString(); message.code = reader.readString();
break; break;
case 2: case 2:
message.lineId = reader.readString(); reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Combinationtype.deserialize(reader), Combinationtype));
break; break;
case 3: case 3:
message.belongsStation = reader.readString(); message.deviceType = reader.readEnum();
break; break;
default: reader.skipField(); default: reader.skipField();
} }
@ -1028,8 +935,98 @@ export namespace ibpGraphicData {
serializeBinary(): Uint8Array { serializeBinary(): Uint8Array {
return this.serialize(); return this.serialize();
} }
static deserializeBinary(bytes: Uint8Array): UniqueIdType { static deserializeBinary(bytes: Uint8Array): IbpRelatedDevice {
return UniqueIdType.deserialize(bytes); return IbpRelatedDevice.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

@ -687,7 +687,7 @@ export namespace pslGraphicData {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
code?: string; code?: string;
combinationtypes?: Combinationtype[]; combinationtypes?: dependency_1.graphicData.DeviceCombinationtype[];
deviceType?: dependency_1.graphicData.RelatedRef.DeviceType; deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
}) { }) {
super(); super();
@ -711,9 +711,9 @@ export namespace pslGraphicData {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get combinationtypes() { get combinationtypes() {
return pb_1.Message.getRepeatedWrapperField(this, Combinationtype, 2) as Combinationtype[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.DeviceCombinationtype, 2) as dependency_1.graphicData.DeviceCombinationtype[];
} }
set combinationtypes(value: Combinationtype[]) { set combinationtypes(value: dependency_1.graphicData.DeviceCombinationtype[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value); pb_1.Message.setRepeatedWrapperField(this, 2, value);
} }
get deviceType() { get deviceType() {
@ -724,7 +724,7 @@ export namespace pslGraphicData {
} }
static fromObject(data: { static fromObject(data: {
code?: string; code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[]; combinationtypes?: ReturnType<typeof dependency_1.graphicData.DeviceCombinationtype.prototype.toObject>[];
deviceType?: dependency_1.graphicData.RelatedRef.DeviceType; deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
}): GatedRelateDevice { }): GatedRelateDevice {
const message = new GatedRelateDevice({}); const message = new GatedRelateDevice({});
@ -732,7 +732,7 @@ export namespace pslGraphicData {
message.code = data.code; message.code = data.code;
} }
if (data.combinationtypes != null) { if (data.combinationtypes != null) {
message.combinationtypes = data.combinationtypes.map(item => Combinationtype.fromObject(item)); message.combinationtypes = data.combinationtypes.map(item => dependency_1.graphicData.DeviceCombinationtype.fromObject(item));
} }
if (data.deviceType != null) { if (data.deviceType != null) {
message.deviceType = data.deviceType; message.deviceType = data.deviceType;
@ -742,14 +742,14 @@ export namespace pslGraphicData {
toObject() { toObject() {
const data: { const data: {
code?: string; code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[]; combinationtypes?: ReturnType<typeof dependency_1.graphicData.DeviceCombinationtype.prototype.toObject>[];
deviceType?: dependency_1.graphicData.RelatedRef.DeviceType; deviceType?: dependency_1.graphicData.RelatedRef.DeviceType;
} = {}; } = {};
if (this.code != null) { if (this.code != null) {
data.code = this.code; data.code = this.code;
} }
if (this.combinationtypes != null) { if (this.combinationtypes != null) {
data.combinationtypes = this.combinationtypes.map((item: Combinationtype) => item.toObject()); data.combinationtypes = this.combinationtypes.map((item: dependency_1.graphicData.DeviceCombinationtype) => item.toObject());
} }
if (this.deviceType != null) { if (this.deviceType != null) {
data.deviceType = this.deviceType; data.deviceType = this.deviceType;
@ -763,7 +763,7 @@ export namespace pslGraphicData {
if (this.code.length) if (this.code.length)
writer.writeString(1, this.code); writer.writeString(1, this.code);
if (this.combinationtypes.length) if (this.combinationtypes.length)
writer.writeRepeatedMessage(2, this.combinationtypes, (item: Combinationtype) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.combinationtypes, (item: dependency_1.graphicData.DeviceCombinationtype) => item.serialize(writer));
if (this.deviceType != dependency_1.graphicData.RelatedRef.DeviceType.Section) if (this.deviceType != dependency_1.graphicData.RelatedRef.DeviceType.Section)
writer.writeEnum(3, this.deviceType); writer.writeEnum(3, this.deviceType);
if (!w) if (!w)
@ -779,7 +779,7 @@ export namespace pslGraphicData {
message.code = reader.readString(); message.code = reader.readString();
break; break;
case 2: case 2:
reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Combinationtype.deserialize(reader), Combinationtype)); reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_1.graphicData.DeviceCombinationtype.deserialize(reader), dependency_1.graphicData.DeviceCombinationtype));
break; break;
case 3: case 3:
message.deviceType = reader.readEnum(); message.deviceType = reader.readEnum();
@ -796,94 +796,4 @@ export namespace pslGraphicData {
return GatedRelateDevice.deserialize(bytes); 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

@ -1731,6 +1731,7 @@ export namespace graphicData {
concentrationStations?: boolean; concentrationStations?: boolean;
kilometerSystem?: KilometerSystem; kilometerSystem?: KilometerSystem;
index?: number; index?: number;
refIbpMapCode?: string;
}) { }) {
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, [], this.#one_of_decls);
@ -1750,6 +1751,9 @@ export namespace graphicData {
if ("index" in data && data.index != undefined) { if ("index" in data && data.index != undefined) {
this.index = data.index; this.index = data.index;
} }
if ("refIbpMapCode" in data && data.refIbpMapCode != undefined) {
this.refIbpMapCode = data.refIbpMapCode;
}
} }
} }
get common() { get common() {
@ -1788,12 +1792,19 @@ export namespace graphicData {
set index(value: number) { set index(value: number) {
pb_1.Message.setField(this, 7, value); pb_1.Message.setField(this, 7, value);
} }
get refIbpMapCode() {
return pb_1.Message.getFieldWithDefault(this, 8, "") as string;
}
set refIbpMapCode(value: string) {
pb_1.Message.setField(this, 8, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
concentrationStations?: boolean; concentrationStations?: boolean;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number; index?: number;
refIbpMapCode?: string;
}): Station { }): Station {
const message = new Station({}); const message = new Station({});
if (data.common != null) { if (data.common != null) {
@ -1811,6 +1822,9 @@ export namespace graphicData {
if (data.index != null) { if (data.index != null) {
message.index = data.index; message.index = data.index;
} }
if (data.refIbpMapCode != null) {
message.refIbpMapCode = data.refIbpMapCode;
}
return message; return message;
} }
toObject() { toObject() {
@ -1820,6 +1834,7 @@ export namespace graphicData {
concentrationStations?: boolean; concentrationStations?: boolean;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number; index?: number;
refIbpMapCode?: string;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -1836,6 +1851,9 @@ export namespace graphicData {
if (this.index != null) { if (this.index != null) {
data.index = this.index; data.index = this.index;
} }
if (this.refIbpMapCode != null) {
data.refIbpMapCode = this.refIbpMapCode;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -1852,6 +1870,8 @@ export namespace graphicData {
writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
if (this.index != 0) if (this.index != 0)
writer.writeInt32(7, this.index); writer.writeInt32(7, this.index);
if (this.refIbpMapCode.length)
writer.writeString(8, this.refIbpMapCode);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1876,6 +1896,9 @@ export namespace graphicData {
case 7: case 7:
message.index = reader.readInt32(); message.index = reader.readInt32();
break; break;
case 8:
message.refIbpMapCode = reader.readString();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -5577,6 +5600,7 @@ export namespace graphicData {
flip?: boolean; flip?: boolean;
index?: number; index?: number;
refScreenDoor?: string; refScreenDoor?: string;
refGatedBoxMapCode?: string;
}) { }) {
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, [], this.#one_of_decls);
@ -5596,6 +5620,9 @@ export namespace graphicData {
if ("refScreenDoor" in data && data.refScreenDoor != undefined) { if ("refScreenDoor" in data && data.refScreenDoor != undefined) {
this.refScreenDoor = data.refScreenDoor; this.refScreenDoor = data.refScreenDoor;
} }
if ("refGatedBoxMapCode" in data && data.refGatedBoxMapCode != undefined) {
this.refGatedBoxMapCode = data.refGatedBoxMapCode;
}
} }
} }
get common() { get common() {
@ -5631,12 +5658,19 @@ export namespace graphicData {
set refScreenDoor(value: string) { set refScreenDoor(value: string) {
pb_1.Message.setField(this, 5, value); pb_1.Message.setField(this, 5, value);
} }
get refGatedBoxMapCode() {
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
}
set refGatedBoxMapCode(value: string) {
pb_1.Message.setField(this, 6, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
flip?: boolean; flip?: boolean;
index?: number; index?: number;
refScreenDoor?: string; refScreenDoor?: string;
refGatedBoxMapCode?: string;
}): GatedBox { }): GatedBox {
const message = new GatedBox({}); const message = new GatedBox({});
if (data.common != null) { if (data.common != null) {
@ -5654,6 +5688,9 @@ export namespace graphicData {
if (data.refScreenDoor != null) { if (data.refScreenDoor != null) {
message.refScreenDoor = data.refScreenDoor; message.refScreenDoor = data.refScreenDoor;
} }
if (data.refGatedBoxMapCode != null) {
message.refGatedBoxMapCode = data.refGatedBoxMapCode;
}
return message; return message;
} }
toObject() { toObject() {
@ -5663,6 +5700,7 @@ export namespace graphicData {
flip?: boolean; flip?: boolean;
index?: number; index?: number;
refScreenDoor?: string; refScreenDoor?: string;
refGatedBoxMapCode?: string;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -5679,6 +5717,9 @@ export namespace graphicData {
if (this.refScreenDoor != null) { if (this.refScreenDoor != null) {
data.refScreenDoor = this.refScreenDoor; data.refScreenDoor = this.refScreenDoor;
} }
if (this.refGatedBoxMapCode != null) {
data.refGatedBoxMapCode = this.refGatedBoxMapCode;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -5695,6 +5736,8 @@ export namespace graphicData {
writer.writeInt32(4, this.index); writer.writeInt32(4, this.index);
if (this.refScreenDoor.length) if (this.refScreenDoor.length)
writer.writeString(5, this.refScreenDoor); writer.writeString(5, this.refScreenDoor);
if (this.refGatedBoxMapCode.length)
writer.writeString(6, this.refGatedBoxMapCode);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -5719,6 +5762,9 @@ export namespace graphicData {
case 5: case 5:
message.refScreenDoor = reader.readString(); message.refScreenDoor = reader.readString();
break; break;
case 6:
message.refGatedBoxMapCode = reader.readString();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -6783,7 +6829,7 @@ export namespace graphicData {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
code?: string; code?: string;
combinationtypes?: Combinationtype[]; combinationtypes?: DeviceCombinationtype[];
deviceType?: RelatedRef.DeviceType; deviceType?: RelatedRef.DeviceType;
}) { }) {
super(); super();
@ -6807,9 +6853,9 @@ export namespace graphicData {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get combinationtypes() { get combinationtypes() {
return pb_1.Message.getRepeatedWrapperField(this, Combinationtype, 2) as Combinationtype[]; return pb_1.Message.getRepeatedWrapperField(this, DeviceCombinationtype, 2) as DeviceCombinationtype[];
} }
set combinationtypes(value: Combinationtype[]) { set combinationtypes(value: DeviceCombinationtype[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value); pb_1.Message.setRepeatedWrapperField(this, 2, value);
} }
get deviceType() { get deviceType() {
@ -6820,7 +6866,7 @@ export namespace graphicData {
} }
static fromObject(data: { static fromObject(data: {
code?: string; code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[]; combinationtypes?: ReturnType<typeof DeviceCombinationtype.prototype.toObject>[];
deviceType?: RelatedRef.DeviceType; deviceType?: RelatedRef.DeviceType;
}): StationRelateDevice { }): StationRelateDevice {
const message = new StationRelateDevice({}); const message = new StationRelateDevice({});
@ -6828,7 +6874,7 @@ export namespace graphicData {
message.code = data.code; message.code = data.code;
} }
if (data.combinationtypes != null) { if (data.combinationtypes != null) {
message.combinationtypes = data.combinationtypes.map(item => Combinationtype.fromObject(item)); message.combinationtypes = data.combinationtypes.map(item => DeviceCombinationtype.fromObject(item));
} }
if (data.deviceType != null) { if (data.deviceType != null) {
message.deviceType = data.deviceType; message.deviceType = data.deviceType;
@ -6838,14 +6884,14 @@ export namespace graphicData {
toObject() { toObject() {
const data: { const data: {
code?: string; code?: string;
combinationtypes?: ReturnType<typeof Combinationtype.prototype.toObject>[]; combinationtypes?: ReturnType<typeof DeviceCombinationtype.prototype.toObject>[];
deviceType?: RelatedRef.DeviceType; deviceType?: RelatedRef.DeviceType;
} = {}; } = {};
if (this.code != null) { if (this.code != null) {
data.code = this.code; data.code = this.code;
} }
if (this.combinationtypes != null) { if (this.combinationtypes != null) {
data.combinationtypes = this.combinationtypes.map((item: Combinationtype) => item.toObject()); data.combinationtypes = this.combinationtypes.map((item: DeviceCombinationtype) => item.toObject());
} }
if (this.deviceType != null) { if (this.deviceType != null) {
data.deviceType = this.deviceType; data.deviceType = this.deviceType;
@ -6859,7 +6905,7 @@ export namespace graphicData {
if (this.code.length) if (this.code.length)
writer.writeString(1, this.code); writer.writeString(1, this.code);
if (this.combinationtypes.length) if (this.combinationtypes.length)
writer.writeRepeatedMessage(2, this.combinationtypes, (item: Combinationtype) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.combinationtypes, (item: DeviceCombinationtype) => item.serialize(writer));
if (this.deviceType != RelatedRef.DeviceType.Section) if (this.deviceType != RelatedRef.DeviceType.Section)
writer.writeEnum(3, this.deviceType); writer.writeEnum(3, this.deviceType);
if (!w) if (!w)
@ -6875,7 +6921,7 @@ export namespace graphicData {
message.code = reader.readString(); message.code = reader.readString();
break; break;
case 2: case 2:
reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Combinationtype.deserialize(reader), Combinationtype)); reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, DeviceCombinationtype.deserialize(reader), DeviceCombinationtype));
break; break;
case 3: case 3:
message.deviceType = reader.readEnum(); message.deviceType = reader.readEnum();
@ -6892,7 +6938,7 @@ export namespace graphicData {
return StationRelateDevice.deserialize(bytes); return StationRelateDevice.deserialize(bytes);
} }
} }
export class Combinationtype extends pb_1.Message { export class DeviceCombinationtype extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
code?: string; code?: string;
@ -6924,8 +6970,8 @@ export namespace graphicData {
static fromObject(data: { static fromObject(data: {
code?: string; code?: string;
refDevices?: string[]; refDevices?: string[];
}): Combinationtype { }): DeviceCombinationtype {
const message = new Combinationtype({}); const message = new DeviceCombinationtype({});
if (data.code != null) { if (data.code != null) {
message.code = data.code; message.code = data.code;
} }
@ -6958,8 +7004,8 @@ export namespace graphicData {
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Combinationtype { static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DeviceCombinationtype {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Combinationtype(); const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeviceCombinationtype();
while (reader.nextField()) { while (reader.nextField()) {
if (reader.isEndGroup()) if (reader.isEndGroup())
break; break;
@ -6978,8 +7024,8 @@ export namespace graphicData {
serializeBinary(): Uint8Array { serializeBinary(): Uint8Array {
return this.serialize(); return this.serialize();
} }
static deserializeBinary(bytes: Uint8Array): Combinationtype { static deserializeBinary(bytes: Uint8Array): DeviceCombinationtype {
return Combinationtype.deserialize(bytes); return DeviceCombinationtype.deserialize(bytes);
} }
} }
} }

View File

@ -1,4 +1,5 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { QTable } from 'quasar';
import { getIBPDrawApp, initIBPDrawApp } from 'src/drawApp/ibpDrawApp'; import { getIBPDrawApp, initIBPDrawApp } from 'src/drawApp/ibpDrawApp';
import { DrawAssistant, IDrawApp, IJlCanvas, JlGraphic } from 'src/jl-graphic'; import { DrawAssistant, IDrawApp, IJlCanvas, JlGraphic } from 'src/jl-graphic';
import { markRaw } from 'vue'; import { markRaw } from 'vue';
@ -9,6 +10,8 @@ export const useIBPDrawStore = defineStore('ibpDraw', {
selectedGraphics: null as JlGraphic[] | null, selectedGraphics: null as JlGraphic[] | null,
draftId: null as number | null, draftId: null as number | null,
draftType: 'IBP', draftType: 'IBP',
showRelateDeviceConfig: false,
table: undefined as QTable | undefined,
}), }),
getters: { getters: {
selectedObjName: (state) => { selectedObjName: (state) => {