bas自动扶梯备用

This commit is contained in:
joylink_zhaoerwei 2024-10-21 18:03:30 +08:00
parent d16bedfbf4
commit a7968d11da
9 changed files with 702 additions and 4 deletions

@ -1 +1 @@
Subproject commit cf2e52a1e02d3f8c001c05ba6480fc201b016bef
Subproject commit 236252fc0fa258e6beaae5b5ac0a7e28ebbcb04b

View File

@ -0,0 +1,41 @@
import * as pb_1 from 'google-protobuf';
import {
IescalatorData,
Escalator,
} from 'src/graphics/BAS/escalator/Escalator';
import { GraphicDataBase } from '../GraphicDataBase';
import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
export class EscalatorData extends GraphicDataBase implements IescalatorData {
constructor(data?: iscsGraphicData.Escalator) {
let escalator;
if (data) {
escalator = data;
} else {
escalator = new iscsGraphicData.Escalator({
common: GraphicDataBase.defaultCommonInfo(Escalator.Type),
});
}
super(escalator);
}
public get data(): iscsGraphicData.Escalator {
return this.getData<iscsGraphicData.Escalator>();
}
get code(): string {
return this.data.code;
}
set code(v: string) {
this.data.code = v;
}
clone(): EscalatorData {
return new EscalatorData(this.data.cloneMessage());
}
copyFrom(data: EscalatorData): void {
pb_1.Message.copyInto(data.data, this.data);
}
eq(other: EscalatorData): boolean {
return pb_1.Message.equals(this.data, other.data);
}
}

View File

@ -47,6 +47,12 @@ import {
} from 'src/graphics/FAS/smokeDetector/SmokeDetector';
import { SmokeDetectorData } from './graphics/FAS/SmokeDetectorInteraction';
import { SmokeDetectorDraw } from 'src/graphics/FAS/smokeDetector/SmokeDetectorAssistant';
import { EscalatorDraw } from 'src/graphics/BAS/escalator/EscalatorDrawAssistant';
import {
Escalator,
EscalatorTemplate,
} from 'src/graphics/BAS/escalator/Escalator';
import { EscalatorData } from './graphics/BAS/EscalatorInteraction';
// import { getOnlyToken } from 'src/configs/TokenManage';
let drawApp: IDrawApp | null = null;
@ -81,6 +87,7 @@ export function initIscsDrawApp(): IDrawApp {
const app = drawApp;
initCommonDrawApp(app);
new EscalatorDraw(app, new EscalatorTemplate(new EscalatorData()));
new FasFailureControlHostDraw(
app,
new FasFailureControlHostTemplate(new FasFailureControlHostData())
@ -291,6 +298,21 @@ export async function loadDrawDatas(): Promise<IGraphicStorage> {
break;
}
}
case '电扶梯':
for (let i = 0; i < storage.basOfEscalatorStorages.length; i++) {
const basOfEscalator = storage.basOfEscalatorStorages[i];
if (
basOfEscalator.stationName ==
drawStore.selectSubmenuAndStation.station
) {
canvasProperty = basOfEscalator.canvas;
datas = loadCommonDrawDatas(basOfEscalator);
basOfEscalator.escalators.forEach((escalator) => {
datas.push(new EscalatorData(escalator));
});
break;
}
}
default:
break;
}
@ -338,6 +360,16 @@ export function saveDrawDatas(app: IDrawApp) {
}
});
}
if (!storage?.basOfEscalatorStorages.length) {
stationOption.forEach((station) =>
storage?.basOfEscalatorStorages.push(
new iscsGraphicData.BASOfEscalatorStorage({
stationName: station,
commonGraphicStorage: new iscsGraphicData.CommonGraphicStorage(),
})
)
);
}
const graphics = app.queryStore.getAllGraphics();
switch (drawStore.selectSubmenuAndStation.submenu) {
case '火灾报警平面图':
@ -412,6 +444,35 @@ export function saveDrawDatas(app: IDrawApp) {
}
}
break;
case '电扶梯':
for (let i = 0; i < storage.basOfEscalatorStorages.length; i++) {
let basOfEscalator = storage.basOfEscalatorStorages[i];
if (
basOfEscalator.stationName ==
drawStore.selectSubmenuAndStation.station
) {
basOfEscalator = new iscsGraphicData.BASOfEscalatorStorage({
stationName: drawStore.selectSubmenuAndStation.station,
commonGraphicStorage: new iscsGraphicData.CommonGraphicStorage(),
});
const basOfEscalatorStorage = saveCommonDrawDatas(
app,
basOfEscalator
) as iscsGraphicData.BASOfEscalatorStorage;
graphics.forEach((g) => {
if (g instanceof Escalator) {
const escalatorData = g.saveData();
basOfEscalatorStorage.escalators.push(
(escalatorData as EscalatorData).data
);
}
});
storage.basOfEscalatorStorages[i] = basOfEscalatorStorage;
break;
}
}
break;
default:
break;

View File

@ -0,0 +1,75 @@
import { GraphicData, JlGraphic, JlGraphicTemplate } from 'jl-graphic';
import tcc_Light_Assets from './escalator-spritesheet.png';
import tcc_Light_JSON from './escalator-data.json';
import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js';
interface EscalatorTextures {
redOn: Texture;
redOff: Texture;
greenOn: Texture;
greenOff: Texture;
blueOn: Texture;
blueOff: Texture;
}
export interface IescalatorData extends GraphicData {
get code(): string;
set code(v: string);
}
export class Escalator extends JlGraphic {
static Type = 'Escalator';
_escalator: Sprite;
escalatorTextures: EscalatorTextures;
__state = 0;
constructor(escalatorTextures: EscalatorTextures) {
super(Escalator.Type);
this.escalatorTextures = escalatorTextures;
this._escalator = new Sprite();
this._escalator.texture = this.escalatorTextures.greenOff;
this._escalator.scale.set(0.25);
this._escalator.anchor.set(0.5);
this.addChild(this._escalator);
}
get code(): string {
return this.datas.code;
}
get datas(): IescalatorData {
return this.getDatas<IescalatorData>();
}
doRepaint(): void {
this._escalator.texture = this.escalatorTextures.greenOn;
}
}
export class EscalatorTemplate extends JlGraphicTemplate<Escalator> {
escalatorTextures?: EscalatorTextures;
constructor(dataTemplate: IescalatorData) {
super(Escalator.Type, { dataTemplate });
this.loadAssets();
}
new(): Escalator {
if (this.escalatorTextures) {
const g = new Escalator(this.escalatorTextures);
g.loadData(this.datas);
return g;
}
throw new Error('资源未加载/加载失败');
}
async loadAssets(): Promise<EscalatorTextures> {
const texture = await Assets.load(tcc_Light_Assets);
const escalatorSheet = new Spritesheet(texture, tcc_Light_JSON);
const result = await escalatorSheet.parse();
this.escalatorTextures = {
redOff: result['red-off.png'],
redOn: result['red-on.png'],
blueOff: result['blue-off.png'],
blueOn: result['blue-on.png'],
greenOff: result['green-off.png'],
greenOn: result['green-on.png'],
};
return this.escalatorTextures as EscalatorTextures;
}
}

View File

@ -0,0 +1,117 @@
import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
import {
AbsorbableLine,
AbsorbablePosition,
GraphicDrawAssistant,
GraphicInteractionPlugin,
GraphicTransformEvent,
IDrawApp,
JlGraphic,
} from 'jl-graphic';
import { IescalatorData, Escalator, EscalatorTemplate } from './Escalator';
export class EscalatorDraw extends GraphicDrawAssistant<
EscalatorTemplate,
IescalatorData
> {
_escalator: Escalator | null = null;
constructor(app: IDrawApp, template: EscalatorTemplate) {
super(app, template, 'sym_o_lightbulb', '自动扶梯');
EscalatorInteraction.init(app);
}
bind(): void {
super.bind();
if (!this._escalator) {
this._escalator = this.graphicTemplate.new();
this.container.addChild(this._escalator);
}
}
public get escalator(): Escalator {
if (!this._escalator) {
this._escalator = this.graphicTemplate.new();
this.container.addChild(this._escalator);
}
return this._escalator;
}
redraw(cp: Point): void {
this.escalator.position.copyFrom(cp);
}
onLeftUp(e: FederatedMouseEvent): void {
this.escalator.position.copyFrom(this.toCanvasCoordinates(e.global));
this.createAndStore(true);
}
prepareData(data: IescalatorData): boolean {
data.transform = this.escalator.saveTransform();
return true;
}
onEsc(): void {
this.finish();
}
}
/**
* 线
* @param escalator
*/
function buildAbsorbablePositions(escalator: Escalator): AbsorbablePosition[] {
const aps: AbsorbablePosition[] = [];
const escalators = escalator.queryStore.queryByType<Escalator>(
Escalator.Type
);
const canvas = escalator.getCanvas();
escalators.forEach((item) => {
if (item.id === escalator.id) {
return;
}
const ala = new AbsorbableLine(
new Point(item.x, 0),
new Point(item.x, canvas.height)
);
const alb = new AbsorbableLine(
new Point(0, item.y),
new Point(canvas.width, item.y)
);
aps.push(ala);
aps.push(alb);
});
return aps;
}
export class EscalatorInteraction extends GraphicInteractionPlugin<Escalator> {
static Name = 'tcc_light_transform';
constructor(app: IDrawApp) {
super(EscalatorInteraction.Name, app);
}
static init(app: IDrawApp) {
return new EscalatorInteraction(app);
}
filter(...grahpics: JlGraphic[]): Escalator[] | undefined {
return grahpics
.filter((g) => g.type === Escalator.Type)
.map((g) => g as Escalator);
}
bind(g: Escalator): void {
g.eventMode = 'static';
g.cursor = 'pointer';
g.scalable = true;
g.rotatable = true;
g.on('transformstart', this.transformstart, this);
}
unbind(g: Escalator): void {
g.eventMode = 'none';
g.scalable = false;
g.rotatable = false;
g.off('transformstart', this.transformstart, this);
}
transformstart(e: GraphicTransformEvent) {
const target = e.target as DisplayObject;
const escalator = target.getGraphic() as Escalator;
escalator.getGraphicApp().setOptions({
absorbablePositions: buildAbsorbablePositions(escalator),
});
}
}

View File

@ -0,0 +1,29 @@
{
"frames": {
"green-off.png": {
"frame": { "x": 0, "y": 0, "w": 128, "h": 128 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 128, "h": 128 },
"sourceSize": { "w": 128, "h": 128 },
"anchor": { "x": 0.5, "y": 0.5 }
},
"green-on.png": {
"frame": { "x": 128, "y": 0, "w": 128, "h": 128 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 128, "h": 128 },
"sourceSize": { "w": 128, "h": 64 },
"anchor": { "x": 0.5, "y": 0.5 }
}
},
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "1.1",
"image": "tcc-light.png",
"format": "RGBA8888",
"size": { "w": 256, "h": 128 },
"scale": "0.5",
"smartupdate": "$TexturePacker:SmartUpdate:e7620bd2d73cc0b3e2deea9704e7eefc:f129a1d9e4b9ba57720b3861c22b155b:eb2d421f7759984b7713aa4aa5354134$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -310,6 +310,7 @@ import { FasFailureControlHost } from 'src/graphics/FAS/fireFailureControlHost/F
import { FasAlarm } from 'src/graphics/FAS/fasAlarm/FasAlarm';
import { ManualAlarmButton } from 'src/graphics/FAS/manualAlarmButton/ManualAlarmButton';
import { SmokeDetector } from 'src/graphics/FAS/smokeDetector/SmokeDetector';
import { Escalator } from 'src/graphics/BAS/escalator/Escalator';
const $q = useQuasar();
const route = useRoute();
@ -390,8 +391,8 @@ function handleUtilsOption() {
Button.Type,
];
switch (drawStore.selectSubmenuAndStation.submenu) {
case 'CCTV设备布局图':
//drawAssistantsTypes.push(CCTVButton.Type);
case '电扶梯':
drawAssistantsTypes.push(Escalator.Type);
break;
case '火灾报警平面图':
drawAssistantsTypes.push(FasFailureControlHost.Type);

View File

@ -11,9 +11,10 @@ export namespace iscsGraphicData {
constructor(data?: any[] | {
cctvOfEquipmentLayoutStorages?: CCTVOfEquipmentLayoutStorage[];
fasOfPlatformAlarmStorages?: FASOfPlatformAlarmStorage[];
basOfEscalatorStorages?: BASOfEscalatorStorage[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("cctvOfEquipmentLayoutStorages" in data && data.cctvOfEquipmentLayoutStorages != undefined) {
this.cctvOfEquipmentLayoutStorages = data.cctvOfEquipmentLayoutStorages;
@ -21,6 +22,9 @@ export namespace iscsGraphicData {
if ("fasOfPlatformAlarmStorages" in data && data.fasOfPlatformAlarmStorages != undefined) {
this.fasOfPlatformAlarmStorages = data.fasOfPlatformAlarmStorages;
}
if ("basOfEscalatorStorages" in data && data.basOfEscalatorStorages != undefined) {
this.basOfEscalatorStorages = data.basOfEscalatorStorages;
}
}
}
get cctvOfEquipmentLayoutStorages() {
@ -35,9 +39,16 @@ export namespace iscsGraphicData {
set fasOfPlatformAlarmStorages(value: FASOfPlatformAlarmStorage[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
get basOfEscalatorStorages() {
return pb_1.Message.getRepeatedWrapperField(this, BASOfEscalatorStorage, 3) as BASOfEscalatorStorage[];
}
set basOfEscalatorStorages(value: BASOfEscalatorStorage[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
static fromObject(data: {
cctvOfEquipmentLayoutStorages?: ReturnType<typeof CCTVOfEquipmentLayoutStorage.prototype.toObject>[];
fasOfPlatformAlarmStorages?: ReturnType<typeof FASOfPlatformAlarmStorage.prototype.toObject>[];
basOfEscalatorStorages?: ReturnType<typeof BASOfEscalatorStorage.prototype.toObject>[];
}): IscsGraphicStorage {
const message = new IscsGraphicStorage({});
if (data.cctvOfEquipmentLayoutStorages != null) {
@ -46,12 +57,16 @@ export namespace iscsGraphicData {
if (data.fasOfPlatformAlarmStorages != null) {
message.fasOfPlatformAlarmStorages = data.fasOfPlatformAlarmStorages.map(item => FASOfPlatformAlarmStorage.fromObject(item));
}
if (data.basOfEscalatorStorages != null) {
message.basOfEscalatorStorages = data.basOfEscalatorStorages.map(item => BASOfEscalatorStorage.fromObject(item));
}
return message;
}
toObject() {
const data: {
cctvOfEquipmentLayoutStorages?: ReturnType<typeof CCTVOfEquipmentLayoutStorage.prototype.toObject>[];
fasOfPlatformAlarmStorages?: ReturnType<typeof FASOfPlatformAlarmStorage.prototype.toObject>[];
basOfEscalatorStorages?: ReturnType<typeof BASOfEscalatorStorage.prototype.toObject>[];
} = {};
if (this.cctvOfEquipmentLayoutStorages != null) {
data.cctvOfEquipmentLayoutStorages = this.cctvOfEquipmentLayoutStorages.map((item: CCTVOfEquipmentLayoutStorage) => item.toObject());
@ -59,6 +74,9 @@ export namespace iscsGraphicData {
if (this.fasOfPlatformAlarmStorages != null) {
data.fasOfPlatformAlarmStorages = this.fasOfPlatformAlarmStorages.map((item: FASOfPlatformAlarmStorage) => item.toObject());
}
if (this.basOfEscalatorStorages != null) {
data.basOfEscalatorStorages = this.basOfEscalatorStorages.map((item: BASOfEscalatorStorage) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
@ -69,6 +87,8 @@ export namespace iscsGraphicData {
writer.writeRepeatedMessage(1, this.cctvOfEquipmentLayoutStorages, (item: CCTVOfEquipmentLayoutStorage) => item.serialize(writer));
if (this.fasOfPlatformAlarmStorages.length)
writer.writeRepeatedMessage(2, this.fasOfPlatformAlarmStorages, (item: FASOfPlatformAlarmStorage) => item.serialize(writer));
if (this.basOfEscalatorStorages.length)
writer.writeRepeatedMessage(3, this.basOfEscalatorStorages, (item: BASOfEscalatorStorage) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -84,6 +104,9 @@ export namespace iscsGraphicData {
case 2:
reader.readMessage(message.fasOfPlatformAlarmStorages, () => pb_1.Message.addToRepeatedWrapperField(message, 2, FASOfPlatformAlarmStorage.deserialize(reader), FASOfPlatformAlarmStorage));
break;
case 3:
reader.readMessage(message.basOfEscalatorStorages, () => pb_1.Message.addToRepeatedWrapperField(message, 3, BASOfEscalatorStorage.deserialize(reader), BASOfEscalatorStorage));
break;
default: reader.skipField();
}
}
@ -2164,6 +2187,357 @@ export namespace iscsGraphicData {
return TemperatureDetector.deserialize(bytes);
}
}
export class BASOfEscalatorStorage extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
stationName?: string;
canvas?: dependency_1.common.Canvas;
commonGraphicStorage?: CommonGraphicStorage;
escalators?: Escalator[];
verticalElevator?: VerticalElevator[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("stationName" in data && data.stationName != undefined) {
this.stationName = data.stationName;
}
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
}
if ("commonGraphicStorage" in data && data.commonGraphicStorage != undefined) {
this.commonGraphicStorage = data.commonGraphicStorage;
}
if ("escalators" in data && data.escalators != undefined) {
this.escalators = data.escalators;
}
if ("verticalElevator" in data && data.verticalElevator != undefined) {
this.verticalElevator = data.verticalElevator;
}
}
}
get stationName() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set stationName(value: string) {
pb_1.Message.setField(this, 1, value);
}
get canvas() {
return pb_1.Message.getWrapperField(this, dependency_1.common.Canvas, 2) as dependency_1.common.Canvas;
}
set canvas(value: dependency_1.common.Canvas) {
pb_1.Message.setWrapperField(this, 2, value);
}
get has_canvas() {
return pb_1.Message.getField(this, 2) != null;
}
get commonGraphicStorage() {
return pb_1.Message.getWrapperField(this, CommonGraphicStorage, 3) as CommonGraphicStorage;
}
set commonGraphicStorage(value: CommonGraphicStorage) {
pb_1.Message.setWrapperField(this, 3, value);
}
get has_commonGraphicStorage() {
return pb_1.Message.getField(this, 3) != null;
}
get escalators() {
return pb_1.Message.getRepeatedWrapperField(this, Escalator, 4) as Escalator[];
}
set escalators(value: Escalator[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get verticalElevator() {
return pb_1.Message.getRepeatedWrapperField(this, VerticalElevator, 5) as VerticalElevator[];
}
set verticalElevator(value: VerticalElevator[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
static fromObject(data: {
stationName?: string;
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>;
commonGraphicStorage?: ReturnType<typeof CommonGraphicStorage.prototype.toObject>;
escalators?: ReturnType<typeof Escalator.prototype.toObject>[];
verticalElevator?: ReturnType<typeof VerticalElevator.prototype.toObject>[];
}): BASOfEscalatorStorage {
const message = new BASOfEscalatorStorage({});
if (data.stationName != null) {
message.stationName = data.stationName;
}
if (data.canvas != null) {
message.canvas = dependency_1.common.Canvas.fromObject(data.canvas);
}
if (data.commonGraphicStorage != null) {
message.commonGraphicStorage = CommonGraphicStorage.fromObject(data.commonGraphicStorage);
}
if (data.escalators != null) {
message.escalators = data.escalators.map(item => Escalator.fromObject(item));
}
if (data.verticalElevator != null) {
message.verticalElevator = data.verticalElevator.map(item => VerticalElevator.fromObject(item));
}
return message;
}
toObject() {
const data: {
stationName?: string;
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>;
commonGraphicStorage?: ReturnType<typeof CommonGraphicStorage.prototype.toObject>;
escalators?: ReturnType<typeof Escalator.prototype.toObject>[];
verticalElevator?: ReturnType<typeof VerticalElevator.prototype.toObject>[];
} = {};
if (this.stationName != null) {
data.stationName = this.stationName;
}
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
}
if (this.commonGraphicStorage != null) {
data.commonGraphicStorage = this.commonGraphicStorage.toObject();
}
if (this.escalators != null) {
data.escalators = this.escalators.map((item: Escalator) => item.toObject());
}
if (this.verticalElevator != null) {
data.verticalElevator = this.verticalElevator.map((item: VerticalElevator) => 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.stationName.length)
writer.writeString(1, this.stationName);
if (this.has_canvas)
writer.writeMessage(2, this.canvas, () => this.canvas.serialize(writer));
if (this.has_commonGraphicStorage)
writer.writeMessage(3, this.commonGraphicStorage, () => this.commonGraphicStorage.serialize(writer));
if (this.escalators.length)
writer.writeRepeatedMessage(4, this.escalators, (item: Escalator) => item.serialize(writer));
if (this.verticalElevator.length)
writer.writeRepeatedMessage(5, this.verticalElevator, (item: VerticalElevator) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BASOfEscalatorStorage {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BASOfEscalatorStorage();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.stationName = reader.readString();
break;
case 2:
reader.readMessage(message.canvas, () => message.canvas = dependency_1.common.Canvas.deserialize(reader));
break;
case 3:
reader.readMessage(message.commonGraphicStorage, () => message.commonGraphicStorage = CommonGraphicStorage.deserialize(reader));
break;
case 4:
reader.readMessage(message.escalators, () => pb_1.Message.addToRepeatedWrapperField(message, 4, Escalator.deserialize(reader), Escalator));
break;
case 5:
reader.readMessage(message.verticalElevator, () => pb_1.Message.addToRepeatedWrapperField(message, 5, VerticalElevator.deserialize(reader), VerticalElevator));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): BASOfEscalatorStorage {
return BASOfEscalatorStorage.deserialize(bytes);
}
}
export class Escalator extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.common.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.common.CommonInfo, 1) as dependency_1.common.CommonInfo;
}
set common(value: dependency_1.common.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.common.CommonInfo.prototype.toObject>;
code?: string;
}): Escalator {
const message = new Escalator({});
if (data.common != null) {
message.common = dependency_1.common.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.common.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): Escalator {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Escalator();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.common.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): Escalator {
return Escalator.deserialize(bytes);
}
}
export class VerticalElevator extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.common.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.common.CommonInfo, 1) as dependency_1.common.CommonInfo;
}
set common(value: dependency_1.common.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.common.CommonInfo.prototype.toObject>;
code?: string;
}): VerticalElevator {
const message = new VerticalElevator({});
if (data.common != null) {
message.common = dependency_1.common.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.common.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): VerticalElevator {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VerticalElevator();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.common.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): VerticalElevator {
return VerticalElevator.deserialize(bytes);
}
}
export class CCTVOfEquipmentLayoutStorage extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {