Integration 2.3f4 :

- nel BTL si scrive anche il tipo del pezzo (___, ELEMENT, LAYER).
This commit is contained in:
DarioS
2021-06-25 15:37:25 +02:00
parent bda5f073e4
commit cdd44e0f3e
3 changed files with 37 additions and 3 deletions
+3
View File
@@ -87,6 +87,8 @@ namespace ib.essetre.integration.egaltech
string rot = singlePart.rotated.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ;
tw.WriteLine( Constants.USERATTRIBUTE + "\"ROTATED\":" + "\"" + rot + "\"") ;
tw.WriteLine( Constants.USERATTRIBUTE + "\"TYPE\":" + "\"" + singlePart.Type + "\"") ;
string CutId = ( IsFromProject ? singlePart.elementId : singlePart.cutId).ToString() ;
tw.WriteLine( Constants.USERATTRIBUTE + "\"CUTID\":" + "\"" + CutId + "\"") ;
@@ -480,6 +482,7 @@ namespace ib.essetre.integration.egaltech
public string height ;
public string width ;
public string Material ;
public string Type ;
public List<Feature> features ;
public double x ;
public double z ;
+32 -1
View File
@@ -588,6 +588,7 @@ namespace ib.essetre.integration.egaltech
if ( bFirst) {
readPart.singleMemberNumber = GetElementSN( (int)dRowF["elementId"], (int)dRowF["projectId"]) ;
readPart.Material = GetElementMaterial( (int)dRowF["elementId"], (int)dRowF["projectId"]) ;
readPart.Type = GetElementType( (int)dRowF["elementId"], (int)dRowF["projectId"]) ;
readPart.count = "1" ;
readPart.length = dRowF["length"].ToString() ;
readPart.height = dRowF["height"].ToString() ;
@@ -736,12 +737,13 @@ namespace ib.essetre.integration.egaltech
if ( bFirst) {
readPart.singleMemberNumber = GetElementSN( (int)dRow0["elementId"], (int)dRow0["projectId"]) ;
readPart.Material = GetElementMaterial( (int)dRow0["elementId"], (int)dRow0["projectId"]) ;
readPart.Type = GetElementType( (int)dRow0["elementId"], (int)dRow0["projectId"]) ;
readPart.count = "1" ;
readPart.length = dRowF["length"].ToString() ;
readPart.height = dRowF["height"].ToString() ;
readPart.width = dRowF["width"].ToString() ;
readPart.x = Constants.HeadOverMat ;
readPart.z = 0 ; // Constants.HeadOverMat ;
readPart.z = 0 ;
readPart.inverted = (double)dRowF["inverted"] ;
readPart.rotated = (double)dRowF["rotated"] ;
readPart.elementId = (int)dRowF["elementId"] ;
@@ -877,6 +879,35 @@ namespace ib.essetre.integration.egaltech
return SN ;
}
//-------------------------------------------------------------------------------------------------------------
// Recupera il Tipo dell'Elemento (colonna "Type")
private static string GetElementType( int ElementId, int ProjectId)
{
string Type = "" ;
string sqlElementSN = "SELECT Type " +
"FROM dbo.vw_Element " +
"WHERE elementId = @firstId " +
"AND projectId = @secondId" ;
// Connessione al DB ed esecuzione query
using ( SqlConnection cn = new SqlConnection( _SqlConnectionStr)) {
cn.Open() ;
using ( SqlCommand sqlCommand = new SqlCommand( sqlElementSN, cn)) {
sqlCommand.Parameters.Add( "@firstId", SqlDbType.Int) ;
sqlCommand.Parameters.Add( "@secondId", SqlDbType.Int) ;
sqlCommand.Parameters["@firstId"].Value = ElementId ;
sqlCommand.Parameters["@secondId"].Value = ProjectId ;
SqlDataReader reader = sqlCommand.ExecuteReader() ;
while ( reader.Read()) {
Type = Convert.ToString( reader["Type"]) ;
}
}
}
return Type ;
}
//-------------------------------------------------------------------------------------------------------------
// Recupera il materiale dell'Elemento (colonna "MATERIAL" di ElementParam)
private static string GetElementMaterial( int ElementId, int ProjectId)
@@ -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.6.3")]
[assembly: AssemblyFileVersion("2.3.6.3")]
[assembly: AssemblyVersion("2.3.6.4")]
[assembly: AssemblyFileVersion("2.3.6.4")]