Compare commits

..

No commits in common. "eb26b7a12317d7a3adb8a50e0eac8c9aebe75e3f" and "89814777b4953a29ccd804eaacb2bad62cdbf596" have entirely different histories.

5 changed files with 40 additions and 79 deletions

View File

@ -468,12 +468,10 @@ namespace VEPROMS.CSLA.Library
return text; return text;
} }
// B2022-035: resolve unit specific designators - moved code to here so that other objects can use it // B2022-035: resolve unit specific designators - moved code to here so that other objects can use it
// B2024-025 added <ID> to the replace list
public static string ResolveUnitSpecific(DocVersionInfo mydocversion, string text) public static string ResolveUnitSpecific(DocVersionInfo mydocversion, string text)
{ {
if (mydocversion == null) return text; if (mydocversion == null) return text;
text = Regex.Replace(text, @"\<U\>", mydocversion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase); text = Regex.Replace(text, @"\<U\>", mydocversion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<ID\>", mydocversion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)ID)\>", mydocversion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); text = Regex.Replace(text, @"\<(U(-|\\u8209\?)ID)\>", mydocversion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NAME)\>", mydocversion.DocVersionConfig.Unit_Name, RegexOptions.IgnoreCase); text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NAME)\>", mydocversion.DocVersionConfig.Unit_Name, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)TEXT)\>", mydocversion.DocVersionConfig.Unit_Text, RegexOptions.IgnoreCase); text = Regex.Replace(text, @"\<(U(-|\\u8209\?)TEXT)\>", mydocversion.DocVersionConfig.Unit_Text, RegexOptions.IgnoreCase);

View File

@ -2934,8 +2934,7 @@ namespace VEPROMS.CSLA.Library
{ {
string str = MyContent.Text; string str = MyContent.Text;
// B2022-035: resolve unit specific designators // B2022-035: resolve unit specific designators
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) if (str.ToUpper().Contains(@"<U")) str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(this.MyDocVersion, str);
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(this.MyDocVersion, str);
return ConvertToDisplayText(str, false, " "); // B2024-013 added " " to replace hard returns with a space instead of semi-colon return ConvertToDisplayText(str, false, " "); // B2024-013 added " " to replace hard returns with a space instead of semi-colon
} }
} }
@ -2947,8 +2946,7 @@ namespace VEPROMS.CSLA.Library
{ {
string str = MyContent.Text; string str = MyContent.Text;
// B2022-035: resolve unit specific designators // B2022-035: resolve unit specific designators
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) if (str.ToUpper().Contains(@"<U")) str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(this.MyDocVersion, str);
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(this.MyDocVersion, str);
return ConvertToDisplayText(str, false, ""); // pass in empty string for hard retun char will keep hard return return ConvertToDisplayText(str, false, ""); // pass in empty string for hard retun char will keep hard return
} }
} }
@ -2962,8 +2960,7 @@ namespace VEPROMS.CSLA.Library
string str = MyContent.Text; string str = MyContent.Text;
if (MyDocVersion != null) if (MyDocVersion != null)
{ {
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number);
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str);
} }
else else
{ {
@ -2982,13 +2979,16 @@ namespace VEPROMS.CSLA.Library
if (MyDocVersion != null) if (MyDocVersion != null)
{ {
// B2022-035: resolve unit specific designators // B2022-035: resolve unit specific designators
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) if (str.ToUpper().Contains("<U")) str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str);
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str);
} }
else else
{ {
_MyLog.WarnFormat("Disconnected Data - ItemID = {0}", ItemID); _MyLog.WarnFormat("Disconnected Data - ItemID = {0}", ItemID);
} }
//if (str.Contains("<u>"))
// str = str.Replace("<u>", MyDocVersion.DocVersionConfig.Unit_Number);
//if (str.Contains("<U>"))
// str = str.Replace("<U>", MyDocVersion.DocVersionConfig.Unit_Number);
return ConvertToDisplayText(str); return ConvertToDisplayText(str);
} }
} }
@ -3047,8 +3047,7 @@ namespace VEPROMS.CSLA.Library
string str = MyContent.Text; string str = MyContent.Text;
if (MyDocVersion != null) if (MyDocVersion != null)
{ {
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number);
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str);
} }
else else
{ {
@ -3081,8 +3080,8 @@ namespace VEPROMS.CSLA.Library
} }
else else
str = MyContent.Number; str = MyContent.Number;
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) str = Regex.Replace(str, @"\<U-ID\>", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str); str = Regex.Replace(str, @"\<ID\>", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
} }
else else
{ {
@ -3095,9 +3094,7 @@ namespace VEPROMS.CSLA.Library
// str = str.Replace(@"<S\u8209?ID>", MyDocVersion.DocVersionConfig.Unit_ID); // str = str.Replace(@"<S\u8209?ID>", MyDocVersion.DocVersionConfig.Unit_ID);
str = ConvertToDisplayText(str); str = ConvertToDisplayText(str);
if (MyDocVersion != null) // B2020-086 check for null doc version - happens if item we are trying to open is no longer there (disconnected) if (MyDocVersion != null) // B2020-086 check for null doc version - happens if item we are trying to open is no longer there (disconnected)
// B2017-019 - process "<u>" in section number str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number); // B2017-019 - process "<u>" in section number
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>)
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str);
return str; return str;
} }
//get { return ConvertToDisplayText(MyContent.Number); } //get { return ConvertToDisplayText(MyContent.Number); }

View File

@ -1540,8 +1540,8 @@ namespace VEPROMS.CSLA.Library
ItemInfo tmpitm = TranGetSectionItem(itminfo); ItemInfo tmpitm = TranGetSectionItem(itminfo);
if (!tmpitm.IsSection) return ""; if (!tmpitm.IsSection) return "";
string str = tmpitm.MyContent.Number; string str = tmpitm.MyContent.Number;
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) str = Regex.Replace(str, @"\<U\>", itminfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase );
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(itminfo.MyDocVersion, str); str = Regex.Replace(str, @"\<ID\>", itminfo.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
return (str); return (str);
} }
private static string TranGetSectionNumber(TransitionBuilder tb, bool allLevels) private static string TranGetSectionNumber(TransitionBuilder tb, bool allLevels)
@ -1566,8 +1566,8 @@ namespace VEPROMS.CSLA.Library
} }
//string str = tmpitm.MyContent.Number; //string str = tmpitm.MyContent.Number;
string str = BuildSectionPath(ToSections); string str = BuildSectionPath(ToSections);
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) str = Regex.Replace(str, @"\<U\>", tb._ToItem.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase);
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(tb._ToItem.MyDocVersion, str); str = Regex.Replace(str, @"\<ID\>", tb._ToItem.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
//if (!str.EndsWith(".") && tb._ToItem.ItemID != tb._ToItem.ActiveSection.ItemID) //if (!str.EndsWith(".") && tb._ToItem.ItemID != tb._ToItem.ActiveSection.ItemID)
tb.StepPrefix = "."; tb.StepPrefix = ".";
tb.SectionNumberLength = str.Length; tb.SectionNumberLength = str.Length;

View File

@ -3583,9 +3583,6 @@ namespace Volian.Controls.Library
private string ResolveUnitApp(DocVersionInfo dvi, string str) private string ResolveUnitApp(DocVersionInfo dvi, string str)
{ {
if (dvi == null) return str; if (dvi == null) return str;
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>)
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(dvi, str);
// look for un-resolved tokens and replace less/greater than chars with "*?" and "?*" respectively
string tmp = str.ToUpper(); string tmp = str.ToUpper();
int sindx = tmp.IndexOf("<U"); int sindx = tmp.IndexOf("<U");
int eindx = tmp.IndexOf(">", sindx + 1); int eindx = tmp.IndexOf(">", sindx + 1);
@ -3594,34 +3591,21 @@ namespace Volian.Controls.Library
{ {
reptmp = str.Substring(sindx, eindx - sindx + 1); reptmp = str.Substring(sindx, eindx - sindx + 1);
tmp = reptmp.ToUpper(); tmp = reptmp.ToUpper();
str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); // unresolved token if (tmp == "<U>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
else if (tmp == "<U-TEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text);
else if (tmp == "<U-NUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
else if (tmp == "<U-NAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name);
else if (tmp == "<U-ID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID);
// B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the OTHER tokens
else if (tmp == "<U-OTHERTEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text);
else if (tmp == "<U-OTHERNUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number);
else if (tmp == "<U-OTHERNAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name);
else if (tmp == "<U-OTHERID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID);
else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*"));
tmp = str.ToUpper(); tmp = str.ToUpper();
sindx = tmp.IndexOf("<U"); sindx = tmp.IndexOf("<U");
eindx = tmp.IndexOf(">", sindx + 1); eindx = tmp.IndexOf(">", sindx + 1);
} }
//string tmp = str.ToUpper();
//int sindx = tmp.IndexOf("<U");
//int eindx = tmp.IndexOf(">", sindx + 1);
//string reptmp;
//while (sindx > -1 && eindx > -1) // B2022-007 added while loop to process more than one <U- RO value
//{
// reptmp = str.Substring(sindx, eindx - sindx + 1);
// tmp = reptmp.ToUpper();
// if (tmp == "<U>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
// else if (tmp == "<U-TEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text);
// else if (tmp == "<U-NUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
// else if (tmp == "<U-NAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name);
// else if (tmp == "<U-ID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID);
// // B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the OTHER tokens
// else if (tmp == "<U-OTHERTEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text);
// else if (tmp == "<U-OTHERNUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number);
// else if (tmp == "<U-OTHERNAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name);
// else if (tmp == "<U-OTHERID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID);
// else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*"));
// tmp = str.ToUpper();
// sindx = tmp.IndexOf("<U");
// eindx = tmp.IndexOf(">", sindx + 1);
//}
return str; return str;
} }
// C2021-018 used to display Alarm Point Table RO values in the editor // C2021-018 used to display Alarm Point Table RO values in the editor

View File

@ -1834,8 +1834,7 @@ i = 0;
{ {
if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title = title.ToUpper(); if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title = title.ToUpper();
// B2022-035: resolve unit specific designators // B2022-035: resolve unit specific designators
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) if (title.ToUpper().Contains(@"<U")) title = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(section.MyDocVersion, title);
title = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(section.MyDocVersion, title);
plstr = SplitTitle(svgGroup, pageItem, title, (int)linelen, token, plstr, null); //,rowAdj); plstr = SplitTitle(svgGroup, pageItem, title, (int)linelen, token, plstr, null); //,rowAdj);
} }
break; break;
@ -1848,8 +1847,7 @@ i = 0;
string title1 = section.MyProcedure.MyContent.Text; string title1 = section.MyProcedure.MyContent.Text;
if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title1 = title1.ToUpper(); if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title1 = title1.ToUpper();
// F2024-012 copied this line from above (processing COVERPROCTITLE) to resolve unit designators in the procedure title // F2024-012 copied this line from above (processing COVERPROCTITLE) to resolve unit designators in the procedure title
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>) if (title1.ToUpper().Contains(@"<U")) title1 = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(section.MyDocVersion, title1);
title1 = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(section.MyDocVersion, title1);
plstr = SplitCoverTitle(svgGroup, pageItem, title1, (int)coverlinelen, token, plstr);//, rowAdj); plstr = SplitCoverTitle(svgGroup, pageItem, title1, (int)coverlinelen, token, plstr);//, rowAdj);
break; break;
case "{TITLE&UNIT}": case "{TITLE&UNIT}":
@ -2473,9 +2471,6 @@ i = 0;
private string ResolveUnitApp(DocVersionInfo dvi, string str) private string ResolveUnitApp(DocVersionInfo dvi, string str)
{ {
if (dvi == null) return str; if (dvi == null) return str;
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>)
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(dvi, str);
// look for un-resolved tokens and replace less/greater than chars with "*?" and "?*" respectively
string tmp = str.ToUpper(); string tmp = str.ToUpper();
int sindx = tmp.IndexOf("<U"); int sindx = tmp.IndexOf("<U");
int eindx = tmp.IndexOf(">", sindx + 1); int eindx = tmp.IndexOf(">", sindx + 1);
@ -2484,34 +2479,21 @@ i = 0;
{ {
reptmp = str.Substring(sindx, eindx - sindx + 1); reptmp = str.Substring(sindx, eindx - sindx + 1);
tmp = reptmp.ToUpper(); tmp = reptmp.ToUpper();
str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); if (tmp == "<U>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
else if (tmp == "<U-TEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text);
else if (tmp == "<U-NUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
else if (tmp == "<U-NAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name);
else if (tmp == "<U-ID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID);
// B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the OTHER tokens
else if (tmp == "<U-OTHERTEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text);
else if (tmp == "<U-OTHERNUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number);
else if (tmp == "<U-OTHERNAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name);
else if (tmp == "<U-OTHERID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID);
else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*"));
tmp = str.ToUpper(); tmp = str.ToUpper();
sindx = tmp.IndexOf("<U"); sindx = tmp.IndexOf("<U");
eindx = tmp.IndexOf(">", sindx + 1); eindx = tmp.IndexOf(">", sindx + 1);
} }
//string tmp = str.ToUpper();
//int sindx = tmp.IndexOf("<U");
//int eindx = tmp.IndexOf(">", sindx + 1);
//string reptmp;
//while (sindx > -1 && eindx > -1) // B2022-007 added while loop to process more than one <U- RO value
//{
// reptmp = str.Substring(sindx, eindx - sindx + 1);
// tmp = reptmp.ToUpper();
// if (tmp == "<U>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
// else if (tmp == "<U-TEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text);
// else if (tmp == "<U-NUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
// else if (tmp == "<U-NAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name);
// else if (tmp == "<U-ID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID);
// // B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the OTHER tokens
// else if (tmp == "<U-OTHERTEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text);
// else if (tmp == "<U-OTHERNUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number);
// else if (tmp == "<U-OTHERNAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name);
// else if (tmp == "<U-OTHERID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID);
// else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*"));
// tmp = str.ToUpper();
// sindx = tmp.IndexOf("<U");
// eindx = tmp.IndexOf(">", sindx + 1);
//}
return str; return str;
} }
// B2019-076: moved the following to DocVersionExt.cs to make it available to transitionext.cs code. // B2019-076: moved the following to DocVersionExt.cs to make it available to transitionext.cs code.