Added CapSPIfLastLower=True for Catawba and McGuire
Added CapROIfLastLower=False for Catawba and McGuire Added CapSPIfLastLower for Catawba and McGuire so that only setpoint ROs are uppercased if the surounding text is uppercase.
This commit is contained in:
@@ -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, @".*(?<!\\)[a-z].*") && char.IsUpper(LastAlpha(beforeRO)))
|
||||
{
|
||||
return UpperCaseUnits(rtnstr);
|
||||
}
|
||||
if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapRoIfLastLower &&
|
||||
!Regex.IsMatch(afterRO,@".*(?<!\\)[a-z].*") && char.IsUpper(LastAlpha(beforeRO)))
|
||||
{
|
||||
|
Reference in New Issue
Block a user