diff --git a/IntegrationEgaltech/BTL.cs b/IntegrationEgaltech/BTL.cs index 804c8ea..30dd9b4 100644 --- a/IntegrationEgaltech/BTL.cs +++ b/IntegrationEgaltech/BTL.cs @@ -14,6 +14,8 @@ namespace ib.essetre.integration.egaltech { public string projectNumber ; public string barLength ; + public string panelLength ; + public string panelWidth ; public string barLoad90 ; public List parts ; // I seguenti Id servono per il nome del file BTL @@ -52,6 +54,8 @@ namespace ib.essetre.integration.egaltech tw.WriteLine( Constants.USERATTRIBUTE + "\"PRODID\":" + "\"" + ( IsFromProject ? 0 : productionId) + "\"") ; tw.WriteLine( Constants.USERATTRIBUTE + "\"PATTID\":" + "\"" + ( IsFromProject ? 0 : patternId) + "\"") ; tw.WriteLine( Constants.USERATTRIBUTE + "\"BARLEN\":" + "\"" + barLength + "\"") ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"PANELLEN\":" + "\"" + panelLength + "\"") ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"PANELWIDTH\":" + "\"" + panelWidth + "\"") ; foreach ( Part singlePart in parts) { tw.WriteLine( Constants.PART) ; @@ -73,6 +77,9 @@ namespace ib.essetre.integration.egaltech string posX = singlePart.x.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; tw.WriteLine( Constants.USERATTRIBUTE + "\"POSX\":" + "\"" + posX + "\"") ; + string posZ = singlePart.z.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"POSZ\":" + "\"" + posZ + "\"") ; + string inv = singlePart.inverted.ToString() ; tw.WriteLine( Constants.USERATTRIBUTE + "\"INVERTED\":" + "\"" + inv + "\"") ; @@ -445,6 +452,7 @@ namespace ib.essetre.integration.egaltech public string width ; public List features ; public double x ; + public double z ; public string inverted ; public string rotated ; public int elementId ; diff --git a/IntegrationEgaltech/Constants.cs b/IntegrationEgaltech/Constants.cs index 4d6c271..a1e8940 100644 --- a/IntegrationEgaltech/Constants.cs +++ b/IntegrationEgaltech/Constants.cs @@ -40,9 +40,12 @@ namespace ib.essetre.integration.egaltech public const double BarMaxLenForAdd = 2000 ; public const double BarAddLen = 2000 ; - // Sovramateriale di testa per pezzi singoli di Vista + // Sovramateriale di testa per travi singole di Vista public const double HeadOverMat = 10 ; + // Sovramateriale per pareti singole di Vista + public const double PanelOverMat = 10 ; + // Id base per punti di contorni liberi public const int FcBaseId = 10000 ; } diff --git a/IntegrationEgaltech/Generator.cs b/IntegrationEgaltech/Generator.cs index 19872f5..8485093 100644 --- a/IntegrationEgaltech/Generator.cs +++ b/IntegrationEgaltech/Generator.cs @@ -511,6 +511,8 @@ namespace ib.essetre.integration.egaltech btlObject.projectNumber = dRow0["projectId"].ToString() ; btlObject.barLength = GetBarLengthP( (int)dRow0["patternId"], (int)dRow0["productionId"]).ToString( "F3", CultureInfo.InvariantCulture) ; btlObject.barLoad90 = GetBarLoad90P( (int)dRow0["patternId"], (int)dRow0["productionId"]).ToString( CultureInfo.InvariantCulture) ; + btlObject.panelLength = GetBarLengthP( (int)dRow0["patternId"], (int)dRow0["productionId"]).ToString( "F3", CultureInfo.InvariantCulture) ; + btlObject.panelWidth = GetBarWidthP( (int)dRow0["patternId"], (int)dRow0["productionId"]).ToString( "F3", CultureInfo.InvariantCulture) ; btlObject.productionId = (int)dRow0["productionId"] ; btlObject.patternId = (int)dRow0["patternId"] ; btlObject.parts = new List() ; @@ -535,6 +537,7 @@ namespace ib.essetre.integration.egaltech readPart.height = dRowF["height"].ToString() ; readPart.width = dRowF["width"].ToString() ; readPart.x = (double)dRowF["x"] ; + readPart.z = (double)dRowF["z"] ; readPart.inverted = dRowF["inverted"].ToString() ; readPart.rotated = dRowF["rotated"].ToString() ; readPart.cutId = (int)dRowF["cutId"] ; @@ -647,6 +650,8 @@ namespace ib.essetre.integration.egaltech btlObject.projectNumber = dRow0["projectId"].ToString() ; 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) ; btlObject.projectId = (int)dRow0["projectId"] ; btlObject.elementId = (int)dRow0["elementId"] ; btlObject.parts = new List() ; @@ -672,6 +677,7 @@ namespace ib.essetre.integration.egaltech readPart.height = dRowF["height"].ToString() ; readPart.width = dRowF["width"].ToString() ; readPart.x = Constants.HeadOverMat ; + readPart.z = Constants.HeadOverMat ; readPart.inverted = dRowF["inverted"].ToString() ; readPart.rotated = dRowF["rotated"].ToString() ; readPart.elementId = (int)dRowF["elementId"] ; @@ -804,6 +810,35 @@ namespace ib.essetre.integration.egaltech return barLength ; } + //------------------------------------------------------------------------------------------------------------- + // Recupera la larghezza della barra nel caso Produzione (colonna "w") + private static double GetBarWidthP( int patternId, int productionId) + { + double barWidth = 0 ; + + string sqlBarWidth = "SELECT w " + + "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["w"]) ; + } + } + } + + return barWidth ; + } + //------------------------------------------------------------------------------------------------------------- // Recupera il flag di carico con rotazione di 90° nel caso Produzione (colonna "load90") private static int GetBarLoad90P( int patternId, int productionId) @@ -882,6 +917,40 @@ namespace ib.essetre.integration.egaltech return barLength ; } + //------------------------------------------------------------------------------------------------------------- + // Recupera la lunghezza del pannello nel caso Ordine (colonna "length", ovvero la lunghezza della singola parete) + // a cui aggiungiamo un valore fisso (es. 200) + private static double GetPanelLengthO( int elementId, int projectId) + { + double panelLength = 0 ; + + DataTable dTab = _ds.Tables[0] ; + int listaProcessesCount = dTab.Rows.Count ; + if ( listaProcessesCount > 0) { + double wallLength = Convert.ToDouble( dTab.Rows[0]["length"]) ; + panelLength = wallLength + 2 * Constants.PanelOverMat ; + } + + return panelLength ; + } + + //------------------------------------------------------------------------------------------------------------- + // Recupera la lunghezza del pannello nel caso Ordine (colonna "width", ovvero la larghezza della singola parete) + // a cui aggiungiamo un valore fisso (es. 200) + private static double GetPanelWidthO( 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]["width"]) ; + panelWidth = wallWidth + 2 * Constants.PanelOverMat ; + } + + return panelWidth ; + } + //------------------------------------------------------------------------------------------------------------- // Restituisce la path di esecuzione di EgtCam5 private static String GetExePath( InOutParameters parameters) diff --git a/IntegrationEgaltech/Properties/AssemblyInfo.cs b/IntegrationEgaltech/Properties/AssemblyInfo.cs index edd4c1f..3ca7bfc 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.2.6.1")] -[assembly: AssemblyFileVersion("2.2.6.1")] +[assembly: AssemblyVersion("2.2.6.2")] +[assembly: AssemblyFileVersion("2.2.6.2")]