creato metodo bonifica charatteri charArray FANUC
This commit is contained in:
+3
-6
@@ -243,18 +243,15 @@ namespace IOB_WIN
|
||||
CncLib.Focas1.ODBEXEPRG answ = FANUC_ref.getPrgName();
|
||||
try
|
||||
{
|
||||
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);
|
||||
// nome prg bonificato!
|
||||
string nome = utils.purgedChar2String(answ.name);
|
||||
//string nome = new string(answ.name.Where(c => char.IsLetter(c) || char.IsDigit(c)).ToArray());
|
||||
prgName = string.Format("{0}|{1}", answ.o_num, nome);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error(exc, "Errore in getPrgName");
|
||||
}
|
||||
// pulisco il valore...
|
||||
prgName = prgName.Replace('\n', ' ').Replace('\r', ' ').Trim();
|
||||
return prgName;
|
||||
}
|
||||
|
||||
|
||||
@@ -1410,7 +1410,7 @@ namespace IOB_WIN
|
||||
public void accodaUrlData(string newLine)
|
||||
{
|
||||
// inserisco in cima allo stack, trimmo e aggiorno display
|
||||
parentForm.dataMonitor_2 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_2), true);
|
||||
parentForm.dataMonitor_2 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_2), false);
|
||||
}
|
||||
/// <summary>
|
||||
/// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA
|
||||
@@ -1419,7 +1419,7 @@ namespace IOB_WIN
|
||||
public void accodaOtherData(string newLine)
|
||||
{
|
||||
// inserisco in cima allo stack, trimmo e aggiorno display
|
||||
parentForm.dataMonitor_3 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_3), true);
|
||||
parentForm.dataMonitor_3 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_3), false);
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua un trim della stringa al numero max di linee da mostrare a video
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace IOB_WIN
|
||||
@@ -104,5 +105,15 @@ namespace IOB_WIN
|
||||
return string.Format(@"{0}\SteamWare.ico", utils.resxDir);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// COnverte un array di caratteri in una stringa valida (ovvero SOLO numeri/lettere)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public static string purgedChar2String(char[] input)
|
||||
{
|
||||
string answ = new string(input.Where(c => char.IsLetter(c) || char.IsDigit(c)).ToArray());
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user