Consider whether an ‘End’ message is printed when determining page breaks

Added error log message ‘End Message LOW on page’, if the end message locates on the bottom line of page list box.
This commit is contained in:
Kathy Ruffing 2014-09-25 16:38:03 +00:00
parent c79e514f3b
commit eac2037172
2 changed files with 11 additions and 8 deletions

View File

@ -172,7 +172,7 @@ namespace Volian.Print.Library
// Document style: DSS_PageBreakHLS breaks on hls. // Document style: DSS_PageBreakHLS breaks on hls.
if (MyItemInfo.IsHigh && (MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageBreakHLS) == E_DocStructStyle.DSS_PageBreakHLS) if (MyItemInfo.IsHigh && (MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageBreakHLS) == E_DocStructStyle.DSS_PageBreakHLS)
{ {
BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage); BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg);
ShowPageBreak(1, "Page Break on DSS_PageBreakHLS", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); ShowPageBreak(1, "Page Break on DSS_PageBreakHLS", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 1; return 1;
} }
@ -181,7 +181,8 @@ namespace Volian.Print.Library
{ {
// if this step contains Cautions or Notes page breaks have to be added for those. // if this step contains Cautions or Notes page breaks have to be added for those.
if (TopMostChild != this) PageBreakOnStep = true; if (TopMostChild != this) PageBreakOnStep = true;
BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage); // Case 1 :Works for ES05 Step 15 SubStep 7
BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg); // Case 1 :Works for ES05 Step 15 SubStep 7
ShowPageBreak(1, "Page Break on Steps, Cautions or Notes", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); ShowPageBreak(1, "Page Break on Steps, Cautions or Notes", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 1; return 1;
} }
@ -302,7 +303,7 @@ namespace Volian.Print.Library
else else
ShowPageBreak(6, "HLS will have to split on current page", "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); ShowPageBreak(6, "HLS will have to split on current page", "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak);
//BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur //BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur
BuildPageBreakList(ySpaceOnFirstPage, yPageSize + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur BuildPageBreakList(ySpaceOnFirstPage, yPageSize + yExtra2, KeepStepsOnPage, yEndMsg); // Case 5 - Determine items where page break(s) occur
return 0; // Stay on this page return 0; // Stay on this page
} }
@ -318,7 +319,7 @@ namespace Volian.Print.Library
// Pagination Fix Break1LineShort2 // Pagination Fix Break1LineShort2
//BuildPageBreakList(yPageSize + yExtra, yPageSize); // Case 1 :Works for ES05 Step 15 SubStep 7 //BuildPageBreakList(yPageSize + yExtra, yPageSize); // Case 1 :Works for ES05 Step 15 SubStep 7
// Pagination Fix Break1LineShort4 // Pagination Fix Break1LineShort4
BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 1 :Works for ES05 Step 15 SubStep 7 BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg); // Case 1 :Works for ES05 Step 15 SubStep 7
return 1; // Paginate on High Level Steps return 1; // Paginate on High Level Steps
} }
//if (yWithinMargins > yPageSize / 2) //if (yWithinMargins > yPageSize / 2)
@ -417,7 +418,7 @@ namespace Volian.Print.Library
return pg; return pg;
return pg.MyParent.ChildrenBelow[0]; return pg.MyParent.ChildrenBelow[0];
} }
private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage) private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg)
{ {
// if this paragraph is flagged to pagebreakonstep (i.e. these are used by background documents // if this paragraph is flagged to pagebreakonstep (i.e. these are used by background documents
// to get each hls/caution/note to be on its own page), then any of the children above should // to get each hls/caution/note to be on its own page), then any of the children above should
@ -503,10 +504,11 @@ namespace Volian.Print.Library
ySpaceOnCurPage += SixLinesPerInch; ySpaceOnCurPage += SixLinesPerInch;
accountForSmartTemplateHeader = Height - (2 * SixLinesPerInch); accountForSmartTemplateHeader = Height - (2 * SixLinesPerInch);
} }
while (((YSize - yTop) > (ySpaceOnCurPage - (accountForCalvertAlarmConditionResponseFooter+yEndMsg))) || PageBreakOnStepList.Count > 0)
while (((YSize - yTop) > (ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter)) || PageBreakOnStepList.Count > 0)
{ {
float ySpaceOnCurPageSave = ySpaceOnCurPage; float ySpaceOnCurPageSave = ySpaceOnCurPage;
if (((YSize - yTop) <= (ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter)) || PageBreakOnStepList.Count > 0)
ySpaceOnCurPage -= yEndMsg;
ySpaceOnCurPage -= myBottomMsgSpace; ySpaceOnCurPage -= myBottomMsgSpace;
vlnParagraph lastBreak = paraBreak; vlnParagraph lastBreak = paraBreak;
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage-accountForCalvertAlarmConditionResponseFooter, yLowerLimit, paraBreak = FindPageBreak(yStart, ySpaceOnCurPage-accountForCalvertAlarmConditionResponseFooter, yLowerLimit,

View File

@ -1286,6 +1286,7 @@ namespace Volian.Print.Library
if (myMsg.Contains("%-12s")) if (myMsg.Contains("%-12s"))
myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12)); myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12));
float xpos = 0; float xpos = 0;
if (yTopMargin-docstyle.Layout.PageLength>=msg_yLocation) _MyLog.WarnFormat("End Message LOW on page: {0}, {1}, {2}, Page {3}",msg_yLocation, MyItemInfo.ItemID, MyItemInfo.ShortPath, MyPageHelper.CurrentPageNumber+1);
if ((docstyle.End.Margin ?? 0) != 0) if ((docstyle.End.Margin ?? 0) != 0)
{ {
xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin; xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin;