minor fix rilettura file CmsGeneralStatus (x try/catch in caso di file mancante...)

This commit is contained in:
Samuele E. Locatelli
2017-03-24 10:57:10 +01:00
parent 9f6d8725ea
commit 0eecabad0d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -241,7 +241,7 @@ namespace MTC_Adapter
// check COD_S
bitNum = 1;
gestStrobeCodMST(bitNum, ref retACK_DW1, 11, MemBlock, "S");
// check COD_T
bitNum = 2;
gestStrobeCodMST(bitNum, ref retACK_DW1, 17, MemBlock, "T");
@@ -439,11 +439,11 @@ namespace MTC_Adapter
// da rivedere: se sono N+1 file (N=path + generale) deve essere ad esempio nomeComune_*.mtc --> ciclo per leggerne N
string fileName = string.Format(@"{0}\{1}", utils.dataDir, utils.CRS("GeneralStatusFilePath"));
string linea;
totRighe = File.ReadLines(fileName).Count();
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
generalStatus = new Dictionary<string, string>();
try
{
totRighe = File.ReadLines(fileName).Count();
// carica da file...
System.IO.StreamReader file = new System.IO.StreamReader(fileName);
if (file != null)
+1 -1
View File
@@ -552,11 +552,11 @@ namespace MTC_Adapter
// da rivedere: se sono N+1 file (N=path + generale) deve essere ad esempio nomeComune_*.mtc --> ciclo per leggerne N
string fileName = string.Format(@"{0}\{1}", utils.dataDir, utils.CRS("GeneralStatusFilePath"));
string linea;
totRighe = File.ReadLines(fileName).Count();
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
generalStatus = new Dictionary<string, string>();
try
{
totRighe = File.ReadLines(fileName).Count();
// carica da file...
System.IO.StreamReader file = new System.IO.StreamReader(fileName);
if (file != null)