From 82fa4f1e74882ba3024656ea735087d8dc0f7c79 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Wed, 24 Jan 2024 08:10:21 -0500 Subject: [PATCH] F2024-006 Fixed pagination logic to that step text at the bottom of an Alarm Point page does not print on top of the bottom continue message --- PROMS/Volian.Print.Library/Pagination.cs | 19 ++++++++++++++++--- PROMS/Volian.Print.Library/vlnParagraph.cs | 16 ++++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index c9438563..3460f87c 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -569,9 +569,22 @@ namespace Volian.Print.Library KeepStepsOnPage = false; } } - // B2023-116: Vogtle alarm pagination - sub-steps are separating from their HLS even if there is room for some (not all). See comment above for setting of - // 'alarmPageKeepHighWithSubs'. - if (KeepStepsOnPage && !alarmPageKeepHighWithSubs && ySizeIncludingFirst > (yWithinMargins - ySizeBtmCtnMess1 - ySizeBtmEndMess1)) KeepStepsOnPage = false; + if (KeepStepsOnPage && ySizeIncludingFirst > (yWithinMargins - ySizeBtmCtnMess1 - ySizeBtmEndMess1)) + { + // B2023-116: Vogtle alarm pagination - sub-steps are separating from their HLS even if there is room for some (not all). + // See comment above for setting of 'alarmPageKeepHighWithSubs'. + if (alarmPageKeepHighWithSubs) + { + // F2024-006: Vogtle Alarms pagination - compare the size of the step and its first sub-step with what we think we have left on the + // page. if not enough room with a continue message then set KeepStepsOnPage to start this step on its own page. + // This solved an issue where the last line of step text was printing on top of the bottom continue message + float myFirstPieceSize = GetFirstPieceSize(true); + if (myFirstPieceSize > yWithinMargins) + KeepStepsOnPage = false; + } + else + KeepStepsOnPage = false; + } if (!KeepWithHeader && !KeepStepsOnPage && mySize - SixLinesPerInch + yEndMsg - tableSpaceAvailable <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break { // Don't want extra line before step diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 18692067..761b18e1 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -3314,9 +3314,11 @@ namespace Volian.Print.Library /// This gets the height of the step with it's Caution's, Notes and potentially any First Substeps /// /// - private float GetFirstPieceSize() + // F2024-006: Vogtle Alarms pagination - added 'includeFirstSub' to get that size of the first substep with the parent step + // to help determine pagination + private float GetFirstPieceSize(bool includeFirstSub = false) { - vlnParagraph paraLast = GetFirstPieceLastPart(); + vlnParagraph paraLast = GetFirstPieceLastPart(includeFirstSub); float retval = (paraLast.YBottom) - YTopMost; //Console.WriteLine(MyItemInfo.DBSequence); return retval; @@ -3370,10 +3372,12 @@ namespace Volian.Print.Library get { return _YBottomForBox; } set { _YBottomForBox = value; } } - private vlnParagraph GetFirstPieceLastPart() + // F2024-006: Vogtle Alarms pagination - added 'includeFirstSub' to get that size of the first substep with the parent step + // to help determine pagination - even when PaginateOnFirstSubstep is turned on + private vlnParagraph GetFirstPieceLastPart(bool includeFirstSub = false) { vlnParagraph para = this; - if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PaginateOnFirstSubstep && ChildrenBelow != null && ChildrenBelow.Count > 0) + if ((!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PaginateOnFirstSubstep || includeFirstSub) && ChildrenBelow != null && ChildrenBelow.Count > 0) { // If the substep has a separator (OR, AND) then return the last substep rather than the first. string mySep = ChildrenBelow[0].MyItemInfo.FormatStepData.Sep ?? "{Null}"; @@ -3386,14 +3390,14 @@ namespace Volian.Print.Library if (keepEqListTogether && !ChildrenBelow[0].MyItemInfo.IsSequential && !this.MyItemInfo.IsHigh) // Extend to the last Item. para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart(); else - para = ChildrenBelow[0].GetFirstPieceLastPart(); + para = ChildrenBelow[0].GetFirstPieceLastPart(includeFirstSub); } } if (ChildrenRight != null && ChildrenRight.Count > 0) { foreach (vlnParagraph paraRight in ChildrenRight) { - vlnParagraph paraRightLast = paraRight.GetFirstPieceLastPart(); + vlnParagraph paraRightLast = paraRight.GetFirstPieceLastPart(includeFirstSub); if (paraRightLast.YBottom > para.YBottom) para = paraRightLast; }