diff --git a/IntegrationEgaltech/Generator.cs b/IntegrationEgaltech/Generator.cs index 97df8fb..380bcb7 100644 --- a/IntegrationEgaltech/Generator.cs +++ b/IntegrationEgaltech/Generator.cs @@ -710,7 +710,11 @@ namespace ib.essetre.integration.egaltech btlObject.barLength = GetBarLengthO( (int)dRow0["elementId"], (int)dRow0["projectId"]).ToString( "F3", CultureInfo.InvariantCulture) ; btlObject.barLoad90 = "0" ; btlObject.panelLength = GetPanelLengthO( (int)dRow0["elementId"], (int)dRow0["projectId"]).ToString( "F3", CultureInfo.InvariantCulture) ; - btlObject.panelWidth = GetPanelWidthO( (int)dRow0["elementId"], (int)dRow0["projectId"]).ToString( "F3", CultureInfo.InvariantCulture) ; + double dAngRot = (double)dRow0["rotated"] ; + if ( Math.Abs( dAngRot - 90) < 0.1 || Math.Abs( dAngRot - 270) < 0.1) + btlObject.panelWidth = GetPanelHeightO( (int)dRow0["elementId"], (int)dRow0["projectId"]).ToString( "F3", CultureInfo.InvariantCulture) ; + else + btlObject.panelWidth = GetPanelWidthO( (int)dRow0["elementId"], (int)dRow0["projectId"]).ToString( "F3", CultureInfo.InvariantCulture) ; btlObject.projectId = (int)dRow0["projectId"] ; btlObject.elementId = (int)dRow0["elementId"] ; btlObject.parts = new List() ; @@ -961,6 +965,35 @@ namespace ib.essetre.integration.egaltech return barWidth ; } + //------------------------------------------------------------------------------------------------------------- + // Recupera l'altezza della barra nel caso Produzione (colonna "h") + private static double GetBarHeightP( int patternId, int productionId) + { + double barWidth = 0 ; + + string sqlBarWidth = "SELECT h " + + "FROM dbo.vw_Pattern " + + "WHERE patternId = @firstId " + + "AND productionId = @secondId" ; + + // Connessione al DB ed esecuzione query + using ( SqlConnection cn = new SqlConnection( _SqlConnectionStr)) { + cn.Open() ; + using ( SqlCommand sqlCommand = new SqlCommand( sqlBarWidth, cn)) { + sqlCommand.Parameters.Add( "@firstId", SqlDbType.Int) ; + sqlCommand.Parameters.Add( "@secondId", SqlDbType.Int) ; + sqlCommand.Parameters["@firstId"].Value = patternId ; + sqlCommand.Parameters["@secondId"].Value = productionId ; + SqlDataReader reader = sqlCommand.ExecuteReader() ; + while ( reader.Read()) { + barWidth = Convert.ToDouble( reader["h"]) ; + } + } + } + + return barWidth ; + } + //------------------------------------------------------------------------------------------------------------- // Recupera il flag di carico con rotazione di 90° nel caso Produzione (colonna "load90") private static int GetBarLoad90P( int patternId, int productionId) @@ -1041,7 +1074,7 @@ namespace ib.essetre.integration.egaltech //------------------------------------------------------------------------------------------------------------- // Recupera la lunghezza del pannello nel caso Ordine (colonna "length", ovvero la lunghezza della singola parete) - // a cui aggiungiamo un valore fisso (es. 200) + // aumentata di un opportuno sovramateriale private static double GetPanelLengthO( int elementId, int projectId) { double panelLength = 0 ; @@ -1057,8 +1090,7 @@ namespace ib.essetre.integration.egaltech } //------------------------------------------------------------------------------------------------------------- - // Recupera la lunghezza del pannello nel caso Ordine (colonna "width", ovvero la larghezza della singola parete) - // a cui aggiungiamo un valore fisso (es. 200) + // Recupera la larghezza del pannello nel caso Ordine (colonna "width", ovvero la larghezza della singola parete) private static double GetPanelWidthO( int elementId, int projectId) { double panelWidth = 0 ; @@ -1067,7 +1099,23 @@ namespace ib.essetre.integration.egaltech int listaProcessesCount = dTab.Rows.Count ; if ( listaProcessesCount > 0) { double wallWidth = Convert.ToDouble( dTab.Rows[0]["width"]) ; - panelWidth = wallWidth ; // + 2 * Constants.PanelOverMat ; + panelWidth = wallWidth ; + } + + return panelWidth ; + } + + //------------------------------------------------------------------------------------------------------------- + // Recupera l'altezza del pannello nel caso Ordine (colonna "height", ovvero la larghezza della singola parete) + private static double GetPanelHeightO( int elementId, int projectId) + { + double panelWidth = 0 ; + + DataTable dTab = _ds.Tables[0] ; + int listaProcessesCount = dTab.Rows.Count ; + if ( listaProcessesCount > 0) { + double wallWidth = Convert.ToDouble( dTab.Rows[0]["height"]) ; + panelWidth = wallWidth ; } return panelWidth ; diff --git a/IntegrationEgaltech/Properties/AssemblyInfo.cs b/IntegrationEgaltech/Properties/AssemblyInfo.cs index 551740e..e0cea07 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.3.4.2")] -[assembly: AssemblyFileVersion("2.3.4.2")] +[assembly: AssemblyVersion("2.3.4.3")] +[assembly: AssemblyFileVersion("2.3.4.3")]