From d9512f73cca87702aec40f49b48de7989fa73d00 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 2 Jul 2020 16:02:10 +0200 Subject: [PATCH] fix gauges --- .../assets/styles/base/arch-interface.less | 13 + Thermo.Active/wwwroot/assets/styles/style.css | 12 + .../arch-interface/arch-interface.ts | 19 +- .../arch-interface/arch-interface.vue | 63 +++-- .../wwwroot/src/modules/app-header.vue | 246 +++++++++++------- 5 files changed, 225 insertions(+), 128 deletions(-) diff --git a/Thermo.Active/wwwroot/assets/styles/base/arch-interface.less b/Thermo.Active/wwwroot/assets/styles/base/arch-interface.less index 8413732d..a8374292 100644 --- a/Thermo.Active/wwwroot/assets/styles/base/arch-interface.less +++ b/Thermo.Active/wwwroot/assets/styles/base/arch-interface.less @@ -9,6 +9,19 @@ .box-gauge { width: 68px; + position: relative; + + .value { + position: absolute; + top: 35%; + margin: auto; + width: 100%; + left: 0; + /* right: 0; */ + text-align: center; + font-size: 0.8rem; + color: @color-darkish-blue; + } div { diff --git a/Thermo.Active/wwwroot/assets/styles/style.css b/Thermo.Active/wwwroot/assets/styles/style.css index 33caa736..f925550f 100644 --- a/Thermo.Active/wwwroot/assets/styles/style.css +++ b/Thermo.Active/wwwroot/assets/styles/style.css @@ -4801,6 +4801,18 @@ article .box .body { } .arch .box-gauge { width: 68px; + position: relative; +} +.arch .box-gauge .value { + position: absolute; + top: 35%; + margin: auto; + width: 100%; + left: 0; + /* right: 0; */ + text-align: center; + font-size: 0.8rem; + color: #002680; } .arch .box-gauge div:last-of-type { margin-top: -25px; diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.ts index 03691e5e..8fcf08cb 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.ts @@ -18,15 +18,22 @@ export default class archinterface extends Vue { @Watch('gaugeData') gaugeDataChanged(n, o) { - if (this.gaugePower) this.gaugePower.setValueAnimated(n.power, 1); - if (this.gaugeAir) this.gaugeAir.setValueAnimated(n.air, 1); - if (this.gaugeVacuum) this.gaugeVacuum.setValueAnimated(n.vacuum, 1); + + if (this.gaugePower) { + this.gaugePower.setValueAnimated(n.power.value * 100 / (n.power.maxVal - n.power.minVal), 1) + }; + if (this.gaugeAir) { + this.gaugeAir.setValueAnimated(n.air.value * 100 / (n.air.maxVal - n.air.minVal), 1); + } + if (this.gaugeVacuum) { + this.gaugeVacuum.setValueAnimated(n.vacuum.value * 100 / (n.vacuum.maxVal - n.vacuum.minVal), 1); + } } mounted() { - this.gaugePower = Gauge(this.$refs.gauge1, { min: 0, max: 100, value: 0 }); - this.gaugeAir = Gauge(this.$refs.gauge2, { min: 0, max: 100, value: 0 }); - this.gaugeVacuum = Gauge(this.$refs.gauge3, { min: 0, max: 100, value: 0 }); + this.gaugePower = Gauge(this.$refs.gauge1, { min: 0, max: 100, value: 0, showValue: false }); + this.gaugeAir = Gauge(this.$refs.gauge2, { min: 0, max: 100, value: 0, showValue: false }); + this.gaugeVacuum = Gauge(this.$refs.gauge3, { min: 0, max: 100, value: 0, showValue: false }); } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.vue index b01ea04d..b20a2dd4 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/arch-interface/arch-interface.vue @@ -1,33 +1,40 @@ diff --git a/Thermo.Active/wwwroot/src/modules/app-header.vue b/Thermo.Active/wwwroot/src/modules/app-header.vue index ee8a1064..472371ab 100644 --- a/Thermo.Active/wwwroot/src/modules/app-header.vue +++ b/Thermo.Active/wwwroot/src/modules/app-header.vue @@ -1,104 +1,162 @@