Support for SAMGS Supplemental Information
This commit is contained in:
@@ -78,6 +78,39 @@ namespace Volian.Print.Library
|
||||
ShowPageBreak(1, "Page Break before empty section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
|
||||
return 1;
|
||||
}
|
||||
// If printing a supinfo part, add an entry to the dictionary that says what page I am on.
|
||||
if (MyPageHelper.PrintingSupplmentalInformation)
|
||||
{
|
||||
int retval = 0;
|
||||
// came across a user defined preferred page break, increment the page count for the supplemental info pdf & return 1 to break the page.
|
||||
// the PrefPageBreak is set when creating the paragraphs (see vlnParagraph constructor)
|
||||
if (PrefPageBreak)
|
||||
{
|
||||
MyPromsPrinter.SupInfoPdfPageCount++;
|
||||
retval = 1;
|
||||
}
|
||||
// Printing the supplemental information pages to a pdf: add an item to the dictionary that says what page in the supinfo pdf
|
||||
// this item can be found on.
|
||||
if (MyItemInfo.IsSupInfoPart)
|
||||
{
|
||||
MyPromsPrinter.SupInfoPdfPage.Add(MyItemInfo.ItemID, MyPromsPrinter.SupInfoPdfPageCount);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
else if (MyItemInfo.MyDocStyle.SupplementalInformation && MyItemInfo.IsStep)
|
||||
{
|
||||
StepConfig sci = MyItemInfo.MyConfig as StepConfig;
|
||||
if (sci.Step_PreferredPagebreak)
|
||||
{
|
||||
if (MyItemInfo.IsHigh) return 1;
|
||||
// if this is the top caution/note return 1 also. Cautions always are first, that is why the check does not need to know if on a
|
||||
// caution that there are notes, but check does need if on a note, are there cautions:
|
||||
if (MyItemInfo.IsCaution && MyItemInfo.MyPrevious == null) return 1;
|
||||
if (MyItemInfo.IsNote && (MyItemInfo.MyParent.Cautions == null || MyItemInfo.MyParent.Cautions.Count == 0) && MyItemInfo.MyPrevious == null) return 1;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
@@ -87,6 +87,14 @@ namespace Volian.Print.Library
|
||||
}
|
||||
public class PromsPrinter
|
||||
{
|
||||
// used to link supinfo steps in pdf
|
||||
public int SupInfoPdfPageCount = -1;
|
||||
private Dictionary<int, int> _SupInfoPdfPage;
|
||||
public Dictionary<int, int> SupInfoPdfPage
|
||||
{
|
||||
get { return _SupInfoPdfPage; }
|
||||
set { _SupInfoPdfPage = value; }
|
||||
}
|
||||
// used to save word sections with resolved ROs (for export file generated from approve)
|
||||
private Dictionary<int, byte[]> _DocReplace;
|
||||
public Dictionary<int, byte[]> DocReplace
|
||||
@@ -687,6 +695,7 @@ namespace Volian.Print.Library
|
||||
int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout);
|
||||
string LastFmtName = null;
|
||||
int lastDocStyle = -1;
|
||||
bool firstStepSec = true;
|
||||
foreach (SectionInfo mySection in myProcedure.Sections)
|
||||
{
|
||||
if (((mySection.MyContent.Number.ToUpper() == "FOLDOUT" && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts)
|
||||
@@ -714,6 +723,7 @@ namespace Volian.Print.Library
|
||||
_MyHelper.AllowAllWatermarks = AllowAllWatermarks;
|
||||
_MyHelper.MyPdfWriter = cb.PdfWriter;
|
||||
_MyHelper.CreatingFoldoutPage = doingFoldout;
|
||||
_MyHelper.CreatingSupInfoPage = false;
|
||||
_MyHelper.MyPdfContentByte = cb;
|
||||
|
||||
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
|
||||
@@ -808,7 +818,7 @@ namespace Volian.Print.Library
|
||||
|
||||
if (mySection.IsAutoTOCSection)
|
||||
{
|
||||
if (cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
|
||||
if (((cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage) || myProcedure.ProcHasSupInfoData) && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
|
||||
{
|
||||
_MyHelper.OnBlankPage = true;
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
@@ -839,6 +849,18 @@ namespace Volian.Print.Library
|
||||
//_MyLog.InfoFormat("NewPage Begin Step Sect blank {0}", cb.PdfWriter.CurrentPageNumber);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the procedure has supplemental facing pages, but this section does not & it's the first section,
|
||||
// need a blank 'facing page'. Sections after the first will get blank 'facing page' in print's pagination logic
|
||||
if (myProcedure.ProcHasSupInfoData && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
|
||||
{
|
||||
_MyHelper.OnBlankPage = true;
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
NewPage();
|
||||
firstStepSec = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
CreateStepPdf(mySection, cb);
|
||||
}
|
||||
@@ -994,7 +1016,7 @@ namespace Volian.Print.Library
|
||||
OnStatusChanged("Read MSWord", PromsPrinterStatusType.ReadMSWord);
|
||||
if (doimport2)
|
||||
{
|
||||
if (!didFoldout && cb.PdfWriter.CurrentPageNumber > 1 && _MyFoldoutReader.Count > 0 && InsertBlankPages)
|
||||
if (((!didFoldout && _MyFoldoutReader.Count > 0) || mySection.MyProcedure.ProcHasSupInfoData) && cb.PdfWriter.CurrentPageNumber > 1 && InsertBlankPages)
|
||||
{
|
||||
// only insert a blank page if this section does not have a foldout (but the procedure as a whole does)
|
||||
// and the checkbox on the print dialog to add blank pages is checked
|
||||
@@ -1596,6 +1618,10 @@ namespace Volian.Print.Library
|
||||
float yPageStart = yTopMargin;
|
||||
if (myItemInfo.HasChildren || myItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || (myItemInfo.ActiveFormat.PlantFormat.FormatData.Express && myItemInfo.MyDocStyle.OptionalSectionContent))
|
||||
{
|
||||
// if there is supplemental information associated with this section... generate the pdf. This pdf will be used to place
|
||||
// supplemental information on facing pages
|
||||
if (myParagraph.SupInfoSection != null && myParagraph.SupInfoSection.ChildrenBelow != null && myParagraph.SupInfoSection.ChildrenBelow.Count > 0)
|
||||
GenerateSuppInfoPdf(myParagraph.SupInfoSection, yTopMargin, yBottomMargin);
|
||||
localYPageStart = myParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
if (myParagraph.MyPlaceKeeper != null)
|
||||
_MyHelper.MyPlacekeepers.Add(myParagraph.MyPlaceKeeper); // add this step text to the PlaceKeeper (Calvert Cliffs)
|
||||
@@ -1661,6 +1687,70 @@ namespace Volian.Print.Library
|
||||
//pt.Description = "End";
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
}
|
||||
|
||||
private void GenerateSuppInfoPdf(vlnParagraph vlnParagraph, float yTopMargin, float yBottomMargin)
|
||||
{
|
||||
ReaderHelper savMyReaderHelper = MyReaderHelper;
|
||||
PdfContentByte savMyContentByte = MyContentByte;
|
||||
VlnSvgPageHelper savMyHelper = _MyHelper;
|
||||
if (SupInfoPdfPage == null) SupInfoPdfPage = new Dictionary<int, int>();
|
||||
else SupInfoPdfPage.Clear();
|
||||
string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + vlnParagraph.MyItemInfo.ItemID.ToString() + @".pdf";
|
||||
PdfContentByte cb = OpenDoc(SupInfoPdfName, PageSize.LETTER);
|
||||
if (cb == null) return;
|
||||
VlnSvgPageHelper myPageHealper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0);
|
||||
cb.PdfWriter.PageEvent = myPageHealper;
|
||||
myPageHealper.AllowAllWatermarks = AllowAllWatermarks;
|
||||
myPageHealper.MyPdfWriter = cb.PdfWriter;
|
||||
myPageHealper.CreatingFoldoutPage = false;
|
||||
myPageHealper.CreatingSupInfoPage = true;
|
||||
myPageHealper.MyPdfContentByte = cb;
|
||||
myPageHealper.ChangeBarDefinition = MyChangeBarDefinition;
|
||||
myPageHealper.PrintingSupplmentalInformation = true;
|
||||
float yPageStart = yTopMargin;
|
||||
vlnParagraph._yPageStartForSupInfo = yTopMargin;
|
||||
vlnParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
try
|
||||
{
|
||||
cb.PdfDocument.Close();
|
||||
cb = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
_MyHelper = savMyHelper;
|
||||
MyContentByte = savMyContentByte;
|
||||
MyReaderHelper = savMyReaderHelper;
|
||||
}
|
||||
public void DoSupInfoPage(PdfContentByte cb, string str, PdfLayer textLayer, VlnSvgPageHelper myPageHelper, int itemid, bool insertBlankPages)
|
||||
{
|
||||
// see if the ID is in the facing page pdf - if so, get the page:
|
||||
if (SupInfoPdfPage == null || SupInfoPdfPage.Count < 1) return;
|
||||
int getpage = 0;
|
||||
if (SupInfoPdfPage.ContainsKey(itemid)) getpage = SupInfoPdfPage[itemid];
|
||||
if (getpage < 0)
|
||||
{
|
||||
myPageHelper.OnBlankPage = true;
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
NewPage();
|
||||
return;
|
||||
}
|
||||
PdfImportedPage sipage = null;
|
||||
try
|
||||
{
|
||||
string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + myPageHelper.MySection.ItemID.ToString() + @".pdf";
|
||||
PdfReader pdfreader = new PdfReader(SupInfoPdfName);
|
||||
sipage = cb.PdfWriter.GetImportedPage(pdfreader, getpage+1);
|
||||
AddImportedPageToLayer(cb.PdfWriter.DirectContent, textLayer, sipage, 0, 0);
|
||||
NewPage();
|
||||
pdfreader.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
}
|
||||
public void DoFoldoutPage(PdfContentByte cb, string str, PdfLayer textLayer, VlnSvgPageHelper myPageHelper, int foldoutindx, bool insertBlankPages)
|
||||
{
|
||||
if (_MyFoldoutSection == null || _MyFoldoutSection.Count==0) return;
|
||||
|
@@ -222,6 +222,12 @@ namespace Volian.Print.Library
|
||||
get { return _PrintedSectionPage; }
|
||||
set { _PrintedSectionPage = value; }
|
||||
}
|
||||
private bool _PrintingSupplmentalInformation = false;
|
||||
public bool PrintingSupplmentalInformation
|
||||
{
|
||||
get { return _PrintingSupplmentalInformation; }
|
||||
set { _PrintingSupplmentalInformation = value; }
|
||||
}
|
||||
|
||||
//private bool _AddBlankPagesForDuplexPrinting = false;
|
||||
//public bool AddBlankPagesForDuplexPrinting // Tells us if a the option to add a blank page is turn on (for procedures with duplex foldouts)
|
||||
@@ -252,7 +258,7 @@ namespace Volian.Print.Library
|
||||
DrawFootnotes(writer.DirectContent);
|
||||
DrawChangeBars(writer.DirectContent);
|
||||
DrawMessages(writer.DirectContent);
|
||||
if (!CreatingFoldoutPage)
|
||||
if (!CreatingFoldoutPage && !CreatingSupInfoPage)
|
||||
{
|
||||
DrawRuler(writer.DirectContent);
|
||||
float x = MySection == null ? 555 : (float)MySection.MyDocStyle.Layout.PageWidth;
|
||||
@@ -269,7 +275,7 @@ namespace Volian.Print.Library
|
||||
else
|
||||
MyPageCounts.CanIncrement = true;
|
||||
base.OnEndPage(writer, document);
|
||||
if (!CreatingFoldoutPage)
|
||||
if (!CreatingFoldoutPage && !CreatingSupInfoPage)
|
||||
DrawRuler(writer.DirectContent);
|
||||
}
|
||||
// added the check for onBlankPage and Foldouts to fix bug found in V.C. Summer auto table of contents - 03/08/2016
|
||||
|
@@ -446,6 +446,8 @@ namespace Volian.Print.Library
|
||||
get { return _IsWordDocPara; }
|
||||
set { _IsWordDocPara = value; }
|
||||
}
|
||||
public static bool HasPrefPageBreak = false; // use to track page breaks for supp info
|
||||
public bool PrefPageBreak = false;
|
||||
private bool _ShowSectionTitles;
|
||||
public bool ShowSectionTitles
|
||||
{
|
||||
@@ -565,6 +567,8 @@ namespace Volian.Print.Library
|
||||
int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DrawText");
|
||||
IsCompressed = (MyPageHelper.YMultiplier != 1 && MyItemInfo != null && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Font.Size >= 12 && (MyItemInfo.FormatStepData.Font.Style & E_Style.Underline) != 0);
|
||||
retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation);
|
||||
// _yPageStartForSupInfo is used to move steps down the page for the supinfo pdf. Each supinfo step may not be related to previous in structure, so need this to set y location.
|
||||
if (MyItemInfo.IsInSupInfo) _yPageStartForSupInfo = retval;
|
||||
// Wolf Creek Training format puts a separator line after printing the section number/title
|
||||
if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining)
|
||||
MyPageHelper.SectionSepLineYoffStart = retval - (SixLinesPerInch / 2);
|
||||
@@ -1461,6 +1465,11 @@ namespace Volian.Print.Library
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
return yPageStart;
|
||||
}
|
||||
if (MyItemInfo.IsInSupInfo) // if generating the pdf for supinfos (facing page) pdf, need a different cb to go to that file.
|
||||
{
|
||||
MyContentByte = cb;
|
||||
MyPageHelper = null;
|
||||
}
|
||||
bool doThreeContinues = false;
|
||||
// For BGE, the very first subsection's pagelist items were not correct - the section/meta section titles were
|
||||
// at the wrong level. Reset the page helper's section.
|
||||
@@ -1539,6 +1548,13 @@ namespace Volian.Print.Library
|
||||
MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null);
|
||||
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
|
||||
}
|
||||
// SupInfo has its own pagination and ylocation handling, reset ypagestart & ylocation if continuing on current page.
|
||||
// The value used was saved when the previous SupInfo step was printed.
|
||||
if (MyItemInfo.IsSupInfoPart)
|
||||
{
|
||||
yPageStart = _yPageStartForSupInfo - SixLinesPerInch;
|
||||
yLocation = yPageStart - YTopMost;
|
||||
}
|
||||
if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS))
|
||||
yPageStart -= SixLinesPerInch;
|
||||
if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep)
|
||||
@@ -1582,6 +1598,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
SectionInfo si = MyItemInfo as SectionInfo;
|
||||
MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null);
|
||||
|
||||
}
|
||||
// Only do foldout page if not done for section break, i.e. check the there's a previous step.
|
||||
if (MyItemInfo.MyPrevious != null && MyItemInfo.FoldoutIndex() > -1)
|
||||
@@ -1597,7 +1614,24 @@ namespace Volian.Print.Library
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
MyPromsPrinter.NewPage();
|
||||
//_MyLog.InfoFormat("NewPage 10 blank {0}", cb.PdfWriter.CurrentPageNumber);
|
||||
}
|
||||
}
|
||||
// If there is supplemental information to be printed on the facing page, then get the id that has supinfo
|
||||
// so that it can be retrieved from the pdf for the supinfos for this section. If there is one,
|
||||
// use DoSupInfoPage to put out the page, otherwise do a blank page.
|
||||
if (!MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
||||
{
|
||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||
if (sid != -1)
|
||||
{
|
||||
MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyPageHelper.OnBlankPage = true;
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
MyPromsPrinter.NewPage();
|
||||
}
|
||||
}
|
||||
if (MyItemInfo.MyDocStyle.LandscapePageList)
|
||||
{
|
||||
@@ -1606,7 +1640,8 @@ namespace Volian.Print.Library
|
||||
}
|
||||
yPageStart = yTopMargin + YTopMost;
|
||||
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
|
||||
SectionTopMessage(cb, yTopMargin, yLocation);
|
||||
SectionTopMessage(cb, yTopMargin, yLocation); // does wcntraining & suppinfo section title
|
||||
if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch);
|
||||
if (doSectionContinue ) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null);
|
||||
// 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 && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection))
|
||||
@@ -1688,7 +1723,20 @@ namespace Volian.Print.Library
|
||||
MyPromsPrinter.NewPage();
|
||||
_MyLog.InfoFormat("NewPage Break within step blank {0}", cb.PdfWriter.CurrentPageNumber);
|
||||
}
|
||||
|
||||
if (!MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
||||
{
|
||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||
if (sid != -1)
|
||||
{
|
||||
MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyPageHelper.OnBlankPage = true;
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
MyPromsPrinter.NewPage();
|
||||
}
|
||||
}
|
||||
// if there is a 'container vlnbox' around the HLS, flag that the drawn box must also break:
|
||||
if (MyHighLevelParagraph != null && MyHighLevelParagraph.PartsContainer != null && MyHighLevelParagraph.PartsContainer.Count > 0 &&
|
||||
!((MyHighLevelParagraph.MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS))
|
||||
@@ -1745,7 +1793,8 @@ namespace Volian.Print.Library
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
||||
}
|
||||
}
|
||||
addExtraLines = SectionTopMessage(cb, yTopMargin, yLocation); // this does wcntraining top section continue message
|
||||
addExtraLines = SectionTopMessage(cb, yTopMargin, yLocation); // this does wcntraining top section continue message and supplemental info message
|
||||
if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch);
|
||||
if (!addExtraLines && (!doSectionTitleContinued || !SectionShowTitles))
|
||||
addExtraLines = DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues && MyItemInfo.MyParent != null && MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.CleanText : null);
|
||||
|
||||
@@ -2043,6 +2092,44 @@ namespace Volian.Print.Library
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
return yPageStart;
|
||||
}
|
||||
// Find the step that has supplemental information from this step down page until a preferred page break is found.
|
||||
// It is used to determine whether there is a supinfo facing page or if there should be a blank page.
|
||||
private int GetIdThatHasSupInfoItems(ItemInfo ii, int startid)
|
||||
{
|
||||
if (ii == null) return -1;
|
||||
if (ii.SupInfos != null && ii.SupInfos.Count > 0) return ii.SupInfos[0].ItemID;
|
||||
int id = GetSubThatHasSupInfoItems(ii, startid);
|
||||
if (id != -1) return id;
|
||||
ItemInfo sib = ii.NextItem;
|
||||
while (sib != null)
|
||||
{
|
||||
if (sib.SupInfos != null && sib.SupInfos.Count > 0) return sib.SupInfos[0].ItemID;
|
||||
id = GetSubThatHasSupInfoItems(sib, startid);
|
||||
if (id != -1) return id;
|
||||
sib = sib.NextItem;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
private int GetSubThatHasSupInfoItems(ItemInfo ii, int startid)
|
||||
{
|
||||
if (ii is StepInfo && ((ii as StepInfo).MyConfig as StepConfig).Step_PreferredPagebreak && ii.ItemID != startid) return -1;
|
||||
if (ii.MyContent.ContentParts != null)
|
||||
{
|
||||
foreach (PartInfo pi in ii.MyContent.ContentParts)
|
||||
{
|
||||
if ((E_FromType)pi.FromType != E_FromType.SupInfo)
|
||||
{
|
||||
foreach (ItemInfo iic in pi.MyItems)
|
||||
{
|
||||
if (iic.SupInfos != null && iic.SupInfos.Count > 0) return iic.SupInfos[0].ItemID;
|
||||
int id = GetSubThatHasSupInfoItems(iic, startid);
|
||||
if (id != -1) return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
private float GetSectionTopMessageSize()
|
||||
{
|
||||
// B2016-134: Account for wcntraining section top continue if item has container
|
||||
@@ -2057,6 +2144,17 @@ namespace Volian.Print.Library
|
||||
// section is continued from previous page) in the Responsibility column.
|
||||
private bool SectionTopMessage(PdfContentByte cb, float yTopMargin, float yLocation)
|
||||
{
|
||||
if (MyPageHelper.CreatingSupInfoPage)
|
||||
{
|
||||
float scttopWidths = "Supplemental Information".Length * 6;
|
||||
float ctrs = ((float)MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyItemInfo.MyDocStyle.Layout.LeftMargin) / 2;
|
||||
float sctcntrXs = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ctrs - (scttopWidths / 2);
|
||||
VE_Font vf = MyItemInfo.MyDocStyle.Font;
|
||||
E_Style sty = (E_Style)(vf.Style | E_Style.Underline);
|
||||
vf = new VE_Font(vf.Family, (int)vf.Size, sty, (float)vf.CPI);
|
||||
MyPageHelper.TopMessage = new vlnText(cb, this, "Supplemental Information", "Supplemental Information", sctcntrXs, yTopMargin + 0.1F, vf);
|
||||
return true;
|
||||
}
|
||||
bool addextra = false;
|
||||
if (MyItemInfo.MyDocStyle.SectTop != null && MyItemInfo.MyDocStyle.SectTop.Message != null)
|
||||
{
|
||||
@@ -2841,6 +2939,7 @@ namespace Volian.Print.Library
|
||||
get { return _MyPromsPrinter; }
|
||||
set { _MyPromsPrinter = value; }
|
||||
}
|
||||
public static float _yPageStartForSupInfo = 0;
|
||||
public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent, bool loadChildren, PromsPrinter pp)
|
||||
{
|
||||
MyPromsPrinter = pp ?? parent.MyPromsPrinter;
|
||||
@@ -2952,6 +3051,8 @@ namespace Volian.Print.Library
|
||||
|
||||
if (itemInfo.IsFootnote) itemInfo.MyTab = null;
|
||||
|
||||
if (itemInfo.IsSupInfoPart) XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
||||
|
||||
//if (itemInfo.MyTab != null && itemInfo.MyTab.Text != null && itemInfo.MyTab.Text != "")
|
||||
// bug fix - if the section does not have a section number, then we need to build an empty tab for the itemInfo
|
||||
// so that we place the section title in the correct location. so we need to go into this IF code block
|
||||
@@ -2980,6 +3081,8 @@ namespace Volian.Print.Library
|
||||
else
|
||||
doprint = false;
|
||||
}
|
||||
// if printing the supplemental info facing page, don't put out the section title. ToPdf will put out 'Supplemental Information' title.
|
||||
if (MyPageHelper.CreatingSupInfoPage && itemInfo.IsSection) doprint = false;
|
||||
if (doprint && itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && itemInfo.MyTab.Text.ToUpper() != "FOLDOUT")
|
||||
{
|
||||
doSectTab = true;
|
||||
@@ -3059,7 +3162,16 @@ namespace Volian.Print.Library
|
||||
}
|
||||
if (!itemInfo.IsSection || doSectTab)
|
||||
{
|
||||
if (itemInfo.MyTab.AltPrintTab != null)
|
||||
if (itemInfo.IsSupInfoPart) // get combined tab if on a supinfo facing page:
|
||||
{
|
||||
string strmytab = null;
|
||||
if (itemInfo.MyParent.IsHigh)
|
||||
strmytab = itemInfo.MyTab.CleanText;
|
||||
else
|
||||
strmytab = ItemInfo.GetCombinedTab(itemInfo.MyParent, itemInfo.MyParent.MyParent.CombinedTab);
|
||||
mytab = new vlnTab(cb, this, strmytab, strmytab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline);
|
||||
}
|
||||
else if (itemInfo.MyTab.AltPrintTab != null)
|
||||
mytab = new vlnTab(cb, this, itemInfo.MyTab.AltPrintTab, itemInfo.MyTab.AltPrintTab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline);
|
||||
else
|
||||
mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, itemInfo.MyTab.CleanText, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline);
|
||||
@@ -3123,6 +3235,11 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
|
||||
if (itemInfo.IsSection && MyParent == null && itemInfo.MyDocStyle.SupplementalInformation)
|
||||
{
|
||||
_SupInfoSection = new vlnParagraph(this, cb, itemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRightParent, false, pp);
|
||||
MyPromsPrinter.SupInfoPdfPageCount = -1;
|
||||
}
|
||||
// For Calvert Alarms: if within the CONDITION/RESPONSE table, indent by 1 character.
|
||||
// Sequential substeps are ok because of the tab string, but items without a tab & other step
|
||||
// types were writing over the CONDITION/RESPONSE vertical table line. This code uses
|
||||
@@ -3196,7 +3313,13 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemInfo is StepInfo && ((itemInfo as StepInfo).MyConfig as StepConfig).Step_PreferredPagebreak) HasPrefPageBreak = true;
|
||||
if (loadChildren && itemInfo.SupInfos != null)
|
||||
{
|
||||
SupInfoSection.ChildrenBelow.Add(cb, itemInfo.SupInfos, XOffset, 0, 0, rnoLevel, maxRNO, formatInfo);
|
||||
SupInfoSection.ChildrenBelow[SupInfoSection.ChildrenBelow.Count - 1].PrefPageBreak = HasPrefPageBreak;
|
||||
HasPrefPageBreak = false;
|
||||
}
|
||||
// Without the following, BGE had gaps in y-direction if the AER/RNO both had cautions/notes.
|
||||
// The only time this needs done is if caution/notes are printed in separate columns in dual
|
||||
// column mode (used the DoubleBoxHLS BGE flag for this - if another plant needs this, make it
|
||||
@@ -4884,6 +5007,23 @@ namespace Volian.Print.Library
|
||||
if (MyItemInfo.IsHigh) return this;
|
||||
return MyParent.GetHighLevelParagraph();
|
||||
}
|
||||
private vlnParagraph _SupInfoSection;
|
||||
public vlnParagraph SupInfoSection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SupInfoSection == null)
|
||||
{
|
||||
_SupInfoSection = GetSupInfoSectionParagraph();
|
||||
}
|
||||
return _SupInfoSection;
|
||||
}
|
||||
}
|
||||
private vlnParagraph GetSupInfoSectionParagraph()
|
||||
{
|
||||
if (MyItemInfo.IsSection) return this._SupInfoSection;
|
||||
return MyParent.GetSupInfoSectionParagraph();
|
||||
}
|
||||
// Tab, Separator, ChangeBar, Box, Circle, Checkoff
|
||||
private vlnTab _MyTab;
|
||||
public vlnTab MyTab
|
||||
@@ -5000,6 +5140,18 @@ namespace Volian.Print.Library
|
||||
|
||||
public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab, float xMetaAdj)
|
||||
{
|
||||
if (itemInfo.IsSupInfoPart)
|
||||
{
|
||||
int addForTab = itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote ? 72 : 36;
|
||||
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + addForTab; // add in an inch to allow for enough space for Note/Caution tab
|
||||
if (myTab != null)
|
||||
{
|
||||
myTab.XOffset = XOffset - ((myTab == null) ? 0 : myTab.Width) - 12;
|
||||
if (!itemInfo.MyParent.IsHigh && !itemInfo.MyParent.IsCaution && !itemInfo.MyParent.IsNote) myTab.Width = 2 * myTab.Width;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
float tabWidth = (myTab == null) ? 0 : myTab.Width;
|
||||
if (itemInfo.IsStepSection)
|
||||
{
|
||||
|
Reference in New Issue
Block a user