Added property ChildrenProcessed to record how many procedures are found to process

Added code to display message box when no procedures are found to be processed and terminates the processing.
Utilized ChildrenProcessed property when processing procedures
Added format changes to correct remaining Braidwood issues
Added code to resolve unit information in section transition
Modified page break logic to resolve issue with Braidwood deviation documents
Added code to resolve page number when section is a word document section
Added check to verify location was not already in list prior to adding it to list
Reduced number of instances of Volian flexgrid during printing
This commit is contained in:
Rich
2014-01-30 21:00:18 +00:00
parent cad3c3d6ee
commit 60234adaf2
7 changed files with 45 additions and 13 deletions

View File

@@ -29,13 +29,18 @@ namespace Volian.Print.Library
private int Paginate(float yLocation, float yTopMargin, float yBottomMargin)
{
// Check if paginate on a separate section, if within a section. Top level section pagination happens in PromsPrinter
float yPageSize = yTopMargin - yBottomMargin;
bool ManualPageBreak = false;
float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin; // -SixLinesPerInch;
if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination())
{
ShowPageBreak(1, "Page Break between separate sections", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 1;
}
// if the EndForSingle format flag is set to false, then we do not print an End message if the section
// is a single column section.
bool _skipEndMessage = MyPageHelper.MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle;
float yPageSize = yTopMargin - yBottomMargin;
// TODO: This does not account for a long step as the last step that would exceed more than one page and
// that has an end message that needs to be accounted for in determining pagination. To do that the last
@@ -47,7 +52,6 @@ namespace Volian.Print.Library
// The 3 was changed to 2 for the end line & the line below. The blank line below the step gives the blank
// line above the end message, thus 2 not 3. This change was made on July 20, 2011 by RHM & KBR. The
// procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8.
bool ManualPageBreak = false;
float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
// The following code is to fix a pagination issue in SHE. It was decided to not put it into development
@@ -60,7 +64,6 @@ namespace Volian.Print.Library
//KBR debug: if (yEndsWithBlankLine != 0) Console.WriteLine("*** yEndsWithBlankLine = {0}", yEndsWithBlankLine);
//float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? ((2 * SixLinesPerInch) - yEndsWithBlankLine) : 0;
float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin; // -SixLinesPerInch;
bool isFirstChild = MyItemInfo.MyPrevious == null;
bool nearTheTop = (yWithinMargins < yPageSize) && (yWithinMargins > (yPageSize - 5 * SixLinesPerInch));
// if step is breaking over a number of pages, determine if the current step is the
@@ -152,6 +155,7 @@ namespace Volian.Print.Library
// if this step contains Cautions or Notes page breaks have to be added for those.
if (TopMostChild != this) PageBreakOnStep = true;
BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage); // Case 1 :Works for ES05 Step 15 SubStep 7
ShowPageBreak(1, "Page Break on Steps, Cautions or Notes", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 1;
}
@@ -383,6 +387,7 @@ namespace Volian.Print.Library
ySpaceOnCurPage -= myBottomMsgSpace;
vlnParagraph lastBreak = paraBreak;
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace);
Console.WriteLine("Break at {0}", paraBreak.MyItemInfo.ShortPath);
if (paraBreak == null)
{
_MyLog.ErrorFormat("<<< ERROR >>> Cannot find a place to break\r\n==>'Cannot Find Place to Break',{0},'{1}','{2}'"
@@ -406,7 +411,7 @@ namespace Volian.Print.Library
{
// If the next page break is beyond the next hls/caution/note, use the next
// hls/caution/note.
if (PageBreakOnStepList[0].YTop <= paraBreak.YTop)
if (PageBreakOnStepList[0].YTop <= paraBreak.YTop || PageBreakOnStepList[0].YSize - yTop <= ySpaceOnCurPage)
{
paraBreak = PageBreakOnStepList[0];
PageBreakOnStepList.RemoveAt(0);

View File

@@ -189,6 +189,7 @@ namespace Volian.Print.Library
}
private string BuildMSWordPDF(SectionInfo section)
{
if (section.PageNumber == 0) section.PageNumber = _MyHelper.CurrentPageNumber;
DateTime tStart = DateTime.Now;
string MSWordFile = null;
if (section.MyContent.ContentEntryCount == 1)

View File

@@ -1303,6 +1303,7 @@ namespace Volian.Print.Library
// from the beginning of the step.
// Note that yLocation is negative to have items in descending
// order so that adding yTop decrements their values.
if(!myList[stepLevel].ContainsKey(yTop - yLocation))
myList[stepLevel].Add(yTop - yLocation, para);
}
if (myList[stepLevel].Count == 0)
@@ -1666,9 +1667,9 @@ namespace Volian.Print.Library
float yForCheckoff = yoff; //0; - default checkoff row is same as FIRST line of text
// if dropCheckoff is true, then the checkoff is place on the same of row as the LAST line of text
bool dropCheckoff = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.DropCheckOff;
VlnFlexGrid myFlexGrid = new VlnFlexGrid(1, 1);
if (itemInfo.MyContent.MyGrid != null)
{
VlnFlexGrid myFlexGrid = new VlnFlexGrid(1, 1);
myFlexGrid.LoadGrid(itemInfo);
MyGrid = new vlnTable(myFlexGrid, cb);
Height = MyGrid.Height;
@@ -1900,9 +1901,9 @@ namespace Volian.Print.Library
float yoffadj = 0;
if (itemInfo.Tables[0].IsTable)
{
VlnFlexGrid fg = new VlnFlexGrid(1, 1);
fg.LoadGrid(itemInfo.Tables[0]);
if (fg.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !fg.TopRowHasBorder())
//VlnFlexGrid fg = myFlexGrid;
//fg.LoadGrid(itemInfo.Tables[0]);
if (myFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !myFlexGrid.TopRowHasBorder())
yoffadj = -SixLinesPerInch;
}