From 8ee514f476394ff97fca5120382c841e05d121aa Mon Sep 17 00:00:00 2001 From: Kathy Date: Mon, 18 Aug 2014 13:35:10 +0000 Subject: [PATCH] =?UTF-8?q?All=20changes=20are=20contained=20in=20BGE=20AL?= =?UTF-8?q?N=20flags:=20CONDITION/RESPONSE=20table=20top=20continue=20mess?= =?UTF-8?q?age=20improvements;=20vertical=20spacing=20around=20bulleted=20?= =?UTF-8?q?items=20(where=20everynlines=20=3D=3D=2099)=20fix;=20if=20previ?= =?UTF-8?q?ous=20step=20is=20within=20template=20&=20this=20is=20not=20(an?= =?UTF-8?q?d=20has=20same=20type)=20use=20template=20definition=20(only=20?= =?UTF-8?q?for=20Calvert=20Alarms)=20Y=20location=20Adjustments=20for=20Ca?= =?UTF-8?q?lvert=20Alarms=20=E2=80=98CONDITION/RESPONSE=20table=20top=20co?= =?UTF-8?q?ntinue=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Volian.Print.Library/VlnSvgPageHelper.cs | 2 ++ PROMS/Volian.Print.Library/vlnParagraph.cs | 35 +++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index a1b3a4fd..2b62a0bb 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -564,11 +564,13 @@ namespace Volian.Print.Library } if (TopMessageSub1 != null) { + TopMessageSub1.YOffset = AlarmYoffStart - 3 * vlnPrintObject.SixLinesPerInch; TopMessageSub1.ToPdf(cb, 0, ref tmp, ref tmp); TopMessageSub1 = null; // Only output it once. } if (TopMessageSub2 != null) { + TopMessageSub2.YOffset = AlarmYoffStart - 3 * vlnPrintObject.SixLinesPerInch; TopMessageSub2.ToPdf(cb, 0, ref tmp, ref tmp); TopMessageSub2 = null; // Only output it once. } diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index e9f40c6f..6bbebc04 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1049,7 +1049,7 @@ namespace Volian.Print.Library yPageStart = yTopMargin + yTopMost;// -2 * SixLinesPerInch; DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); if (EmptyTopMostPart) yPageStart += SixLinesPerInch; - DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues?"2 ":null); + bool addExtraLines = DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues && MyItemInfo.MyParent != null && MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.CleanText : null); // If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader) @@ -1065,7 +1065,8 @@ namespace Volian.Print.Library if (doAlarmBox && MyItemInfo.StepLevel > 1) { float alrmY = CalculateYOffset(yPageStart, yTopMargin); - PartsLeft.Add(new vlnMacro((float)docstyle.Layout.LeftMargin - 12, YOffset - (4 * SixLinesPerInch), "H4")); + float macroY = addExtraLines ? YOffset - (6 * SixLinesPerInch) : YOffset - (4 * SixLinesPerInch); + PartsLeft.Add(new vlnMacro((float)docstyle.Layout.LeftMargin - 12, macroY, "H4")); MyPageHelper.AlarmYoffStart = alrmY - SixLinesPerInch; yPageStart -= (4 * SixLinesPerInch); } @@ -1084,6 +1085,7 @@ namespace Volian.Print.Library float mytmpfloat = smartPara.ParagraphToPdf(cb, smartPara.Height, yTopMargin, yBottomMargin); // .ToPdf(cb, 0, yTopMargin, yBottomMargin); yPageStart -= smartPara.Height; } + if (addExtraLines) yPageStart -= (2 * SixLinesPerInch); if (MyItemInfo.IsRNOPart && MyItemInfo.FormatStepData.DoubleSpace && MyItemInfo.FormatStepData.SpaceDouble) yPageStart += SixLinesPerInch; break; case 3: // Break on High Level Step (SevenLinesPerInch) @@ -1247,8 +1249,9 @@ namespace Volian.Print.Library return yPageStart; } - private void DoTopContinueMsg(PdfContentByte cb, ref float yPageStart, float yTopMargin, DocStyle docstyle, string subTab) + private bool DoTopContinueMsg(PdfContentByte cb, ref float yPageStart, float yTopMargin, DocStyle docstyle, string subTab) { + bool addExtraLine = false; string myMsg = docstyle.Continue.Top.Message; MyPageHelper.TopMessageR = null; if (myMsg != null && myMsg != "") @@ -1315,10 +1318,15 @@ namespace Volian.Print.Library if (subTab != null && MyItemInfo.StepLevel > 2) { float ybot = yTopMargin + (4 * SixLinesPerInch); - float xoffB = (float)docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0; - MyPageHelper.TopMessageSub1 = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font); - xoffB = docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.MarginR ?? 0; + float xoffB = 0; + if (MyParent.MyTab != null) + { + xoffB = MyParent.MyTab.XOffset; + MyPageHelper.TopMessageSub1 = new vlnText(cb, this, MyParent.MyTab.Text, MyParent.MyTab.Text, xoffB, ybot, docstyle.Continue.Bottom.Font); + } + xoffB = MyParent.XOffset; MyPageHelper.TopMessageSub2 = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font); + addExtraLine = true; } } if (!PageBreakOnStep) @@ -1326,6 +1334,7 @@ namespace Volian.Print.Library else MyPageHelper.TopMessage = null; } + return addExtraLine; } private void DoBottomContinueMsg(PdfContentByte cb, float yBottomMargin, float yLocation, DocStyle docstyle, bool doThreeContinues) @@ -2830,6 +2839,11 @@ namespace Volian.Print.Library int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; if (everyNLines == -99) return 0; if ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && !MyItemInfo.FormatStepData.SpaceIn && MyItemInfo.GetNextItem() == null) return 0; + if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && everyNLines == 99 && MyItemInfo.GetNextItem() == null) + { + if (MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0 && MyItemInfo.Steps[0].MyContent.Type == MyItemInfo.MyContent.Type) return 0; + if (MyItemInfo.MyParent.GetNextItem() != null && MyItemInfo.MyParent.GetNextItem().MyContent.Type == MyItemInfo.MyContent.Type) return 0; + } if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.GetNextItem() == null) return SixLinesPerInch; // Pagination issue to be used with yEndsWithBlankLine in Pagination code, but not checked in yet. //if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; @@ -3647,6 +3661,15 @@ namespace Volian.Print.Library else widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride == null ? null : (float?)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO); + + // Calvert Alarms had a case where the Title With Text Below (type 42) did not match + // any of the template items, but needed the width from the template. The previous step (of + // same type) was in the template. Check for this case. The issue can be found in + // Unit 1 Alarms/1c06/Alarm E-48/'General Information' section. + if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && widOvrd == 0) + { + if (itemInfo.MyPrevious != null && itemInfo.MyPrevious.TemplateIndex > 1) widOvrd = GetWidthOrStartFromTemplate(itemInfo.MyPrevious, itemInfo.MyPrevious.ActiveFormat, true); + } //widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride; // Don't adjust the RNO width if in single column mode: if (itemInfo.IsRNOPart && itemInfo.MyParent.IsHigh && itemInfo.MyActiveSection.ColumnMode != 0 && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null)