Logic changed to support very long RNO with unrelated long AER. If the RNO will fit on a page by itself, and it will not fit if it starts where it is, it breaks the pagebefore the AER step.
This commit is contained in:
parent
925f18d7fb
commit
650aa8aa17
@ -370,7 +370,7 @@ namespace Volian.Print.Library
|
|||||||
while (((YSize - yTop) > ySpaceOnCurPage) || PageBreakOnStepList.Count > 0)
|
while (((YSize - yTop) > ySpaceOnCurPage) || PageBreakOnStepList.Count > 0)
|
||||||
{
|
{
|
||||||
ySpaceOnCurPage -= myBottomMsgSpace;
|
ySpaceOnCurPage -= myBottomMsgSpace;
|
||||||
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList, paraBreak);
|
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace);
|
||||||
if (paraBreak == null)
|
if (paraBreak == null)
|
||||||
{
|
{
|
||||||
_MyLog.ErrorFormat("<<< ERROR >>> Cannot find a place to break\r\n==>'Cannot Find Place to Break',{0},'{1}','{2}'"
|
_MyLog.ErrorFormat("<<< ERROR >>> Cannot find a place to break\r\n==>'Cannot Find Place to Break',{0},'{1}','{2}'"
|
||||||
@ -418,24 +418,31 @@ namespace Volian.Print.Library
|
|||||||
/// <param name="yTop"></param>
|
/// <param name="yTop"></param>
|
||||||
/// <param name="myList"></param>
|
/// <param name="myList"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak)
|
private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak, float fullPage)
|
||||||
{
|
{
|
||||||
vlnParagraph minPara = null;
|
vlnParagraph minPara = null;
|
||||||
foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest.
|
foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest.
|
||||||
{
|
{
|
||||||
foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation
|
foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation
|
||||||
{
|
{
|
||||||
|
float spaceOnPage = yUpperLimit + yLocation;
|
||||||
vlnParagraph myPara = myList[stepLevel][yLocation];
|
vlnParagraph myPara = myList[stepLevel][yLocation];
|
||||||
// The following lines were added for Comanche Peak ECA-TP-11-001A.SProcedure Steps.S17 (Printed as Step 12)
|
// The following lines were added for Comanche Peak ECA-TP-11-001A.SProcedure Steps.S17 (Printed as Step 12)
|
||||||
if (myPara.YSize > yUpperLimit && myPara.ChildrenRight != null && myPara.ChildrenRight.Count > 0 && myPara.ChildrenRight[0].YSize <= yUpperLimit)
|
if (myPara.YSize > fullPage && myPara.ChildrenRight != null && myPara.ChildrenRight.Count > 0
|
||||||
|
&& myPara.ChildrenRight[0].YSize <= fullPage && myPara.ChildrenRight[0].YSize > spaceOnPage)
|
||||||
|
{
|
||||||
|
_MyLog.WarnFormat("\r\nMyParaBreak {0},{1},{2},{3},{4}", myPara, myPara.YSize, yUpperLimit, myPara.ChildrenRight[0].YSize, spaceOnPage);
|
||||||
return myPara;
|
return myPara;
|
||||||
|
}
|
||||||
// The following lines were added for Comanche Peak ECA-0.1A.SProcedure Steps.S17 (Printed as Step 12)
|
// The following lines were added for Comanche Peak ECA-0.1A.SProcedure Steps.S17 (Printed as Step 12)
|
||||||
// ******************** NEEDS TO BE FIXED **********************
|
vlnParagraph myParent = myPara.MyParent;
|
||||||
//vlnParagraph myParent = myPara.MyParent;
|
spaceOnPage = yUpperLimit + myPara.YTop + yLocation - myParent.YTop;
|
||||||
//if (myParent != lastBreak && myParent.YSize > yUpperLimit && myParent.ChildrenRight != null && myParent.ChildrenRight.Count > 0 && myParent.ChildrenRight[0].YSize <= yUpperLimit)
|
if (myParent != lastBreak && myParent.YSize > fullPage && myParent.ChildrenRight != null && myParent.ChildrenRight.Count > 0
|
||||||
// _MyLog.WarnFormat("\r\nMyParentBreak {0},{1},{2},{3}", myParent, myParent.YSize, yUpperLimit,myParent.ChildrenRight[0].YSize);
|
&& myParent.ChildrenRight[0].YSize <= fullPage && myParent.ChildrenRight[0].YSize > spaceOnPage)
|
||||||
//Console.WriteLine("Here");
|
{
|
||||||
//return myParent;
|
_MyLog.WarnFormat("\r\nMyParentBreak {0},{1},{2},{3},{4}", myParent, myParent.YSize, yUpperLimit, myParent.ChildrenRight[0].YSize, spaceOnPage);
|
||||||
|
return myParent;
|
||||||
|
}
|
||||||
// The top of this step will fit onto page (-yLocation < yWithinMargins)
|
// The top of this step will fit onto page (-yLocation < yWithinMargins)
|
||||||
float wcnChkLstBorder = myPara.MyItemInfo.MyHLS != null && myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate &&
|
float wcnChkLstBorder = myPara.MyItemInfo.MyHLS != null && myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate &&
|
||||||
(myPara.MyItemInfo.MyHLS.FormatStepData.Suffix ?? "") != "" ? 2*SixLinesPerInch : 0;
|
(myPara.MyItemInfo.MyHLS.FormatStepData.Suffix ?? "") != "" ? 2*SixLinesPerInch : 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user