Integration :

- aggiunta gestione file dati ausiliari btm (per ora contiene solo LOAD90).
This commit is contained in:
Dario Sassi
2019-12-20 15:08:14 +00:00
parent 3a20d1f2a7
commit 4b85e596da
+11 -5
View File
@@ -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 ;
}