From 2a60bb9d187f498c397e20bb9720dd18e4ebbb1e Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 15 Jul 2019 06:58:21 +0000 Subject: [PATCH] Integration 2.1g4 : - aggiunta gestione ritorno rotazioni - aggiunta gestione ritorno tempo totale stimato - per trave da progetto si aggiunge grezzo in eccesso solo se di lunghezza inferiore a 2 metri. --- IntegrationEgaltech/Constants.cs | 1 + IntegrationEgaltech/Generator.cs | 34 +++++++++++++++---- .../Properties/AssemblyInfo.cs | 4 +-- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/IntegrationEgaltech/Constants.cs b/IntegrationEgaltech/Constants.cs index 430243c..d8504cf 100644 --- a/IntegrationEgaltech/Constants.cs +++ b/IntegrationEgaltech/Constants.cs @@ -33,6 +33,7 @@ namespace ib.essetre.integration.egaltech public const int scaleUnit = 2 ; // Allungamento della barra per pezzi singoli da Vista + public const double BarMaxLenForAdd = 2000 ; public const double BarAddLen = 2000 ; // Sovramateriale di testa per pezzi singoli di Vista diff --git a/IntegrationEgaltech/Generator.cs b/IntegrationEgaltech/Generator.cs index 8f3636d..24cd146 100644 --- a/IntegrationEgaltech/Generator.cs +++ b/IntegrationEgaltech/Generator.cs @@ -9,6 +9,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; +using System.Globalization ; using ib.essetre.integration; using ib.essetre.integration.egaltech; @@ -121,9 +122,10 @@ namespace ib.essetre.integration.egaltech // Dialog con Progress Bar float progValue = (float) 1 / numBars ; + string sProgress = ( progValue * ( i + 1) * 100).ToString("F1", CultureInfo.InvariantCulture) ; callback.Progress( progValue * ( i + 1), - " Progresso: " + ( progValue * ( i + 1) * 100) + "%" + "\n" + - " BTL generati: " + ( i + 1) + " su " + numBars) ; + " Progress: " + sProgress + "%" + "\n" + + " Count: " + ( i + 1) + " / " + numBars) ; // Scrittura del file BTL // Il nome del file cambia a seconda che si tratti del caso Produzione o caso Ordine @@ -170,9 +172,11 @@ namespace ib.essetre.integration.egaltech bool bErrors = false ; int nLastErr = 0 ; string sLastMsg = "" ; + int nTotTime = 0 ; if ( File.Exists( Path.ChangeExtension( BtlPath, ".txt"))) { int nErr = 0 ; string sMsg = "" ; + double dRot = 0 ; int cutId = 0 ; int taskId = 0 ; string[] lines = System.IO.File.ReadAllLines( Path.ChangeExtension( BtlPath, ".txt")) ; @@ -184,6 +188,11 @@ namespace ib.essetre.integration.egaltech cutId = 0 ; taskId = 0 ; } + else if ( line.StartsWith( "ROT=")) { + int? nVal = GetVal( line, "ROT") ; + int nRot = ( nVal != null ? nVal.Value : 0) ; + dRot = (( 4 - nRot) % 4) * 90 ; + } else if ( line.StartsWith( "CUTID=")) { int? nVal = GetVal( line, "CUTID") ; cutId = ( nVal != null ? nVal.Value : 0) ; @@ -199,8 +208,16 @@ namespace ib.essetre.integration.egaltech sLastMsg = sMsg ; } pattInfo.SetTaskState( cutId, taskId, resExe, sMsg) ; + if ( pattInfo.IsFromProject) + pattInfo.SetProcessInfoChosen( cutId, taskId, dRot, 0, false) ; + else + pattInfo.SetTaskInfoChosen( cutId, taskId, dRot, 0, false) ; } - else if ( ! string.IsNullOrWhiteSpace( line)) + else if ( line.StartsWith( "TIME=")) { + int? nVal = GetVal( line, "TIME") ; + nTotTime = ( nVal != null ? nVal.Value : 0) ; + } + else if ( ! string.IsNullOrWhiteSpace( line) && line != "---") sMsg = line ; } } @@ -219,7 +236,7 @@ namespace ib.essetre.integration.egaltech pattInfo.Message = sLastMsg ; } } - pattInfo.EstimatedTime = 32.7 ; + pattInfo.EstimatedTime = nTotTime ; // Lettura OutputFilename e scrittura nel parametro stringa Iso (solo nel caso UIModes.HIDDEN) if ( ! bErrors && parameters.UIMode == InOutParameters.UIModes.HIDDEN) { @@ -534,8 +551,13 @@ namespace ib.essetre.integration.egaltech DataTable dTab = ds.Tables[0] ; int listaProcessesCount = dTab.Rows.Count ; - if ( listaProcessesCount > 0) - barLength = Convert.ToDouble( dTab.Rows[0]["length"]) + Constants.BarAddLen ; + if ( listaProcessesCount > 0) { + double beamLength = Convert.ToDouble( dTab.Rows[0]["length"]) ; + if ( beamLength < Constants.BarMaxLenForAdd) + barLength = beamLength + Constants.BarAddLen ; + else + barLength = beamLength + 2 * Constants.HeadOverMat ; + } return barLength ; } diff --git a/IntegrationEgaltech/Properties/AssemblyInfo.cs b/IntegrationEgaltech/Properties/AssemblyInfo.cs index 16b4e39..a4dcab3 100644 --- a/IntegrationEgaltech/Properties/AssemblyInfo.cs +++ b/IntegrationEgaltech/Properties/AssemblyInfo.cs @@ -36,5 +36,5 @@ using System.Runtime.InteropServices; // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // usando l'asterisco '*' come illustrato di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.7.3")] -[assembly: AssemblyFileVersion("2.1.7.3")] +[assembly: AssemblyVersion("2.1.7.4")] +[assembly: AssemblyFileVersion("2.1.7.4")]