Merge branch 'master' of https://git.code.tencent.com/beijing-rtss-test/bj-rtss-client
This commit is contained in:
commit
e8142b63a6
@ -17,6 +17,56 @@
|
|||||||
@blur="onUpdate"
|
@blur="onUpdate"
|
||||||
label="子屏蔽门的数量"
|
label="子屏蔽门的数量"
|
||||||
/>
|
/>
|
||||||
|
<q-list bordered separator class="rounded-borders">
|
||||||
|
<q-expansion-item
|
||||||
|
expand-separator
|
||||||
|
v-for="(screenDoorGroup, index) in screenDoorModel.screenDoorGroupList"
|
||||||
|
:key="screenDoorGroup"
|
||||||
|
:label="'列车编组数量为' + screenDoorGroup.trainGroupAmount"
|
||||||
|
>
|
||||||
|
<q-card>
|
||||||
|
<q-item no-wrap class="q-gutter-y-sm column">
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
v-model.number="screenDoorGroup.trainGroupAmount"
|
||||||
|
type="number"
|
||||||
|
label="列车编组数量"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
v-model.number="screenDoorGroup.startSmallDoor"
|
||||||
|
type="number"
|
||||||
|
label="起始的屏蔽门编号"
|
||||||
|
/>
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
v-model.number="screenDoorGroup.endSmallDoor"
|
||||||
|
type="number"
|
||||||
|
label="结束的屏蔽门编号"
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
<q-btn
|
||||||
|
label="确认修改"
|
||||||
|
color="secondary"
|
||||||
|
@click="onUpdate"
|
||||||
|
class="q-mr-md"
|
||||||
|
/>
|
||||||
|
<q-btn
|
||||||
|
label="删除列车编组"
|
||||||
|
color="secondary"
|
||||||
|
@click="deleteScreenDoorGroup(index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</q-item>
|
||||||
|
</q-card>
|
||||||
|
</q-expansion-item>
|
||||||
|
</q-list>
|
||||||
|
<q-btn
|
||||||
|
class="q-mt-md"
|
||||||
|
label="增加列车编组"
|
||||||
|
color="secondary"
|
||||||
|
@click="addScreenDoorGroup"
|
||||||
|
/>
|
||||||
<q-list bordered separator class="rounded-borders">
|
<q-list bordered separator class="rounded-borders">
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section no-wrap class="q-gutter-y-sm column">
|
<q-item-section no-wrap class="q-gutter-y-sm column">
|
||||||
@ -39,6 +89,7 @@ import { useDrawStore } from 'src/stores/draw-store';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { ScreenDoor } from 'src/graphics/screenDoor/ScreenDoor';
|
import { ScreenDoor } from 'src/graphics/screenDoor/ScreenDoor';
|
||||||
import { Platform } from 'src/graphics/platform/Platform';
|
import { Platform } from 'src/graphics/platform/Platform';
|
||||||
|
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||||
|
|
||||||
const drawStore = useDrawStore();
|
const drawStore = useDrawStore();
|
||||||
const { data: screenDoorModel, onUpdate } = useFormData(
|
const { data: screenDoorModel, onUpdate } = useFormData(
|
||||||
@ -59,4 +110,19 @@ const platformRelation = computed(() => {
|
|||||||
}
|
}
|
||||||
return refStation;
|
return refStation;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function addScreenDoorGroup() {
|
||||||
|
screenDoorModel.screenDoorGroupList = [
|
||||||
|
...screenDoorModel.screenDoorGroupList,
|
||||||
|
new graphicData.ScreenDoorGroup(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteScreenDoorGroup(index: number) {
|
||||||
|
const screenDoor = drawStore.selectedGraphic as ScreenDoor;
|
||||||
|
const data = screenDoor.datas.clone().screenDoorGroupList;
|
||||||
|
data.splice(index, 1);
|
||||||
|
screenDoor.datas.screenDoorGroupList = data;
|
||||||
|
screenDoorModel.screenDoorGroupList = data;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -40,6 +40,14 @@ export class ScreenDoorData extends GraphicDataBase implements IScreenDoorData {
|
|||||||
set sonDoorAmount(v: number) {
|
set sonDoorAmount(v: number) {
|
||||||
this.data.sonDoorAmount = v;
|
this.data.sonDoorAmount = v;
|
||||||
}
|
}
|
||||||
|
get screenDoorGroupList(): graphicData.ScreenDoorGroup[] {
|
||||||
|
return this.data.screenDoorGroupList.length > 0
|
||||||
|
? this.data.screenDoorGroupList
|
||||||
|
: (this.data.screenDoorGroupList = [new graphicData.ScreenDoorGroup()]);
|
||||||
|
}
|
||||||
|
set screenDoorGroupList(groupList: graphicData.ScreenDoorGroup[]) {
|
||||||
|
this.data.screenDoorGroupList = groupList;
|
||||||
|
}
|
||||||
|
|
||||||
clone(): ScreenDoorData {
|
clone(): ScreenDoorData {
|
||||||
return new ScreenDoorData(this.data.cloneMessage());
|
return new ScreenDoorData(this.data.cloneMessage());
|
||||||
|
@ -188,7 +188,7 @@ export class Platform extends JlGraphic {
|
|||||||
const refSection = this.relationManage
|
const refSection = this.relationManage
|
||||||
.getRelationsOfGraphicAndOtherType(this, Section.Type)
|
.getRelationsOfGraphicAndOtherType(this, Section.Type)
|
||||||
.map((relation) => relation.getOtherGraphic<Section>(this).datas.id);
|
.map((relation) => relation.getOtherGraphic<Section>(this).datas.id);
|
||||||
if (refStation.length) {
|
if (refSection.length) {
|
||||||
platformRef.push(createRelatedRefProto(Section.Type, refSection[0]));
|
platformRef.push(createRelatedRefProto(Section.Type, refSection[0]));
|
||||||
}
|
}
|
||||||
this.datas.platformRef = platformRef;
|
this.datas.platformRef = platformRef;
|
||||||
|
@ -4,8 +4,10 @@ import {
|
|||||||
JlGraphic,
|
JlGraphic,
|
||||||
JlGraphicTemplate,
|
JlGraphicTemplate,
|
||||||
VectorText,
|
VectorText,
|
||||||
|
distance2,
|
||||||
} from 'src/jl-graphic';
|
} from 'src/jl-graphic';
|
||||||
import { Platform } from '../platform/Platform';
|
import { Platform } from '../platform/Platform';
|
||||||
|
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||||
|
|
||||||
export interface IScreenDoorData extends GraphicData {
|
export interface IScreenDoorData extends GraphicData {
|
||||||
get code(): string; // 编号
|
get code(): string; // 编号
|
||||||
@ -14,6 +16,8 @@ export interface IScreenDoorData extends GraphicData {
|
|||||||
set refPlatform(v: string);
|
set refPlatform(v: string);
|
||||||
get sonDoorAmount(): number; //子屏蔽门的数量
|
get sonDoorAmount(): number; //子屏蔽门的数量
|
||||||
set sonDoorAmount(v: number);
|
set sonDoorAmount(v: number);
|
||||||
|
get screenDoorGroupList(): graphicData.ScreenDoorGroup[]; //编组列表
|
||||||
|
set screenDoorGroupList(v: graphicData.ScreenDoorGroup[]);
|
||||||
clone(): IScreenDoorData;
|
clone(): IScreenDoorData;
|
||||||
copyFrom(data: IScreenDoorData): void;
|
copyFrom(data: IScreenDoorData): void;
|
||||||
eq(other: IScreenDoorData): boolean;
|
eq(other: IScreenDoorData): boolean;
|
||||||
@ -44,15 +48,15 @@ class smallDoorGraphic extends Container {
|
|||||||
screenDoorConsts.smallDoorWidth * i;
|
screenDoorConsts.smallDoorWidth * i;
|
||||||
const smallDoorGraphic = this.smallDoorGraphic;
|
const smallDoorGraphic = this.smallDoorGraphic;
|
||||||
const lineColor = screenDoorConsts.doorGreen;
|
const lineColor = screenDoorConsts.doorGreen;
|
||||||
const direction = 'down';
|
const direction = 'up';
|
||||||
smallDoorGraphic
|
smallDoorGraphic
|
||||||
.lineStyle(screenDoorConsts.lineWidth, new Color(lineColor))
|
.lineStyle(screenDoorConsts.lineWidth, new Color(lineColor))
|
||||||
.moveTo(start, 0)
|
.moveTo(start, 0)
|
||||||
.lineTo(start + screenDoorConsts.smallDoorWidth - 3, 0);
|
.lineTo(start + screenDoorConsts.smallDoorWidth - 3, 0);
|
||||||
if (direction == 'down') {
|
if (direction == 'up') {
|
||||||
this.labelGraphic.text = data.sonDoorAmount - i;
|
|
||||||
} else {
|
|
||||||
this.labelGraphic.text = i + 1;
|
this.labelGraphic.text = i + 1;
|
||||||
|
} else {
|
||||||
|
this.labelGraphic.text = data.sonDoorAmount - i;
|
||||||
}
|
}
|
||||||
this.labelGraphic.style.fill = 'red';
|
this.labelGraphic.style.fill = 'red';
|
||||||
if (i % 2 == 0) {
|
if (i % 2 == 0) {
|
||||||
@ -89,13 +93,22 @@ export class ScreenDoor extends JlGraphic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildRelation() {
|
buildRelation() {
|
||||||
const stationas = this.queryStore.queryByType<Platform>(Platform.Type);
|
const platforms = this.queryStore.queryByType<Platform>(Platform.Type);
|
||||||
for (let i = 0; i < stationas.length; i++) {
|
const minDistanceRefPlatform: Platform[] = [];
|
||||||
const sP = stationas[i].localBoundsToCanvasPoints();
|
platforms.forEach((platform) => {
|
||||||
|
const sP = platform.localBoundsToCanvasPoints();
|
||||||
if (this.x > sP[0].x && this.x < sP[1].x) {
|
if (this.x > sP[0].x && this.x < sP[1].x) {
|
||||||
this.relationManage.addRelation(this, stationas[i]);
|
minDistanceRefPlatform.push(platform);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
const refPlatform = minDistanceRefPlatform.reduce((prev, cur) => {
|
||||||
|
return distance2(prev.position, this.position) >
|
||||||
|
distance2(cur.position, this.position)
|
||||||
|
? cur
|
||||||
|
: prev;
|
||||||
|
});
|
||||||
|
if (refPlatform) {
|
||||||
|
this.relationManage.addRelation(this, refPlatform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
saveRelations() {
|
saveRelations() {
|
||||||
|
@ -1455,9 +1455,10 @@ export namespace graphicData {
|
|||||||
code?: string;
|
code?: string;
|
||||||
sonDoorAmount?: number;
|
sonDoorAmount?: number;
|
||||||
refPlatform?: string;
|
refPlatform?: string;
|
||||||
|
screenDoorGroupList?: ScreenDoorGroup[];
|
||||||
}) {
|
}) {
|
||||||
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, [5], this.#one_of_decls);
|
||||||
if (!Array.isArray(data) && typeof data == "object") {
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
if ("common" in data && data.common != undefined) {
|
if ("common" in data && data.common != undefined) {
|
||||||
this.common = data.common;
|
this.common = data.common;
|
||||||
@ -1471,6 +1472,9 @@ export namespace graphicData {
|
|||||||
if ("refPlatform" in data && data.refPlatform != undefined) {
|
if ("refPlatform" in data && data.refPlatform != undefined) {
|
||||||
this.refPlatform = data.refPlatform;
|
this.refPlatform = data.refPlatform;
|
||||||
}
|
}
|
||||||
|
if ("screenDoorGroupList" in data && data.screenDoorGroupList != undefined) {
|
||||||
|
this.screenDoorGroupList = data.screenDoorGroupList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get common() {
|
get common() {
|
||||||
@ -1500,11 +1504,18 @@ export namespace graphicData {
|
|||||||
set refPlatform(value: string) {
|
set refPlatform(value: string) {
|
||||||
pb_1.Message.setField(this, 4, value);
|
pb_1.Message.setField(this, 4, value);
|
||||||
}
|
}
|
||||||
|
get screenDoorGroupList() {
|
||||||
|
return pb_1.Message.getRepeatedWrapperField(this, ScreenDoorGroup, 5) as ScreenDoorGroup[];
|
||||||
|
}
|
||||||
|
set screenDoorGroupList(value: ScreenDoorGroup[]) {
|
||||||
|
pb_1.Message.setRepeatedWrapperField(this, 5, value);
|
||||||
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
sonDoorAmount?: number;
|
sonDoorAmount?: number;
|
||||||
refPlatform?: string;
|
refPlatform?: string;
|
||||||
|
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
|
||||||
}): ScreenDoor {
|
}): ScreenDoor {
|
||||||
const message = new ScreenDoor({});
|
const message = new ScreenDoor({});
|
||||||
if (data.common != null) {
|
if (data.common != null) {
|
||||||
@ -1519,6 +1530,9 @@ export namespace graphicData {
|
|||||||
if (data.refPlatform != null) {
|
if (data.refPlatform != null) {
|
||||||
message.refPlatform = data.refPlatform;
|
message.refPlatform = data.refPlatform;
|
||||||
}
|
}
|
||||||
|
if (data.screenDoorGroupList != null) {
|
||||||
|
message.screenDoorGroupList = data.screenDoorGroupList.map(item => ScreenDoorGroup.fromObject(item));
|
||||||
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
@ -1527,6 +1541,7 @@ export namespace graphicData {
|
|||||||
code?: string;
|
code?: string;
|
||||||
sonDoorAmount?: number;
|
sonDoorAmount?: number;
|
||||||
refPlatform?: string;
|
refPlatform?: string;
|
||||||
|
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
|
||||||
} = {};
|
} = {};
|
||||||
if (this.common != null) {
|
if (this.common != null) {
|
||||||
data.common = this.common.toObject();
|
data.common = this.common.toObject();
|
||||||
@ -1540,6 +1555,9 @@ export namespace graphicData {
|
|||||||
if (this.refPlatform != null) {
|
if (this.refPlatform != null) {
|
||||||
data.refPlatform = this.refPlatform;
|
data.refPlatform = this.refPlatform;
|
||||||
}
|
}
|
||||||
|
if (this.screenDoorGroupList != null) {
|
||||||
|
data.screenDoorGroupList = this.screenDoorGroupList.map((item: ScreenDoorGroup) => item.toObject());
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
serialize(): Uint8Array;
|
serialize(): Uint8Array;
|
||||||
@ -1554,6 +1572,8 @@ export namespace graphicData {
|
|||||||
writer.writeInt32(3, this.sonDoorAmount);
|
writer.writeInt32(3, this.sonDoorAmount);
|
||||||
if (this.refPlatform.length)
|
if (this.refPlatform.length)
|
||||||
writer.writeString(4, this.refPlatform);
|
writer.writeString(4, this.refPlatform);
|
||||||
|
if (this.screenDoorGroupList.length)
|
||||||
|
writer.writeRepeatedMessage(5, this.screenDoorGroupList, (item: ScreenDoorGroup) => item.serialize(writer));
|
||||||
if (!w)
|
if (!w)
|
||||||
return writer.getResultBuffer();
|
return writer.getResultBuffer();
|
||||||
}
|
}
|
||||||
@ -1575,6 +1595,9 @@ export namespace graphicData {
|
|||||||
case 4:
|
case 4:
|
||||||
message.refPlatform = reader.readString();
|
message.refPlatform = reader.readString();
|
||||||
break;
|
break;
|
||||||
|
case 5:
|
||||||
|
reader.readMessage(message.screenDoorGroupList, () => pb_1.Message.addToRepeatedWrapperField(message, 5, ScreenDoorGroup.deserialize(reader), ScreenDoorGroup));
|
||||||
|
break;
|
||||||
default: reader.skipField();
|
default: reader.skipField();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1587,6 +1610,119 @@ export namespace graphicData {
|
|||||||
return ScreenDoor.deserialize(bytes);
|
return ScreenDoor.deserialize(bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export class ScreenDoorGroup extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
trainGroupAmount?: number;
|
||||||
|
startSmallDoor?: number;
|
||||||
|
endSmallDoor?: number;
|
||||||
|
}) {
|
||||||
|
super();
|
||||||
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||||
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
|
if ("trainGroupAmount" in data && data.trainGroupAmount != undefined) {
|
||||||
|
this.trainGroupAmount = data.trainGroupAmount;
|
||||||
|
}
|
||||||
|
if ("startSmallDoor" in data && data.startSmallDoor != undefined) {
|
||||||
|
this.startSmallDoor = data.startSmallDoor;
|
||||||
|
}
|
||||||
|
if ("endSmallDoor" in data && data.endSmallDoor != undefined) {
|
||||||
|
this.endSmallDoor = data.endSmallDoor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get trainGroupAmount() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||||
|
}
|
||||||
|
set trainGroupAmount(value: number) {
|
||||||
|
pb_1.Message.setField(this, 1, value);
|
||||||
|
}
|
||||||
|
get startSmallDoor() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||||
|
}
|
||||||
|
set startSmallDoor(value: number) {
|
||||||
|
pb_1.Message.setField(this, 2, value);
|
||||||
|
}
|
||||||
|
get endSmallDoor() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
|
||||||
|
}
|
||||||
|
set endSmallDoor(value: number) {
|
||||||
|
pb_1.Message.setField(this, 3, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
trainGroupAmount?: number;
|
||||||
|
startSmallDoor?: number;
|
||||||
|
endSmallDoor?: number;
|
||||||
|
}): ScreenDoorGroup {
|
||||||
|
const message = new ScreenDoorGroup({});
|
||||||
|
if (data.trainGroupAmount != null) {
|
||||||
|
message.trainGroupAmount = data.trainGroupAmount;
|
||||||
|
}
|
||||||
|
if (data.startSmallDoor != null) {
|
||||||
|
message.startSmallDoor = data.startSmallDoor;
|
||||||
|
}
|
||||||
|
if (data.endSmallDoor != null) {
|
||||||
|
message.endSmallDoor = data.endSmallDoor;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
trainGroupAmount?: number;
|
||||||
|
startSmallDoor?: number;
|
||||||
|
endSmallDoor?: number;
|
||||||
|
} = {};
|
||||||
|
if (this.trainGroupAmount != null) {
|
||||||
|
data.trainGroupAmount = this.trainGroupAmount;
|
||||||
|
}
|
||||||
|
if (this.startSmallDoor != null) {
|
||||||
|
data.startSmallDoor = this.startSmallDoor;
|
||||||
|
}
|
||||||
|
if (this.endSmallDoor != null) {
|
||||||
|
data.endSmallDoor = this.endSmallDoor;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||||
|
const writer = w || new pb_1.BinaryWriter();
|
||||||
|
if (this.trainGroupAmount != 0)
|
||||||
|
writer.writeInt32(1, this.trainGroupAmount);
|
||||||
|
if (this.startSmallDoor != 0)
|
||||||
|
writer.writeInt32(2, this.startSmallDoor);
|
||||||
|
if (this.endSmallDoor != 0)
|
||||||
|
writer.writeInt32(3, this.endSmallDoor);
|
||||||
|
if (!w)
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
}
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoorGroup {
|
||||||
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScreenDoorGroup();
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup())
|
||||||
|
break;
|
||||||
|
switch (reader.getFieldNumber()) {
|
||||||
|
case 1:
|
||||||
|
message.trainGroupAmount = reader.readInt32();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
message.startSmallDoor = reader.readInt32();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
message.endSmallDoor = reader.readInt32();
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): ScreenDoorGroup {
|
||||||
|
return ScreenDoorGroup.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
export class Station extends pb_1.Message {
|
export class Station extends pb_1.Message {
|
||||||
#one_of_decls: number[][] = [];
|
#one_of_decls: number[][] = [];
|
||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
|
Loading…
Reference in New Issue
Block a user