From 6af1d7e5620a2d6db2fae50fca8dc4ccd15ab154 Mon Sep 17 00:00:00 2001 From: Nicola Carminati Date: Thu, 31 May 2018 12:41:19 +0200 Subject: [PATCH 1/2] Tools Image Fix - Depot --- Step/wwwroot/src/components/depot.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Step/wwwroot/src/components/depot.vue b/Step/wwwroot/src/components/depot.vue index 07af9e30..fe9cc6d7 100644 --- a/Step/wwwroot/src/components/depot.vue +++ b/Step/wwwroot/src/components/depot.vue @@ -21,8 +21,8 @@ - - + +
@@ -39,6 +39,7 @@ From b9c316e8d06e5cd023643db57832fdc1914b9397 Mon Sep 17 00:00:00 2001 From: Nicola Carminati Date: Thu, 31 May 2018 12:57:38 +0200 Subject: [PATCH 2/2] Fix Shanks behaviour --- Step.Utils/languages/IT.xml | 1 + Step.Utils/languages/en.xml | 3 +- Step/wwwroot/src/components/tooling-shanks.ts | 67 ++++++++++++++++--- .../wwwroot/src/components/tooling-shanks.vue | 8 ++- 4 files changed, 66 insertions(+), 13 deletions(-) diff --git a/Step.Utils/languages/IT.xml b/Step.Utils/languages/IT.xml index fc5c1e33..7be24cce 100644 --- a/Step.Utils/languages/IT.xml +++ b/Step.Utils/languages/IT.xml @@ -224,6 +224,7 @@ Positione Tipo Disabilitata + Posizione Nome diff --git a/Step.Utils/languages/en.xml b/Step.Utils/languages/en.xml index dba018a9..bcf3ee5d 100644 --- a/Step.Utils/languages/en.xml +++ b/Step.Utils/languages/en.xml @@ -203,7 +203,7 @@ Name Child Id Multitool Id - Tool Enambled + Tool Enabled Tool Active Tool Inhibited Tool In Fixed Place @@ -223,6 +223,7 @@ Position Id Position Type Disabled + Position Name diff --git a/Step/wwwroot/src/components/tooling-shanks.ts b/Step/wwwroot/src/components/tooling-shanks.ts index fd04dd69..d5cd3efd 100644 --- a/Step/wwwroot/src/components/tooling-shanks.ts +++ b/Step/wwwroot/src/components/tooling-shanks.ts @@ -54,6 +54,7 @@ export default class toolingShanks extends Vue { public selectedEquipment: any = null; public toolSelected: any = null; + public posSelected: any = null; public enableModify: any = false; @@ -92,6 +93,26 @@ export default class toolingShanks extends Vue { this.disableList = true; } + public availablePosition(pos) { + return !this.selectedTool.childsTools.find( + function (obj){ + return obj.multitoolId==pos + } + ); + } + + public getFirstAvailablePosition(){ + if(!this.selectedTool) + return 0; + var i; + for (i = 1; i < (this.maxToolsPerMultitools+1); i++) { + if(this.availablePosition(i)) + return i; + } + return 0; + + } + public addShank() { this.selectedTool = {}; @@ -178,6 +199,7 @@ export default class toolingShanks extends Vue { // this.enableAddToolToShank = true; this.selectTab(obj); this.toolSelected = response.tools[0]; + this.posSelected = this.getFirstAvailablePosition(); }); // this.disableList = true; // this.enableModify = true; @@ -227,6 +249,14 @@ export default class toolingShanks extends Vue { this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration; this.disableList = false; + + if(this.shanks.length < this.maxMultitools){ + this.enableAddShank = false; + } + else{ + this.enableAddShank = true; + } + }); } @@ -241,14 +271,7 @@ export default class toolingShanks extends Vue { public addToolsToShank(shank) { let model = this.toolSelected; - for (let l in this.selectedTool.childsTools) { - if (this.selectedTool.childsTools[l].multitoolId) { - model.multitoolId = this.selectedTool.childsTools[l].multitoolId + 1; - } - if (this.selectedTool.childsTools[l].id < 0) { - model.multitoolId = 1; - } - } + model.multitoolId = this.posSelected; new ToolingService().addToolToShank(shank, model).then(response => { this.selectTab(response); for (let l in this.selectedTool.childsTools) { @@ -256,6 +279,12 @@ export default class toolingShanks extends Vue { this.selectedTool.childsTools.splice(l, 1); } } + if(this.selectedTool.childsTools.length < this.maxToolsPerMultitools){ + this.enableAddChildsTools = false; + } + else{ + this.enableAddChildsTools = true; + } this.disableList = false; }) // new ToolingService().SetEdgeData(tool,model).then(response => { @@ -276,6 +305,18 @@ export default class toolingShanks extends Vue { this.enableModify = false; this.enableEquipment = false; this.selectedEquipment = null; + for (let l in this.selectedTool.childsTools) { + if (this.selectedTool.childsTools[l].id <= 0) { + this.selectedTool.childsTools.splice(l, 1); + } + } + if(this.selectedTool.childsTools.length < this.maxToolsPerMultitools){ + this.enableAddChildsTools = false; + } + else{ + this.enableAddChildsTools = true; + } + }) }, null); // new ToolingService().SetEdgeData(tool,model).then(response => { @@ -290,7 +331,15 @@ export default class toolingShanks extends Vue { ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_delete", "Richiesta di conferma"), this.$options.filters.localize("modal_confirm_delete_shank", "Confermi la cancellazione del codolo?"), () => { - new ToolingService().DeleteShank(model).then(response => { + new ToolingService().DeleteShank(model).then(response => { + + + if(this.shanks.length < this.maxMultitools){ + this.enableAddShank = false; + } + else{ + this.enableAddShank = true; + } this.selectedEquipment = null; this.enableEquipment = false; this.enableParameters = true; diff --git a/Step/wwwroot/src/components/tooling-shanks.vue b/Step/wwwroot/src/components/tooling-shanks.vue index 4239562a..31686e73 100644 --- a/Step/wwwroot/src/components/tooling-shanks.vue +++ b/Step/wwwroot/src/components/tooling-shanks.vue @@ -39,7 +39,7 @@
@@ -76,9 +76,11 @@
- + + + - +