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:
		| @@ -1414,6 +1414,15 @@ namespace VEPROMS.CSLA.Library | ||||
| 				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 | ||||
| 	#region VersionIdText | ||||
|   | ||||
| @@ -899,6 +899,7 @@ namespace Volian.Print.Library | ||||
| 			pg = pg.TopMostChild; | ||||
| 			return pg; | ||||
| 		} | ||||
| 		public float yPageSizeForPagination = -1; | ||||
| 		private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg, bool doSectionTitleContinued, bool onNewPage) | ||||
| 		{ | ||||
| 			float topContinueHeight = 2 * SixLinesPerInch; | ||||
| @@ -973,6 +974,8 @@ namespace Volian.Print.Library | ||||
|  | ||||
| 			string myTopMsg = docstyle.Continue.Top.Message; | ||||
| 			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 | ||||
| 			// 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; | ||||
| @@ -1039,6 +1042,7 @@ namespace Volian.Print.Library | ||||
| 					paraBreak = FindPageBreak(yStart, ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter - yAccountForBottomMsg, yLowerLimit, | ||||
| 						myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace, | ||||
| 						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. | ||||
| 					//           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. | ||||
| @@ -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-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. | ||||
| 				// 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. | ||||
| 				ySpaceOnNextPage1 -= accountForSmartTemplateHeader; | ||||
| 				// 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 | ||||
| 		//	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. | ||||
| 		public int levelForPagination = -1; | ||||
| 		private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak, float fullPage, | ||||
| 			float myBottomMsgSpace, bool RNOContinueOnly, float yTop) | ||||
| 		{ | ||||
|   | ||||
| @@ -1442,8 +1442,8 @@ namespace Volian.Print.Library | ||||
| 			{ | ||||
| 				if (!Rtf2Pdf.PdfDebug) return "No Path"; | ||||
| 				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}", | ||||
| 					DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData == null ? "NoStepData" : MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.ShortPath, Width, XOffset, YOffset); | ||||
| 				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, levelForPagination, yPageSizeForPagination); | ||||
| 				ProfileTimer.Pop(profileDepth); | ||||
| 				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; | ||||
| 				} | ||||
| 				paraLoc.MyParagraph.levelForPagination = level; | ||||
| 				myList.Add(level, paraLoc.YTop, paraLoc.MyParagraph); | ||||
| 			} | ||||
| 			return myList; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user