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:
Rich 2014-01-15 19:29:26 +00:00
parent 3ddc7dfd41
commit 75abd14dd4
6 changed files with 31 additions and 6 deletions

View File

@ -5419,6 +5419,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _CapRoIfLastLower, "@CapRoIfLastLower");
}
}
private LazyLoad<bool> _CapSPIfLastLower;
public bool CapSPIfLastLower
{
get
{
return LazyLoad(ref _CapSPIfLastLower, "@CapSPIfLastLower");
}
}
private LazyLoad<bool> _UpRoIfPrevUpper;
public bool UpRoIfPrevUpper
{

View File

@ -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)))
{

View File

@ -1121,7 +1121,8 @@ public struct RO
public string UpRoAftrDash; //UpSetpntAftrDash;
public string UpcaseAllRoUnits; //UpcaseAllSetpointUnits;
public string CapHighRo; //CapHighSetpnt;
public string CapRoIfLastLower; //CapsPIFLastLower;
public string CapRoIfLastLower; //Old CapsPIFLastLower;
public string CapSPIfLastLower; //Adding in CapSPIFLastLower;
public string UpRoIfPrevUpper; //UpSpIfPrevUpper
public string UnderlineRo; //UnderlineSetpoints
public string CapFirstLetterInHighRO; //CAPFIRSTLETTERINHIGHSP
@ -4118,6 +4119,7 @@ namespace fmtxml
else fmtdata.ROData.CapHighRo = "False";
if (XtraFlags.CapsPIFLastLower == "True") fmtdata.ROData.CapRoIfLastLower = "True";
else fmtdata.ROData.CapRoIfLastLower = "False";
fmtdata.ROData.CapSPIfLastLower = "null";
if (XtraFlags.UpSpIfPrevUpper == "True") fmtdata.ROData.UpRoIfPrevUpper = "True";
else fmtdata.ROData.UpRoIfPrevUpper = "False";
if (XtraFlags.UnderlineSetpoints == "True") fmtdata.ROData.UnderlineRo = "True";

View File

@ -10,9 +10,15 @@ namespace fmtxml
private void AddCATADEVfmt(ref FormatData fmtdata)
{
fmtdata.ProcData.TitleLength = 45;
// Fix Logic for CAPSPIfLastLower
fmtdata.ROData.CapRoIfLastLower = "False";
fmtdata.ROData.CapSPIfLastLower = "True";
}
private void AddCATfmt(ref FormatData fmtdata) // Catawba
{
// Fix Logic for CAPSPIfLastLower
fmtdata.ROData.CapRoIfLastLower = "False";
fmtdata.ROData.CapSPIfLastLower = "True";
//fmtdata.SectData.StepSectionData.StpSectLayData.Separator.SeparatorLocation = 2;
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = -3;
fmtdata.SectData.StepSectionData.StpSectLayData.WidT = 390;

View File

@ -9,6 +9,9 @@ namespace fmtxml
{
private void AddMCGfmt(ref FormatData fmtdata) // McGuire
{
// Fix Logic for CAPSPIfLastLower
fmtdata.ROData.CapRoIfLastLower = "False";
fmtdata.ROData.CapSPIfLastLower = "True";
//fmtdata.SectData.StepSectionData.StpSectLayData.Separator.SeparatorLocation = 2;
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = -3;
fmtdata.SectData.StepSectionData.StpSectLayData.WidT = 390;

Binary file not shown.