diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index 2821582c..18616153 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -254,11 +254,21 @@ namespace VEPROMS } this.Cursor = Cursors.Default; } - + // B2018-002 - Invalid Transitions - Define Transition Refresh Statistics + private int numTransProcessed = 0; + private int numTransFixed = 0; + private int numTransConverted = 0; + // B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics + private void ResetTransNumbers() + { + numTransProcessed = 0; + numTransFixed = 0; + numTransConverted = 0; + } private void RefreshTransitions() { - int numTransProcessed = 0; - int numTransFixed = 0; + // B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics + ResetTransNumbers(); this.Cursor = Cursors.WaitCursor; List pil = new List(); foreach (TreeNode tn in myProcedures.Keys) @@ -296,16 +306,16 @@ namespace VEPROMS else { myFixes = new StringBuilder(); - myFixesCount = 0; - int lastFixedCount = myFixesCount; RefreshProcedureTransitions(pq); + // B2018-002 - Invalid Transitions - Update Transition Refresh Statistics + numTransConverted += ProcedureInfo.TranConvertCount; numTransProcessed += ProcedureInfo.TranCheckCount; - numTransFixed += ProcedureInfo.TranFixCount = myFixesCount - lastFixedCount; + numTransFixed += ProcedureInfo.TranFixCount; pbProcess.PerformStep(); Application.DoEvents(); } } - if (numTransFixed == 0) + if (numTransFixed == 0 && numTransConverted ==0) { txtResults.AppendText("No Transitions Needed Updated."); txtResults.AppendText(Environment.NewLine); @@ -316,7 +326,12 @@ namespace VEPROMS txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(string.Format("Transitions Checked: {0}",numTransProcessed)); txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(string.Format("Transitions Fixed: {0}",numTransFixed)); + // B2018-002 - Invalid Transitions - Display Transition Refresh Statistics + txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}",numTransProcessed - (numTransConverted + numTransFixed))); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(string.Format("Transitions Modified: {0}", numTransFixed)); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(string.Format("Transitions Converted to text: {0}", numTransConverted)); Application.DoEvents(); if (pil.Count > 0) { @@ -340,10 +355,11 @@ namespace VEPROMS } } this.Cursor = Cursors.Default; - if (numTransFixed == 0) - MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions needed fixed.",numTransProcessed), "Refresh Transitions Completed"); + // B2018-002 - Invalid Transitions - Display Transition Refresh Statisitic + if (numTransFixed == 0 && numTransConverted ==0) + MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.",numTransProcessed), "Refresh Transitions Completed"); else - MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Transitions needed fixed.", numTransProcessed, numTransFixed), "Refresh Transitions Completed"); + MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted),numTransFixed, numTransConverted), "Refresh Transitions Completed"); } // C2017-030 - new Admin Tools user interface @@ -760,11 +776,12 @@ namespace VEPROMS private void RefreshProcedureTransitions(ProcedureInfo pq) { DateTime start = DateTime.Now; - int lastFixesCount = myFixesCount; ProcedureInfo.ResetTranCounters(); ProcedureInfo.RefreshTransitions(pq);//, transitionsToDisconnected, transitionsToNonEditable); TimeSpan ts = DateTime.Now - start; - txtProcess.AppendText(string.Format("Procedure: {1}{0}Checked {2} Transitions{0}Fixed {3} Transitions{0}Elapsed Seconds:{4}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount,myFixesCount - lastFixesCount, ts.TotalSeconds)); + // B2018-002 - Invalid Transitions - Display Transition Refresh Statistics + txtProcess.AppendText(string.Format("Procedure: {1}{0}Checked {2} Transitions{0}Fixed {3} Transitions{0}Converted to Text {4} Transitions{0}Elapsed Seconds:{5}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ts.TotalSeconds)); + //Console.WriteLine("\"{0}\"\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}", pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ts.TotalSeconds, numTransProcessed, numTransFixed, numTransConverted); if (myFixes.Length > 0) { txtResults.AppendText(myFixes.ToString()); @@ -814,9 +831,11 @@ namespace VEPROMS StringBuilder myFixes; int myFixesCount = 0; + int myConvertCount = 0; // show the changes made in the Results pannel, include the ItemId of the step element void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args) { + if (args.Type == "TX") { myFixesCount++; @@ -827,10 +846,14 @@ namespace VEPROMS } else if (args.Type == "RO") { - txtResults.AppendText(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue,(sender as ItemInfo).ItemID)); + txtResults.AppendText(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID)); Application.DoEvents(); //myFixes.AppendLine(string.Format("Fixed Referenced Object for {1}{0}Old Text: {2}{0}New Text: {3}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue)); } + else // B2018-002 - Invalid Transitions - Display Transition Cconversion Statistics + { + myFixes.AppendLine(string.Format("Converted Transition to text for {0}({1})", (sender as ItemInfo).ShortPath, (sender as ItemInfo).ItemID)); + } } private void btnClear_Click(object sender, EventArgs e)