9DaACYAlfh|
zVk7SvsFGhG?-U%E=vn=0m6;Qv)9amFE8we`ul#?)wQ>)XfUVpBzAC6U23N()>Rvq$
zx(I%tI+3OV9zRIEr!hB&&vUXYqY$A0#+B~5PUENGD^bLP2vU~JiV#)ZQWK$}iU(q2
z7>kgqo&b!Q>WyjmytP=sosr1{r3k~p0F1$l;HrC$Wwe)(<+w-yVlA%Q#aD-e3RG5L
z6UX=@fwH`u<|n2~IU3P?;|=E4*O7i7Tj`pFA;Yrd+5P))Z~#$sA>zNnU6wKX)?2*v
z_S=kicTcjjL4YhQ@Xx(Hc<|r_;7q#39Ue0H!!#VeFvSfn+<6e*Wh2X{zBng8LK49?Shs4eiR&V2t
zAuS4Qs|Ah5<>6L@fJv*_IHu8R5qhElaRt+kV)I)^xi
zcn@U>!y#X{fgW|c^!hykkjn?HGzq9~Dj_wMQD<|cRU+~L-(TLN&)SY7sRQphtB
z00^gxqmXEKAI1+n-Ss1#uj+v9X~5e~co$F-Vdi^*TY4
z5G4tzG=NePj7N9m(pIRsHeJo9ylFvAw-bFdPoq-`^(;Lw@$oJ3M^&
zklk@AJ2ueO(TLia?2n7)&SX6T{?MF(L7!j#;^(}yxJawjVlWsGSZj%*2x~1t81n1)
z-qV?-C1h`pIp+{-@!sRSN2_)d5sWd2D$W?b9Yr)=ep#221O~8;h)$!1BIvw`+_fHBNRhy;X?=v2cdH(!4hlhv6ag3^x=lO|e
zSw<8^wA*c3trk%farNp|(ljMFIy&O<
z?hAvD?R($(uKw^xH%_~yEK9moh5ujc^?DRVK~WU^3mNgeO`HSs`Tzg`07*qoM6N<$
Ef@-GHkN^Mx
literal 0
HcmV?d00001
diff --git a/src/graphics/FAS/firePump/FirePump.ts b/src/graphics/FAS/firePump/FirePump.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/graphics/FAS/firePump/FirePumpAssistant.ts b/src/graphics/FAS/firePump/FirePumpAssistant.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/graphics/FAS/fireShutter/FireShutter.json b/src/graphics/FAS/fireShutter/FireShutter.json
new file mode 100644
index 0000000..c39d0da
--- /dev/null
+++ b/src/graphics/FAS/fireShutter/FireShutter.json
@@ -0,0 +1,21 @@
+{
+ "frames": {
+ "normal.png": {
+ "frame": { "x": 0, "y": 0, "w": 33, "h": 33 },
+ "rotated": false,
+ "trimmed": false,
+ "spriteSourceSize": { "x": 0, "y": 0, "w": 33, "h": 33 },
+ "sourceSize": { "w": 33, "h": 33 },
+ "anchor": { "x": 0.5, "y": 0.5 }
+ }
+ },
+ "meta": {
+ "app": "https://www.codeandweb.com/texturepacker",
+ "version": "1.1",
+ "image": "FireShutter.png",
+ "format": "RGBA8888",
+ "size": { "w": 33, "h": 33 },
+ "scale": "1",
+ "smartupdate": "$TexturePacker:SmartUpdate:e7620bd2d73cc0b3e2deea9704e7eefc:f129a1d9e4b9ba57720b3861c22b155b:eb2d421f7759984b7713aa4aa5354134$"
+ }
+}
diff --git a/src/graphics/FAS/fireShutter/FireShutter.png b/src/graphics/FAS/fireShutter/FireShutter.png
new file mode 100644
index 0000000000000000000000000000000000000000..8fca74f887a0be0e8fdcbf61861da88cfcf52ba1
GIT binary patch
literal 988
zcmV<210(#2P)+(*4M)A$(6K32(aud#nc|?**^V%2)~@OLWd=s<^0C-a
zDofgA$;t7eq*y_A0>ygK|IInP@AL8F{GSJo(AU?e7z_s1N^^5_ND~tiu#Q(+-{joI9zw!2d0Ui>
z0a~=j0g%!M!JjfKB1itj;~wXWoru@0QAkCKQd$k~vss!n8N=_zz~cPoHuJLWwC&GiTP?w2zZER=EiGcTeb
z^3W66>CCjG
zdI&iNN)l`jJGeajBRK~6b;b+8v~Qe_7v9EcZ{m}0-p?39)nLj|*kAt~k2f^Z{`vt<
z9Q%-(^4)CI6#%fW*}=yr&!H#^Gvl))Ln?>-pM&}Jd-MMqt0)Seo_?37pK2lG*Whwp
z#crPqCXU|?Bl}Z6H
zI5>nhUr#I+2f${tpeUKGyXu(;-29E|>PiX>My%GIh~iReGMU6XBI!ZqMFAlLMPK8;Qpvw6-=c-?gQAg
zO^tY`MpXf*hFDyPpx5WGIJkx1b6`T)@Bv@9-0X=tcheF#w$k!2Zxv9W0Y
z3$=#?!0GArU39i`O#g6NNXJ;t#ydBq!ITJ0QHWS{`2PP-hTm*={y^bV;7qM0000<
KMNUMnLSTZe@yWLU
literal 0
HcmV?d00001
diff --git a/src/graphics/FAS/fireShutter/FireShutter.ts b/src/graphics/FAS/fireShutter/FireShutter.ts
new file mode 100644
index 0000000..1f5104a
--- /dev/null
+++ b/src/graphics/FAS/fireShutter/FireShutter.ts
@@ -0,0 +1,63 @@
+import { GraphicData, JlGraphic, JlGraphicTemplate } from 'jl-graphic';
+import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js';
+// import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
+import FireShutterJson from './fireShutter.json';
+import FireShutterAssets from './fireShutter.png';
+
+export interface IFireShutterData extends GraphicData {
+ get code(): string;
+ set code(v: string);
+}
+
+interface FireShutterTextures {
+ normal: Texture;
+}
+
+export class FireShutter extends JlGraphic {
+ static Type = 'FireShutter';
+ _fireShutter: Sprite;
+ fireShutterTextures: FireShutterTextures;
+ __state = 0;
+
+ constructor(fireShutterTextures: FireShutterTextures) {
+ super(FireShutter.Type);
+ this._fireShutter = new Sprite();
+ this.fireShutterTextures = fireShutterTextures;
+ this._fireShutter.anchor.set(0.5);
+ this.addChild(this._fireShutter);
+ this._fireShutter.texture = this.fireShutterTextures.normal;
+ }
+ get code(): string {
+ return this.datas.code;
+ }
+ get datas(): IFireShutterData {
+ return this.getDatas();
+ }
+
+ doRepaint(): void {}
+}
+
+export class FireShutterTemplate extends JlGraphicTemplate {
+ fireShutterTextures?: FireShutterTextures;
+ constructor(dataTemplate: IFireShutterData) {
+ super(FireShutter.Type, { dataTemplate });
+ this.loadAssets();
+ }
+ new(): FireShutter {
+ if (this.fireShutterTextures) {
+ const g = new FireShutter(this.fireShutterTextures);
+ g.loadData(this.datas);
+ return g;
+ }
+ throw new Error('资源未加载/加载失败');
+ }
+ async loadAssets(): Promise {
+ const texture = await Assets.load(FireShutterAssets);
+ const fireShutterSheet = new Spritesheet(texture, FireShutterJson);
+ const result = await fireShutterSheet.parse();
+ this.fireShutterTextures = {
+ normal: result['normal.png'],
+ };
+ return this.fireShutterTextures as FireShutterTextures;
+ }
+}
diff --git a/src/graphics/FAS/fireShutter/FireShutterAssistant.ts b/src/graphics/FAS/fireShutter/FireShutterAssistant.ts
new file mode 100644
index 0000000..dc4c3b2
--- /dev/null
+++ b/src/graphics/FAS/fireShutter/FireShutterAssistant.ts
@@ -0,0 +1,128 @@
+import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
+import {
+ AbsorbableLine,
+ AbsorbablePosition,
+ GraphicDrawAssistant,
+ GraphicInteractionPlugin,
+ GraphicTransformEvent,
+ IDrawApp,
+ JlGraphic,
+} from 'jl-graphic';
+import {
+ IFireShutterData,
+ FireShutter,
+ FireShutterTemplate,
+} from './FireShutter';
+
+export class FireShutterDraw extends GraphicDrawAssistant<
+ FireShutterTemplate,
+ IFireShutterData
+> {
+ _fireShutter: FireShutter | null = null;
+ constructor(app: IDrawApp, template: FireShutterTemplate) {
+ super(
+ app,
+ template,
+ 'svguse:../drawIcon.svg#icon-fire-shutter',
+ '防火卷帘'
+ );
+ FireShutterInteraction.init(app);
+ }
+
+ bind(): void {
+ super.bind();
+ if (!this._fireShutter) {
+ this._fireShutter = this.graphicTemplate.new();
+ this.container.addChild(this._fireShutter);
+ }
+ }
+
+ public get fireShutter(): FireShutter {
+ if (!this._fireShutter) {
+ this._fireShutter = this.graphicTemplate.new();
+ this.container.addChild(this._fireShutter);
+ }
+ return this._fireShutter;
+ }
+
+ redraw(cp: Point): void {
+ this.fireShutter.position.copyFrom(cp);
+ }
+ onLeftUp(e: FederatedMouseEvent): void {
+ this.fireShutter.position.copyFrom(this.toCanvasCoordinates(e.global));
+ this.createAndStore(true);
+ }
+ prepareData(data: IFireShutterData): boolean {
+ data.transform = this.fireShutter.saveTransform();
+ return true;
+ }
+ onEsc(): void {
+ this.finish();
+ }
+}
+
+/**
+ * 构建吸附线
+ * @param fireShutter
+ */
+function buildAbsorbablePositions(
+ fireShutter: FireShutter
+): AbsorbablePosition[] {
+ const aps: AbsorbablePosition[] = [];
+ const fireShutters = fireShutter.queryStore.queryByType(
+ FireShutter.Type
+ );
+ const canvas = fireShutter.getCanvas();
+ fireShutters.forEach((item) => {
+ if (item.id === fireShutter.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 FireShutterInteraction extends GraphicInteractionPlugin {
+ static Name = 'fas_alarm_transform';
+ constructor(app: IDrawApp) {
+ super(FireShutterInteraction.Name, app);
+ }
+ static init(app: IDrawApp) {
+ return new FireShutterInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): FireShutter[] | undefined {
+ return grahpics
+ .filter((g) => g.type === FireShutter.Type)
+ .map((g) => g as FireShutter);
+ }
+ bind(g: FireShutter): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.scalable = true;
+ g.rotatable = true;
+ g.on('transformstart', this.transformstart, this);
+ }
+ unbind(g: FireShutter): void {
+ g.eventMode = 'none';
+ g.scalable = false;
+ g.rotatable = false;
+ g.off('transformstart', this.transformstart, this);
+ }
+ transformstart(e: GraphicTransformEvent) {
+ const target = e.target as DisplayObject;
+ const fireShutter = target.getGraphic() as FireShutter;
+ fireShutter.getGraphicApp().setOptions({
+ absorbablePositions: buildAbsorbablePositions(fireShutter),
+ });
+ }
+}
diff --git a/src/graphics/FAS/temperatureDetector/TemperatureDetector.json b/src/graphics/FAS/temperatureDetector/TemperatureDetector.json
new file mode 100644
index 0000000..47369d4
--- /dev/null
+++ b/src/graphics/FAS/temperatureDetector/TemperatureDetector.json
@@ -0,0 +1,21 @@
+{
+ "frames": {
+ "normal.png": {
+ "frame": { "x": 0, "y": 0, "w": 21, "h": 11 },
+ "rotated": false,
+ "trimmed": false,
+ "spriteSourceSize": { "x": 0, "y": 0, "w": 21, "h": 11 },
+ "sourceSize": { "w": 21, "h": 11 },
+ "anchor": { "x": 0.5, "y": 0.5 }
+ }
+ },
+ "meta": {
+ "app": "https://www.codeandweb.com/texturepacker",
+ "version": "1.1",
+ "image": "TemperatureDetector.png",
+ "format": "RGBA8888",
+ "size": { "w": 21, "h": 11 },
+ "scale": "1",
+ "smartupdate": "$TexturePacker:SmartUpdate:e7620bd2d73cc0b3e2deea9704e7eefc:f129a1d9e4b9ba57720b3861c22b155b:eb2d421f7759984b7713aa4aa5354134$"
+ }
+}
diff --git a/src/graphics/FAS/temperatureDetector/TemperatureDetector.png b/src/graphics/FAS/temperatureDetector/TemperatureDetector.png
new file mode 100644
index 0000000000000000000000000000000000000000..a3e24cf5be0ebf5f8c1b7f40b3b46dddf90d8d91
GIT binary patch
literal 644
zcmV-~0(5P)(3v>sCIkZw9w_uc`?cTuJPzs)xQ2^Y7mwH7
zswu}o!i$FmV*?6k1Ztq(!1jp%P*4#IjHN9q6ZC>v;v_jNmXkDVZ5=v
z^`-wcm@Ln1e6DS5`fZSX7khOyF#;tFsOm^kMU^mW6>8xFVXD8|wAJDqRdsoJ`PI_P
z58qx#=}yAA*haQ*oVuQgOcEMdD^_hByO^y+ugjEAoji2u=AB!!^D|UY5DMITe12v4
zZ92q0mv7icyNxhm^YQSm{kiMoLWUU$w|_V4HB5F+y?FFq4Fxa&1WMrI_}%z01V^{3uD)$p6HzW*v~Y(Yqp#I
z)y-~q(#>eqNv_pC^C{ZJ?C9mBEm&`?wfs4B_z+SH#)~wOETK%>=>tm-Euv(
zCf?i*0R8|dYY=S();
+ }
+
+ doRepaint(): void {}
+}
+
+export class TemperatureDetectorTemplate extends JlGraphicTemplate {
+ temperatureDetectorTextures?: TemperatureDetectorTextures;
+ constructor(dataTemplate: ITemperatureDetectorData) {
+ super(TemperatureDetector.Type, { dataTemplate });
+ this.loadAssets();
+ }
+ new(): TemperatureDetector {
+ if (this.temperatureDetectorTextures) {
+ const g = new TemperatureDetector(this.temperatureDetectorTextures);
+ g.loadData(this.datas);
+ return g;
+ }
+ throw new Error('资源未加载/加载失败');
+ }
+ async loadAssets(): Promise {
+ const texture = await Assets.load(TemperatureDetectorAsset);
+ const temperatureDetectorSheet = new Spritesheet(
+ texture,
+ TemperatureDetectorJson
+ );
+ const result = await temperatureDetectorSheet.parse();
+ this.temperatureDetectorTextures = {
+ normal: result['normal.png'],
+ };
+ return this.temperatureDetectorTextures as TemperatureDetectorTextures;
+ }
+}
diff --git a/src/graphics/FAS/temperatureDetector/TemperatureDetectorAssistant.ts b/src/graphics/FAS/temperatureDetector/TemperatureDetectorAssistant.ts
new file mode 100644
index 0000000..16eb0d2
--- /dev/null
+++ b/src/graphics/FAS/temperatureDetector/TemperatureDetectorAssistant.ts
@@ -0,0 +1,131 @@
+import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
+import {
+ AbsorbableLine,
+ AbsorbablePosition,
+ GraphicDrawAssistant,
+ GraphicInteractionPlugin,
+ GraphicTransformEvent,
+ IDrawApp,
+ JlGraphic,
+} from 'jl-graphic';
+import {
+ ITemperatureDetectorData,
+ TemperatureDetector,
+ TemperatureDetectorTemplate,
+} from './TemperatureDetector';
+
+export class TemperatureDetectorDraw extends GraphicDrawAssistant<
+ TemperatureDetectorTemplate,
+ ITemperatureDetectorData
+> {
+ _temperatureDetector: TemperatureDetector | null = null;
+ constructor(app: IDrawApp, template: TemperatureDetectorTemplate) {
+ super(
+ app,
+ template,
+ 'svguse:../drawIcon.svg#icon-temperature-detector',
+ '温感'
+ );
+ TemperatureDetectorInteraction.init(app);
+ }
+
+ bind(): void {
+ super.bind();
+ if (!this._temperatureDetector) {
+ this._temperatureDetector = this.graphicTemplate.new();
+ this.container.addChild(this._temperatureDetector);
+ }
+ }
+
+ public get temperatureDetector(): TemperatureDetector {
+ if (!this._temperatureDetector) {
+ this._temperatureDetector = this.graphicTemplate.new();
+ this.container.addChild(this._temperatureDetector);
+ }
+ return this._temperatureDetector;
+ }
+
+ redraw(cp: Point): void {
+ this.temperatureDetector.position.copyFrom(cp);
+ }
+ onLeftUp(e: FederatedMouseEvent): void {
+ this.temperatureDetector.position.copyFrom(
+ this.toCanvasCoordinates(e.global)
+ );
+ this.createAndStore(true);
+ }
+ prepareData(data: ITemperatureDetectorData): boolean {
+ data.transform = this.temperatureDetector.saveTransform();
+ return true;
+ }
+ onEsc(): void {
+ this.finish();
+ }
+}
+
+/**
+ * 构建吸附线
+ * @param temperatureDetector
+ */
+function buildAbsorbablePositions(
+ temperatureDetector: TemperatureDetector
+): AbsorbablePosition[] {
+ const aps: AbsorbablePosition[] = [];
+ const temperatureDetectors =
+ temperatureDetector.queryStore.queryByType(
+ TemperatureDetector.Type
+ );
+ const canvas = temperatureDetector.getCanvas();
+ temperatureDetectors.forEach((item) => {
+ if (item.id === temperatureDetector.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 TemperatureDetectorInteraction extends GraphicInteractionPlugin {
+ static Name = 'temperature_detector_transform';
+ constructor(app: IDrawApp) {
+ super(TemperatureDetectorInteraction.Name, app);
+ }
+ static init(app: IDrawApp) {
+ return new TemperatureDetectorInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): TemperatureDetector[] | undefined {
+ return grahpics
+ .filter((g) => g.type === TemperatureDetector.Type)
+ .map((g) => g as TemperatureDetector);
+ }
+ bind(g: TemperatureDetector): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.scalable = true;
+ g.rotatable = true;
+ g.on('transformstart', this.transformstart, this);
+ }
+ unbind(g: TemperatureDetector): void {
+ g.eventMode = 'none';
+ g.scalable = false;
+ g.rotatable = false;
+ g.off('transformstart', this.transformstart, this);
+ }
+ transformstart(e: GraphicTransformEvent) {
+ const target = e.target as DisplayObject;
+ const temperatureDetector = target.getGraphic() as TemperatureDetector;
+ temperatureDetector.getGraphicApp().setOptions({
+ absorbablePositions: buildAbsorbablePositions(temperatureDetector),
+ });
+ }
+}
diff --git a/src/layouts/IscsDrawLayout.vue b/src/layouts/IscsDrawLayout.vue
index 331613f..777803a 100644
--- a/src/layouts/IscsDrawLayout.vue
+++ b/src/layouts/IscsDrawLayout.vue
@@ -310,6 +310,8 @@ import { FasFailureControlHost } from 'src/graphics/FAS/fireFailureControlHost/F
import { FasAlarm } from 'src/graphics/FAS/fasAlarm/FasAlarm';
import { ManualAlarmButton } from 'src/graphics/FAS/manualAlarmButton/ManualAlarmButton';
import { SmokeDetector } from 'src/graphics/FAS/smokeDetector/SmokeDetector';
+import { TemperatureDetector } from 'src/graphics/FAS/temperatureDetector/TemperatureDetector';
+import { FireShutter } from 'src/graphics/FAS/fireShutter/FireShutter';
const $q = useQuasar();
const route = useRoute();
@@ -398,6 +400,8 @@ function handleUtilsOption() {
drawAssistantsTypes.push(FasAlarm.Type);
drawAssistantsTypes.push(ManualAlarmButton.Type);
drawAssistantsTypes.push(SmokeDetector.Type);
+ drawAssistantsTypes.push(TemperatureDetector.Type);
+ drawAssistantsTypes.push(FireShutter.Type);
break;
}
drawAssistantsTypes.forEach((type) => {