B2022-086: Barakah: Added flag, ‘AdjFirstSecDocStylesInPagination’, to NOT account for alarm box on 2nd page of alarms in pagination

B2022-086:  Barakah:  improve pagination, allow more on page & correctly account for top of page items when calculating y amount of text on a page; added debug output
Added debug output
This commit is contained in:
Kathy Ruffing 2022-12-08 15:43:50 +00:00
parent f72c37c177
commit f6266daf7d
3 changed files with 20 additions and 2 deletions

View File

@ -1414,6 +1414,15 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _UseUnitWatermarkOnApproved, "@UseUnitWatermarkOnApproved"); return LazyLoad(ref _UseUnitWatermarkOnApproved, "@UseUnitWatermarkOnApproved");
} }
} }
// B2022-086: Barakah - flag to adjust ypagesize for pagination when 1st and later pages have different printable box size
private LazyLoad<bool> _AdjFirstSecDocStylesInPagination;
public bool AdjFirstSecDocStylesInPagination
{
get
{
return LazyLoad(ref _AdjFirstSecDocStylesInPagination, "@AdjFirstSecDocStylesInPagination");
}
}
} }
#endregion #endregion
#region VersionIdText #region VersionIdText

View File

@ -899,6 +899,7 @@ namespace Volian.Print.Library
pg = pg.TopMostChild; pg = pg.TopMostChild;
return pg; return pg;
} }
public float yPageSizeForPagination = -1;
private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg, bool doSectionTitleContinued, bool onNewPage) private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg, bool doSectionTitleContinued, bool onNewPage)
{ {
float topContinueHeight = 2 * SixLinesPerInch; float topContinueHeight = 2 * SixLinesPerInch;
@ -973,6 +974,8 @@ namespace Volian.Print.Library
string myTopMsg = docstyle.Continue.Top.Message; string myTopMsg = docstyle.Continue.Top.Message;
float myTopMsgSpace = ((myTopMsg ?? "") != "") ? 2 * SixLinesPerInch : 0; float myTopMsgSpace = ((myTopMsg ?? "") != "") ? 2 * SixLinesPerInch : 0;
// B2022-086: If continue message is above printable box don't include its size in pagination logic
if (docstyle.Continue.Top.RowOverride != null && docstyle.Continue.Top.RowOverride > 0) myTopMsgSpace = 0;
// For B2016-157 & B2015-211: myTopMsgSpace is 1 line, not 2. Note that this may be a more generic solution, but // For B2016-157 & B2015-211: myTopMsgSpace is 1 line, not 2. Note that this may be a more generic solution, but
// it was found during print testing for BGE and flag is used to minimize impact on other formats // it was found during print testing for BGE and flag is used to minimize impact on other formats
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertPagination) myTopMsgSpace = ((myTopMsg ?? "") != "") ? SixLinesPerInch : 0; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertPagination) myTopMsgSpace = ((myTopMsg ?? "") != "") ? SixLinesPerInch : 0;
@ -1039,6 +1042,7 @@ namespace Volian.Print.Library
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter - yAccountForBottomMsg, yLowerLimit, paraBreak = FindPageBreak(yStart, ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter - yAccountForBottomMsg, yLowerLimit,
myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace, myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace,
myBottomMsgSpace, MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly, yTop); myBottomMsgSpace, MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly, yTop);
paraBreak.yPageSizeForPagination = yPageSize;
// B2020-032 put in for Barakah EOPs 1T4-OP-EOP-XX-0100 Attachement 32 step 1.2.2a where a table was printing on a page by itself. // B2020-032 put in for Barakah EOPs 1T4-OP-EOP-XX-0100 Attachement 32 step 1.2.2a where a table was printing on a page by itself.
// The following logic will walk up to each parent level to see try and get as many parent step levels on the same page // The following logic will walk up to each parent level to see try and get as many parent step levels on the same page
// as the Table. // as the Table.
@ -1273,6 +1277,9 @@ namespace Volian.Print.Library
// B2020-112: complicated AER/RNO. yEndMsg was accounted for twice -> put endmsg part back in, it broke wcn and didn't affect bge // B2020-112: complicated AER/RNO. yEndMsg was accounted for twice -> put endmsg part back in, it broke wcn and didn't affect bge
// B2020-116: the 112 change broke a WCN print of single column. The end message adjustment was added back in and retested for 112 also // B2020-116: the 112 change broke a WCN print of single column. The end message adjustment was added back in and retested for 112 also
// and had no negative impact. // and had no negative impact.
// B2022-086: adjust yPageSize for non-first page when second (or later) page has a different printable box (don't include
// size of alarm box in Barakah alarms is particular case that bug was written for)
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.AdjFirstSecDocStylesInPagination && MyItemInfo.MyDocStyle.IndexOtherThanFirstPage != null) yPageSize = GetYPageSizeUseOnAllButFirstPage();
float ySpaceOnNextPage1 = yPageSize - (myTopMsgSpace + (yEndMsg == 0 ? SixLinesPerInch : 0)); // Allow for continue message and blank line. float ySpaceOnNextPage1 = yPageSize - (myTopMsgSpace + (yEndMsg == 0 ? SixLinesPerInch : 0)); // Allow for continue message and blank line.
ySpaceOnNextPage1 -= accountForSmartTemplateHeader; ySpaceOnNextPage1 -= accountForSmartTemplateHeader;
// This fixes B2016-174: // This fixes B2016-174:
@ -1486,6 +1493,7 @@ namespace Volian.Print.Library
// B2020-108: Original FindPageBreak was renamed to FindPageBreak1 so that an additional check can be made after // B2020-108: Original FindPageBreak was renamed to FindPageBreak1 so that an additional check can be made after
// the page break is found. Check if the location identified is a parent of a table that is too long to allow parent to fit // the page break is found. Check if the location identified is a parent of a table that is too long to allow parent to fit
// on the same page, if so break at the table rather than the parent. // on the same page, if so break at the table rather than the parent.
public int levelForPagination = -1;
private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak, float fullPage, private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak, float fullPage,
float myBottomMsgSpace, bool RNOContinueOnly, float yTop) float myBottomMsgSpace, bool RNOContinueOnly, float yTop)
{ {

View File

@ -1442,8 +1442,8 @@ namespace Volian.Print.Library
{ {
if (!Rtf2Pdf.PdfDebug) return "No Path"; if (!Rtf2Pdf.PdfDebug) return "No Path";
int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DebugInfo"); int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DebugInfo");
string retval = string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} ShortPath={5} Width={6} Left={7} YOffset={8}", string retval = string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} ShortPath={5} Width={6} Left={7} YOffset={8}, PaginationLevel = {9}, yPageSize = {10}",
DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData == null ? "NoStepData" : MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.ShortPath, Width, XOffset, YOffset); DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData == null ? "NoStepData" : MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.ShortPath, Width, XOffset, YOffset, levelForPagination, yPageSizeForPagination);
ProfileTimer.Pop(profileDepth); ProfileTimer.Pop(profileDepth);
return retval; return retval;
} }
@ -7067,6 +7067,7 @@ namespace Volian.Print.Library
{ {
if (!paraLoc.MyParagraph.MyItemInfo.IsTitle && paraLoc.MyParagraph.MyItemInfo.MyPrevious != null && paraLoc.MyParagraph.MyItemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") level = 0; if (!paraLoc.MyParagraph.MyItemInfo.IsTitle && paraLoc.MyParagraph.MyItemInfo.MyPrevious != null && paraLoc.MyParagraph.MyItemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") level = 0;
} }
paraLoc.MyParagraph.levelForPagination = level;
myList.Add(level, paraLoc.YTop, paraLoc.MyParagraph); myList.Add(level, paraLoc.YTop, paraLoc.MyParagraph);
} }
return myList; return myList;