From 968dab090ded6472e8ccd7f9720b68555fd480e8 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 31 Aug 2020 16:10:39 +0200 Subject: [PATCH] =?UTF-8?q?fix=20velocit=C3=A0=20di=20aggiornamento=20slid?= =?UTF-8?q?er=20tramite=20tasti.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Thermo.Active/wwwroot/config.development.json | 2 +- Thermo.Active/wwwroot/index.html | 2 +- .../app_modules_thermo/components/slider.ts | 63 +++++++++++-------- .../app_modules_thermo/components/slider.vue | 4 +- .../setup/ciclo/components/show-ciclo-info.ts | 5 +- .../components/show-controstampo-info.ts | 7 ++- .../components/show-estrazione-info.ts | 6 +- .../formato/components/show-formato-info.ts | 7 ++- .../setup/imbutitura/show-imbutitura-info.ts | 7 ++- .../setup/opzioni/show-opzioni-info.ts | 7 ++- .../components/show-pirometro-info.ts | 7 ++- .../components/show-quote-velocita-info.ts | 7 ++- .../components/show-raffreddamento-info.ts | 7 ++- .../riscaldi/components/show-riscaldi-info.ts | 7 ++- .../setup/vuoto/show-vuoto-info.ts | 7 ++- 15 files changed, 95 insertions(+), 50 deletions(-) diff --git a/Thermo.Active/wwwroot/config.development.json b/Thermo.Active/wwwroot/config.development.json index 8c7723c2..58ce0f2f 100644 --- a/Thermo.Active/wwwroot/config.development.json +++ b/Thermo.Active/wwwroot/config.development.json @@ -2,7 +2,7 @@ "env": "development", "api": { "enabled": true, - "apiServerUrl": "http://localhost:9000/" + "apiServerUrl": "http://seriate.steamware.net:9000/" }, "allUIVisible": true } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/index.html b/Thermo.Active/wwwroot/index.html index e00637af..ac35876a 100644 --- a/Thermo.Active/wwwroot/index.html +++ b/Thermo.Active/wwwroot/index.html @@ -13,7 +13,7 @@ - + diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.ts index 9f60bb8e..291e9314 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.ts @@ -1,8 +1,9 @@ import Vue from "vue"; import Component from "vue-class-component"; import { Prop } from 'vue-property-decorator'; -import { debounce } from "@/_base/debounce"; + import { Hub } from "@/services"; +import Numeric from "./numeric"; @Component({ name: "slider" }) export default class Slider extends Vue { @@ -17,6 +18,8 @@ export default class Slider extends Vue { @Prop({ default: 1 }) decimal: number; + incrementing: number = 0; + tempValue: number = null; get actualvalue() { return this.value.setpointHMI; @@ -27,11 +30,9 @@ export default class Slider extends Vue { } set actualvalue(v: number) { - this.debouncedActualValue(v) + this.value.setpointHMI = v; } - debouncedActualValue = debounce((v: number) => this.value.setpointHMI = v, 200); - get step() { // var s = ((this.value.range.max - this.value.range.min) / (this.lines + 1)); // var m = Math.pow(10, this.decimal); @@ -39,31 +40,43 @@ export default class Slider extends Vue { return 1; }; - increment() { + startIncrement() { if (!this.value.status.enabled) return; + this.incrementing = setInterval(() => { + var v = this.value.setpointHMI; + if (v < this.value.range.max) { + v += this.step; + } + if (v > this.value.range.max) { + v = this.value.range.max; + } + this.actualvalue = v; + }, 50); + } + + startDecrement() { + if (!this.value.status.enabled) return; + this.incrementing = setInterval(() => { + var v = this.value.setpointHMI; + if (v > this.value.range.min) { + v -= this.step; + } + if (v < this.value.range.min) { + v = this.value.range.min; + } + this.actualvalue = v; + }, 50); + } + + confirm() { + if (!this.value.status.enabled) return; + if (this.incrementing) + clearInterval(this.incrementing); + + this.incrementing = 0; - var v = this.value.setpointHMI; - if (v < this.value.range.max) { - v += this.step; - } - if (v > this.value.range.max) { - v = this.value.range.max; - } - this.actualvalue = v; }; - decrement() { - if (!this.value.status.enabled) return; - - var v = this.value.setpointHMI; - if (v > this.value.range.min) { - v -= this.step; - } - if (v < this.value.range.min) { - v = this.value.range.min; - } - this.actualvalue = v; - }; doSoftKeyClick() { Hub.Current.sendUserSoftKey(this.softKey.id); diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.vue index 49e20882..b8809087 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.vue @@ -1,7 +1,7 @@