diff --git a/Step/wwwroot/src/components/tooling/tooling-depot.ts b/Step/wwwroot/src/components/tooling/tooling-depot.ts index 5918f91b..11770b0f 100644 --- a/Step/wwwroot/src/components/tooling/tooling-depot.ts +++ b/Step/wwwroot/src/components/tooling/tooling-depot.ts @@ -53,6 +53,12 @@ export default class depot extends Vue { return this.getAvaiableTools[index - this.getAvaiableMultiTools.length]; } + public getPayloadForNcAvailableShank(index: number): any{ + if (index < this.getNcAvailableShank.length){ + return this.getNcAvailableShank[index]; + } + } + public onDrag({ isSource, payload, willAcceptDrop }) { this.draggingIn = true; this.draggingTool = payload; @@ -288,13 +294,28 @@ export default class depot extends Vue { alert("sadasdsa"); } - public toolIsInError(tool) { + public toolIsInWarning(tool){ if (tool) return (this.$store.getters as ToolingGetters).toolIsInWarning(tool.id); else return null; } + public ncShankgIsInWarning(shank){ + return (this.$store.getters as ToolingGetters).ncShankIsInWarning(shank.id); + } + + public toolIsInError(model) { + if(model){ + if(this.typeNc == "Demo"){ + this.toolIsInWarning(model) + } + else{ + this.ncShankgIsInWarning(model); + } + } + } + public returnChild(elem) { if (!elem) return null; @@ -466,11 +487,11 @@ export default class depot extends Vue { if (this.draggingTool && this.draggingPosition == position.positionId) { if (this.ncToolAtPosition(position.positionId) || position.disabled || !this.checkMagPosType(position.type)) return - this.draggingIn = false; this.draggingTool = null; - var toolToAdd = event.payload; - new DepotService().AddToolToDepotNc(this.depotId, position.positionId, { toolId: toolToAdd.id }).then(response => { + var shankToAdd = event.payload; + + new DepotService().AddToolToDepotNc(this.depotId, position.positionId, { shankId: shankToAdd.id }).then(response => { }); } @@ -487,7 +508,11 @@ export default class depot extends Vue { // new DepotService().AddToolToDepotNc(this.depotId, position.positionId, { toolId: toolToAdd.id }).then(response => { // }); - public removeToolsToDepot(position, toolToAdd) { + public removeToolsToDepot(position, model) { + debugger + if(model.shankId){ + model.id = model.shankId; + } if (this.editable){ if(this.typeNc == "Demo"){ new DepotService().RemoveToolToDepot(this.depotId, position).then(response => { @@ -495,7 +520,7 @@ export default class depot extends Vue { }); } else{ - new DepotService().RemoveToolToDepotNc(this.depotId, position).then(response => { + new DepotService().RemoveToolToDepotNc(this.depotId, position, {shankId: model.id}).then(response => { }); } diff --git a/Step/wwwroot/src/components/tooling/tooling-depot.vue b/Step/wwwroot/src/components/tooling/tooling-depot.vue index 88a91789..98480c16 100644 --- a/Step/wwwroot/src/components/tooling/tooling-depot.vue +++ b/Step/wwwroot/src/components/tooling/tooling-depot.vue @@ -123,7 +123,7 @@