diff --git a/bj-rtss-message b/bj-rtss-message index 19514bc..8403e90 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 19514bc55091b2afb559d6e6f9a3c1e3b2699be1 +Subproject commit 8403e90692f1848d38b7928ba3b9ecfe3f381722 diff --git a/src/components/draw-app/properties/PslButtonProperty.vue b/src/components/draw-app/properties/PslButtonProperty.vue index 61cea06..2fcb03b 100644 --- a/src/components/draw-app/properties/PslButtonProperty.vue +++ b/src/components/draw-app/properties/PslButtonProperty.vue @@ -8,14 +8,6 @@ label="Psl按钮" lazy-rules /> - - - diff --git a/src/components/draw-app/properties/PslLightProperty.vue b/src/components/draw-app/properties/PslLightProperty.vue index 61a3787..03bfd7d 100644 --- a/src/components/draw-app/properties/PslLightProperty.vue +++ b/src/components/draw-app/properties/PslLightProperty.vue @@ -8,14 +8,6 @@ label="Psl按钮" lazy-rules /> - (); @@ -64,23 +51,6 @@ export class PslButton extends JlGraphic { } else { this._pslButton.texture = this.pslButtonTextures.redBtn; } - if (this.datas.topAnnotation) { - this.topAnnotation.text = this.datas.topAnnotation || ''; - this.topAnnotation.style.fill = pslConst.annotationColor; - this.topAnnotation.setVectorFontSize(pslConst.annotationFontSize); - this.topAnnotation.anchor.set(0.5); - const taTransform = this.datas.childTransforms?.find( - (item) => item.name === this.topAnnotation.name - ); - if (taTransform) { - const position = taTransform?.transform.position; - const rotation = taTransform?.transform?.rotation; - this.topAnnotation.position.set(position?.x, position?.y); - this.topAnnotation.rotation = rotation || 0; - } - } else { - this.topAnnotation.position.set(0, pslConst.topAnnotationOffset); - } } } diff --git a/src/graphics/pslButton/pslButtonDrawAssistant.ts b/src/graphics/pslButton/pslButtonDrawAssistant.ts index d8fdc9b..fbf9c3f 100644 --- a/src/graphics/pslButton/pslButtonDrawAssistant.ts +++ b/src/graphics/pslButton/pslButtonDrawAssistant.ts @@ -133,22 +133,12 @@ export class PslButtonInteraction extends GraphicInteractionPlugin { g.scalable = true; g.rotatable = true; g.on('transformstart', this.transformstart, this); - g.topAnnotation.draggable = true; - g.topAnnotation.selectable = true; - g.topAnnotation.rotatable = true; - g.topAnnotation.transformSave = true; - g.topAnnotation.eventMode = 'static'; } unbind(g: PslButton): void { g.eventMode = 'none'; g.scalable = false; g.rotatable = false; g.off('transformstart', this.transformstart, this); - g.topAnnotation.draggable = false; - g.topAnnotation.selectable = false; - g.topAnnotation.rotatable = false; - g.topAnnotation.transformSave = false; - g.topAnnotation.eventMode = 'none'; } transformstart(e: GraphicTransformEvent) { const target = e.target as DisplayObject; diff --git a/src/graphics/pslKey/pslKey.ts b/src/graphics/pslKey/pslKey.ts index b183588..89c9130 100644 --- a/src/graphics/pslKey/pslKey.ts +++ b/src/graphics/pslKey/pslKey.ts @@ -3,7 +3,6 @@ import { GraphicState, JlGraphic, JlGraphicTemplate, - VectorText, } from 'src/jl-graphic'; import Psl_Key_Assets from './psl-key-spritesheet.png'; import Psl_Key_JSON from './psl-key-data.json'; @@ -17,19 +16,8 @@ interface PslKeyTextures { export interface IPslKeyData extends GraphicData { get code(): string; set code(v: string); - get topAnnotation(): string; - set topAnnotation(v: string); - get rightAnnotation(): string; - set rightAnnotation(v: string); } -const pslConst = { - annotationFontSize: 14, - annotationColor: '0XFFFFFF', - topAnnotationOffset: -40, - rightAnnotationOffset: 60, -}; - export interface IPslKeyState extends GraphicState { get state(): number; set state(v: number); @@ -38,8 +26,6 @@ export interface IPslKeyState extends GraphicState { export class PslKey extends JlGraphic { static Type = 'PslKey'; _pslKey: Sprite; - topAnnotation: VectorText; - rightAnnotation: VectorText; pslkeyTextures: PslKeyTextures; __state = 0; @@ -47,15 +33,9 @@ export class PslKey extends JlGraphic { super(PslKey.Type); this.pslkeyTextures = pslkeyTextures; this._pslKey = new Sprite(); - this.topAnnotation = new VectorText(); - this.rightAnnotation = new VectorText(); - this.topAnnotation.name = 'topAnnotation'; - this.rightAnnotation.name = 'rightAnnotation'; this._pslKey.texture = this.pslkeyTextures.pslKey; this._pslKey.anchor.set(0.5); this.addChild(this._pslKey); - this.addChild(this.topAnnotation); - this.addChild(this.rightAnnotation); } get datas(): IPslKeyData { return this.getDatas(); @@ -63,40 +43,6 @@ export class PslKey extends JlGraphic { doRepaint(): void { this._pslKey.rotation = 0; this._pslKey.texture = this.pslkeyTextures.pslKey; - if (this.datas.topAnnotation) { - this.topAnnotation.text = this.datas.topAnnotation || ''; - this.topAnnotation.style.fill = pslConst.annotationColor; - this.topAnnotation.setVectorFontSize(pslConst.annotationFontSize); - this.topAnnotation.anchor.set(0.5); - const taTransform = this.datas.childTransforms?.find( - (item) => item.name === this.topAnnotation.name - ); - if (taTransform) { - const position = taTransform?.transform.position; - const rotation = taTransform?.transform?.rotation; - this.topAnnotation.position.set(position?.x, position?.y); - this.topAnnotation.rotation = rotation || 0; - } - } else { - this.topAnnotation.position.set(0, pslConst.topAnnotationOffset); - } - if (this.datas.rightAnnotation) { - this.rightAnnotation.text = this.datas.rightAnnotation || ''; - this.rightAnnotation.style.fill = pslConst.annotationColor; - this.rightAnnotation.setVectorFontSize(pslConst.annotationFontSize); - this.rightAnnotation.anchor.set(0.5); - const taTransform = this.datas.childTransforms?.find( - (item) => item.name === this.rightAnnotation.name - ); - if (taTransform) { - const position = taTransform?.transform.position; - const rotation = taTransform?.transform?.rotation; - this.rightAnnotation.position.set(position?.x, position?.y); - this.rightAnnotation.rotation = rotation || 0; - } - } else { - this.rightAnnotation.position.set(pslConst.rightAnnotationOffset, 0); - } } } diff --git a/src/graphics/pslKey/pslKeyDrawAssistant.ts b/src/graphics/pslKey/pslKeyDrawAssistant.ts index f2ff354..db6db0d 100644 --- a/src/graphics/pslKey/pslKeyDrawAssistant.ts +++ b/src/graphics/pslKey/pslKeyDrawAssistant.ts @@ -126,32 +126,12 @@ export class PslKeyInteraction extends GraphicInteractionPlugin { g.scalable = true; g.rotatable = true; g.on('transformstart', this.transformstart, this); - g.topAnnotation.draggable = true; - g.topAnnotation.selectable = true; - g.topAnnotation.rotatable = true; - g.topAnnotation.transformSave = true; - g.topAnnotation.eventMode = 'static'; - g.rightAnnotation.draggable = true; - g.rightAnnotation.selectable = true; - g.rightAnnotation.rotatable = true; - g.rightAnnotation.transformSave = true; - g.rightAnnotation.eventMode = 'static'; } unbind(g: PslKey): void { g.eventMode = 'none'; g.scalable = false; g.rotatable = false; g.off('transformstart', this.transformstart, this); - g.topAnnotation.draggable = false; - g.topAnnotation.selectable = false; - g.topAnnotation.rotatable = false; - g.topAnnotation.transformSave = false; - g.topAnnotation.eventMode = 'none'; - g.rightAnnotation.draggable = false; - g.rightAnnotation.selectable = false; - g.rightAnnotation.rotatable = false; - g.rightAnnotation.transformSave = false; - g.rightAnnotation.eventMode = 'none'; } transformstart(e: GraphicTransformEvent) { const target = e.target as DisplayObject; diff --git a/src/graphics/pslLight/psl-light-spritesheet.png b/src/graphics/pslLight/psl-light-spritesheet.png index ce0759c..2c8d430 100644 Binary files a/src/graphics/pslLight/psl-light-spritesheet.png and b/src/graphics/pslLight/psl-light-spritesheet.png differ diff --git a/src/graphics/pslLight/pslLight.ts b/src/graphics/pslLight/pslLight.ts index d1a853f..b483026 100644 --- a/src/graphics/pslLight/pslLight.ts +++ b/src/graphics/pslLight/pslLight.ts @@ -3,7 +3,6 @@ import { GraphicState, JlGraphic, JlGraphicTemplate, - VectorText, } from 'src/jl-graphic'; import Psl_Light_Assets from './psl-light-spritesheet.png'; import Psl_Light_JSON from './psl-light-data.json'; @@ -23,18 +22,10 @@ interface PslLightTextures { export interface IPslLightData extends GraphicData { get code(): string; set code(v: string); - get topAnnotation(): string; - set topAnnotation(v: string); get lightColor(): pslGraphicData.PslElementColor; set lightColor(v: pslGraphicData.PslElementColor); } -const pslConst = { - annotationFontSize: 14, - annotationColor: '0XFFFFFF', - topAnnotationOffset: -40, -}; - export interface IPslLightState extends GraphicState { get state(): number; set state(v: number); @@ -43,7 +34,6 @@ export interface IPslLightState extends GraphicState { export class PslLight extends JlGraphic { static Type = 'PslLight'; _pslLight: Sprite; - topAnnotation: VectorText; pslLightTextures: PslLightTextures; __state = 0; @@ -51,12 +41,9 @@ export class PslLight extends JlGraphic { super(PslLight.Type); this.pslLightTextures = pslLightTextures; this._pslLight = new Sprite(); - this.topAnnotation = new VectorText(); - this.topAnnotation.name = 'topAnnotation'; this._pslLight.texture = this.pslLightTextures.redOff; this._pslLight.anchor.set(0.5); this.addChild(this._pslLight); - this.addChild(this.topAnnotation); } get datas(): IPslLightData { return this.getDatas(); @@ -70,23 +57,6 @@ export class PslLight extends JlGraphic { } else { this._pslLight.texture = this.pslLightTextures.redOff; } - if (this.datas.topAnnotation) { - this.topAnnotation.text = this.datas.topAnnotation || ''; - this.topAnnotation.style.fill = pslConst.annotationColor; - this.topAnnotation.setVectorFontSize(pslConst.annotationFontSize); - this.topAnnotation.anchor.set(0.5); - const taTransform = this.datas.childTransforms?.find( - (item) => item.name === this.topAnnotation.name - ); - if (taTransform) { - const position = taTransform.transform.position; - const rotation = taTransform.transform.rotation; - this.topAnnotation.position.set(position?.x, position?.y); - this.topAnnotation.rotation = rotation || 0; - } - } else { - this.topAnnotation.position.set(0, pslConst.topAnnotationOffset); - } } } diff --git a/src/graphics/pslLight/pslLightDrawAssistant.ts b/src/graphics/pslLight/pslLightDrawAssistant.ts index 88aaa7f..4cd65d9 100644 --- a/src/graphics/pslLight/pslLightDrawAssistant.ts +++ b/src/graphics/pslLight/pslLightDrawAssistant.ts @@ -126,22 +126,12 @@ export class PslLightInteraction extends GraphicInteractionPlugin { g.scalable = true; g.rotatable = true; g.on('transformstart', this.transformstart, this); - g.topAnnotation.draggable = true; - g.topAnnotation.selectable = true; - g.topAnnotation.rotatable = true; - g.topAnnotation.transformSave = true; - g.topAnnotation.eventMode = 'static'; } unbind(g: PslLight): void { g.eventMode = 'none'; g.scalable = false; g.rotatable = false; g.off('transformstart', this.transformstart, this); - g.topAnnotation.draggable = false; - g.topAnnotation.selectable = false; - g.topAnnotation.rotatable = false; - g.topAnnotation.transformSave = false; - g.topAnnotation.eventMode = 'none'; } transformstart(e: GraphicTransformEvent) { const target = e.target as DisplayObject; diff --git a/src/protos/pslGraphics.ts b/src/protos/pslGraphics.ts index a70f00f..d68ba84 100644 --- a/src/protos/pslGraphics.ts +++ b/src/protos/pslGraphics.ts @@ -155,7 +155,6 @@ export namespace pslGraphicData { constructor(data?: any[] | { common?: dependency_1.graphicData.CommonInfo; code?: string; - topAnnotation?: string; lightColor?: PslElementColor; }) { super(); @@ -167,9 +166,6 @@ export namespace pslGraphicData { if ("code" in data && data.code != undefined) { this.code = data.code; } - if ("topAnnotation" in data && data.topAnnotation != undefined) { - this.topAnnotation = data.topAnnotation; - } if ("lightColor" in data && data.lightColor != undefined) { this.lightColor = data.lightColor; } @@ -190,12 +186,6 @@ export namespace pslGraphicData { set code(value: string) { pb_1.Message.setField(this, 2, value); } - get topAnnotation() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set topAnnotation(value: string) { - pb_1.Message.setField(this, 3, value); - } get lightColor() { return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor; } @@ -205,7 +195,6 @@ export namespace pslGraphicData { static fromObject(data: { common?: ReturnType; code?: string; - topAnnotation?: string; lightColor?: PslElementColor; }): PslLight { const message = new PslLight({}); @@ -215,9 +204,6 @@ export namespace pslGraphicData { if (data.code != null) { message.code = data.code; } - if (data.topAnnotation != null) { - message.topAnnotation = data.topAnnotation; - } if (data.lightColor != null) { message.lightColor = data.lightColor; } @@ -227,7 +213,6 @@ export namespace pslGraphicData { const data: { common?: ReturnType; code?: string; - topAnnotation?: string; lightColor?: PslElementColor; } = {}; if (this.common != null) { @@ -236,9 +221,6 @@ export namespace pslGraphicData { if (this.code != null) { data.code = this.code; } - if (this.topAnnotation != null) { - data.topAnnotation = this.topAnnotation; - } if (this.lightColor != null) { data.lightColor = this.lightColor; } @@ -252,8 +234,6 @@ export namespace pslGraphicData { writer.writeMessage(1, this.common, () => this.common.serialize(writer)); if (this.code.length) writer.writeString(2, this.code); - if (this.topAnnotation.length) - writer.writeString(3, this.topAnnotation); if (this.lightColor != PslElementColor.red) writer.writeEnum(4, this.lightColor); if (!w) @@ -271,9 +251,6 @@ export namespace pslGraphicData { case 2: message.code = reader.readString(); break; - case 3: - message.topAnnotation = reader.readString(); - break; case 4: message.lightColor = reader.readEnum(); break; @@ -294,7 +271,6 @@ export namespace pslGraphicData { constructor(data?: any[] | { common?: dependency_1.graphicData.CommonInfo; code?: string; - topAnnotation?: string; buttonColor?: PslElementColor; }) { super(); @@ -306,9 +282,6 @@ export namespace pslGraphicData { if ("code" in data && data.code != undefined) { this.code = data.code; } - if ("topAnnotation" in data && data.topAnnotation != undefined) { - this.topAnnotation = data.topAnnotation; - } if ("buttonColor" in data && data.buttonColor != undefined) { this.buttonColor = data.buttonColor; } @@ -329,12 +302,6 @@ export namespace pslGraphicData { set code(value: string) { pb_1.Message.setField(this, 2, value); } - get topAnnotation() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set topAnnotation(value: string) { - pb_1.Message.setField(this, 3, value); - } get buttonColor() { return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor; } @@ -344,7 +311,6 @@ export namespace pslGraphicData { static fromObject(data: { common?: ReturnType; code?: string; - topAnnotation?: string; buttonColor?: PslElementColor; }): PslButton { const message = new PslButton({}); @@ -354,9 +320,6 @@ export namespace pslGraphicData { if (data.code != null) { message.code = data.code; } - if (data.topAnnotation != null) { - message.topAnnotation = data.topAnnotation; - } if (data.buttonColor != null) { message.buttonColor = data.buttonColor; } @@ -366,7 +329,6 @@ export namespace pslGraphicData { const data: { common?: ReturnType; code?: string; - topAnnotation?: string; buttonColor?: PslElementColor; } = {}; if (this.common != null) { @@ -375,9 +337,6 @@ export namespace pslGraphicData { if (this.code != null) { data.code = this.code; } - if (this.topAnnotation != null) { - data.topAnnotation = this.topAnnotation; - } if (this.buttonColor != null) { data.buttonColor = this.buttonColor; } @@ -391,8 +350,6 @@ export namespace pslGraphicData { writer.writeMessage(1, this.common, () => this.common.serialize(writer)); if (this.code.length) writer.writeString(2, this.code); - if (this.topAnnotation.length) - writer.writeString(3, this.topAnnotation); if (this.buttonColor != PslElementColor.red) writer.writeEnum(4, this.buttonColor); if (!w) @@ -410,9 +367,6 @@ export namespace pslGraphicData { case 2: message.code = reader.readString(); break; - case 3: - message.topAnnotation = reader.readString(); - break; case 4: message.buttonColor = reader.readEnum(); break; @@ -433,8 +387,6 @@ export namespace pslGraphicData { constructor(data?: any[] | { common?: dependency_1.graphicData.CommonInfo; code?: string; - topAnnotation?: string; - rightAnnotation?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -445,12 +397,6 @@ export namespace pslGraphicData { if ("code" in data && data.code != undefined) { this.code = data.code; } - if ("topAnnotation" in data && data.topAnnotation != undefined) { - this.topAnnotation = data.topAnnotation; - } - if ("rightAnnotation" in data && data.rightAnnotation != undefined) { - this.rightAnnotation = data.rightAnnotation; - } } } get common() { @@ -468,23 +414,9 @@ export namespace pslGraphicData { set code(value: string) { pb_1.Message.setField(this, 2, value); } - get topAnnotation() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set topAnnotation(value: string) { - pb_1.Message.setField(this, 3, value); - } - get rightAnnotation() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set rightAnnotation(value: string) { - pb_1.Message.setField(this, 4, value); - } static fromObject(data: { common?: ReturnType; code?: string; - topAnnotation?: string; - rightAnnotation?: string; }): PslKey { const message = new PslKey({}); if (data.common != null) { @@ -493,20 +425,12 @@ export namespace pslGraphicData { if (data.code != null) { message.code = data.code; } - if (data.topAnnotation != null) { - message.topAnnotation = data.topAnnotation; - } - if (data.rightAnnotation != null) { - message.rightAnnotation = data.rightAnnotation; - } return message; } toObject() { const data: { common?: ReturnType; code?: string; - topAnnotation?: string; - rightAnnotation?: string; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -514,12 +438,6 @@ export namespace pslGraphicData { if (this.code != null) { data.code = this.code; } - if (this.topAnnotation != null) { - data.topAnnotation = this.topAnnotation; - } - if (this.rightAnnotation != null) { - data.rightAnnotation = this.rightAnnotation; - } return data; } serialize(): Uint8Array; @@ -530,10 +448,6 @@ export namespace pslGraphicData { writer.writeMessage(1, this.common, () => this.common.serialize(writer)); if (this.code.length) writer.writeString(2, this.code); - if (this.topAnnotation.length) - writer.writeString(3, this.topAnnotation); - if (this.rightAnnotation.length) - writer.writeString(4, this.rightAnnotation); if (!w) return writer.getResultBuffer(); } @@ -549,12 +463,6 @@ export namespace pslGraphicData { case 2: message.code = reader.readString(); break; - case 3: - message.topAnnotation = reader.readString(); - break; - case 4: - message.rightAnnotation = reader.readString(); - break; default: reader.skipField(); } }