diff --git a/IntegrationEgaltech/BTL.cs b/IntegrationEgaltech/BTL.cs index 3db5e67..9177ee6 100644 --- a/IntegrationEgaltech/BTL.cs +++ b/IntegrationEgaltech/BTL.cs @@ -157,7 +157,7 @@ namespace ib.essetre.integration.egaltech string[] arrParam = sag1.Split(new string[] { "POLY([", "),", ")],'P','O')" }, StringSplitOptions.RemoveEmptyEntries); // Se il parametro Q10 è 1, l'ordine dell'array viene invertito - if ( singleFeature.processParameters[37].Equals(1)) + if ( singleFeature.processParameters[35] == "1") Array.Reverse( arrParam) ; int count = 0; // Nel caso in cui ci troviamo alla fine di un Arco questa viene incrementata di 1, in modo da scrivere il numero parametro corretto nei seguenti cicli diff --git a/IntegrationEgaltech/Generator.cs b/IntegrationEgaltech/Generator.cs index d2e98d9..7d13cc3 100644 --- a/IntegrationEgaltech/Generator.cs +++ b/IntegrationEgaltech/Generator.cs @@ -47,33 +47,34 @@ namespace ib.essetre.integration.egaltech BTL btlObject = new BTL() ; - String sqlProduction = "SELECT vw_Task.productionId, " + - "vw_Task.patternId, vw_Task.cutId ,taskId, info1, info2, enabled, level, " + - "inTools,outTools,isChecked,vw_Task.done,isoType,ax,ay,az, vw_Cut.x, vw_Cut.y, vw_Cut.z, " + - "vw_Task.flagDeleted, [group], [key], face, edge, des, p01, p02, p03, p04, p05, p06, " + - "p07, p08, p09, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, " + - "p26, q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q14, q15, q16, q17, " + - "q18, q19, q20, priority, processIdent, processingQuality, sag1, projectId, elementId, cutStart, cutEnd, " + - "inverted, rotated, doneTime, startAngle, endAngle, referenceCutId, length, width, height " + - "FROM ESSETRE.dbo.vw_Task " + - "INNER JOIN vw_Cut ON " + - "(vw_Task.cutId = vw_Cut.cutId AND vw_Task.patternId = vw_Cut.patternId AND vw_Task.productionId = vw_Cut.productionId) " + - "WHERE vw_Task.patternId = " + (Int32)parameters.Patterns[i].PatternId + - " and vw_Task.productionId = " + (Int32)parameters.Patterns[i].ProductionId; + String sqlProduction = + "SELECT vw_Task.productionId, " + + "vw_Task.patternId, vw_Task.cutId ,taskId, info1, info2, enabled, level, " + + "inTools,outTools,isChecked,vw_Task.done,isoType,ax,ay,az, vw_Cut.x, vw_Cut.y, vw_Cut.z, " + + "vw_Task.flagDeleted, [group], [key], face, edge, des, " + + "p01, p02, p03, p04, p05, p06, p07, p08, p09, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, " + + "q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, " + + "priority, processIdent, processingQuality, sag1, projectId, elementId, cutStart, cutEnd, " + + "inverted, rotated, doneTime, startAngle, endAngle, referenceCutId, length, width, height " + + "FROM ESSETRE.dbo.vw_Task " + + "INNER JOIN vw_Cut ON " + + "(vw_Task.cutId = vw_Cut.cutId AND vw_Task.patternId = vw_Cut.patternId AND vw_Task.productionId = vw_Cut.productionId) " + + "WHERE vw_Task.patternId = " + (Int32)parameters.Patterns[i].PatternId + + " and vw_Task.productionId = " + (Int32)parameters.Patterns[i].ProductionId; - String sqlProject = "SELECT vw_Process.projectId, " + - "vw_Process.elementId, cutId, processId, info1, info2, enabled, level, " + - "inTools, outTools, isChecked, vw_Process.done, isoType, ax, ay, az, vw_Process.x, vw_Process.y, vw_Process.z, " + - "vw_Process.flagDeleted, vw_Process.[group], [key], face, edge, des, p01, p02, p03, p04, p05, p06, " + - "p07, p08, p09, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, " + - "p26, q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q14, q15, q16, q17, " + - "q18, q19, q20, priority, processIdent, processingQuality, sag1, productionId, patternId, cutId, cutStart, cutEnd, " + - "inverted, rotated, doneTime, startAngle, endAngle, referenceCutId, vw_Cut.length, vw_Cut.width, vw_Cut.height " + - "FROM ESSETRE.dbo.vw_Process " + - "INNER JOIN vw_Cut ON " + - "(vw_Cut.projectId = vw_Process.projectId AND vw_Cut.elementId = vw_Process.elementId) " + - "WHERE vw_Process.projectId = " + (Int32)parameters.Patterns[i].ProjectId + - " and vw_Process.elementId = " + (Int32)parameters.Patterns[i].ElementId; + String sqlProject = + "SELECT P.projectId, " + + "P.elementId, 0 cutId, processId, info1, info2, enabled, level, " + + "inTools, outTools, isChecked, P.done, isoType, ax, ay, az, P.x, P.y, P.z, " + + "P.flagDeleted, P.[group], [key], face, edge, des, " + + "p01, p02, p03, p04, p05, p06, p07, p08, p09, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, " + + "q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, " + + "priority, processIdent, processingQuality, sag1, P.projectId, P.elementId, P.processId, 10 cutStart,0 cutEnd, " + + "E.inverted, E.rotated, 0 doneTime, 0 startAngle, 0 endAngle, -1 referenceCutId, E.length, E.width, E.height " + + "FROM dbo.vw_Process P " + + "INNER JOIN dbo.vw_Element E ON P.projectId=E.projectId and P.elementId=E.elementId " + + "WHERE P.projectId = " + (Int32)parameters.Patterns[i].ProjectId + + " and E.elementId = " + (Int32)parameters.Patterns[i].ElementId ; string sql = null ; @@ -101,6 +102,8 @@ namespace ib.essetre.integration.egaltech ds.Tables.Add( tempDs.Tables[0].Copy()) ; + cn.Close() ; + // Verifica parametro isFromProject: nel caso Ordine viene ottenuta la lista dei Process, // nel caso Produzione viene ottenuta la lista dei Task if ( parameters.Patterns[i].IsFromProject) @@ -171,36 +174,41 @@ namespace ib.essetre.integration.egaltech if ( File.Exists( CncPath)) { string lines = System.IO.File.ReadAllText( CncPath) ; parameters.Patterns[i].Iso = lines ; + parameters.Patterns[i].Result = PatternInfo.Results.OK ; + parameters.Patterns[i].DetailResult = PatternInfo.DetailResults.ALL_OK ; } - else + else { parameters.Patterns[i].Iso = "" ; + parameters.Patterns[i].Result = PatternInfo.Results.ERROR ; + parameters.Patterns[i].DetailResult = PatternInfo.DetailResults.ALL_KO ; + } ////imposta le modifiche ////solo se parameters.Patterns[i].Transformable //parameters.Patterns[i].AddCutChange(2, "inverted", 180); //parameters.Patterns[i].AddPatternChange("StartX", 20); - //public enum Results - //{ - // NONE = 0, - // OK = 1, - // ERROR = 2 - //} + //public enum Results + //{ + // NONE = 0, + // OK = 1, + // ERROR = 2 + //} - ////fattibile o non fattibile - ////parameters.Patterns[i].Iso;=.... //stringa iso - ////parameters.Patterns[i].OutputFilename; //nome file da generare - ////parameters.Patterns[i].SetTaskState(cutId, taskId, value, message); //Cutid del db - //parameters.Patterns[i].Result = PatternInfo.Results.OK; - //parameters.Patterns[i].Message = ""; //eventuale errore messaggio - // } + ////fattibile o non fattibile + ////parameters.Patterns[i].Iso;=.... //stringa iso + ////parameters.Patterns[i].OutputFilename; //nome file da generare + ////parameters.Patterns[i].SetTaskState(cutId, taskId, value, message); //Cutid del db + //parameters.Patterns[i].Result = PatternInfo.Results.OK; + //parameters.Patterns[i].Message = ""; //eventuale errore messaggio + // } - //esempio di apertura db, usare solo le viste (iniziano per vw_) - // chiavi - //parameters.Patterns(0).ProductionId + //esempio di apertura db, usare solo le viste (iniziano per vw_) + // chiavi + //parameters.Patterns(0).ProductionId - //cn.Close(); - //} + //cn.Close(); + //} } } @@ -356,15 +364,15 @@ namespace ib.essetre.integration.egaltech btlObject.projectId = (int)ds.Tables[i].Rows[0]["projectId"]; btlObject.elementId = (int)ds.Tables[i].Rows[0]["elementId"]; - List ListaCutParts = getListaCutIdO( (int)ds.Tables[i].Rows[0]["elementId"], - (int)ds.Tables[i].Rows[0]["projectId"]); + List ListaCutParts = new List( 1) ; + ListaCutParts.Add( (int)ds.Tables[i].Rows[0]["elementId"]) ; for ( int c = 0; c < ListaCutParts.Count; c++) { BTL.Part readPart = new BTL.Part(); for ( int ltc = 0; ltc < listaProcessesCount; ltc++) { - if ( (int)ds.Tables[i].Rows[ltc]["cutId"] == ListaCutParts[c]) { - readPart.singleMemberNumber = ds.Tables[i].Rows[ltc]["ElementId"].ToString(); + if ( (int)ds.Tables[i].Rows[ltc]["elementId"] == ListaCutParts[c]) { + readPart.singleMemberNumber = ds.Tables[i].Rows[ltc]["elementId"].ToString(); readPart.count = Convert.ToString(1); readPart.length = ds.Tables[i].Rows[ltc]["length"].ToString(); readPart.height = ds.Tables[i].Rows[ltc]["height"].ToString(); @@ -372,13 +380,13 @@ namespace ib.essetre.integration.egaltech readPart.x = (double)ds.Tables[i].Rows[ltc]["x"]; readPart.inverted = ds.Tables[i].Rows[ltc]["inverted"].ToString(); readPart.rotated = ds.Tables[i].Rows[ltc]["rotated"].ToString(); - readPart.cutId = (int)ds.Tables[i].Rows[ltc]["cutId"]; //In realtà i Process non hanno il cutId, se non virtuale + readPart.elementId = (int)ds.Tables[i].Rows[ltc]["elementId"]; } readPart.features = new List(); for ( int f = 0; f < listaProcessesCount; f++) { - if ( (int)ds.Tables[i].Rows[f]["cutId"] == ListaCutParts[c]) { + if ( (int)ds.Tables[i].Rows[f]["elementId"] == ListaCutParts[c]) { BTL.Feature readFeature = new BTL.Feature() ; readFeature.processId = ds.Tables[i].Rows[f]["processId"].ToString(); diff --git a/IntegrationEgaltech/Properties/AssemblyInfo.cs b/IntegrationEgaltech/Properties/AssemblyInfo.cs index 2d829fc..7286617 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.2.2")] -[assembly: AssemblyFileVersion("2.1.2.2")] +[assembly: AssemblyVersion("2.1.2.3")] +[assembly: AssemblyFileVersion("2.1.2.3")]