diff --git a/Client/View/OpeningForm.cs b/Client/View/OpeningForm.cs index 9160ba04..7d177ce9 100644 --- a/Client/View/OpeningForm.cs +++ b/Client/View/OpeningForm.cs @@ -34,7 +34,11 @@ namespace CMS_Client.View //Constructor public OpeningForm() { - InitializeComponent(); + InitializeComponent(); + + //Setup The Browser + if (!SetupBrowser()) + return; //Set window Position this.Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2)); @@ -144,10 +148,6 @@ namespace CMS_Client.View //Set App Opacity setOpacity(1); - //Setup The Browser - if (!SetupBrowser()) - return; - //Close the Window closeWindow(); } diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index b6b94c4c..830fd335 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Model/DTOModels/DTOHeadModel.cs b/Step.Model/DTOModels/DTOHeadModel.cs index d114705d..b46557e1 100644 --- a/Step.Model/DTOModels/DTOHeadModel.cs +++ b/Step.Model/DTOModels/DTOHeadModel.cs @@ -1,4 +1,6 @@ -namespace Step.Model.DTOModels +using static CMS_CORE_Library.Models.DataStructures; + +namespace Step.Model.DTOModels { public class DTOHeadModel { @@ -62,6 +64,8 @@ public int ActualSpeed; public short Load; public ushort MountedTool; + public bool Configured; + public ROTATION Rotation; public DTOToolInSpindleModel ToolData; public override bool Equals(object obj) @@ -82,6 +86,12 @@ if (MountedTool != item.MountedTool) return false; + if (Configured != item.Configured) + return false; + + if (Rotation != item.Rotation) + return false; + // Call Parent equals return base.Equals(item); } diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index 469f2e99..1fcabf1d 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -1329,6 +1329,8 @@ namespace Step.NC IsActive = head.IsActive, IsSelected = head.IsSelected, AbrasiveIsActive = head.AbrasiveIsActive, + Configured = head.Configured, + Rotation = head.Rotation, ToolData = head.Tool == null ? null : new DTOToolInSpindleModel() { ChildId = head.Tool.ChildId, @@ -2480,9 +2482,9 @@ namespace Step.NC return numericalControl.TOOLS_RMagazineStatus(ref status); } - public CmsError StartAssistedToolingProcedure(ushort toolId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action) + public CmsError StartAssistedToolingProcedure(ushort toolId, ushort familyId, ushort shankId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action) { - return numericalControl.PLC_WAssistedToolingCmd(toolId, magazineId, positionId, action); + return numericalControl.PLC_WAssistedToolingCmd(toolId, familyId, shankId, magazineId, positionId, action); } public CmsError ReadAssistedToolingProcedure(out DTOAssistedToolingEndValueModel data) diff --git a/Step/Controllers/WebApi/NcFileController.cs b/Step/Controllers/WebApi/NcFileController.cs index fda45f7a..417d2da3 100644 --- a/Step/Controllers/WebApi/NcFileController.cs +++ b/Step/Controllers/WebApi/NcFileController.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; +using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; diff --git a/Step/Controllers/WebApi/NcToolManagerController.cs b/Step/Controllers/WebApi/NcToolManagerController.cs index 670ea173..7629ad15 100644 --- a/Step/Controllers/WebApi/NcToolManagerController.cs +++ b/Step/Controllers/WebApi/NcToolManagerController.cs @@ -881,9 +881,16 @@ namespace Step.Controllers.WebApi { ncHandler.Connect(); - CmsError cmsError = ncHandler.StartAssistedToolingProcedure(data.ToolId, data.MagazineId, data.PositionId, data.Action); - if (cmsError.IsError()) - return BadRequest(cmsError.localizationKey); + using(NcToolManagerController toolsManager = new NcToolManagerController()) + { + var tool = toolsManager.FindTool(data.ToolId); + if (tool == null) + return BadRequest(); + + CmsError cmsError = ncHandler.StartAssistedToolingProcedure(data.ToolId, (ushort)tool.FamilyId, (ushort)tool.ShankId, data.MagazineId, data.PositionId, data.Action); + if (cmsError.IsError()) + return BadRequest(cmsError.localizationKey); + } return Ok(); } diff --git a/Step/wwwroot/src/app_modules/production/components/head-production.vue b/Step/wwwroot/src/app_modules/production/components/head-production.vue index f2df9537..52ee4b87 100644 --- a/Step/wwwroot/src/app_modules/production/components/head-production.vue +++ b/Step/wwwroot/src/app_modules/production/components/head-production.vue @@ -4,7 +4,7 @@
{{title}}
- + @@ -84,7 +84,8 @@ export default { abrasiveIsActive: { default: true }, isActive: {default:false}, isSelected: {default:false}, - title: { default: "head 1"} + title: { default: "head 1"}, + rotation: { default: 0} }, // // data: function(){ // // return{ diff --git a/Step/wwwroot/src/app_modules/production/components/production.vue b/Step/wwwroot/src/app_modules/production/components/production.vue index 51fa44d0..77af5144 100644 --- a/Step/wwwroot/src/app_modules/production/components/production.vue +++ b/Step/wwwroot/src/app_modules/production/components/production.vue @@ -63,6 +63,8 @@ :tool="getHeadsProperty(h.id).mountedTool" :toolName="getHeadstoolName(h.id)" :toolDuplo="getHeadstoolChild(h.id)" + :rotation="getHeadsProperty(h.id).rotation" + :configured="getHeadsProperty(h.id).configured" @click="selectHead(h)" @overridePlus="overridePlus(h.id)" @overrideMinus="overrideMinus(h.id)">
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 ae85909a..43b0baae 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -199,6 +199,7 @@ export default class depot extends Vue { public magazines: server.MagazineModel[] = (this.$store.state as AppModel).tooling.magazines; public enableModify: any = false; public magazineType: any = 0; + public assistedToolingIsActive : boolean = false public checked: any = true; @@ -307,6 +308,7 @@ export default class depot extends Vue { toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depotNc); this.onLoading = false; + this.assistedToolingIsActive = this.magazineType == 5 } @@ -587,11 +589,23 @@ export default class depot extends Vue { } } - public openModalLoadDepot(positionId, positionType) { - ModalHelper.loadDepotModal.positionType = positionType; - ModalHelper.loadDepotModal.positionId = positionId; - ModalHelper.loadDepotModal.magazineId = this.depotId; - ModalHelper.ShowModal(LoadDepot); + public openModalLoadDepot(action, positionId, positionType) { + console.log("AZIONE", action, positionId, positionType) + if(action != "EXCHANGE"){ // Unload case + // Call api with unload + const tool = this.ncToolAtPosition(positionId) + new DepotService().StartAssistedToolingProcedure(tool.id, Number(this.depotId), positionId).then(response => { + console.log(response) + }); + } + else { + // Open moadal in order to select new tool + ModalHelper.loadDepotModal.positionType = positionType; + ModalHelper.loadDepotModal.positionId = positionId; + ModalHelper.loadDepotModal.action = action; + ModalHelper.loadDepotModal.magazineId = this.depotId; + ModalHelper.ShowModal(LoadDepot); + } } // SIEMENS 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 9cbe0cb1..851120c0 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.vue @@ -44,6 +44,7 @@ +
@@ -55,7 +56,19 @@
- +
+
@@ -167,7 +181,16 @@
- +
- +