From f2ed2274ff2b26495a35bd68ea17291d8e662d3c Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 16 Jul 2019 17:00:58 +0200 Subject: [PATCH] Fix decodifica UnOp (Operating Groups) --- Jenkinsfile | 2 +- MTC_Adapter/SCMA/MainForm.cs | 39 ++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 334f7c7..ed76185 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=394']) { + withEnv(['NEXT_BUILD_NUMBER=395']) { // env.versionNumber = VersionNumber(versionNumberString : '2.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '2.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'SCMA' diff --git a/MTC_Adapter/SCMA/MainForm.cs b/MTC_Adapter/SCMA/MainForm.cs index e6dd96a..25ff9bb 100644 --- a/MTC_Adapter/SCMA/MainForm.cs +++ b/MTC_Adapter/SCMA/MainForm.cs @@ -1316,6 +1316,10 @@ namespace SCMA int numProc = 0; List listaProc = new List(); + // UnOp... + int numUnOp = 0; + List listaUnOp = new List(); + // cerco i dati dei vari elementi opzionali // VacuumPump... int numVP = 0; @@ -1380,8 +1384,7 @@ namespace SCMA numRules += 9; } fileOut.WriteLine(""); - - + // cerco PATH come componenti... List selProc = currDataModel.Components.FindAll(x => x.BrowseName.Contains("Machine:Cnc:CncProcesses:")); string procBaseName = ""; @@ -1406,6 +1409,33 @@ namespace SCMA } fileOut.WriteLine(""); + // cerco Gruppi operatori come componenti... + List selUnOp = currDataModel.Components.FindAll(x => x.BrowseName.Contains("Machine:OperatingGroups:")); + string procUnOp = ""; + foreach (var item in selUnOp) + { + numUnOp++; + procUnOp = $"UnOp_{numUnOp.ToString("00")}"; + newElement = new element() + { + ident = procUnOp + }; + listaUnOp.Add(newElement); + // aggiungo su file... + replString = item.BrowseName.Replace("Machine:", ""); + fileOut.WriteLine($"A|I|{newElement.ident}_Speed|{replString}:SpeedRate"); + fileOut.WriteLine($"A|I|{newElement.ident}_KRev|{replString}:Distance"); + fileOut.WriteLine($"A|I|{newElement.ident}_ToolId|{replString}:ToolId"); + fileOut.WriteLine($"A|I|{newElement.ident}_NumCU|{replString}:ToolChanges"); + fileOut.WriteLine($"A|I|{newElement.ident}_AccTime|{replString}:ActiveTime"); + fileOut.WriteLine($"A|I|{newElement.ident}_Load|{replString}:Load"); + fileOut.WriteLine($"A|I|{newElement.ident}_SpeedOverr|{replString}:SpeedOverride"); + fileOut.WriteLine($"A|I|{newElement.ident}_Status|{replString}:Status"); + fileOut.WriteLine($"A|I|ST_{newElement.ident}_Status|{replString}:Status"); + numRules += 9; + } + fileOut.WriteLine(""); + // cerco gruppi ausiliari... List listaAux = currDataModel.Properties.FindAll(x => x.BrowseName.Contains("Machine:AuxiliaryGroups")); foreach (var item in listaAux) @@ -1478,6 +1508,11 @@ namespace SCMA element[] elencoProc = listaProc.ToArray(); adpConf.Path = elencoProc; } + if (numUnOp > 0) + { + element[] elencoUnOp = listaUnOp.ToArray(); + adpConf.UnOp = elencoUnOp; + } if (numVP > 0) { element[] elencoVP = listaVP.ToArray();