关联站台调整&IBP问题修复

This commit is contained in:
fan 2023-10-11 10:37:41 +08:00
parent 355a8d4c4b
commit f7d0242873
12 changed files with 95 additions and 67 deletions

@ -1 +1 @@
Subproject commit 6a27f93fe968b98b5b83badb16abbca12bc8b633
Subproject commit a8fa6fec188ad3df19952e298a1f846d581ca200

View File

@ -15,14 +15,16 @@
@blur="onUpdate"
label="名称"
/>
<q-input
<q-select
outlined
class="q-mt-sm"
v-model.number="esbButtonModel.refStand"
type="number"
@blur="onUpdate"
label="对应站台索引"
/>
style="margin-top: 10px"
v-model="esbButtonModel.refStand"
:options="platformList"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="关联站台"
></q-select>
</q-form>
</template>
@ -30,11 +32,26 @@
import { EsbButtonData } from 'src/drawApp/graphics/EsbButtonInteraction';
import { useFormData } from 'src/components/DrawAppFormUtils';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive } from 'vue';
import { Platform } from 'src/graphics/platform/Platform';
const drawStore = useDrawStore();
const platformList: { label: string; value: string }[] = reactive([]);
const { data: esbButtonModel, onUpdate } = useFormData(
new EsbButtonData(),
drawStore.getDrawApp()
);
onMounted(() => {
const platforms = drawStore
.getDrawApp()
.queryStore.queryByType<Platform>(Platform.Type);
platforms.forEach((p) => {
platformList.push({
value: p.id,
label: `${p.datas.code}[${p.datas.index}]`,
});
});
});
</script>

View File

@ -21,14 +21,16 @@
@blur="onUpdate"
label="名称"
/>
<q-input
<q-select
outlined
style="margin-top: 10px"
v-model.number="spksSwitchModel.refStand"
type="number"
@blur="onUpdate"
label="对应站台索引"
/>
v-model="spksSwitchModel.refStand"
:options="platformList"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="关联站台"
></q-select>
<q-select
outlined
style="margin-top: 10px"
@ -47,6 +49,7 @@
import { useFormData } from 'src/components/DrawAppFormUtils';
import { SpksSwitchData } from 'src/drawApp/graphics/SpksSwitchInteraction';
import { Section } from 'src/graphics/section/Section';
import { Platform } from 'src/graphics/platform/Platform';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive } from 'vue';
@ -56,6 +59,7 @@ const { data: spksSwitchModel, onUpdate } = useFormData(
drawStore.getDrawApp()
);
const sectionList: { label: string; value: string }[] = reactive([]);
const platformList: { label: string; value: string }[] = reactive([]);
onMounted(() => {
const sections = drawStore
@ -67,5 +71,14 @@ onMounted(() => {
label: `${se.datas.code}[${se.datas.index}]`,
});
});
const platforms = drawStore
.getDrawApp()
.queryStore.queryByType<Platform>(Platform.Type);
platforms.forEach((p) => {
platformList.push({
value: p.id,
label: `${p.datas.code}[${p.datas.index}]`,
});
});
});
</script>

View File

@ -2,7 +2,7 @@ import * as pb_1 from 'google-protobuf';
import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
import { EsbButton, IEsbButton } from 'src/graphics/esbButton/EsbButton';
import {
GraphicApp,
IGraphicApp,
GraphicInteractionPlugin,
JlGraphic,
} from 'src/jl-graphic';
@ -46,10 +46,10 @@ export class EsbButtonData extends GraphicDataBase implements IEsbButton {
set index(v: number) {
this.data.index = v;
}
get refStand(): number {
get refStand(): string {
return this.data.refStand;
}
set refStand(v: number) {
set refStand(v: string) {
this.data.refStand = v;
}
clone(): EsbButtonData {
@ -76,11 +76,11 @@ const EsbButtonEditMenu: ContextMenu = ContextMenu.init({
});
export class DrawEsbButtonInteraction extends GraphicInteractionPlugin<EsbButton> {
static Name = 'esb_button_draw_right_menu';
constructor(app: GraphicApp) {
constructor(app: IGraphicApp) {
super(DrawEsbButtonInteraction.Name, app);
app.registerMenu(EsbButtonEditMenu);
}
static init(app: GraphicApp) {
static init(app: IGraphicApp) {
return new DrawEsbButtonInteraction(app);
}
filter(...grahpics: JlGraphic[]): EsbButton[] | undefined {

View File

@ -2,7 +2,7 @@ import * as pb_1 from 'google-protobuf';
import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
import { GatedBox, IGatedBox } from 'src/graphics/gatedBox/GatedBox';
import {
GraphicApp,
IGraphicApp,
GraphicInteractionPlugin,
JlGraphic,
} from 'src/jl-graphic';
@ -70,11 +70,11 @@ const GatedBoxEditMenu: ContextMenu = ContextMenu.init({
});
export class DrawGatedBoxInteraction extends GraphicInteractionPlugin<GatedBox> {
static Name = 'gated_box_draw_right_menu';
constructor(app: GraphicApp) {
constructor(app: IGraphicApp) {
super(DrawGatedBoxInteraction.Name, app);
app.registerMenu(GatedBoxEditMenu);
}
static init(app: GraphicApp) {
static init(app: IGraphicApp) {
return new DrawGatedBoxInteraction(app);
}
filter(...grahpics: JlGraphic[]): GatedBox[] | undefined {

View File

@ -46,10 +46,10 @@ export class SpksSwitchData extends GraphicDataBase implements ISpksSwitch {
set index(v: number) {
this.data.index = v;
}
get refStand(): number {
get refStand(): string {
return this.data.refStand;
}
set refStand(v: number) {
set refStand(v: string) {
this.data.refStand = v;
}
get refSections(): string[] {

View File

@ -156,7 +156,7 @@ function onEditPointCreate(g: ILineGraphic, dp: DraggablePoint): void {
}
export class ArrowPointEditPlugin extends GraphicInteractionPlugin<Arrow> {
static Name = 'SectionPointDrag';
static Name = 'ArrowPointDrag';
drawAssistant: ArrowDraw;
constructor(app: IGraphicApp, da: ArrowDraw) {
@ -170,8 +170,8 @@ export class ArrowPointEditPlugin extends GraphicInteractionPlugin<Arrow> {
return grahpics.filter((g) => g.type == Arrow.Type) as Arrow[];
}
bind(g: Arrow): void {
g.lineGraphic.eventMode = 'static';
g.lineGraphic.cursor = 'pointer';
g.eventMode = 'static';
g.cursor = 'pointer';
g.hitArea = new ArrowGraphicHitArea(g);
g.transformSave = true;
g.on('selected', this.onSelected, this);

View File

@ -13,8 +13,8 @@ export interface IEsbButton extends GraphicData {
set flip(v: boolean);
get index(): number;
set index(v: number);
get refStand(): number;
set refStand(v: number);
get refStand(): string;
set refStand(v: string);
clone(): IEsbButton;
copyFrom(data: IEsbButton): void;
eq(other: IEsbButton): boolean;

View File

@ -13,8 +13,8 @@ export interface ISpksSwitch extends GraphicData {
set flip(v: boolean);
get index(): number;
set index(v: number);
get refStand(): number;
set refStand(v: number);
get refStand(): string;
set refStand(v: string);
get refSections(): string[];
set refSections(v: string[]);
clone(): ISpksSwitch;

View File

@ -652,10 +652,8 @@ abstract class GraphicSceneBase
}
private async load(): Promise<void> {
console.log(this._options.dataLoader, '=====');
if (this._options.dataLoader) {
const storage = await this._options.dataLoader();
console.log(storage, 'storage');
if (storage.canvasProperty) {
this.canvas.update(storage.canvasProperty);
console.log(this.canvas, 'canvas');

View File

@ -167,7 +167,7 @@ function backConfirm() {
<IbpDrawProperties />
</QDrawer>
<QPageContainer>
<div id="draw-app-container"></div>
<div id="draw-app-container" class="overflow-hidden"></div>
</QPageContainer>
</QLayout>
</template>

View File

@ -4952,8 +4952,8 @@ export namespace graphicData {
code?: string;
flip?: boolean;
index?: number;
refStand?: number;
refSections?: string[];
refStand?: string;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6], this.#one_of_decls);
@ -4970,12 +4970,12 @@ export namespace graphicData {
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
if ("refStand" in data && data.refStand != undefined) {
this.refStand = data.refStand;
}
if ("refSections" in data && data.refSections != undefined) {
this.refSections = data.refSections;
}
if ("refStand" in data && data.refStand != undefined) {
this.refStand = data.refStand;
}
}
}
get common() {
@ -5005,25 +5005,25 @@ export namespace graphicData {
set index(value: number) {
pb_1.Message.setField(this, 4, value);
}
get refStand() {
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
}
set refStand(value: number) {
pb_1.Message.setField(this, 5, value);
}
get refSections() {
return pb_1.Message.getFieldWithDefault(this, 6, []) as string[];
}
set refSections(value: string[]) {
pb_1.Message.setField(this, 6, value);
}
get refStand() {
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
}
set refStand(value: string) {
pb_1.Message.setField(this, 7, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
flip?: boolean;
index?: number;
refStand?: number;
refSections?: string[];
refStand?: string;
}): SpksSwitch {
const message = new SpksSwitch({});
if (data.common != null) {
@ -5038,12 +5038,12 @@ export namespace graphicData {
if (data.index != null) {
message.index = data.index;
}
if (data.refStand != null) {
message.refStand = data.refStand;
}
if (data.refSections != null) {
message.refSections = data.refSections;
}
if (data.refStand != null) {
message.refStand = data.refStand;
}
return message;
}
toObject() {
@ -5052,8 +5052,8 @@ export namespace graphicData {
code?: string;
flip?: boolean;
index?: number;
refStand?: number;
refSections?: string[];
refStand?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -5067,12 +5067,12 @@ export namespace graphicData {
if (this.index != null) {
data.index = this.index;
}
if (this.refStand != null) {
data.refStand = this.refStand;
}
if (this.refSections != null) {
data.refSections = this.refSections;
}
if (this.refStand != null) {
data.refStand = this.refStand;
}
return data;
}
serialize(): Uint8Array;
@ -5087,10 +5087,10 @@ export namespace graphicData {
writer.writeBool(3, this.flip);
if (this.index != 0)
writer.writeInt32(4, this.index);
if (this.refStand != 0)
writer.writeInt32(5, this.refStand);
if (this.refSections.length)
writer.writeRepeatedString(6, this.refSections);
if (this.refStand.length)
writer.writeString(7, this.refStand);
if (!w)
return writer.getResultBuffer();
}
@ -5112,12 +5112,12 @@ export namespace graphicData {
case 4:
message.index = reader.readInt32();
break;
case 5:
message.refStand = reader.readInt32();
break;
case 6:
pb_1.Message.addToRepeatedField(message, 6, reader.readString());
break;
case 7:
message.refStand = reader.readString();
break;
default: reader.skipField();
}
}
@ -5137,7 +5137,7 @@ export namespace graphicData {
code?: string;
flip?: boolean;
index?: number;
refStand?: number;
refStand?: string;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -5187,17 +5187,17 @@ export namespace graphicData {
pb_1.Message.setField(this, 4, value);
}
get refStand() {
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
}
set refStand(value: number) {
pb_1.Message.setField(this, 5, value);
set refStand(value: string) {
pb_1.Message.setField(this, 6, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
flip?: boolean;
index?: number;
refStand?: number;
refStand?: string;
}): EsbButton {
const message = new EsbButton({});
if (data.common != null) {
@ -5223,7 +5223,7 @@ export namespace graphicData {
code?: string;
flip?: boolean;
index?: number;
refStand?: number;
refStand?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -5254,8 +5254,8 @@ export namespace graphicData {
writer.writeBool(3, this.flip);
if (this.index != 0)
writer.writeInt32(4, this.index);
if (this.refStand != 0)
writer.writeInt32(5, this.refStand);
if (this.refStand.length)
writer.writeString(6, this.refStand);
if (!w)
return writer.getResultBuffer();
}
@ -5277,8 +5277,8 @@ export namespace graphicData {
case 4:
message.index = reader.readInt32();
break;
case 5:
message.refStand = reader.readInt32();
case 6:
message.refStand = reader.readString();
break;
default: reader.skipField();
}