From a54c2eaa09af8c28e57fcf168ac064f4381959c6 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 20 Feb 2015 17:39:13 +0000 Subject: [PATCH] Changed logic to find ROs or XY Plots. VEPROMS_BGE/OI-34 has the text <<<--Isolators-->>> which was being identified as an XY Plot and then as an RO. Add location information to the error log for RO Image problems Reduce duplicated error log messages for RO Value update --- .../Extension/DocumentExt.cs | 10 +++++----- .../Extension/ROFSTExt.cs | 20 +++++++++++++++---- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index ed41b796..78fa1929 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -1279,8 +1279,8 @@ namespace VEPROMS.CSLA.Library { if (roValue == null) { - sel.Text = "RO Not Found"; - sel.Font.Color = LBWdColor.wdColorRed; + //sel.Text = "RO Not Found"; + //sel.Font.Color = LBWdColor.wdColorRed; } else { @@ -1341,7 +1341,7 @@ namespace VEPROMS.CSLA.Library // - Dash // [!<> ]@ - 1 or more characters not including Less-Than, Greater-Than or Space // [>] - Greater-Than Character - find.Text = "[<][<]*[>][>]"; + find.Text = "[<][<]G*[>][>]"; //find.Wrap = LBWdFindWrap.wdFindStop; find.Wrap = LBWdFindWrap.wdFindContinue; find.MatchCase = false; @@ -1366,12 +1366,12 @@ namespace VEPROMS.CSLA.Library // If you do a search in MSWord, make sure wildcard box is checked and then press the // Special button to see the definitions of the various wildcards // [<] - Less-Than Character - // [!<> ]@ - 1 or more characters not including Less-Than, Greater-Than or Space + // [!<> -]@ - 1 or more characters not including Less-Than, Greater-Than, Dash or Space // - Dash // [!<>]@ - 1 or more characters not including Less-Than, Greater-Than. // a space be included as part of the accessory page id (Callaway, EOP Addendum 37) // [>] - Greater-Than Character - find.Text = "[<][!<> ]@-[!<>]@[>]"; + find.Text = "[<][!<> -]@-[!<>]@[>]"; find.Wrap = LBWdFindWrap.wdFindContinue; find.MatchCase = false; find.MatchWholeWord = false; diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 6b529f23..99c1ec78 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -881,12 +881,12 @@ namespace VEPROMS.CSLA.Library throw new DbCslaException("ROFstInfo.DataPortal_Fetch", ex); } } - public ROImageInfo GetROImageByFilename(string filename) + public ROImageInfo GetROImageByFilename(string filename, ItemInfo myItemInfo) { ROImageInfoList images = ROImageInfoList.GetByRODbIDFilename(RODbID, filename); if (images == null || images.Count == 0) { - _MyLog.WarnFormat("\r\nReferenced Object Image {0} Missing\r\nNeed to Update RO Values",filename); + ROWarning(myItemInfo,"Referenced Object Image {0} Missing", filename); return null; } ROImageInfo retval = null; @@ -896,11 +896,23 @@ namespace VEPROMS.CSLA.Library retval = image; } if(retval.DTS > DTS) - _MyLog.WarnFormat("\r\nReferenced Object Image {0} newer {1} than RO.FST {2}\r\nNeed to Update RO Values",filename,retval.DTS.ToShortDateString(),DTS.ToShortDateString()); + ROWarning(myItemInfo, "Referenced Object Image {0} newer {1} than RO.FST {2}", filename, retval.DTS.ToShortDateString(), DTS.ToShortDateString()); else - _MyLog.WarnFormat("Referenced Object Image {0} older {1} then RO.FST {2}\r\nNeed to Update RO Values",filename,retval.DTS.ToShortDateString(),DTS.ToShortDateString()); + ROWarning(myItemInfo, "Referenced Object Image {0} older {1} then RO.FST {2}", filename, retval.DTS.ToShortDateString(), DTS.ToShortDateString()); return retval; } + private static List DocVersionsNeedingROUpdate = new List(); + private static void ROWarning(ItemInfo myItemInfo, string format, params object[] args) + { + int key = 0; + if(myItemInfo.MyDocVersion != null) key = myItemInfo.MyDocVersion.VersionID; + if (!DocVersionsNeedingROUpdate.Contains(key)) + { + string prefix = string.Format("\r\nNeed to Update RO Values for {0}\r\nProcedure {1}\r\n" , myItemInfo.SearchDVPath ,myItemInfo.MyProcedure.DisplayNumber); + _MyLog.WarnFormat(prefix + format, args); + DocVersionsNeedingROUpdate.Add(key); + } + } } public class ROFstInfoROTableUpdateEventArgs {