From 4b85e596da3940682b75ad4b28bb02166bcfe1c1 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 20 Dec 2019 15:08:14 +0000 Subject: [PATCH] Integration : - aggiunta gestione file dati ausiliari btm (per ora contiene solo LOAD90). --- IntegrationEgaltech/BTL.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/IntegrationEgaltech/BTL.cs b/IntegrationEgaltech/BTL.cs index 0f2cf1f..a158692 100644 --- a/IntegrationEgaltech/BTL.cs +++ b/IntegrationEgaltech/BTL.cs @@ -28,11 +28,11 @@ namespace ib.essetre.integration.egaltech public BTL() {} - public bool WriteIntoFile( string filePath, bool IsFromProject) + public bool WriteIntoFile( string BtlPath, bool IsFromProject) { // Se un file txt (contenente messaggio di errore) con lo stesso nome esiste già viene cancellato - if ( File.Exists( Path.ChangeExtension( filePath, ".txt"))) - File.Delete( Path.ChangeExtension( filePath, ".txt")) ; + if ( File.Exists( Path.ChangeExtension( BtlPath, ".txt"))) + File.Delete( Path.ChangeExtension( BtlPath, ".txt")) ; // Se non esistono pezzi, non faccio alcunché if ( parts == null) @@ -42,7 +42,7 @@ namespace ib.essetre.integration.egaltech _FcEnt = Constants.FcBaseId ; // Il seguente blocco 'using' si occupa della scrittura del file di testo, poi salvato in .btl - using ( var tw = new StreamWriter( filePath, false)) { + using ( var tw = new StreamWriter( BtlPath, false)) { tw.WriteLine( Constants.VERSION) ; tw.WriteLine( Constants.BUILD) ; @@ -52,7 +52,6 @@ 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 + "\"LOAD90\":" + "\"" + barLoad90 + "\"") ; foreach ( Part singlePart in parts) { tw.WriteLine( Constants.PART) ; @@ -118,6 +117,13 @@ namespace ib.essetre.integration.egaltech } } } + + // Scrittura file ausiliario con dati che non fanno ricalcolare le lavorazioni + using ( var tw = new StreamWriter( Path.ChangeExtension( BtlPath, ".btm"), false)) { + tw.WriteLine( "[AuxData]") ; + tw.WriteLine( "LOAD90=" + barLoad90) ; + } + return true ; }