From 393da8156b6ebd3a68b4bf5d6c7ce111d3ec34fc Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 9 Sep 2020 09:58:31 +0200 Subject: [PATCH 1/7] Aggiunto metodo x fornire note ad UI --- Thermo.Active/Controllers/WebApi/RecipeController.cs | 5 +++++ Thermo.Active/wwwroot/config.development.json | 2 +- Thermo.Active/wwwroot/index.html | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Thermo.Active/Controllers/WebApi/RecipeController.cs b/Thermo.Active/Controllers/WebApi/RecipeController.cs index 0aebb19b..3a9fcf0e 100644 --- a/Thermo.Active/Controllers/WebApi/RecipeController.cs +++ b/Thermo.Active/Controllers/WebApi/RecipeController.cs @@ -70,6 +70,11 @@ namespace Thermo.Active.Controllers.WebApi return Ok(currRecipe); } + [Route("recipeNotes"), HttpGet] + public IHttpActionResult GetRecipeNotes() + { + return Ok(NcFileAdapter.RecipeLiveData.recipeNotes); + } [Route("update"), HttpPut] [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)] diff --git a/Thermo.Active/wwwroot/config.development.json b/Thermo.Active/wwwroot/config.development.json index 58ce0f2f..8c7723c2 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://seriate.steamware.net:9000/" + "apiServerUrl": "http://localhost:9000/" }, "allUIVisible": true } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/index.html b/Thermo.Active/wwwroot/index.html index f52c1422..06c2fb9c 100644 --- a/Thermo.Active/wwwroot/index.html +++ b/Thermo.Active/wwwroot/index.html @@ -13,7 +13,7 @@ - + From bb7ef476ed90b17dd65c1769b529ad0b891caae2 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 9 Sep 2020 09:58:42 +0200 Subject: [PATCH 2/7] new rel --- 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 ca601503..b4e385bc 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.13.74")] \ No newline at end of file +[assembly: AssemblyVersion("0.13.75")] \ No newline at end of file From d511b49c64bf505caf1e2f49eb8f67ebd8e286e4 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 9 Sep 2020 12:15:54 +0200 Subject: [PATCH 3/7] enabled fields visibility --- Thermo.Active/wwwroot/assets/styles/base/modals.less | 2 +- Thermo.Active/wwwroot/assets/styles/style.css | 2 +- .../src/modules/base-components/modal-load-program.vue | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Thermo.Active/wwwroot/assets/styles/base/modals.less b/Thermo.Active/wwwroot/assets/styles/base/modals.less index 713b3c85..5f628a9f 100644 --- a/Thermo.Active/wwwroot/assets/styles/base/modals.less +++ b/Thermo.Active/wwwroot/assets/styles/base/modals.less @@ -2378,7 +2378,7 @@ line-height: 4px; .title { - width: 110px; + min-width: 110px; text-align: right; color: @color-darkish-blue; } diff --git a/Thermo.Active/wwwroot/assets/styles/style.css b/Thermo.Active/wwwroot/assets/styles/style.css index 6db29f6e..85182c1a 100644 --- a/Thermo.Active/wwwroot/assets/styles/style.css +++ b/Thermo.Active/wwwroot/assets/styles/style.css @@ -2523,7 +2523,7 @@ article .box .body { .modal.modal-add-element-queue .modal-load-program-body .selected-item .selected-item-header .subtitle .title, .modal.modal-load-program .modal-add-element-queue-body .selected-item .selected-item-header .subtitle .title, .modal.modal-add-element-queue .modal-add-element-queue-body .selected-item .selected-item-header .subtitle .title { - width: 110px; + min-width: 110px; text-align: right; color: #002680; } diff --git a/Thermo.Active/wwwroot/src/modules/base-components/modal-load-program.vue b/Thermo.Active/wwwroot/src/modules/base-components/modal-load-program.vue index 37c9cdae..60a1821c 100644 --- a/Thermo.Active/wwwroot/src/modules/base-components/modal-load-program.vue +++ b/Thermo.Active/wwwroot/src/modules/base-components/modal-load-program.vue @@ -121,14 +121,14 @@ -
+
From 682efe19281835d4fbc8626007969f7363168b6e Mon Sep 17 00:00:00 2001 From: = Date: Wed, 9 Sep 2020 12:16:04 +0200 Subject: [PATCH 4/7] enabled fields visibility --- Thermo.Active/wwwroot/config.development.json | 2 +- .../wwwroot/src/app_modules_thermo/dashboard/dashboard.ts | 5 +---- .../setup/ciclo/components/show-ciclo-info.ts | 2 +- .../controstampo_setup/components/show-controstampo-info.ts | 2 +- .../setup/estrazione/components/show-estrazione-info.ts | 2 +- .../setup/pirometro/components/show-pirometro-info.ts | 2 +- .../quote-velocita/components/show-quote-velocita-info.ts | 2 +- .../raffreddamento/components/show-raffreddamento-info.ts | 2 +- .../setup/riscaldi/components/show-riscaldi-info.ts | 2 +- .../src/app_modules_thermo/setup/vuoto/show-vuoto-info.ts | 2 +- 10 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Thermo.Active/wwwroot/config.development.json b/Thermo.Active/wwwroot/config.development.json index 58ce0f2f..58460cb5 100644 --- a/Thermo.Active/wwwroot/config.development.json +++ b/Thermo.Active/wwwroot/config.development.json @@ -4,5 +4,5 @@ "enabled": true, "apiServerUrl": "http://seriate.steamware.net:9000/" }, - "allUIVisible": true + "allUIVisible": false } \ No newline at end of file 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 d03c9847..8c6cbc48 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts @@ -26,7 +26,6 @@ import { Hub } from '@/services'; }) export default class Dashboard extends Vue { - get panel() { return (this.$store.state as AppModel).prod.panel; } @@ -66,7 +65,6 @@ export default class Dashboard extends Vue { return (this.$store.state as AppModel).machineInfo.cmsConnectReady; } - loading = false; async loadMore() { if (this.loading) return; @@ -81,11 +79,11 @@ export default class Dashboard extends Vue { getColor(nome, cognome) { return getColorFromName(nome, cognome); } + isDarkColor(color) { return isDarkColor(color); } - async mounted() { prodService.GetProdPanel(); @@ -157,7 +155,6 @@ export default class Dashboard extends Vue { close() { appModelActions.ShowDashboard(this.$store); }; - } enum ribbonStatusEnum { diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/ciclo/components/show-ciclo-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/ciclo/components/show-ciclo-info.ts index 9337f185..48132fab 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/ciclo/components/show-ciclo-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/ciclo/components/show-ciclo-info.ts @@ -89,7 +89,7 @@ export default class ShowCicloInfo extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/controstampo_setup/components/show-controstampo-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/controstampo_setup/components/show-controstampo-info.ts index b6700266..d2f1bde7 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/controstampo_setup/components/show-controstampo-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/controstampo_setup/components/show-controstampo-info.ts @@ -104,7 +104,7 @@ export default class ShowControstampoInfo extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/estrazione/components/show-estrazione-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/estrazione/components/show-estrazione-info.ts index 049bedd8..236b0e2c 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/estrazione/components/show-estrazione-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/estrazione/components/show-estrazione-info.ts @@ -84,7 +84,7 @@ export default class ShowEstrazioneInfo extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/pirometro/components/show-pirometro-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/pirometro/components/show-pirometro-info.ts index 3e08b0ee..48c4df40 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/pirometro/components/show-pirometro-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/pirometro/components/show-pirometro-info.ts @@ -85,7 +85,7 @@ export default class ShowPirometroInfo extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/quote-velocita/components/show-quote-velocita-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/quote-velocita/components/show-quote-velocita-info.ts index 849c9c8b..60a604b0 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/quote-velocita/components/show-quote-velocita-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/quote-velocita/components/show-quote-velocita-info.ts @@ -98,7 +98,7 @@ export default class ShowQuoteVelocitaInfo extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/raffreddamento/components/show-raffreddamento-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/raffreddamento/components/show-raffreddamento-info.ts index eb49353e..54aac689 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/raffreddamento/components/show-raffreddamento-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/raffreddamento/components/show-raffreddamento-info.ts @@ -109,7 +109,7 @@ export default class Raffreddamento extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts index fa0edca0..03d513bf 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts @@ -82,7 +82,7 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/vuoto/show-vuoto-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/vuoto/show-vuoto-info.ts index 0dadefd2..4586bd15 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/vuoto/show-vuoto-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/vuoto/show-vuoto-info.ts @@ -110,7 +110,7 @@ export default class ShowVuotoInfo extends Vue { hasEnabledFields(...fields: string[]) { let result = false; for (const field of fields) { - if ((this.recipe[field] as Recipe.IValue).status.enabled) result = true; + if ((this.recipe[field] as Recipe.IValue).status.visible) result = true; } return result; } From 7481d3bf28ced961a515446ced44fc6a8277820b Mon Sep 17 00:00:00 2001 From: = Date: Wed, 9 Sep 2020 16:43:48 +0200 Subject: [PATCH 5/7] print ricetta --- Thermo.Active/wwwroot/src/App.ts | 2 ++ Thermo.Active/wwwroot/src/App.vue | 1 + .../components/gantt/gantt-component.vue | 7 ++++-- .../processo/components/gantt/gantt-row.ts | 8 +++++++ .../processo/components/gantt/gantt.ts | 20 ++++++++++++---- .../processo/components/gantt/gantt.vue | 2 +- .../processo/components/printProcesso.ts | 23 +++++++++++++++++++ .../processo/components/printProcesso.vue | 6 +++++ .../processo/components/processo.vue | 1 - .../wwwroot/src/modules/app-header.ts | 1 + .../wwwroot/src/services/recipeService.ts | 12 ++++++++++ 11 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts create mode 100644 Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.vue diff --git a/Thermo.Active/wwwroot/src/App.ts b/Thermo.Active/wwwroot/src/App.ts index 30388c39..400b08c2 100644 --- a/Thermo.Active/wwwroot/src/App.ts +++ b/Thermo.Active/wwwroot/src/App.ts @@ -20,6 +20,7 @@ import Component from "vue-class-component"; import { Watch } from "vue-property-decorator"; import { UsersService } from "./services/usersService"; import { KeyboardHelper } from "./app_modules_thermo/components/KeyboardHelper"; +import printGantt from "@/app_modules_thermo/processo/components/printProcesso.vue"; declare var cmsClient; @@ -37,6 +38,7 @@ declare var cmsClient; dashboard: Dashboard, predashboard: PreDashboard, alarmList, + printGantt } }) export default class app extends Vue { diff --git a/Thermo.Active/wwwroot/src/App.vue b/Thermo.Active/wwwroot/src/App.vue index 4e28f4e5..a7c89d2a 100644 --- a/Thermo.Active/wwwroot/src/App.vue +++ b/Thermo.Active/wwwroot/src/App.vue @@ -18,6 +18,7 @@ +
diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt-component.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt-component.vue index d26517b6..30efe406 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt-component.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt-component.vue @@ -149,7 +149,7 @@ - + - + i.section == this.section).sort((a, b) => a.priority - b.priority); } + get maxVerticalPosition() { + return Math.max(...this.blocks.map(b => this.verticalPosition(b))) + } + + get maxBlockPosition() { + return Math.max(...this.blocks.map(b => this.startPosition(b))) + } + startPosition(block: server.Modblock) { return blockStartPosition(block, this.blocks, this.ganttOptions) * this.ganttOptions.secondSize; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts index b89a6f7d..fa412607 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts @@ -4,10 +4,12 @@ import moment from "moment"; import ganttHeader from "./gantt-header.vue"; import ganttRow from "./gantt-row.vue" import timeLine from "./timeline.vue"; +import { recipeService } from "@/services/recipeService"; +import { store, AppModel } from "@/store"; var ContainerElements = ["svg", "g", "foreignobject"]; var RelevantStyles = { - "rect": ["fill", "stroke", "stroke-width"], + "rect": ["fill", "stroke", "stroke-width", "rx", "ry"], "path": ["fill", "stroke", "stroke-width"], "circle": ["fill", "stroke", "stroke-width"], "line": ["stroke", "stroke-width"], @@ -34,6 +36,16 @@ export default class Gantt extends Vue { padX: number = 0; padY: number = 0; + get panel() { + return (this.$store.state as AppModel).prod.panel; + } + + + get ganttHeight() { + return (this.$refs.section1 as any).rowHeight + + (this.$refs.section2 as any).rowHeight + + (this.$refs.section3 as any).rowHeight; + } public print() { this.ganttOptions.printing = true; @@ -48,10 +60,10 @@ export default class Gantt extends Vue { var DOMURL = (window.URL || window.webkitURL); var svgBlob = new Blob([data], { type: 'image/svg+xml;charset=utf-8' }); - var url = DOMURL.createObjectURL(svgBlob); - + // var url = DOMURL.createObjectURL(svgBlob); + recipeService.UploadImage(svgBlob, this.panel.nomeRicetta.replace('.rcp', '') + ".svg"); this.ganttOptions.printing = false; - window.open(url, '_blank') + // window.open(url, '_blank') }); } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.vue index e9bf5b37..fddec304 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.vue @@ -4,7 +4,7 @@ ref="mainContainer" preserveAspectRation="xMinYMax" width="100%" - height="100%" + :height="ganttOptions.printing ? `${ganttHeight}px` : '100%'" @mousemove.capture="doPan" v-on:touchmove="doPan" @mousedown="startPan" diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts new file mode 100644 index 00000000..384c12a9 --- /dev/null +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts @@ -0,0 +1,23 @@ +import Vue from "vue"; +import Component from "vue-class-component"; +import gantt from "./gantt/gantt.vue"; +import { store } from "@/store"; +import { messageService } from "@/_base"; + +@Component({ + components: { + gantt + } +}) +export default class PrintProcesso extends Vue { + + get blocks(): server.Modblock[] { + return store.state.modules.blocks; + } + + mounted() { + messageService.subscribeToChannel("print", () => { + (this.$refs.gantt as any).print(); + }) + } +} \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.vue new file mode 100644 index 00000000..83da3692 --- /dev/null +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.vue @@ -0,0 +1,6 @@ + +