From d207f82cc16f71c03fefd054364fa73342be393c Mon Sep 17 00:00:00 2001 From: = Date: Sat, 3 Oct 2020 18:08:55 +0200 Subject: [PATCH 01/10] dashboard legend --- .../dashboard/base-components/stats.ts | 2 +- .../dashboard/base-components/stats.vue | 29 +++++++++++++++++-- Thermo.Active/wwwroot/src/services/hub.ts | 1 - 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.ts index 361dedd7..4b6e5c4d 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.ts @@ -47,6 +47,6 @@ export default class stats extends Vue { d.push() return d.join(" "); } - return null; + return ""; } } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.vue index 3cfb8386..55185da5 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/stats.vue @@ -1,5 +1,9 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/services/hub.ts b/Thermo.Active/wwwroot/src/services/hub.ts index 17e50bb1..e7ec2536 100644 --- a/Thermo.Active/wwwroot/src/services/hub.ts +++ b/Thermo.Active/wwwroot/src/services/hub.ts @@ -188,7 +188,6 @@ export class Hub { } public static prodData(data) { - console.log('prodInfoData', data); prodActions.setProd(store, data); } From ab9f65391eb7e8a1c55acf8892b0a1a42ac53a44 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 3 Oct 2020 18:32:57 +0200 Subject: [PATCH 02/10] dashboar grafico e legenda --- .../wwwroot/assets/styles/base/dashboard.less | 20 +++++++++++--- Thermo.Active/wwwroot/assets/styles/style.css | 5 ++++ .../app_modules_thermo/dashboard/dashboard.ts | 2 ++ .../dashboard/dashboard.vue | 27 ++++++++++++++++--- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/Thermo.Active/wwwroot/assets/styles/base/dashboard.less b/Thermo.Active/wwwroot/assets/styles/base/dashboard.less index 1882cc84..5decc7a4 100644 --- a/Thermo.Active/wwwroot/assets/styles/base/dashboard.less +++ b/Thermo.Active/wwwroot/assets/styles/base/dashboard.less @@ -254,12 +254,13 @@ align-items: center; display: flex; color: #4b4b4b; - + &.pressed, &:active:not([disabled]) { background-color: #4b4b4baa; } - &:hover{ + + &:hover { border: 2px solid #1791ff; } } @@ -336,6 +337,7 @@ } .piece_time { + cursor: pointer; display: grid; grid-template-rows: repeat(2, auto); grid-template-columns: repeat(2, auto); @@ -352,6 +354,15 @@ grid-column: 2; } + .piece_hours, + .time_cycle { + &.selected { + span { + color: #1791ff !important; + } + } + } + div { display: flex; flex-flow: column; @@ -456,12 +467,13 @@ height: 50px; border: 2px solid #4b4b4b; box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.5); - + &.pressed, &:active:not([disabled]) { background-color: #4b4b4baa; } - &:hover{ + + &:hover { border: 2px solid #1791ff; } } diff --git a/Thermo.Active/wwwroot/assets/styles/style.css b/Thermo.Active/wwwroot/assets/styles/style.css index c3e98fd7..4c048368 100644 --- a/Thermo.Active/wwwroot/assets/styles/style.css +++ b/Thermo.Active/wwwroot/assets/styles/style.css @@ -4493,6 +4493,7 @@ article .box .body { z-index: 1; } .dashboard .third_col .piece_time { + cursor: pointer; display: grid; grid-template-rows: repeat(2, auto); grid-template-columns: repeat(2, auto); @@ -4507,6 +4508,10 @@ article .box .body { grid-row: 1; grid-column: 2; } +.dashboard .third_col .piece_time .piece_hours.selected span, +.dashboard .third_col .piece_time .time_cycle.selected span { + color: #1791ff !important; +} .dashboard .third_col .piece_time div { display: flex; flex-flow: column; diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts index 9391e9de..6305d2ff 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts @@ -27,6 +27,8 @@ import { SoftKeysConfigurationModel } from '@/store/machineInfo.store'; }) export default class Dashboard extends Vue { + selectedChart: 'tempociclo' | 'pezziora' = "pezziora"; + get panel() { return (this.$store.state as AppModel).prod.panel; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue index c52fa8da..17fcca51 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue @@ -144,19 +144,40 @@
-
+
{{'dashboard-piece-hours' | localize('pezzi/ora')}} {{panel.lastCadenza | round(1)}} --
-
+
{{'dashboard-time-cycle' | localize('tempo/ciclo')}} {{Math.floor(panel.lastTCiclo / 60) | round(0)}}'{{panel.lastTCiclo % 60 | round(0)}}'' --
- + +
From e60b47560e560a0c32dcfd107cd763b70e48e121 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 5 Oct 2020 11:10:58 +0200 Subject: [PATCH 03/10] fix naming dei files e dashboard con cestino --- .../assets/styles/base/dashboard-gauge.less | 4 + .../wwwroot/assets/styles/base/dashboard.less | 5 ++ Thermo.Active/wwwroot/assets/styles/style.css | 7 ++ Thermo.Active/wwwroot/config.development.json | 2 +- Thermo.Active/wwwroot/index.html | 2 +- Thermo.Active/wwwroot/src/@types/prod.cs.d.ts | 1 + .../dashboard/base-components/gauge.ts | 42 +++++----- .../dashboard/base-components/gauge.vue | 30 +++++++- .../dashboard/base-components/item.ts | 6 ++ .../dashboard/base-components/item.vue | 6 +- .../app_modules_thermo/dashboard/dashboard.ts | 15 +++- .../dashboard/dashboard.vue | 2 +- .../components/programmazione-preriscaldo.ts | 77 +++++++++---------- ...HeatingService.ts => preheatingService.ts} | 0 .../wwwroot/src/services/prodService.ts | 5 +- 15 files changed, 136 insertions(+), 68 deletions(-) rename Thermo.Active/wwwroot/src/services/{PreHeatingService.ts => preheatingService.ts} (100%) diff --git a/Thermo.Active/wwwroot/assets/styles/base/dashboard-gauge.less b/Thermo.Active/wwwroot/assets/styles/base/dashboard-gauge.less index aca8a070..55106dd3 100644 --- a/Thermo.Active/wwwroot/assets/styles/base/dashboard-gauge.less +++ b/Thermo.Active/wwwroot/assets/styles/base/dashboard-gauge.less @@ -67,6 +67,10 @@ stroke-width: 2.5; } + .errors { + stroke: #d0021b; + } + .value-text { fill: black; font-size: 20px; diff --git a/Thermo.Active/wwwroot/assets/styles/base/dashboard.less b/Thermo.Active/wwwroot/assets/styles/base/dashboard.less index 5decc7a4..44bc93be 100644 --- a/Thermo.Active/wwwroot/assets/styles/base/dashboard.less +++ b/Thermo.Active/wwwroot/assets/styles/base/dashboard.less @@ -434,6 +434,11 @@ text-align: right; font-size: 54px; font-weight: 500; + + &.red { + color: #d0021b; + } + } .col { diff --git a/Thermo.Active/wwwroot/assets/styles/style.css b/Thermo.Active/wwwroot/assets/styles/style.css index 3568e5ae..f7a2981b 100644 --- a/Thermo.Active/wwwroot/assets/styles/style.css +++ b/Thermo.Active/wwwroot/assets/styles/style.css @@ -4202,6 +4202,10 @@ article .box .body { stroke: #90C03D; stroke-width: 2.5; } +.gauge-container .gauge1 .gauge .errors, +.gauge-container .gauge2 .gauge .errors { + stroke: #d0021b; +} .gauge-container .gauge1 .gauge .value-text, .gauge-container .gauge2 .gauge .value-text { fill: black; @@ -4569,6 +4573,9 @@ article .box .body { font-size: 54px; font-weight: 500; } +.history-item label.red { + color: #d0021b; +} .history-item .col { display: flex; flex-flow: column; diff --git a/Thermo.Active/wwwroot/config.development.json b/Thermo.Active/wwwroot/config.development.json index f8091c43..58460cb5 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": false } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/index.html b/Thermo.Active/wwwroot/index.html index 06c2fb9c..f52c1422 100644 --- a/Thermo.Active/wwwroot/index.html +++ b/Thermo.Active/wwwroot/index.html @@ -13,7 +13,7 @@ - + diff --git a/Thermo.Active/wwwroot/src/@types/prod.cs.d.ts b/Thermo.Active/wwwroot/src/@types/prod.cs.d.ts index 6021837e..cab97f71 100644 --- a/Thermo.Active/wwwroot/src/@types/prod.cs.d.ts +++ b/Thermo.Active/wwwroot/src/@types/prod.cs.d.ts @@ -13,6 +13,7 @@ declare module Prod { moldTemp: number; vacuumReadVal: number; mouldEnergyOUT: number;// Generated by https://quicktype.io + isScrap: boolean; } interface IProdPanel { diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts index 1b78741f..40ce04d7 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts @@ -2,7 +2,7 @@ import Vue from "vue"; import Component from "vue-class-component"; import Gauge from "svg-gauge"; import { store } from "@/store"; -import { Watch } from "vue-property-decorator"; +import { Prop, Watch } from "vue-property-decorator"; @Component({}) export default class MainGauge extends Vue { @@ -10,18 +10,10 @@ export default class MainGauge extends Vue { gauge1: any = null; gauge2: any = null; - mounted() { - this.gauge1 = Gauge( - this.$refs.gauge1, { - max: 100, - dialStartAngle: -90, - dialEndAngle: -90.001, - value: 0, - showValue: false, - viewBox: [8, 8, 84, 84] - } - ); + @Prop({ default: [] }) + scrapedItems: number[]; + mounted() { this.gauge2 = Gauge( this.$refs.gauge2, { max: 100, @@ -34,7 +26,6 @@ export default class MainGauge extends Vue { ); this.gaugeDataChanged(this.gaugeData, null); - this.gaugeChanged(); } get gaugeData() { @@ -44,17 +35,32 @@ export default class MainGauge extends Vue { @Watch('gaugeData') gaugeDataChanged(n, o) { - if (this.gauge2) { + if (this.gauge2 && n.timeAdv.maxVal - n.timeAdv.minVal > 0) { this.gauge2.setValueAnimated((n.timeAdv.value - n.timeAdv.minVal) * 100 / (n.timeAdv.maxVal - n.timeAdv.minVal), 1) }; } get prod() { return store.state.prod.panel } - @Watch('prod.numDone') - @Watch('prod.numTarget') - gaugeChanged() { - this.gauge1.setValueAnimated((this.prod.numDone / this.prod.numTarget) * 100, 1); + + polarToCartesian(centerX, centerY, radius, angleInDegrees) { + var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; + + return { + x: centerX + (radius * Math.cos(angleInRadians)), + y: centerY + (radius * Math.sin(angleInRadians)) + }; + } + + describeArc(x, y, radius, startAngle, endAngle) { + var start = this.polarToCartesian(x, y, radius, endAngle); + var end = this.polarToCartesian(x, y, radius, startAngle); + var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1"; + var d = [ + "M", start.x, start.y, + "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y + ].join(" "); + return d; } } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.vue index a0b03f4d..1fc156b4 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.vue @@ -1,6 +1,34 @@ \ No newline at end of file From 51e682c166793afb966bde7f64b2d74a3a853c00 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 5 Oct 2020 14:45:43 +0200 Subject: [PATCH 06/10] fix setpointhmi invalid --- Thermo.Active/wwwroot/src/services/hub.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Thermo.Active/wwwroot/src/services/hub.ts b/Thermo.Active/wwwroot/src/services/hub.ts index 90d1cf15..6e3a0b07 100644 --- a/Thermo.Active/wwwroot/src/services/hub.ts +++ b/Thermo.Active/wwwroot/src/services/hub.ts @@ -25,6 +25,7 @@ import { recipeActions } from "@/store/recipe.store"; import { prodActions } from "@/store/prod.store"; import { Model } from "vue-property-decorator"; import { prodService } from "./prodService"; +import { recipeService } from "./recipeService"; declare const PRODUCTION; @@ -106,7 +107,7 @@ export class Hub { // qui i NUOVI metodi NUOVI dal server (Recipe, gauges) da completare lato HUB this._hub.client.recipeFullData = Hub.recipeFullData; - this._hub.client.setpointHmiInvalid = Hub.setpointHmiInvalid; + this._hub.client.setpointHmiInvalid = Hub.setpointHmiInvalid; this._hub.client.recipeOverData = Hub.recipeOverData; this._hub.client.recipeChangedData = Hub.recipeChangedData; this._hub.client.prodInfoData = Hub.prodData; @@ -180,11 +181,13 @@ export class Hub { recipeActions.setCurrent(store, data, true); } - public static setpointHmiInvalid(data) { - console.log("setpointHmiInvalid"); + public static async setpointHmiInvalid(data) { + if (data) { + await recipeService.GetCurrent(); + // await recipeService.GetOverview(); + } } - public static recipeOverData(data) { recipeActions.setOverview(store, data); } From 6c834482a4e1211e1c9bb7334e34c5668f4530c2 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 5 Oct 2020 15:02:34 +0200 Subject: [PATCH 07/10] fix gauge & dashboard --- .../app_modules_thermo/dashboard/base-components/gauge.ts | 8 ++++++++ .../wwwroot/src/app_modules_thermo/dashboard/dashboard.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts index 40ce04d7..7d6b66b8 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/gauge.ts @@ -40,6 +40,14 @@ export default class MainGauge extends Vue { }; } + @Watch('gaugeData.timeAdv', { deep: true }) + gaugeDataTimeChanged(n, o) { + + if (this.gauge2 && n.maxVal - n.minVal > 0) { + this.gauge2.setValueAnimated((n.value - n.minVal) * 100 / (n.maxVal - n.minVal), .4) + }; + } + get prod() { return store.state.prod.panel } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts index 93a64f4b..ba2cece8 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts @@ -106,7 +106,7 @@ export default class Dashboard extends Vue { let min = Math.min(this.lastItem.numDone, ... this.items.map(i => i.numDone)); - let result = await prodService.History(min - 1) + let result = await prodService.History(min - 1, min - 1) for (const i of result) { this.itemsMap.set(i.numDone, i); } From cb16049c72f82be952413ea3088a5f3e52a805f5 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 5 Oct 2020 15:05:40 +0200 Subject: [PATCH 08/10] typo, start vers 1 --- Thermo.Active/Controllers/WebApi/RecipeController.cs | 1 - Thermo.Active/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Thermo.Active/Controllers/WebApi/RecipeController.cs b/Thermo.Active/Controllers/WebApi/RecipeController.cs index 1d72a2b6..b2c05ccd 100644 --- a/Thermo.Active/Controllers/WebApi/RecipeController.cs +++ b/Thermo.Active/Controllers/WebApi/RecipeController.cs @@ -296,7 +296,6 @@ namespace Thermo.Active.Controllers.WebApi [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)] public IHttpActionResult Load(string newName) { - // chiamo metodo di lettura... var dataRead = NcFileAdapter.LoadRecipe(newName); if (dataRead == null) diff --git a/Thermo.Active/Properties/AssemblyInfo.cs b/Thermo.Active/Properties/AssemblyInfo.cs index 61226fd7..d9bfad73 100644 --- a/Thermo.Active/Properties/AssemblyInfo.cs +++ b/Thermo.Active/Properties/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.21.106")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.107")] \ No newline at end of file From f0ee892ce5b81f5a00f855c873e197655fd62233 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 5 Oct 2020 15:08:32 +0200 Subject: [PATCH 09/10] typo --- Thermo.Active/Controllers/WebApi/RecipeController.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Thermo.Active/Controllers/WebApi/RecipeController.cs b/Thermo.Active/Controllers/WebApi/RecipeController.cs index b2c05ccd..41f05e73 100644 --- a/Thermo.Active/Controllers/WebApi/RecipeController.cs +++ b/Thermo.Active/Controllers/WebApi/RecipeController.cs @@ -309,8 +309,6 @@ namespace Thermo.Active.Controllers.WebApi // update current live data! NcFileAdapter.SaveRecipeCurrent(); - - CmsError libraryError = WriteCurrentRecipeToPlc(); if (libraryError.IsError()) { From 8769127f91ab0dd988ff524525bbf1a91cf87578 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 5 Oct 2020 15:10:36 +0200 Subject: [PATCH 10/10] set vers 0.99 --- Thermo.Active/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Thermo.Active/Properties/AssemblyInfo.cs b/Thermo.Active/Properties/AssemblyInfo.cs index d9bfad73..3099a5ef 100644 --- a/Thermo.Active/Properties/AssemblyInfo.cs +++ b/Thermo.Active/Properties/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.107")] \ No newline at end of file +[assembly: AssemblyVersion("0.99.107")] \ No newline at end of file