diff --git a/PROMS/Formats/fmtall/AEPCHIDall.xml b/PROMS/Formats/fmtall/AEPCHIDall.xml index 46587b92..af8272c7 100644 Binary files a/PROMS/Formats/fmtall/AEPCHIDall.xml and b/PROMS/Formats/fmtall/AEPCHIDall.xml differ diff --git a/PROMS/Formats/fmtall/AEPall.xml b/PROMS/Formats/fmtall/AEPall.xml index 38490ca8..9da1fe68 100644 Binary files a/PROMS/Formats/fmtall/AEPall.xml and b/PROMS/Formats/fmtall/AEPall.xml differ diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index d20a722b..23557a4b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -600,6 +600,7 @@ namespace VEPROMS.CSLA.Library public ItemInfo _RangeItem; public bool _UsedRangeAncestor; private string _Token; + public string _UnitProcSetString; public bool SectNumWithStepNum; private int _SectionNumberLength = 0; public int SectionNumberLength @@ -847,6 +848,7 @@ namespace VEPROMS.CSLA.Library tb._TranType = tranType; tb._ToItem = toItem; tb._RangeItem = rangeItem; + tb._UnitProcSetString = tb._FormatData.TransData.TransTypeList[tranType].UnitProcSetString; return tb; } private static string BuildString(TransitionBuilder tb) @@ -938,9 +940,54 @@ namespace VEPROMS.CSLA.Library unitnum = unitnum.Replace("-", @"\u8209?"); retstr = unitnum.Replace("#", retstr); } + // B2019-072: use si & psi as a prefix to the transition + string outsideprefix = null; + if (tb._ToItem.MyDocVersion != tb._FromItem.MyDocVersion) // doc versions not equal means it is an outside transition + { + if (tb._FromItem.ActiveFormat.PlantFormat.FormatData.PrintData.OutSideTransSetName) // must have format flag to include prefix + { + bool foundnull = false; + if (tb._UnitProcSetString != null && tb._UnitProcSetString != "") // must have a string on transition to use as format + { + // get the type/token strings from the format so that can grab si or psi info. An example format + // as used by AEP is: UnitProcSetString ="{PSI:UNITCOM}-{SI:SETNAME}-{PSI:SETID}-" + string findMatch = "{.*?}"; + MatchCollection ms = Regex.Matches(tb._UnitProcSetString,findMatch); + string txt = tb._UnitProcSetString; + FolderConfig fc = tb._ToItem.MyDocVersion.MyFolder.FolderConfig as FolderConfig; + ProcedureConfig pc = new ProcedureConfig(tb._ToItem.MyProcedure.MyContent.Config); + // Use a dictionary to get all of the tokens from the format string, then + // go through all dictionary entries to make the replacements. + Dictionary repStr = new Dictionary(); + foreach (Match mtch in ms) + { + int offset = mtch.Index; + string str = tb._UnitProcSetString.Substring(mtch.Index, mtch.Length); + int indxcn = str.IndexOf(":"); + string pt1 = str.Substring(1, indxcn - 1); + string pt2 = str.Substring(indxcn+1, str.Length - 2 - indxcn); + string add = null; + if (pt1.StartsWith("SI")) // SI fields go to the folder specific information + add = fc.GetValue(pt1, pt2); + else + add = pc.GetValue(pt1, pt2); + if (add == null || add == "") foundnull = true; // don't do prefix if any of the fields are null. + else repStr.Add(str, add); + } + if (!foundnull) + { + outsideprefix = tb._UnitProcSetString; + foreach (string key in repStr.Keys) + outsideprefix = outsideprefix.Replace(key, repStr[key]); + outsideprefix = outsideprefix.Replace("-", @"\u8209?"); // use unicode for dashes + } + } + } + } // LATER: Format Flag TruncateProcNmAfter1stSpace (dropped plants) // LATER: Format Flag HardSpTranProcNumb (active plants) tb.AppendPrefix(); + if (outsideprefix != null) retstr = outsideprefix + retstr; if (tb._FormatData.TransData.HardSpTranProcNumb) retstr = retstr.Replace(" ", @"\u160?"); tb.ReplaceToken(retstr); return (retstr != null && retstr != ""); diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 549768bb..02a7a9c3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -1050,6 +1050,14 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _UnitNumber, "@UnitNumber"); } } + private LazyLoad _OutSideTransSetName; //B2019-072: For AEP, use PSI & SI for outside transition text + public bool OutSideTransSetName + { + get + { + return LazyLoad(ref _OutSideTransSetName, "@OutSideTransSetName"); + } + } private LazyLoad _SpecialCaseCalvert; public bool SpecialCaseCalvert { @@ -6667,6 +6675,14 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _TransMenu, "@TransMenu"); } } + private LazyLoad _UnitProcSetString; //B2019-072: For AEP, use PSI & SI for outside transition text + public string UnitProcSetString // this is format of string to preface transition with + { + get + { + return LazyLoad(ref _UnitProcSetString, "@UnitProcSetString"); + } + } public override string GetPDDisplayName() { return string.Format("[{0}] - Type {1}", Index, Type); } public override string GetPDCategory()