diff --git a/PROMS/Formats/fmtall/BASEall.xml b/PROMS/Formats/fmtall/BASEall.xml
index 54405046..2d2705fe 100644
Binary files a/PROMS/Formats/fmtall/BASEall.xml and b/PROMS/Formats/fmtall/BASEall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPS1all.xml b/PROMS/Formats/fmtall/BVPS1all.xml
index 840a5739..6e2aab97 100644
Binary files a/PROMS/Formats/fmtall/BVPS1all.xml and b/PROMS/Formats/fmtall/BVPS1all.xml differ
diff --git a/PROMS/Formats/fmtall/BVPS2all.xml b/PROMS/Formats/fmtall/BVPS2all.xml
index 2ea95abe..90971a8b 100644
Binary files a/PROMS/Formats/fmtall/BVPS2all.xml and b/PROMS/Formats/fmtall/BVPS2all.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSAOPall.xml b/PROMS/Formats/fmtall/BVPSAOPall.xml
index 576e1295..a25e41e1 100644
Binary files a/PROMS/Formats/fmtall/BVPSAOPall.xml and b/PROMS/Formats/fmtall/BVPSAOPall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSAtchall.xml b/PROMS/Formats/fmtall/BVPSAtchall.xml
index d2ecf29a..7a6bac26 100644
Binary files a/PROMS/Formats/fmtall/BVPSAtchall.xml and b/PROMS/Formats/fmtall/BVPSAtchall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSBCKall.xml b/PROMS/Formats/fmtall/BVPSBCKall.xml
index 365ad2fe..13d90216 100644
Binary files a/PROMS/Formats/fmtall/BVPSBCKall.xml and b/PROMS/Formats/fmtall/BVPSBCKall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSDEVall.xml b/PROMS/Formats/fmtall/BVPSDEVall.xml
index fc5b750f..5aa1a90e 100644
Binary files a/PROMS/Formats/fmtall/BVPSDEVall.xml and b/PROMS/Formats/fmtall/BVPSDEVall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSFlexDEVall.xml b/PROMS/Formats/fmtall/BVPSFlexDEVall.xml
index 2a7e168d..53162623 100644
Binary files a/PROMS/Formats/fmtall/BVPSFlexDEVall.xml and b/PROMS/Formats/fmtall/BVPSFlexDEVall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSNIBCKall.xml b/PROMS/Formats/fmtall/BVPSNIBCKall.xml
index ec0027bf..db96f397 100644
Binary files a/PROMS/Formats/fmtall/BVPSNIBCKall.xml and b/PROMS/Formats/fmtall/BVPSNIBCKall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSSAMGBCKall.xml b/PROMS/Formats/fmtall/BVPSSAMGBCKall.xml
index 71e47048..25fdb768 100644
Binary files a/PROMS/Formats/fmtall/BVPSSAMGBCKall.xml and b/PROMS/Formats/fmtall/BVPSSAMGBCKall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSSAMGDEVall.xml b/PROMS/Formats/fmtall/BVPSSAMGDEVall.xml
index fb484c4b..bad43d2d 100644
Binary files a/PROMS/Formats/fmtall/BVPSSAMGDEVall.xml and b/PROMS/Formats/fmtall/BVPSSAMGDEVall.xml differ
diff --git a/PROMS/Formats/fmtall/BVPSSAMGall.xml b/PROMS/Formats/fmtall/BVPSSAMGall.xml
index 9b25771b..a632db64 100644
Binary files a/PROMS/Formats/fmtall/BVPSSAMGall.xml and b/PROMS/Formats/fmtall/BVPSSAMGall.xml differ
diff --git a/PROMS/Formats/fmtall/CPDEVall.xml b/PROMS/Formats/fmtall/CPDEVall.xml
index 8f746a23..de28c2d3 100644
Binary files a/PROMS/Formats/fmtall/CPDEVall.xml and b/PROMS/Formats/fmtall/CPDEVall.xml differ
diff --git a/PROMS/Formats/fmtall/CPFDEVall.xml b/PROMS/Formats/fmtall/CPFDEVall.xml
index 37e5c29e..44247a28 100644
Binary files a/PROMS/Formats/fmtall/CPFDEVall.xml and b/PROMS/Formats/fmtall/CPFDEVall.xml differ
diff --git a/PROMS/Formats/fmtall/CPSAMGDEVall.xml b/PROMS/Formats/fmtall/CPSAMGDEVall.xml
index 3ffb7320..ea200aaf 100644
Binary files a/PROMS/Formats/fmtall/CPSAMGDEVall.xml and b/PROMS/Formats/fmtall/CPSAMGDEVall.xml differ
diff --git a/PROMS/Formats/fmtall/CPSAMGDataall.xml b/PROMS/Formats/fmtall/CPSAMGDataall.xml
index 4814e93a..bb413c1e 100644
Binary files a/PROMS/Formats/fmtall/CPSAMGDataall.xml and b/PROMS/Formats/fmtall/CPSAMGDataall.xml differ
diff --git a/PROMS/Formats/fmtall/ComPeakFlex11all.xml b/PROMS/Formats/fmtall/ComPeakFlex11all.xml
index e3555c41..6ba67177 100644
Binary files a/PROMS/Formats/fmtall/ComPeakFlex11all.xml and b/PROMS/Formats/fmtall/ComPeakFlex11all.xml differ
diff --git a/PROMS/Formats/fmtall/ComPeakFlexall.xml b/PROMS/Formats/fmtall/ComPeakFlexall.xml
index 805e795a..1a134506 100644
Binary files a/PROMS/Formats/fmtall/ComPeakFlexall.xml and b/PROMS/Formats/fmtall/ComPeakFlexall.xml differ
diff --git a/PROMS/Formats/fmtall/TUECABNall.xml b/PROMS/Formats/fmtall/TUECABNall.xml
index ccf5e757..73b39cab 100644
Binary files a/PROMS/Formats/fmtall/TUECABNall.xml and b/PROMS/Formats/fmtall/TUECABNall.xml differ
diff --git a/PROMS/Formats/fmtall/TUECSAMG1all.xml b/PROMS/Formats/fmtall/TUECSAMG1all.xml
index b2be9c8a..4bf3cc1f 100644
Binary files a/PROMS/Formats/fmtall/TUECSAMG1all.xml and b/PROMS/Formats/fmtall/TUECSAMG1all.xml differ
diff --git a/PROMS/Formats/fmtall/TUECSAMGall.xml b/PROMS/Formats/fmtall/TUECSAMGall.xml
index 67dfbeba..88ff5e7e 100644
Binary files a/PROMS/Formats/fmtall/TUECSAMGall.xml and b/PROMS/Formats/fmtall/TUECSAMGall.xml differ
diff --git a/PROMS/Formats/fmtall/VEGP1all.xml b/PROMS/Formats/fmtall/VEGP1all.xml
index 79e4128c..6640b2c8 100644
Binary files a/PROMS/Formats/fmtall/VEGP1all.xml and b/PROMS/Formats/fmtall/VEGP1all.xml differ
diff --git a/PROMS/Formats/fmtall/VEGP2all.xml b/PROMS/Formats/fmtall/VEGP2all.xml
index dbc85c58..cc85c74e 100644
Binary files a/PROMS/Formats/fmtall/VEGP2all.xml and b/PROMS/Formats/fmtall/VEGP2all.xml differ
diff --git a/PROMS/Formats/fmtall/VEGPAlrall.xml b/PROMS/Formats/fmtall/VEGPAlrall.xml
index d1d306e4..0752764b 100644
Binary files a/PROMS/Formats/fmtall/VEGPAlrall.xml and b/PROMS/Formats/fmtall/VEGPAlrall.xml differ
diff --git a/PROMS/Formats/fmtall/VEGPBckStpsall.xml b/PROMS/Formats/fmtall/VEGPBckStpsall.xml
index 6e484f1f..afdfb3c2 100644
Binary files a/PROMS/Formats/fmtall/VEGPBckStpsall.xml and b/PROMS/Formats/fmtall/VEGPBckStpsall.xml differ
diff --git a/PROMS/Formats/fmtall/VEGPBckall.xml b/PROMS/Formats/fmtall/VEGPBckall.xml
index bfdc9727..a0005ced 100644
Binary files a/PROMS/Formats/fmtall/VEGPBckall.xml and b/PROMS/Formats/fmtall/VEGPBckall.xml differ
diff --git a/PROMS/Formats/genmacall/VEGP1.svg b/PROMS/Formats/genmacall/VEGP1.svg
index f81f5b07..f588fadf 100644
Binary files a/PROMS/Formats/genmacall/VEGP1.svg and b/PROMS/Formats/genmacall/VEGP1.svg differ
diff --git a/PROMS/Formats/genmacall/VEGP2.svg b/PROMS/Formats/genmacall/VEGP2.svg
index 4f504cc3..ea6cf7c3 100644
Binary files a/PROMS/Formats/genmacall/VEGP2.svg and b/PROMS/Formats/genmacall/VEGP2.svg differ
diff --git a/PROMS/Formats/genmacall/VEGPAlr.svg b/PROMS/Formats/genmacall/VEGPAlr.svg
index 921e5718..d887ab27 100644
Binary files a/PROMS/Formats/genmacall/VEGPAlr.svg and b/PROMS/Formats/genmacall/VEGPAlr.svg differ
diff --git a/PROMS/Formats/genmacall/VEGPBck.svg b/PROMS/Formats/genmacall/VEGPBck.svg
index 15ffe7db..91f088b6 100644
Binary files a/PROMS/Formats/genmacall/VEGPBck.svg and b/PROMS/Formats/genmacall/VEGPBck.svg differ
diff --git a/PROMS/Formats/genmacall/cpdev.svg b/PROMS/Formats/genmacall/cpdev.svg
index a820f2bf..c55e7800 100644
Binary files a/PROMS/Formats/genmacall/cpdev.svg and b/PROMS/Formats/genmacall/cpdev.svg differ
diff --git a/PROMS/Formats/genmacall/cpfdev.svg b/PROMS/Formats/genmacall/cpfdev.svg
index 957e503b..49173593 100644
Binary files a/PROMS/Formats/genmacall/cpfdev.svg and b/PROMS/Formats/genmacall/cpfdev.svg differ
diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs b/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs
index 98647f8f..82cbd45f 100644
--- a/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs
+++ b/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs
@@ -746,7 +746,7 @@ namespace RODBInterface
string csufx = string.Format("_PCCHILD{0}", pcChildIdx);
//applicValues += ",";
XmlNode cn = elmnode.SelectSingleNode(parentName + csufx);
- if (cn == null)
+ if (cn == null || cn.InnerText.Length == 0) // B2024-004 use Parent value if Child text length is zero
applicValues += string.Format(",UnitIdx={0} Value={1}", pcChildIdx, parentValue); // use parent value as default
else
{
diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs
index 6ade16c3..9e1c5208 100644
--- a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs
+++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs
@@ -473,7 +473,7 @@ namespace ctlXMLEditLib
nd = node.SelectSingleNode(str);
// if not found with just the string, search the tree.
if (nd==null)nd = node.SelectSingleNode("*/"+str);
- if (nd == null)
+ if (nd == null || nd.InnerText.Length==0) // B2024-004 use Parent value if Child text length is zero
GetDefaultParentValue(hwnd, node, str); // C2021-026 Parent/Child Field has no value so use parent's value
else
{
diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs
index 40be0144..c61857ad 100644
--- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs
+++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs
@@ -59,6 +59,13 @@ namespace VEPROMS
get { return _Automatic; }
set { _Automatic = value; }
}
+ private int _prtSectID = -1;
+ public int PrtSectID
+ {
+ get { return _prtSectID; }
+ set { _prtSectID = value; }
+ }
+
// C2018-033 Used to turn off using the date/time PDF file prefix and suffix when doing batch file autmatic baseline print testing (frmVEPROMS.cs RunAutomatic())
// This is needed so the the automatic baselines can compare results from different runs of PROMS
@@ -768,7 +775,7 @@ namespace VEPROMS
// B2021-102 put in the using for better memory management
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
- swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor))//;//C2018-009 print PROMS version
+ swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor, PrtSectID))//;//C2018-009 print PROMS version
{
frmStatus.CloseWhenDone = true;
Application.DoEvents();
@@ -849,8 +856,9 @@ namespace VEPROMS
// B2016-249 Output Procedure to folder associated with Parent Child
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked,
cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text,
- new Point(Left, Bottom - 50), swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor)) // ;//C2018-009 print PROMS version
+ new Point(Left, Bottom - 50), swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor, PrtSectID)) // ;//C2018-009 print PROMS version
{
+ frmStatus.PrtSectID = PrtSectID;
frmStatus.CloseWhenDone = true;
Application.DoEvents();
frmStatus.CancelStop = true;
@@ -1001,7 +1009,7 @@ namespace VEPROMS
// B2018-124 use text of watermark form drop down list instead of enum value
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
- swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, false, tbBlankPage.Text, _MergedPfd, watermarkColor))//; //C2018-009 print PROMS version
+ swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, false, tbBlankPage.Text, _MergedPfd, watermarkColor, PrtSectID))//; //C2018-009 print PROMS version
{
frmStatus.MakePlaceKeeper = swtbtnGeneratePlacekeeper.Value;
frmStatus.MakeContinuousActionSummary = cbxGenerateConActSum.Checked;
diff --git a/PROMS/VEPROMS User Interface/Properties/AssemblyInfo.cs b/PROMS/VEPROMS User Interface/Properties/AssemblyInfo.cs
index f715524d..699a2c37 100644
--- a/PROMS/VEPROMS User Interface/Properties/AssemblyInfo.cs
+++ b/PROMS/VEPROMS User Interface/Properties/AssemblyInfo.cs
@@ -44,8 +44,18 @@ using System.Runtime.InteropServices;
// Revision DHH (day - no leading zero, two digit hour - military time
//
// ********* REMEMBER TO CHECK THE AssemblyConfiguration SETTING (ABOVE) ********
-[assembly: AssemblyVersion("2.1.2311.3014")]
-[assembly: AssemblyFileVersion("2.1.2311.3014")]
+[assembly: AssemblyVersion("2.1.2402.616")]
+[assembly: AssemblyFileVersion("2.1.2402.616")]
+
+
+
+
+
+
+
+
+
+
diff --git a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs
index 34513d86..91c20e91 100644
--- a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs
+++ b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs
@@ -91,7 +91,13 @@ namespace VEPROMS
get { return _DidAll; }
set { _DidAll = 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)
+ private int _prtSectID = -1;
+ public int PrtSectID
+ {
+ get { return _prtSectID; }
+ 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 = -1)
{
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic
ProcedureInfo MyProcedure = myItem as ProcedureInfo;
@@ -116,6 +122,7 @@ namespace VEPROMS
Prefix = prefix;
OpenPDF = openPDF;
DidAll = didAll;
+ _prtSectID = PrtSectID;
InitializeComponent();
@@ -276,7 +283,7 @@ namespace VEPROMS
cachePartInfo = PartInfo.CacheList;
}
- _PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary, MakeTimeCriticalActionSummary);
+ _PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary, MakeTimeCriticalActionSummary, PrtSectID);
ProfileTimer.Pop(profileDepth);
diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs
index d5e9c4ea..59628177 100644
--- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs
+++ b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs
@@ -36,6 +36,8 @@ namespace VEPROMS
this.btnShortCuts = new DevComponents.DotNetBar.ButtonItem();
this.btnHelpVWeb = new DevComponents.DotNetBar.ButtonItem();
this.btnSendErrorLog = new DevComponents.DotNetBar.ButtonItem();
+ this.btnShowErrFld = new DevComponents.DotNetBar.ButtonItem();
+ this.btnShowPrtFld = new DevComponents.DotNetBar.ButtonItem();
this.btnHelpAbout = new DevComponents.DotNetBar.ButtonItem();
this.office2007StartButton1 = new DevComponents.DotNetBar.Office2007StartButton();
this.itemContainer1 = new DevComponents.DotNetBar.ItemContainer();
@@ -206,11 +208,13 @@ namespace VEPROMS
this.btnHelp.KeyTips = "?";
this.btnHelp.Name = "btnHelp";
this.btnHelp.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
- this.btnHelpManual,
- this.btnShortCuts,
- this.btnHelpVWeb,
- this.btnSendErrorLog,
- this.btnHelpAbout});
+ this.btnHelpManual,
+ this.btnShortCuts,
+ this.btnHelpVWeb,
+ this.btnSendErrorLog,
+ this.btnShowErrFld,
+ this.btnShowPrtFld,
+ this.btnHelpAbout}); ;
this.btnHelp.Text = "Help";
//
// btnHelpManual
@@ -244,6 +248,24 @@ namespace VEPROMS
this.btnSendErrorLog.Text = "Send Error Log";
this.btnSendErrorLog.Click += new System.EventHandler(this.btnSendErrorLog_Click);
//
+ // btnShowErrFld
+ //
+ //this.btnShowErrFld.Image = global::VEPROMS.Properties.Resources.GoToParentFolderHS;
+ this.btnShowErrFld.Image = ((System.Drawing.Image)(resources.GetObject("btnShowErrFld.Image")));
+ this.btnShowErrFld.Name = "btnShowErrFld";
+ this.btnShowErrFld.Text = "Open Log Folder";
+ this.btnShowErrFld.Click += new System.EventHandler(this.btnShowErrFld_Click);
+ //
+ // btnShowPrtFld
+ //
+ //this.btnShowPrtFld.Image = global::VEPROMS.Properties.Resources.GoToParentFolderHS;
+ this.btnShowPrtFld.Image = ((System.Drawing.Image)(resources.GetObject("btnShowPrtFld.Image")));
+ this.btnShowPrtFld.Name = "btnShowPrtFld";
+ this.btnShowPrtFld.Text = "Open Default Print Folder";
+ this.btnShowPrtFld.Click += new System.EventHandler(this.btnShowPrtFld_Click);
+ //
+ //
+ //
// btnHelpAbout
//
this.btnHelpAbout.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
@@ -1733,6 +1755,8 @@ namespace VEPROMS
private DevComponents.DotNetBar.TabItem infotabFoldoutMaint;
private Volian.Controls.Library.DisplayFoldoutMaint displayFoldoutMaint;
private DevComponents.DotNetBar.ButtonItem btnSendErrorLog;
+ private DevComponents.DotNetBar.ButtonItem btnShowErrFld;
+ private DevComponents.DotNetBar.ButtonItem btnShowPrtFld;
private DevComponents.DotNetBar.TabControlPanel tabControlPanel3;
private DevComponents.DotNetBar.TabItem toosTabReports;
private Volian.Controls.Library.DisplayReports displayReports;
diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs
index 0ff406ef..bc046ef3 100644
--- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs
+++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs
@@ -21,6 +21,7 @@ using DescriptiveEnum;
using Volian.Base.Library;
using Volian.Print.Library;
using JR.Utils.GUI.Forms;
+using System.Diagnostics;
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
@@ -514,6 +515,7 @@ namespace VEPROMS
ItemInfo.ItemDeleted += new ItemInfoEvent(RefreshDisplayHistory);
tv.PrintProcedure += new vlnTreeViewEvent(tv_PrintProcedure);
+ tv.PrintSection += new vlnTreeViewEvent(tv_PrintSection);
tv.QPrintProcedure += new vlnTreeViewEvent(tv_QPrintProcedure);
tv.PrintAllProcedures += new vlnTreeViewEvent(tv_PrintAllProcedures);
tv.ApproveProcedure += new vlnTreeViewEvent(tv_ApproveProcedure);
@@ -1189,6 +1191,45 @@ namespace VEPROMS
}
+ void tv_PrintSection(object sender, vlnTreeEventArgs args) // Quick Print right click menu on Procedure name.
+ {
+ try
+ {
+ //args.Node.Parent.
+ SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo;
+ int _prtSectID = si2.ItemID;
+
+ if (si2 == null) return;
+
+ tc.SaveCurrentEditItem(si2.MyProcedure);
+
+ si2.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex;
+
+ using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(si2.MyProcedure))
+ {
+ prnDlg.PrtSectID = _prtSectID;
+ prnDlg.SelectedSlave = args.UnitIndex;
+ prnDlg.MySessionInfo = MySessionInfo;
+ prnDlg.SetupForProcedure(); // Setup filename
+ prnDlg.ShowDialog(this); // Create Print report
+
+ si2.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
+ }
+ }
+ catch (Exception ex)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.AppendLine("Could not create PDF Print");
+ sb.AppendLine();
+ MessageBox.Show(sb.ToString(), "Error when creating PDF Print", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+
+ _MyLog.Warn("Failed to create PDF print", ex);
+ }
+
+ }
+
+
void tv_CreateContinuousActionSummary(object sender, vlnTreeEventArgs args)
{
DialogResult dr = System.Windows.Forms.DialogResult.Yes;
@@ -4932,6 +4973,26 @@ namespace VEPROMS
}
}
+ private void btnShowErrFld_Click(object sender, EventArgs e)
+ {
+ string path = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
+ path = path + @"\Documents\VEPROMS";
+ if (Directory.Exists(path))
+ {
+ Process.Start("explorer.exe", path);
+ }
+ }
+
+ private void btnShowPrtFld_Click(object sender, EventArgs e)
+ {
+ string path = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
+ path = path + @"\AppData\Local\Temp\VEPROMS";
+ if (Directory.Exists(path))
+ {
+ Process.Start("explorer.exe", path);
+ }
+ }
+
private void btnHelpManual_Click(object sender, EventArgs e)
{
// C2019-024 Display the PROMS User Manual when user click on the option in the Help drop down menu
diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.resx b/PROMS/VEPROMS User Interface/frmVEPROMS.resx
index d5038add..c950d8f5 100644
--- a/PROMS/VEPROMS User Interface/frmVEPROMS.resx
+++ b/PROMS/VEPROMS User Interface/frmVEPROMS.resx
@@ -170,6 +170,18 @@
rkJggg==
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAANUlEQVR4nGNgoBR8ahL8jw1/bBTooMiAT8Qa8gmPAUQZ8n+Z3n9KMMOoAf9Hw0CPCmEw4AAA71z+QhwwNhoAAAAASUVORK5CYII=
+
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAANUlEQVR4nGNgoBR8ahL8jw1/bBTooMiAT8Qa8gmPAUQZ8n+Z3n9KMMOoAf9Hw0CPCmEw4AAA71z+QhwwNhoAAAAASUVORK5CYII=
+
+
+
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs
index 04c00975..810ce4df 100644
--- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs
+++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs
@@ -665,10 +665,12 @@ namespace VEPROMS.CSLA.Library
{
TranFixCount++;
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Non-Editable Step");
- Content content = Content.Get(itemInfo.MyContent.ContentID);
- content.FixTransitionText(traninfo, true);
- content.Save();
- }
+ using (Content content = Content.Get(itemInfo.MyContent.ContentID)) //B2024-006 free up content memory when done
+ {
+ content.FixTransitionText(traninfo, true);
+ content.Save();
+ }
+ }
}
if (!forceConvertToText)
@@ -682,10 +684,12 @@ namespace VEPROMS.CSLA.Library
forceConvertToText = true;
TranFixCount++;
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to External Procedure using Internal Format");
- Content content = Content.Get(itemInfo.MyContent.ContentID);
- content.FixTransitionText(traninfo, true);
- content.Save();
- }
+ using (Content content = Content.Get(itemInfo.MyContent.ContentID)) //B2024-006 free up content memory when done
+ {
+ content.FixTransitionText(traninfo, true);
+ content.Save();
+ }
+ }
}
}
}
@@ -701,9 +705,11 @@ namespace VEPROMS.CSLA.Library
forceConvertToText = true;
TranFixCount++;
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Outside Procedure using Internal Format");
- Content content = Content.Get(itemInfo.MyContent.ContentID);
- content.FixTransitionText(traninfo, true);
- content.Save();
+ using (Content content = Content.Get(itemInfo.MyContent.ContentID)) //B2024-006 free up content memory when done
+ {
+ content.FixTransitionText(traninfo, true);
+ content.Save();
+ }
}
}
}
@@ -719,9 +725,11 @@ namespace VEPROMS.CSLA.Library
if (newText != oldText || newValue == "?")
{
TranFixCount++;
- Content content = Content.Get(itemInfo.MyContent.ContentID);
- content.FixTransitionText(traninfo);
- content.Save();
+ using (Content content = Content.Get(itemInfo.MyContent.ContentID)) //B2024-006 free up content memory when done
+ {
+ content.FixTransitionText(traninfo);
+ content.Save();
+ }
}
}
}
@@ -966,24 +974,26 @@ namespace VEPROMS.CSLA.Library
{
//ShowDifference(oldText, newText); // debug - display in Visual Studio Output window
ROFixCount++;
- Content content = Content.Get(itemInfo.MyContent.ContentID);
- if (roval == "?")
+ using (Content content = Content.Get(itemInfo.MyContent.ContentID)) //B2024-006 free up content memory when done
{
- oldText = content.ConvertROToText(rousage, roval, roch.type, origROFst);
- using (Item myitem = content.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
+ if (roval == "?")
{
- myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
- // B2016-225 (follow through) added more descriptive Annotation Type when RO is converted to text
- Annotation.MakeAnnotation(myitem, AnnotationType.GetByNameOrCreate("Link Converted To Text"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null);
+ oldText = content.ConvertROToText(rousage, roval, roch.type, origROFst);
+ using (Item myitem = content.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
+ {
+ myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
+ // B2016-225 (follow through) added more descriptive Annotation Type when RO is converted to text
+ Annotation.MakeAnnotation(myitem, AnnotationType.GetByNameOrCreate("Link Converted To Text"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null);
+ }
}
+ else
+ {
+ content.FixContentText(rousage, roval, roch.type, origROFst);
+ }
+ content.UserID = Volian.Base.Library.VlnSettings.UserID;
+ content.DTS = DateTime.Now;
+ content.Save();
}
- else
- {
- content.FixContentText(rousage, roval, roch.type, origROFst);
- }
- content.UserID = Volian.Base.Library.VlnSettings.UserID;
- content.DTS = DateTime.Now;
- content.Save();
}
}
}
diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs
index aa178018..483a321a 100644
--- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs
+++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs
@@ -1545,6 +1545,9 @@ namespace VEPROMS.CSLA.Library
{
//if (tb._FromItem.MyContent.InList(5322)) Console.WriteLine("Here");
string str1 = TranGetSectionNumber(tb._ToItem);
+ // F2024-008 added flag to title case the section number in transitions
+ if (tb._FormatData.TransData.Cap1stCharTransSectionNumber)
+ str1 = CapFirstLetterOnly(str1, 0);
if(!tb._ToItem.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) return str1;
List FromSections = GetSections(tb._FromItem.ActiveSection);
List ToSections = GetSections(tb._ToItem.ActiveSection);
@@ -1615,6 +1618,9 @@ namespace VEPROMS.CSLA.Library
sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") :
tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle, 0) :
sectionTitle);
+ // F2024-008 Added flag to surround the section title with parenthesis in transitions
+ if (tb._FormatData.TransData.ParensAroundSectionTitle)
+ sectionTitle = string.Format("({0})", sectionTitle);
// B2017-236 Replace embedded returns with spaces and trim the spaces from the end of the section title.
return TrimSectionTitle(sectionTitle);
}
diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs
index 250a4367..2b09e8d5 100644
--- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs
+++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs
@@ -7103,6 +7103,7 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _Cap1stCharTrans, "@Cap1stCharTrans");
}
}
+ // Title Case section title
private LazyLoad _Cap1stCharTransSection;
public bool Cap1stCharTransSection
{
@@ -7111,6 +7112,24 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _Cap1stCharTransSection, "@Cap1stCharTransSection");
}
}
+ // Title Case section number
+ private LazyLoad _Cap1stCharTransSectionNumber;
+ public bool Cap1stCharTransSectionNumber
+ {
+ get
+ {
+ return LazyLoad(ref _Cap1stCharTransSectionNumber, "@Cap1stCharTransSectionNumber");
+ }
+ }
+ // Parens around section title
+ private LazyLoad _ParensAroundSectionTitle;
+ public bool ParensAroundSectionTitle
+ {
+ get
+ {
+ return LazyLoad(ref _ParensAroundSectionTitle, "@ParensAroundSectionTitle");
+ }
+ }
private LazyLoad _UseTransitionModifier;
public bool UseTransitionModifier
{
diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs
index 1e651cad..21ac3f2f 100644
--- a/PROMS/Volian.Controls.Library/DisplayTransition.cs
+++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs
@@ -208,7 +208,7 @@ namespace Volian.Controls.Library
// set other procedure related private variables.
vlnTreeComboSetsFillIn(_CurrentProcedure);
cbTranProcsFillIn(_CurrentProcedure);
- if (_CurrentProcedure.Sections != null)
+ if (_CurrentProcedure.Sections != null && secitm != null)
{
// if the selected format is using section default, initialize with the section default (find it),
// otherwise use current section item.
@@ -987,6 +987,7 @@ namespace Volian.Controls.Library
if (prcitm.Sections != null)
{
foreach (SectionInfo sio in prcitm.Sections)
+
{
SectionConfig sc = sio.MyConfig as SectionConfig;
if (sc != null && sc.Section_OriginalSteps == "Y")
@@ -1115,6 +1116,8 @@ namespace Volian.Controls.Library
this.superToolTipDispTran.SetSuperTooltip(this.listBoxTranFmt, new DevComponents.DotNetBar.SuperTooltipInfo("", "",
"This is where transition types are selected. This also defines how the transition will look in the text.",
null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
+ // B2024-007 color of transition panel was not toggling properly
+ groupPanelTranFmt.Style.BackColor = !HasDefault && NeedsDefault ? Color.Red : Color.Orange;
//btnTranSave.Enabled = allowSave;
//if (CurTrans != null && selii != null)
//{
diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs
index 2cfc387d..5bbbeeee 100644
--- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs
+++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs
@@ -3395,6 +3395,8 @@ namespace Volian.Controls.Library
Cursor = Cursors.Default;
return;
}
+ // B2024-002: Save any changes to the database so that updating of ROs has current data:
+ MyEditItem.SaveContents();
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
{
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));
diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.Designer.cs b/PROMS/Volian.Controls.Library/vlnTreeView.Designer.cs
index 98e486b8..605c0232 100644
--- a/PROMS/Volian.Controls.Library/vlnTreeView.Designer.cs
+++ b/PROMS/Volian.Controls.Library/vlnTreeView.Designer.cs
@@ -1,36 +1,36 @@
namespace Volian.Controls.Library
{
- partial class vlnTreeView
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
+ partial class vlnTreeView
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
- #region Component Designer generated code
+ #region Component Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- components = new System.ComponentModel.Container();
- }
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ components = new System.ComponentModel.Container();
+ }
- #endregion
- }
+ #endregion
+ }
}
diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs
index eb220f91..ef52239f 100644
--- a/PROMS/Volian.Controls.Library/vlnTreeView.cs
+++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs
@@ -506,6 +506,11 @@ namespace Volian.Controls.Library
{
if (QPrintProcedure != null) QPrintProcedure(sender, args);
}
+ public event vlnTreeViewEvent PrintSection;
+ private void OnPrintSection(object sender, vlnTreeEventArgs args)
+ {
+ if (PrintSection != null) PrintSection(sender, args);
+ }
public event vlnTreeViewEvent PrintAllProcedures;
private void OnPrintAllProcedures(object sender, vlnTreeEventArgs args)
{
@@ -837,6 +842,7 @@ namespace Volian.Controls.Library
MenuItem mitcas = new MenuItem("Create Time Critical Action Summary"); //F2022-024 added menu option
MenuItem mip = new MenuItem("Print");
MenuItem miqp = new MenuItem("Quick Print");
+ //MenuItem mips = new MenuItem("Print Section");
MenuItem mia = new MenuItem("Approve");
int k = 0;
foreach (string s in pri.MyDocVersion.UnitNames)
@@ -850,6 +856,9 @@ namespace Volian.Controls.Library
MenuItem mqp = miqp.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
mqp.Enabled = procAppl;
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));
ma.Enabled = procAppl;
ma.Tag = k;
@@ -864,6 +873,7 @@ namespace Volian.Controls.Library
cm.MenuItems.Add(mitcas);
cm.MenuItems.Add(mip);
cm.MenuItems.Add(miqp);
+ //cm.MenuItems.Add(mips);
AddShowChangeBarsAfterMenuItem(cm.MenuItems, pri);
cm.MenuItems.Add(mia);
AddApprovedRevisionsMultiUnit(cm.MenuItems, pri);
@@ -874,6 +884,7 @@ namespace Volian.Controls.Library
cm.MenuItems.Add("Create Time Critical Action Summary", new EventHandler(mi_Click));
cm.MenuItems.Add("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);
cm.MenuItems.Add("Approve", new EventHandler(mi_Click));
@@ -945,6 +956,25 @@ namespace Volian.Controls.Library
SectionConfig sc = si.MyConfig as SectionConfig;
if (!si.IsEnhancedSection && (si.Sections == null || si.Sections.Count == 0 || (meta && sc != null && si.Sections != null && si.Sections.Count > 0 && sc.SubSection_Edit == "Y")))
cm.MenuItems.Add("New Step", new EventHandler(mi_Click));
+
+ //ProcedureInfo pri = tn as SectionInfo;
+ SectionInfo si2 = (tn as VETreeNode).VEObject as SectionInfo;
+ if (si2.MyDocVersion.MultiUnitCount > 1)
+ {
+ MenuItem mps = new MenuItem("Print Section");
+ int k = 0;
+ foreach (string s in si2.MyDocVersion.UnitNames)
+ {
+ k++;
+ MenuItem mp = mps.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
+ mp.Tag = k;
+ }
+ cm.MenuItems.Add(mps);
+ }
+ else
+ {
+ cm.MenuItems.Add("Print Section", new EventHandler(mi_Click));
+ }
}
}
}
@@ -962,7 +992,13 @@ namespace Volian.Controls.Library
}
#endregion
//_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
if (!tn.IsExpanded && tn.VEObject as SectionInfo != null)
{
@@ -1000,6 +1036,10 @@ namespace Volian.Controls.Library
// require clearing of all enhanced config data or mapping it to existing data (quite complicated)
if ((ui.IsAdministrator() || ui.IsSetAdministrator(i.MyProcedure.MyDocVersion) || ui.IsWriter(i.MyProcedure.MyDocVersion)) && (!i.IsEnhancedStep && !i.IsEnhancedProcedure && !i.IsEnhancedSection && !i.IsRtfRaw && !i.IsFigure))
cm.MenuItems.Add("Copy", new EventHandler(mi_Click));
+ if (i.HasWordContent)
+ {
+ cm.MenuItems.Add("Print Section", new EventHandler(mi_Click));
+ }
}
#endregion
//_MyLog.WarnFormat("Context Menu 4 - {0}", GC.GetTotalMemory(true));
@@ -1747,6 +1787,9 @@ namespace Volian.Controls.Library
case "Quick Print":
OnQPrintProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
+ case "Print Section":
+ OnPrintSection(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
+ break;
case "Print All Procedures for":
OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0,mi.Text,(int)mi.Tag));
break;
@@ -1880,6 +1923,10 @@ namespace Volian.Controls.Library
}
switch (mi.Text)
{
+ case "Print Section":
+ VETreeNode tn2 = SelectedNode as VETreeNode;
+ OnPrintSection(this, new vlnTreeEventArgs(tn2 as VETreeNode, null, 0));
+ break;
case "Open":
OpenNode();
break;
diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs
index ab857036..61b32bc1 100644
--- a/PROMS/Volian.Print.Library/PromsPrinter.cs
+++ b/PROMS/Volian.Print.Library/PromsPrinter.cs
@@ -179,6 +179,12 @@ namespace Volian.Print.Library
get { return _PDFFile; }
set { _PDFFile = value; }
}
+ private int _prtSectID = -1;
+ public int PrtSectID
+ {
+ get { return _prtSectID; }
+ set { _prtSectID = value; }
+ }
private bool _DebugOutput;
public bool DebugOutput
{
@@ -317,7 +323,7 @@ namespace Volian.Print.Library
set { _MergedPdf = value; }
}
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)
+ 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
_MyItem = myItem;
@@ -342,6 +348,7 @@ namespace Volian.Print.Library
_DidAll = didAll;
_MergeNotIncluded = false;
_MergedPdf = mergedPdf;
+ _prtSectID = PrtSectID;
//_MyReaderHelper.LoadTree(myItem);
}
// Pass 1 PDF Name
@@ -361,10 +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
// in that pdf that should have landscaped page numbers. These are added when the page is finished (onEndPage)
public static Dictionary> MergedLandscapePages = null;
- public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary)
+ public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary, int PrtSectID = -1)
{
if (_MyItem is ProcedureInfo)
{
+ _prtSectID = PrtSectID;
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
{
@@ -799,20 +807,23 @@ namespace Volian.Print.Library
int cnt = 0;
foreach (SectionInfo mySection in myProcedure.Sections)
{
- if (!mySection.MyDocStyle.IsStepSection && !mySection.IsAutoTOCSection)
+ if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID))
{
- VEPROMS.CSLA.Library.Document.ConvertWordSectionToDOCX((ItemInfo)mySection); // 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
- if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (mySection.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 (!mySection.MyDocStyle.IsStepSection && !mySection.IsAutoTOCSection)
+ {
+ VEPROMS.CSLA.Library.Document.ConvertWordSectionToDOCX((ItemInfo)mySection); // 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
+ if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (mySection.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.
- _MyFoldoutSection.Add(mySection);
- 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);
- cnt++;
+ _MyFoldoutSection.Add(mySection);
+ 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);
+ cnt++;
+ }
}
}
}
@@ -942,190 +953,193 @@ namespace Volian.Print.Library
}
foreach (SectionInfo mySection in myProcedure.Sections)
{
- // B2020-115 Calculate maximum available space on a page for figures
- vlnParagraph.hMax = ((float)mySection.MyDocStyle.Layout.PageLength);
- vlnParagraph.wMax = ((float)mySection.MyDocStyle.Layout.PageWidth) - ((float)mySection.MyDocStyle.Layout.LeftMargin - 12);
- NeedSupInfoBreak = true;
- 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)
- || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection))
- != doingFoldout) continue;
- if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
- PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
- PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
- PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
+ if(PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID) )
+ {
+ // B2020-115 Calculate maximum available space on a page for figures
+ vlnParagraph.hMax = ((float)mySection.MyDocStyle.Layout.PageLength);
+ vlnParagraph.wMax = ((float)mySection.MyDocStyle.Layout.PageWidth) - ((float)mySection.MyDocStyle.Layout.LeftMargin - 12);
+ NeedSupInfoBreak = true;
+ 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)
+ || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection))
+ != doingFoldout) continue;
+ if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
+ PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
+ PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
+ PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
- OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
- // Set up Helper for the particular Section
- if (_MyHelper == null)
- {
- LastFmtName = mySection.ActiveFormat.Name;
- lastDocStyle = (int)mySection.MyDocStyle.Index;
- string hlsText = "";
- int hlsItemId = 0;
- if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
+ OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
+ // Set up Helper for the particular Section
+ if (_MyHelper == null)
{
- hlsItemId = mySection.Steps[0].ItemID;
- hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list
- }
- cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId);
- _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);
- if (DebugOutput)
- {
- // 16-bit background
- string procedureFileName = BackgroundFolder + "\\" + PDFFile.Trim();//CreateFileName(myProcedure.DisplayNumber);
- FileInfo VEPromsFile = new FileInfo(procedureFileName);
- if (VEPromsFile.Exists && !doingFoldout)
- {
- _MyHelper.BackgroundFile = procedureFileName;
- float x = 0;
- float y = 0;
- 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
- // characters per inch.
- // 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in:
- // These values adjust if overlay is 16bit versus 32bit. This is
- // used so that the comparison is an exact match. Use 0,0 if comparing to another 32bit
- // pdf, i.e. won't process the following 2 lines of code.
- x = 2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI;
- y = -9.5F;
- }
- x += 72F * VlnSettings.GetCommandFloat("X", 0);
- y -= 72F * VlnSettings.GetCommandFloat("Y", 0);
- _MyHelper.BackgroundOffset = new PointF(x, y);
- _MyHelper.BackgroundPageOffset = 0;
- }
- _MyHelper.WatermarkLayer = _WatermarkLayer;
- _MyHelper.PageListLayer = _PagelistLayer;
- _MyHelper.TextLayer = _TextLayer;
- _MyHelper.BackgroundLayer = _BackgroundLayer;
- _MyHelper.DebugLayer = _DebugLayer;
- _MyHelper.PROMSVersionLayer = _PROMSVersionLayer; //C2018-009 print PROMS version
- }
- _MyHelper.Rev = _Rev;
- _MyHelper.Watermark = _Watermark;
- // C2019-039 Remove automatic zoom on Overlay PDFs
- //_MyHelper.DoZoomOMatic = DebugOutput;
- _MyHelper.OriginalPageBreak = OriginalPageBreak;
- _MyHelper.PROMSVersion = _PromsVersion; //C2018-009 print PROMS version
- _MyHelper.WatermarkColor = WatermarkOverrideColor; // C2021-019: save the override for the watermark color
- OnStatusChanged("After Set PageEvent", PromsPrinterStatusType.SetPageEvent);
- }
- else
- {
- //added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section
- _MyHelper.MyGaps.Clear();
- //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText);
- // 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 (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
- {
- _MyHelper.DidFirstPageDocStyle = false;
- lastDocStyle = (int)mySection.MyDocStyle.Index;
LastFmtName = mySection.ActiveFormat.Name;
- }
- if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
- _MyHelper.MySection = mySection;
- //OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);
- }
- // 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.
- _MyHelper.PhoneListHeight = 0;
- if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
- {
- // get config for section
- SectionConfig sc = mySection.MyConfig as SectionConfig;
- if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y")
- {
- DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
- if (dvc != null)
+ lastDocStyle = (int)mySection.MyDocStyle.Index;
+ string hlsText = "";
+ int hlsItemId = 0;
+ if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
{
- string phlist = dvc.Print_PhoneList;
- if (phlist != null && phlist != "")
- {
- // count lines:
- int cl = 0;
- int indx = phlist.IndexOf("\n");
- while (indx > 0)
- {
- cl++;
- if (indx + 1 > phlist.Length)
- indx = -1;
- else
- indx = phlist.IndexOf("\n", indx + 1);
- }
- if (cl == 0) cl = 1; // phone list is a single line without an ending newline
- _MyHelper.PhoneListHeight = cl * vlnPrintObject.SixLinesPerInch;
- }
+ hlsItemId = mySection.Steps[0].ItemID;
+ hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list
}
- }
- }
- _MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID
+ cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId, PrtSectID);
+ _MyHelper.AllowAllWatermarks = AllowAllWatermarks;
+ _MyHelper.MyPdfWriter = cb.PdfWriter;
+ _MyHelper.CreatingFoldoutPage = doingFoldout;
+ _MyHelper.CreatingSupInfoPage = false;
+ _MyHelper.MyPdfContentByte = cb;
- 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
- {
- InsertBlankPage(cb);
- }
- GenerateTOC(mySection, myProcedure, cb, _TextLayer);
- // 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:
- //if (myProcedure.ProcHasSupInfoData && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
- //{
- // InsertBlankPage(cb);
- //}
- }
- else
- {
- if (mySection.IsStepSection)
- {
- if (mySection.Steps != null && mySection.Steps.Count > 0)
+ if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
+ if (DebugOutput)
{
- // get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1)
- 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
- 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);
- else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages)
+ // 16-bit background
+ string procedureFileName = BackgroundFolder + "\\" + PDFFile.Trim();//CreateFileName(myProcedure.DisplayNumber);
+ FileInfo VEPromsFile = new FileInfo(procedureFileName);
+ if (VEPromsFile.Exists && !doingFoldout)
{
- // 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,
- // then don't insert a blank page between the previous section and this one
- if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !mySection.SearchPrev.MyDocStyle.DontInsertBlankPages)
+ _MyHelper.BackgroundFile = procedureFileName;
+ float x = 0;
+ float y = 0;
+ if (!(mySection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF
{
- // 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
- InsertBlankPage(cb);
- //_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 (SupInfoPrintType == E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
- {
- InsertBlankPage(cb);
+ // X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's
+ // characters per inch.
+ // 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in:
+ // These values adjust if overlay is 16bit versus 32bit. This is
+ // used so that the comparison is an exact match. Use 0,0 if comparing to another 32bit
+ // pdf, i.e. won't process the following 2 lines of code.
+ x = 2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI;
+ y = -9.5F;
}
+ x += 72F * VlnSettings.GetCommandFloat("X", 0);
+ y -= 72F * VlnSettings.GetCommandFloat("Y", 0);
+ _MyHelper.BackgroundOffset = new PointF(x, y);
+ _MyHelper.BackgroundPageOffset = 0;
}
+ _MyHelper.WatermarkLayer = _WatermarkLayer;
+ _MyHelper.PageListLayer = _PagelistLayer;
+ _MyHelper.TextLayer = _TextLayer;
+ _MyHelper.BackgroundLayer = _BackgroundLayer;
+ _MyHelper.DebugLayer = _DebugLayer;
+ _MyHelper.PROMSVersionLayer = _PROMSVersionLayer; //C2018-009 print PROMS version
}
- firstStepSec = false;
- CreateStepPdf(mySection, cb);
+ _MyHelper.Rev = _Rev;
+ _MyHelper.Watermark = _Watermark;
+ // C2019-039 Remove automatic zoom on Overlay PDFs
+ //_MyHelper.DoZoomOMatic = DebugOutput;
+ _MyHelper.OriginalPageBreak = OriginalPageBreak;
+ _MyHelper.PROMSVersion = _PromsVersion; //C2018-009 print PROMS version
+ _MyHelper.WatermarkColor = WatermarkOverrideColor; // C2021-019: save the override for the watermark color
+ OnStatusChanged("After Set PageEvent", PromsPrinterStatusType.SetPageEvent);
}
else
{
- CreateWordDocPdf(cb, mySection);
+ //added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section
+ _MyHelper.MyGaps.Clear();
+ //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText);
+ // 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 (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
+ {
+ _MyHelper.DidFirstPageDocStyle = false;
+ lastDocStyle = (int)mySection.MyDocStyle.Index;
+ LastFmtName = mySection.ActiveFormat.Name;
+ }
+ if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
+ _MyHelper.MySection = mySection;
+ //OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);
}
+ // 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.
+ _MyHelper.PhoneListHeight = 0;
+ if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
+ {
+ // get config for section
+ SectionConfig sc = mySection.MyConfig as SectionConfig;
+ if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y")
+ {
+ DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
+ if (dvc != null)
+ {
+ string phlist = dvc.Print_PhoneList;
+ if (phlist != null && phlist != "")
+ {
+ // count lines:
+ int cl = 0;
+ int indx = phlist.IndexOf("\n");
+ while (indx > 0)
+ {
+ cl++;
+ if (indx + 1 > phlist.Length)
+ indx = -1;
+ else
+ indx = phlist.IndexOf("\n", indx + 1);
+ }
+ if (cl == 0) cl = 1; // phone list is a single line without an ending newline
+ _MyHelper.PhoneListHeight = cl * vlnPrintObject.SixLinesPerInch;
+ }
+ }
+ }
+ }
+ _MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID
+
+ 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
+ {
+ InsertBlankPage(cb);
+ }
+ GenerateTOC(mySection, myProcedure, cb, _TextLayer);
+ // 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:
+ //if (myProcedure.ProcHasSupInfoData && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
+ //{
+ // InsertBlankPage(cb);
+ //}
+ }
+ else
+ {
+ if (mySection.IsStepSection)
+ {
+ if (mySection.Steps != null && mySection.Steps.Count > 0)
+ {
+ // get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1)
+ 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
+ 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);
+ 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:
+ // 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
+ 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)
+ // and the checkbox on the print dialog to add blank pages is checked
+ InsertBlankPage(cb);
+ //_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 (SupInfoPrintType == E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
+ {
+ InsertBlankPage(cb);
+ }
+ }
+ }
+ firstStepSec = false;
+ CreateStepPdf(mySection, cb);
+ }
+ else
+ {
+ CreateWordDocPdf(cb, mySection);
+ }
+ }
+ _MyHelper.PrintedSectionPage = 0;
}
- _MyHelper.PrintedSectionPage = 0;
}
if (_MyHelper != null && _MyHelper.BackgroundFile != null)
{
@@ -1570,270 +1584,273 @@ namespace Volian.Print.Library
bool inGroup = false;
foreach (SectionInfo mySection in ii.Sections)
{
- sectCnt++;
- SectionConfig sc = mySection.MyConfig as SectionConfig;
- if ((mySection.MyDocStyle != null && mySection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y"))
- || ((mySection.MyDocStyle == null || !mySection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y")))
+ if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID))
{
- // 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:
- level = 0;
- ItemInfo iilvl = mySection as ItemInfo;
- while (!iilvl.IsProcedure)
+ sectCnt++;
+ SectionConfig sc = mySection.MyConfig as SectionConfig;
+ if ((mySection.MyDocStyle != null && mySection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y"))
+ || ((mySection.MyDocStyle == null || !mySection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y")))
{
- level++;
- iilvl = iilvl.MyParent;
- }
- // check what level the plant wants the auto ToC indented:
- int tofCNumLevels = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCNumLevels ?? 0;
- if (tofCNumLevels > 0 && level > tofCNumLevels) return yLocation;
-
- int startIndentAfterLevel = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCStartIndentAfterLevel ?? 2; //
- level = level <= startIndentAfterLevel ? 0 : level - startIndentAfterLevel;
- float indentOffset = (level * (secTitlePos - secNumPos));
-
- if (didSubSecLineSpacing && sectCnt == 1 && indentOffset > 0) // processing first sub-section and we are indenting B2016-205
- {
- // processed last sub-section so use the main section line spacing (most times is double spaced)
- yLocation -= (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch;
- yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
- }
- // The Group Title logic was added for V.C. Summer and Farley(new writer guide format)
- // It allows the user to enter a Table of Contents Grouping Title on the Section Property (under automation)
- // The grouping title will print if the same title wasn't last printed
- string tocGrpHeading = sc.Section_TOC_Group_Title; // returns a "" if no title was entered
- float yBottomMargin = yPageStart - (float)tocSection.MyDocStyle.Layout.PageLength + (2 * vlnPrintObject.SixLinesPerInch);
- bool doGroupHeading = false;
- if (tocGrpHeading != lastTOCGroupHeading && tocGrpHeading.Length > 0)
- {
- doGroupHeading = true;
- inGroup = true;
- // B2020-033: for single spacing, add an extra line before a grouping title:
- float tmpspc = (float)(tOfC.TofCLineSpacing ?? 1);
- if (lastTOCGroupHeading != "" || (firstGroupHeading && tmpspc == 1))
+ // 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:
+ level = 0;
+ ItemInfo iilvl = mySection as ItemInfo;
+ while (!iilvl.IsProcedure)
{
- yLocation += vlnPrintObject.SixLinesPerInch;
- firstGroupHeading = false;
+ level++;
+ iilvl = iilvl.MyParent;
}
- lastTOCGroupHeading = tocGrpHeading;
- }
- // 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.
- bool didGrp = false;
- string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.DisplayNumber;// B2017-019 - process "" in section number
- if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
- && tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading))
- {
- tmptxt = tmptxt.Replace(tocGrpHeading, "");
- didGrp = true;
- }
- if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
- && lastTOCGroupHeading.Length > 0 && tmptxt.ToUpper().Contains(lastTOCGroupHeading))
- {
- tmptxt = tmptxt.Replace(lastTOCGroupHeading, "");
- didGrp = true;
- }
- string rtfText = GetRtfToC(tmptxt, tOfC);
- Paragraph myparagraphSecNum = vlnPrintObject.RtfToParagraph(rtfText);
- float width = 0;
- foreach (Chunk chkt in myparagraphSecNum.Chunks)
- width += chkt.GetWidthPoint();
- float numwidth = width;
- Rtf2Pdf.Offset = new PointF(0, 2.5F);
+ // check what level the plant wants the auto ToC indented:
+ int tofCNumLevels = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCNumLevels ?? 0;
+ if (tofCNumLevels > 0 && level > tofCNumLevels) return yLocation;
- // if the starting column of text would be in 'middle of' the number, just put it
- // a few spaces after the number. The '18' below represents 3 chars.
- float adjSecTitlePos = secTitlePos + indentOffset + (level * 6);
- if (secNumPos + numwidth + indentOffset > secTitlePos + indentOffset)
- adjSecTitlePos = secNumPos + numwidth + 18 - xAdjTitleIndent + indentOffset;
+ int startIndentAfterLevel = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCStartIndentAfterLevel ?? 2; //
+ level = level <= startIndentAfterLevel ? 0 : level - startIndentAfterLevel;
+ float indentOffset = (level * (secTitlePos - secNumPos));
- // 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
- string tocSecTitle = mySection.FormattedDisplayText;// B2017-019 - process "" in section title
- 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 != "")
- tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle;
+ if (didSubSecLineSpacing && sectCnt == 1 && indentOffset > 0) // processing first sub-section and we are indenting B2016-205
+ {
+ // processed last sub-section so use the main section line spacing (most times is double spaced)
+ yLocation -= (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch;
+ yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
+ }
+ // The Group Title logic was added for V.C. Summer and Farley(new writer guide format)
+ // It allows the user to enter a Table of Contents Grouping Title on the Section Property (under automation)
+ // The grouping title will print if the same title wasn't last printed
+ string tocGrpHeading = sc.Section_TOC_Group_Title; // returns a "" if no title was entered
+ float yBottomMargin = yPageStart - (float)tocSection.MyDocStyle.Layout.PageLength + (2 * vlnPrintObject.SixLinesPerInch);
+ bool doGroupHeading = false;
+ if (tocGrpHeading != lastTOCGroupHeading && tocGrpHeading.Length > 0)
+ {
+ doGroupHeading = true;
+ inGroup = true;
+ // B2020-033: for single spacing, add an extra line before a grouping title:
+ float tmpspc = (float)(tOfC.TofCLineSpacing ?? 1);
+ if (lastTOCGroupHeading != "" || (firstGroupHeading && tmpspc == 1))
+ {
+ yLocation += vlnPrintObject.SixLinesPerInch;
+ firstGroupHeading = false;
+ }
+ lastTOCGroupHeading = tocGrpHeading;
+ }
+ // 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.
+ bool didGrp = false;
+ string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.DisplayNumber;// B2017-019 - process "" in section number
+ if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
+ && tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading))
+ {
+ tmptxt = tmptxt.Replace(tocGrpHeading, "");
+ didGrp = true;
+ }
+ if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
+ && lastTOCGroupHeading.Length > 0 && tmptxt.ToUpper().Contains(lastTOCGroupHeading))
+ {
+ tmptxt = tmptxt.Replace(lastTOCGroupHeading, "");
+ didGrp = true;
+ }
+ string rtfText = GetRtfToC(tmptxt, tOfC);
+ Paragraph myparagraphSecNum = vlnPrintObject.RtfToParagraph(rtfText);
+ float width = 0;
+ foreach (Chunk chkt in myparagraphSecNum.Chunks)
+ width += chkt.GetWidthPoint();
+ float numwidth = width;
+ Rtf2Pdf.Offset = new PointF(0, 2.5F);
- // Do the title first since it may wrap to 2nd line and this is an issue for
- // doing a pagebreak, i.e. may cause a page break when the number on a single line
- // would not.
- //if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData
- if (level == 0 && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCUnderlineFirstLevelTitle)
- {
- VE_Font ovrFont = new VE_Font(tOfC.Font.Family, (int)tOfC.Font.Size, (E_Style)tOfC.Font.Style | E_Style.Underline, (float)tOfC.Font.CPI);
- rtfText = GetRtfToC(tocSecTitle, tOfC, ovrFont);
- }
- else
- rtfText = GetRtfToC(tocSecTitle, tOfC);
- Paragraph myparagraphSecTitle = vlnPrintObject.RtfToParagraph(rtfText); // section title
- width = secPagePos - adjSecTitlePos - ((tOfC.TofCPageNumAlign.ToUpper() == "RIGHT") ? 18 : 6);// B2021-109 proper adjustment of section title width - copied from leader dots lenth calcuation below
- float savTitleWid = width;
- // for South Texas Table of Contents
- // if there is no section number (we put a blank in tmptxt) then move the section title over to the section number position
- if (doGroupHeading) // see if the group title and the first item under it will fit on the page B2016-216
- {
- VE_Font grpingFont = new VE_Font(tOfC.Font.Family, (int)tOfC.Font.Size, (E_Style)tOfC.Font.Style | E_Style.Underline, (float)tOfC.Font.CPI);
- string rtfGrpingText = GetRtfToC(tocGrpHeading, tOfC, grpingFont);
- Paragraph myparagraphGrpTitle = vlnPrintObject.RtfToParagraph(rtfGrpingText);
- float w = secPagePos - 6;
- // F2018-033: Farley Auto TOC. If line spacing is less than 0, then spacing is double spaced if on section items (such as
- // Purpose, Proc Steps; and spacing is single spaced if within groups. If not less than 0, just use what is in format file.
- int lnaftergroup = 1;
- float lnsp = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacing ?? 0;
- if (lnsp < 0) lnaftergroup = ((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 0) > 0) ? 1 : 2;
- float yLocAfterGrpTitleAndFirstItem = yLocation + (lnaftergroup * vlnPrintObject.SixLinesPerInch) + vlnPrintObject.GetHeight(cb, myparagraphGrpTitle, string.Empty, w, false) + vlnPrintObject.GetHeight(cb, myparagraphSecTitle, string.Empty, savTitleWid, false);
- // if group heading and first item under it does not fit on the page, do a page break
- if ((yPageStart - yLocAfterGrpTitleAndFirstItem) < yBottomMargin)
+ // if the starting column of text would be in 'middle of' the number, just put it
+ // a few spaces after the number. The '18' below represents 3 chars.
+ float adjSecTitlePos = secTitlePos + indentOffset + (level * 6);
+ if (secNumPos + numwidth + indentOffset > secTitlePos + indentOffset)
+ adjSecTitlePos = secNumPos + numwidth + 18 - xAdjTitleIndent + indentOffset;
+
+ // 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
+ string tocSecTitle = mySection.FormattedDisplayText;// B2017-019 - process "" in section title
+ 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 != "")
+ tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle;
+
+ // Do the title first since it may wrap to 2nd line and this is an issue for
+ // doing a pagebreak, i.e. may cause a page break when the number on a single line
+ // would not.
+ //if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData
+ if (level == 0 && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCUnderlineFirstLevelTitle)
+ {
+ VE_Font ovrFont = new VE_Font(tOfC.Font.Family, (int)tOfC.Font.Size, (E_Style)tOfC.Font.Style | E_Style.Underline, (float)tOfC.Font.CPI);
+ rtfText = GetRtfToC(tocSecTitle, tOfC, ovrFont);
+ }
+ else
+ rtfText = GetRtfToC(tocSecTitle, tOfC);
+ Paragraph myparagraphSecTitle = vlnPrintObject.RtfToParagraph(rtfText); // section title
+ width = secPagePos - adjSecTitlePos - ((tOfC.TofCPageNumAlign.ToUpper() == "RIGHT") ? 18 : 6);// B2021-109 proper adjustment of section title width - copied from leader dots lenth calcuation below
+ float savTitleWid = width;
+ // for South Texas Table of Contents
+ // if there is no section number (we put a blank in tmptxt) then move the section title over to the section number position
+ if (doGroupHeading) // see if the group title and the first item under it will fit on the page B2016-216
+ {
+ VE_Font grpingFont = new VE_Font(tOfC.Font.Family, (int)tOfC.Font.Size, (E_Style)tOfC.Font.Style | E_Style.Underline, (float)tOfC.Font.CPI);
+ string rtfGrpingText = GetRtfToC(tocGrpHeading, tOfC, grpingFont);
+ Paragraph myparagraphGrpTitle = vlnPrintObject.RtfToParagraph(rtfGrpingText);
+ float w = secPagePos - 6;
+ // F2018-033: Farley Auto TOC. If line spacing is less than 0, then spacing is double spaced if on section items (such as
+ // Purpose, Proc Steps; and spacing is single spaced if within groups. If not less than 0, just use what is in format file.
+ int lnaftergroup = 1;
+ float lnsp = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacing ?? 0;
+ if (lnsp < 0) lnaftergroup = ((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 0) > 0) ? 1 : 2;
+ float yLocAfterGrpTitleAndFirstItem = yLocation + (lnaftergroup * vlnPrintObject.SixLinesPerInch) + vlnPrintObject.GetHeight(cb, myparagraphGrpTitle, string.Empty, w, false) + vlnPrintObject.GetHeight(cb, myparagraphSecTitle, string.Empty, savTitleWid, false);
+ // if group heading and first item under it does not fit on the page, do a page break
+ if ((yPageStart - yLocAfterGrpTitleAndFirstItem) < yBottomMargin)
+ {
+ NewPage();
+ _MyHelper.ResetSvg(); // needed to reset so that PSNotFirst pagelist justify flag gets used for BGE
+ yLocation = lastyLocation = 0;
+ }
+ //if (yLocation > 0) yLocation += vlnPrintObject.SixLinesPerInch;// commented out for B2016-200 // for two blank line between last TOC title and the new grouping title
+ float rtnval = Rtf2Pdf.TextAt(cb, myparagraphGrpTitle, leftMargin + secNumPos, yPageStart - yLocation, w, height, "", yBottomMargin); // print the Group Title
+ yLocation += vlnPrintObject.SixLinesPerInch; // for two blank line between last TOC title and the new grouping title - added for B2016-200
+ if (lnsp > -1) yLocation += (lnaftergroup * vlnPrintObject.SixLinesPerInch); // new line
+ }
+ // Print the section title
+ float retval = Rtf2Pdf.TextAt(cb, myparagraphSecTitle, leftMargin + ((tOfC.TofCSecNumPos == tOfC.TofCSecTitlePos && tmptxt.Equals(" ")) ? secNumPos : adjSecTitlePos), yPageStart - yLocation, width, height, "", yBottomMargin);
+ if (retval == 0) // couldn't fit, flags need for a page break.
{
NewPage();
_MyHelper.ResetSvg(); // needed to reset so that PSNotFirst pagelist justify flag gets used for BGE
yLocation = lastyLocation = 0;
+ retval = Rtf2Pdf.TextAt(cb, myparagraphSecTitle, leftMargin + adjSecTitlePos, yPageStart - yLocation, width, height, "", yBottomMargin);
}
- //if (yLocation > 0) yLocation += vlnPrintObject.SixLinesPerInch;// commented out for B2016-200 // for two blank line between last TOC title and the new grouping title
- float rtnval = Rtf2Pdf.TextAt(cb, myparagraphGrpTitle, leftMargin + secNumPos, yPageStart - yLocation, w, height, "", yBottomMargin); // print the Group Title
- yLocation += vlnPrintObject.SixLinesPerInch; // for two blank line between last TOC title and the new grouping title - added for B2016-200
- if (lnsp > -1) yLocation += (lnaftergroup * vlnPrintObject.SixLinesPerInch); // new line
- }
- // Print the section title
- float retval = Rtf2Pdf.TextAt(cb, myparagraphSecTitle, leftMargin + ((tOfC.TofCSecNumPos == tOfC.TofCSecTitlePos && tmptxt.Equals(" ")) ? secNumPos : adjSecTitlePos), yPageStart - yLocation, width, height, "", yBottomMargin);
- if (retval == 0) // couldn't fit, flags need for a page break.
- {
- NewPage();
- _MyHelper.ResetSvg(); // needed to reset so that PSNotFirst pagelist justify flag gets used for BGE
- yLocation = lastyLocation = 0;
- retval = Rtf2Pdf.TextAt(cb, myparagraphSecTitle, leftMargin + adjSecTitlePos, yPageStart - yLocation, width, height, "", yBottomMargin);
- }
- float ttlRetval = retval;
- float savTitleFillWidth = Rtf2Pdf.FillWidth;
+ float ttlRetval = retval;
+ float savTitleFillWidth = Rtf2Pdf.FillWidth;
- // Now do the section number. Retval is the ylocation on page after the text
- // is put out.
- retval = Rtf2Pdf.TextAt(cb, myparagraphSecNum, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, numwidth * 1.3F, height, "", yBottomMargin);
+ // Now do the section number. Retval is the ylocation on page after the text
+ // is put out.
+ retval = Rtf2Pdf.TextAt(cb, myparagraphSecNum, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, numwidth * 1.3F, height, "", yBottomMargin);
- //float lSpace = (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
+ //float lSpace = (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
- // 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.
- // Only do this if the title is not empty (the code was meant for if title spans more than a line)
- if (retval != ttlRetval && mySection.MyContent.Text != null && mySection.MyContent.Text != "") yLocation += (retval - ttlRetval);
+ // 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.
+ // Only do this if the title is not empty (the code was meant for if title spans more than a line)
+ if (retval != ttlRetval && mySection.MyContent.Text != null && mySection.MyContent.Text != "") yLocation += (retval - ttlRetval);
- // retval = the minimum (further down the page) between section number and
- // title - this accounts for multi line title.
- retval = Math.Min(retval, ttlRetval);
- lastyLocation = retval;
+ // retval = the minimum (further down the page) between section number and
+ // title - this accounts for multi line title.
+ retval = Math.Min(retval, ttlRetval);
+ lastyLocation = retval;
- // check that the page number should be in the TOC (some BGE sections do not have the page number)
- if (!((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC))
- {
- // 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
- // these between the section title & the page number
- if (tOfC.TofCSpaceChar != null && tOfC.TofCSpaceChar != "" && tOfC.TofCSpaceChar != " ")
+ // check that the page number should be in the TOC (some BGE sections do not have the page number)
+ if (!((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC))
{
- width = 0;
- foreach (Chunk chkt in myparagraphSecTitle.Chunks)
- width += chkt.GetWidthPoint();
-
- // get height - if two lines high, need width of 2nd line for adding
- // space characters
- float heightTtl = vlnPrintObject.GetHeight(cb, myparagraphSecTitle, string.Empty, savTitleWid, false);
- string spaceStr = "";
- float startSpace = 0;
- // the '6's in the next few code lines & in the 'while' loop below allows the placement of the dots (or other space character)
- // to be not too close to section title & page number.
- if (heightTtl > vlnPrintObject.SixLinesPerInch)
+ // 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
+ // these between the section title & the page number
+ if (tOfC.TofCSpaceChar != null && tOfC.TofCSpaceChar != "" && tOfC.TofCSpaceChar != " ")
{
- // this title is 2 or more lines, find start of leader dots by determining length of text
- // on 2nd line (the savTitleFillWidth is the widest line of the split title)
- float secondLineWidth = width - savTitleFillWidth;
- startSpace = leftMargin + adjSecTitlePos + secondLineWidth + 6;
+ width = 0;
+ foreach (Chunk chkt in myparagraphSecTitle.Chunks)
+ width += chkt.GetWidthPoint();
+
+ // get height - if two lines high, need width of 2nd line for adding
+ // space characters
+ float heightTtl = vlnPrintObject.GetHeight(cb, myparagraphSecTitle, string.Empty, savTitleWid, false);
+ string spaceStr = "";
+ float startSpace = 0;
+ // the '6's in the next few code lines & in the 'while' loop below allows the placement of the dots (or other space character)
+ // to be not too close to section title & page number.
+ if (heightTtl > vlnPrintObject.SixLinesPerInch)
+ {
+ // this title is 2 or more lines, find start of leader dots by determining length of text
+ // on 2nd line (the savTitleFillWidth is the widest line of the split title)
+ float secondLineWidth = width - savTitleFillWidth;
+ startSpace = leftMargin + adjSecTitlePos + secondLineWidth + 6;
+ }
+ else
+ startSpace = leftMargin + adjSecTitlePos + width + 6;
+ // If the page number is Right justified, need less space characters ('.') so that page number
+ // doesn't have the last space character overwriting the 1st digit:
+ int endJust = (tOfC.TofCPageNumAlign.ToUpper() == "RIGHT") ? 18 : 6;
+
+ float endSpace = leftMargin + secPagePos - endJust;
+ float numSpace = endSpace - startSpace;
+ rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC);
+ Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText);
+ float spacchrwid = 0;
+ foreach (Chunk chkt in tmpmyparagraph.Chunks)
+ spacchrwid += chkt.GetWidthPoint();
+ while (numSpace > 6)
+ {
+ spaceStr = spaceStr + tOfC.TofCSpaceChar;
+ numSpace -= spacchrwid;
+ }
+
+ rtfText = GetRtfToC(spaceStr, tOfC); // out the leader dots
+ Paragraph myparagraphs = vlnPrintObject.RtfToParagraph(rtfText);
+ retval = Rtf2Pdf.TextAt(cb, myparagraphs, startSpace, yPageStart - yLocation, endSpace - startSpace, height, "", yBottomMargin);
+
+ }
+ // if in the pre-table of content list, just put the page number out as text.
+ // otherwise, add a template _MyHelper.MyTOCPageCounts
+ string key = "TOC" + mySection.ItemID.ToString();
+ if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key))
+ {
+ string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString();
+ rtfText = GetRtfToC(pnum, tOfC);
+ Paragraph myparagraphp = vlnPrintObject.RtfToParagraph(rtfText);
+ width = pnum.Length * 6;
+ retval = Rtf2Pdf.TextAt(cb, myparagraphp, leftMargin + secPagePos, yPageStart - yLocation, width, height, "", yBottomMargin);
}
else
- startSpace = leftMargin + adjSecTitlePos + width + 6;
- // If the page number is Right justified, need less space characters ('.') so that page number
- // doesn't have the last space character overwriting the 1st digit:
- int endJust = (tOfC.TofCPageNumAlign.ToUpper() == "RIGHT") ? 18 : 6;
-
- float endSpace = leftMargin + secPagePos - endJust;
- float numSpace = endSpace - startSpace;
- rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC);
- Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText);
- float spacchrwid = 0;
- foreach (Chunk chkt in tmpmyparagraph.Chunks)
- spacchrwid += chkt.GetWidthPoint();
- while (numSpace > 6)
- {
- spaceStr = spaceStr + tOfC.TofCSpaceChar;
- numSpace -= spacchrwid;
- }
-
- rtfText = GetRtfToC(spaceStr, tOfC); // out the leader dots
- Paragraph myparagraphs = vlnPrintObject.RtfToParagraph(rtfText);
- retval = Rtf2Pdf.TextAt(cb, myparagraphs, startSpace, yPageStart - yLocation, endSpace - startSpace, height, "", yBottomMargin);
-
+ AddTemplateTOCPageCounts(tOfC, yLocation, yPageStartAdj, leftMargin, secPagePos, height, key);
}
- // if in the pre-table of content list, just put the page number out as text.
- // otherwise, add a template _MyHelper.MyTOCPageCounts
- string key = "TOC" + mySection.ItemID.ToString();
- if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key))
+ //If the format wants single spacing within subsections (2nd level and lower), then need to figure out
+ // spacing (vcb1 table of contents)
+ //bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
+ // && (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null))))
+ // || didGrp;
+ doSubY = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
+ && (mySection.MyParent.IsSection && (/* mySection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205
+ || didGrp;
+ //float spc = (float)(tOfC.TofCLineSpacing ?? 1);
+ if (doSubY)
{
- string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString();
- rtfText = GetRtfToC(pnum, tOfC);
- Paragraph myparagraphp = vlnPrintObject.RtfToParagraph(rtfText);
- width = pnum.Length * 6;
- retval = Rtf2Pdf.TextAt(cb, myparagraphp, leftMargin + secPagePos, yPageStart - yLocation, width, height, "", yBottomMargin);
+ float spcs = (float)(tOfC.TofCLineSpacingSub ?? 1);
+ if (spcs == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
+ {
+ if (inGroup) // Do not require a title to be placed on each section in group for Farley. If in group from above, single space
+ spcs = 1;
+ else
+ spcs = 2;
+ }
+ yLocation += (spcs * vlnPrintObject.SixLinesPerInch);
}
else
- AddTemplateTOCPageCounts(tOfC, yLocation, yPageStartAdj, leftMargin, secPagePos, height, key);
- }
- //If the format wants single spacing within subsections (2nd level and lower), then need to figure out
- // spacing (vcb1 table of contents)
- //bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
- // && (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null))))
- // || didGrp;
- doSubY = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
- && (mySection.MyParent.IsSection && (/* mySection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205
- || didGrp;
- //float spc = (float)(tOfC.TofCLineSpacing ?? 1);
- if (doSubY)
- {
- float spcs = (float)(tOfC.TofCLineSpacingSub ?? 1);
- if (spcs == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
{
- if (inGroup) // Do not require a title to be placed on each section in group for Farley. If in group from above, single space
- spcs = 1;
- else
- spcs = 2;
+ float spc = (float)(tOfC.TofCLineSpacing ?? 1);
+ if (spc == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
+ {
+ if (inGroup) // Do not require a title to be placed on each section in group for Farley. If in group from above, single space
+ spc = 1;
+ else
+ spc = 2;
+ }
+ yLocation += (spc * vlnPrintObject.SixLinesPerInch);
}
- yLocation += (spcs * vlnPrintObject.SixLinesPerInch);
+ // 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:
+ if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCAllowHLS &&
+ mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
+ yLocation = AddHLSToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY, level + 1, adjSecTitlePos);
}
- else
+ float savYLoc = yLocation;
+ 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
{
- float spc = (float)(tOfC.TofCLineSpacing ?? 1);
- if (spc == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
+ if (doSubY && sectCnt == ii.Sections.Count)
{
- if (inGroup) // Do not require a title to be placed on each section in group for Farley. If in group from above, single space
- spc = 1;
- else
- spc = 2;
+ // processed last sub-section so use the main section line spacing (most times is double spaced)
+ yLocation -= (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch;
+ yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
}
- yLocation += (spc * vlnPrintObject.SixLinesPerInch);
- }
- // 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:
- if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCAllowHLS &&
- mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
- yLocation = AddHLSToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY, level + 1, adjSecTitlePos);
- }
- float savYLoc = yLocation;
- 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 (doSubY && sectCnt == ii.Sections.Count)
- {
- // processed last sub-section so use the main section line spacing (most times is double spaced)
- yLocation -= (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch;
- yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch;
}
}
}
@@ -2338,7 +2355,7 @@ namespace Volian.Print.Library
iTextSharp.text.Rectangle pageSize = PDFPageSize.UsePaperSize(MyItem.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
PdfContentByte cb = OpenDoc(ref SupInfoPdfName, pageSize);
if (cb == null) return;
- VlnSvgPageHelper myPageHelper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0);
+ VlnSvgPageHelper myPageHelper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0, _prtSectID);
cb.PdfWriter.PageEvent = myPageHelper;
myPageHelper.AllowAllWatermarks = AllowAllWatermarks;
myPageHelper.MyPdfWriter = cb.PdfWriter;
@@ -2926,46 +2943,49 @@ namespace Volian.Print.Library
if (ii.Sections == null) return; // B2021-067 crash on null reference
foreach (SectionInfo si in ii.Sections)
{
+ if (MyPromsPrinter.PrtSectID == -1 || (MyPromsPrinter.PrtSectID > -1 && si.ItemID == MyPromsPrinter.PrtSectID))
+ {
if (si.IsStepSection)
- {
- if (si.Sections != null) LoadSectionTree(si);
- }
- else
- {
- MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(si);
- if (MyPdfFile != null)
{
- try
+ if (si.Sections != null) LoadSectionTree(si);
+ }
+ else
+ {
+ MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(si);
+ if (MyPdfFile != null)
{
- FileInfo fi = new FileInfo(MyPdfFile);
- if (fi.Length == 0) // B2017-218 Handle invalid word sections
+ try
{
- if (!PromsPrinter.BaselineTesting) //B2018-071 Output a message box unless baseline testing is being performed.
- MessageBox.Show(si.DisplayNumber + " " + si.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
+ FileInfo fi = new FileInfo(MyPdfFile);
+ 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.
+ MessageBox.Show(si.DisplayNumber + " " + si.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ return;
+ }
+ MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null;
+ string key = string.Empty;
+ for (int i = 1; i <= MyReader.NumberOfPages; i++)
+ {
+ key = string.Format("{0}.{1}", si.ItemID, i);
+ dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, 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 (!((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);
+ dicSize.Add(key, rectgl);
+ //dicSize.Add(key, MyReader.GetPageSizeWithRotation(i));
+ }
}
- MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null;
- string key = string.Empty;
- for (int i = 1; i <= MyReader.NumberOfPages; i++)
+ catch (Exception ex)
{
- key = string.Format("{0}.{1}", si.ItemID, i);
- dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, 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 (!((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);
- dicSize.Add(key, rectgl);
- //dicSize.Add(key, MyReader.GetPageSizeWithRotation(i));
+ if (_MyPromsPrinter.DocReplace == null)
+ MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ _MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", si.ItemID, si.DisplayNumber, si.DisplayText), ex);
}
}
- catch (Exception ex)
- {
- if (_MyPromsPrinter.DocReplace == null)
- MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
- _MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", si.ItemID, si.DisplayNumber, si.DisplayText), ex);
- }
}
- }
+ }
}
}
}
diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs
index c5c2e949..ea078716 100644
--- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs
+++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs
@@ -85,6 +85,12 @@ namespace Volian.Print.Library
get { return _TopMessage; }
set { _TopMessage = value; }
}
+ private int _prtSectID = -1;
+ public int PrtSectID
+ {
+ get { return _prtSectID; }
+ set { _prtSectID = value; }
+ }
private List _TopMessageRs=new List(); // Added if there are 2 messages, in AER AND RNO (for BGE)
public List TopMessageRs
{
@@ -867,12 +873,15 @@ i = 0;
set
{
_MySection = value;
- MySectionTitle = ((_MySection.DisplayNumber ?? string.Empty)==string.Empty ? string.Empty : _MySection.DisplayNumber + " - ") + _MySection.DisplayText;
+ MySectionTitle = ((_MySection.DisplayNumber ?? string.Empty) == string.Empty ? string.Empty : _MySection.DisplayNumber + " - ") + _MySection.DisplayText;
bool forceLoadSvg = false;
if (value.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && value.MyDocStyle.ResetFirstPageOnSection)
DidFirstPageDocStyle = false;
if (DidFirstPageDocStyle)
forceLoadSvg = SetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this)
+ if (_prtSectID > -1) {
+ forceLoadSvg = true;
+ }
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg);
if (sectSvg != null) MySvg = sectSvg;
_YTopMargin = null;
@@ -1031,9 +1040,10 @@ i = 0;
set { _MyPromsPrinter = value; }
}
private int _MyRomanPage = 1;
- public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId)
+ public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int PrtSectID)
: base()
{
+ _prtSectID = PrtSectID;
HLSText = hlsText;
HasHLSTextId = hlsItemId;
MyPromsPrinter = myPromsPrinter;
@@ -1836,6 +1846,8 @@ i = 0;
float coverlinelen = ((ctlen == 0) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength : ctlen) * (float)pageItem.Font.CPI / 12;
string title1 = section.MyProcedure.MyContent.Text;
if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title1 = title1.ToUpper();
+ // F2024-012 copied this line from above (processing COVERPROCTITLE) to resolve unit designators in the procedure title
+ if (title1.ToUpper().Contains(@"