All changes are contained in BGE ALN flags: CONDITION/RESPONSE table top continue message improvements; vertical spacing around bulleted items (where everynlines == 99) fix; if previous step is within template & this is not (and has same type) use template definition (only for Calvert Alarms)

Y location Adjustments for Calvert Alarms ‘CONDITION/RESPONSE table top continue messages
This commit is contained in:
Kathy Ruffing 2014-08-18 13:35:10 +00:00
parent a33347b22a
commit 8ee514f476
2 changed files with 31 additions and 6 deletions

View File

@ -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.
}

View File

@ -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)