Compare commits

..

No commits in common. "975a8a89aaa93488ef1c7f31ec8a87259ffb0952" and "38bc44f2f95c2e47923936072a94c9b04a395100" have entirely different histories.

4 changed files with 1081 additions and 0 deletions

View File

@ -0,0 +1,50 @@
<template>
<!-- 绘制图形模板属性 -->
<div v-if="drawStore.drawMode">
<q-card flat>
<q-card-section>
<div class="text-h6">{{ drawStore.drawGraphicName + ' 模板' }}</div>
</q-card-section>
<q-separator inset></q-separator>
<q-card-section> </q-card-section>
</q-card>
</div>
<!-- 画布或图形对象属性 -->
<div v-else-if="drawStore.selectedGraphics !== null">
<q-card flat>
<q-card-section>
<div class="text-h6">{{ drawStore.selectedObjName + ' 属性' }}</div>
</q-card-section>
<q-separator inset></q-separator>
<template v-if="drawStore.selectedGraphics.length === 0">
<q-card-section>
<canvas-property></canvas-property>
</q-card-section>
</template>
<template v-else-if="drawStore.selectedGraphics.length === 1">
<q-card-section>
<iscs-text-property
v-if="drawStore.selectedGraphicType === TextContent.Type"
/>
<rect-property
v-else-if="drawStore.selectedGraphicType === Rect.Type"
/>
</q-card-section>
</template>
<template v-else-if="drawStore.selectedGraphics.length > 1">
<multiple-select-property></multiple-select-property>
</template>
</q-card>
</div>
</template>
<script setup lang="ts">
import { useDrawStore } from 'src/stores/draw-store';
import CanvasProperty from './properties/FireAlarm/CanvasFireAlarmProperty.vue';
import IscsTextProperty from './properties/IscsTextProperty.vue';
import { TextContent } from 'src/graphics/textContent/TextContent';
import RectProperty from './properties/RectProperty.vue';
import { Rect } from 'src/graphics/rect/Rect';
const drawStore = useDrawStore();
</script>

89
src/drawApp/fasApp.ts Normal file
View File

@ -0,0 +1,89 @@
import {
CombinationKey,
IDrawApp,
IGraphicStorage,
JlGraphic,
KeyListener,
newDrawApp,
} from 'jl-graphic';
import { FASGraphicData } from 'src/protos/fas_graphic_data';
import { fromUint8Array } from 'js-base64';
import {
initCommonDrawApp,
saveCommonDrawDatas,
saveDrawToServer,
} from './commonApp';
import { useDrawStore } from 'src/stores/draw-store';
let drawApp: IDrawApp | null = null;
export function getFASDrawApp(): IDrawApp | null {
return drawApp;
}
export function destroyFASDrawApp(): void {
if (drawApp) {
drawApp.destroy();
drawApp = null;
}
}
export function initFASDrawApp(): IDrawApp {
const isSupportDeletion = (g: JlGraphic) => {
console.log(g);
return true;
};
drawApp = newDrawApp({
dataLoader: loadDrawDatas,
isSupportDeletion: isSupportDeletion,
});
const app = drawApp;
initCommonDrawApp(app);
// new CCTVButtonDraw(app, new CCTVButtonTemplate(new CCTVButtonData()));
app.addKeyboardListener(
new KeyListener({
value: 'KeyS',
global: true,
combinations: [CombinationKey.Ctrl],
onPress: () => {
saveDrawToServer(saveDrawDatas(app));
},
})
);
return drawApp;
}
export async function loadDrawDatas(): Promise<IGraphicStorage> {
const drawStore = useDrawStore();
const id = drawStore.draftId;
if (!id) {
throw new Error('获取数据异常为获取到草稿地图ID');
}
/* const { proto: base64 } = await getDraft(id);
if (base64) {
const storage = iscsGraphicData.IscsGraphicStorage.deserialize(
toUint8Array(base64)
);
const datas = loadCommonDrawDatas(storage);} */
return Promise.resolve({
datas: [],
});
}
export function saveDrawDatas(app: IDrawApp) {
let storage = new FASGraphicData.FASGraphicStorage();
storage = saveCommonDrawDatas(
app,
storage
) as FASGraphicData.FASGraphicStorage;
const graphics = app.queryStore.getAllGraphics();
/* graphics.forEach((g) => {
if (TrackSection.Type === g.type) {
const trackSectionData = (g as TrackSection).saveData();
storage.trackSections.push((trackSectionData as TrackSectionData).data);
} }) */
console.log(storage, '保存数据', graphics);
const base64 = fromUint8Array(storage.serialize());
return base64;
}

View File

@ -0,0 +1,260 @@
<template>
<q-layout view="hHh LpR fFf">
<q-header reveal class="bg-primary text-white">
<q-toolbar>
<q-toolbar-title class="q-gutter-sm">
<q-btn color="accent" label="功能菜单">
<q-menu>
<q-list style="min-width: 100px">
<q-item
v-for="item in leftMenuConfig"
:key="item.label"
clickable
v-close-popup
@click="item.click"
>
<q-item-section>{{ item.label }}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
<q-btn-toggle
v-model="selectUtil"
color="brown"
text-color="white"
toggle-color="orange"
toggle-text-color="black"
:options="utilsOption"
@update:model-value="drawSelect"
>
<template
v-for="(ctl, idx) in utilsOption"
:key="idx"
v-slot:[ctl.value]
>
<q-tooltip>{{ ctl.tip }}</q-tooltip>
</template>
</q-btn-toggle>
</q-toolbar-title>
<q-btn square color="purple" style="margin-right: 10px" icon="search">
<q-popup-edit
ref="popupEdit"
v-model="searchId"
:cover="false"
:offset="[0, 10]"
v-slot="scope"
>
<q-input
color="accent"
v-model="scope.value"
label="设备Id"
dense
autofocus
@keyup.enter="scope.set"
>
<template v-slot:prepend>
<q-icon name="search" color="accent" />
</template>
</q-input>
</q-popup-edit>
</q-btn>
<q-btn color="info" label="返回" @click="backConfirm" />
<q-btn dense flat round icon="menu" @click="toggleRightDrawer" />
</q-toolbar>
<q-resize-observer @resize="onHeaderResize" />
</q-header>
<q-drawer show-if-above bordered v-model="rightDrawerOpen" side="right">
<q-resize-observer @resize="onRightResize" />
<fire-alarm-draw-properties></fire-alarm-draw-properties>
</q-drawer>
<q-page-container>
<div id="draw-app-container" class="overflow-hidden"></div>
</q-page-container>
<q-dialog
v-model="saveAsDialog"
persistent
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 300px">
<q-card-section>
<div class="text-h6">另存为</div>
</q-card-section>
<q-card-section>
<q-input
outlined
label="草稿名称"
v-model="saveAsName"
:rules="[(val) => val.trim() != '' || '草稿名称不能为空']"
/>
</q-card-section>
<q-card-actions align="right">
<q-btn color="primary" label="提交" @click="saveAs(saveAsName)" />
<q-btn label="取消" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
<q-resize-observer @resize="onResize" />
</q-layout>
</template>
<script setup lang="ts">
import FireAlarmDrawProperties from 'src/components/draw-app/FireAlarmDrawProperties.vue';
import { onMounted, reactive, ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { successNotify } from 'src/utils/CommonNotify';
import { useQuasar } from 'quasar';
import { useDrawStore } from 'src/stores/draw-store';
import { PictureType } from 'src/protos/picture';
import { Arrow } from 'src/graphics/arrow/Arrow';
import { TextContent } from 'src/graphics/textContent/TextContent';
import { Rect } from 'src/graphics/rect/Rect';
const $q = useQuasar();
const route = useRoute();
const router = useRouter();
const searchId = ref(0);
const drawStore = useDrawStore();
watch(
() => drawStore.drawMode,
(drawMode) => {
if (!drawMode) {
selectUtil.value = '';
}
}
);
watch(
() => searchId.value,
() => {
try {
if (searchId.value) {
const device = drawStore
.getDrawApp()
.queryStore.queryById(searchId.value);
drawStore.getDrawApp().makeGraphicCenterShow(device);
drawStore.getDrawApp().updateSelected(device);
searchId.value = 0;
}
} catch (err) {
$q.notify({
type: 'negative',
message: `未查找到id为【${searchId.value}】的设备`,
});
}
}
);
const rightDrawerOpen = ref(false);
function toggleRightDrawer() {
rightDrawerOpen.value = !rightDrawerOpen.value;
onResize();
}
//
const selectUtil = ref();
const utilsOption: ControlItem[] = reactive([]);
const drawSelect = (item: string) => {
drawStore.getDrawApp().interactionPlugin(item).resume();
};
class ControlItem {
value: string;
slot: string;
icon: string;
tip: string;
show = true;
constructor(value: string, icon: string, tip: string, show?: boolean) {
this.value = value;
this.slot = value;
this.icon = icon;
this.tip = tip;
if (show != undefined) {
this.show = show;
}
}
}
//
const leftMenuConfig = [
{ label: '保存', click: saveAllDrawDatas },
{ label: '另存为', click: () => (saveAsDialog.value = true) },
];
onMounted(() => {
console.log('绘制应用layout mounted');
drawStore.drawPictureType = PictureType.FireAlarm;
const dom = document.getElementById('draw-app-container');
if (dom) {
drawStore.setDraftId(+route.params.id as number);
const drawApp = drawStore.initDrawApp();
drawApp.bindDom(dom);
drawApp.reload();
onResize();
} else {
drawStore.setDraftId(null);
}
const drawAssistantsTypes = [Arrow.Type, TextContent.Type, Rect.Type];
drawAssistantsTypes.forEach((type) => {
const drawAssistant = drawStore.getDrawApp().getDrawAssistant(type);
if (drawAssistant) {
utilsOption.push(
new ControlItem(
drawAssistant.name,
drawAssistant.icon,
drawAssistant.description || drawAssistant.name
)
);
}
});
});
const canvasWidth = ref(0);
const canvasHeight = ref(0);
const headerHeight = ref(0);
const rightWidth = ref(0);
function onHeaderResize(size: { height: number; width: number }) {
headerHeight.value = size.height;
onResize();
}
function onRightResize(size: { height: number; width: number }) {
rightWidth.value = size.width;
onResize();
}
function onResize() {
const clientWidth = document.documentElement.clientWidth;
const clientHeight = document.documentElement.clientHeight;
canvasWidth.value =
clientWidth - (rightDrawerOpen.value ? rightWidth.value : 0);
canvasHeight.value = clientHeight - headerHeight.value;
const dom = document.getElementById('draw-app-container');
if (dom) {
dom.style.width = canvasWidth.value + 'px';
dom.style.height = canvasHeight.value + 'px';
}
}
function saveAllDrawDatas() {
// const drawApp = drawStore.getDrawApp();
}
function backConfirm() {
router.go(-1);
}
const saveAsDialog = ref(false);
const saveAsName = ref('');
async function saveAs(name: string) {
successNotify('另存为成功' + name);
}
</script>

View File

@ -0,0 +1,682 @@
/**
* Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 5.27.4
* source: fas_graphic_data.proto
* git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./iscs_graphic_data";
import * as pb_1 from "google-protobuf";
export namespace FASGraphicData {
export class FASGraphicStorage extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
canvas?: dependency_1.iscsGraphicData.Canvas;
arrows?: dependency_1.iscsGraphicData.Arrow[];
iscsTexts?: dependency_1.iscsGraphicData.IscsText[];
rects?: dependency_1.iscsGraphicData.Rect[];
manualAlarmButtons?: ManualAlarmButton[];
hydrantAlarmButtons?: HydrantAlarmButton[];
gasExtinguishings?: GasExtinguishing[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 7], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
}
if ("arrows" in data && data.arrows != undefined) {
this.arrows = data.arrows;
}
if ("iscsTexts" in data && data.iscsTexts != undefined) {
this.iscsTexts = data.iscsTexts;
}
if ("rects" in data && data.rects != undefined) {
this.rects = data.rects;
}
if ("manualAlarmButtons" in data && data.manualAlarmButtons != undefined) {
this.manualAlarmButtons = data.manualAlarmButtons;
}
if ("hydrantAlarmButtons" in data && data.hydrantAlarmButtons != undefined) {
this.hydrantAlarmButtons = data.hydrantAlarmButtons;
}
if ("gasExtinguishings" in data && data.gasExtinguishings != undefined) {
this.gasExtinguishings = data.gasExtinguishings;
}
}
}
get canvas() {
return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.Canvas, 1) as dependency_1.iscsGraphicData.Canvas;
}
set canvas(value: dependency_1.iscsGraphicData.Canvas) {
pb_1.Message.setWrapperField(this, 1, value);
}
get has_canvas() {
return pb_1.Message.getField(this, 1) != null;
}
get arrows() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.iscsGraphicData.Arrow, 2) as dependency_1.iscsGraphicData.Arrow[];
}
set arrows(value: dependency_1.iscsGraphicData.Arrow[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
get iscsTexts() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.iscsGraphicData.IscsText, 3) as dependency_1.iscsGraphicData.IscsText[];
}
set iscsTexts(value: dependency_1.iscsGraphicData.IscsText[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get rects() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.iscsGraphicData.Rect, 4) as dependency_1.iscsGraphicData.Rect[];
}
set rects(value: dependency_1.iscsGraphicData.Rect[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get manualAlarmButtons() {
return pb_1.Message.getRepeatedWrapperField(this, ManualAlarmButton, 5) as ManualAlarmButton[];
}
set manualAlarmButtons(value: ManualAlarmButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
get hydrantAlarmButtons() {
return pb_1.Message.getRepeatedWrapperField(this, HydrantAlarmButton, 6) as HydrantAlarmButton[];
}
set hydrantAlarmButtons(value: HydrantAlarmButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 6, value);
}
get gasExtinguishings() {
return pb_1.Message.getRepeatedWrapperField(this, GasExtinguishing, 7) as GasExtinguishing[];
}
set gasExtinguishings(value: GasExtinguishing[]) {
pb_1.Message.setRepeatedWrapperField(this, 7, value);
}
static fromObject(data: {
canvas?: ReturnType<typeof dependency_1.iscsGraphicData.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof dependency_1.iscsGraphicData.Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof dependency_1.iscsGraphicData.IscsText.prototype.toObject>[];
rects?: ReturnType<typeof dependency_1.iscsGraphicData.Rect.prototype.toObject>[];
manualAlarmButtons?: ReturnType<typeof ManualAlarmButton.prototype.toObject>[];
hydrantAlarmButtons?: ReturnType<typeof HydrantAlarmButton.prototype.toObject>[];
gasExtinguishings?: ReturnType<typeof GasExtinguishing.prototype.toObject>[];
}): FASGraphicStorage {
const message = new FASGraphicStorage({});
if (data.canvas != null) {
message.canvas = dependency_1.iscsGraphicData.Canvas.fromObject(data.canvas);
}
if (data.arrows != null) {
message.arrows = data.arrows.map(item => dependency_1.iscsGraphicData.Arrow.fromObject(item));
}
if (data.iscsTexts != null) {
message.iscsTexts = data.iscsTexts.map(item => dependency_1.iscsGraphicData.IscsText.fromObject(item));
}
if (data.rects != null) {
message.rects = data.rects.map(item => dependency_1.iscsGraphicData.Rect.fromObject(item));
}
if (data.manualAlarmButtons != null) {
message.manualAlarmButtons = data.manualAlarmButtons.map(item => ManualAlarmButton.fromObject(item));
}
if (data.hydrantAlarmButtons != null) {
message.hydrantAlarmButtons = data.hydrantAlarmButtons.map(item => HydrantAlarmButton.fromObject(item));
}
if (data.gasExtinguishings != null) {
message.gasExtinguishings = data.gasExtinguishings.map(item => GasExtinguishing.fromObject(item));
}
return message;
}
toObject() {
const data: {
canvas?: ReturnType<typeof dependency_1.iscsGraphicData.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof dependency_1.iscsGraphicData.Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof dependency_1.iscsGraphicData.IscsText.prototype.toObject>[];
rects?: ReturnType<typeof dependency_1.iscsGraphicData.Rect.prototype.toObject>[];
manualAlarmButtons?: ReturnType<typeof ManualAlarmButton.prototype.toObject>[];
hydrantAlarmButtons?: ReturnType<typeof HydrantAlarmButton.prototype.toObject>[];
gasExtinguishings?: ReturnType<typeof GasExtinguishing.prototype.toObject>[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
}
if (this.arrows != null) {
data.arrows = this.arrows.map((item: dependency_1.iscsGraphicData.Arrow) => item.toObject());
}
if (this.iscsTexts != null) {
data.iscsTexts = this.iscsTexts.map((item: dependency_1.iscsGraphicData.IscsText) => item.toObject());
}
if (this.rects != null) {
data.rects = this.rects.map((item: dependency_1.iscsGraphicData.Rect) => item.toObject());
}
if (this.manualAlarmButtons != null) {
data.manualAlarmButtons = this.manualAlarmButtons.map((item: ManualAlarmButton) => item.toObject());
}
if (this.hydrantAlarmButtons != null) {
data.hydrantAlarmButtons = this.hydrantAlarmButtons.map((item: HydrantAlarmButton) => item.toObject());
}
if (this.gasExtinguishings != null) {
data.gasExtinguishings = this.gasExtinguishings.map((item: GasExtinguishing) => 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_canvas)
writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer));
if (this.arrows.length)
writer.writeRepeatedMessage(2, this.arrows, (item: dependency_1.iscsGraphicData.Arrow) => item.serialize(writer));
if (this.iscsTexts.length)
writer.writeRepeatedMessage(3, this.iscsTexts, (item: dependency_1.iscsGraphicData.IscsText) => item.serialize(writer));
if (this.rects.length)
writer.writeRepeatedMessage(4, this.rects, (item: dependency_1.iscsGraphicData.Rect) => item.serialize(writer));
if (this.manualAlarmButtons.length)
writer.writeRepeatedMessage(5, this.manualAlarmButtons, (item: ManualAlarmButton) => item.serialize(writer));
if (this.hydrantAlarmButtons.length)
writer.writeRepeatedMessage(6, this.hydrantAlarmButtons, (item: HydrantAlarmButton) => item.serialize(writer));
if (this.gasExtinguishings.length)
writer.writeRepeatedMessage(7, this.gasExtinguishings, (item: GasExtinguishing) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FASGraphicStorage {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FASGraphicStorage();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.canvas, () => message.canvas = dependency_1.iscsGraphicData.Canvas.deserialize(reader));
break;
case 2:
reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_1.iscsGraphicData.Arrow.deserialize(reader), dependency_1.iscsGraphicData.Arrow));
break;
case 3:
reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.iscsGraphicData.IscsText.deserialize(reader), dependency_1.iscsGraphicData.IscsText));
break;
case 4:
reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_1.iscsGraphicData.Rect.deserialize(reader), dependency_1.iscsGraphicData.Rect));
break;
case 5:
reader.readMessage(message.manualAlarmButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 5, ManualAlarmButton.deserialize(reader), ManualAlarmButton));
break;
case 6:
reader.readMessage(message.hydrantAlarmButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 6, HydrantAlarmButton.deserialize(reader), HydrantAlarmButton));
break;
case 7:
reader.readMessage(message.gasExtinguishings, () => pb_1.Message.addToRepeatedWrapperField(message, 7, GasExtinguishing.deserialize(reader), GasExtinguishing));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): FASGraphicStorage {
return FASGraphicStorage.deserialize(bytes);
}
}
export class ManualAlarmButton extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.iscsGraphicData.CommonInfo;
code?: 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 ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.CommonInfo, 1) as dependency_1.iscsGraphicData.CommonInfo;
}
set common(value: dependency_1.iscsGraphicData.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);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
}): ManualAlarmButton {
const message = new ManualAlarmButton({});
if (data.common != null) {
message.common = dependency_1.iscsGraphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
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 (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ManualAlarmButton {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ManualAlarmButton();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.iscsGraphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): ManualAlarmButton {
return ManualAlarmButton.deserialize(bytes);
}
}
export class HydrantAlarmButton extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.iscsGraphicData.CommonInfo;
code?: 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 ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.CommonInfo, 1) as dependency_1.iscsGraphicData.CommonInfo;
}
set common(value: dependency_1.iscsGraphicData.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);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
}): HydrantAlarmButton {
const message = new HydrantAlarmButton({});
if (data.common != null) {
message.common = dependency_1.iscsGraphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
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 (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): HydrantAlarmButton {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new HydrantAlarmButton();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.iscsGraphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): HydrantAlarmButton {
return HydrantAlarmButton.deserialize(bytes);
}
}
export class GasExtinguishing extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.iscsGraphicData.CommonInfo;
code?: 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 ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.CommonInfo, 1) as dependency_1.iscsGraphicData.CommonInfo;
}
set common(value: dependency_1.iscsGraphicData.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);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
}): GasExtinguishing {
const message = new GasExtinguishing({});
if (data.common != null) {
message.common = dependency_1.iscsGraphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
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 (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GasExtinguishing {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GasExtinguishing();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.iscsGraphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): GasExtinguishing {
return GasExtinguishing.deserialize(bytes);
}
}
export class SmokeDetector extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.iscsGraphicData.CommonInfo;
code?: 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 ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.CommonInfo, 1) as dependency_1.iscsGraphicData.CommonInfo;
}
set common(value: dependency_1.iscsGraphicData.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);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
}): SmokeDetector {
const message = new SmokeDetector({});
if (data.common != null) {
message.common = dependency_1.iscsGraphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
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 (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SmokeDetector {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SmokeDetector();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.iscsGraphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): SmokeDetector {
return SmokeDetector.deserialize(bytes);
}
}
export class TemperatureDetector extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.iscsGraphicData.CommonInfo;
code?: 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 ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.CommonInfo, 1) as dependency_1.iscsGraphicData.CommonInfo;
}
set common(value: dependency_1.iscsGraphicData.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);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
}): TemperatureDetector {
const message = new TemperatureDetector({});
if (data.common != null) {
message.common = dependency_1.iscsGraphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
code?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
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 (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TemperatureDetector {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TemperatureDetector();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.iscsGraphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): TemperatureDetector {
return TemperatureDetector.deserialize(bytes);
}
}
}