diff --git a/Step.Core/ThreadsFunctions.cs b/Step.Core/ThreadsFunctions.cs index 79e40d05..5706e659 100644 --- a/Step.Core/ThreadsFunctions.cs +++ b/Step.Core/ThreadsFunctions.cs @@ -703,14 +703,14 @@ public static class ThreadsFunctions // Try connection CmsError libraryError = ncHandler.Connect(); if (libraryError.errorCode != 0) - ManageLibraryError(libraryError); + ManageLibraryError(libraryError); while (true) { sw.Restart(); // Check if client is connected - if (ncHandler.numericalControl.NC_IsConnected()) + if (ncHandler.numericalControl.NC_IsConnected()) { // Read data libraryError = ncHandler.UpdateQueue(); @@ -877,7 +877,7 @@ public static class ThreadsFunctions if (m154.Parameters[0] == "MTC") { // Convert tag string in Pascal Case and add to result string - switch (m154.Parameters[1].ToLower()) + switch (m154.Parameters[1].ToLower()) { case "currprog": stringVal += "CurrProg"; @@ -902,7 +902,7 @@ public static class ThreadsFunctions string outputFileName = ServerStartupConfig.MTCFolderPath + "\\DATA\\CmsGeneralStatus.mtc"; // Create file if not exits if (!File.Exists(outputFileName)) - using (var f = File.Create(outputFileName)) { }; + using (var f = File.Create(outputFileName)) { }; // Read file List fileLines = File.ReadAllLines(outputFileName).ToList(); string[] parametersInLine; @@ -931,7 +931,6 @@ public static class ThreadsFunctions } } } - } else RestoreConnection(); diff --git a/Step/Controllers/WebApi/NcFileController.cs b/Step/Controllers/WebApi/NcFileController.cs index 6ef00d9c..968ae304 100644 --- a/Step/Controllers/WebApi/NcFileController.cs +++ b/Step/Controllers/WebApi/NcFileController.cs @@ -242,7 +242,7 @@ namespace Step.Controllers.WebApi } } - [Route("queue/{processId:int}/edit/{itemId:int}"), HttpPut] + [Route("queue/{processId:int}/edit/{itemId:int}"), HttpPut] public IHttpActionResult EditQueueItem(int processId, int itemId, RepsModel reps) { using (NcFileHandler ncHandler = new NcFileHandler()) diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts index f67d7620..a9a157a5 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts @@ -323,6 +323,7 @@ export default class toolingEquipment extends Vue { else { this.fieldTool(newTool); this.selectedTool = Object.assign({}, newTool) + this.copySelectedTool = null this.enableToolModify = true this.enableOffsets = false this.enableParameters = true @@ -428,10 +429,13 @@ export default class toolingEquipment extends Vue { } public cancel = function () { + debugger if(this.isSiemens){ if (this.copySelectedTool) { this.selectedTool = Object.assign({},this.copySelectedTool); toolingActions.updateTool(store, this.copySelectedTool); + } else { + this.selectedTool = null; } } else{ @@ -440,7 +444,7 @@ export default class toolingEquipment extends Vue { toolingActions.updateNcTool(store, this.copySelectedTool); } } - + if (!this.selectedTool || !this.selectedTool.id) { this.selectedTool = null; } else { @@ -473,6 +477,8 @@ public isEquipmentSelected(offset){ } public cancelOffsetTab = function () { + console.log("OFFSET") + debugger if(this.copySelectedTool && this.selectedTool.id > 0){ // Useless? this.selectedTool = Object.assign({},this.copySelectedTool); toolingActions.updateNcTool(store, this.selectedTool); @@ -740,6 +746,7 @@ public isEquipmentSelected(offset){ } async buttonSave(tool: any, edge: any) { + console.log("ENTRO QUI", tool) if (tool.id) { if (edge && edge.id > 0) { this.modifyEdge(tool, edge); @@ -751,6 +758,9 @@ public isEquipmentSelected(offset){ this.modifyTool(tool); } } + else { + this.save(tool) + } } async deleteTool(model) { diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts index e319b04a..84a09a51 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts @@ -320,10 +320,10 @@ export default class toolingFamilies extends Vue { public getToolMagPositionByFamily = function (family) { if(family.childTools){ + // Loop througth childs for(let j = 0; j < family.childTools.length; j++) { - var SH = this.ncShanks.filter(t => String(t.id).indexOf(family.childTools[j].shankId) >=0); - - if(SH.length > 0) + var SH = this.ncShanks.filter(t => String(t.id).indexOf(family.childTools[j].shankId) >= 0); + if(SH.length > 0 && SH[0].magazineId) return SH[0].magazineId; } } diff --git a/Step/wwwroot/src/config.ts b/Step/wwwroot/src/config.ts index 96f4b6ad..07c70d37 100644 --- a/Step/wwwroot/src/config.ts +++ b/Step/wwwroot/src/config.ts @@ -9,4 +9,4 @@ export const DEBUG_CONFIGURATION = CONFIGURATION_OSAI; // stabilisce se leggere la configurazione dal server o // se utilizzare la configurazione locale -export const USE_RUNTIME_CONFIGURATION = false; \ No newline at end of file +export const USE_RUNTIME_CONFIGURATION = true; \ No newline at end of file