ancora una modifica x debug progName con char invalidi

This commit is contained in:
Samuele E. Locatelli
2017-10-26 10:43:04 +02:00
parent d4c049e523
commit 378575a83a
2 changed files with 8 additions and 5 deletions
+7 -4
View File
@@ -243,15 +243,18 @@ namespace IOB_WIN
CncLib.Focas1.ODBEXEPRG answ = FANUC_ref.getPrgName();
try
{
string nome = new string(answ.name);
prgName= string.Format("{0}|{1}", answ.o_num, nome);
lg.Info(answ.ToString());
//string nome = string.Join("_",answ.name);
string nome = new string(answ.name.Where(c => char.IsLetter(c) || char.IsDigit(c)).ToArray());
//string nome = new string(answ.name);
prgName = string.Format("{0}|{1}", answ.o_num, nome);
}
catch(Exception exc)
catch (Exception exc)
{
lg.Error(exc, "Errore in getPrgName");
}
// pulisco il valore...
prgName= prgName.Replace('\n', ' ').Replace('\r', ' ').Trim();
prgName = prgName.Replace('\n', ' ').Replace('\r', ' ').Trim();
return prgName;
}
+1 -1
View File
@@ -869,7 +869,7 @@ namespace IOB_WIN
// decodifica valore!
string[] valori = qDecodeIN(queueVal);
// aggiungo macchina e valore...
answ += string.Format(@"{0}?flux={1}&valore={2}", currIobConf.codIOB, valori[1], valori[2]);
answ += string.Format(@"{0}?flux={1}&&valore={2}", currIobConf.codIOB, valori[1], valori[2]);
// aggiondo dataOra evento e corrente + contatore...
answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[3]);
return answ;