diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 830fd335..e25554b1 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Config/Config/toolManagerConfig.xml b/Step.Config/Config/toolManagerConfig.xml index 55ede02f..ac6973c9 100644 --- a/Step.Config/Config/toolManagerConfig.xml +++ b/Step.Config/Config/toolManagerConfig.xml @@ -1,7 +1,7 @@  - false + true false true false @@ -52,13 +52,15 @@ 1 - + true + Magazine 1 Magazzino 1 2 + true Magazine 2 Magazzino 2 @@ -66,6 +68,7 @@ 3 + true Magazine 3 Magazzino 3 diff --git a/Step.Config/Config/toolManagerConfigValidator.xsd b/Step.Config/Config/toolManagerConfigValidator.xsd index 3f78cb7f..b9432357 100644 --- a/Step.Config/Config/toolManagerConfigValidator.xsd +++ b/Step.Config/Config/toolManagerConfigValidator.xsd @@ -110,6 +110,7 @@ + @@ -118,7 +119,7 @@ - + diff --git a/Step.Database/Controllers/NcToolManagerController.cs b/Step.Database/Controllers/NcToolManagerController.cs index 48e13ee5..1644b5f5 100644 --- a/Step.Database/Controllers/NcToolManagerController.cs +++ b/Step.Database/Controllers/NcToolManagerController.cs @@ -484,7 +484,7 @@ namespace Step.Database.Controllers dbCtx.Shanks.Attach(shank); // Set ids with new positions shank.MagazineId = magazineId; - shank.PositionId = positionId; + //shank.PositionId = positionId; // Set original Ids shank.OriginMagazineId = magazineId; shank.OriginPositionId = positionId; @@ -520,7 +520,7 @@ namespace Step.Database.Controllers return GetShank(shankId); } - public DTONcShankModel UnloadToolFromShank(DbNcToolModel tool) + public DTONcShankModel UnloadToolFromShank(DbNcToolModel tool) { dbCtx.Tools.Attach(tool); int? shankId = tool.ShankId; diff --git a/Step.Model/ConfigModels/MagazineNamesModel.cs b/Step.Model/ConfigModels/MagazineNamesModel.cs index f36fb4bd..f71c4338 100644 --- a/Step.Model/ConfigModels/MagazineNamesModel.cs +++ b/Step.Model/ConfigModels/MagazineNamesModel.cs @@ -10,6 +10,8 @@ namespace Step.Model.ConfigModels { public int MagazineId { get; set; } + public bool AssistedTooling { get; set; } + public Dictionary LocalizedNames { get; set; } } } diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index 1fcabf1d..99486fc9 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -150,7 +150,7 @@ namespace Step.NC else { string name = ""; - cmsError = numericalControl.PROC_RSelectedPPName(selectedProcess, ref name); + cmsError = numericalControl.PROC_RSelectedPPName(selectedProcess, ref name); if (cmsError.IsError()) return cmsError; @@ -1512,13 +1512,23 @@ namespace Step.NC CmsError cmsError = numericalControl.TOOLS_RConfiguration(ref config); if (cmsError.IsError()) return cmsError; + + // Set magazine assisted tooling from config + foreach(var magConfig in ToolManagerConfig.MagazineNames) + { + var mag = config.Magazines.FirstOrDefault(x => magConfig.MagazineId == x.Id); + if (mag != null) + mag.AssistedToolingIsActive = magConfig.AssistedTooling; + } if (NcConfig.NcVendor != NC_VENDOR.SIEMENS && NcConfig.NcVendor != NC_VENDOR.DEMO) { + // Setup options config.FamilyOptionActive = true; config.MultitoolOptionActive = true; config.OffsetOptionActive = true; + // Add categories to be removed List categories = new List(); if (!ToolManagerConfig.ShankOpt) { @@ -1575,6 +1585,7 @@ namespace Step.NC if (!ToolManagerConfig.ReviveOpt) categories.Add("revive"); + // Remove category from configurations config.ToolsConfiguration = config.ToolsConfiguration.Where(x => !categories.Contains(x.Category)).ToList(); // Remove categories from familyConfig diff --git a/Step/Controllers/WebApi/ApiMaintenanceController.cs b/Step/Controllers/WebApi/ApiMaintenanceController.cs index 437e70df..2b4af1fa 100644 --- a/Step/Controllers/WebApi/ApiMaintenanceController.cs +++ b/Step/Controllers/WebApi/ApiMaintenanceController.cs @@ -342,6 +342,7 @@ namespace Step.Controllers.WebApi if (!File.Exists(MAINTENANCE_ATTACHMENT_PATH + attachment.LocalFileName)) return NotFound(); + return new FileResult(MAINTENANCE_ATTACHMENT_PATH + attachment.LocalFileName); } } diff --git a/Step/Controllers/WebApi/NcToolManagerController.cs b/Step/Controllers/WebApi/NcToolManagerController.cs index 7629ad15..0951c511 100644 --- a/Step/Controllers/WebApi/NcToolManagerController.cs +++ b/Step/Controllers/WebApi/NcToolManagerController.cs @@ -195,6 +195,7 @@ namespace Step.Controllers.WebApi } else { + defaultFamily.Id = toolId; // Add new family DbNcFamilyModel dbFam = toolsManager.AddFamily(defaultFamily); @@ -883,7 +884,7 @@ namespace Step.Controllers.WebApi using(NcToolManagerController toolsManager = new NcToolManagerController()) { - var tool = toolsManager.FindTool(data.ToolId); + var tool = toolsManager.FindTool(data.ToolId); if (tool == null) return BadRequest(); diff --git a/Step/wwwroot/src/@types/tooling.d.ts b/Step/wwwroot/src/@types/tooling.d.ts index 51b59b39..3bd39a2b 100644 --- a/Step/wwwroot/src/@types/tooling.d.ts +++ b/Step/wwwroot/src/@types/tooling.d.ts @@ -1,3 +1,5 @@ +import { assistedTooling1 } from "../app_modules/tooling"; + declare module server { export interface ToolTableInfoModel { @@ -80,6 +82,7 @@ declare module server { type: number, name: string, loadingIsActive: boolean, + assistedToolingIsActive: boolean // signalRLoadingIsActive: boolean } diff --git a/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts b/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts index 7575f67c..68fd33d6 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts @@ -16,7 +16,8 @@ export default { positionId: null, magazineId: null, magInfo: null, - fitInPosition: true + fitInPosition: true, + action: "LOAD" } }, computed: { @@ -40,6 +41,7 @@ export default { this.magazineId = ModalHelper.loadDepotModal.magazineId; this.positionId = ModalHelper.loadDepotModal.positionId; + this.action = ModalHelper.loadDepotModal.action; if(this.magazineId) this.magInfo = (this.$store.state as AppModel).tooling.magazines.find(d => d.id == this.magazineId); @@ -66,11 +68,24 @@ export default { }); } else{ - new DepotService().AddToolToDepotNc(this.magazineId, this.positionId, { shankId: this.toolSelected.id }).then(response => { - Factory.Get(MessageService).deleteChannel("esc_pressed"); - toolingActions.updateBusyStatusPositions(store,this.magInfo.type,(this.$store.state as AppModel).depot.depotNc); - ModalHelper.HideModal(); - }); + if (this.action == "LOAD") { + new DepotService().AddToolToDepotNc(this.magazineId, this.positionId, { shankId: this.toolSelected.id }).then(response => { + Factory.Get(MessageService).deleteChannel("esc_pressed"); + toolingActions.updateBusyStatusPositions(store,this.magInfo.type,(this.$store.state as AppModel).depot.depotNc); + ModalHelper.HideModal(); + }) + } + else { + let act = 2; // Unload + if (this.action == "EXCHANGE") + act = 1; + + new DepotService().StartAssistedToolingProcedure(this.toolSelected.id, this.magazineId, this.positionId, act).then(response => { + Factory.Get(MessageService).deleteChannel("esc_pressed"); + toolingActions.updateBusyStatusPositions(store, this.magInfo.type, (this.$store.state as AppModel).depot.depotNc); + ModalHelper.HideModal(); + }) + } } }, calcItemName(shank) { diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts index 43b0baae..f87c706b 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -308,7 +308,13 @@ export default class depot extends Vue { toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depotNc); this.onLoading = false; - this.assistedToolingIsActive = this.magazineType == 5 + + // Set assistedTooling procedure + if(this.magazines){ + var mag = this.magazines.find(x => x.id == this.depotId) + if(mag) + this.assistedToolingIsActive = mag.assistedToolingIsActive + } } @@ -591,10 +597,10 @@ export default class depot extends Vue { public openModalLoadDepot(action, positionId, positionType) { console.log("AZIONE", action, positionId, positionType) - if(action != "EXCHANGE"){ // Unload case - // Call api with unload + if(action == "UNLOAD") { // Unload case + // Call assisted unload api const tool = this.ncToolAtPosition(positionId) - new DepotService().StartAssistedToolingProcedure(tool.id, Number(this.depotId), positionId).then(response => { + new DepotService().StartAssistedToolingProcedure(tool.id, Number(this.depotId), positionId, 2).then(response => { console.log(response) }); } diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue index 851120c0..147bff92 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue @@ -12,6 +12,7 @@ +
{{'depot_label_search' | localize("Seleziona un utensile e trascinalo nel magazzino corrispondente:")}} @@ -68,7 +69,7 @@ :magpos-occupied="toolAtPosition(pos.positionId) || pos.occupied" :editable="editable" :disabled="pos.disabled" - @click="openModalLoadDepot" > + @click="openModalLoadDepot"> @@ -207,7 +209,7 @@ @click="removeToolsToDepot(pos.positionId, ncToolAtPosition(pos.positionId))" @clickinfo="openInfoShank(ncToolAtPosition(pos.positionId).id)"> - +
diff --git a/Step/wwwroot/src/modules/base-components/cards/detail-card.vue b/Step/wwwroot/src/modules/base-components/cards/detail-card.vue index cb7e7b4d..7d54d120 100644 --- a/Step/wwwroot/src/modules/base-components/cards/detail-card.vue +++ b/Step/wwwroot/src/modules/base-components/cards/detail-card.vue @@ -1,5 +1,4 @@