diff --git a/Thermo.Active/Controllers/WebApi/RecipeController.cs b/Thermo.Active/Controllers/WebApi/RecipeController.cs index 1d72a2b6..41f05e73 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) @@ -310,8 +309,6 @@ namespace Thermo.Active.Controllers.WebApi // update current live data! NcFileAdapter.SaveRecipeCurrent(); - - CmsError libraryError = WriteCurrentRecipeToPlc(); if (libraryError.IsError()) { diff --git a/Thermo.Active/Properties/AssemblyInfo.cs b/Thermo.Active/Properties/AssemblyInfo.cs index 61226fd7..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("0.21.106")] \ No newline at end of file +[assembly: AssemblyVersion("0.99.107")] \ No newline at end of file diff --git a/Thermo.Active/wwwroot/assets/icons/svg/slide-stampo.svg b/Thermo.Active/wwwroot/assets/icons/svg/slide-stampo.svg index c9dbbf37..04a6f6a5 100644 --- a/Thermo.Active/wwwroot/assets/icons/svg/slide-stampo.svg +++ b/Thermo.Active/wwwroot/assets/icons/svg/slide-stampo.svg @@ -1,10 +1,36 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 1882cc84..44bc93be 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; @@ -423,6 +434,11 @@ text-align: right; font-size: 54px; font-weight: 500; + + &.red { + color: #d0021b; + } + } .col { @@ -456,12 +472,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 026682ff..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; @@ -4493,6 +4497,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 +4512,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; @@ -4564,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/assets/svg/disegno-stampo.svg b/Thermo.Active/wwwroot/assets/svg/disegno-stampo.svg index 8bf8b2b6..ed8584af 100644 --- a/Thermo.Active/wwwroot/assets/svg/disegno-stampo.svg +++ b/Thermo.Active/wwwroot/assets/svg/disegno-stampo.svg @@ -7,52 +7,26 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="718.82501" - height="480" - viewBox="0 0 718.82501 480" + width="575" + height="468" + viewBox="0 0 575 468" version="1.1" - id="svg851" + id="svg1888" sodipodi:docname="disegno-stampo.svg" - inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> + id="metadata1894"> image/svg+xml - - - - + id="defs1892" /> + inkscape:current-layer="svg1888" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + fill="none" + fill-rule="evenodd" + id="g1886"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..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 @@ -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,40 @@ 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) }; } + @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 } - @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 diff --git a/Thermo.Active/wwwroot/src/services/hub.ts b/Thermo.Active/wwwroot/src/services/hub.ts index 602a5f3a..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); } @@ -194,7 +197,6 @@ export class Hub { } public static prodData(data) { - console.log('prodInfoData', data); prodActions.setProd(store, data); } diff --git a/Thermo.Active/wwwroot/src/services/PreHeatingService.ts b/Thermo.Active/wwwroot/src/services/preheatingService.ts similarity index 100% rename from Thermo.Active/wwwroot/src/services/PreHeatingService.ts rename to Thermo.Active/wwwroot/src/services/preheatingService.ts diff --git a/Thermo.Active/wwwroot/src/services/prodService.ts b/Thermo.Active/wwwroot/src/services/prodService.ts index 5fb6c316..1e4a43eb 100644 --- a/Thermo.Active/wwwroot/src/services/prodService.ts +++ b/Thermo.Active/wwwroot/src/services/prodService.ts @@ -24,7 +24,6 @@ export class ProdService extends baseRestService { return result; } - async Manual() { await this.Put((await this.BASE_URL()) + "mode/manual", null); } @@ -36,5 +35,9 @@ export class ProdService extends baseRestService { async Start(qty: number, newWorkOrder: boolean, riscqty: number) { await this.Put((await this.BASE_URL()) + `startFull?requestQty=${qty}&newWorkOrder=${newWorkOrder}&numCicliRisc=${riscqty}`, null); } + + async SetScrap(num: number, scrap: boolean = true) { + await this.Put((await this.BASE_URL()) + `setScrap?num=${num}&isScrap=${scrap}`, null); + } } export const prodService = new ProdService(); \ No newline at end of file