Development #256

Merged
djankowski merged 5 commits from Development into master 2024-02-29 13:23:48 -05:00
10 changed files with 967 additions and 1079 deletions

Binary file not shown.

Binary file not shown.

View File

@ -59,10 +59,8 @@ namespace VEPROMS
get { return _Automatic; } get { return _Automatic; }
set { _Automatic = value; } set { _Automatic = value; }
} }
// C2024-003 parameter contains parent section, child section, issubsection flag. private int _prtSectID = -1;
// C2024-003 values needed to print section. public int PrtSectID
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
{ {
get { return _prtSectID; } get { return _prtSectID; }
set { _prtSectID = value; } set { _prtSectID = value; }
@ -145,8 +143,7 @@ namespace VEPROMS
} }
public string PDFPath public string PDFPath
{ {
get get {// B2018-069 Revert to Temporary for Baseline testing
{// B2018-069 Revert to Temporary for Baseline testing
if (PromsPrinter.BaselineTesting) if (PromsPrinter.BaselineTesting)
return VlnSettings.TemporaryFolder; return VlnSettings.TemporaryFolder;
return txbPDFLocation.Text; return txbPDFLocation.Text;

View File

@ -91,15 +91,13 @@ namespace VEPROMS
get { return _DidAll; } get { return _DidAll; }
set { _DidAll = value; } set { _DidAll = value; }
} }
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. private int _prtSectID = -1;
// C2024-003 values needed to print section. public int PrtSectID
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
{ {
get { return _prtSectID; } get { return _prtSectID; }
set { _prtSectID = value; } set { _prtSectID = value; }
} }
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int[] PrtSectID = null) public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1)
{ {
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic // B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic
ProcedureInfo MyProcedure = myItem as ProcedureInfo; ProcedureInfo MyProcedure = myItem as ProcedureInfo;

View File

@ -1197,21 +1197,7 @@ namespace VEPROMS
{ {
//args.Node.Parent. //args.Node.Parent.
SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo; SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo;
int[] _prtSectID = new int[3]; // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. int _prtSectID = si2.ItemID;
if (si2.IsSubsection == true)
{
// If section is a subsection. Assigned values are section and subsection.
_prtSectID[0] = si2.MyParent.ItemID; // section
_prtSectID[1] = si2.ItemID; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
else
{
// If section is a regular section. assign values is section is not a subsection.
_prtSectID[0] = si2.ItemID; // section
_prtSectID[1] = -1; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
if (si2 == null) return; if (si2 == null) return;
@ -1221,7 +1207,7 @@ namespace VEPROMS
using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(si2.MyProcedure)) using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(si2.MyProcedure))
{ {
prnDlg.PrtSectID = _prtSectID; // Assign Section print values to parameter used in print secetions / sub sections. prnDlg.PrtSectID = _prtSectID;
prnDlg.SelectedSlave = args.UnitIndex; prnDlg.SelectedSlave = args.UnitIndex;
prnDlg.MySessionInfo = MySessionInfo; prnDlg.MySessionInfo = MySessionInfo;
prnDlg.SetupForProcedure(); // Setup filename prnDlg.SetupForProcedure(); // Setup filename

View File

@ -842,6 +842,7 @@ namespace Volian.Controls.Library
MenuItem mitcas = new MenuItem("Create Time Critical Action Summary"); //F2022-024 added menu option MenuItem mitcas = new MenuItem("Create Time Critical Action Summary"); //F2022-024 added menu option
MenuItem mip = new MenuItem("Print"); MenuItem mip = new MenuItem("Print");
MenuItem miqp = new MenuItem("Quick Print"); MenuItem miqp = new MenuItem("Quick Print");
//MenuItem mips = new MenuItem("Print Section");
MenuItem mia = new MenuItem("Approve"); MenuItem mia = new MenuItem("Approve");
int k = 0; int k = 0;
foreach (string s in pri.MyDocVersion.UnitNames) foreach (string s in pri.MyDocVersion.UnitNames)
@ -855,6 +856,9 @@ namespace Volian.Controls.Library
MenuItem mqp = miqp.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); MenuItem mqp = miqp.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
mqp.Enabled = procAppl; mqp.Enabled = procAppl;
mqp.Tag = k; mqp.Tag = k;
//MenuItem mps = mips.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
//mps.Enabled = procAppl;
//mps.Tag = k;
MenuItem ma = mia.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); MenuItem ma = mia.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
ma.Enabled = procAppl; ma.Enabled = procAppl;
ma.Tag = k; ma.Tag = k;
@ -880,9 +884,13 @@ namespace Volian.Controls.Library
cm.MenuItems.Add("Create Time Critical Action Summary", new EventHandler(mi_Click)); cm.MenuItems.Add("Create Time Critical Action Summary", new EventHandler(mi_Click));
cm.MenuItems.Add("Print", new EventHandler(mi_Click)); cm.MenuItems.Add("Print", new EventHandler(mi_Click));
cm.MenuItems.Add("Quick Print", new EventHandler(mi_Click)); cm.MenuItems.Add("Quick Print", new EventHandler(mi_Click));
//cm.MenuItems.Add("Print Section", new EventHandler(mi_Click));
//MenuItem miqp = new MenuItem("Print");
AddShowChangeBarsAfterMenuItem(cm.MenuItems, pri); AddShowChangeBarsAfterMenuItem(cm.MenuItems, pri);
cm.MenuItems.Add("Approve", new EventHandler(mi_Click)); cm.MenuItems.Add("Approve", new EventHandler(mi_Click));
//_MyLog.WarnFormat("Context Menu 1 before - {0}", GC.GetTotalMemory(true));
AddApprovedRevisions(cm.MenuItems, pri); AddApprovedRevisions(cm.MenuItems, pri);
//_MyLog.WarnFormat("Context Menu 1 after - {0}", GC.GetTotalMemory(true));
} }
} }
else else
@ -984,6 +992,13 @@ namespace Volian.Controls.Library
} }
#endregion #endregion
//_MyLog.WarnFormat("Context Menu 2 - {0}", GC.GetTotalMemory(true)); //_MyLog.WarnFormat("Context Menu 2 - {0}", GC.GetTotalMemory(true));
//#region Print_Section
//if (!tn.IsExpanded && tn.VEObject as SectionInfo != null)
//{
// SectionInfo si = tn.VEObject as SectionInfo;
// if (si.IsStepSection) cm.MenuItems.Add("Print Section", new EventHandler(mi_Click));
//}
//#endregion
#region Menu_Open #region Menu_Open
if (!tn.IsExpanded && tn.VEObject as SectionInfo != null) if (!tn.IsExpanded && tn.VEObject as SectionInfo != null)
{ {
@ -1430,8 +1445,7 @@ namespace Volian.Controls.Library
bool superceded = false; bool superceded = false;
MenuItem mi = sender as MenuItem; MenuItem mi = sender as MenuItem;
if (mi == null) return; if (mi == null) return;
//RevisionInfo ri = mi.Tag as RevisionInfo; RevisionInfo ri = mi.Tag as RevisionInfo;
RevisionInfo ri = RevisionInfo.Get(int.Parse(mi.Tag.ToString()));
{ {
MenuItem mip = mi.Parent as MenuItem; MenuItem mip = mi.Parent as MenuItem;
//B2021-086 Added the check for the last revision stage is an Approved stage //B2021-086 Added the check for the last revision stage is an Approved stage

View File

@ -1824,7 +1824,7 @@ namespace Volian.Print.Library
// B2020-073 was not keeping all of RNO sub-step together - Comanche Peak FRC-0.1 (unit 1) Step 14 // B2020-073 was not keeping all of RNO sub-step together - Comanche Peak FRC-0.1 (unit 1) Step 14
// B2020-081 was breaking on an AER substep that has an long RNO - should keep AER substep and part of RNO on the page = D.C. Cook "Current (Post FLEX) U1 NOP NOT [EOPs]" set, ES-0.1 step 1. // B2020-081 was breaking on an AER substep that has an long RNO - should keep AER substep and part of RNO on the page = D.C. Cook "Current (Post FLEX) U1 NOP NOT [EOPs]" set, ES-0.1 step 1.
// B2020-085 was breaking first child of second RNO (third IF in RNO) - should break on second child of second RNO - D.C. Cook AOP Unit 1 002-020 Step 15 // B2020-085 was breaking first child of second RNO (third IF in RNO) - should break on second child of second RNO - D.C. Cook AOP Unit 1 002-020 Step 15
// B2020-099 was breaking on last sub-step of previous RNO - Calvert Approved Procedures; Abnormal Procedures <20> Unit 2; AOP-2A; Section VII; Step 11.RNO.11.1.c // B2020-099 was breaking on last sub-step of previous RNO - Calvert Approved Procedures; Abnormal Procedures Unit 2; AOP-2A; Section VII; Step 11.RNO.11.1.c
private vlnParagraph HasSecondRNOThatWillFit(float yStart, float yLowerLimit, float yUpperLimit, StepLevelList myList, int stepLevel, float yTop) private vlnParagraph HasSecondRNOThatWillFit(float yStart, float yLowerLimit, float yUpperLimit, StepLevelList myList, int stepLevel, float yTop)
{ {
// B2020-120: for calvert alarms/condition response table, don't run code for second rno // B2020-120: for calvert alarms/condition response table, don't run code for second rno

View File

@ -179,10 +179,8 @@ namespace Volian.Print.Library
get { return _PDFFile; } get { return _PDFFile; }
set { _PDFFile = value; } set { _PDFFile = value; }
} }
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. private int _prtSectID = -1;
// C2024-003 values needed to print individual sections. public int PrtSectID
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
{ {
get { return _prtSectID; } get { return _prtSectID; }
set { _prtSectID = value; } set { _prtSectID = value; }
@ -325,7 +323,7 @@ namespace Volian.Print.Library
set { _MergedPdf = value; } set { _MergedPdf = value; }
} }
public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite,
ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, int removeTrailngHardReturnsAndManualPageBreaks, string blankPageText, bool didAll, MergedPdf mergedPdf, string watermarkColor, int[] PrtSectID = null) ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, int removeTrailngHardReturnsAndManualPageBreaks, string blankPageText, bool didAll, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1)
{ {
Prefix = prefix; // RHM20150506 Multiline ItemID TextBox Prefix = prefix; // RHM20150506 Multiline ItemID TextBox
_MyItem = myItem; _MyItem = myItem;
@ -343,8 +341,6 @@ namespace Volian.Print.Library
_BatchPrint = batchPrint; _BatchPrint = batchPrint;
_MyReaderHelper = new ReaderHelper(this); _MyReaderHelper = new ReaderHelper(this);
_SaveLinks = saveLinks; _SaveLinks = saveLinks;
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag.
_prtSectID = PrtSectID;
// C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. // C2021-010: Remove trailing returns/spaces & manual page breaks & allow save.
if (removeTrailngHardReturnsAndManualPageBreaks == 1 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveTrailingHardReturnsAndSpaces = new List<int>(); if (removeTrailngHardReturnsAndManualPageBreaks == 1 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveTrailingHardReturnsAndSpaces = new List<int>();
if (removeTrailngHardReturnsAndManualPageBreaks == 2 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveManualPageBreaks = new List<int>(); if (removeTrailngHardReturnsAndManualPageBreaks == 2 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveManualPageBreaks = new List<int>();
@ -352,7 +348,8 @@ namespace Volian.Print.Library
_DidAll = didAll; _DidAll = didAll;
_MergeNotIncluded = false; _MergeNotIncluded = false;
_MergedPdf = mergedPdf; _MergedPdf = mergedPdf;
_prtSectID = PrtSectID;
//_MyReaderHelper.LoadTree(myItem);
} }
// Pass 1 PDF Name // Pass 1 PDF Name
private string _BeforePageNumberPdf = null; private string _BeforePageNumberPdf = null;
@ -371,11 +368,11 @@ namespace Volian.Print.Library
// B2019-152: MergedLandscapePages is a dictionary whose key is the pdf file name & values are all of the page numbers // B2019-152: MergedLandscapePages is a dictionary whose key is the pdf file name & values are all of the page numbers
// in that pdf that should have landscaped page numbers. These are added when the page is finished (onEndPage) // in that pdf that should have landscaped page numbers. These are added when the page is finished (onEndPage)
public static Dictionary<string, List<int>> MergedLandscapePages = null; public static Dictionary<string, List<int>> MergedLandscapePages = null;
public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary, int[] PrtSectID = null) public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary, int PrtSectID = -1)
{ {
if (_MyItem is ProcedureInfo) if (_MyItem is ProcedureInfo)
{ {
_prtSectID = PrtSectID; // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. _prtSectID = PrtSectID;
ProcedureConfig pcfg = (ProcedureConfig)(_MyItem as ProcedureInfo).MyConfig; ProcedureConfig pcfg = (ProcedureConfig)(_MyItem as ProcedureInfo).MyConfig;
if (DidAll && pcfg.Print_NotInMergeAll) // will be merging a pdf, so don't print this procedure if user set that on procedure propertures if (DidAll && pcfg.Print_NotInMergeAll) // will be merging a pdf, so don't print this procedure if user set that on procedure propertures
{ {
@ -807,46 +804,23 @@ namespace Volian.Print.Library
VlnItextFont.RegisterFontFolder(); //B2019-174 register the font folder so that symbols will display on auto TOC VlnItextFont.RegisterFontFolder(); //B2019-174 register the font folder so that symbols will display on auto TOC
if (myProcedure.Sections != null) if (myProcedure.Sections != null)
{ {
SectionInfo CurSection = null; // C2024-003 detrimine if the user in printing a sub section.
if (Convert.ToBoolean(PrtSectID[2])) // If section is a CurSection retrieved the CurSection.
{
foreach (SectionInfo si2 in myProcedure.Sections)
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find Parent Section
{
if (subsi.ItemID == PrtSectID[1]) // Find sub section
{
CurSection = subsi; // Assign the subsection object to CurSection.
}
}
}
}
}
int cnt = 0; int cnt = 0;
foreach (SectionInfo mySection in myProcedure.Sections) foreach (SectionInfo mySection in myProcedure.Sections)
{ {
if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0])) // C2024-003 check if the user is printing a section if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID))
{ {
if (!mySection.MyDocStyle.IsStepSection && !mySection.IsAutoTOCSection)
if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection. CurSection contains any type of section.
{ {
CurSection = mySection; // if section is not a sub section. VEPROMS.CSLA.Library.Document.ConvertWordSectionToDOCX((ItemInfo)mySection); // B2023-093 Convert a Word section to the DOCX Word format if needed before printing
}
if (!CurSection.MyDocStyle.IsStepSection && !CurSection.IsAutoTOCSection)
{
VEPROMS.CSLA.Library.Document.ConvertWordSectionToDOCX((ItemInfo)CurSection); // B2023-093 Convert a Word section to the DOCX Word format if needed before printing
} }
//C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y") if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y")
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y")) || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"))
{ {
// if floating foldouts, need a list of sections & foldoutreaders. Just do first for now. // if floating foldouts, need a list of sections & foldoutreaders. Just do first for now.
_MyFoldoutSection.Add(CurSection); _MyFoldoutSection.Add(mySection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, CurSection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false, false); string foldoutPdf = PrintProcedureOrFoldout(myProcedure, mySection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false, false);
_MyFoldoutReader.Add(foldoutPdf != null ? new PdfReader(foldoutPdf) : null); _MyFoldoutReader.Add(foldoutPdf != null ? new PdfReader(foldoutPdf) : null);
cnt++; cnt++;
} }
@ -977,67 +951,44 @@ namespace Volian.Print.Library
string clr = pc.GetValue("PSI", "WATERMARKOVERRIDECLR"); string clr = pc.GetValue("PSI", "WATERMARKOVERRIDECLR");
if (clr != null && clr != "") WatermarkOverrideColor = clr.ToUpper().Contains("DEFAULT") ? "BLUE" : clr; if (clr != null && clr != "") WatermarkOverrideColor = clr.ToUpper().Contains("DEFAULT") ? "BLUE" : clr;
} }
SectionInfo CurSection = null; // C2024-003 detrimine if the user is printing a sub section.1639
if (Convert.ToBoolean(PrtSectID[2]))
{
foreach (SectionInfo si2 in myProcedure.Sections) // Find parent section.
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find selected sub section.
{
if (subsi.ItemID == PrtSectID[1])
{
CurSection = subsi; // Assign sub section object to CurSection.
}
}
}
}
}
foreach (SectionInfo mySection in myProcedure.Sections) foreach (SectionInfo mySection in myProcedure.Sections)
{ {
if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0])) if(PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID) )
{ {
if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection
{
CurSection = mySection;
}
// B2020-115 Calculate maximum available space on a page for figures // B2020-115 Calculate maximum available space on a page for figures
vlnParagraph.hMax = ((float)CurSection.MyDocStyle.Layout.PageLength); vlnParagraph.hMax = ((float)mySection.MyDocStyle.Layout.PageLength);
vlnParagraph.wMax = ((float)CurSection.MyDocStyle.Layout.PageWidth) - ((float)CurSection.MyDocStyle.Layout.LeftMargin - 12); vlnParagraph.wMax = ((float)mySection.MyDocStyle.Layout.PageWidth) - ((float)mySection.MyDocStyle.Layout.LeftMargin - 12);
NeedSupInfoBreak = true; NeedSupInfoBreak = true;
bool isFoldoutSection = (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box bool isFoldoutSection = (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
if (((isFoldoutSection && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts) if (((isFoldoutSection && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts)
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection)) || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection))
!= doingFoldout) continue; != doingFoldout) continue;
if (myFoldoutSection != null && myFoldoutSection.ItemID != CurSection.ItemID) continue; if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
PrintOverride.CompressSuper = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper; PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub; PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
PrintOverride.CompressPropSubSup = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup; PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
OnStatusChanged((CurSection.DisplayNumber ?? "") == "" ? CurSection.DisplayText : CurSection.DisplayNumber, PromsPrinterStatusType.Progress, progress++); OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
// Set up Helper for the particular Section // Set up Helper for the particular Section
if (_MyHelper == null) if (_MyHelper == null)
{ {
LastFmtName = CurSection.ActiveFormat.Name; LastFmtName = mySection.ActiveFormat.Name;
lastDocStyle = (int)CurSection.MyDocStyle.Index; lastDocStyle = (int)mySection.MyDocStyle.Index;
string hlsText = ""; string hlsText = "";
int hlsItemId = 0; int hlsItemId = 0;
if (CurSection.IsStepSection && CurSection.Steps != null && CurSection.Steps.Count > 0) if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
{ {
hlsItemId = CurSection.Steps[0].ItemID; hlsItemId = mySection.Steps[0].ItemID;
hlsText = CurSection.Steps[0].DisplayText; // save the High level step text for use in the page list hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list
} }
cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(CurSection, this, hlsText, hlsItemId, PrtSectID); cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId, PrtSectID);
_MyHelper.AllowAllWatermarks = AllowAllWatermarks; _MyHelper.AllowAllWatermarks = AllowAllWatermarks;
_MyHelper.MyPdfWriter = cb.PdfWriter; _MyHelper.MyPdfWriter = cb.PdfWriter;
_MyHelper.CreatingFoldoutPage = doingFoldout; _MyHelper.CreatingFoldoutPage = doingFoldout;
_MyHelper.CreatingSupInfoPage = false; _MyHelper.CreatingSupInfoPage = false;
_MyHelper.MyPdfContentByte = cb; _MyHelper.MyPdfContentByte = cb;
if (!CurSection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)CurSection, ((CurSection.DisplayNumber ?? "") == "" ? "" : CurSection.DisplayNumber + " - ") + CurSection.DisplayText, null); if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
if (DebugOutput) if (DebugOutput)
{ {
// 16-bit background // 16-bit background
@ -1048,7 +999,7 @@ namespace Volian.Print.Library
_MyHelper.BackgroundFile = procedureFileName; _MyHelper.BackgroundFile = procedureFileName;
float x = 0; float x = 0;
float y = 0; float y = 0;
if (!(CurSection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF if (!(mySection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF
{ {
// X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's // X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's
// characters per inch. // characters per inch.
@ -1084,29 +1035,29 @@ namespace Volian.Print.Library
{ {
//added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section //added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section
_MyHelper.MyGaps.Clear(); _MyHelper.MyGaps.Clear();
//Console.WriteLine("'{0}' PromsPrinter", CurSection.DisplayText); //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText);
// if pagination is separate or we've changed the format, we have not done the first page // if pagination is separate or we've changed the format, we have not done the first page
// (if this format has the useonfirst page docstyle flag) // (if this format has the useonfirst page docstyle flag)
if (LastFmtName != CurSection.ActiveFormat.Name || lastDocStyle != (int)CurSection.MyDocStyle.Index || CurSection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) if (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
{ {
_MyHelper.DidFirstPageDocStyle = false; _MyHelper.DidFirstPageDocStyle = false;
lastDocStyle = (int)CurSection.MyDocStyle.Index; lastDocStyle = (int)mySection.MyDocStyle.Index;
LastFmtName = CurSection.ActiveFormat.Name; LastFmtName = mySection.ActiveFormat.Name;
} }
if (!CurSection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)CurSection, ((CurSection.DisplayNumber ?? "") == "" ? "" : CurSection.DisplayNumber + " - ") + CurSection.DisplayText, null); if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
_MyHelper.MySection = CurSection; _MyHelper.MySection = mySection;
//OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG); //OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);
} }
// if this format uses phonelists, see if this section has one. We need to know the number // if this format uses phonelists, see if this section has one. We need to know the number
//of lines to adjust the pagelength for pagination and printing. //of lines to adjust the pagelength for pagination and printing.
_MyHelper.PhoneListHeight = 0; _MyHelper.PhoneListHeight = 0;
if (CurSection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList) if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
{ {
// get config for section // get config for section
SectionConfig sc = CurSection.MyConfig as SectionConfig; SectionConfig sc = mySection.MyConfig as SectionConfig;
if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y") if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y")
{ {
DocVersionConfig dvc = CurSection.MyDocVersion.MyConfig as DocVersionConfig; DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
if (dvc != null) if (dvc != null)
{ {
string phlist = dvc.Print_PhoneList; string phlist = dvc.Print_PhoneList;
@ -1131,13 +1082,13 @@ namespace Volian.Print.Library
} }
_MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID _MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID
if (CurSection.IsAutoTOCSection) if (mySection.IsAutoTOCSection)
{ {
if (((cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage) || myProcedure.ProcHasSupInfoData) && 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
{ {
InsertBlankPage(cb); InsertBlankPage(cb);
} }
GenerateTOC(CurSection, myProcedure, cb, _TextLayer); GenerateTOC(mySection, myProcedure, cb, _TextLayer);
// B2020-102: extra page printing after auto TOC for summer. Retested for Farley and was successful also // B2020-102: extra page printing after auto TOC for summer. Retested for Farley and was successful also
// F2018-033: Farley Auto TOC. If doing foldouts or supinfo facing pages, add a blank page after also: // F2018-033: Farley Auto TOC. If doing foldouts or supinfo facing pages, add a blank page after also:
//if (myProcedure.ProcHasSupInfoData && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even //if (myProcedure.ProcHasSupInfoData && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
@ -1147,21 +1098,21 @@ namespace Volian.Print.Library
} }
else else
{ {
if (CurSection.IsStepSection) if (mySection.IsStepSection)
{ {
if (CurSection.Steps != null && CurSection.Steps.Count > 0) if (mySection.Steps != null && mySection.Steps.Count > 0)
{ {
// get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1) // get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1)
ItemInfo firstStep = CurSection.Steps[0]; ItemInfo firstStep = mySection.Steps[0];
// B2019-165 Don't print the duplex foldout (on the back of the page) if the Don't Include Duplex Foldout check box was checked in section properties // B2019-165 Don't print the duplex foldout (on the back of the page) if the Don't Include Duplex Foldout check box was checked in section properties
if (firstStep.FoldoutIndex() > -1 && (CurSection.MyPrevious == null || !((CurSection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout))) if (firstStep.FoldoutIndex() > -1 && (mySection.MyPrevious == null || !((mySection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout)))
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages); DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages);
else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages) else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages)
{ {
// if it is continuous pagination, don't do blank page - not sure if this is correct place for this: // if it is continuous pagination, don't do blank page - not sure if this is correct place for this:
// C2023-001 if the previous section has the flag to not insert blank pages, // C2023-001 if the previous section has the flag to not insert blank pages,
// then don't insert a blank page between the previous section and this one // then don't insert a blank page between the previous section and this one
if (CurSection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !CurSection.SearchPrev.MyDocStyle.DontInsertBlankPages) if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !mySection.SearchPrev.MyDocStyle.DontInsertBlankPages)
{ {
// only insert a blank page if this section does not have a foldout (but the procedure as a whole does) // 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 // and the checkbox on the print dialog to add blank pages is checked
@ -1173,18 +1124,18 @@ namespace Volian.Print.Library
{ {
// If the procedure has supplemental facing pages, but this section does not & it's the first section, // 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 // need a blank 'facing page'. Sections after the first will get blank 'facing page' in print's pagination logic
if (SupInfoPrintType == E_SupInfoPrintType.Merge && !CurSection.HasSupInfoSteps && firstStepSec && InsertBlankPages) if (SupInfoPrintType == E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
{ {
InsertBlankPage(cb); InsertBlankPage(cb);
} }
} }
} }
firstStepSec = false; firstStepSec = false;
CreateStepPdf(CurSection, cb); CreateStepPdf(mySection, cb);
} }
else else
{ {
CreateWordDocPdf(cb, CurSection); CreateWordDocPdf(cb, mySection);
} }
} }
_MyHelper.PrintedSectionPage = 0; _MyHelper.PrintedSectionPage = 0;
@ -1631,44 +1582,19 @@ namespace Volian.Print.Library
// C2018-004 create meta file for baseline compares // C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("TOC Ystart {0} LeftMar {1} ScNmPos {2} ScTtlPos {3} ScPgPos {4}", yPageStart, leftMargin, secNumPos, secTitlePos, secPagePos); Volian.Base.Library.BaselineMetaFile.WriteLine("TOC Ystart {0} LeftMar {1} ScNmPos {2} ScTtlPos {3} ScPgPos {4}", yPageStart, leftMargin, secNumPos, secTitlePos, secPagePos);
bool inGroup = false; bool inGroup = false;
SectionInfo CurSection = null; // C2024-003 detrimine determine if the user in printing a sub section.
if (Convert.ToBoolean(PrtSectID[2]))
{
foreach (SectionInfo si2 in ii.Sections) // Find parent section.
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find sub section.
{
if (subsi.ItemID == PrtSectID[1])
{
CurSection = subsi; // Assigned sub section object to CurSection.
}
}
}
}
}
foreach (SectionInfo mySection in ii.Sections) foreach (SectionInfo mySection in ii.Sections)
{ {
if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID))
if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0]))
{ {
if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection
{
CurSection = mySection;
}
sectCnt++; sectCnt++;
SectionConfig sc = CurSection.MyConfig as SectionConfig; SectionConfig sc = mySection.MyConfig as SectionConfig;
if ((CurSection.MyDocStyle != null && CurSection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y")) if ((mySection.MyDocStyle != null && mySection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y"))
|| ((CurSection.MyDocStyle == null || !CurSection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y"))) || ((mySection.MyDocStyle == null || !mySection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y")))
{ {
// for indenting of subsections, count up tree. Only start indenting // for indenting of subsections, count up tree. Only start indenting
// at third level, i.e. not indent on 1.0 and 1.1, but indent on 1.1.1: // at third level, i.e. not indent on 1.0 and 1.1, but indent on 1.1.1:
level = 0; level = 0;
ItemInfo iilvl = CurSection as ItemInfo; ItemInfo iilvl = mySection as ItemInfo;
while (!iilvl.IsProcedure) while (!iilvl.IsProcedure)
{ {
level++; level++;
@ -1710,7 +1636,7 @@ namespace Volian.Print.Library
// need to do the section number, section title & page number. Page number // need to do the section number, section title & page number. Page number
// has to be put on at end after number of page is known, so use a Template. // has to be put on at end after number of page is known, so use a Template.
bool didGrp = false; bool didGrp = false;
string tmptxt = CurSection.MyContent.Number == null || CurSection.MyContent.Number == "" ? " " : CurSection.DisplayNumber;// B2017-019 - process "<u>" in section number string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.DisplayNumber;// B2017-019 - process "<u>" in section number
if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
&& tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading)) && tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading))
{ {
@ -1739,7 +1665,7 @@ namespace Volian.Print.Library
// logic put in for V.C. Summer who wants to their auto table of contents to print "OPERATOR ACTIONS" (set in the format) instead of "Procedure Steps" // logic put in for V.C. Summer who wants to their auto table of contents to print "OPERATOR ACTIONS" (set in the format) instead of "Procedure Steps"
// - note that Summer didn't want to change the section title because they want transition to say "procedure step" for the section title. 03/08/2016 // - note that Summer didn't want to change the section title because they want transition to say "procedure step" for the section title. 03/08/2016
string tocSecTitle = CurSection.FormattedDisplayText;// B2017-019 - process "<u>" in section title string tocSecTitle = mySection.FormattedDisplayText;// B2017-019 - process "<u>" in section title
tocSecTitle = ConvertSpecialChars(tocSecTitle, ii.ActiveFormat.PlantFormat.FormatData); // B2019-172 process symbol characters tocSecTitle = ConvertSpecialChars(tocSecTitle, ii.ActiveFormat.PlantFormat.FormatData); // B2019-172 process symbol characters
if (tocSecTitle.ToUpper() == "PROCEDURE STEPS" && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle != "") if (tocSecTitle.ToUpper() == "PROCEDURE STEPS" && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle != "")
tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle; tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle;
@ -1805,7 +1731,7 @@ namespace Volian.Print.Library
// adjust ylocation for pagenumber - the ylocation will get reset if the // adjust ylocation for pagenumber - the ylocation will get reset if the
// section title split on 2 lines and the page number needs to be on the 2nd line. // section title split on 2 lines and the page number needs to be on the 2nd line.
// Only do this if the title is not empty (the code was meant for if title spans more than a line) // Only do this if the title is not empty (the code was meant for if title spans more than a line)
if (retval != ttlRetval && CurSection.MyContent.Text != null && CurSection.MyContent.Text != "") yLocation += (retval - ttlRetval); if (retval != ttlRetval && mySection.MyContent.Text != null && mySection.MyContent.Text != "") yLocation += (retval - ttlRetval);
// retval = the minimum (further down the page) between section number and // retval = the minimum (further down the page) between section number and
// title - this accounts for multi line title. // title - this accounts for multi line title.
@ -1813,7 +1739,7 @@ namespace Volian.Print.Library
lastyLocation = retval; lastyLocation = retval;
// check that the page number should be in the TOC (some BGE sections do not have the page number) // check that the page number should be in the TOC (some BGE sections do not have the page number)
if (!((CurSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC)) if (!((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC))
{ {
// add a template for the page number: // add a template for the page number:
// if the space character is not null & is not a space, the we've got to put out // if the space character is not null & is not a space, the we've got to put out
@ -1864,8 +1790,8 @@ namespace Volian.Print.Library
} }
// if in the pre-table of content list, just put the page number out as text. // if in the pre-table of content list, just put the page number out as text.
// otherwise, add a template _MyHelper.MyTOCPageCounts // otherwise, add a template _MyHelper.MyTOCPageCounts
string key = "TOC" + CurSection.ItemID.ToString(); string key = "TOC" + mySection.ItemID.ToString();
if (CurSection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key)) if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key))
{ {
string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString(); string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString();
rtfText = GetRtfToC(pnum, tOfC); rtfText = GetRtfToC(pnum, tOfC);
@ -1879,10 +1805,10 @@ namespace Volian.Print.Library
//If the format wants single spacing within subsections (2nd level and lower), then need to figure out //If the format wants single spacing within subsections (2nd level and lower), then need to figure out
// spacing (vcb1 table of contents) // spacing (vcb1 table of contents)
//bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0) //bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
// && (CurSection.MyParent.IsSection && ((CurSection.Sections != null && CurSection.Sections.Count > 0) || (level > 0 && CurSection.NextItem != null)))) // && (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null))))
// || didGrp; // || didGrp;
doSubY = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0) doSubY = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
&& (CurSection.MyParent.IsSection && (/* CurSection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205 && (mySection.MyParent.IsSection && (/* mySection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205
|| didGrp; || didGrp;
//float spc = (float)(tOfC.TofCLineSpacing ?? 1); //float spc = (float)(tOfC.TofCLineSpacing ?? 1);
if (doSubY) if (doSubY)
@ -1911,12 +1837,12 @@ namespace Volian.Print.Library
} }
// C2021-015: Barakah High Level Steps in Table of Contents - check to see if we need to add the high level steps on // C2021-015: Barakah High Level Steps in Table of Contents - check to see if we need to add the high level steps on
// table of contents for this section, format flag & section has steps: // table of contents for this section, format flag & section has steps:
if (CurSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCAllowHLS && if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCAllowHLS &&
CurSection.IsStepSection && CurSection.Steps != null && CurSection.Steps.Count > 0) mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
yLocation = AddHLSToTOC(tocSection, CurSection, tOfC, cb, yPageStart, yLocation, doSubY, level + 1, adjSecTitlePos); yLocation = AddHLSToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY, level + 1, adjSecTitlePos);
} }
float savYLoc = yLocation; float savYLoc = yLocation;
yLocation = AddSectionToTOC(tocSection, CurSection, tOfC, cb, yPageStart, yLocation, doSubY); yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY);
if (savYLoc == yLocation) // nothing was outputted i.e. the subsections are not included on the TOC // B2016-205 if (savYLoc == yLocation) // nothing was outputted i.e. the subsections are not included on the TOC // B2016-205
{ {
if (doSubY && sectCnt == ii.Sections.Count) if (doSubY && sectCnt == ii.Sections.Count)
@ -3015,39 +2941,17 @@ namespace Volian.Print.Library
private void LoadSectionTree(ItemInfo ii) private void LoadSectionTree(ItemInfo ii)
{ {
if (ii.Sections == null) return; // B2021-067 crash on null reference if (ii.Sections == null) return; // B2021-067 crash on null reference
SectionInfo CurSection = null;
if (Convert.ToBoolean(MyPromsPrinter.PrtSectID[2])) // C2024-003 determine if the user is printing a sub section. If so assign it to CurSection.
{
foreach (SectionInfo si2 in ii.Sections) // Find parent section
{
if (si2.ItemID == MyPromsPrinter.PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find sub section.
{
if (subsi.ItemID == MyPromsPrinter.PrtSectID[1])
{
CurSection = subsi; // Assign sub section object to CurSection.
break;
}
}
}
}
}
foreach (SectionInfo si in ii.Sections) foreach (SectionInfo si in ii.Sections)
if (MyPromsPrinter.PrtSectID[0] == -1 || (MyPromsPrinter.PrtSectID[0] > -1 && si.ItemID == MyPromsPrinter.PrtSectID[0]))
{ {
if (!Convert.ToBoolean(MyPromsPrinter.PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection if (MyPromsPrinter.PrtSectID == -1 || (MyPromsPrinter.PrtSectID > -1 && si.ItemID == MyPromsPrinter.PrtSectID))
{ {
CurSection = si; if (si.IsStepSection)
}
if (CurSection.IsStepSection)
{ {
if (CurSection.Sections != null) LoadSectionTree(CurSection); if (si.Sections != null) LoadSectionTree(si);
} }
else else
{ {
MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(CurSection); MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(si);
if (MyPdfFile != null) if (MyPdfFile != null)
{ {
try try
@ -3056,18 +2960,18 @@ namespace Volian.Print.Library
if (fi.Length == 0) // B2017-218 Handle invalid word sections if (fi.Length == 0) // B2017-218 Handle invalid word sections
{ {
if (!PromsPrinter.BaselineTesting) //B2018-071 Output a message box unless baseline testing is being performed. if (!PromsPrinter.BaselineTesting) //B2018-071 Output a message box unless baseline testing is being performed.
MessageBox.Show(CurSection.DisplayNumber + " " + CurSection.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); MessageBox.Show(si.DisplayNumber + " " + si.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return; return;
} }
MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null; MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null;
string key = string.Empty; string key = string.Empty;
for (int i = 1; i <= MyReader.NumberOfPages; i++) for (int i = 1; i <= MyReader.NumberOfPages; i++)
{ {
key = string.Format("{0}.{1}", CurSection.ItemID, i); key = string.Format("{0}.{1}", si.ItemID, i);
dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i)); dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i));
iTextSharp.text.Rectangle rectgl = MyReader.GetPageSizeWithRotation(i); iTextSharp.text.Rectangle rectgl = MyReader.GetPageSizeWithRotation(i);
// If the word page is set to landscape, but the document style is not landscape, then flip the height and width (put back to portrait) // If the word page is set to landscape, but the document style is not landscape, then flip the height and width (put back to portrait)
if (!((CurSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width) if (!((si.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width)
rectgl = new iTextSharp.text.Rectangle(rectgl.Height, rectgl.Width); rectgl = new iTextSharp.text.Rectangle(rectgl.Height, rectgl.Width);
dicSize.Add(key, rectgl); dicSize.Add(key, rectgl);
//dicSize.Add(key, MyReader.GetPageSizeWithRotation(i)); //dicSize.Add(key, MyReader.GetPageSizeWithRotation(i));
@ -3077,7 +2981,7 @@ namespace Volian.Print.Library
{ {
if (_MyPromsPrinter.DocReplace == null) if (_MyPromsPrinter.DocReplace == null)
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
_MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", CurSection.ItemID, CurSection.DisplayNumber, CurSection.DisplayText), ex); _MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", si.ItemID, si.DisplayNumber, si.DisplayText), ex);
} }
} }
} }
@ -3113,5 +3017,5 @@ namespace Volian.Print.Library
// set { _LastTime = value; } // set { _LastTime = value; }
// } // }
//} //}
}

View File

@ -85,10 +85,8 @@ namespace Volian.Print.Library
get { return _TopMessage; } get { return _TopMessage; }
set { _TopMessage = value; } set { _TopMessage = value; }
} }
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. private int _prtSectID = -1;
// C2024-003 values needed to print section. public int PrtSectID
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
{ {
get { return _prtSectID; } get { return _prtSectID; }
set { _prtSectID = value; } set { _prtSectID = value; }
@ -726,15 +724,11 @@ namespace Volian.Print.Library
{ {
PdfDestination dest = new PdfDestination(PdfDestination.FIT); PdfDestination dest = new PdfDestination(PdfDestination.FIT);
PdfOutline pdo = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false); PdfOutline pdo = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false);
if (!Convert.ToBoolean(_prtSectID[2]))
{
if (MyPdfOutlines.Count == lev) if (MyPdfOutlines.Count == lev)
MyPdfOutlines.Add(pdo); MyPdfOutlines.Add(pdo);
else else
MyPdfOutlines[lev] = pdo; MyPdfOutlines[lev] = pdo;
} }
}
else else
{ {
PdfDestination dest =pb.PdfDestination; PdfDestination dest =pb.PdfDestination;
@ -885,8 +879,7 @@ namespace Volian.Print.Library
DidFirstPageDocStyle = false; DidFirstPageDocStyle = false;
if (DidFirstPageDocStyle) if (DidFirstPageDocStyle)
forceLoadSvg = SetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this) forceLoadSvg = SetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this)
if (_prtSectID[0] > -1) if (_prtSectID > -1) {
{
forceLoadSvg = true; forceLoadSvg = true;
} }
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg); Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg);
@ -1047,7 +1040,7 @@ namespace Volian.Print.Library
set { _MyPromsPrinter = value; } set { _MyPromsPrinter = value; }
} }
private int _MyRomanPage = 1; private int _MyRomanPage = 1;
public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int[] PrtSectID = null) public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int PrtSectID)
: base() : base()
{ {
_prtSectID = PrtSectID; _prtSectID = PrtSectID;

View File

@ -1607,8 +1607,7 @@ namespace Volian.Print.Library
// if parent was continuous & this is separate, don't reset document style to subsection (next page) type // if parent was continuous & this is separate, don't reset document style to subsection (next page) type
// this was putting incorrect pagelist item on parent section's page. This occurred in BGE/OI3 set/OI-7 procedure/10.0 Attachments. // this was putting incorrect pagelist item on parent section's page. This occurred in BGE/OI3 set/OI-7 procedure/10.0 Attachments.
// B2017-273 added a check for Farley format, we don't want the subsection pagelist infor to appear on the parent section page - works with Paginate() logic - (section has steps and a sub-section ex: FNP-2-EEP-0 Attachment 4) // B2017-273 added a check for Farley format, we don't want the subsection pagelist infor to appear on the parent section page - works with Paginate() logic - (section has steps and a sub-section ex: FNP-2-EEP-0 Attachment 4)
// C2024-003 fixed a null exception bug by changing MyParent.MyItemInfo to MyItemInfo.MyParent. if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && !MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyParent.MyItemInfo as SectionInfo).IsSeparatePagination() || !(MyItemInfo as SectionInfo).IsSeparatePagination())
if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && !MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyItemInfo.MyParent as SectionInfo).IsSeparatePagination() || !(MyItemInfo as SectionInfo).IsSeparatePagination())
{ {
MyPageHelper.MySection = MyItemInfo as SectionInfo; MyPageHelper.MySection = MyItemInfo as SectionInfo;
MyPageHelper.ResetSvg(); MyPageHelper.ResetSvg();
@ -2836,13 +2835,13 @@ namespace Volian.Print.Library
{ {
// Vogtle Alarms: Their alarms are set up differently than standard procedures - the HLS in Vogtle // Vogtle Alarms: Their alarms are set up differently than standard procedures - the HLS in Vogtle
// alarms is a section in other procedures. The top continue message is shown when a break occurs: // alarms is a section in other procedures. The top continue message is shown when a break occurs:
// • A continued message will appear on the top of the page ONLY if the pagination occurs anywhere // • A continued message will appear on the top of the page ONLY if the pagination occurs anywhere
// within the first level substep. If, for example, the page break occurs between substep 3 and substep // within the first level substep. If, for example, the page break occurs between substep 3 and substep
// 4 as in example 2, no continued message will appear on the top of the page. // 4 as in example 2, no continued message will appear on the top of the page.
// • If a continued message is needed, the continued message will include the first level substep number // • If a continued message is needed, the continued message will include the first level substep number
// if it is a sequential substep, such as “5. (continued)”. If it is NOT a sequential substep, then only // if it is a sequential substep, such as “5. (continued)”. If it is NOT a sequential substep, then only
// the word “(continued)” will appear. // the word “(continued)” will appear.
// • If a page break occurs between high level steps, such as before “Causes:”, then no continued message is needed. // • If a page break occurs between high level steps, such as before “Causes:”, then no continued message is needed.
bool doMessage = true; bool doMessage = true;
if (MyItemInfo.IsHigh) doMessage = false; // at high, don't do message if (MyItemInfo.IsHigh) doMessage = false; // at high, don't do message
if (MyItemInfo.MyParent.IsHigh) doMessage = false; // at first level, don't do message if (MyItemInfo.MyParent.IsHigh) doMessage = false; // at first level, don't do message
@ -2901,8 +2900,7 @@ namespace Volian.Print.Library
// CONDITION/RESPONSE table. Messages only get printed if the break is on a substep at steplevel > 2. // CONDITION/RESPONSE table. Messages only get printed if the break is on a substep at steplevel > 2.
// see comments within code for what the tab contains, it varies depending on which side // see comments within code for what the tab contains, it varies depending on which side
// break occurred & how deep in the step the break occurred. // break occurred & how deep in the step the break occurred.
if (subTab != null && MyItemInfo.StepLevel > 2) if (subTab != null && MyItemInfo.StepLevel > 2) {
{
bool incond = !MyItemInfo.IsInRNO; bool incond = !MyItemInfo.IsInRNO;
float ybot = yTopMargin + (4 * SixLinesPerInch); float ybot = yTopMargin + (4 * SixLinesPerInch);
string concatrnoTab = ""; // constructed tab for Response side string concatrnoTab = ""; // constructed tab for Response side
@ -4494,7 +4492,7 @@ namespace Volian.Print.Library
// Get the minimun value between the AER and RNO YtopMost. // Get the minimun value between the AER and RNO YtopMost.
// example. Calvert AOP-7E/XIII/Step A5.h Unit 2 Approved set // example. Calvert AOP-7E/XIII/Step A5.h Unit 2 Approved set
//B2021-027 use YOffset if there isn't any children above (AER). //B2021-027 use YOffset if there isn't any children above (AER).
// example: Catawba Unit 1 AP's; AP/1/A/5500/050; Enclosure 8 step 1 // example: Catawba Unit 1 APs; AP/1/A/5500/050; Enclosure 8 step 1
if (ChildrenAbove.Count == 0) if (ChildrenAbove.Count == 0)
YTopMost = ChildrenRight[0].ChildrenAbove[0].YOffset; //B2021-027 YTopMost = ChildrenRight[0].ChildrenAbove[0].YOffset; //B2021-027
else else
@ -7214,12 +7212,10 @@ namespace Volian.Print.Library
public int StepLevel public int StepLevel
{ {
get { return _StepLevel; } get { return _StepLevel; }
set set {
{
//if (MyParagraph.MyItemInfo.InList(97960,84472,91010)) //if (MyParagraph.MyItemInfo.InList(97960,84472,91010))
// Console.WriteLine("stop"); // Console.WriteLine("stop");
_StepLevel = value; _StepLevel = value; }
}
} }
private vlnParagraph _MyParagraph; private vlnParagraph _MyParagraph;
public vlnParagraph MyParagraph public vlnParagraph MyParagraph