diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 86328c45..8e7a49c3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -5419,6 +5419,14 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _CapRoIfLastLower, "@CapRoIfLastLower"); } } + private LazyLoad _CapSPIfLastLower; + public bool CapSPIfLastLower + { + get + { + return LazyLoad(ref _CapSPIfLastLower, "@CapSPIfLastLower"); + } + } private LazyLoad _UpRoIfPrevUpper; public bool UpRoIfPrevUpper { diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index 4d73045f..9aef9747 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -350,13 +350,14 @@ namespace Volian.Controls.Library System.Text.RegularExpressions.Group g = m.Groups[3]; string beforeRO = StaticStripRtfCommands(text.Substring(0, g.Index)); string afterRO = StaticStripRtfCommands(text.Substring(g.Index + g.Length)); - string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO); - newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh); Match myMatch = regRefObj.Match(m.ToString()); int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); int rodbid = int.Parse(myMatch.Groups[3].Value); ROFstInfo myROFst = _MyItemInfo.MyDocVersion.GetROFst(rodbid); - if (myROFst.IsSetpointDB(dbid)) newvalue = ReplaceSpaceWithHardspace(newvalue); + bool isSetpoint=myROFst.IsSetpointDB(dbid); + string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint); + newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh); + if (isSetpoint) newvalue = ReplaceSpaceWithHardspace(newvalue); if (g.ToString() != newvalue) text = text.Substring(0, g.Index) + newvalue + text.Substring(g.Index + g.Length); } @@ -1168,7 +1169,7 @@ namespace Volian.Controls.Library // string spaces = @" \u160?"; // return (spaces.IndexOf(ch) >= 0); //} - private string DoROFormatFlags(string roText, string beforeRO, string afterRO) + private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint) { string rtnstr = roText; // The RO text is being changed to match it's context. Since it is changed in reverse order, the text before the RO @@ -1194,7 +1195,12 @@ namespace Volian.Controls.Library // Caps ROs anywhere if no lower case text follows // and an upper case letter immediately precedes the RO. - + + if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapSPIfLastLower && + !Regex.IsMatch(afterRO, @".*(?