From 0ba2c8305ca91b232ab0935433dce7d0f05c3a02 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 23 Feb 2021 16:31:13 +0100 Subject: [PATCH] modal show & get tcamdata --- Thermo.Active/wwwroot/src/App.vue | 1 + .../base-components/thermoProphet-modal.ts | 12 ++++++++---- .../components/base-components/thermocamera.ts | 8 +++++++- .../wwwroot/src/services/warmersService.ts | 16 ++++++++++++---- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Thermo.Active/wwwroot/src/App.vue b/Thermo.Active/wwwroot/src/App.vue index 9730b272..32fdca0f 100644 --- a/Thermo.Active/wwwroot/src/App.vue +++ b/Thermo.Active/wwwroot/src/App.vue @@ -31,6 +31,7 @@ + diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermoProphet-modal.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermoProphet-modal.ts index 83b8bb75..4033d93b 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermoProphet-modal.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermoProphet-modal.ts @@ -1,12 +1,19 @@ import Component from "vue-class-component"; import Vue from "vue"; import { ModalHelper, Modal } from "@/components/modals"; +import { Prop } from "vue-property-decorator"; @Component({ components: { modal: Modal }, }) export default class ThermoModal extends Vue { + @Prop() + TCamData: { + imageSize: { x: number, y: number }, + rangeTemperature: { max: number, min: number }, + } + showPreview = 0; selectedImage: number = 0; serverPath = "/thermoprophet/colored"; @@ -127,12 +134,9 @@ export default class ThermoModal extends Vue { '20201116-110618.jpg']; close() { - ModalHelper.HideModal(); + ModalHelper.HideModal("modal2"); } mounted() { - for (const iterator of this.images) { - - } } } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts index 2fb88a2c..ba96d595 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts @@ -29,6 +29,11 @@ export default class Thermocamera extends Vue { thermoImageOpacity: number = 0; resistanceMode = 0; + TCamData: { + imageSize: { x: number, y: number }, + rangeTemperature: { max: number, min: number }, + } = null; + @Watch("warmers", { deep: true }) async ChangedTemps() { @@ -47,6 +52,7 @@ export default class Thermocamera extends Vue { } async mounted() { this.ChangedTemps(); + this.TCamData = await warmersService.GetTCamData(); } get selectedChannels(): Warmers.IChannel[] { @@ -169,6 +175,6 @@ export default class Thermocamera extends Vue { } async openThermoModal() { - ModalHelper.ShowModal(termoModal); + ModalHelper.ShowModal(termoModal, "modal2"); } } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/services/warmersService.ts b/Thermo.Active/wwwroot/src/services/warmersService.ts index 9e6af3d0..e335190a 100644 --- a/Thermo.Active/wwwroot/src/services/warmersService.ts +++ b/Thermo.Active/wwwroot/src/services/warmersService.ts @@ -10,7 +10,7 @@ export class WarmersService extends baseRestService { async GetThermocameraStatus() { let result = await this.Get((await this.BASE_URL()) + "TCamData"); - warmersActions.setTcamStatus(store, result as Warmers.ICamStatus ); + warmersActions.setTcamStatus(store, result as Warmers.ICamStatus); return result; } @@ -42,12 +42,12 @@ export class WarmersService extends baseRestService { } async setTCamMode(model: boolean) { - let result = await this.Put((await this.BASE_URL()) + "setTCamMode?enableTCam="+model, {}, true); + let result = await this.Put((await this.BASE_URL()) + "setTCamMode?enableTCam=" + model, {}, true); return result; } - + async setTCamOn(model: boolean) { - let result = await this.Put((await this.BASE_URL()) + "setTCamOn?setTCamOn="+model,{}, true); + let result = await this.Put((await this.BASE_URL()) + "setTCamOn?setTCamOn=" + model, {}, true); return result; } @@ -66,5 +66,13 @@ export class WarmersService extends baseRestService { return result; } + async GetTCamData() { + let result = await this.Get<{ + imageSize: { x: number, y: number }, + rangeTemperature: { max: number, min: number }, + }>((await this.BASE_URL()) + "TCamData", true); + return result; + } + } export const warmersService = new WarmersService(); \ No newline at end of file