添加车库门盒子

This commit is contained in:
joylink_fanyuhong 2024-03-21 09:11:07 +08:00
parent eee398eaa1
commit ec135451d4
14 changed files with 2321 additions and 7 deletions

View File

@ -32,6 +32,11 @@
<path d="M14.4091 23V11.3636H18.3409C19.2538 11.3636 20 11.5284 20.5795 11.858C21.1629 12.1837 21.5947 12.625 21.875 13.1818C22.1553 13.7386 22.2955 14.3598 22.2955 15.0455C22.2955 15.7311 22.1553 16.3542 21.875 16.9148C21.5985 17.4754 21.1705 17.9223 20.5909 18.2557C20.0114 18.5852 19.2689 18.75 18.3636 18.75H15.5455V17.5H18.3182C18.9432 17.5 19.4451 17.392 19.8239 17.1761C20.2027 16.9602 20.4773 16.6686 20.6477 16.3011C20.822 15.9299 20.9091 15.5114 20.9091 15.0455C20.9091 14.5795 20.822 14.1629 20.6477 13.7955C20.4773 13.428 20.2008 13.1402 19.8182 12.9318C19.4356 12.7197 18.928 12.6136 18.2955 12.6136H15.8182V23H14.4091Z" fill="white"/> <path d="M14.4091 23V11.3636H18.3409C19.2538 11.3636 20 11.5284 20.5795 11.858C21.1629 12.1837 21.5947 12.625 21.875 13.1818C22.1553 13.7386 22.2955 14.3598 22.2955 15.0455C22.2955 15.7311 22.1553 16.3542 21.875 16.9148C21.5985 17.4754 21.1705 17.9223 20.5909 18.2557C20.0114 18.5852 19.2689 18.75 18.3636 18.75H15.5455V17.5H18.3182C18.9432 17.5 19.4451 17.392 19.8239 17.1761C20.2027 16.9602 20.4773 16.6686 20.6477 16.3011C20.822 15.9299 20.9091 15.5114 20.9091 15.0455C20.9091 14.5795 20.822 14.1629 20.6477 13.7955C20.4773 13.428 20.2008 13.1402 19.8182 12.9318C19.4356 12.7197 18.928 12.6136 18.2955 12.6136H15.8182V23H14.4091Z" fill="white"/>
<line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/> <line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/>
</symbol> </symbol>
<symbol id="icon-garage-door-box" viewBox="0 0 35 34" fill="none">
<rect x="1" y="1" width="33" height="32" stroke="white" stroke-width="2"/>
<path d="M17.1932 14C17.0838 13.6652 16.9396 13.3653 16.7607 13.1001C16.585 12.8317 16.3745 12.603 16.1293 12.4141C15.8873 12.2251 15.6122 12.081 15.304 11.9815C14.9957 11.8821 14.6577 11.8324 14.2898 11.8324C13.6866 11.8324 13.138 11.9882 12.6442 12.2997C12.1503 12.6113 11.7576 13.0703 11.4659 13.6768C11.1742 14.2834 11.0284 15.0275 11.0284 15.9091C11.0284 16.7907 11.1759 17.5348 11.4709 18.1413C11.7659 18.7479 12.1652 19.2069 12.669 19.5185C13.1728 19.83 13.7396 19.9858 14.3693 19.9858C14.9527 19.9858 15.4664 19.8615 15.9105 19.6129C16.358 19.361 16.706 19.0064 16.9545 18.549C17.2064 18.0883 17.3324 17.5464 17.3324 16.9233L17.7102 17.0028H14.6477V15.9091H18.5256V17.0028C18.5256 17.8414 18.3466 18.5705 17.9886 19.1903C17.634 19.8101 17.1435 20.2907 16.517 20.6321C15.8939 20.9702 15.178 21.1392 14.3693 21.1392C13.4678 21.1392 12.6757 20.9271 11.9929 20.5028C11.3134 20.0786 10.7831 19.4754 10.402 18.6932C10.0241 17.911 9.83523 16.983 9.83523 15.9091C9.83523 15.1037 9.94295 14.3795 10.1584 13.7365C10.3771 13.0902 10.6854 12.54 11.0831 12.0859C11.4808 11.6319 11.9515 11.2839 12.495 11.0419C13.0386 10.8 13.6368 10.679 14.2898 10.679C14.8267 10.679 15.3272 10.7602 15.7912 10.9226C16.2585 11.0817 16.6745 11.3087 17.0391 11.6037C17.407 11.8954 17.7135 12.245 17.9588 12.6527C18.2041 13.0571 18.3731 13.5062 18.4659 14H17.1932Z" fill="white"/>
<line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/>
</symbol>
<symbol id="icon-esb-button" viewBox="0 0 35 34" fill="none"> <symbol id="icon-esb-button" viewBox="0 0 35 34" fill="none">
<rect x="1" y="1" width="33" height="32" stroke="white" stroke-width="2"/> <rect x="1" y="1" width="33" height="32" stroke="white" stroke-width="2"/>
<line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/> <line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

@ -1 +1 @@
Subproject commit 6dff8221d5e43e87727328fcd3260559ff13a2a3 Subproject commit b748c7ff3ed7d401c8caeaecd3d4ec719ae27ee2

View File

@ -148,6 +148,9 @@
<garage-door-property <garage-door-property
v-else-if="drawStore.selectedGraphicType === GarageDoor.Type" v-else-if="drawStore.selectedGraphicType === GarageDoor.Type"
></garage-door-property> ></garage-door-property>
<garage-door-box-property
v-else-if="drawStore.selectedGraphicType === GarageDoorBox.Type"
></garage-door-box-property>
</q-card-section> </q-card-section>
</template> </template>
<template v-else-if="drawStore.selectedGraphics.length > 1"> <template v-else-if="drawStore.selectedGraphics.length > 1">
@ -232,6 +235,8 @@ import GarageDoorProperty from './properties/GarageDoorProperty.vue';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor'; import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import CarWashingProperty from './properties/CarWashingProperty.vue'; import CarWashingProperty from './properties/CarWashingProperty.vue';
import { CarWashing } from 'src/graphics/carWashing/CarWashing'; import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import GarageDoorBoxProperty from './properties/GarageDoorBoxProperty.vue';
import { GarageDoorBox } from 'src/graphics/garageDoorBox/GarageDoorBox';
const drawStore = useDrawStore(); const drawStore = useDrawStore();
</script> </script>

View File

@ -0,0 +1,78 @@
<template>
<q-form>
<q-input
outlined
readonly
v-model="garageDoorBoxModel.id"
label="id"
hint=""
/>
<q-input
outlined
class="q-mt-sm"
v-model="garageDoorBoxModel.code"
@blur="onUpdate"
label="编号"
/>
<q-select
outlined
class="q-mt-sm"
style="margin-top: 10px"
v-model="garageDoorBoxModel.refGarageDoorId"
:options="garageDoorList"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="关联屏蔽门"
></q-select>
<q-select
outlined
class="q-mt-sm"
@blur="onUpdate"
v-model="garageDoorBoxModel.refPslMapCode"
:options="pslNameList"
label="关联PSL地图"
/>
</q-form>
</template>
<script setup lang="ts">
import { GarageDoorBoxData } from 'src/drawApp/graphics/GarageDoorBoxInteraction';
import { useFormData } from 'src/components/DrawAppFormUtils';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive, ref } from 'vue';
import { getPublishList } from 'src/api/PublishApi';
import { PictureType } from 'src/protos/picture';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
const { data: garageDoorBoxModel, onUpdate } = useFormData(
new GarageDoorBoxData(),
useDrawStore().getDrawApp()
);
const garageDoorList: { label: string; value: number }[] = reactive([]);
const pslNameList = ref<string[]>([]);
onMounted(() => {
const list2: string[] = [];
getPublishList({
type: PictureType.Psl,
category: useDrawStore().categoryType,
}).then((pslMapList) => {
if (pslMapList && pslMapList.length) {
pslMapList.forEach((item) => {
list2.push(item.name);
});
}
pslNameList.value = list2;
});
const garageDoors = useDrawStore()
.getDrawApp()
.queryStore.queryByType<GarageDoor>(GarageDoor.Type);
garageDoors.forEach((p) => {
garageDoorList.push({
value: p.id,
label: `${p.datas.code}[${p.datas.id}]`,
});
});
});
</script>

View File

@ -24,6 +24,7 @@ import { PslBox } from 'src/graphics/pslBox/PslBox';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor'; import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import { CarWashing } from 'src/graphics/carWashing/CarWashing'; import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { FloodGate } from 'src/graphics/floodGate/FloodGate'; import { FloodGate } from 'src/graphics/floodGate/FloodGate';
import { GarageDoorBox } from 'src/graphics/garageDoorBox/GarageDoorBox';
export const drawCommonLayerList = [ export const drawCommonLayerList = [
// 图层列表 默认显示的图层defaultShow: true // 图层列表 默认显示的图层defaultShow: true
@ -61,4 +62,5 @@ export const drawCommonLayerList = [
{ label: '车库门', value: GarageDoor.Type, defaultShow: true }, { label: '车库门', value: GarageDoor.Type, defaultShow: true },
{ label: '防淹门', value: FloodGate.Type, defaultShow: true }, { label: '防淹门', value: FloodGate.Type, defaultShow: true },
{ label: '洗车机', value: CarWashing.Type, defaultShow: true }, { label: '洗车机', value: CarWashing.Type, defaultShow: true },
{ label: '车库门设置', value: GarageDoorBox.Type, defaultShow: true },
]; ];

View File

@ -96,6 +96,15 @@ import {
GatedBoxData, GatedBoxData,
DrawGatedBoxInteraction, DrawGatedBoxInteraction,
} from './graphics/GatedBoxInteraction'; } from './graphics/GatedBoxInteraction';
import {
GarageDoorBox,
GarageDoorBoxTemplate,
} from 'src/graphics/garageDoorBox/GarageDoorBox';
import {
GarageDoorBoxData,
DrawGarageDoorBoxInteraction,
} from './graphics/GarageDoorBoxInteraction';
import { GarageDoorBoxDraw } from 'src/graphics/garageDoorBox/GarageDoorBoxAssistant';
// import { EsbButton, EsbButtonTemplate } from 'src/graphics/esbButton/EsbButton'; // import { EsbButton, EsbButtonTemplate } from 'src/graphics/esbButton/EsbButton';
// import { // import {
// EsbButtonData, // EsbButtonData,
@ -223,6 +232,10 @@ export function initCommonDrawApp(app: IDrawApp) {
new StopPositionDraw(app, new StopPositionTemplate(new StopPositionData())); new StopPositionDraw(app, new StopPositionTemplate(new StopPositionData()));
new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData())); new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData()));
new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData())); new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData()));
new GarageDoorBoxDraw(
app,
new GarageDoorBoxTemplate(new GarageDoorBoxData())
);
// new EsbButtonDraw( // new EsbButtonDraw(
// app, // app,
// new EsbButtonTemplate(new EsbButtonData(), new EsbButtonState()) // new EsbButtonTemplate(new EsbButtonData(), new EsbButtonState())
@ -250,6 +263,7 @@ export function initCommonDrawApp(app: IDrawApp) {
DrawStopPositionInteraction.init(app); DrawStopPositionInteraction.init(app);
DrawSpksSwitchInteraction.init(app); DrawSpksSwitchInteraction.init(app);
DrawGatedBoxInteraction.init(app); DrawGatedBoxInteraction.init(app);
DrawGarageDoorBoxInteraction.init(app);
// DrawEsbButtonInteraction.init(app); // DrawEsbButtonInteraction.init(app);
// 画布右键菜单 // 画布右键菜单
@ -431,6 +445,9 @@ export function loadCommonDrawDatas(
storage.gateBoxs.forEach((gatedBox) => { storage.gateBoxs.forEach((gatedBox) => {
datas.push(new GatedBoxData(gatedBox)); datas.push(new GatedBoxData(gatedBox));
}); });
storage.garageDoorBoxes.forEach((garageDoorBox) => {
datas.push(new GarageDoorBoxData(garageDoorBox));
});
// storage.esbButtons.forEach((esbButton) => { // storage.esbButtons.forEach((esbButton) => {
// datas.push(new EsbButtonData(esbButton)); // datas.push(new EsbButtonData(esbButton));
// }); // });
@ -523,6 +540,11 @@ export function saveCommonDrawDatas(app: IDrawApp) {
// } else if (EsbButton.Type === g.type) { // } else if (EsbButton.Type === g.type) {
// const esbButtonData = (g as EsbButton).saveData(); // const esbButtonData = (g as EsbButton).saveData();
// storage.esbButtons.push((esbButtonData as EsbButtonData).data); // storage.esbButtons.push((esbButtonData as EsbButtonData).data);
} else if (GarageDoorBox.Type === g.type) {
const garageDoorBoxData = (g as GarageDoorBox).saveData();
storage.garageDoorBoxes.push(
(garageDoorBoxData as GarageDoorBoxData).data
);
} else if (Transponder.Type === g.type) { } else if (Transponder.Type === g.type) {
const transponderData = (g as Transponder).saveData(); const transponderData = (g as Transponder).saveData();
storage.transponders.push((transponderData as TransponderData).data); storage.transponders.push((transponderData as TransponderData).data);

View File

@ -0,0 +1,150 @@
import * as pb_1 from 'google-protobuf';
import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
import {
GarageDoorBox,
IGarageDoorBox,
} from 'src/graphics/garageDoorBox/GarageDoorBox';
import {
IGraphicApp,
GraphicInteractionPlugin,
JlGraphic,
IGraphicScene,
MenuItemOptions,
ContextMenu,
} from 'jl-graphic';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { GraphicDataBase } from './GraphicDataBase';
import { usePslStore } from 'src/stores/psl-store';
export class GarageDoorBoxData
extends GraphicDataBase
implements IGarageDoorBox
{
constructor(data?: graphicData.GarageDoorBox) {
let garageDoorBox;
if (!data) {
garageDoorBox = new graphicData.GarageDoorBox({
common: GraphicDataBase.defaultCommonInfo(GarageDoorBox.Type),
});
} else {
garageDoorBox = data;
}
super(garageDoorBox);
}
public get data(): graphicData.GarageDoorBox {
return this.getData<graphicData.GarageDoorBox>();
}
get code(): string {
return this.data.code;
}
set code(v: string) {
this.data.code = v;
}
get flip(): boolean {
return this.data.flip;
}
set flip(v: boolean) {
this.data.flip = v;
}
get refGarageDoorId(): number {
return this.data.refGarageDoorId;
}
set refGarageDoorId(v: number) {
this.data.refGarageDoorId = v;
}
get refPslMapCode(): string {
return this.data.refPslMapCode;
}
set refPslMapCode(v: string) {
this.data.refPslMapCode = v;
}
clone(): GarageDoorBoxData {
return new GarageDoorBoxData(this.data.cloneMessage());
}
copyFrom(data: GarageDoorBoxData): void {
pb_1.Message.copyInto(data.data, this.data);
}
eq(other: GarageDoorBoxData): boolean {
return pb_1.Message.equals(this.data, other.data);
}
}
const flipConfig: MenuItemOptions = {
name: '上下翻转',
};
const GarageDoorBoxEditMenu: ContextMenu = ContextMenu.init({
name: '设置车库门编辑菜单',
groups: [
{
items: [flipConfig],
},
],
});
export class DrawGarageDoorBoxInteraction extends GraphicInteractionPlugin<GarageDoorBox> {
static Name = 'garage_door_box_draw_right_menu';
constructor(app: IGraphicApp) {
super(DrawGarageDoorBoxInteraction.Name, app);
app.registerMenu(GarageDoorBoxEditMenu);
}
static init(app: IGraphicApp) {
return new DrawGarageDoorBoxInteraction(app);
}
filter(...grahpics: JlGraphic[]): GarageDoorBox[] | undefined {
return grahpics
.filter((g) => g.type === GarageDoorBox.Type)
.map((g) => g as GarageDoorBox);
}
bind(g: GarageDoorBox): void {
g.on('_rightclick', this.onContextMenu, this);
}
unbind(g: GarageDoorBox): void {
g.off('_rightclick', this.onContextMenu, this);
}
onContextMenu(e: FederatedMouseEvent) {
const target = e.target as DisplayObject;
const garageDoorBox = target.getGraphic() as GarageDoorBox;
this.app.updateSelected(garageDoorBox);
flipConfig.handler = () => {
garageDoorBox.datas.flip = !garageDoorBox.datas.flip;
garageDoorBox.repaint();
};
GarageDoorBoxEditMenu.open(e.global);
}
}
export class GarageDoorBoxOperateInteraction extends GraphicInteractionPlugin<GarageDoorBox> {
static Name = 'garage_door_box_operate_menu';
constructor(app: IGraphicScene) {
super(GarageDoorBoxOperateInteraction.Name, app);
}
static init(app: IGraphicScene) {
return new GarageDoorBoxOperateInteraction(app);
}
filter(...grahpics: JlGraphic[]): GarageDoorBox[] | undefined {
return grahpics
.filter((g) => g.type === GarageDoorBox.Type)
.map((g) => g as GarageDoorBox);
}
bind(g: GarageDoorBox): void {
g.eventMode = 'static';
g.cursor = 'pointer';
g.on('_leftclick', this.onLeftClick, this);
}
unbind(g: GarageDoorBox): void {
g.eventMode = 'none';
g.off('_leftclick', this.onLeftClick, this);
}
onLeftClick(e: FederatedMouseEvent) {
const target = e.target as DisplayObject;
const garageDoorBox = target.getGraphic() as GarageDoorBox;
usePslStore().setPslParam(
garageDoorBox.datas.id,
garageDoorBox.datas.refPslMapCode
);
}
}

View File

@ -128,6 +128,11 @@ import {
SpksSwitchOperationInteraction, SpksSwitchOperationInteraction,
} from './graphics/SpksSwitchInteraction'; } from './graphics/SpksSwitchInteraction';
import { GatedBoxData } from './graphics/GatedBoxInteraction'; import { GatedBoxData } from './graphics/GatedBoxInteraction';
import { GarageDoorBoxData } from './graphics/GarageDoorBoxInteraction';
import {
GarageDoorBox,
GarageDoorBoxTemplate,
} from 'src/graphics/garageDoorBox/GarageDoorBox';
import { import {
EsbButtonData, EsbButtonData,
EsbButtonOperationInteraction, EsbButtonOperationInteraction,
@ -169,6 +174,7 @@ import {
} from 'src/graphics/trackLogicSection/TrackLogicSection'; } from 'src/graphics/trackLogicSection/TrackLogicSection';
import { TrackLogicSectionData } from './graphics/TrackLogicSectionInteraction'; import { TrackLogicSectionData } from './graphics/TrackLogicSectionInteraction';
import { GatedBoxOperateInteraction } from './graphics/GatedBoxInteraction'; import { GatedBoxOperateInteraction } from './graphics/GatedBoxInteraction';
import { GarageDoorBoxOperateInteraction } from './graphics/GarageDoorBoxInteraction';
import { CategoryType } from 'src/components/CategoryType'; import { CategoryType } from 'src/components/CategoryType';
import { import {
AutoReturnBox, AutoReturnBox,
@ -257,6 +263,7 @@ export const layerList = [
{ label: '车库门', value: GarageDoor.Type, defaultShow: true }, { label: '车库门', value: GarageDoor.Type, defaultShow: true },
{ label: '防淹门', value: FloodGate.Type, defaultShow: true }, { label: '防淹门', value: FloodGate.Type, defaultShow: true },
{ label: '洗车机', value: CarWashing.Type, defaultShow: true }, { label: '洗车机', value: CarWashing.Type, defaultShow: true },
{ label: '车库门设置', value: GarageDoorBox.Type, defaultShow: true },
]; ];
let lineScene: IGraphicScene; let lineScene: IGraphicScene;
@ -328,6 +335,7 @@ export function initLineScene(lineApp: IGraphicApp, sceneName: string) {
new CarWashingTemplate(new CarWashingData()), new CarWashingTemplate(new CarWashingData()),
new GarageDoorTemplate(new GarageDoorData()), new GarageDoorTemplate(new GarageDoorData()),
new FloodGateTemplate(new FloodGateData()), new FloodGateTemplate(new FloodGateData()),
new GarageDoorBoxTemplate(new GarageDoorBoxData()),
]; ];
lineScene.registerGraphicTemplates(...graphicTemplate); lineScene.registerGraphicTemplates(...graphicTemplate);
SignalOperateInteraction.init(lineScene); SignalOperateInteraction.init(lineScene);
@ -347,6 +355,7 @@ export function initLineScene(lineApp: IGraphicApp, sceneName: string) {
CarWashingOperationInteraction.init(lineScene); CarWashingOperationInteraction.init(lineScene);
GarageDoorOperationInteraction.init(lineScene); GarageDoorOperationInteraction.init(lineScene);
FloodGateOperationInteraction.init(lineScene); FloodGateOperationInteraction.init(lineScene);
GarageDoorBoxOperateInteraction.init(lineScene);
if (categoryType === CategoryType.TH) { if (categoryType === CategoryType.TH) {
GatedBoxOperateInteraction.init(lineScene); GatedBoxOperateInteraction.init(lineScene);
} }
@ -651,6 +660,9 @@ export async function loadLineDatas(): Promise<IGraphicStorage> {
storage.floodGates.forEach((floodGate) => { storage.floodGates.forEach((floodGate) => {
datas.push(new FloodGateData(floodGate)); datas.push(new FloodGateData(floodGate));
}); });
storage.garageDoorBoxes.forEach((garageDoorBox) => {
datas.push(new GarageDoorBoxData(garageDoorBox));
});
// const linkIdGenerator = new IdGenerator(Link.Type); // const linkIdGenerator = new IdGenerator(Link.Type);
// storage.CalculateLink.forEach((link) => { // storage.CalculateLink.forEach((link) => {
// const g = new LinkData(link); // const g = new LinkData(link);

View File

@ -0,0 +1,110 @@
import { Graphics } from 'pixi.js';
import {
GraphicData,
JlGraphic,
JlGraphicTemplate,
VectorText,
} from 'jl-graphic';
export interface IGarageDoorBox extends GraphicData {
get code(): string;
set code(v: string);
get flip(): boolean;
set flip(v: boolean);
get refGarageDoorId(): number;
set refGarageDoorId(v: number);
get refPslMapCode(): string;
set refPslMapCode(v: string);
clone(): IGarageDoorBox;
copyFrom(data: IGarageDoorBox): void;
eq(other: IGarageDoorBox): boolean;
}
const garageDoorBoxConsts = {
codeFontSize: 12,
codeColor: 0xffffff,
bodyLineColor: 0xffffff,
bodyLineWidth: 4,
bodyRectLineColor: 0xffffff,
bodyRectLineWidth: 2,
bodyRectWidth: 20,
bodyRectHeight: 20,
bodyColor: 0x000000,
};
export class GarageDoorBox extends JlGraphic {
static Type = 'garageDoorBox';
codeGraph: VectorText = new VectorText('');
rectBody: Graphics = new Graphics();
lineBody: Graphics = new Graphics();
textGraph: VectorText = new VectorText('G');
constructor() {
super(GarageDoorBox.Type);
this.addChild(this.codeGraph);
this.addChild(this.rectBody);
this.addChild(this.lineBody);
this.addChild(this.textGraph);
this.codeGraph.name = 'g_d_b_code';
}
get code(): string {
return this.datas.code;
}
get datas(): IGarageDoorBox {
return this.getDatas<IGarageDoorBox>();
}
doRepaint(): void {
const codeGraph = this.codeGraph;
codeGraph.text = this.datas.code;
codeGraph.style.fill = garageDoorBoxConsts.codeColor;
codeGraph.setVectorFontSize(garageDoorBoxConsts.codeFontSize);
const codeTransform = this.datas?.childTransforms?.find(
(item) => item.name === 'g_d_b_code'
);
if (codeTransform) {
const position = codeTransform?.transform.position;
const rotation = codeTransform?.transform?.rotation;
codeGraph.position.set(position?.x, position?.y);
codeGraph.rotation = rotation || 0;
} else {
codeGraph.position.set(20, 0);
}
codeGraph.anchor.set(0.5);
this.textGraph.style.fill = garageDoorBoxConsts.codeColor;
this.textGraph.setVectorFontSize(garageDoorBoxConsts.codeFontSize);
this.textGraph.anchor.set(0.5);
this.rectBody.clear();
this.rectBody.beginFill(garageDoorBoxConsts.bodyColor, 0);
this.rectBody.lineStyle(
garageDoorBoxConsts.bodyRectLineWidth,
garageDoorBoxConsts.bodyRectLineColor
);
this.rectBody.drawRect(
-garageDoorBoxConsts.bodyRectWidth / 2,
-garageDoorBoxConsts.bodyRectHeight / 2,
garageDoorBoxConsts.bodyRectWidth,
garageDoorBoxConsts.bodyRectHeight
);
this.rectBody.endFill();
this.lineBody.clear();
const lineY = this.datas.flip
? garageDoorBoxConsts.bodyRectHeight / 2
: -garageDoorBoxConsts.bodyRectHeight / 2;
this.lineBody.lineStyle(
garageDoorBoxConsts.bodyLineWidth,
garageDoorBoxConsts.bodyLineColor
);
this.lineBody.moveTo(-garageDoorBoxConsts.bodyRectWidth / 2, lineY);
this.lineBody.lineTo(garageDoorBoxConsts.bodyRectWidth / 2, lineY);
}
}
export class GarageDoorBoxTemplate extends JlGraphicTemplate<GarageDoorBox> {
constructor(dataTemplate: IGarageDoorBox) {
super(GarageDoorBox.Type, { dataTemplate });
}
new(): GarageDoorBox {
const garageDoorBox = new GarageDoorBox();
garageDoorBox.loadData(this.datas);
return garageDoorBox;
}
}

View File

@ -0,0 +1,132 @@
import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
import {
AbsorbableLine,
AbsorbablePosition,
GraphicDrawAssistant,
GraphicInteractionPlugin,
GraphicTransformEvent,
IDrawApp,
JlGraphic,
} from 'jl-graphic';
import {
GarageDoorBox,
GarageDoorBoxTemplate,
IGarageDoorBox,
} from './GarageDoorBox';
export interface IGarageDoorBoxDrawOptions {
newData: () => IGarageDoorBox;
}
export class GarageDoorBoxDraw extends GraphicDrawAssistant<
GarageDoorBoxTemplate,
IGarageDoorBox
> {
_garageDoorBox: GarageDoorBox | null = null;
constructor(app: IDrawApp, template: GarageDoorBoxTemplate) {
super(
app,
template,
'svguse:../../drawIcon.svg#icon-garage-door-box',
'设置车库门GarageDoorBox'
);
GarageDoorBoxInteraction.init(app);
}
public get garageDoorBox(): GarageDoorBox {
if (!this._garageDoorBox) {
this._garageDoorBox = this.graphicTemplate.new();
this._garageDoorBox.loadData(this.graphicTemplate.datas);
this.container.addChild(this._garageDoorBox);
}
return this._garageDoorBox;
}
onLeftUp(e: FederatedMouseEvent): void {
this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
this.createAndStore(true);
}
redraw(p: Point): void {
this.garageDoorBox.repaint();
this.container.position.set(p.x, p.y);
}
prepareData(data: IGarageDoorBox): boolean {
data.transform = this.container.saveTransform();
data.code = 'G';
return true;
}
}
/**
* 线
* @param garageDoorBox
*/
function buildAbsorbablePositions(
garageDoorBox: GarageDoorBox
): AbsorbablePosition[] {
const aps: AbsorbablePosition[] = [];
const garageDoorBoxs = garageDoorBox.queryStore.queryByType<GarageDoorBox>(
GarageDoorBox.Type
);
const canvas = garageDoorBox.getCanvas();
garageDoorBoxs.forEach((item) => {
if (item.id === garageDoorBox.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 GarageDoorBoxInteraction extends GraphicInteractionPlugin<GarageDoorBox> {
static Name = 'garage_door_box_transform';
constructor(app: IDrawApp) {
super(GarageDoorBoxInteraction.Name, app);
}
static init(app: IDrawApp) {
return new GarageDoorBoxInteraction(app);
}
filter(...grahpics: JlGraphic[]): GarageDoorBox[] | undefined {
return grahpics
.filter((g) => g.type === GarageDoorBox.Type)
.map((g) => g as GarageDoorBox);
}
bind(g: GarageDoorBox): void {
g.eventMode = 'static';
g.cursor = 'pointer';
g.scalable = true;
g.rotatable = true;
g.codeGraph.draggable = true;
g.codeGraph.selectable = true;
g.codeGraph.rotatable = true;
g.codeGraph.transformSave = true;
g.codeGraph.eventMode = 'static';
g.on('transformstart', this.transformstart, this);
}
unbind(g: GarageDoorBox): void {
g.eventMode = 'none';
g.scalable = false;
g.rotatable = false;
g.codeGraph.draggable = false;
g.codeGraph.selectable = false;
g.codeGraph.rotatable = false;
g.codeGraph.transformSave = false;
g.codeGraph.eventMode = 'none';
g.off('transformstart', this.transformstart, this);
}
transformstart(e: GraphicTransformEvent) {
const target = e.target as DisplayObject;
const garageDoorBox = target.getGraphic() as GarageDoorBox;
garageDoorBox.getGraphicApp().setOptions({
absorbablePositions: buildAbsorbablePositions(garageDoorBox),
});
}
}

View File

@ -277,6 +277,7 @@ import { PslBox } from 'src/graphics/pslBox/PslBox';
import { CarWashing } from 'src/graphics/carWashing/CarWashing'; import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { FloodGate } from 'src/graphics/floodGate/FloodGate'; import { FloodGate } from 'src/graphics/floodGate/FloodGate';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor'; import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import { GarageDoorBox } from 'src/graphics/garageDoorBox/GarageDoorBox';
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
@ -445,6 +446,7 @@ onMounted(() => {
CarWashing.Type, CarWashing.Type,
FloodGate.Type, FloodGate.Type,
GarageDoor.Type, GarageDoor.Type,
GarageDoorBox.Type,
]; ];
switch (drawStore.categoryType) { switch (drawStore.categoryType) {
case CategoryType.TH: case CategoryType.TH:

View File

@ -1020,6 +1020,7 @@ export namespace state {
constructor(data?: any[] | { constructor(data?: any[] | {
conn?: boolean; conn?: boolean;
connType?: TrainConnState.TrainConnType; connType?: TrainConnState.TrainConnType;
TrainControlMapId?: number;
}) { }) {
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);
@ -1030,6 +1031,9 @@ export namespace state {
if ("connType" in data && data.connType != undefined) { if ("connType" in data && data.connType != undefined) {
this.connType = data.connType; this.connType = data.connType;
} }
if ("TrainControlMapId" in data && data.TrainControlMapId != undefined) {
this.TrainControlMapId = data.TrainControlMapId;
}
} }
} }
get conn() { get conn() {
@ -1044,9 +1048,16 @@ export namespace state {
set connType(value: TrainConnState.TrainConnType) { set connType(value: TrainConnState.TrainConnType) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get TrainControlMapId() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set TrainControlMapId(value: number) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: { static fromObject(data: {
conn?: boolean; conn?: boolean;
connType?: TrainConnState.TrainConnType; connType?: TrainConnState.TrainConnType;
TrainControlMapId?: number;
}): TrainConnState { }): TrainConnState {
const message = new TrainConnState({}); const message = new TrainConnState({});
if (data.conn != null) { if (data.conn != null) {
@ -1055,12 +1066,16 @@ export namespace state {
if (data.connType != null) { if (data.connType != null) {
message.connType = data.connType; message.connType = data.connType;
} }
if (data.TrainControlMapId != null) {
message.TrainControlMapId = data.TrainControlMapId;
}
return message; return message;
} }
toObject() { toObject() {
const data: { const data: {
conn?: boolean; conn?: boolean;
connType?: TrainConnState.TrainConnType; connType?: TrainConnState.TrainConnType;
TrainControlMapId?: number;
} = {}; } = {};
if (this.conn != null) { if (this.conn != null) {
data.conn = this.conn; data.conn = this.conn;
@ -1068,6 +1083,9 @@ export namespace state {
if (this.connType != null) { if (this.connType != null) {
data.connType = this.connType; data.connType = this.connType;
} }
if (this.TrainControlMapId != null) {
data.TrainControlMapId = this.TrainControlMapId;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -1078,6 +1096,8 @@ export namespace state {
writer.writeBool(1, this.conn); writer.writeBool(1, this.conn);
if (this.connType != TrainConnState.TrainConnType.NONE) if (this.connType != TrainConnState.TrainConnType.NONE)
writer.writeEnum(2, this.connType); writer.writeEnum(2, this.connType);
if (this.TrainControlMapId != 0)
writer.writeUint32(3, this.TrainControlMapId);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1093,6 +1113,9 @@ export namespace state {
case 2: case 2:
message.connType = reader.readEnum(); message.connType = reader.readEnum();
break; break;
case 3:
message.TrainControlMapId = reader.readUint32();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -1138,6 +1161,7 @@ export namespace state {
tailOffset?: number; tailOffset?: number;
tailDevicePort?: string; tailDevicePort?: string;
btmState?: BTMState; btmState?: BTMState;
tcc?: TrainControlState;
connState?: TrainConnState; connState?: TrainConnState;
}) { }) {
super(); super();
@ -1212,6 +1236,9 @@ export namespace state {
if ("btmState" in data && data.btmState != undefined) { if ("btmState" in data && data.btmState != undefined) {
this.btmState = data.btmState; this.btmState = data.btmState;
} }
if ("tcc" in data && data.tcc != undefined) {
this.tcc = data.tcc;
}
if ("connState" in data && data.connState != undefined) { if ("connState" in data && data.connState != undefined) {
this.connState = data.connState; this.connState = data.connState;
} }
@ -1373,15 +1400,24 @@ export namespace state {
get has_btmState() { get has_btmState() {
return pb_1.Message.getField(this, 23) != null; return pb_1.Message.getField(this, 23) != null;
} }
get connState() { get tcc() {
return pb_1.Message.getWrapperField(this, TrainConnState, 24) as TrainConnState; return pb_1.Message.getWrapperField(this, TrainControlState, 24) as TrainControlState;
} }
set connState(value: TrainConnState) { set tcc(value: TrainControlState) {
pb_1.Message.setWrapperField(this, 24, value); pb_1.Message.setWrapperField(this, 24, value);
} }
get has_connState() { get has_tcc() {
return pb_1.Message.getField(this, 24) != null; return pb_1.Message.getField(this, 24) != null;
} }
get connState() {
return pb_1.Message.getWrapperField(this, TrainConnState, 25) as TrainConnState;
}
set connState(value: TrainConnState) {
pb_1.Message.setWrapperField(this, 25, value);
}
get has_connState() {
return pb_1.Message.getField(this, 25) != null;
}
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
up?: boolean; up?: boolean;
@ -1406,6 +1442,7 @@ export namespace state {
tailOffset?: number; tailOffset?: number;
tailDevicePort?: string; tailDevicePort?: string;
btmState?: ReturnType<typeof BTMState.prototype.toObject>; btmState?: ReturnType<typeof BTMState.prototype.toObject>;
tcc?: ReturnType<typeof TrainControlState.prototype.toObject>;
connState?: ReturnType<typeof TrainConnState.prototype.toObject>; connState?: ReturnType<typeof TrainConnState.prototype.toObject>;
}): TrainState { }): TrainState {
const message = new TrainState({}); const message = new TrainState({});
@ -1478,6 +1515,9 @@ export namespace state {
if (data.btmState != null) { if (data.btmState != null) {
message.btmState = BTMState.fromObject(data.btmState); message.btmState = BTMState.fromObject(data.btmState);
} }
if (data.tcc != null) {
message.tcc = TrainControlState.fromObject(data.tcc);
}
if (data.connState != null) { if (data.connState != null) {
message.connState = TrainConnState.fromObject(data.connState); message.connState = TrainConnState.fromObject(data.connState);
} }
@ -1508,6 +1548,7 @@ export namespace state {
tailOffset?: number; tailOffset?: number;
tailDevicePort?: string; tailDevicePort?: string;
btmState?: ReturnType<typeof BTMState.prototype.toObject>; btmState?: ReturnType<typeof BTMState.prototype.toObject>;
tcc?: ReturnType<typeof TrainControlState.prototype.toObject>;
connState?: ReturnType<typeof TrainConnState.prototype.toObject>; connState?: ReturnType<typeof TrainConnState.prototype.toObject>;
} = {}; } = {};
if (this.id != null) { if (this.id != null) {
@ -1579,6 +1620,9 @@ export namespace state {
if (this.btmState != null) { if (this.btmState != null) {
data.btmState = this.btmState.toObject(); data.btmState = this.btmState.toObject();
} }
if (this.tcc != null) {
data.tcc = this.tcc.toObject();
}
if (this.connState != null) { if (this.connState != null) {
data.connState = this.connState.toObject(); data.connState = this.connState.toObject();
} }
@ -1634,8 +1678,10 @@ export namespace state {
writer.writeString(22, this.tailDevicePort); writer.writeString(22, this.tailDevicePort);
if (this.has_btmState) if (this.has_btmState)
writer.writeMessage(23, this.btmState, () => this.btmState.serialize(writer)); writer.writeMessage(23, this.btmState, () => this.btmState.serialize(writer));
if (this.has_tcc)
writer.writeMessage(24, this.tcc, () => this.tcc.serialize(writer));
if (this.has_connState) if (this.has_connState)
writer.writeMessage(24, this.connState, () => this.connState.serialize(writer)); writer.writeMessage(25, this.connState, () => this.connState.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1715,6 +1761,9 @@ export namespace state {
reader.readMessage(message.btmState, () => message.btmState = BTMState.deserialize(reader)); reader.readMessage(message.btmState, () => message.btmState = BTMState.deserialize(reader));
break; break;
case 24: case 24:
reader.readMessage(message.tcc, () => message.tcc = TrainControlState.deserialize(reader));
break;
case 25:
reader.readMessage(message.connState, () => message.connState = TrainConnState.deserialize(reader)); reader.readMessage(message.connState, () => message.connState = TrainConnState.deserialize(reader));
break; break;
default: reader.skipField(); default: reader.skipField();
@ -7715,4 +7764,534 @@ export namespace state {
return SimulationThirdPartyApiServiceState.deserialize(bytes); return SimulationThirdPartyApiServiceState.deserialize(bytes);
} }
} }
export class TrainControlState extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
ebutton?: TrainControlState.EmergentButton;
driverKey?: TrainControlState.DriverKeySwitch[];
dirKey?: TrainControlState.DirectionKeySwitch;
pushHandler?: TrainControlState.PushHandler;
}) {
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 ("ebutton" in data && data.ebutton != undefined) {
this.ebutton = data.ebutton;
}
if ("driverKey" in data && data.driverKey != undefined) {
this.driverKey = data.driverKey;
}
if ("dirKey" in data && data.dirKey != undefined) {
this.dirKey = data.dirKey;
}
if ("pushHandler" in data && data.pushHandler != undefined) {
this.pushHandler = data.pushHandler;
}
}
}
get ebutton() {
return pb_1.Message.getWrapperField(this, TrainControlState.EmergentButton, 1) as TrainControlState.EmergentButton;
}
set ebutton(value: TrainControlState.EmergentButton) {
pb_1.Message.setWrapperField(this, 1, value);
}
get has_ebutton() {
return pb_1.Message.getField(this, 1) != null;
}
get driverKey() {
return pb_1.Message.getRepeatedWrapperField(this, TrainControlState.DriverKeySwitch, 2) as TrainControlState.DriverKeySwitch[];
}
set driverKey(value: TrainControlState.DriverKeySwitch[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
get dirKey() {
return pb_1.Message.getWrapperField(this, TrainControlState.DirectionKeySwitch, 3) as TrainControlState.DirectionKeySwitch;
}
set dirKey(value: TrainControlState.DirectionKeySwitch) {
pb_1.Message.setWrapperField(this, 3, value);
}
get has_dirKey() {
return pb_1.Message.getField(this, 3) != null;
}
get pushHandler() {
return pb_1.Message.getWrapperField(this, TrainControlState.PushHandler, 4) as TrainControlState.PushHandler;
}
set pushHandler(value: TrainControlState.PushHandler) {
pb_1.Message.setWrapperField(this, 4, value);
}
get has_pushHandler() {
return pb_1.Message.getField(this, 4) != null;
}
static fromObject(data: {
ebutton?: ReturnType<typeof TrainControlState.EmergentButton.prototype.toObject>;
driverKey?: ReturnType<typeof TrainControlState.DriverKeySwitch.prototype.toObject>[];
dirKey?: ReturnType<typeof TrainControlState.DirectionKeySwitch.prototype.toObject>;
pushHandler?: ReturnType<typeof TrainControlState.PushHandler.prototype.toObject>;
}): TrainControlState {
const message = new TrainControlState({});
if (data.ebutton != null) {
message.ebutton = TrainControlState.EmergentButton.fromObject(data.ebutton);
}
if (data.driverKey != null) {
message.driverKey = data.driverKey.map(item => TrainControlState.DriverKeySwitch.fromObject(item));
}
if (data.dirKey != null) {
message.dirKey = TrainControlState.DirectionKeySwitch.fromObject(data.dirKey);
}
if (data.pushHandler != null) {
message.pushHandler = TrainControlState.PushHandler.fromObject(data.pushHandler);
}
return message;
}
toObject() {
const data: {
ebutton?: ReturnType<typeof TrainControlState.EmergentButton.prototype.toObject>;
driverKey?: ReturnType<typeof TrainControlState.DriverKeySwitch.prototype.toObject>[];
dirKey?: ReturnType<typeof TrainControlState.DirectionKeySwitch.prototype.toObject>;
pushHandler?: ReturnType<typeof TrainControlState.PushHandler.prototype.toObject>;
} = {};
if (this.ebutton != null) {
data.ebutton = this.ebutton.toObject();
}
if (this.driverKey != null) {
data.driverKey = this.driverKey.map((item: TrainControlState.DriverKeySwitch) => item.toObject());
}
if (this.dirKey != null) {
data.dirKey = this.dirKey.toObject();
}
if (this.pushHandler != null) {
data.pushHandler = this.pushHandler.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_ebutton)
writer.writeMessage(1, this.ebutton, () => this.ebutton.serialize(writer));
if (this.driverKey.length)
writer.writeRepeatedMessage(2, this.driverKey, (item: TrainControlState.DriverKeySwitch) => item.serialize(writer));
if (this.has_dirKey)
writer.writeMessage(3, this.dirKey, () => this.dirKey.serialize(writer));
if (this.has_pushHandler)
writer.writeMessage(4, this.pushHandler, () => this.pushHandler.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainControlState {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainControlState();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.ebutton, () => message.ebutton = TrainControlState.EmergentButton.deserialize(reader));
break;
case 2:
reader.readMessage(message.driverKey, () => pb_1.Message.addToRepeatedWrapperField(message, 2, TrainControlState.DriverKeySwitch.deserialize(reader), TrainControlState.DriverKeySwitch));
break;
case 3:
reader.readMessage(message.dirKey, () => message.dirKey = TrainControlState.DirectionKeySwitch.deserialize(reader));
break;
case 4:
reader.readMessage(message.pushHandler, () => message.pushHandler = TrainControlState.PushHandler.deserialize(reader));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): TrainControlState {
return TrainControlState.deserialize(bytes);
}
}
export namespace TrainControlState {
export class EmergentButton extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
id?: number;
passed?: boolean;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
}
if ("passed" in data && data.passed != undefined) {
this.passed = data.passed;
}
}
}
get id() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set id(value: number) {
pb_1.Message.setField(this, 1, value);
}
get passed() {
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
}
set passed(value: boolean) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
id?: number;
passed?: boolean;
}): EmergentButton {
const message = new EmergentButton({});
if (data.id != null) {
message.id = data.id;
}
if (data.passed != null) {
message.passed = data.passed;
}
return message;
}
toObject() {
const data: {
id?: number;
passed?: boolean;
} = {};
if (this.id != null) {
data.id = this.id;
}
if (this.passed != null) {
data.passed = this.passed;
}
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.id != 0)
writer.writeUint32(1, this.id);
if (this.passed != false)
writer.writeBool(3, this.passed);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EmergentButton {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EmergentButton();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.id = reader.readUint32();
break;
case 3:
message.passed = reader.readBool();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): EmergentButton {
return EmergentButton.deserialize(bytes);
}
}
export class DriverKeySwitch extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
id?: number;
val?: boolean;
dt?: dependency_3.request.DriverType;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
}
if ("val" in data && data.val != undefined) {
this.val = data.val;
}
if ("dt" in data && data.dt != undefined) {
this.dt = data.dt;
}
}
}
get id() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set id(value: number) {
pb_1.Message.setField(this, 1, value);
}
get val() {
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
}
set val(value: boolean) {
pb_1.Message.setField(this, 2, value);
}
get dt() {
return pb_1.Message.getFieldWithDefault(this, 3, dependency_3.request.DriverType.ONE_END) as dependency_3.request.DriverType;
}
set dt(value: dependency_3.request.DriverType) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
id?: number;
val?: boolean;
dt?: dependency_3.request.DriverType;
}): DriverKeySwitch {
const message = new DriverKeySwitch({});
if (data.id != null) {
message.id = data.id;
}
if (data.val != null) {
message.val = data.val;
}
if (data.dt != null) {
message.dt = data.dt;
}
return message;
}
toObject() {
const data: {
id?: number;
val?: boolean;
dt?: dependency_3.request.DriverType;
} = {};
if (this.id != null) {
data.id = this.id;
}
if (this.val != null) {
data.val = this.val;
}
if (this.dt != null) {
data.dt = this.dt;
}
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.id != 0)
writer.writeUint32(1, this.id);
if (this.val != false)
writer.writeBool(2, this.val);
if (this.dt != dependency_3.request.DriverType.ONE_END)
writer.writeEnum(3, this.dt);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DriverKeySwitch {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DriverKeySwitch();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.id = reader.readUint32();
break;
case 2:
message.val = reader.readBool();
break;
case 3:
message.dt = reader.readEnum();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): DriverKeySwitch {
return DriverKeySwitch.deserialize(bytes);
}
}
export class DirectionKeySwitch extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
id?: number;
val?: 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 ("id" in data && data.id != undefined) {
this.id = data.id;
}
if ("val" in data && data.val != undefined) {
this.val = data.val;
}
}
}
get id() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set id(value: number) {
pb_1.Message.setField(this, 1, value);
}
get val() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set val(value: number) {
pb_1.Message.setField(this, 2, value);
}
static fromObject(data: {
id?: number;
val?: number;
}): DirectionKeySwitch {
const message = new DirectionKeySwitch({});
if (data.id != null) {
message.id = data.id;
}
if (data.val != null) {
message.val = data.val;
}
return message;
}
toObject() {
const data: {
id?: number;
val?: number;
} = {};
if (this.id != null) {
data.id = this.id;
}
if (this.val != null) {
data.val = this.val;
}
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.id != 0)
writer.writeUint32(1, this.id);
if (this.val != 0)
writer.writeUint32(2, this.val);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DirectionKeySwitch {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DirectionKeySwitch();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.id = reader.readUint32();
break;
case 2:
message.val = reader.readUint32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): DirectionKeySwitch {
return DirectionKeySwitch.deserialize(bytes);
}
}
export class PushHandler extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
id?: number;
val?: 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 ("id" in data && data.id != undefined) {
this.id = data.id;
}
if ("val" in data && data.val != undefined) {
this.val = data.val;
}
}
}
get id() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set id(value: number) {
pb_1.Message.setField(this, 1, value);
}
get val() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set val(value: number) {
pb_1.Message.setField(this, 2, value);
}
static fromObject(data: {
id?: number;
val?: number;
}): PushHandler {
const message = new PushHandler({});
if (data.id != null) {
message.id = data.id;
}
if (data.val != null) {
message.val = data.val;
}
return message;
}
toObject() {
const data: {
id?: number;
val?: number;
} = {};
if (this.id != null) {
data.id = this.id;
}
if (this.val != null) {
data.val = this.val;
}
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.id != 0)
writer.writeUint32(1, this.id);
if (this.val != 0)
writer.writeInt32(2, this.val);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PushHandler {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PushHandler();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.id = reader.readUint32();
break;
case 2:
message.val = reader.readInt32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): PushHandler {
return PushHandler.deserialize(bytes);
}
}
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -55,9 +55,10 @@ export namespace graphicData {
carWashings?: CarWashing[]; carWashings?: CarWashing[];
garageDoors?: GarageDoor[]; garageDoors?: GarageDoor[];
floodGates?: FloodGate[]; floodGates?: FloodGate[];
garageDoorBoxes?: GarageDoorBox[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], 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;
@ -185,6 +186,9 @@ export namespace graphicData {
if ("floodGates" in data && data.floodGates != undefined) { if ("floodGates" in data && data.floodGates != undefined) {
this.floodGates = data.floodGates; this.floodGates = data.floodGates;
} }
if ("garageDoorBoxes" in data && data.garageDoorBoxes != undefined) {
this.garageDoorBoxes = data.garageDoorBoxes;
}
} }
} }
get canvas() { get canvas() {
@ -451,6 +455,12 @@ export namespace graphicData {
set floodGates(value: FloodGate[]) { set floodGates(value: FloodGate[]) {
pb_1.Message.setRepeatedWrapperField(this, 47, value); pb_1.Message.setRepeatedWrapperField(this, 47, value);
} }
get garageDoorBoxes() {
return pb_1.Message.getRepeatedWrapperField(this, GarageDoorBox, 48) as GarageDoorBox[];
}
set garageDoorBoxes(value: GarageDoorBox[]) {
pb_1.Message.setRepeatedWrapperField(this, 48, value);
}
static fromObject(data: { static fromObject(data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>; canvas?: ReturnType<typeof Canvas.prototype.toObject>;
Platforms?: ReturnType<typeof Platform.prototype.toObject>[]; Platforms?: ReturnType<typeof Platform.prototype.toObject>[];
@ -494,6 +504,7 @@ export namespace graphicData {
carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[]; carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[];
garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[]; garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[];
floodGates?: ReturnType<typeof FloodGate.prototype.toObject>[]; floodGates?: ReturnType<typeof FloodGate.prototype.toObject>[];
garageDoorBoxes?: ReturnType<typeof GarageDoorBox.prototype.toObject>[];
}): RtssGraphicStorage { }): RtssGraphicStorage {
const message = new RtssGraphicStorage({}); const message = new RtssGraphicStorage({});
if (data.canvas != null) { if (data.canvas != null) {
@ -622,6 +633,9 @@ export namespace graphicData {
if (data.floodGates != null) { if (data.floodGates != null) {
message.floodGates = data.floodGates.map(item => FloodGate.fromObject(item)); message.floodGates = data.floodGates.map(item => FloodGate.fromObject(item));
} }
if (data.garageDoorBoxes != null) {
message.garageDoorBoxes = data.garageDoorBoxes.map(item => GarageDoorBox.fromObject(item));
}
return message; return message;
} }
toObject() { toObject() {
@ -668,6 +682,7 @@ export namespace graphicData {
carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[]; carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[];
garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[]; garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[];
floodGates?: ReturnType<typeof FloodGate.prototype.toObject>[]; floodGates?: ReturnType<typeof FloodGate.prototype.toObject>[];
garageDoorBoxes?: ReturnType<typeof GarageDoorBox.prototype.toObject>[];
} = {}; } = {};
if (this.canvas != null) { if (this.canvas != null) {
data.canvas = this.canvas.toObject(); data.canvas = this.canvas.toObject();
@ -795,6 +810,9 @@ export namespace graphicData {
if (this.floodGates != null) { if (this.floodGates != null) {
data.floodGates = this.floodGates.map((item: FloodGate) => item.toObject()); data.floodGates = this.floodGates.map((item: FloodGate) => item.toObject());
} }
if (this.garageDoorBoxes != null) {
data.garageDoorBoxes = this.garageDoorBoxes.map((item: GarageDoorBox) => item.toObject());
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -885,6 +903,8 @@ export namespace graphicData {
writer.writeRepeatedMessage(46, this.garageDoors, (item: GarageDoor) => item.serialize(writer)); writer.writeRepeatedMessage(46, this.garageDoors, (item: GarageDoor) => item.serialize(writer));
if (this.floodGates.length) if (this.floodGates.length)
writer.writeRepeatedMessage(47, this.floodGates, (item: FloodGate) => item.serialize(writer)); writer.writeRepeatedMessage(47, this.floodGates, (item: FloodGate) => item.serialize(writer));
if (this.garageDoorBoxes.length)
writer.writeRepeatedMessage(48, this.garageDoorBoxes, (item: GarageDoorBox) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1020,6 +1040,9 @@ export namespace graphicData {
case 47: case 47:
reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 47, FloodGate.deserialize(reader), FloodGate)); reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 47, FloodGate.deserialize(reader), FloodGate));
break; break;
case 48:
reader.readMessage(message.garageDoorBoxes, () => pb_1.Message.addToRepeatedWrapperField(message, 48, GarageDoorBox.deserialize(reader), GarageDoorBox));
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -9837,6 +9860,7 @@ export namespace graphicData {
totalLength?: number; totalLength?: number;
trainSets?: string; trainSets?: string;
dynamicConfig?: dependency_1.common.TrainDynamicConfig; dynamicConfig?: dependency_1.common.TrainDynamicConfig;
trainControlMapId?: number;
}) { }) {
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);
@ -9856,6 +9880,9 @@ export namespace graphicData {
if ("dynamicConfig" in data && data.dynamicConfig != undefined) { if ("dynamicConfig" in data && data.dynamicConfig != undefined) {
this.dynamicConfig = data.dynamicConfig; this.dynamicConfig = data.dynamicConfig;
} }
if ("trainControlMapId" in data && data.trainControlMapId != undefined) {
this.trainControlMapId = data.trainControlMapId;
}
} }
} }
get trainModel() { get trainModel() {
@ -9891,12 +9918,19 @@ export namespace graphicData {
get has_dynamicConfig() { get has_dynamicConfig() {
return pb_1.Message.getField(this, 7) != null; return pb_1.Message.getField(this, 7) != null;
} }
get trainControlMapId() {
return pb_1.Message.getFieldWithDefault(this, 9, 0) as number;
}
set trainControlMapId(value: number) {
pb_1.Message.setField(this, 9, value);
}
static fromObject(data: { static fromObject(data: {
trainModel?: Train.TrainModel; trainModel?: Train.TrainModel;
carriageLength?: number; carriageLength?: number;
totalLength?: number; totalLength?: number;
trainSets?: string; trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>; dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
trainControlMapId?: number;
}): Train { }): Train {
const message = new Train({}); const message = new Train({});
if (data.trainModel != null) { if (data.trainModel != null) {
@ -9914,6 +9948,9 @@ export namespace graphicData {
if (data.dynamicConfig != null) { if (data.dynamicConfig != null) {
message.dynamicConfig = dependency_1.common.TrainDynamicConfig.fromObject(data.dynamicConfig); message.dynamicConfig = dependency_1.common.TrainDynamicConfig.fromObject(data.dynamicConfig);
} }
if (data.trainControlMapId != null) {
message.trainControlMapId = data.trainControlMapId;
}
return message; return message;
} }
toObject() { toObject() {
@ -9923,6 +9960,7 @@ export namespace graphicData {
totalLength?: number; totalLength?: number;
trainSets?: string; trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>; dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
trainControlMapId?: number;
} = {}; } = {};
if (this.trainModel != null) { if (this.trainModel != null) {
data.trainModel = this.trainModel; data.trainModel = this.trainModel;
@ -9939,6 +9977,9 @@ export namespace graphicData {
if (this.dynamicConfig != null) { if (this.dynamicConfig != null) {
data.dynamicConfig = this.dynamicConfig.toObject(); data.dynamicConfig = this.dynamicConfig.toObject();
} }
if (this.trainControlMapId != null) {
data.trainControlMapId = this.trainControlMapId;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -9955,6 +9996,8 @@ export namespace graphicData {
writer.writeString(6, this.trainSets); writer.writeString(6, this.trainSets);
if (this.has_dynamicConfig) if (this.has_dynamicConfig)
writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer)); writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer));
if (this.trainControlMapId != 0)
writer.writeInt32(9, this.trainControlMapId);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -9979,6 +10022,9 @@ export namespace graphicData {
case 7: case 7:
reader.readMessage(message.dynamicConfig, () => message.dynamicConfig = dependency_1.common.TrainDynamicConfig.deserialize(reader)); reader.readMessage(message.dynamicConfig, () => message.dynamicConfig = dependency_1.common.TrainDynamicConfig.deserialize(reader));
break; break;
case 9:
message.trainControlMapId = reader.readInt32();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -10112,4 +10158,166 @@ export namespace graphicData {
return OtherLine.deserialize(bytes); return OtherLine.deserialize(bytes);
} }
} }
export class GarageDoorBox extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
refPslMapCode?: string;
refGarageDoorId?: number;
flip?: boolean;
}) {
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;
}
if ("refPslMapCode" in data && data.refPslMapCode != undefined) {
this.refPslMapCode = data.refPslMapCode;
}
if ("refGarageDoorId" in data && data.refGarageDoorId != undefined) {
this.refGarageDoorId = data.refGarageDoorId;
}
if ("flip" in data && data.flip != undefined) {
this.flip = data.flip;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo;
}
set common(value: CommonInfo) {
pb_1.Message.setWrapperField(this, 1, value);
}
get has_common() {
return pb_1.Message.getField(this, 1) != null;
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get refPslMapCode() {
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
}
set refPslMapCode(value: string) {
pb_1.Message.setField(this, 3, value);
}
get refGarageDoorId() {
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
}
set refGarageDoorId(value: number) {
pb_1.Message.setField(this, 4, value);
}
get flip() {
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
}
set flip(value: boolean) {
pb_1.Message.setField(this, 5, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
refPslMapCode?: string;
refGarageDoorId?: number;
flip?: boolean;
}): GarageDoorBox {
const message = new GarageDoorBox({});
if (data.common != null) {
message.common = CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
if (data.refPslMapCode != null) {
message.refPslMapCode = data.refPslMapCode;
}
if (data.refGarageDoorId != null) {
message.refGarageDoorId = data.refGarageDoorId;
}
if (data.flip != null) {
message.flip = data.flip;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
refPslMapCode?: string;
refGarageDoorId?: number;
flip?: boolean;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
if (this.refPslMapCode != null) {
data.refPslMapCode = this.refPslMapCode;
}
if (this.refGarageDoorId != null) {
data.refGarageDoorId = this.refGarageDoorId;
}
if (this.flip != null) {
data.flip = this.flip;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.has_common)
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.refPslMapCode.length)
writer.writeString(3, this.refPslMapCode);
if (this.refGarageDoorId != 0)
writer.writeUint32(4, this.refGarageDoorId);
if (this.flip != false)
writer.writeBool(5, this.flip);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GarageDoorBox {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GarageDoorBox();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
case 3:
message.refPslMapCode = reader.readString();
break;
case 4:
message.refGarageDoorId = reader.readUint32();
break;
case 5:
message.flip = reader.readBool();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): GarageDoorBox {
return GarageDoorBox.deserialize(bytes);
}
}
} }