From b022ed7a17548c6aebd76d219e3931785b62001f Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 26 Oct 2017 10:55:32 +0200 Subject: [PATCH] bonifica commenti... --- IOB-WIN/IobGeneric.cs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index c4b77fa7..b54380d8 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -1392,7 +1392,7 @@ namespace IOB_WIN public void accodaRawData(string newLine) { // inserisco in cima allo stack, trimmo e aggiorno display - parentForm.dataMonitor_0 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_0), false); + parentForm.dataMonitor_0 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_0)); } /// /// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA @@ -1401,7 +1401,7 @@ namespace IOB_WIN public void accodaSignaInlData(string newLine) { // inserisco in cima allo stack, trimmo e aggiorno display - parentForm.dataMonitor_1 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_1), false); + parentForm.dataMonitor_1 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_1)); } /// /// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA @@ -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), false); + parentForm.dataMonitor_2 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_2)); } /// /// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA @@ -1419,26 +1419,21 @@ 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), false); + parentForm.dataMonitor_3 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_3)); } /// /// Effettua un trim della stringa al numero max di linee da mostrare a video /// /// /// - private string limitLine2show(string newString, bool showLog) + private string limitLine2show(string newString) { // se num righe superiore a limite trimmo... - if (newString.Split('\r').Length > parentForm.nLine2show) + if (newString.Split('\n').Length > parentForm.nLine2show) { - // loggo cosa ho adesso... - if (showLog) lg.Info("ACTUAL STRING{0}----------------------------------------{0}{1}{0}----------------------------------------", Environment.NewLine, newString); - int idx = newString.LastIndexOf('\r'); - if (showLog) lg.Info("Index Found: {0} | TOT-LEN:{1}", idx, newString.Length); - //int idx = newString.LastIndexOf(Environment.NewLine); + //int idx = newString.LastIndexOf('\r'); + int idx = newString.LastIndexOf(Environment.NewLine); newString = newString.Substring(0, idx); - if (showLog) lg.Info("TRIMMED STRING{0}----------------------------------------{0}{1}{0}----------------------------------------", Environment.NewLine, newString); - if (showLog) lg.Info("NEW-LEN:{0}", newString.Length); } return newString; }