Print footnotes & separator lines for BGE Valve Sections

This commit is contained in:
Kathy Ruffing 2014-10-29 14:44:22 +00:00
parent 03385f2013
commit 7f8b048f8a

View File

@ -75,6 +75,11 @@ namespace Volian.Print.Library
int maxRnoSav = maxRNO;
foreach (ItemInfo iChildItemInfo in itemInfoList)
{
if (iChildItemInfo.IsNote && iChildItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.NotesToFootnotes)
{
vlnParagraph para = new vlnParagraph(Parent, cb, iChildItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRight, true);
continue; // don't add it, vlnParagraph adds this item to the footnote vlntext list in ToPdf.
}
maxRNO = maxRnoSav;
if (iChildItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox && iChildItemInfo.IsHigh) bxIndex = null;
if (iChildItemInfo.IsSection && (iChildItemInfo as SectionInfo).ColumnMode != maxRNO)
@ -1029,6 +1034,7 @@ namespace Volian.Print.Library
case 1: // Break on High Level Step
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
docstyle = MyItemInfo.MyDocStyle;
if (MyPageHelper.NotesToFootNotes != null) MyPageHelper.NotesToFootNotesYoffset = yLocation;
bool doSectionContinue = !MyItemInfo.IsSection && ((docstyle.StructureStyle.Style & E_DocStructStyle.BottomSectionContinue) == E_DocStructStyle.BottomSectionContinue);
if (doSectionContinue) DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, false);
cb.PdfDocument.NewPage();
@ -1068,6 +1074,11 @@ namespace Volian.Print.Library
//_MyLog.InfoFormat("NewPage 10 blank {0}", cb.PdfWriter.CurrentPageNumber);
}
}
if (MyItemInfo.MyDocStyle.LandscapePageList)
{
System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0);
cb.Transform(myMatrix);
}
yPageStart = yTopMargin + YTopMost;
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
@ -1109,7 +1120,7 @@ namespace Volian.Print.Library
}
}
}
if (MyPageHelper.NotesToFootNotes != null) MyPageHelper.NotesToFootNotesYoffset = yLocation;
DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, doThreeContinues);
cb.PdfDocument.NewPage();
if (MyItemInfo.IsStep && ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd))
@ -1231,6 +1242,7 @@ namespace Volian.Print.Library
if (!firstHighLevelStep)
{
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
if (MyPageHelper.NotesToFootNotes != null) MyPageHelper.NotesToFootNotesYoffset = yLocation;
cb.PdfDocument.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection)
//_MyLog.InfoFormat("NewPage 12 {0}", cb.PdfWriter.CurrentPageNumber);
//Console.WriteLine("'b3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset);
@ -1253,6 +1265,11 @@ namespace Volian.Print.Library
cb.PdfDocument.NewPage();
//_MyLog.InfoFormat("NewPage 12 lpi blank {0}", cb.PdfWriter.CurrentPageNumber);
}
if (MyItemInfo.MyDocStyle.LandscapePageList)
{
System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0);
cb.Transform(myMatrix);
}
// If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it
if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
@ -1335,6 +1352,23 @@ namespace Volian.Print.Library
Console.WriteLine("'No Header 1','{0}',{1},{2}", MyItemInfo.ShortPath, MyItemInfo.MyDocStyle.CancelSectTitle, MyItemInfo.MyDocStyle.SpecialStepsFoldout);
}
}
// see if this hls has footnotes, if so save them for vlnSvgPageHelper to put out
// and figure out yspace it takes for pagination.
if (MyItemInfo.IsHigh && MyPageHelper.NotesToFootNotesHLS.ContainsKey(MyItemInfo.ItemID))
{
List<int> myNotes = MyPageHelper.NotesToFootNotesHLS[MyItemInfo.ItemID];
foreach (int myNote in myNotes)
{
ItemInfo inote = ItemInfo.Get(myNote);
vlnText ntTxt = new vlnText(cb, null, inote.MyContent.Text, inote.MyContent.Text, (float)MyItemInfo.MyDocStyle.Layout.LeftMargin, 0, inote.FormatStepData.Font);
ntTxt.Width = (float)MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyItemInfo.MyDocStyle.Layout.LeftMargin;
if (MyPageHelper.NotesToFootNotes == null) MyPageHelper.NotesToFootNotes = new List<vlnText>();
MyPageHelper.NotesToFootNotes.Add(ntTxt);
}
MyPageHelper.NotesToFootNotesHLS.Remove(MyItemInfo.ItemID);
}
yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
@ -2020,6 +2054,21 @@ namespace Volian.Print.Library
Prefix = prefix;
Suffix = suffix;
MyItemInfo = itemInfo;
MyContentByte = cb;
if (itemInfo.IsNote && itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.NotesToFootnotes)
{
// notestofootnoteshls may need to be a list, a hls can have more than one note
// should it be list of vlntext.
if (MyPageHelper.NotesToFootNotesHLS.ContainsKey(itemInfo.MyHLS.ItemID))
MyPageHelper.NotesToFootNotesHLS[itemInfo.MyHLS.ItemID].Add(itemInfo.ItemID);
else
{
List<int> notesList = new List<int>();
notesList.Add(itemInfo.ItemID);
MyPageHelper.NotesToFootNotesHLS.Add(itemInfo.MyHLS.ItemID, notesList);
}
return;
}
// do some 'setup' for Calvert Alarms:
if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
{
@ -2055,7 +2104,7 @@ namespace Volian.Print.Library
MyTopRNO = MyParent.MyTopRNO;
if (MyTopRNO != null) MyTopRNO.LastRNO = this;
}
MyContentByte = cb;
if (!MyPageHelper.MyParagraphs.ContainsKey(itemInfo.ItemID)) MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this);
// if this a continuous subsection, refresh the style.
@ -2856,6 +2905,13 @@ namespace Volian.Print.Library
}
YBottomMost = yoff;
if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.LandscapePageList && MyItemInfo.MyDocStyle.ComponentList)
{
// put out line after step (for BGEVLV format)
float macroY = YBottomMost-(0.25f * SixLinesPerInch);
PartsLeft.Add(new vlnMacro((float)MyItemInfo.MyDocStyle.Layout.LeftMargin, macroY, "B9"));
}
// For Checklist, the substeps are in rows of data. The YBottomMost is the bottom most for
// the row.
if (savCheckListBottomMost != 0) YBottomMost = Math.Max(savCheckListBottomMost, YBottomMost);