From f33261822779367e5cac55a4a0a6d2d8a48693ea Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 29 Apr 2014 13:12:10 +0000 Subject: [PATCH] =?UTF-8?q?BGE:=20Handle=20{}=20around=20ro=20values=20BGE?= =?UTF-8?q?:=20Added=20an=20x-Location=20of=20end=20message=20for=20a=20se?= =?UTF-8?q?ction=20Use=20x-location=20of=20end=20message=20for=20a=20secti?= =?UTF-8?q?on;=20tab=20format=20for=20sequential=20tabs=20at=204th=20level?= =?UTF-8?q?;=20hls=20tab=20spaces;=20indent=20in=20transition=20format=209?= =?UTF-8?q?=20BGE:=20Use=20x-location=20of=20end=20message=20for=20a=20sec?= =?UTF-8?q?tion=20BGE:=20support=20for=20top=20continue=20messages=20that?= =?UTF-8?q?=20contain=20tab=20for=20continued=20step=20resolve=20{Step=20T?= =?UTF-8?q?ext}=20token=20in=20transition;=20modify=20code=20that=20proces?= =?UTF-8?q?ses=20transition=20format=20to=20use=20collection=20matches=20r?= =?UTF-8?q?ather=20than=20search=20for=20=E2=80=98{=E2=80=98=20support=20A?= =?UTF-8?q?llUnits=20ro=20flag=20support=20=E2=80=98{=E2=80=98=20and=20?= =?UTF-8?q?=E2=80=98}=E2=80=99=20around=20ro=20value=20top=20continue=20me?= =?UTF-8?q?ssage=20with=20tab;=20location=20of=20top=20continue=20message?= =?UTF-8?q?=20in=20both=20AER/RNO=20columns=20for=20dual=20column;=20suppo?= =?UTF-8?q?rt=20indent=20in=20transition=20format=20during=20print=20suppo?= =?UTF-8?q?rt=20two=20top=20continue=20messages=20(aer/rno)=20that=20can?= =?UTF-8?q?=20have=20different=20text;=20fix=20bug=20in=20splitting=20proc?= =?UTF-8?q?edure=20title=20text=20if=20it=20contains=20hard=20spaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/DataLoader/RefObjs.cs | 2 + .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 30 ++++++++++++ .../Extension/TransitionExt.cs | 31 ++++++++---- .../VEPROMS.CSLA.Library/Format/DocStyles.cs | 8 ++++ PROMS/Volian.Controls.Library/DisplayText.cs | 47 ++++++++++--------- PROMS/Volian.Controls.Library/StepRTB.cs | 2 + .../Volian.Print.Library/VlnSvgPageHelper.cs | 29 ++++++++++-- PROMS/Volian.Print.Library/vlnParagraph.cs | 47 +++++++++++++++---- PROMS/fmtxml/FmtToXml.cs | 2 + PROMS/fmtxml/PlantSpecific_Calvert.cs | 10 ++++ PROMS/fmtxml/TranslateDoc.XSL | 5 ++ 11 files changed, 167 insertions(+), 46 deletions(-) diff --git a/PROMS/DataLoader/RefObjs.cs b/PROMS/DataLoader/RefObjs.cs index 3c645dc9..aa7845d2 100644 --- a/PROMS/DataLoader/RefObjs.cs +++ b/PROMS/DataLoader/RefObjs.cs @@ -81,6 +81,8 @@ namespace DataLoader { roval = roval.Substring(0, roval.IndexOf('\n')); } + roval = roval.Replace("{", @"\{"); + roval = roval.Replace("}", @"\}"); // add an annotation stating "Invalid Unit RO 'ROID'. Need an Item for this, so just add // it to a list of 'invalid ros' so that calling method can add annotations to the Item. if (roval == "?") diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 9288b1f5..0ac27afe 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -428,6 +428,11 @@ namespace VEPROMS.CSLA.Library itemInfo.ActiveSection = sectionInfo; itemInfo.MyProcedure = procInfo; itemInfo.MyDocVersion = docVersionInfo; + if (itemInfo.IsStep) + { + ItemInfo ip = itemParent as ItemInfo; + itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab); + } if (itemInfo.MyContent.ContentGridCount > 0) itemInfo.MyContent.LoadNonCachedGrid(); if (itemInfo.MyContent.ContentPartCount > 0) @@ -500,6 +505,20 @@ namespace VEPROMS.CSLA.Library // Console.WriteLine("Items: {0}", TimeSpan.FromTicks(ticksItems).TotalSeconds); // Console.WriteLine("Transitions: {0}", TimeSpan.FromTicks(ticksTrans).TotalSeconds); //} + internal static string GetCombinedTab(ItemInfo itemInfo, string parTab) + { + string pTab = parTab == null ? "" : parTab; + string thisTab = itemInfo.MyTab.CleanText.Trim(); + if (itemInfo.FormatStepData.NumberWithLevel) pTab = itemInfo.MyHLS.MyTab.CleanText.Trim(); + // if the parent tab ends with a alphanumeric and this tab is alphanumeric, add a '.' to separate them + bool ms = pTab != "" && char.IsLetterOrDigit(pTab.TrimEnd()[pTab.Length - 1]); // parent tab ends with alphanumeric + bool mn = thisTab.TrimStart().Length > 0 && char.IsLetterOrDigit(thisTab.TrimStart()[0]);// this starts with alpha + if (ms && mn) pTab = pTab.TrimEnd() + "."; + + // remove ending '.' (if this is a hls, don't remove the '.') + if (!itemInfo.IsHigh && thisTab.EndsWith(".")) thisTab = thisTab.Substring(0, thisTab.Length - 1); + return pTab + thisTab.Trim(); + } internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup) { if (itemInfo == null) return; @@ -509,6 +528,11 @@ namespace VEPROMS.CSLA.Library // itemInfo.ActiveSection = (itemInfo as SectionInfo) ?? sectionInfo; itemInfo.ActiveSection = sectionInfo; itemInfo.MyDocVersion = docVersionInfo; + if (itemInfo.IsStep) + { + ItemInfo ip = itemParent as ItemInfo; + itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab); + } ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst; //rofstinfo.docVer = docVersionInfo; ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo); @@ -2298,7 +2322,13 @@ namespace VEPROMS.CSLA.Library return _MyHLS; } } + private string _CombinedTab = null; + public string CombinedTab + { + get { return _CombinedTab; } + set { _CombinedTab = value; } + } private DocVersionInfo _MyDocVersion = null; public DocVersionInfo MyDocVersion diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index e374464f..1e116976 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -516,6 +516,7 @@ namespace VEPROMS.CSLA.Library _AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber); _AppendMethods.Add("{Sect Number}", AddTranGetSectionNumber); // WCN2, tran type 6 _AppendMethods.Add("{Page Num}", AddPageNumber); + _AppendMethods.Add("{Step Text}", AddStepText); } public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool hasPageNum) { @@ -599,14 +600,20 @@ namespace VEPROMS.CSLA.Library return "?"; int startIndex = 0; int index = -1; + int rexIndex = -1; string prefix = null; string prevToken = null; bool lastAdded = false; - while ((index = tb._TransFormat.IndexOf("{", startIndex)) > -1) + MatchCollection mc = Regex.Matches(tb._TransFormat, @"{(Proc Num|\?\.Proc Num|Proc Title|\?\.Proc Title|" + + @"First Step|Step Number|Last Step|\.|Sect Hdr|\?\.Sect Hdr|Sect Title|\?\.Sect Title|\?\.Sect Num|Sect Num|" + + @"Sect Number|Page Num|Step Text)}"); + foreach (Match m in mc) { string tmppref = prefix; prefix = null; - if (index > startIndex) prefix = tb._TransFormat.Substring(startIndex, index - startIndex); + rexIndex = m.Index; + int rexEndToken = m.Index + m.Length - 1; + if (rexIndex > startIndex) prefix = tb._TransFormat.Substring(startIndex, rexIndex - startIndex); if (prefix == null) prevToken = null; // if the last token did not add anything to the buffer, still want to put the text prefix in: if (!lastAdded && prefix == null) prefix = tmppref; @@ -615,20 +622,19 @@ namespace VEPROMS.CSLA.Library tb.Append(prefix); prefix = ""; } - int endtokn = tb._TransFormat.IndexOf("}", index); - string token = tb._TransFormat.Substring(index, endtokn - index + 1); + string token = tb._TransFormat.Substring(rexIndex, rexEndToken - rexIndex + 1); // we need to flag condition where the step number already has the section number in it. For example, Wolf Creek // using WCN2, has some sections whose section number is 'D' and the step number is 'D1', or 'D2'. The resolved // transition text was coming out as 'DD1'. The format's HLS tab format contains '{Section Prefix}' whose implementation // adds the section number to the tab. - if (token.Contains("Sect Num") && tb._TransFormat.Length > endtokn + 1) + if (token.Contains("Sect Num") && tb._TransFormat.Length > rexEndToken + 1) { - int nxtTokenS = tb._TransFormat.IndexOf("{", endtokn); - if (nxtTokenS > -1 && nxtTokenS == endtokn+1) // the {step} token has to immediately follow the section num token + int nxtTokenS = tb._TransFormat.IndexOf("{", rexEndToken); + if (nxtTokenS > -1 && nxtTokenS == rexEndToken + 1) // the {step} token has to immediately follow the section num token { int nxtTokenE = tb._TransFormat.IndexOf("}", nxtTokenS); string nxtToken = tb._TransFormat.Substring(nxtTokenS, nxtTokenE - nxtTokenS + 1); - tb.SectNumWithStepNum = tb._ToItem.IsStep && nxtToken.Contains("Step") + tb.SectNumWithStepNum = tb._ToItem.IsStep && nxtToken.Contains("Step") && tb._ToItem.MyHLS.FormatStepData.TabData.IdentPrint.Contains("{Section Prefix}"); } } @@ -648,7 +654,7 @@ namespace VEPROMS.CSLA.Library } else tb.Append("\\" + token.Substring(0, token.Length - 1) + "\\}"); - startIndex = endtokn + 1; + startIndex = rexEndToken + 1; prevToken = token; if (startIndex >= tb._TransFormat.Length) break; } @@ -926,6 +932,13 @@ namespace VEPROMS.CSLA.Library tb._UsedRangeAncestor = usedRangeAncestor; return true; } + private static bool AddStepText(TransitionBuilder tb) + { + tb.AppendPrefix(); + string txt = tb._ToItem.MyContent.Text; + tb.Append(txt); + return true; + } private static Dictionary GetAncestors(ItemInfo itemInfo) { Dictionary retval = new Dictionary(); diff --git a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs index bc944c3b..15b404f9 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs @@ -720,6 +720,14 @@ namespace VEPROMS.CSLA.Library return Message == null ? null : Message.Replace("\n","\r\n"); } } + private LazyLoad _Margin; + public float? Margin + { + get + { + return LazyLoad(ref _Margin, "@Margin"); + } + } #endregion } #endregion diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index f0e0b02e..f6b2739b 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -410,11 +410,19 @@ namespace Volian.Controls.Library // if it turns out that if ro's have any embedded unicode characters this needs expanded, such as /u8209? (hard hyphen) string lookFor = string.Format(@""); MatchCollection matches = Regex.Matches(text, lookFor); + string prevValue = null; for (int i = matches.Count - 1; i >= 0; i--) { Match m = matches[i]; if (m != null && m.Groups.Count > 6 && m.Groups[6].ToString() == "ReferencedObject") { + // if previous processed (next ro) was found, then see if it has an 'and' between it and the previous + if (prevValue != null) + { + int endIndx = m.Index + m.Length; + string tr = text.Substring(endIndx).Replace(@"\v0","").TrimStart(); + if (!tr.ToUpper().StartsWith("AND")) prevValue = null; + } 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)); @@ -425,7 +433,8 @@ namespace Volian.Controls.Library int rodbid = int.Parse(myMatch.Groups[3].Value); ROFstInfo myROFst = _MyItemInfo.MyDocVersion.GetROFst(rodbid); bool isSetpoint=myROFst.IsSetpointDB(dbid, _MyItemInfo.MyDocVersion); - string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint); + string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint, prevValue); + if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits) prevValue = newvalue; newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh); if (isSetpoint) newvalue = ReplaceSpaceWithHardspace(newvalue); if (g.ToString() != newvalue) @@ -1240,13 +1249,14 @@ namespace Volian.Controls.Library // string spaces = @" \u160?"; // return (spaces.IndexOf(ch) >= 0); //} - private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint) + private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint, string prevValue) { 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 // should ignore other RO text. beforeRO = Regex.Replace(beforeRO, @"\", ""); // Remove any RO Values. beforeRO = Regex.Replace(beforeRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments + string allUnitAfterRo = afterRO; afterRO = Regex.Replace(afterRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments // Underline all ROs, values and Units @@ -1330,26 +1340,19 @@ namespace Volian.Controls.Library //In a sequence of RO values, the unit appears with every value //(e.g., "25 gpm and 30 gpm" vs. "25 and 30 gpm") - //if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits) - //{ - // int idx = rtnstr.LastIndexOf(' '); - // if (idx > 0) - // { - // StringBuilder sb = new StringBuilder(); - // string lastunit = rtnstr.Substring(idx); // RO unit including preceeding space - // int idx2 = rtnstr.IndexOf(lastunit); - // int si = 0; - // while (idx2 < idx) - // { - // sb.Append(rtnstr.Substring(si, idx2 - si)); - // si = idx2 + lastunit.Length; - // idx2 = rtnstr.IndexOf(lastunit, si); - // } - // sb.Append(rtnstr.Substring(si)); - // rtnstr = sb.ToString(); - // } - //} - + if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits && prevValue != null) + { + string units = null; + Match m = Regex.Match(prevValue, "[^0-9]"); + if (m.Success) + { + units = prevValue.Substring(m.Index); + if (rtnstr.EndsWith(units)) + { + rtnstr = rtnstr.Replace(units, ""); + } + } + } return rtnstr; } /// diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 06df800b..03f79825 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1087,6 +1087,8 @@ namespace Volian.Controls.Library SelectionLength = 0; linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 "); + linkValue = linkValue.Replace(@"{", @"\{"); + linkValue = linkValue.Replace(@"}", @"\}"); SelectedRtf = @"{\rtf1\ansi"+FontTable+@"{\colortbl ;\red255\green0\blue0;}\v"+FontSize+@" \v0 }"; this.SelectionLength = 0; this.SelectionStart = position; diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index ac0058b1..87da922c 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -32,13 +32,18 @@ namespace Volian.Print.Library get { return _CheckListBoxes; } set { _CheckListBoxes = value; } } - private vlnText _TopMessage; public vlnText TopMessage { get { return _TopMessage; } set { _TopMessage = value; } } + private vlnText _TopMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE) + public vlnText TopMessageR + { + get { return _TopMessageR; } + set { _TopMessageR = value; } + } private vlnText _BottomMessage; public vlnText BottomMessage { @@ -387,6 +392,11 @@ namespace Volian.Print.Library TopMessage.ToPdf(cb, 0, ref tmp, ref tmp); TopMessage = null; // Only output it once. } + if (TopMessageR != null) + { + TopMessageR.ToPdf(cb, 0, ref tmp, ref tmp); + TopMessageR = null; // Only output it once. + } if (BottomMessage != null) { BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); @@ -1617,9 +1627,9 @@ namespace Volian.Print.Library indx += m.Length - 1; width++; } - else + else { - m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]"); + m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]"); // 3 char unicode, for example \u160? (hardspace) if (m.Success) { indx += m.Length - 1; @@ -1627,11 +1637,20 @@ namespace Volian.Print.Library } else { - m = Regex.Match(text.Substring(indx), @"^\\[^ ]*? "); + m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]"); if (m.Success) { indx += m.Length - 1; - rtfprefix = AdjustRtfPrefix(rtfprefix, m.Value); + width++; + } + else + { + m = Regex.Match(text.Substring(indx), @"^\\[^ ]*? "); + if (m.Success) + { + indx += m.Length - 1; + rtfprefix = AdjustRtfPrefix(rtfprefix, m.Value); + } } } } diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index e27db0fd..8f57e37c 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1044,11 +1044,29 @@ namespace Volian.Print.Library DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); if (EmptyTopMostPart) yPageStart += SixLinesPerInch; myMsg = docstyle.Continue.Top.Message; + MyPageHelper.TopMessageR = null; if (myMsg != null && myMsg != "") { yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message - if (myMsg.IndexOf(@"%sR") > -1) // KBR NEEDS MUCH MORE WORK, i.e. substep tabs concatenated onto step tabs, AER vs RNO - myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.MyTab.Text); + if (myMsg.IndexOf(@"%sR") > -1) + { + ItemInfo myAer = MyItemInfo.IsHigh?MyItemInfo:MyItemInfo.MyParent; + if (MyItemInfo.IsInRNO) + { + if (MyItemInfo.IsNote || MyItemInfo.IsCaution) + myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.MyParent.CombinedTab); + else + myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.CombinedTab); + float xor = MyTopRNO.MyTab.XOffset; + MyPageHelper.TopMessageR = new vlnText(cb, this, myMsg, myMsg, xor, yTopMargin + 0.1F, docstyle.Continue.Top.Font); + // get aer message, go up parent until find aer and use its combined tab: + myAer = MyItemInfo; + while (myAer.IsInRNO) myAer = myAer.MyParent; + } + myMsg = docstyle.Continue.Top.Message.Replace(@"%sR", myAer.CombinedTab); + } + if (myMsg.IndexOf(@"%s") > -1) + myMsg = myMsg.Replace(@"%s", MyItemInfo.MyParent.CombinedTab); if (myMsg.IndexOf(@"%3d") > -1) myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString()); if (myMsg.IndexOf(@"%d") > -1) @@ -1188,20 +1206,28 @@ namespace Volian.Print.Library { msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch); } - + if (docstyle.End.Flag < 0) // Adjust this many lines down the page. + { + float adjMsgY = (float)(-docstyle.End.Flag * SixLinesPerInch); + if (msg_yLocation - adjMsgY > docstyle.Layout.FooterLength) msg_yLocation = msg_yLocation - adjMsgY; + } if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber); //jcb code //if (myMsg.Contains("%-8s")) // myMsg = myMsg.Replace("%-8s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(8)); if (myMsg.Contains("%-12s")) myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12)); - //end jb code - // center the message. - float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; - float centerpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; - centerpos = Math.Max(centerpos, XOffsetBox + (float)docstyle.Layout.LeftMargin); - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font); - MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height)); + float xpos = 0; + if ((docstyle.End.Margin ?? 0) != 0) + xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin; + else + { + float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; + xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; + xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin); + MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height)); + } + MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); } } if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2},{3}", MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, MyItemInfo.ItemID, yLocalypagestart, yPageStart); @@ -2603,6 +2629,7 @@ namespace Volian.Print.Library stText = stText.Replace(@"\ulnone ", ""); stText = stText.Replace(@"\ulnone", ""); } + if (stText.Contains("{IND}")) stText = stText.Replace("{IND}", "\x5"); if (itemInfo.IsSection && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Level0Big && itemInfo.MyParent.IsProcedure) myFont = new System.Drawing.Font(myFont.FontFamily, 14, myFont.Style | FontStyle.Bold); _RtfSB.Append(AddFontTable(myFont)); diff --git a/PROMS/fmtxml/FmtToXml.cs b/PROMS/fmtxml/FmtToXml.cs index 47f7c59b..747edb34 100644 --- a/PROMS/fmtxml/FmtToXml.cs +++ b/PROMS/fmtxml/FmtToXml.cs @@ -90,6 +90,7 @@ public struct DocStyle public bool CBNoOverrideSpace; // Added for farley pagination of bottomcontinue message public VE_Font ContStyle; // Style of continue messages public short EndFlag; // Does end statement exist for this type + public float EndMargin; // Added for BGE - need to position the end message (differs for single vs dual column) public VE_Font EndStyle; // Style of end message at end of page public string ContTop; // Message at top of page public string ContBottom; // Message at bottom of page @@ -1073,6 +1074,7 @@ namespace fmtxml { dc.EndString = null; dc.EndFlag = 0; + dc.EndMargin = 0; } if (offst[3] != 0) dc.FinalMsg = DoReplaceTokens(GetAsciiStringUntilNull(brFmt)); else dc.FinalMsg = null; diff --git a/PROMS/fmtxml/PlantSpecific_Calvert.cs b/PROMS/fmtxml/PlantSpecific_Calvert.cs index 88981302..7f3f15b9 100644 --- a/PROMS/fmtxml/PlantSpecific_Calvert.cs +++ b/PROMS/fmtxml/PlantSpecific_Calvert.cs @@ -15,7 +15,14 @@ namespace fmtxml fmtdata.SectData.SectionHeader.Level0Big = "True"; fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 30; fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,192,126"; + fmtdata.SectData.StepSectionData.SequentialTabFormat[4].TabFormat = "{seq})"; + fmtdata.SectData.StepSectionData.SequentialTabFormat[4].PrintTabFormat = "{seq})"; fmtdata.TransData.UseSpecificTransitionModifier = "true"; + fmtdata.StepData[2].TabData.Ident = " {numeric}. "; + fmtdata.StepData[2].TabData.IdentEdit = " {numeric}. "; + fmtdata.StepData[2].TabData.RNOIdent = " . "; + fmtdata.StepData[2].TabData.RNOIdentEdit = " . "; + fmtdata.StepData[6].SeparateBox = "True"; //fmtdata.StepData[6].MatchUpRNO = "False"; fmtdata.StepData[7].SeparateBox = "True"; @@ -26,6 +33,7 @@ namespace fmtxml fmtdata.TransData.TransTypeData[4].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}"; fmtdata.TransData.TransTypeData[5].TransFormat = @"{Proc Num}, \ul {Proc Title}\ulnone , {Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}"; fmtdata.TransData.TransTypeData[6].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}{Page Num}"; + fmtdata.TransData.TransTypeData[9].TransFormat = @"{Proc Num} {IND}\ul {Proc Title}\ulnone "; fmtdata.TransData.TransTypeData[10].TransFormat = @"{First Step}, \ul {Step Text}\ulnone {Page Num}"; } private void AddBGEEOPOverridefmt(ref FormatData fmtdata) @@ -84,9 +92,11 @@ namespace fmtxml dcstyles.DcStyles[0].TopMargin = 96; dcstyles.DcStyles[1].PageLength = 600; dcstyles.DcStyles[1].PageWidth = 552; + dcstyles.DcStyles[1].EndMargin = 206; dcstyles.DcStyles[2].CBMargin = 96; dcstyles.DcStyles[2].CBMarginR = 335; dcstyles.DcStyles[2].CBLoc = 1; + dcstyles.DcStyles[2].EndMargin = 75; dcstyles.DcStyles[2].PageWidth = 552; dcstyles.DcStyles[2].CenterLineX = 240; dcstyles.DcStyles[2].CenterLineYTop = 647; diff --git a/PROMS/fmtxml/TranslateDoc.XSL b/PROMS/fmtxml/TranslateDoc.XSL index a29fba2c..764f9325 100644 --- a/PROMS/fmtxml/TranslateDoc.XSL +++ b/PROMS/fmtxml/TranslateDoc.XSL @@ -239,6 +239,11 @@ + + + + +