diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index be40a9bb..5ebb7366 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -2145,14 +2145,7 @@ i = 0; } if (token.Contains(@"PS-")) { - //Console.WriteLine("RefreshConfig {0} {1}", section.MyProcedure.ItemID, section.MyProcedure.MyItemInfoUnique); - //section.MyProcedure.RefreshConfig(); - //ProcedureConfig procConfig = section.MyProcedure.MyConfig as ProcedureConfig; - //Console.WriteLine("> ProcConfig {0} {1}",procConfig,section.MyProcedure.MyItemInfoUnique); - //Console.WriteLine("> MyContent {0}", section.MyProcedure.MyContent.Config); - //section.MyProcedure.RefreshConfig(); ProcedureConfig procConfig = new ProcedureConfig(section.MyProcedure.MyContent.Config); - //Console.WriteLine("< ProcConfig {0}", procConfig); if (procConfig != null) { int indx = token.IndexOf("-"); @@ -2161,10 +2154,11 @@ i = 0; if (qindx == -1) { val = procConfig.GetValue("PSI", token.Substring(4, token.Length - 5)); - if(val.Contains("")) // Replace with the current unit number + // F2021-034: Resolve applicability unit tokens (not just '') + if(val.ToUpper().Contains("") || val.ToUpper().Contains("", unbr3??""); + string unbr3 = ResolveUnitApp(MySection.MyDocVersion, val); + val = unbr3 ?? ""; } // MaxWidth is used to define width that the PSI text spans x-direction on page. If it is // defined, see if the text is too wide for a single line (SplitTextMaxWidth). The @@ -2219,6 +2213,28 @@ i = 0; } return retval; } + // F2021-034: Resolve applicability unit tokens (not just '') + private string ResolveUnitApp(DocVersionInfo dvi, string str) + { + string tmp = str.ToUpper(); + int sindx = tmp.IndexOf("", sindx + 1); + string reptmp = str.Substring(sindx, eindx - sindx+1); + tmp = reptmp.ToUpper(); + if (reptmp != "" && dvi != null) + { + if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name); + else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID); + } + return str; + } // B2019-076: moved the following to DocVersionExt.cs to make it available to transitionext.cs code. //private string GetInheritedSIValue(ProcedureInfo pi, string fieldName) //{