Integration 3.1a1 :
- aggiunta gestione PARTOFFSET.
This commit is contained in:
@@ -107,7 +107,18 @@ namespace ib.essetre.integration.egaltech
|
||||
double wid = Convert.ToDouble( singlePart.width) * Math.Pow( 10, Constants.scaleUnit) ;
|
||||
int intWid = Convert.ToInt32( wid) ;
|
||||
tw.WriteLine( Constants.WIDTH + intWid.ToString( "D8")) ;
|
||||
|
||||
|
||||
if (singlePart.Offsets[0] != "0" || singlePart.Offsets[1] != "0" ||
|
||||
singlePart.Offsets[2] != "0" || singlePart.Offsets[3] != "0" || singlePart.Offsets[4] != "0") {
|
||||
tw.Write(Constants.PARTOFFSET);
|
||||
tw.Write(" P04:" + MultAndConvertTo8(singlePart.Offsets[0]));
|
||||
tw.Write(" P11:" + MultAndConvertTo8(singlePart.Offsets[1]));
|
||||
tw.Write(" P12:" + MultAndConvertTo8(singlePart.Offsets[2]));
|
||||
tw.Write(" P13:" + MultAndConvertTo8(singlePart.Offsets[3]));
|
||||
tw.Write(" P14:" + MultAndConvertTo8(singlePart.Offsets[4]));
|
||||
tw.WriteLine("");
|
||||
}
|
||||
|
||||
string posX = singlePart.x.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ;
|
||||
tw.WriteLine( Constants.USERATTRIBUTE + "\"POSX\":" + "\"" + posX + "\"") ;
|
||||
|
||||
@@ -647,6 +658,7 @@ namespace ib.essetre.integration.egaltech
|
||||
public string height ;
|
||||
public string width ;
|
||||
public string Material ;
|
||||
public List<string> Offsets ;
|
||||
public string Type ;
|
||||
public List<Feature> features ;
|
||||
public double x ;
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace ib.essetre.integration.egaltech
|
||||
public const string LENGTH = "LENGTH: " ;
|
||||
public const string HEIGHT = "HEIGHT: " ;
|
||||
public const string WIDTH = "WIDTH: " ;
|
||||
public const string PARTOFFSET = "PARTOFFSET: " ;
|
||||
public const string OUTLINE_KEY = "OUTLINE: ";
|
||||
public const string APERTURE_KEY = "APERTURE: ";
|
||||
public const string SIDE = "SIDE: ";
|
||||
|
||||
@@ -611,6 +611,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.Offsets = GetElementOffsets((int)dRowF["elementId"], (int)dRowF["projectId"]);
|
||||
readPart.Type = GetElementType( (int)dRowF["elementId"], (int)dRowF["projectId"]) ;
|
||||
readPart.count = "1" ;
|
||||
readPart.length = dRowF["length"].ToString() ;
|
||||
@@ -764,6 +765,7 @@ 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.Offsets = GetElementOffsets((int)dRowF["elementId"], (int)dRowF["projectId"]);
|
||||
readPart.Type = GetElementType( (int)dRow0["elementId"], (int)dRow0["projectId"]) ;
|
||||
readPart.count = "1" ;
|
||||
readPart.length = dRowF["length"].ToString() ;
|
||||
@@ -971,6 +973,46 @@ namespace ib.essetre.integration.egaltech
|
||||
|
||||
return Mat ;
|
||||
}
|
||||
private static List<string> GetElementOffsets(int ElementId, int ProjectId)
|
||||
{
|
||||
List<string> Offsets = new List<string>{ "0", "0", "0", "0", "0"} ;
|
||||
|
||||
string sqlElementMat = "SELECT name, value " +
|
||||
"FROM dbo.vw_ElementParam " +
|
||||
"WHERE elementId = @firstId " +
|
||||
"AND projectId = @secondId " +
|
||||
"AND name like 'PARTOFFSET_%' ";
|
||||
|
||||
// Connessione al DB ed esecuzione query
|
||||
using (SqlConnection cn = new SqlConnection(_SqlConnectionStr))
|
||||
{
|
||||
cn.Open() ;
|
||||
using (SqlCommand sqlCommand = new SqlCommand(sqlElementMat, 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()) {
|
||||
string sName = Convert.ToString(reader["name"]);
|
||||
string sVal = Convert.ToString(reader["value"]);
|
||||
if ( sName == "PARTOFFSET_P04")
|
||||
Offsets[0] = sVal ;
|
||||
else if (sName == "PARTOFFSET_P11")
|
||||
Offsets[1] = sVal ;
|
||||
else if (sName == "PARTOFFSET_P12")
|
||||
Offsets[2] = sVal ;
|
||||
else if (sName == "PARTOFFSET_P13")
|
||||
Offsets[3] = sVal ;
|
||||
else if (sName == "PARTOFFSET_P14")
|
||||
Offsets[4] = sVal ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Offsets ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
// Recupera la lunghezza della barra nel caso Produzione (colonna "l")
|
||||
|
||||
@@ -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.7.7.1")]
|
||||
[assembly: AssemblyFileVersion("2.7.7.1")]
|
||||
[assembly: AssemblyVersion("3.1.1.1")]
|
||||
[assembly: AssemblyFileVersion("3.1.1.1")]
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user