From 0ea0fbd8d4ed1b61d9b7a501e95809e7922ed0bb Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 28 Sep 2020 09:16:54 +0200 Subject: [PATCH] fix client problems and slider behaviour --- Client.Config/Config.xml | 2 +- Client/View/MainForm.cs | 2 +- .../app_modules_thermo/components/slider.ts | 22 ++++++++++--------- .../app_modules_thermo/components/slider.vue | 6 ++--- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Client.Config/Config.xml b/Client.Config/Config.xml index cf12b14a..8c1d68c1 100644 --- a/Client.Config/Config.xml +++ b/Client.Config/Config.xml @@ -4,7 +4,7 @@ false #FF00FF GPU - false + true false true diff --git a/Client/View/MainForm.cs b/Client/View/MainForm.cs index 88145e34..2540ff0f 100644 --- a/Client/View/MainForm.cs +++ b/Client/View/MainForm.cs @@ -434,7 +434,7 @@ namespace Active_Client.View string dom = ev.Node.GetElementAttribute("type").ToLower(); //Filter if the node Type is TEXT or PASSWORD - if (dom != null && (dom.Equals("text") || dom.Equals("password"))) + if (dom != null && (dom.Equals("text") || dom.Equals("password") || dom.Equals(""))) NcWindow.openVirtualKeyboard(ev.Node.ElementBounds, ev.Browser.Identifier > 1, false); } //Filter if this node is TEXTAREA Node 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 159b4692..98ffcb75 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.ts @@ -38,6 +38,7 @@ export default class Slider extends Vue { incrementingStep: number; step: number = 1; + initalStep: number = 1; // get step() { // var s = ((this.value.range.max - this.value.range.min) / (this.lines + 1)); // var m = Math.pow(10, this.decimal); @@ -46,44 +47,45 @@ export default class Slider extends Vue { // }; mounted() { - this.step = 1 / Math.pow(10, this.value.numDec); + this.initalStep = 1 / Math.pow(10, this.value.numDec); + this.step = this.initalStep; if (Number.isNaN(this.step)) this.step = 1; } startIncrement() { if (!this.value.status.enabled) return; this.incrementValue(); - this.incrementing = setInterval(this.incrementValue, 50); + this.incrementing = setInterval(this.incrementValue, 100); } startDecrement() { if (!this.value.status.enabled) return; this.decrementValue(); - this.incrementing = setInterval(this.decrementValue, 50); + this.incrementing = setInterval(this.decrementValue, 100); } decrementValue(){ var v = this.value.setpointHMI; if (v < this.value.range.max) { - v += Math.floor(this.step); - this.step += this.incrementingStep; + v -= this.step; + this.step += this.incrementingStep * this.initalStep; } if (v > this.value.range.max) { v = this.value.range.max; } - this.actualvalue = v; + this.actualvalue = parseFloat(v.toFixed(this.value.numDec)); } incrementValue(){ var v = this.value.setpointHMI; if (v < this.value.range.max) { - v += Math.floor(this.step); - this.step += this.incrementingStep; + v += this.step; + this.step += this.incrementingStep * this.initalStep; } if (v > this.value.range.max) { v = this.value.range.max; } - this.actualvalue = v; + this.actualvalue = parseFloat(v.toFixed(this.value.numDec)); } confirm() { @@ -92,7 +94,7 @@ export default class Slider extends Vue { clearInterval(this.incrementing); this.incrementing = 0; - this.step = 1; + this.step = this.initalStep; }; 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 624321fb..d4574cc2 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/slider.vue @@ -20,9 +20,9 @@
- {{`${this.value.range.min} ${this.value.unitMeasure}`}} - {{`${(this.value.range.max - this.value.range.min) / 2 + this.value.range.min} ${this.value.unitMeasure}`}} - {{`${this.value.range.max} ${this.value.unitMeasure}`}} + {{`${this.value.range.min.toFixed(this.value.numDec)} ${this.value.unitMeasure}`}} + {{`${((this.value.range.max - this.value.range.min) / 2 + this.value.range.min).toFixed(this.value.numDec)} ${this.value.unitMeasure}`}} + {{`${this.value.range.max.toFixed(this.value.numDec)} ${this.value.unitMeasure}`}}