diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 66c69569..f2054c7a 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Config/Config/maintenancesConfig.xml b/Step.Config/Config/maintenancesConfig.xml index 12697b84..605d9f16 100644 --- a/Step.Config/Config/maintenancesConfig.xml +++ b/Step.Config/Config/maintenancesConfig.xml @@ -14,7 +14,7 @@ Sostituire tenute aria/liquido giunto assi rotanti mm - 1 + 0 diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index e386fb2f..8226f552 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -985,12 +985,15 @@ namespace Step.NC // Get matching counter for the current maintenance counter = counters.Find(x => x.Id == currMaintenance.CounterId); + // Convert from seconds to minuts + var counterVal = counter.Value / 60; + int perfVal = 0; if (performed != null) perfVal = performed.CounterValue; // Calc percentage = PLC - PERFORMED VALUE * 100 / interval - percentage = ((counter.Value - perfVal) * 100) / SupportFunctions.ConvertInMinutes(currMaintenance.Interval.Value, currMaintenance.UnitOfMeasure.Value); - missingDays = TimeSpan.FromMinutes(-1 * (counter.Value - perfVal - SupportFunctions.ConvertInMinutes(currMaintenance.Interval.Value, currMaintenance.UnitOfMeasure.Value))); + percentage = ((counterVal - perfVal) * 100) / SupportFunctions.ConvertInMinutes(currMaintenance.Interval.Value, currMaintenance.UnitOfMeasure.Value); + missingDays = TimeSpan.FromMinutes(-1 * ((counterVal / 60) - perfVal - SupportFunctions.ConvertInMinutes(currMaintenance.Interval.Value, currMaintenance.UnitOfMeasure.Value))); } break; @@ -1109,7 +1112,7 @@ namespace Step.NC perfVal = performed.CounterValue; // MAINTENANCE_INTERVAL <= PLC - LASTPERFORMED - if (SupportFunctions.ConvertInMinutes(currMaintenance.Interval.Value, currMaintenance.UnitOfMeasure.Value) <= counter.Value - perfVal) + if (SupportFunctions.ConvertInMinutes(currMaintenance.Interval.Value, currMaintenance.UnitOfMeasure.Value) <= (counter.Value / 60) - perfVal) { // Update last expiration date if null if (currMaintenance.LastExpirationDate == null) diff --git a/Step/Controllers/WebApi/NcToolManagerController.cs b/Step/Controllers/WebApi/NcToolManagerController.cs index 8cf35e7a..2c27de58 100644 --- a/Step/Controllers/WebApi/NcToolManagerController.cs +++ b/Step/Controllers/WebApi/NcToolManagerController.cs @@ -62,7 +62,7 @@ namespace Step.Controllers.WebApi if (!ModelState.IsValid) return BadRequest(ModelState); - short id = 0; + short familyId = 0; using (NcToolManagerController toolsManager = new NcToolManagerController()) { // Check if option is active @@ -71,7 +71,7 @@ namespace Step.Controllers.WebApi if (dtoToolWithFamily.FamilyId == 0) { // If param equal to 0 create a new family - DTONewNcFamilyModel newFamily = new DTONewNcFamilyModel() { Name = "NewFamily" }; + DTONewNcFamilyModel newFamily = new DTONewNcFamilyModel() { Name = "NewFamily", LeftSize = 1, RightSize = 1 }; // Add new family & update family id DbNcFamilyModel newFam = toolsManager.AddFamily(newFamily); dtoToolWithFamily.FamilyId = newFam.FamilyId; @@ -104,7 +104,7 @@ namespace Step.Controllers.WebApi dtoToolWithFamily.FamilyId = dbFam.FamilyId; // Set common id - id = dbFam.FamilyId; + familyId = dbFam.FamilyId; } // Check if option is active @@ -118,7 +118,7 @@ namespace Step.Controllers.WebApi }; // Create a new shank - DbNcShankModel ncShank = toolsManager.AddShank(newShank, id); + DbNcShankModel ncShank = toolsManager.AddShank(newShank, familyId); // Connect tool to new shank dtoToolWithFamily.ShankId = ncShank.ShankId; } @@ -131,7 +131,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); // Add tool - CmsError cmsError = ncHandler.AddTool(dtoToolWithFamily, out DTONcToolModel newTool, id); + CmsError cmsError = ncHandler.AddTool(dtoToolWithFamily, out DTONcToolModel newTool, familyId); if (cmsError.IsError()) return BadRequest(cmsError.localizationKey); 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 1af45521..7575f67c 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts @@ -53,7 +53,7 @@ export default { return this.$store.state.machineInfo.isSiemens; }, isPositionCompatible(tool) { - return (this.$store.getters).positionCompatible(tool.id, ModalHelper.loadDepotModal.positionType); + return (this.$store.getters).positionCompatible(tool.id, ModalHelper.loadDepotModal.positionType); }, save() { this.magazineId = ModalHelper.loadDepotModal.magazineId; @@ -66,7 +66,6 @@ export default { }); } else{ - console.log(this.magazineId, this.positionId, { shankId: this.toolSelected.id }) ; 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); @@ -102,7 +101,7 @@ export default { this.fitInPosition = (this.$store.state as AppModel).tooling.magPosDepot[this.positionId -1].canLoadTool; } else{ - toolingActions.setCanLoadTool(store, this.toolSelected.maxRight,this.toolSelected.maxLeft,this.magInfo.type,(this.$store.state as AppModel).depot.depot); + toolingActions.setCanLoadTool(store, this.toolSelected.maxRight,this.toolSelected.maxLeft, this.magInfo.type, (this.$store.state as AppModel).depot.depotNc); this.fitInPosition = (this.$store.state as AppModel).tooling.magPosNcDepot[this.positionId -1].canLoadTool; } } 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 9911d85e..a811464a 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -584,9 +584,10 @@ export default class depot extends Vue { ModalHelper.ShowModal(LoadDepot); } + // SIEMENS public doAddToDepotPosition(position, event) { if (this.draggingTool && this.draggingPosition == position.positionId) { - if (this.toolAtPosition(position.positionId) || position.disabled || !this.checkMagPosType(position.type)) + if (this.toolAtPosition(position.positionId) || !position.canLoadTool) return this.draggingIn = false; @@ -598,9 +599,10 @@ export default class depot extends Vue { } } + // OSAI-FANUC public doAddToNcDepotPosition(position, event) { if (this.draggingTool && this.draggingPosition == position.positionId) { - if (this.ncToolAtPosition(position.positionId) || position.disabled || !this.checkMagPosType(position.type)) + if (this.ncToolAtPosition(position.positionId) || !position.canLoadTool) return this.draggingIn = false; this.draggingTool = null; @@ -708,12 +710,12 @@ export default class depot extends Vue { } - public calculateAvailablePositions() { + public calculateAvailablePositions() { if(this.draggingTool){ if(this.isSiemens) toolingActions.setCanLoadTool(store, this.draggingTool.rightSize,this.draggingTool.leftSize,this.magazineType,this.depot); else - toolingActions.setCanLoadTool(store, this.draggingTool.maxRight,this.draggingTool.maxLeft,this.magazineType,this.depotNc); + toolingActions.setCanLoadTool(store, this.draggingTool.maxRight, this.draggingTool.maxLeft, this.magazineType, this.depotNc); } } } \ No newline at end of file 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 90df86e2..306f9e5c 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue @@ -170,7 +170,7 @@
- +
- +
{{'tooling_families_boxright_editlabel' | localize("Modifica della famiglia %s", selectedTool.name)}}
{{'tooling_families_boxright_newlabel' | localize("Aggiunta nuova famiglia")}}
@@ -146,8 +146,8 @@
@@ -174,7 +174,8 @@
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 808fd528..d53e06e0 100644 --- a/Step/wwwroot/src/modules/base-components/cards/detail-card.vue +++ b/Step/wwwroot/src/modules/base-components/cards/detail-card.vue @@ -25,7 +25,6 @@ export default { label:{default:""}, physicalType:{default:1}, magposOccupied:{ default: false }, - magposOccupied:{ default: false }, editable:{ default: false }, disabled:{ default: false } }, diff --git a/Step/wwwroot/src/store/tooling.store.ts b/Step/wwwroot/src/store/tooling.store.ts index bf42162a..693867fb 100644 --- a/Step/wwwroot/src/store/tooling.store.ts +++ b/Step/wwwroot/src/store/tooling.store.ts @@ -191,7 +191,8 @@ export const toolingStore = { if(!posType || posType==0) return true; - let tool = state.tools.find(t => t.id === id); + let tool = state.tools.find(t => t.id === id); + if(tool){ if(tool.magazinePositionType == posType) @@ -566,7 +567,7 @@ export const toolingStore = { }); }, - SetCanLoadTool(store, {sizeRight, sizeLeft,magazineType,tools}){ + SetCanLoadTool(store, {sizeRight, sizeLeft, magazineType, tools}){ var magposDisabled = new Array(); var dimleftMount = sizeLeft/2.0; @@ -578,9 +579,10 @@ export const toolingStore = { positionMagazines = store.magPosDepot; else positionMagazines = store.magPosNcDepot; + var maxPos = positionMagazines.length; - //Check if is enabled + // Check if is enabled positionMagazines.forEach(element => { element.canLoadTool = !element.disabled; if(element.disabled){ @@ -588,14 +590,14 @@ export const toolingStore = { } }); - //Check disabled positions + // Check disabled positions magposDisabled.forEach(element => { var dimleft = 0.5; var dimright = 0.5; for (let index = 1; index < (dimrightMount + dimleft); index++) { position = element.positionId -1 - index; - //Base on magazineType + // Base on magazineType if(magazineType != 1 && magazineType != 2){ if(position>=0 && position < maxPos) positionMagazines[position].canLoadTool = false @@ -610,7 +612,7 @@ export const toolingStore = { for (let index = 1; index < (dimleftMount + dimright); index++) { position = element.positionId -1 + index; - //Base on magazineType + // Base on magazineType if(magazineType != 1 && magazineType != 2){ if(position>=0 && position < maxPos) positionMagazines[position].canLoadTool = false @@ -624,25 +626,37 @@ export const toolingStore = { } }); - //Check mounted tools dimension + // Check mounted tools dimension var dimleft; var dimright; tools.forEach(element => { - if(element.childTool || element.childShank){ + if(element.childTool || element.childShank || element.childsTools){ - //Get Right Size + + // Get Right Size if(element.childShank){ dimleft = element.childShank.leftSize/2.0; dimright = element.childShank.rightSize/2.0; - }else + } else if(element.childTool) { dimleft = element.childTool.leftSize/2.0; dimright = element.childTool.rightSize/2.0; } + else{ + dimleft = element.maxLeft/2.0; + dimright = element.maxRight/2.0; + } + + //Check dimensions + if(dimleft<0.5) + dimleft = 0.5; + if(dimright<0.5) + dimright = 0.5; + for (let index = 1; index < (dimrightMount + dimleft); index++) { position = element.positionId -1 - index; - //Base on magazineType + // Base on magazineType if(magazineType != 1 && magazineType != 2){ if(position>=0 && position < maxPos) positionMagazines[position].canLoadTool = false @@ -658,7 +672,7 @@ export const toolingStore = { for (let index = 1; index < (dimleftMount + dimright); index++) { position = element.positionId -1 + index; - //Base on magazineType + // Base on magazineType if(magazineType != 1 && magazineType != 2){ if(position>=0 && position < maxPos) positionMagazines[position].canLoadTool = false