diff --git a/PROMS/Formats/fmtall/VEGP2all.xml b/PROMS/Formats/fmtall/VEGP2all.xml index 33bfe91b..ab7cfa95 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 fa1f9f5f..39b977a4 100644 Binary files a/PROMS/Formats/fmtall/VEGPAlrall.xml and b/PROMS/Formats/fmtall/VEGPAlrall.xml differ diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index d8cc47e0..c61857ad 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -18,14 +18,14 @@ namespace VEPROMS { public bool SaveLinks { - get - { + get + { return swtbtnPDFLinks.Value; } } public int RemoveTrailingHardReturnsAndManualPageBreaks { - get + get { // C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. // return values: 0=None; 1=Trailing; 2=ManualPgBrk; 3=Both. @@ -33,7 +33,7 @@ namespace VEPROMS if (!cbxRemoveManualPgBrk.Checked && !cbxRemoveTrailing.Checked) return 0; if (!cbxRemoveManualPgBrk.Checked && cbxRemoveTrailing.Checked) return 1; if (cbxRemoveManualPgBrk.Checked && !cbxRemoveTrailing.Checked) return 2; - return 3; + return 3; } } private string _Prefix = ""; // RHM20150506 Multiline ItemID TextBox @@ -59,10 +59,8 @@ namespace VEPROMS get { return _Automatic; } set { _Automatic = value; } } - // C2024-003 parameter contains parent section, child section, issubsection flag. - // C2024-003 values needed to print section. - private int[] _prtSectID = new int[] { -1, -1, 0 }; - public int[] PrtSectID + private int _prtSectID = -1; + public int PrtSectID { get { return _prtSectID; } set { _prtSectID = value; } @@ -75,8 +73,8 @@ namespace VEPROMS public bool AllowDateTimePrefixSuffix { get { return _AllowDateTimePrefixSuffix; } - set - { + set + { _AllowDateTimePrefixSuffix = value; swtbtnPDFdtPrefixSuffix.Value = swtbtnPDFdtPrefixSuffix.Enabled = _AllowDateTimePrefixSuffix; } @@ -88,7 +86,7 @@ namespace VEPROMS { cbxDebugPagination.Checked = true; cbxDebugText.Checked = true; - cbxMetaFile.Checked = true; // C2018-004 create meta file for baseline compares + cbxMetaFile.Checked = true; // C2018-004 create meta file for baseline compares _IncludeWordSecTextInMetafile = true; Application.DoEvents(); string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); @@ -103,7 +101,7 @@ namespace VEPROMS cbxDebug.Checked = false; else if (parameter.ToUpper() == "/NM") cbxMetaFile.Checked = false; // C2018-004 turn off create meta file for baseline compares - else if (parameter.ToUpper() == "/NW") + else if (parameter.ToUpper() == "/NW") _IncludeWordSecTextInMetafile = false; // C2018-023 turn off putting Word attachment text in the meta file for baseline compares } CreatePDFs(); @@ -145,11 +143,10 @@ namespace VEPROMS } public string PDFPath { - get - {// B2018-069 Revert to Temporary for Baseline testing + get {// B2018-069 Revert to Temporary for Baseline testing if (PromsPrinter.BaselineTesting) return VlnSettings.TemporaryFolder; - return txbPDFLocation.Text; + return txbPDFLocation.Text; } set { txbPDFLocation.Text = value; } } @@ -193,7 +190,7 @@ namespace VEPROMS if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) { swtbtnBlankPgsForDuplex.Enabled = false; - tbBlankPage.Enabled = true; // C2019-004: Allow user to define duplex blank page text (similar changes throughout file are not commented) + tbBlankPage.Enabled = true; // C2019-004: Allow user to define duplex blank page text (similar changes throughout file are not commented) } btnCreatePDF.Text = "Create PDFs"; HandleDocVersionSettings(); @@ -238,7 +235,7 @@ namespace VEPROMS gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode; swtbtnGeneratePlacekeeper.Value = false; cbxGenerateConActSum.Checked = false; - swtbtnGeneratePlacekeeper.Visible = lblGeneratePlacekeeper.Visible = oneProcedure && + swtbtnGeneratePlacekeeper.Visible = lblGeneratePlacekeeper.Visible = oneProcedure && ((MyProcedure.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper); // C2021-062 make visable the check box to assign rev number for all procedures being printed // also make visable the Rev Num entry field. @@ -283,7 +280,7 @@ namespace VEPROMS expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value || swtbtnPDFdtPrefixSuffix.Value; } public DlgPrintProcedure(ProcedureInfo pi, bool automatic) // RHM20150506 Multiline ItemID TextBox - { + { InitializeComponent(); Automatic = automatic; _AllProcedures = false; @@ -312,7 +309,7 @@ namespace VEPROMS { base.OnActivated(e); if (Owner != null) - Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height / 2 - Height / 2); + Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height/2 - Height/2); } private void HandleDocVersionSettings() { @@ -326,10 +323,10 @@ namespace VEPROMS // if the default setting is 'SelectBeforePrinting', expand the Additional Print Settings panel if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.SelectBeforePrinting) { - swtbtnChgBar.Value = false; - cbxOvrrideDefChgBars.Checked = false; - expPrnSetting.Expanded = true; - } + swtbtnChgBar.Value = false; + cbxOvrrideDefChgBars.Checked = false; + expPrnSetting.Expanded = true; + } } private void GetDocVersionSettings() @@ -344,14 +341,14 @@ namespace VEPROMS cbxOpenAfterCreate2.Checked = _DocVersionConfig.Print_AlwaysViewPDFAfterCreate; // Changebars on/off if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.Without) - swtbtnChgBar.Value = false; + swtbtnChgBar.Value = false; else - swtbtnChgBar.Value = true; + swtbtnChgBar.Value = true; // Watermark on/off if (_DocVersionConfig.Print_Watermark == PrintWatermark.None) - swtbtnWaterMark.Value = false; + swtbtnWaterMark.Value = false; else - swtbtnWaterMark.Value = true; + swtbtnWaterMark.Value = true; // Auto Duplexing on/off - Auto duplex was used only by Point Beach formats These buttons were removed from the dialog // There was not print coding to support this format flag @@ -376,7 +373,7 @@ namespace VEPROMS // default to using OriginalPageBreaks (16bit page breaks) if App.config is set // to true: //cbxOrPgBrk.Visible = VlnSettings.OriginalPageBreak && VlnSettings.DebugMode; - cbxOrPgBrk.Visible = false; //per Harry + cbxOrPgBrk.Visible = false; //per Harry cbxOrPgBrk.Checked = false; } @@ -413,7 +410,7 @@ namespace VEPROMS private Timer _MyTimer; public void SetupForProcedure() // RHM20150506 Multiline ItemID TextBox { - if (_DocVersionInfo == null) this.Text = "Create PDF for " + ProcNum; + if(_DocVersionInfo == null)this.Text = "Create PDF for " + ProcNum; // get list of previous pdf files // if no previous pdf file, then get path from frmVersionProperties // dlgSelectFile.InitialDirectory = pdf path from frmVersionProperties @@ -422,20 +419,20 @@ namespace VEPROMS //txbPDFLocation.Text = _PDFPath; BuildPDFFileName(); ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig; - if (SelectedSlave > 0) pc.SelectedSlave = SelectedSlave; + if(SelectedSlave > 0) pc.SelectedSlave = SelectedSlave; if (pc != null) { //C2021-062 use the save rev number for all procedures if set, or just use the rev number in the current procedure config RevNum = (_NewRevForAllProcs == null) ? pc.Print_Rev : _NewRevForAllProcs; RevDate = pc.Print_RevDate; //== null || pc.Print_RevDate=="" ? DateTime.Today : Convert.ToDateTime(pc.Print_RevDate); ReviewDate = pc.Print_ReviewDate; // == null ? DateTime.Today : Convert.ToDateTime(pc.Print_ReviewDate); - //Now check the format flags to determine if/how the Rev string should be parsed. + //Now check the format flags to determine if/how the Rev string should be parsed. // This will covert the old way (16-bit) of setting a RevDate (appending it to the RevNumber) // to the new way saving the RevNumber and RevDate in there own config fields if ((_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && RevNum.Contains("/")) - || (_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && RevNum.Contains("\\"))) + || (_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && RevNum.Contains("\\"))) { - int indx = RevNum.IndexOf(_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/'); + int indx = RevNum.IndexOf(_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/'); pc.Print_RevDate = RevDate = RevNum.Substring(indx + 1); pc.Print_Rev = RevNum = RevNum.Substring(0, indx); // save the RevNumber and RevDate to the procedure's config. @@ -533,8 +530,8 @@ namespace VEPROMS if (dtPre != PDFDTPrefix.None) PDFFilePrefix = ""; // incase user entered prefix text but then selected a date/time (in working draft properties) if (dtSuf != PDFDTSuffix.None) PDFFileSuffix = ""; // incase user entered suffix text but then selected a date/time (in working draft properties) // B2020-062 control the toggle of date/time prefix/suffix on pdf file name - // disable the date/time Prefix/Suffix switch if no date/time was selected - // This switch is does not affect the use of it if the user typed in text for prefix/suffix + // disable the date/time Prefix/Suffix switch if no date/time was selected + // This switch is does not affect the use of it if the user typed in text for prefix/suffix if (!AllowDateTimePrefixSuffix || (dtPre == PDFDTPrefix.None && dtSuf == PDFDTSuffix.None)) { swtbtnPDFdtPrefixSuffix.Value = false; @@ -610,7 +607,7 @@ namespace VEPROMS private void swtbtnWaterMark_ValueChanged(object sender, EventArgs e) { - if (!swtbtnWaterMark.Value) // C2021-019: make both invisible + if (!swtbtnWaterMark.Value) // C2021-019: make both invisible { cbxWaterMark.Visible = swtbtnWaterMark.Value; lblWaterMarkOvrd.Visible = swtbtnWaterMark.Value; @@ -637,7 +634,7 @@ namespace VEPROMS if (!Directory.Exists(PDFPath)) { string msg = string.Format("'{0}' does not exist. \n\nCreate it?", PDFPath); - DialogResult dr = MessageBox.Show(msg, "Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + DialogResult dr= MessageBox.Show(msg, "Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { try @@ -671,7 +668,7 @@ namespace VEPROMS public ProcedureInfo MyProcedure { get { return _MyProcedure; } - set + set { _MyProcedure = value; // if procedure has supplemental information, the automatially check the add blank pages for duplex printing @@ -733,11 +730,11 @@ namespace VEPROMS int i = 0; pbPDFsStatus.Maximum = n; pbPDFsStatus.Visible = true; - VlnSvgPageHelper.CountInApplProcs = 1; // B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0) + VlnSvgPageHelper.CountInApplProcs = 1; // B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0) this.Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name); foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures) { - string locpdfname = null; // get pdf file name for later merge code + string locpdfname = null; // get pdf file name for later merge code MyProcedure = myProc; // C2021-019: Override Watermark Text, 'waterMarkText' will have whatever watermark text should be printed ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig; @@ -774,7 +771,7 @@ namespace VEPROMS string myPDFPath = GetMultiunitPDFPath(); _MergedPdfPath = myPDFPath; // If Slave, need its subdirectory/unit path for merging - // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. + // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // 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), @@ -874,7 +871,7 @@ namespace VEPROMS } } pbPDFsStatus.Visible = false; - if (!Automatic) + if(!Automatic) ShowDebugFiles(); ProfileTimer.Pop(profileDepth); ProfileTimer.ShowTimerTable(); @@ -946,7 +943,7 @@ namespace VEPROMS if (cbxDebugText.Checked) Volian.Base.Library.DebugText.Show(); if (cbxMetaFile.Checked)// C2018-004 create meta file for baseline compares - Volian.Base.Library.BaselineMetaFile.Show(); // baseline + Volian.Base.Library.BaselineMetaFile.Show(); // baseline } public void CreatePDF() // RHM20150506 Multiline ItemID TextBox { @@ -962,8 +959,8 @@ namespace VEPROMS } MyProcedure.SelectedChildToPrint = SelectedSlave; // B2023-035 for BNPP Alarms save the number of the child selected to print // B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0) - // Only do if set has applicability, printing an individual procedure, need to determine - // applicability count. + // Only do if set has applicability, printing an individual procedure, need to determine + // applicability count. if (MyProcedure.MyDocVersion.MultiUnitCount > 1) { VlnSvgPageHelper.CountInApplProcs = 1; @@ -980,12 +977,12 @@ namespace VEPROMS Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked; // B2019-044 don't print the watermark if the watermark switch on the print dialog is turned off cbxWaterMark.Visible = true; - string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None"; // B2018-124 use text of watermark form drop down list instead of enum value + string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None" ; // B2018-124 use text of watermark form drop down list instead of enum value string watermarkColor = "Blue"; // this is the default watermark color frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator Watermark ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig; string waterMarkTextOverride = ""; - if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text + if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text if (swtbtnWaterMark.Value && waterMarkTextOverride != null && waterMarkTextOverride != "") waterMarkText = waterMarkTextOverride; // Determine change bar settings. First get from config & then see if override from dialog. // Also check that format allows override. @@ -1202,7 +1199,7 @@ namespace VEPROMS grpDateSelector.Text = "Select Revision Date"; grpDateSelector.Visible = calDateSelector.Visible = true; //C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date - DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today; + DateTime initSelDate =(txbDate.Text != null && txbDate.Text.Length != 0)? Convert.ToDateTime(txbDate.Text) : DateTime.Today; calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate; } @@ -1301,11 +1298,11 @@ namespace VEPROMS } private void expPrnSetting_ExpandedChanging(object sender, DevComponents.DotNetBar.ExpandedChangeEventArgs e) - { - if (expPrnSetting.Expanded) + { + if (expPrnSetting.Expanded) //this.Size = new Size(this.Size.Width+(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height); - //else - this.Size = new Size(this.Size.Width - (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), this.Size.Height); + //else + this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height); //Refresh(); } @@ -1337,12 +1334,12 @@ namespace VEPROMS { DateTime dtStart = DateTime.Now; _MergedPfd = new MergedPdf(PDFPath, _DocVersionInfo); - PromsPrinter.MergedLandscapePages = null; // B2019-152: MergedLandscapePages has data set when creating separate pdfs (DoCreatePDF) - DoCreatePDF(); // create indivitual pdfs + PromsPrinter.MergedLandscapePages = null; // B2019-152: MergedLandscapePages has data set when creating separate pdfs (DoCreatePDF) + DoCreatePDF(); // create indivitual pdfs if (_MergedPdfPath != null && _MergedPdfPath != PDFPath) PDFPath = _MergedPfd.Folder = _MergedPdfPath; // C2021-063 pass in whether to generate Alarm Point List text when a merge is done - if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages, cbxAlmPtTxt.Checked)) return; // merge them together. - // if the property to show the file after printing is set (on the version dialog), display it. Otherwise do a dialog to let user know it's done + if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages,cbxAlmPtTxt.Checked)) return; // merge them together. + // if the property to show the file after printing is set (on the version dialog), display it. Otherwise do a dialog to let user know it's done if (_DocVersionConfig.Print_MergedPdfsViewAfter) { if (_MergedPfd.MergedPdfs != null && _MergedPfd.MergedPdfs.Count > 0) diff --git a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs index c6d15f41..91c20e91 100644 --- a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs +++ b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs @@ -91,15 +91,13 @@ namespace VEPROMS get { return _DidAll; } set { _DidAll = value; } } - // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. - // C2024-003 values needed to print section. - private int[] _prtSectID = new int[] { -1, -1, 0 }; - public int[] PrtSectID + 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 = null) + public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1) { // B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic ProcedureInfo MyProcedure = myItem as ProcedureInfo; @@ -109,7 +107,7 @@ namespace VEPROMS if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier) { // B2023-035 Pass in the select child (selectedSlave) which may be different than docversionconfig's SelectedSlave - MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave, allOrAuto, MyProcedure.SelectedChildToPrint); + MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave, allOrAuto, MyProcedure.SelectedChildToPrint); } else MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID, allOrAuto); @@ -131,11 +129,11 @@ namespace VEPROMS // if the version number of PROMS is 1.0, then we are running a Demo version. // When running a Demo version, force a "Sample" watermark when printing. // B2020-022 append a ".pdf" extension if the file name does on have one. - MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF")) ? pdfFile : pdfFile + ".pdf", insertBlankPages, allOrAuto, Prefix, saveLinks, removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor); - + MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF"))?pdfFile:pdfFile+".pdf", insertBlankPages, allOrAuto,Prefix,saveLinks,removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor); + MyPromsPrinter.PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : ""; //C2018-009 print PROMS version - - + + PDFPath = pdfPath; this.Text = "Creating PDF of " + myItem.DisplayNumber; _NewLocation = newLocation; @@ -298,8 +296,8 @@ namespace VEPROMS } while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes); - - + + if (_PdfFile == null) { this.Close(); @@ -320,7 +318,7 @@ namespace VEPROMS DateTime tEnd = DateTime.Now; MyStatus = _PdfFile + " created."; MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds)); - + if (OpenPDF) { OpenPDFandPlacekeeper(_PdfFile); @@ -334,8 +332,8 @@ namespace VEPROMS if (UserInfo.CanEdit(frmVEPROMS.SMyUserInfo, MyPromsPrinter.MyItem.MyDocVersion)) { // C2023-018: Clarify message on temporary/permanent removal of returns/spaces & page breaks - if (FlexibleMessageBox.Show(this, "The procedure PDF file was created by temporarily removing certain hard returns,\r\ntrailing spaces, and/or manual page breaks that could affect the pagination\r\n" + - "of the procedure.\r\n\r\nAfter reviewing the PDF file, do you want to permanently remove the deleted hard returns, \r\nspaces and/or manual page breaks?\r\n\r\n" + + if (FlexibleMessageBox.Show(this, "The procedure PDF file was created by temporarily removing certain hard returns,\r\ntrailing spaces, and/or manual page breaks that could affect the pagination\r\n"+ + "of the procedure.\r\n\r\nAfter reviewing the PDF file, do you want to permanently remove the deleted hard returns, \r\nspaces and/or manual page breaks?\r\n\r\n"+ "An annotation will be added to every location where data has been deleted. The locations \r\ncan be found by performing a Global Search for the \"Manual Pagination Issues\" annotation type.", "Confirm Pagination Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { @@ -347,7 +345,7 @@ namespace VEPROMS } btnOpenFolder.Visible = btnOpenPDF.Visible = true; - + if (CloseWhenDone) { OpenPDFandPlacekeeper(null); @@ -424,7 +422,7 @@ namespace VEPROMS } catch (Exception ex) { - string str = string.Format("{0} - {1} - {2}", pdffile, ex.GetType().Name, ex.Message); + string str = string.Format("{0} - {1} - {2}",pdffile,ex.GetType().Name,ex.Message); MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 06aa206b..bc046ef3 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -116,7 +116,7 @@ namespace VEPROMS //added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave; - + DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); //added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit @@ -356,12 +356,12 @@ namespace VEPROMS cmbFont.SelectedIndex = -1; string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); string db = Volian.Base.Library.VlnSettings.GetDB(); - + if (db != null) Database.SelectedDatabase = db; //B2018-129 Most Recently Used list was being cleared. Needed to remove a (string) type case in the IF statement - if (!string.IsNullOrEmpty((string)Properties.Settings.Default["DefaultDB"])) + if (!string.IsNullOrEmpty((string)Properties.Settings.Default["DefaultDB"])) Database.LastDatabase = Properties.Settings.Default.DefaultDB; // Setup the Context menu for DisplaySearch including the symbols @@ -400,7 +400,7 @@ namespace VEPROMS // B2019-107 Error Log message for inconsistent PromsFixes _MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>{5}" , Application.ProductVersion, Database.RevDate, Environment.UserDomainName, Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt"), FormatInfo.Failed ?? ""); - + // C2022-030 Notify the user if the stored procedure in the database are not update to date // with those in the PROMSFixes.sql delivered with the PROMS executable string pfVersion = ExeInfo.GetAssocicatedPROMSFixesVersion(); @@ -418,8 +418,8 @@ namespace VEPROMS sbMsg.Append("\n\nPlease have your DBA update the database with the PROMSFixes.sql script file that was\ndelivered with this PROMS executable."); sbMsg.Append("\n\nThe PROMSFixes.sql file is included with the PROMS installation download."); sbMsg.Append("\n\nIt can also be found in your PROMS executable folder:"); - sbMsg.AppendFormat("\n\t{0}", ExeInfo.PROMSExecutableFolderPath()); - FlexibleMessageBox.Show(sbMsg.ToString(), "SQL Stored Procedures Version Difference"); + sbMsg.AppendFormat("\n\t{0}",ExeInfo.PROMSExecutableFolderPath()); + FlexibleMessageBox.Show(sbMsg.ToString(),"SQL Stored Procedures Version Difference"); } foreach (string parameter in parameters) @@ -527,7 +527,7 @@ namespace VEPROMS tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF); displayApplicability.ApplicabilityViewModeChanged += new DisplayApplicability.DisplayApplicabilityEvent(displayApplicability_ApplicabilityViewModeChanged); - + tv.ExportImportProcedureSets += new vlnTreeViewEvent(tv_ExportImportProcedureSets); tv.PrintTransitionReport += new vlnTreeViewEvent(tv_PrintTransitionReport); tv.ProcessingComplete += tv_ProcessingComplete; @@ -690,7 +690,7 @@ namespace VEPROMS else { int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, CheckOutType.Session); - + dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this, (E_UCFImportOptions)Properties.Settings.Default.UCFImportOpt);//Added frmVEPROMS Parameter dlg.ShowDialog(this); @@ -1139,7 +1139,7 @@ namespace VEPROMS dvi.DocVersionConfig.SelectedSlave = 0; } - + void tv_PrintProcedure(object sender, vlnTreeEventArgs args) { ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; @@ -1178,8 +1178,8 @@ namespace VEPROMS pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; } } - catch (Exception ex) - { + catch(Exception ex) + { StringBuilder sb = new StringBuilder(); sb.AppendLine("Could not create PDF Print"); @@ -1197,21 +1197,7 @@ namespace VEPROMS { //args.Node.Parent. SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo; - int[] _prtSectID = new int[3]; // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. - if (si2.IsSubsection == true) - { - // If section is a subsection. Assigned values are section and subsection. - _prtSectID[0] = si2.MyParent.ItemID; // section - _prtSectID[1] = si2.ItemID; // sub section - _prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag - } - else - { - // If section is a regular section. assign values is section is not a subsection. - _prtSectID[0] = si2.ItemID; // section - _prtSectID[1] = -1; // sub section - _prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag - } + int _prtSectID = si2.ItemID; if (si2 == null) return; @@ -1221,7 +1207,7 @@ namespace VEPROMS using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(si2.MyProcedure)) { - prnDlg.PrtSectID = _prtSectID; // Assign Section print values to parameter used in print secetions / sub sections. + prnDlg.PrtSectID = _prtSectID; prnDlg.SelectedSlave = args.UnitIndex; prnDlg.MySessionInfo = MySessionInfo; prnDlg.SetupForProcedure(); // Setup filename @@ -1655,11 +1641,11 @@ namespace VEPROMS if (!_WeAreExitingPROMS && !ClosingWithError && tc.SelectedDisplayTabItem != null && tc._MyDisplayTabItems.Count > 0) { // B2019-071 dialog to ask user if we are to close one tab or exit - DlgCloseTabsOrExit dctoe = new DlgCloseTabsOrExit(MyParent == null, PROMSWindowForms.Count > 0); + DlgCloseTabsOrExit dctoe = new DlgCloseTabsOrExit(MyParent == null, PROMSWindowForms.Count > 0); dctoe.ShowDialog(); // B2019-101 flag that we are exiting from PROMS main window (separate windows) - _WeAreExitingPROMS = (MyParent == null && dctoe.ExitPROMS); + _WeAreExitingPROMS = (MyParent == null && dctoe.ExitPROMS); if (dctoe.Cancel) // B2019-071 user decided to not close any tab and not exit PROMS - so do nothing and continue working { @@ -1681,7 +1667,7 @@ namespace VEPROMS tc.CloseTabItem(tc.SelectedDisplayTabItem); // B2019-071 close just the current tab and continue working - if (!dctoe.ExitPROMS) + if (!dctoe.ExitPROMS) { n = 0; e.Cancel = true; @@ -1714,7 +1700,7 @@ namespace VEPROMS } // This keeps PROMS from Hanging under certain circumstances - tc.ShuttingDown = true; + tc.ShuttingDown = true; // B2019-161 When shutting down output the timing information (to the error log) if (VolianTimer.TimingsOn) @@ -1896,12 +1882,12 @@ namespace VEPROMS private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsExport; private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsImport; private TabItemsToClose _MyCloseTabList = new TabItemsToClose(); - + public TabItemsToClose MyCloseTabList { get { return _MyCloseTabList; } } - + private bool _DisablePing = false; public bool DisablePing { @@ -2011,7 +1997,7 @@ namespace VEPROMS if (ContentInfo.IsInCache(id)) { ContentInfo ci = ContentInfo.Get(id); - + if (MySessionInfo.LastContentChange >= ci.LastChangedInt64) { using (Content c = Content.Get(id)) @@ -2035,7 +2021,7 @@ namespace VEPROMS } } catch { } - + //MySemaphore.Release(); //_MyLog.DebugFormat("{0},{1:X},{2:X},{3:X}", DateTime.Now.ToLongTimeString(), lastChanged, MySessionInfo.LastContentChange, MySessionInfo.LastChangedInt64); } @@ -2106,7 +2092,7 @@ namespace VEPROMS btnResetSecurity = new ButtonItem("btnResetSecurity", "Reset Security"); btnSecurity.SubItems.Add(btnResetSecurity); btnResetSecurity.Click += new EventHandler(btnResetSecurity_Click); - + //batch refresh transitions btnAdministrativeTools = new ButtonItem("btnAdministrativeTools", "Administrative Tools"); btnAdministrativeTools.Click += new EventHandler(btnAdministrativeTools_Click); @@ -2120,7 +2106,7 @@ namespace VEPROMS this.superTooltip1.SetSuperTooltip(btnResetSecurity, new SuperTooltipInfo("Reset Security", null, null, null, null, eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(btnAdministrativeTools, new SuperTooltipInfo("Administrative Tools", null, null, null, null, eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(btnUpdateFormats, new SuperTooltipInfo("Update Formats", null, null, null, null, eTooltipColor.Gray)); - + try { MyUserInfo = UserInfo.GetByUserID(VlnSettings.UserID); @@ -2167,7 +2153,7 @@ namespace VEPROMS btnFormats.Visible = isVisible; btnSecurity.Visible = isVisible; btnAdmin.Enabled = (isVisible || HasSetAdministrator(MyUserInfo)); - + tmrCloseTabItems = new Timer(); tmrCloseTabItems.Interval = 100; tmrCloseTabItems.Tick += new EventHandler(tmrCloseTabItems_Tick); @@ -2175,7 +2161,7 @@ namespace VEPROMS CloseSessionsNoLongerActive(); MySessionInfo = SessionInfo.BeginSession(Environment.MachineName, System.Diagnostics.Process.GetCurrentProcess().Id); - + if (MySessionInfo == null) { MessageBox.Show("This database is locked by the Administrator. Please try again later", "PROMS is Locked"); @@ -2219,7 +2205,7 @@ namespace VEPROMS if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size; //if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState; //if (Settings.Default.SaveTreeviewExpanded) epProcedures.Expanded = Settings.Default.TreeviewExpanded; - + // if the Procedures panel was left open from the last session, then open it epProcedures.Expanded = Settings.Default.TreeviewExpanded; if (Settings.Default["QATItems"] != null) ribbonControl1.QatLayout = Settings.Default.QATItems; @@ -2391,7 +2377,7 @@ namespace VEPROMS TurnChangeManagerOn.Execute(); } } - + // C2015-022 Separate Windows. This is a dictionary of child PROMS windows forms (frmVEPROMS) // Dictionary _PROMSWindowForms = null; @@ -2439,7 +2425,7 @@ namespace VEPROMS while (!(_tn.VEObject is FolderInfo)) { // back up to the first folder tree node - _tn = (VETreeNode)_tn.Parent; + _tn = (VETreeNode)_tn.Parent; } _tn.Nodes.Clear(); // remove the child nodes from main window - child window now has this part of the procedure tree @@ -2536,7 +2522,7 @@ namespace VEPROMS } DialogResult dr = System.Windows.Forms.DialogResult.Yes; - + // RHM20150507 Table Scrunch Rtf2Pdf.AllowTableScrunching = cbScrunch.Checked ? _DefaultScrunchingRules : TableScrunching.None; @@ -2768,7 +2754,7 @@ namespace VEPROMS tmrCloseTabItems.Enabled = false; _TimeActivity1.Open(); - + while (MyCloseTabList.CountDTI > 0) { DisplayTabItem dti = MyCloseTabList.PopDTI(); @@ -3880,7 +3866,7 @@ namespace VEPROMS { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabRO; - + displayRO.ProgressBar = bottomProgBar; displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : @@ -4039,7 +4025,7 @@ namespace VEPROMS // need this to update RO Tree after UpdateRofst (B2015-226) // B2022-026 RO Memory reduction coding (Jakes Merge) - displayRO.MyROFST = SelectedROFst; + displayRO.MyROFST = SelectedROFst; displayRO.LoadTree(); // resetting the MyROFSTLookup for the search & reports panels will refresh the RO trees after UpdateRofst in each of those panels (B2015-226) @@ -4082,7 +4068,7 @@ namespace VEPROMS SetCaption(tv.SelectedNode as VETreeNode); displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem; - + if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) { displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; @@ -4297,7 +4283,7 @@ namespace VEPROMS // B2022-026 RO Memory reduction coding (Jakes Merge) displayRO.ProgressBar = bottomProgBar; displayRO.MyRTB = args.MyEditItem.MyStepRTB; - displayRO.LoadTree(); + displayRO.LoadTree(); displayBookMarks.MyEditItem = args.MyEditItem; displayHistory.MyEditItem = args.MyEditItem; @@ -4316,7 +4302,7 @@ namespace VEPROMS displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text; - + if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0) displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0]; @@ -4434,7 +4420,7 @@ namespace VEPROMS displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text; - + displayRO.ProgressBar = bottomProgBar; displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo; @@ -4460,7 +4446,7 @@ namespace VEPROMS if (!tv.Focused && tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null) tv.AdjustTree(tc.SelectedDisplayTabItem.SelectedItemInfo); - VETreeNode vtn = tv.SelectedNode as VETreeNode; + VETreeNode vtn = tv.SelectedNode as VETreeNode; if (vtn == null) return; StepInfo stpinf = vtn.VEObject as StepInfo; if (stpinf == null || !stpinf.IsRNOPart) //B2017-037 is this a RNO step type element - don't allow insert before/after @@ -4898,7 +4884,7 @@ namespace VEPROMS private void btnUpdateFormat_Click(object sender, EventArgs e) { - UpdateFormats(null); + UpdateFormats(null); } private void UpdateFormats(string mypath) @@ -4969,7 +4955,7 @@ namespace VEPROMS try { frmSendErrorLog frm = new frmSendErrorLog(Properties.Settings.Default.OutlookEmail, Properties.Settings.Default["SMTPServer"].ToString(), Properties.Settings.Default["SMTPUser"].ToString(), ErrorLogFileName); - + if (frm.ShowDialog(this) == DialogResult.OK) { Properties.Settings.Default.OutlookEmail = frm.OutlookEmail; diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index c925ea00..46282f4d 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -22,8 +22,8 @@ namespace Volian.Controls.Library public delegate void vlnTreeViewEvent(object sender, vlnTreeEventArgs args); public delegate void vlnTreeViewTimeEvent(object sender, vlnTreeTimeEventArgs args); public delegate void vlnTreeViewStatusEvent(object sender, vlnTreeStatusEventArgs args); - public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args); - public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args); + public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args); + public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args); public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args); public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args); public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args); @@ -55,7 +55,7 @@ namespace Volian.Controls.Library { _MySectionInfo = mySectionInfo; } - public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo, bool isDeleting) + public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo,bool isDeleting) { _MySectionInfo = mySectionInfo; _IsDeleting = isDeleting; @@ -138,7 +138,7 @@ namespace Volian.Controls.Library get { return _Node; } set { _Node = value; } } - private TreeNode _Destination = null; + private TreeNode _Destination=null; public TreeNode Destination { get { return _Destination; } @@ -166,7 +166,7 @@ namespace Volian.Controls.Library //end jcb multiunit #endregion #region Factory Methods - private vlnTreeEventArgs() {; } + private vlnTreeEventArgs() { ;} public vlnTreeEventArgs(TreeNode node) { _Node = node; @@ -190,7 +190,7 @@ namespace Volian.Controls.Library #endregion public override string ToString() { - return string.Format("Node={0},Destination={1},Index={2},Unit={3},UnitIndex={4}", NodePath(this.Node), this.Destination, this.Index, this.Unit, this.UnitIndex); + return string.Format("Node={0},Destination={1},Index={2},Unit={3},UnitIndex={4}",NodePath(this.Node),this.Destination, this.Index,this.Unit, this.UnitIndex); } private string NodePath(TreeNode node) @@ -213,14 +213,14 @@ namespace Volian.Controls.Library } #endregion #region Factory Methods - private vlnTreeItemInfoEventArgs() {; } + private vlnTreeItemInfoEventArgs() { ;} public vlnTreeItemInfoEventArgs(ItemInfo myItemInfo) { _MyItemInfo = myItemInfo; } #endregion } - public enum E_InsertType { Before, After, Child }; + public enum E_InsertType {Before, After, Child}; public partial class vlnTreeItemInfoInsertEventArgs { #region Business Methods @@ -256,7 +256,7 @@ namespace Volian.Controls.Library } #endregion #region Factory Methods - private vlnTreeItemInfoInsertEventArgs() {; } + private vlnTreeItemInfoInsertEventArgs() { ;} public vlnTreeItemInfoInsertEventArgs(ItemInfo myItemInfo, E_InsertType insertType, string stepText) { _MyItemInfo = myItemInfo; @@ -303,7 +303,7 @@ namespace Volian.Controls.Library } #endregion #region Factory Methods - private vlnTreeItemInfoPasteEventArgs() {; } + private vlnTreeItemInfoPasteEventArgs() { ;} public vlnTreeItemInfoPasteEventArgs(ItemInfo myItemInfo, int copyStartId, ItemInfo.EAddpingPart pasteType, int? type) { _MyItemInfo = myItemInfo; @@ -311,7 +311,7 @@ namespace Volian.Controls.Library _PasteType = pasteType; _Type = type; } - + #endregion } #endregion @@ -353,7 +353,7 @@ namespace Volian.Controls.Library get { return _SectionConfig; } set { _ConfigObject = _SectionConfig = value; } } - private vlnTreePropertyEventArgs() {; } + private vlnTreePropertyEventArgs() { ;} public vlnTreePropertyEventArgs(string title, FolderConfig folderConfig) { _Title = title; @@ -551,11 +551,11 @@ namespace Volian.Controls.Library { if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args); } - public event vlnTreeViewEvent ExportImportProcedureSets; - private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args) - { - if (ExportImportProcedureSets != null) ExportImportProcedureSets(sender, args); - } + public event vlnTreeViewEvent ExportImportProcedureSets; + private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args) + { + if (ExportImportProcedureSets != null) ExportImportProcedureSets(sender, args); + } public event vlnTreeViewEvent PrintTransitionReport; private void OnPrintTransitionReport(object sender, vlnTreeEventArgs args) { @@ -607,7 +607,7 @@ namespace Volian.Controls.Library // This event was added to update the Step Properties/RO & Tools/Search RO & Reports // when an update of ro.fst is done & the ro trees on those panels needs refreshed. // (bug fix B2015-226) - public event StepPanelTabDisplayEvent TabDisplay; + public event StepPanelTabDisplayEvent TabDisplay; private void OnTabDisplay(object sender, StepPanelTabDisplayEventArgs args) { if (TabDisplay != null) TabDisplay(sender, args); @@ -693,39 +693,39 @@ namespace Volian.Controls.Library //_MyLog.WarnFormat("Context Menu 1b - {0}", GC.GetTotalMemory(true)); if (ui.IsAdministrator() || ui.IsSetAdministrator(fi)) { - if (fi.MyParent != null) // don't allow insert before/after if at top node + if (fi.MyParent != null) // don't allow insert before/after if at top node { if (!ui.IsAdministrator() && DoSpecificInfo) cm.MenuItems.Add("Procedure Set Specific Information", new EventHandler(mi_Click)); // B2020-111 only allow Set Administrator to add new folders inside folders they admininstrate - if (ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent)) + if (ui.IsAdministrator()||ui.IsSetAdministrator(fi.MyParent)) { cm.MenuItems.Add("Insert Folder Before", new EventHandler(mi_Click)); cm.MenuItems.Add("Insert Folder After", new EventHandler(mi_Click)); } } // B2020-111 only allow Set Administrator to add new folders inside folders they admininstrate - if ((ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent)) && fi.FolderDocVersionCount == 0) + if ((ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent)) && fi.FolderDocVersionCount == 0) cm.MenuItems.Add("New Folder", new EventHandler(mi_Click)); - if (fi.ChildFolderCount == 0 && !fi.HasWorkingDraft) + if (fi.ChildFolderCount == 0 && !fi.HasWorkingDraft) cm.MenuItems.Add("Create Working Draft", new EventHandler(mi_Click)); } - if (fi.HasWorkingDraft) + if (fi.HasWorkingDraft) cm.MenuItems.Add("Print Transition Report", new EventHandler(mi_Click)); } - else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs + else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs { isWrkDftNode = true; //_MyLog.WarnFormat("Context Menu 1c - {0}", GC.GetTotalMemory(true)); DocVersionInfo dvi = tn.VEObject as DocVersionInfo; if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi)) - { - cm.MenuItems.Add("Import Procedure", mi_Click); - } - if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsWriter(dvi)) + { + cm.MenuItems.Add("Import Procedure", mi_Click); + } + if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsWriter(dvi)) { OwnerInfoList.Reset(); oil = OwnerInfoList.GetByVersionID(dvi.VersionID); - if (dvi.ActiveFormat.PlantFormat.FormatData.SpecificInfo) + if (dvi.ActiveFormat.PlantFormat.FormatData.SpecificInfo) cm.MenuItems.Add("Procedure Set Specific Information", new EventHandler(mi_Click)); cm.MenuItems.Add("Refresh Checked Out Procedures", new EventHandler(mi_Click)); cm.MenuItems.Add("New Procedure", new EventHandler(mi_Click)); @@ -812,15 +812,15 @@ namespace Volian.Controls.Library urv.Enabled = !dvi.ROfstLastCompleted || dvi.NewerRoFst; } } - else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections + else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections { isProcNode = true; ProcedureInfo pri = tn.VEObject as ProcedureInfo; oi = OwnerInfo.GetByItemID(pri.ItemID, CheckOutType.Procedure); if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion)) - { - cm.MenuItems.Add("Export Procedure", mi_Click); - } + { + cm.MenuItems.Add("Export Procedure", mi_Click); + } if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion) || ui.IsWriter(pri.MyDocVersion)) { if (oi != null && oi.SessionID != MySessionInfo.SessionID) @@ -842,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) @@ -855,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; @@ -867,7 +871,7 @@ namespace Volian.Controls.Library } cm.MenuItems.Add(micas); cm.MenuItems.Add(mitcas); - cm.MenuItems.Add(mip); + cm.MenuItems.Add(mip); cm.MenuItems.Add(miqp); //cm.MenuItems.Add(mips); AddShowChangeBarsAfterMenuItem(cm.MenuItems, pri); @@ -880,9 +884,13 @@ 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)); + //_MyLog.WarnFormat("Context Menu 1 before - {0}", GC.GetTotalMemory(true)); AddApprovedRevisions(cm.MenuItems, pri); + //_MyLog.WarnFormat("Context Menu 1 after - {0}", GC.GetTotalMemory(true)); } } else @@ -984,6 +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) { @@ -1037,36 +1052,36 @@ namespace Volian.Controls.Library ok = true; else if (tn.VEObject is ItemInfo && (ui.IsAdministrator() || ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion))) ok = true; - if (ok) + if(ok) Menu_Paste(tn, cm); #endregion //_MyLog.WarnFormat("Context Menu 5 - {0}", GC.GetTotalMemory(true)); #region Menu_Delete if (ok) - { - // Add delete to the menu unless at the very 'top' node, on a grouping (partinfo) - // node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items. - PartInfo pi = tn.VEObject as PartInfo; - if (pi == null && tn.Parent != null) // it's not a part and it's not the top.... { - fi = tn.VEObject as FolderInfo; - if (fi == null || tn.Nodes.Count == 0) // it's not a folder or it has no children + // Add delete to the menu unless at the very 'top' node, on a grouping (partinfo) + // node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items. + PartInfo pi = tn.VEObject as PartInfo; + if (pi == null && tn.Parent != null) // it's not a part and it's not the top.... { - DocVersionInfo di = tn.VEObject as DocVersionInfo; - if (di == null || tn.Nodes.Count == 0) // it's not a docversion or it has no children + fi = tn.VEObject as FolderInfo; + if (fi == null || tn.Nodes.Count == 0) // it's not a folder or it has no children { - // if it's an enhanced step that was linked from a source, don't allow delete - bool canDoDel = true; - ItemInfo iienh = tn.VEObject as ItemInfo; - if (iienh != null && iienh.IsProcedure && iienh.IsEnhancedProcedure) canDoDel = false; - if (iienh != null && iienh.IsSection && iienh.IsEnhancedSection && !iienh.IsEnhancedSectionTitleOnly) canDoDel = false; - if (iienh != null && iienh.IsEnhancedStep) canDoDel = false; - if (canDoDel) cm.MenuItems.Add("Delete", new EventHandler(mi_Click)); + DocVersionInfo di = tn.VEObject as DocVersionInfo; + if (di == null || tn.Nodes.Count == 0) // it's not a docversion or it has no children + { + // if it's an enhanced step that was linked from a source, don't allow delete + bool canDoDel = true; + ItemInfo iienh = tn.VEObject as ItemInfo; + if (iienh != null && iienh.IsProcedure && iienh.IsEnhancedProcedure) canDoDel = false; + if (iienh != null && iienh.IsSection && iienh.IsEnhancedSection && !iienh.IsEnhancedSectionTitleOnly) canDoDel = false; + if (iienh != null && iienh.IsEnhancedStep) canDoDel = false; + if (canDoDel) cm.MenuItems.Add("Delete", new EventHandler(mi_Click)); + } } } } - } #endregion //_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true)); #region Menu_ExternalTransitions @@ -1102,13 +1117,13 @@ namespace Volian.Controls.Library } doclink = string.Format("Unlink Source and {0} Procedure", doclink); MenuItem mix = cm.MenuItems.Add(doclink, new EventHandler(miEnhanced_Click)); - mix.Tag = -1; // NOTE this is what flags what gets processed on menu click, i.e. -1 + mix.Tag = -1; // NOTE this is what flags what gets processed on menu click, i.e. -1 } // if this is a source procedure that has enhanced, for example Background and/or deviation, ask which should be unlinked including all else if (eds != null && eds.Count > 1) { MenuItem miu = new MenuItem("Unlink Enhanced Procedure(s) from Source"); - miu.Tag = -2; // this menu item doesn't get used. + miu.Tag = -2; // this menu item doesn't get used. int k = 0; foreach (EnhancedDocument ed in eds) { @@ -1119,7 +1134,7 @@ namespace Volian.Controls.Library } // add all submenu item MenuItem mp1 = miu.MenuItems.Add("All", new EventHandler(miEnhanced_Click)); - mp1.Tag = 0; // Tag of 0 flags All + mp1.Tag = 0; // Tag of 0 flags All cm.MenuItems.Add(miu); } } @@ -1129,9 +1144,9 @@ namespace Volian.Controls.Library // Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo) // node (RNOs, Steps, Cautions, Notes) or at the step level. // B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access. - if (tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo)); - else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo)) - : (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) + if ( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo)); + else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo)) + : (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion))); PartInfo pia = tn.VEObject as PartInfo; ItemInfo ii = tn.VEObject as ItemInfo; @@ -1212,7 +1227,7 @@ namespace Volian.Controls.Library itm.Text == "Procedure Set Specific Information" || itm.Text == "Approve All Procedures for" || itm.Text == "Approve Some Procedures" || itm.Text == "Approve Some Procedures for") itm.Enabled = false; - + } } } @@ -1241,9 +1256,9 @@ namespace Volian.Controls.Library // F2022-024 added Time Critical Action Summary option foreach (MenuItem itm in cm.MenuItems) { - if (itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" || + if(itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" || itm.Text == "Copy" || itm.Text == "Delete" || itm.Text == "Properties..." || itm.Text == "Replace Existing Procedure" || - itm.Text.StartsWith("Showing Change Bars Starting") || itm.Text == "Create Continuous Action Summary" || + itm.Text.StartsWith("Showing Change Bars Starting") || itm.Text == "Create Continuous Action Summary" || itm.Text == "Create Time Critical Action Summary" || itm.Text == "Export Procedure") itm.Enabled = false; } @@ -1252,7 +1267,7 @@ namespace Volian.Controls.Library { foreach (MenuItem itm in cm.MenuItems) { - if (!itm.Text.StartsWith("Document Checked Out")) + if(!itm.Text.StartsWith("Document Checked Out")) itm.Enabled = false; } } @@ -1269,7 +1284,7 @@ namespace Volian.Controls.Library { _currentPri = pri; RevisionInfoList ril = RevisionInfoList.GetByItemID(pri.ItemID); - if (ril.Count == 0) return; // no versions to list + if (ril.Count == 0) return; // no versions to list MenuItem mi = menuItemCollection.Add("Versions"); int k = 0; int lastApprovedRevisionID = 0; @@ -1316,11 +1331,11 @@ namespace Volian.Controls.Library ril = null; } } - public void AddNewNode(IVEDrillDownReadOnly o) - { - VETreeNode tn = new VETreeNode(o); - SelectedNode.Nodes.Add(tn); - } + public void AddNewNode(IVEDrillDownReadOnly o) + { + VETreeNode tn = new VETreeNode(o); + SelectedNode.Nodes.Add(tn); + } private void AddApprovedRevisions(Menu.MenuItemCollection menuItemCollection, ProcedureInfo pri) { try @@ -1329,7 +1344,7 @@ namespace Volian.Controls.Library _currentPri = pri; using (RevisionInfoList ril = RevisionInfoList.GetByItemID(pri.ItemID)) { - //_MyLog.WarnFormat("Context Menu 1 After GET - {0}", GC.GetTotalMemory(true)); + //_MyLog.WarnFormat("Context Menu 1 After GET - {0}", GC.GetTotalMemory(true)); if (ril.Count == 0) return; // no versions to list MenuItem mi = menuItemCollection.Add("Versions"); int lastApprovedRevisionID = 0; @@ -1410,7 +1425,7 @@ namespace Volian.Controls.Library RevisionConfig rc = ri.MyConfig as RevisionConfig; // bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures. int applIdx = rc.Applicability_Index; - string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to inlcude the export filename + string str = (applIdx > 0)?_currentPri.MyDocVersion.UnitNames[applIdx-1] +"_":""; // if parent/child get the defined child name to inlcude the export filename System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.LoadXml(ri.LatestVersion.ApprovedXML); string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database; @@ -1430,17 +1445,16 @@ namespace Volian.Controls.Library bool superceded = false; MenuItem mi = sender as MenuItem; if (mi == null) return; - //RevisionInfo ri = mi.Tag as RevisionInfo; - RevisionInfo ri = RevisionInfo.Get(int.Parse(mi.Tag.ToString())); + RevisionInfo ri = mi.Tag as RevisionInfo; { MenuItem mip = mi.Parent as MenuItem; //B2021-086 Added the check for the last revision stage is an Approved stage - if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved != 0) + if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved!=0) superceded = true; } vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber), ri.LatestVersion.PDF, superceded ? "Superceded" : ""); OnViewPDF(sender, args); - // System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded)); +// System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded)); } void MultiUnitApprovedRevision_Click(object sender, EventArgs e) { @@ -1553,7 +1567,7 @@ namespace Volian.Controls.Library // 'from' is object copied // 'to' is object where paste was selected from #region Menu_Paste_ToDocVersion - if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc + if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc { if (iiClipboard.IsProcedure) { @@ -1563,7 +1577,7 @@ namespace Volian.Controls.Library // 3) 'to' docversion is 'source' and 'from' procedure is within this docversion // 4) 'to' docVersion is 'enhanced' and 'from' procedure is not bool canPaste = false; - + DocVersionInfo dvi = tn.VEObject as DocVersionInfo; DocVersionConfig dvc = dvi.DocVersionConfig; bool docVersionIsEnhanced = dvc.MyEnhancedDocuments != null && dvc.MyEnhancedDocuments.Count > 0 && dvc.MyEnhancedDocuments[0].Type == 0; @@ -1578,7 +1592,7 @@ namespace Volian.Controls.Library if (iiClipboard.IsRtfRaw) canPaste = false; // never paste an equation. if (canPaste) cm.MenuItems.Add("Paste Procedure", new EventHandler(mi_Click)); } - #endregion + #endregion } else { @@ -1589,7 +1603,7 @@ namespace Volian.Controls.Library { SectionInfo si = (tn.VEObject as SectionInfo != null) ? tn.VEObject as SectionInfo : null; #region Menu_Paste_ToFromProcedure - if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after + if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after { // Enhanced considerations, in order to paste a procedure around another procedure: NOTE that an 'enhanced' procedure cannot be in paste buffer! // 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced) @@ -1613,16 +1627,16 @@ namespace Volian.Controls.Library bool prFromIsEnhanced = iiClipboard.IsEnhancedProcedure; bool prFromIsSource = pcFromCfg.MyEnhancedDocuments != null && pcFromCfg.MyEnhancedDocuments.Count > 0 && pcFromCfg.MyEnhancedDocuments[0].Type != 0; bool prCanPaste = false; - if (!prToIsEnhanced && !prToIsSource && !prFromIsEnhanced && !prFromIsSource) prCanPaste = true; // 1) - // else if ((!prToIsEnhanced && !prToIsSource) && prFromIsSource) prCanPaste = false; // 2) commented out because already set to false - else if (prToIsSource && !prFromIsEnhanced && !prFromIsSource) // 3) + if (!prToIsEnhanced && !prToIsSource && !prFromIsEnhanced && !prFromIsSource) prCanPaste = true; // 1) + // else if ((!prToIsEnhanced && !prToIsSource) && prFromIsSource) prCanPaste = false; // 2) commented out because already set to false + else if (prToIsSource && !prFromIsEnhanced && !prFromIsSource) // 3) { prCanPaste = true; okToReplace = false; } - else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) prCanPaste = true; // 4) - //else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID != iiClipboard.MyDocVersion.VersionID) prCanPaste = false; // 5) commented out because already set to false - //else if (prToIsEnhanced && prFromIsSource) prCanPaste = false; // 6)commented out because already set to false + else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) prCanPaste = true; // 4) + //else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID != iiClipboard.MyDocVersion.VersionID) prCanPaste = false; // 5) commented out because already set to false + //else if (prToIsEnhanced && prFromIsSource) prCanPaste = false; // 6)commented out because already set to false if (iiClipboard.IsRtfRaw) prCanPaste = okToReplace = prCanPaste = false; // never paste an equation. if (prCanPaste) cm.MenuItems.Add("Paste Procedure Before", new EventHandler(mi_Click)); if (okToReplace && prCanPaste) cm.MenuItems.Add("Replace Existing Procedure", new EventHandler(mi_Click)); @@ -1632,9 +1646,9 @@ namespace Volian.Controls.Library if (!prCanPaste) { if (prToIsEnhanced) - cm.MenuItems.Add("CANNOT PASTE HERE, Click for more information...", new EventHandler(mi_Click)); + cm.MenuItems.Add("CANNOT PASTE HERE, Click for more information...", new EventHandler(mi_Click)); else - cm.MenuItems.Add("CANNOT PASTE HERE. Click for more information...", new EventHandler(mi_Click)); + cm.MenuItems.Add("CANNOT PASTE HERE. Click for more information...", new EventHandler(mi_Click)); } } #endregion @@ -1654,9 +1668,9 @@ namespace Volian.Controls.Library bool scFromIsEnhanced = iiClipboard.IsEnhancedSection; bool scFromIsSource = scFromCfg.MyEnhancedDocuments != null && scFromCfg.MyEnhancedDocuments.Count > 0 && scFromCfg.MyEnhancedDocuments[0].Type != 0; bool scCanPaste = false; - if (!prToIsEnhanced && !prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; // 1) + if (!prToIsEnhanced && !prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; // 1) else if (prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; - else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) scCanPaste = true; // 3) + else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) scCanPaste = true; // 3) if (iiClipboard.IsRtfRaw) scCanPaste = false; // never paste an equation. if (scCanPaste) cm.MenuItems.Add("Paste Section", new EventHandler(mi_Click)); } @@ -1680,13 +1694,13 @@ namespace Volian.Controls.Library bool secFromIsEnhanced = iiClipboard.IsEnhancedSection; bool secFromIsSource = secFromCfg.MyEnhancedDocuments != null && secFromCfg.MyEnhancedDocuments.Count > 0 && secFromCfg.MyEnhancedDocuments[0].Type != 0; bool secCanPaste = false; - if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1) - else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2) + if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1) + else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2) { secCanPaste = true; okToReplace = false; } - else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) secCanPaste = true; // 3) + else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) secCanPaste = true; // 3) if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation. if (secCanPaste) cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click)); if (okToReplace && secCanPaste) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click)); @@ -1716,9 +1730,9 @@ namespace Volian.Controls.Library bool stpFromIsEnhanced = iiClipboard.IsEnhancedStep; bool stpFromIsSource = stpFromCfg.MyEnhancedDocuments != null && stpFromCfg.MyEnhancedDocuments.Count > 0 && stpFromCfg.MyEnhancedDocuments[0].Type != 0; bool stpCanPaste = false; - if (!secToIsEnhanced && !secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) + if (!secToIsEnhanced && !secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) else if (secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 2) - else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) stpCanPaste = true; // 3) + else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) stpCanPaste = true; // 3) if (iiClipboard.IsRtfRaw) stpCanPaste = false; // never paste an equation. if (stpCanPaste) cm.MenuItems.Add("Paste Step", new EventHandler(mi_Click)); } @@ -1742,8 +1756,8 @@ namespace Volian.Controls.Library bool stpFromIsEnhanced = iiClipboard.IsEnhancedStep; bool stpFromIsSource = stpFromCfg.MyEnhancedDocuments != null && stpFromCfg.MyEnhancedDocuments.Count > 0 && stpFromCfg.MyEnhancedDocuments[0].Type != 0; bool stpCanPaste = false; - if (!stpToIsEnhanced && !stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) - else if (stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) // 2) + if (!stpToIsEnhanced && !stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1) + else if (stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) // 2) { stpCanPaste = true; okToReplace = false; @@ -1751,7 +1765,7 @@ namespace Volian.Controls.Library else if (stpToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) // 3 { stpCanPaste = true; - if (stpFromIsSource) okToReplace = false; // B2017-183: don't allow a replace to source steps + if (stpFromIsSource) okToReplace = false; // B2017-183: don't allow a replace to source steps } if (iiClipboard.IsRtfRaw) stpCanPaste = false; // never paste an equation. if (stpCanPaste && AddToInsertMenu(iiPasteHere, 0)) cm.MenuItems.Add("Paste Step Before", new EventHandler(mi_Click)); @@ -1781,7 +1795,7 @@ namespace Volian.Controls.Library 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)); + OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0,mi.Text,(int)mi.Tag)); break; case "Approve": OnApproveProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); @@ -1793,10 +1807,10 @@ namespace Volian.Controls.Library OnApproveSomeProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); break; case "Create Continuous Action Summary": - OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); + OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag)); break; case "Create Time Critical Action Summary": - OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); + OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag)); break; default: if (mip.Text.StartsWith("Showing Change Bars Starting")) @@ -1834,7 +1848,7 @@ namespace Volian.Controls.Library { if (selprc.IsEnhancedProcedure) { - selprc.DoUnlinkEnhanced(selprc, 0, !hasValidConnectingProc); // if no valid linked: enhtype = 0 since this an enhanced doc is getting unlinked + selprc.DoUnlinkEnhanced(selprc, 0, !hasValidConnectingProc); // if no valid linked: enhtype = 0 since this an enhanced doc is getting unlinked } else // from source { @@ -1842,7 +1856,7 @@ namespace Volian.Controls.Library if (hasValidConnectingProc) { ItemInfo lprc = ItemInfo.Get(seleds[0].ItemID); - lprc.DoUnlinkEnhanced(lprc, 0, !hasValidConnectingProc); + lprc.DoUnlinkEnhanced(lprc, 0, !hasValidConnectingProc); } else selprc.DoUnlinkEnhanced(selprc, seleds[0].Type, !hasValidConnectingProc); @@ -1862,7 +1876,7 @@ namespace Volian.Controls.Library { ItemInfo lprc = ItemInfo.Get(ed.ItemID); bool hasValidConnectingProc = CheckForValidEnhLink(lprc); - // if there is a valid connection, unlink both. Otherwise, just unlink this selected procedure. + // if there is a valid connection, unlink both. Otherwise, just unlink this selected procedure. if (hasValidConnectingProc) lprc.DoUnlinkEnhanced(lprc, ed.Type, !hasValidConnectingProc); else @@ -1886,27 +1900,27 @@ namespace Volian.Controls.Library OnNodeSI(this, new vlnTreeEventArgs(tn, null, 0)); return; } - if (mi.Text.StartsWith("Collapse")) - { + if (mi.Text.StartsWith("Collapse")) + { CollapseProcedures(); - return; - } + return; + } if (mi.Text == "Print Transition Report") { OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode)); return; } - if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure") - { - OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - return; - } - if (mi.Text == "Import Procedure Set" || mi.Text == "Import Procedure") - { - OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 1)); - return; - } - if (mi.Text.StartsWith("Procedure Checked Out to") || mi.Text.StartsWith("Document Checked Out to")) + if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure") + { + OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); + return; + } + if (mi.Text == "Import Procedure Set" || mi.Text == "Import Procedure") + { + OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 1)); + return; + } + if (mi.Text.StartsWith("Procedure Checked Out to") || mi.Text.StartsWith("Document Checked Out to")) { OnProcedureCheckedOutTo(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); return; @@ -1928,7 +1942,7 @@ namespace Volian.Controls.Library break; case "New Folder": SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Folder); + tv_NodeNew(MenuSelections.Folder); break; case "Create Working Draft": SelectedNode.Expand(); @@ -1972,7 +1986,7 @@ namespace Volian.Controls.Library tv_NodeCopy(); break; // lots of paste options: - case "Paste Procedure": + case "Paste Procedure": case "Paste Procedure Before": case "Replace Existing Procedure": case "Paste Procedure After": @@ -2052,14 +2066,14 @@ namespace Volian.Controls.Library UpdateROValues(SelectedNode as VETreeNode); break; case "Create Continuous Action Summary": - OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); + OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0)); break; - // F2022-024 Time Critical Action Summary + // F2022-024 Time Critical Action Summary case "Create Time Critical Action Summary": - OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); + OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0)); break; - // B2017-243 added the following two Cannot Paste items when dealing with enhanced documents - // when then user selects these menu items a message box will appear giving more information as to why it cannot be pasted + // B2017-243 added the following two Cannot Paste items when dealing with enhanced documents + // when then user selects these menu items a message box will appear giving more information as to why it cannot be pasted case "CANNOT PASTE HERE. Click for more information...": FlexibleMessageBox.Show("You have copied a document that is linked to an Enhanced Document.\n\n" + "It can only be pasted before or after another document, within the set, that is linked to an Enhanced Document.", "Cannot Paste Here"); @@ -2100,7 +2114,7 @@ namespace Volian.Controls.Library foreach (VETreeNode tnc in tn.Nodes) CollapseProcedures(tnc); if (tn.VEObject as DocVersionInfo == null && tn.VEObject as FolderInfo == null) - tn.Collapse(); + tn.Collapse(); _doingCollapseNode = true; // B2016-058 this will prevent a Drag Node error when collapsing an RNOs, Cautions, or Notes tree node } private void tv_RemoveChgIds() @@ -2155,12 +2169,12 @@ namespace Volian.Controls.Library FinalProgressBarMessage = "Cannot check-out Working Draft"; return; } - Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error + Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion); using (DocVersion dv = DocVersion.Get(MyDVI.VersionID)) { swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder - // B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo + // B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed { // only load the RO.fst @@ -2188,7 +2202,7 @@ namespace Volian.Controls.Library swROUpdate.Write(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID)); } - private ProgressBarItem _ProgressBar = null; + private ProgressBarItem _ProgressBar=null; public ProgressBarItem ProgressBar { get { return _ProgressBar; } @@ -2301,7 +2315,7 @@ namespace Volian.Controls.Library return; } // C2017-003: ro data in sql server, check for sql connection string - if (MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring") + if (MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring") roloc = roloc + " \"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString + "\""; // C2021-026 pass in Parent/Child information (list of the children) // B2022-019 look at all DocVersions to find ParentChild information @@ -2365,7 +2379,7 @@ namespace Volian.Controls.Library // assume that item to paste is a procedure, otherwise the menuing would not have // included the paste options - tn = (VETreeNode)tn.Nodes[tn.Nodes.Count - 1]; + tn = (VETreeNode) tn.Nodes[tn.Nodes.Count - 1]; p = "After"; } else // this is an empty docversion: @@ -2407,7 +2421,7 @@ namespace Volian.Controls.Library } ItemInfo newProc = dvi.PasteChild(copyStartID); VETreeNode tn1 = new VETreeNode(newProc); - SelectedNode.Nodes.Add(tn1); // add tree node to end of list. + SelectedNode.Nodes.Add(tn1); // add tree node to end of list. SelectedNode = tn1; } @@ -2444,7 +2458,7 @@ namespace Volian.Controls.Library } if (pasteSectIntoEmptySect) { - tn.ChildrenLoaded = false; // force a reload of treenode + tn.ChildrenLoaded = false; // force a reload of treenode tn.LoadChildren(true); } SelectedNode = tn; @@ -2459,7 +2473,7 @@ namespace Volian.Controls.Library // the item to be pasted in the step editor and the tree. ItemInfo newItemInfo = null; // F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format - if (!ii.IsProcedure) + if (!ii.IsProcedure) ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, false); if (ii.IsProcedure || !OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, pasteOpt, ii.MyContent.Type))) { @@ -2482,8 +2496,8 @@ namespace Volian.Controls.Library } private void PasteReplace(VETreeNode tn, int copyStartID) { - VETreeNode prevtn = (VETreeNode)tn.PrevNode; - VETreeNode partn = (VETreeNode)tn.Parent; + VETreeNode prevtn = (VETreeNode) tn.PrevNode; + VETreeNode partn = (VETreeNode) tn.Parent; ItemInfo ii = tn.VEObject as ItemInfo; // F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true); @@ -2504,16 +2518,16 @@ namespace Volian.Controls.Library } private void tv_NodeCopy() { - if (SelectedNode == null) return; + if (SelectedNode==null)return; VETreeNode tn = SelectedNode as VETreeNode; - OnNodeCopy(this, new vlnTreeEventArgs(tn)); + OnNodeCopy(this, new vlnTreeEventArgs(tn)); } #endregion #region PropertyPagesInterface private void SetupNodeProperties() { VETreeNode tn = SelectedNode as VETreeNode; - if (tn == null) return; + if (tn==null)return; if ((tn.VEObject as FolderInfo) != null) OpenProperties(tn.VEObject as FolderInfo); @@ -2525,7 +2539,7 @@ namespace Volian.Controls.Library if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0) rofstid = dvi.DocVersionAssociations[0].MyROFst.ROFstID; OpenProperties(tn.VEObject as DocVersionInfo); if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0 && rofstid != dvi.DocVersionAssociations[0].MyROFst.ROFstID) - OnTabDisplay(this, new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST")); + OnTabDisplay(this,new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST")); } else if ((tn.VEObject as ProcedureInfo) != null) OpenProperties(tn.VEObject as ProcedureInfo); @@ -2539,7 +2553,7 @@ namespace Volian.Controls.Library { using (Folder folder = folderInfo.Get()) { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig)); + OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig)); } } private void OpenProperties(DocVersionInfo dvInfo) @@ -2553,7 +2567,7 @@ namespace Volian.Controls.Library { using (Procedure proc = procInfo.Get()) { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig)); + OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig)); } } private void OpenProperties(SectionInfo sectInfo) @@ -2566,7 +2580,7 @@ namespace Volian.Controls.Library title = string.Format("{0} {1} Properties", sectInfo.SectionConfig.Number, sectInfo.SectionConfig.Title); else title = string.Format("{0} Properties", sectInfo.SectionConfig.Title); - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig)); + OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig)); } } private void OpenProperties(StepInfo stpinfo) @@ -2620,7 +2634,7 @@ namespace Volian.Controls.Library { if (newtype == MenuSelections.DocVersion) { - int dvid = -1; // flag to allow user to cancel from dialog & then we remove it. + int dvid = -1; // flag to allow user to cancel from dialog & then we remove it. using (DocVersion docversion = DocVersion.MakeDocVersion(parentfolder, "Working Draft", "Title", null, null, null)) { ShowBrokenRules(docversion.BrokenRulesCollection); @@ -2629,7 +2643,7 @@ namespace Volian.Controls.Library { docversion.Save(); tn = new VETreeNode(_LastDocVersionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. + SelectedNode.Nodes.Add(tn); // add tree node to end of list. parentfolder.Reset_ChildFolders(); parentfolder.Reset_FolderDocVersions(); } @@ -2640,7 +2654,7 @@ namespace Volian.Controls.Library } else if (newtype == MenuSelections.Folder) { - int f1 = -1; // flag to allow user to cancel from dialog & then we remove it. + int f1 = -1; // flag to allow user to cancel from dialog & then we remove it. string uniquename = _LastFolderInfo.UniqueChildName("New Folder"); using (Folder folder = Folder.MakeFolder(parentfolder, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, string.Empty, DateTime.Now, VlnSettings.UserID)) { @@ -2652,20 +2666,20 @@ namespace Volian.Controls.Library { folder.Save(); tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); - SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist. + SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist. } else f1 = folder.FolderID; } if (f1 != -1) Folder.Delete(f1); } - else if (newtype == MenuSelections.FolderAfter || newtype == MenuSelections.FolderBefore) + else if (newtype == MenuSelections.FolderAfter||newtype == MenuSelections.FolderBefore) { int f2 = -1; string uniquename = _LastFolderInfo.MyParent.UniqueChildName("New Folder"); int myindex = SelectedNode.Index + ((newtype == MenuSelections.FolderAfter) ? 1 : 0); FolderInfo parfolderinfo = FolderInfo.Get(parentfolder.FolderID); - double? myorder = parfolderinfo.NewManualOrder(myindex); + double? myorder = parfolderinfo.NewManualOrder(myindex); using (Folder folder = Folder.MakeFolder(parentfolder.MyParent, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, myorder, string.Empty, DateTime.Now, VlnSettings.UserID)) { ShowBrokenRules(folder.BrokenRulesCollection); @@ -2689,7 +2703,7 @@ namespace Volian.Controls.Library else if (newtype == MenuSelections.Procedure) { int p1 = -1; - using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count != 0 ? _LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count - 1] : null, null, "New Procedure", 0)) + using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count!=0?_LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count-1]:null, null, "New Procedure", 0)) { ShowBrokenRules(procedure.BrokenRulesCollection); SetLastValues(ProcedureInfo.Get(procedure.ItemID)); @@ -2698,8 +2712,8 @@ namespace Volian.Controls.Library { procedure.Save(); tn = new VETreeNode(_LastProcedureInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - // The following line will allow for a refresh of the procedure list on the Working Draft's treenodes docversion (B2016-034) + SelectedNode.Nodes.Add(tn); // add tree node to end of list. + // The following line will allow for a refresh of the procedure list on the Working Draft's treenodes docversion (B2016-034) if (((SelectedNode as VETreeNode).VEObject as DocVersionInfo) != null) ((SelectedNode as VETreeNode).VEObject as DocVersionInfo).ResetProcedures(); if (procedure.MyProcedureInfo.CreateEnhanced) { @@ -2741,21 +2755,21 @@ namespace Volian.Controls.Library else p2 = procedure.ItemID; } - if (p2 != -1) + if (p2 != -1) DeleteItemInfoAndChildren(_LastProcedureInfo); // Delete Item and reset Previous and Next } #endregion #region InsertSection - else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list + else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list { string message = string.Empty; if (_LastProcedureInfo != null) if (!MySessionInfo.CanCheckOutItem(_LastProcedureInfo.ItemID, CheckOutType.Procedure, ref message)) - { - FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - OnUnPauseRefresh(this, null); - return; - } + { + FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); + OnUnPauseRefresh(this, null); + return; + } int s1 = -1; if (!(_LastProcedureInfo == null) || !(_LastSectionInfo == null)) { @@ -2785,7 +2799,7 @@ namespace Volian.Controls.Library "If you would like to view or copy these hidden steps you will need to go\n" + "into the properties of this section and check the Editable Data checkbox.\n" + "You will then be able to view and copy those steps. When finished, open\n" + - "the properties page again and uncheck the Editable Data checkbox.\n\n" + + "the properties page again and uncheck the Editable Data checkbox.\n\n"+ "Do you want to continue creating the subsection?"; if (FlexibleMessageBox.Show(this, msgstr, "Subsection Insert", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { @@ -2797,7 +2811,7 @@ namespace Volian.Controls.Library if (!hasMetaSubs) doPseudo = true; } } - using (Section section = CreateNewSection()) + using(Section section = CreateNewSection()) { ShowBrokenRules(section.BrokenRulesCollection); SectionInfo savLastSectionInfo = _LastSectionInfo; @@ -2807,10 +2821,10 @@ namespace Volian.Controls.Library if (!doPseudo) { tn = new VETreeNode(_LastSectionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. + SelectedNode.Nodes.Add(tn); // add tree node to end of list. // if the new section was flagged as either having an enhanced link for Title or Contents, create the // Enhanced section: - Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. + Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. if (sectiontmp.SectionConfig.LinkEnhanced == "T" || sectiontmp.SectionConfig.LinkEnhanced == "Y") CreateEnhancedForSection(newtype, sectiontmp, savLastSectionInfo, sectiontmp.DisplayNumber, sectiontmp.MyContent.Text); sectiontmp.Dispose(); @@ -2821,7 +2835,7 @@ namespace Volian.Controls.Library // may have to add a 'steps' node if a step(s) already exist... ItemInfo ii = (SelectedNode as VETreeNode).VEObject as ItemInfo; int cpindx = 0; - if (SelectedNode.Nodes.Count > 0) + if (SelectedNode.Nodes.Count>0) { VETreeNode vtn = SelectedNode.Nodes[0] as VETreeNode; // B2017-014: removed code that was adding a 2nd section part node. and also select node to @@ -2831,7 +2845,7 @@ namespace Volian.Controls.Library // B2017-014: removed code that was adding a 2nd section part node. } } - else // Properties was canceled out of: + else // Properties was canceled out of: s1 = section.ItemID; } if (s1 != -1) @@ -2865,14 +2879,14 @@ namespace Volian.Controls.Library if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK) { int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1); - int itemido = (indx >= par.Nodes.Count) ? -1 : (((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID; - if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido != section.ItemID) + int itemido = (indx >= par.Nodes.Count)?-1:(((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID; + if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido !=section.ItemID) { tn = new VETreeNode(_LastSectionInfo); par.Nodes.Insert(indx, tn); // if the new section was flagged as either having an enhanced link for Title or Contents, create the // Enhanced section: - Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. + Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem. if (sectiontmp.SectionConfig.LinkEnhanced == "T" || sectiontmp.SectionConfig.LinkEnhanced == "Y") CreateEnhancedForSection(newtype, sectiontmp, savLastSectionInfo, sectiontmp.DisplayNumber, sectiontmp.MyContent.Text); sectiontmp.Dispose(); @@ -2892,7 +2906,7 @@ namespace Volian.Controls.Library } #endregion #region InsertStep - else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree. + else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree. { string message = string.Empty; if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) @@ -2969,7 +2983,7 @@ namespace Volian.Controls.Library using (Procedure newenhProcedure = Procedure.MakeProcedure(enhDVInfo, enhDVInfo.Procedures.Count != 0 ? enhDVInfo.Procedures[enhDVInfo.Procedures.Count - 1] : null, null, "New Procedure", 0)) { SaveEnhancedForProcedure(sourceProc, newenhProcedure, ded.Type); - RefreshRelatedNode(ProcedureInfo.Get(newenhProcedure.ItemID)); // this updates the treeview to include the new enhanced procedure + RefreshRelatedNode(ProcedureInfo.Get(newenhProcedure.ItemID)); // this updates the treeview to include the new enhanced procedure } } } @@ -3058,7 +3072,7 @@ namespace Volian.Controls.Library { SectionConfig newenhcfg = new SectionConfig(newenhSection); newenhcfg.AddEnhancedDocument(0, sourceSect.ItemID); - newenhcfg.SaveEnhancedDocuments(); // does this save data? + newenhcfg.SaveEnhancedDocuments(); // does this save data? using (Content c1 = Content.Get(newenhSection.ContentID)) { c1.Config = newenhcfg.ToString(); @@ -3072,7 +3086,7 @@ namespace Volian.Controls.Library cs.Save(); } } - + private Section CreateNewSection() { // B2020-087 the config for SubSection_Edit was sometimes set even when there wasn't any subsections, @@ -3112,7 +3126,7 @@ namespace Volian.Controls.Library // The parent step was not open in the step editor, just create new step(s) and add treenode. int newId = -1; // B2020-076: if this step has a template, insert template steps. - int topType = ii.GetSmartTemplateTopLevelIndxOfThisType(20002); + int topType = ii.GetSmartTemplateTopLevelIndxOfThisType(20002); if (topType != -1) { ItemInfo tmp = null; @@ -3139,12 +3153,12 @@ namespace Volian.Controls.Library // see if enhanced related steps need created: SectionConfig scfgE = _LastItemInfo.ActiveSection.MyConfig as SectionConfig; // C2018-003 fixed use of getting the active section - if (scfgE != null && scfgE.Section_LnkEnh == "Y") + if (scfgE != null && scfgE.Section_LnkEnh=="Y") { // set up which item to insert from based on whether editor was open (see comment from 11/17 above). EnhancedDocuments enhdocs = null; ItemInfo.EAddpingPart addpart = ItemInfo.EAddpingPart.Child; - if (_LastItemInfo.MyPrevious != null) // the code above will do the MakeStep regardless of whether editor is up if this is the only step. + if (_LastItemInfo.MyPrevious != null) // the code above will do the MakeStep regardless of whether editor is up if this is the only step. { addpart = ItemInfo.EAddpingPart.After; ItemInfo lstSrc = _LastItemInfo.MyPrevious; @@ -3316,7 +3330,7 @@ namespace Volian.Controls.Library result = FlexibleMessageBox.Show("Are you sure you want to delete this " + typeDescription + "?", "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); } - if (_LastProcedureInfo != null || result == DialogResult.Yes) + if (_LastProcedureInfo != null || result == DialogResult.Yes) { if (_LastFolderInfo != null) { @@ -3332,7 +3346,7 @@ namespace Volian.Controls.Library { foreach (DVEnhancedDocument dve in dvc.MyEnhancedDocuments) { - if (dve.Type != 0) + if (dve.Type != 0) DocVersion.Delete(dve.VersionID); else { @@ -3378,7 +3392,7 @@ namespace Volian.Controls.Library if (ed.Type != 0) enhIds.Add(ed.ItemID); // always return false because an event gets fired to delete tree nodes. if (!DeleteItemInfoAndChildren(_LastProcedureInfo)) return false; - + _LastProcedureInfo = null; foreach (int enhId in enhIds) { @@ -3422,7 +3436,7 @@ namespace Volian.Controls.Library // just clear enhanced links back _LastSectionInfo.ClearEnhancedSectionLink(); } - OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo, true)); + OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo,true)); // always return false because an event gets fired to delete tree nodes. if (!DeleteItemInfoAndChildren(_LastSectionInfo)) { @@ -3488,11 +3502,11 @@ namespace Volian.Controls.Library // do delete using RTBItem - this manages windowing from the step editor. // If the procedure is open & you're deleting procedure, you want to close open // window - this is done in DisplayTabControl-DeleteStepTabItem. - OnProcessing(true, "Deleting"); + OnProcessing(true,"Deleting"); if (!OnDeleteItemInfo(this, new vlnTreeItemInfoEventArgs(ii))) Item.DeleteItemAndChildren(ii); - OnProcessing(false, "Deleted"); - OnProcessingComplete(dtStart, "Deleted"); + OnProcessing(false,"Deleted"); + OnProcessingComplete(dtStart,"Deleted"); if (deletedSection) { // B2020-087 if we deleted the last sub section, then clear the SubSection_Edit in the parent's config @@ -3511,12 +3525,12 @@ namespace Volian.Controls.Library } catch (System.Data.SqlClient.SqlException ex) { - OnProcessing(false, "Delete Failed"); - OnProcessingComplete(dtStart, "Delete Failed"); + OnProcessing(false,"Delete Failed"); + OnProcessingComplete(dtStart,"Delete Failed"); // C2020-033: Support delete to bring up Search/Incoming Transitions panel if (ex.Message.Contains("has External Transitions")) { - ItemInfo iis = ItemInfo.Get(ii.ItemID); + ItemInfo iis = ItemInfo.Get(ii.ItemID); OnSearchIncTransIn(this, new vlnTreeItemInfoEventArgs(iis)); iis = ii.HandleSqlExceptionOnDelete(ex); } @@ -3532,13 +3546,13 @@ namespace Volian.Controls.Library private void OnProcessingComplete(DateTime dtStart, string message) { if (ProcessingComplete != null) - ProcessingComplete(this, new vlnTreeTimeEventArgs(dtStart, message)); + ProcessingComplete(this, new vlnTreeTimeEventArgs(dtStart,message)); } public event vlnTreeViewStatusEvent Processing; private void OnProcessing(bool status, string message) { if (Processing != null) - Processing(this, new vlnTreeStatusEventArgs(status, message)); + Processing(this, new vlnTreeStatusEventArgs(status,message)); } #endregion #region SetLastValuesAndSaveIfChangedStuff @@ -3614,7 +3628,7 @@ namespace Volian.Controls.Library ItemInfo iidrag = ((VETreeNode)dragNode).VEObject as ItemInfo; FolderInfo fdrag = ((VETreeNode)dragNode).VEObject as FolderInfo; DocVersionInfo ddrag = ((VETreeNode)dragNode).VEObject as DocVersionInfo; - if ((iidrag == null && fdrag == null && ddrag == null)) + if ((iidrag == null && fdrag == null && ddrag == null)) { FlexibleMessageBox.Show("Cannot drag/drop a grouping node."); return; @@ -3629,7 +3643,7 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_ItemDrag", ex); + if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_ItemDrag", ex); } } #endregion @@ -3665,7 +3679,7 @@ namespace Volian.Controls.Library { get { return _lastScroll; } } - private string _location = string.Empty; + private string _location = string.Empty; #endregion #region Constructors public DropLocation(TreeView tv, System.Windows.Forms.DragEventArgs e, DateTime lastScroll) @@ -3782,7 +3796,7 @@ namespace Volian.Controls.Library { return; } - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Line at {0} Node {1}[{2}] {3}", _location, _dropNode.Text, _index, _position.ToString()); + //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Line at {0} Node {1}[{2}] {3}", _location, _dropNode.Text, _index, _position.ToString()); // Changed the color of the drag indicator to always be red Color lc = (_position == DropPosition.After ? Color.Red : Color.Red); Brush lb = (_position == DropPosition.After ? Brushes.Red : Brushes.Red); @@ -3809,12 +3823,12 @@ namespace Volian.Controls.Library //if (e.Effect == DragDropEffects.None) return; if (_dropNode != null) { - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); +// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); DragHelper.ImageList_DragShowNolock(false); TreeView tv = _dropNode.TreeView; TreeNode tmp = tv.GetNodeAt(tv.PointToClient(new Point(e.X, e.Y))); - // if (!ScrollOnly) - // { +// if (!ScrollOnly) +// { if (ScrollTreeView(tmp) || !ScrollOnly) { //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation2 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); @@ -3824,11 +3838,11 @@ namespace Volian.Controls.Library //tv.SelectedNode = dropNode; Graphics g = tv.CreateGraphics(); TreeNodeTriangle(g); - if (_position != DropPosition.Child) InsertPointer(tmp, g); + if (_position != DropPosition.Child)InsertPointer(tmp, g); } } - // } - // else ScrollTreeView(tmp); +// } +// else ScrollTreeView(tmp); DragHelper.ImageList_DragShowNolock(true); } } @@ -3851,10 +3865,10 @@ namespace Volian.Controls.Library tn.NextVisibleNode.EnsureVisible();// Make sure that the next node is visible else if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible } - else + tn.PrevVisibleNode.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible } + else if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible + tn.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible retval = (top != tn.Bounds.Top); // if (retval) if(_MyLog.IsInfoEnabled)_MyLog.Info("Scroll"); } @@ -3887,14 +3901,14 @@ namespace Volian.Controls.Library { DragDropEffects ee = e.Effect; if (e.KeyState == 13) // Shift and Control Keys to do a move. - ee = DragDropEffects.Move; + ee = DragDropEffects.Move; else ee = DragDropEffects.None; // Default - Do nothing - if (IsChild(dragNode, dl.DropNode)) // Don't copy or move to a child node + if (IsChild(dragNode, dl.DropNode)) // Don't copy or move to a child node ee = DragDropEffects.None; - else if (IsDocVersion((VETreeNode)dragNode)) // Don't move docversions + else if (IsDocVersion((VETreeNode)dragNode)) // Don't move docversions ee = DragDropEffects.None; - else if (IsFolder((VETreeNode)dragNode)) // Folder move is only valid if moving to folder with NO docversions + else if (IsFolder((VETreeNode)dragNode)) // Folder move is only valid if moving to folder with NO docversions { FolderInfo fdropi = ((VETreeNode)dl.DropNode).VEObject as FolderInfo; if (fdropi == null || fdropi.FolderDocVersionCount > 0) ee = DragDropEffects.None; @@ -3905,7 +3919,7 @@ namespace Volian.Controls.Library // For HLP, just move within the same procedure // TODO: allow for section move within subsections. ProcedureInfo pdropi = ((VETreeNode)dl.DropNode).VEObject as ProcedureInfo; - if (pdropi == null || (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; + if (pdropi == null || (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; } else if (!IsFolder((VETreeNode)dragNode) && (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; @@ -3916,7 +3930,7 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_DragOver", ex); + if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragOver", ex); } } @@ -3970,7 +3984,7 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GetTreeNodeFromData", ex); + if(_MyLog.IsErrorEnabled)_MyLog.Error("GetTreeNodeFromData", ex); } } return null; @@ -3996,7 +4010,7 @@ namespace Volian.Controls.Library this.SelectedNode = dragNode; FolderInfo fdragi = ((VETreeNode)dragNode).VEObject as FolderInfo; FolderInfo fdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as FolderInfo; - if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount == 0) + if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount==0) { using (Folder fdrag = fdragi.Get()) { @@ -4015,7 +4029,7 @@ namespace Volian.Controls.Library // may either be a document version or a procedure depending on where the user wants to position the procedure. ProcedureInfo pdragi = ((VETreeNode)dragNode).VEObject as ProcedureInfo; ProcedureInfo pdropi = null; - if (pdragi != null) // moving a procedure + if (pdragi != null) // moving a procedure { pdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as ProcedureInfo; if (pdropi != null && pdragi.ActiveParent == pdropi.ActiveParent) @@ -4035,7 +4049,7 @@ namespace Volian.Controls.Library // Allow drag/drop of sections within the same procedure or same section (if subsection) (must have same parent) SectionInfo sdragi = ((VETreeNode)dragNode).VEObject as SectionInfo; SectionInfo sdropi = null; - if (sdragi != null) // moving a section + if (sdragi != null) // moving a section { sdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as SectionInfo; if (sdropi != null && sdragi.ActiveParent == sdropi.ActiveParent) @@ -4056,7 +4070,7 @@ namespace Volian.Controls.Library // Allow drag/drop of steps within the same parent only StepInfo stdragi = ((VETreeNode)dragNode).VEObject as StepInfo; StepInfo stdropi = null; - if (stdragi != null) // moving a step + if (stdragi != null) // moving a step { stdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as StepInfo; if (stdropi != null && stdragi.ActiveParent == stdropi.ActiveParent) @@ -4080,36 +4094,36 @@ namespace Volian.Controls.Library } catch (Exception ex) { - if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_DragDrop", ex); + if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragDrop", ex); } } - // private void DumpMembers(object o) - // { - // Type t = o.GetType(); - // //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString()); - // MemberInfo[] mis = t.GetMembers(); - // int i = 0; - // foreach (MemberInfo mi in mis) - // { - // i++; - // try - // { - // //if(mi.MemberType != MemberTypes.Method) - // //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType); - //// if (fi.Name == "TreeView") - //// fi.SetValue(o, null); - // } - // catch (Exception ex) - // { - // if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex); - // } - // } - // } +// private void DumpMembers(object o) +// { +// Type t = o.GetType(); +// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString()); +// MemberInfo[] mis = t.GetMembers(); +// int i = 0; +// foreach (MemberInfo mi in mis) +// { +// i++; +// try +// { +// //if(mi.MemberType != MemberTypes.Method) +// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType); +//// if (fi.Name == "TreeView") +//// fi.SetValue(o, null); +// } +// catch (Exception ex) +// { +// if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex); +// } +// } +// } private TreeNode Clone(TreeNode tn) { TreeNode tmp = (TreeNode)tn.Clone(); - ExpandMatch(tmp, tn); + ExpandMatch(tmp,tn); return tmp; } private void tv_DragDropOld(object sender, System.Windows.Forms.DragEventArgs e) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 9baf4fad..3460f87c 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -64,18 +64,18 @@ namespace Volian.Print.Library float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin; // -SixLinesPerInch; if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination()) { - ShowPageBreak(1, "Page Break between separate sections", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - + ShowPageBreak(1, "Page Break between separate sections", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); + // if parent was continuous & this is separate, need to paginate to get subsection on // its own page. This occurred in BGE/OI3 set/OI-7 procedure/10.0 Attachments. if (!(MyParent.MyItemInfo as SectionInfo).IsSeparatePagination()) return 1; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && (MyItemInfo as SectionInfo).IsSeparatePagination()) return 1; - // B2017-273 added a check for Farley format, we don't want the subsection pagelist infor to appear on the parent section page - works with ToPDF() logic - (section has steps and a sub-section ex: FNP-2-EEP-0 Attachment 4) - if (MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyItemInfo as SectionInfo).IsSeparatePagination()) return 1; + // B2017-273 added a check for Farley format, we don't want the subsection pagelist infor to appear on the parent section page - works with ToPDF() logic - (section has steps and a sub-section ex: FNP-2-EEP-0 Attachment 4) + if (MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyItemInfo as SectionInfo).IsSeparatePagination()) return 1; if (MyItemInfo.MyPrevious != null) // add if statement to fix Westinghouse print issue 3-21-2014 - return 1; + return 1; } - if (MyItemInfo.IsSection && _ChildrenBelow == null && YSize > (yLocation - yBottomMargin)) + if (MyItemInfo.IsSection && _ChildrenBelow == null && YSize > (yLocation-yBottomMargin)) { ShowPageBreak(1, "Page Break before empty section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); return 1; @@ -171,7 +171,7 @@ namespace Volian.Print.Library // line above the end message, thus 2 not 3. This change was made on July 20, 2011 by RHM & KBR. The // procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8. //float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; - float yEndMsg = (!_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null) ? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages + float yEndMsg = (!_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null)? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages // also consider if there is a phone list at the bottom of the page, add the amount of space the phone // list requires onto yEndMsg to make it easier to figure out pagination (include an extra line for the @@ -191,7 +191,7 @@ namespace Volian.Print.Library //float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? ((2 * SixLinesPerInch) - yEndsWithBlankLine) : 0; bool isFirstChild = MyItemInfo.MyPrevious == null; - bool nearTheTop = (yWithinMargins < yPageSize) && (yWithinMargins > (yPageSize - 5 * SixLinesPerInch)); + bool nearTheTop = (yWithinMargins < yPageSize) && (yWithinMargins > (yPageSize - 5 * SixLinesPerInch)); // if step is breaking over a number of pages, determine if the current step is the // location of a pagebreak. ParaBreaks contains the paragraphs that break within a step. if (MyPageHelper.ParaBreaks.Count > 0) @@ -202,8 +202,8 @@ namespace Volian.Print.Library { MyPageHelper.ParaBreaks.RemoveAt(0); reason = AddReason("Partial Step - Case 1"); - ShowPageBreak(1, reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - return 2; // break on this item within a step + ShowPageBreak(1,reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); + return 2; // break on this item within a step } // check for rnos: else if (MyPageHelper.ParaBreaks[0].CheckAlternates(this)) @@ -211,7 +211,7 @@ namespace Volian.Print.Library MyPageHelper.ParaBreaks.RemoveAt(0); reason = AddReason("Partial Step - Case 2"); ShowPageBreak(1, reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - return 2; // break on this item within a step + return 2; // break on this item within a step } /////////////////// // The following else ifs are reached if something previously went wrong in pagination & this code tries to account for it. @@ -224,7 +224,7 @@ namespace Volian.Print.Library MyPageHelper.ParaBreaks.RemoveAt(0); reason = AddReason("Partial Step - Case 3"); ShowPageBreak(1, reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - return 2; // break on this item within a step + return 2; // break on this item within a step } // B2018-015 Pagination Issue VCS EOP-15.0 Step 15 - Handle when RNO is exactly aligned with the AER column // B2018-065 Calvert's continue message was not including the substep number in AOP-1A Attachment 1, added AERandRNO check @@ -240,12 +240,12 @@ namespace Volian.Print.Library //} reason = AddReason("Partial Step - Case 4"); ShowPageBreak(1, reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - return 2; // break on this item within a step + return 2; // break on this item within a step } - return 0; // this is not an item with a break + return 0; // this is not an item with a break } float mySize = YSize * MyPageHelper.YMultiplier; - vlnParagraph firstChild = ChildrenBelow.Count > 0 ? ChildrenBelow[0] : null; + vlnParagraph firstChild = ChildrenBelow.Count > 0 ? ChildrenBelow[0] : null; // Steps that have the smart template (the WCNCKL format for example), always include two children. if (MyItemInfo.IsHigh && MyItemInfo.FormatStepData.UseSmartTemplate) // { @@ -277,8 +277,8 @@ namespace Volian.Print.Library // on that first step. StepConfig sc = firstChild.MyItemInfo.MyConfig as StepConfig; ManualPageBreak = MyPageHelper.OriginalPageBreak ? (sc == null ? false : sc.Step_ManualPagebreak) : - sc == null ? false : - (MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks == null) ? sc.Step_NewManualPagebreak : false; + sc == null ? false : + (MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks == null)? sc.Step_NewManualPagebreak : false; // C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. if (sc != null && sc.Step_NewManualPagebreak && MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks != null && !MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Contains(firstChild.MyItemInfo.ItemID)) MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Add(firstChild.MyItemInfo.ItemID); @@ -309,7 +309,7 @@ namespace Volian.Print.Library float ySizeIncludingFirstStep = firstStepChild.YSize + (firstStepChild.YTopMost - YTopMost); float ySizeBtmCtnMess = GetBottomContinueMessageSize(MyItemInfo.MyDocStyle); float ySizeBtmEndMess = GetBottomEndMessageSize(MyItemInfo.MyDocStyle); - bool firstSubstepExceedsSpaceAvailable = ySizeIncludingFirstStep > (yWithinMargins - ySizeBtmCtnMess - ySizeBtmEndMess); + bool firstSubstepExceedsSpaceAvailable = ySizeIncludingFirstStep > (yWithinMargins - ySizeBtmCtnMess -ySizeBtmEndMess); if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild) KeepStepsOnPage = false; if (ySizeIncludingFirst == YSize) KeepStepsOnPage = false; @@ -365,13 +365,13 @@ namespace Volian.Print.Library //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box if ((MyItemInfo.MyActiveSection.MyConfig as SectionConfig).Section_IsFoldout == "Y" && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CompressSteps - && mySize > yPageSize + && mySize > yPageSize && mySize <= yPageSize * SixLinesPerInch / _SevenLinesPerInch) CompressFoldout = true; return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page } - if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level - bool doSectionTitleContinued = false; + if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level + bool doSectionTitleContinued = false; if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) { float vpHeight = SixLinesPerInch; @@ -396,11 +396,11 @@ namespace Volian.Print.Library // if this step contains Cautions or Notes page breaks have to be added for those. if (TopMostChild != this) PageBreakOnStep = true; - BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 + BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 ShowPageBreak(1, "Page Break on Steps, Cautions or Notes", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); return 1; } - + //MyPageHelper.HLSText = MyItemInfo.DisplayText; // save the High Level Step Text //Console.WriteLine("{0} Paginate", MyPageHelper.HLSText); StepConfig sc1 = MyItemInfo.MyConfig as StepConfig; @@ -445,16 +445,16 @@ namespace Volian.Print.Library if (BreakHighLevelStepWithSection) KeepWithHeader = true; // for a HLS that has an asterisk box with the rno separator IN the box, adjust the size by 2 lines to account for box. if (MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 && - (MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0)) - mySize += (2 * SixLinesPerInch); + (MyItemInfo.RNOs==null ||MyItemInfo.RNOs.Count==0)) + mySize += (2*SixLinesPerInch); // mySize is the size of this step and includes an extra blank line. For HLS, if this is the last step in section & there is room in footer to keep - // step on the page, do so by eliminating the blank line before doing the test to see if it fits. + // step on the page, do so by eliminating the blank line before doing the test to see if it fits. // B2017-254 Fixed Pagination Logic when checking to see if the current item is the last high level step if (MyItemInfo.IsHigh && mySize >= (2 * SixLinesPerInch) && MyItemInfo.MyDocStyle.Layout.FooterLength > 0 && (MyItemInfo.MyDocStyle.End.Message == null || MyItemInfo.MyDocStyle.End.Message == "") && MyItemInfo.NextItem == null && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) && (MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0)) mySize -= SixLinesPerInch; //// Account for extra lines in the end message (flag < 0) float adjMsgY = 0; - if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null && MyItemInfo.MyDocStyle.End.Flag < 0) // Adjust this many lines down the page. + if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null && MyItemInfo.MyDocStyle.End.Flag < 0) // Adjust this many lines down the page. { adjMsgY = (float)-MyItemInfo.MyDocStyle.End.Flag * SixLinesPerInch; if (yEndMsg != 0) yEndMsg += adjMsgY; @@ -486,7 +486,7 @@ namespace Volian.Print.Library // 888 888 888 o oo .d8P `888'`888' 888 888 888 888 888 888 . // o888o o888o o888ooooood8 8""88888P' `8' `8' o888o o888o o888o o888o o888o "888" //Console.WriteLine("'PageBreak',1,'No','HLS will fit on page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - ShowPageBreak(-1, "HLS will fit on page", firstStep, YSize, yPageSize, yWithinMargins, ManualPageBreak); + ShowPageBreak(-1, "HLS will fit on page", firstStep, YSize, yPageSize, yWithinMargins,ManualPageBreak); return 0; } // !MyItemInfo.IsHigh - if (MyItemInfo.IsRNOPart && MyParent.XOffset < XOffset) return 0; // Don't paginate on an RNO to the right @@ -500,7 +500,7 @@ namespace Volian.Print.Library // this next page size is the same as current page size. float yPageSizeNextPage = yPageSize; mySize = YSize; // reset in case mySize changed for current page is compressed - // for a HLS that has an asterisk box with the rno separator IN the box, adjust the size by 2 lines to account for box. + // for a HLS that has an asterisk box with the rno separator IN the box, adjust the size by 2 lines to account for box. if (MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 && (MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0)) mySize += (2 * SixLinesPerInch); @@ -509,18 +509,18 @@ namespace Volian.Print.Library if (MyPageHelper.DidFirstPageDocStyle && MyItemInfo.ActiveSection != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0)// C2018-003 fixed use of getting the active section yPageSizeNextPage = GetYPageSizeUseOnAllButFirstPage(); - if (KeepStepsOnPage - && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel - && YSize == ySizeIncludingFirst - && YSize + yEndMsg > yWithinMargins) + if (KeepStepsOnPage + && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel + && YSize == ySizeIncludingFirst + && YSize + yEndMsg > yWithinMargins) { // If the first step is the size of the entire step and the step has an end message then don't try to break the step KeepStepsOnPage = false; //_MyLog.WarnFormat("Kick Step to Next Page {0},{1}", MyItemInfo.ItemID, MyItemInfo.ShortPath); } if (yWithinMargins < SixLinesPerInch) KeepStepsOnPage = false; // if there is no room to print, don't keep steps on the page - // The following was added for IP2 background printing. There were situations where there was a HLS and its paragraph was - // put on next page (IP2 bck: E-3/References), and a paragraph was writing into the footer (FR-H.1 step 2.2.3.1. KBR 10/14/14) + // The following was added for IP2 background printing. There were situations where there was a HLS and its paragraph was + // put on next page (IP2 bck: E-3/References), and a paragraph was writing into the footer (FR-H.1 step 2.2.3.1. KBR 10/14/14) if (KeepStepsOnPage && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel && YSize == ySizeIncludingFirst @@ -560,7 +560,7 @@ namespace Volian.Print.Library float ySizeBtmCtnMess1 = GetBottomContinueMessageSize(MyItemInfo.MyDocStyle); float ySizeBtmEndMess1 = GetBottomEndMessageSize(MyItemInfo.MyDocStyle); // B2017-154 Don't leave an orphan on the next page if the high level step and first sub-step will fit on the current page - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.NoOrphans1 && KeepStepsOnPage && ChildrenBelow.Count == 2)// Handle Orphans when there are two sub-steps and only one will fit. + if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.NoOrphans1 && KeepStepsOnPage && ChildrenBelow.Count == 2)// Handle Orphans when there are two sub-steps and only one will fit. { vlnParagraph orphan = ChildrenBelow[1];// Verify that the orphan has no children if (orphan.ChildrenBelow.Count == 0 && orphan.ChildrenAbove.Count == 0 && orphan.ChildrenLeft.Count == 0 && orphan.ChildrenRight.Count == 0) @@ -571,13 +571,13 @@ namespace Volian.Print.Library } if (KeepStepsOnPage && ySizeIncludingFirst > (yWithinMargins - ySizeBtmCtnMess1 - ySizeBtmEndMess1)) { - // B2023-116: Vogtle alarm pagination - sub-steps are separating from their HLS even if there is room for some (not all). - // See comment above for setting of 'alarmPageKeepHighWithSubs'. + // B2023-116: Vogtle alarm pagination - sub-steps are separating from their HLS even if there is room for some (not all). + // See comment above for setting of 'alarmPageKeepHighWithSubs'. if (alarmPageKeepHighWithSubs) { - // F2024-006: Vogtle Alarms pagination - compare the size of the step and its first sub-step with what we think we have left on the - // page. if not enough room with a continue message then set KeepStepsOnPage to start this step on its own page. - // This solved an issue where the last line of step text was printing on top of the bottom continue message + // F2024-006: Vogtle Alarms pagination - compare the size of the step and its first sub-step with what we think we have left on the + // page. if not enough room with a continue message then set KeepStepsOnPage to start this step on its own page. + // This solved an issue where the last line of step text was printing on top of the bottom continue message float myFirstPieceSize = GetFirstPieceSize(true); if (myFirstPieceSize > yWithinMargins) KeepStepsOnPage = false; @@ -585,7 +585,7 @@ namespace Volian.Print.Library else KeepStepsOnPage = false; } - if (!KeepWithHeader && !KeepStepsOnPage && mySize - SixLinesPerInch + yEndMsg - tableSpaceAvailable <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break + if (!KeepWithHeader && !KeepStepsOnPage && mySize - SixLinesPerInch + yEndMsg - tableSpaceAvailable <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break { // Don't want extra line before step //Console.WriteLine("'PageBreak',2,'Yes','HLS will fit on 1 Page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); @@ -602,8 +602,8 @@ namespace Volian.Print.Library } // TODO - yEndMsg - compressed size? - // ySize7LPI includes a blank line after the step which we don't want to include in the page break test. - else if (!KeepStepsOnPage && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CompressSteps + // ySize7LPI includes a blank line after the step which we don't want to include in the page break test. + else if (!KeepStepsOnPage && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CompressSteps //&& (mySize7LPI - SixLinesPerInch + yEndMsg - tableSpaceAvailable) < (yPageSizeNextPage * SixLinesPerInch / _SevenLinesPerInch))// RHM20150525 - Table Scrunch // if this is the first step, then the step has to fit in the space that remains on the page // otherwise it needs to fit on a blank page @@ -628,7 +628,7 @@ namespace Volian.Print.Library else // The entire step cannot fit on a blank page or KeepStepsOnPage is true. { // if there is more than half a page left, then start to print on the current page - float myFirstPieceSize = GetFirstPieceSize(); //Case 0 + float myFirstPieceSize = GetFirstPieceSize(); //Case 0 if (_Match16BitPagination) myFirstPieceSize += 2 * SixLinesPerInch; // TODO: Put this line back to case 0, i.e. previous line. This fixes a 16-bit vs 32-bit pagination diff in EO30 Step 20. //float myFirstPieceSize = GetFirstPieceSize() + 2 * SixLinesPerInch; //Case 10 - this is to match 16bit @@ -662,19 +662,19 @@ namespace Volian.Print.Library // if the HLS is part of a Smart Template (i.e. WCNCKL table), don't add in an extra line because // that makes pagination work incorrectly because the Smart Template has a 'table' line after the // text. - float ySpaceOnFirstPage = yWithinMargins + (MyItemInfo.FormatStepData.UseSmartTemplate ? 0 : SixLinesPerInch); + float ySpaceOnFirstPage = yWithinMargins + (MyItemInfo.FormatStepData.UseSmartTemplate ? 0 : SixLinesPerInch); if (firstStep == "Yes") - //{ + //{ ySpaceOnFirstPage = yWithinMargins; // Accounts for Section Title Line - //ShowPageBreak(8, CheckForCompression("First HLS has to split on current page"), firstStep, YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - //} - //else - // ShowPageBreak(6, CheckForCompression("HLS will have to split on current page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - //BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur - // B2020-027: adjust for lines that may print on first page of section only, added MyPageHelper.PrintedSectionPage - // B2020-108: The bug itself was related to keeping a table with its parent. However compression for some pages was - // not working because onnewpage was always false in the next BuildPageBreakList call. onnewpage is used to determine compression - // (has to be on a new page to compress page). Use calculated value rather than always false in this case. + //ShowPageBreak(8, CheckForCompression("First HLS has to split on current page"), firstStep, YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); + //} + //else + // ShowPageBreak(6, CheckForCompression("HLS will have to split on current page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); + //BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur + // B2020-027: adjust for lines that may print on first page of section only, added MyPageHelper.PrintedSectionPage + // B2020-108: The bug itself was related to keeping a table with its parent. However compression for some pages was + // not working because onnewpage was always false in the next BuildPageBreakList call. onnewpage is used to determine compression + // (has to be on a new page to compress page). Use calculated value rather than always false in this case. bool onnewpage = MyItemInfo.MyPrevious == null && (MyItemInfo.MyActiveSection as SectionInfo) != null && (MyItemInfo.MyActiveSection as SectionInfo).IsSeparatePagination(); // B2020-123: Missing section continue message, onnewpage needs to be set to true: @@ -683,16 +683,16 @@ namespace Volian.Print.Library onnewpage = true; MyParent.CalvertPrintedSubSectTitle = false; } - BuildPageBreakList(ySpaceOnFirstPage, yPageSize + yExtra2 + MyPageHelper.PrintedSectionPage, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, onnewpage); // Case 5 - Determine items where page break(s) occur - // ooooo ooooo ooooo .oooooo..o .oooooo..o oooo o8o . .oooooo. . - // `888' `888' `888' d8P' `Y8 d8P' `Y8 `888 `"' .o8 d8P' `Y8b .o8 - // 888 888 888 Y88bo. Y88bo. oo.ooooo. 888 oooo .o888oo 888 oooo oooo oooo d8b oooo d8b .ooooo. ooo. .oo. .o888oo - // 888ooooo888 888 `"Y8888o. `"Y8888o. 888' `88b 888 `888 888 888 `888 `888 `888""8P `888""8P d88' `88b `888P"Y88b 888 - // 888 888 888 `"Y88b `"Y88b 888 888 888 888 888 888 888 888 888 888 888ooo888 888 888 888 - // 888 888 888 o oo .d8P oo .d8P 888 888 888 888 888 . `88b ooo 888 888 888 888 888 .o 888 888 888 . - // o888o o888o o888ooooood8 8""88888P' 8""88888P' 888bod8P' o888o o888o "888" `Y8bood8P' `V88V"V8P' d888b d888b `Y8bod8P' o888o o888o "888" - // 888 - // o888o + BuildPageBreakList(ySpaceOnFirstPage, yPageSize + yExtra2 + MyPageHelper.PrintedSectionPage, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, onnewpage); // Case 5 - Determine items where page break(s) occur + // ooooo ooooo ooooo .oooooo..o .oooooo..o oooo o8o . .oooooo. . + // `888' `888' `888' d8P' `Y8 d8P' `Y8 `888 `"' .o8 d8P' `Y8b .o8 + // 888 888 888 Y88bo. Y88bo. oo.ooooo. 888 oooo .o888oo 888 oooo oooo oooo d8b oooo d8b .ooooo. ooo. .oo. .o888oo + // 888ooooo888 888 `"Y8888o. `"Y8888o. 888' `88b 888 `888 888 888 `888 `888 `888""8P `888""8P d88' `88b `888P"Y88b 888 + // 888 888 888 `"Y88b `"Y88b 888 888 888 888 888 888 888 888 888 888 888ooo888 888 888 888 + // 888 888 888 o oo .d8P oo .d8P 888 888 888 888 888 . `88b ooo 888 888 888 888 888 .o 888 888 888 . + // o888o o888o o888ooooood8 8""88888P' 8""88888P' 888bod8P' o888o o888o "888" `Y8bood8P' `V88V"V8P' d888b d888b `Y8bod8P' o888o o888o "888" + // 888 + // o888o if (firstStep == "Yes") { //ySpaceOnFirstPage = yWithinMargins; // Accounts for Section Title Line @@ -701,10 +701,10 @@ namespace Volian.Print.Library else ShowPageBreak(6, CheckForFirstCompression("HLS will have to split on current page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); // B2018-081 - Fix pagination when a Step and it's substeps are so complicated that the high level step is separated from its high level RNO - if (this.MyItemInfo.IsHigh && MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.IsHigh) + if(this.MyItemInfo.IsHigh && MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.IsHigh) { MyPageHelper.ParaBreaks.Clear(); - BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 + BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 ShowPageBreak(6, CheckForFirstCompression("HLS will have to split on next page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); return 1; } @@ -714,7 +714,7 @@ namespace Volian.Print.Library && ChildrenRight[0].YSize <= yPageSizeNextPage && ChildrenRight[0].YSize > yWithinMargins) { MyPageHelper.ParaBreaks.Clear(); - BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 + BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 ShowPageBreak(6, CheckForFirstCompression("HLS with RNO will have to split on next page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); return 1; } @@ -727,7 +727,7 @@ namespace Volian.Print.Library ShowPageBreak(6, CheckForFirstCompression("HLS with Separate Pagination for SubSection"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); return 1; } - return 0; // Stay on this page + return 0; // Stay on this page } // Less than half a page left, start printing on a new page. @@ -738,21 +738,21 @@ namespace Volian.Print.Library // Pagination Fix Break1LineShort2 //BuildPageBreakList(yPageSize + yExtra, yPageSize); // Case 1 :Works for ES05 Step 15 SubStep 7 // Pagination Fix Break1LineShort4 - BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 - // ooooo ooooo ooooo .oooooo..o .oooooo..o oooo o8o . ooooo ooo - // `888' `888' `888' d8P' `Y8 d8P' `Y8 `888 `"' .o8 `888b. `8' - // 888 888 888 Y88bo. Y88bo. oo.ooooo. 888 oooo .o888oo 8 `88b. 8 .ooooo. oooo oooo ooo - // 888ooooo888 888 `"Y8888o. `"Y8888o. 888' `88b 888 `888 888 8 `88b. 8 d88' `88b `88. `88. .8' - // 888 888 888 `"Y88b `"Y88b 888 888 888 888 888 8 `88b.8 888ooo888 `88..]88..8' - // 888 888 888 o oo .d8P oo .d8P 888 888 888 888 888 . 8 `888 888 .o `888'`888' - // o888o o888o o888ooooood8 8""88888P' 8""88888P' 888bod8P' o888o o888o "888" o8o `8 `Y8bod8P' `8' `8' - // 888 - // o888o + BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7 + // ooooo ooooo ooooo .oooooo..o .oooooo..o oooo o8o . ooooo ooo + // `888' `888' `888' d8P' `Y8 d8P' `Y8 `888 `"' .o8 `888b. `8' + // 888 888 888 Y88bo. Y88bo. oo.ooooo. 888 oooo .o888oo 8 `88b. 8 .ooooo. oooo oooo ooo + // 888ooooo888 888 `"Y8888o. `"Y8888o. 888' `88b 888 `888 888 8 `88b. 8 d88' `88b `88. `88. .8' + // 888 888 888 `"Y88b `"Y88b 888 888 888 888 888 8 `88b.8 888ooo888 `88..]88..8' + // 888 888 888 o oo .d8P oo .d8P 888 888 888 888 888 . 8 `888 888 .o `888'`888' + // o888o o888o o888ooooood8 8""88888P' 8""88888P' 888bod8P' o888o o888o "888" o8o `8 `Y8bod8P' `8' `8' + // 888 + // o888o if (firstStep == "Yes") ShowPageBreak(9, CheckForFirstCompression("First HLS will have to split on new page"), "Yes", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); else ShowPageBreak(3, CheckForFirstCompression("HLS will have to split on new page"), "Yes", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - return 1; // Paginate on High Level Steps + return 1; // Paginate on High Level Steps } //if (yWithinMargins > yPageSize / 2) //{ @@ -773,7 +773,7 @@ namespace Volian.Print.Library bool hasRNO = false; if (itemInfo1.IsInRNO) hasRNO |= true; else - hasAER |= true; + hasAER |=true; if (itemInfo2.IsInRNO) hasRNO |= true; else hasAER |= true; @@ -787,14 +787,14 @@ namespace Volian.Print.Library if (endmsg != "") { string[] splitOn = { "\\par" }; // B2018-058 account for RTF newlines ( used for V.C. Summer End messages) - EndMsgHeight = (endmsg.Split(splitOn, StringSplitOptions.RemoveEmptyEntries).Length + 1) * SixLinesPerInch; + EndMsgHeight = (endmsg.Split(splitOn,StringSplitOptions.RemoveEmptyEntries).Length + 1) * SixLinesPerInch; } return EndMsgHeight; } private float GetBottomEndMessageSize(DocStyle docstyle) { float myBottomMsgSpace = 0; - if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null && MyItemInfo.MyDocStyle.End.Flag < 0) // Adjust this many lines down the page. + if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null && MyItemInfo.MyDocStyle.End.Flag < 0) // Adjust this many lines down the page. { docstyle = MyItemInfo.MyDocStyle; string myBottomMsg = docstyle.End.Message; @@ -876,7 +876,7 @@ namespace Volian.Print.Library // B2020-159: If forced pagination errors occurred, add a description to be placed on a dialog after printing. if (PromsPrinter.ForcedPaginations == null) PromsPrinter.ForcedPaginations = new List(); string path = MyItemInfo.Path.Replace(MyItemInfo.MyProcedure.DisplayText, "").Replace(MyItemInfo.MyProcedure.DisplayNumber, "").TrimStart(" ,".ToCharArray()); - PromsPrinter.ForcedPaginations.Add(string.Format("{0}\t{1}\t{2}", MyPromsPrinter.PDFFile.Substring(0, MyPromsPrinter.PDFFile.IndexOf(".")), path, MyItemInfo.PageNumber)); + PromsPrinter.ForcedPaginations.Add(string.Format("{0}\t{1}\t{2}", MyPromsPrinter.PDFFile.Substring(0,MyPromsPrinter.PDFFile.IndexOf(".")), path, MyItemInfo.PageNumber)); } if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && MyPageHelper.CreatingSupInfoPage) @@ -888,18 +888,18 @@ namespace Volian.Print.Library if (breakOrNot != "No") { bool hasBox = MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0; - bool rnoSepIn = (MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0); + bool rnoSepIn = (MyItemInfo.RNOs==null ||MyItemInfo.RNOs.Count==0); // DebugPagination.WriteLine("{0}", MyItemInfo.DBSequence); //,instance); - if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9},{10},{11}", - MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber - (breakOrNot == "Yes" ? 0 : 1), + if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9},{10},{11}", + MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber - (breakOrNot == "Yes" ? 0 : 1), MyItemInfo.ShortPath, instance, (manualPageBreak ? "Manual " : "") + message, breakOrNot, MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), hasBox, rnoSepIn ); //C2018-015 add debug pagination to meta file - if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9},{10},{11}", - MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber - (breakOrNot == "Yes" ? 0 : 1), + if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9},{10},{11}", + MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber - (breakOrNot == "Yes" ? 0 : 1), MyItemInfo.ShortPath, instance, (manualPageBreak ? "Manual " : "") + message, breakOrNot, MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), @@ -920,11 +920,11 @@ namespace Volian.Print.Library private List _AlternateBreaks = null; public List AlternateBreaks { - get + get { if (_AlternateBreaks == null) _AlternateBreaks = new List(); - return _AlternateBreaks; + return _AlternateBreaks; } } private void AddAlternateBreak(vlnParagraph vp) @@ -934,10 +934,10 @@ namespace Volian.Print.Library private bool CheckAlternates(vlnParagraph vpBrk) { if (_AlternateBreaks == null) return false; - foreach (vlnParagraph vp in AlternateBreaks) + foreach(vlnParagraph vp in AlternateBreaks) if (vp.MyItemInfo.ItemID == vpBrk.MyItemInfo.ItemID) { - // _MyLog.WarnFormat("alternate used '{0}'-'{1}'",vpBrk.MyItemInfo.ShortPath,vp.MyItemInfo.ShortPath); +// _MyLog.WarnFormat("alternate used '{0}'-'{1}'",vpBrk.MyItemInfo.ShortPath,vp.MyItemInfo.ShortPath); return true; } return false; @@ -993,13 +993,13 @@ namespace Volian.Print.Library yLowerLimit = yStart + 2 * SixLinesPerInch; } // Make sure that the FirstPiece (Caution Note HLS and First Substeps) fit - float myFirstPieceSize = GetFirstPieceSize(); //Case 0 - // the following logic was added to fix Pagination for VCS BDMG1 Step 4 + float myFirstPieceSize = GetFirstPieceSize(); //Case 0 + // the following logic was added to fix Pagination for VCS BDMG1 Step 4 if (ChildrenRight.Count > 0 && ChildrenRight[0].YOffset == YOffset) { float myFirstPieceRNOSize = 0; myFirstPieceRNOSize = ChildrenRight[0].GetFirstPieceSize(); - if (myFirstPieceRNOSize < ySpaceOnCurPage) + if(myFirstPieceRNOSize < ySpaceOnCurPage) if (ChildrenBelow.Count > 0) { float myFirstPieceAERSize = ChildrenBelow[0].GetFirstPieceSize() + ChildrenBelow[0].YOffset - YOffset; @@ -1014,12 +1014,12 @@ namespace Volian.Print.Library float myBottomMsgSpace = GetBottomContinueMessageSize(docstyle); switch (docstyle.Continue.Bottom.Location) { - case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page - // The following format flag was added for FNP, without the flag (which stops the reset of BottomMsgSpace) - // a number of FNP procedures had overwritten steps/bottom continue message. An example can be - // found in FNP = SAMGS;FNP-1-SACRG-2, step 1. + case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page + // The following format flag was added for FNP, without the flag (which stops the reset of BottomMsgSpace) + // a number of FNP procedures had overwritten steps/bottom continue message. An example can be + // found in FNP = SAMGS;FNP-1-SACRG-2, step 1. if (!docstyle.Continue.Bottom.NoOverrideSpace) - myBottomMsgSpace = 0; + myBottomMsgSpace = 0; break; } // also account for phonelist for locating bottom continue message: @@ -1089,7 +1089,7 @@ namespace Volian.Print.Library // to have page breaks. As each of these are processed (after this code) the topmost item in PageBreakOnStepList is removed. // The following checks if the entire step will fit for these types of steps and if so return the next break, i.e. [0], from the PageBreakOnStepList. // The if was changed to fix B2017-161. - bool DidPreferredPageBreak = false; + bool DidPreferredPageBreak = false; if (PageBreakOnStepList.Count > 0 && (PageBreakOnStepList[0].YTop - (lastBreak == null ? ((TopMostChild != null) ? TopMostChild.YTop : 0) : lastBreak.YTop) <= ySpaceOnCurPage)) paraBreak = PageBreakOnStepList[0]; else @@ -1115,10 +1115,10 @@ namespace Volian.Print.Library // B2017-109: for supplemental information, if there is a preferred page break, account for it. // B2018-033 VCS SAG-6 Steps 3 and 9 and SACRG1 Step 13 // Break after table if it's the only item left and there is enough space - if (paraBreak != null && paraBreak.MyGrid != null && ItemsLeft(myList) == 1 && + if (paraBreak != null && paraBreak.MyGrid != null && ItemsLeft(myList) == 1 && ((YSize - yTop) <= (paraBreak.MyGrid.SpaceAvailable + ySpaceOnCurPage - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)))) break; - if (myPreferredBreaks != null && myPreferredBreaks.Count > 0 && myPreferredBreaks.Keys[0] < paraBreak.YOffset) + if (myPreferredBreaks != null && myPreferredBreaks.Count > 0 && myPreferredBreaks.Keys[0] < paraBreak.YOffset) { // B2017-122: don't use preferred break if the last break was before this break vlnParagraph prefBreak = myPreferredBreaks[myPreferredBreaks.Keys[0]]; @@ -1199,9 +1199,9 @@ namespace Volian.Print.Library } if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfcreekCKLFormat) { - if (!paraBreak.MyItemInfo.IsHigh // not a high level step - && paraBreak.MyParent.MyItemInfo.IsHigh // my parent is a hls - && paraBreak.MyItemInfo.MyPrevious == null // first substep + if (!paraBreak.MyItemInfo.IsHigh // not a high level step + && paraBreak.MyParent.MyItemInfo.IsHigh // my parent is a hls + && paraBreak.MyItemInfo.MyPrevious == null // first substep && paraBreak.MyParent.MyItemInfo.FormatStepData.UseSmartTemplate) // my parent has the checklist header { if (DebugPagination.IsOpen) DebugPagination.WriteLine("Breaking at parent of {0}", paraBreak.MyItemInfo.DisplayText); @@ -1375,7 +1375,7 @@ namespace Volian.Print.Library // | Flags compression for 1st page | // | (1st page doesn't use paraBreak) | // - if (lastBreak != null) // not on first page of step + if (lastBreak != null) // not on first page of step { lastBreak.PageBreakReason = "More of Step at 7 LPI"; lastBreak.CompressPartOfStep = true; @@ -1424,7 +1424,7 @@ namespace Volian.Print.Library RemoveProcessedParagraphs(myList, yTopNew - yTop); yTop = yTopNew; MyPageHelper.ParaBreaks.Add(paraBreak); - ySpaceOnNextPage1 -= paraBreak.GetSectionTopMessageSize(); // B2016-134: Account for wcntraining section top continue on substep containers (notes/cautions) + ySpaceOnNextPage1 -= paraBreak.GetSectionTopMessageSize(); // B2016-134: Account for wcntraining section top continue on substep containers (notes/cautions) SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; // B2016-266 Only set SectionTitleContinued1 if the format supports section continue messages bool doSectionTitleContinued1 = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader; @@ -1435,9 +1435,9 @@ namespace Volian.Print.Library doSectionTitleContinued1 = false; } if (doSectionTitleContinued1) ySpaceOnNextPage1 -= 2 * SixLinesPerInch; // B2016-195: Account for Section Continue Message - // B2017-161: unnecessary PageBreak for background documents: use the 'usedPageBreakOnStepList' flag when using the PageBreakOnStepList, don't adjust space on page to account - // for continue message, if there is not one. - // B2017-252 Pagination Fix - RNP was not paginating correctly. Added logic to set ySPaceOnCurPage if ySpaceOnNextPage was larger + // B2017-161: unnecessary PageBreak for background documents: use the 'usedPageBreakOnStepList' flag when using the PageBreakOnStepList, don't adjust space on page to account + // for continue message, if there is not one. + // B2017-252 Pagination Fix - RNP was not paginating correctly. Added logic to set ySPaceOnCurPage if ySpaceOnNextPage was larger if (!usedPageBreakOnStepList || ySpaceOnNextPage1 > ySpaceOnCurPage) ySpaceOnCurPage = ySpaceOnNextPage1; //ySpaceOnCurPage = yPageSize - (myTopMsgSpace + SixLinesPerInch); // Allow for continue message and blank line. @@ -1465,7 +1465,7 @@ namespace Volian.Print.Library } float ySpaceAt7LPI = (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)) * SixLinesPerInch / _SevenLinesPerInch; if ((YSize - yTop) > (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)) - && (YSize - yTop) < ySpaceAt7LPI) + && (YSize - yTop) < ySpaceAt7LPI ) { // Compress Rest of Step // .oooooo. ooooooooo. . @@ -1492,8 +1492,8 @@ namespace Volian.Print.Library private int ItemsLeft(StepLevelList myList) { int retval = 0; - foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. - foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation + foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. + foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation retval++; return retval; } @@ -1507,9 +1507,9 @@ namespace Volian.Print.Library // C2023-018: Remove the supplemental info & alarm check, doing the possible page breaks on sub-steps //if (!MyItemInfo.MyDocStyle.SupplementalInformation && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.AlarmPagination) return null; SortedList sdpara = null; - foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. + foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. { - foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation + foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation { vlnParagraph myPara = myList[stepLevel][yLocation]; StepConfig sci = myPara.MyItemInfo.MyConfig as StepConfig; @@ -1596,13 +1596,13 @@ namespace Volian.Print.Library /// /// private static vlnParagraph FindPageBreak1(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak, float fullPage, - float myBottomMsgSpace, bool RNOContinueOnly, float yTop) + float myBottomMsgSpace,bool RNOContinueOnly, float yTop) { vlnParagraph minPara = null; //StringBuilder minBuff = new StringBuilder(); - float? yLocationMin = null; + float? yLocationMin=null; vlnParagraph minPara2 = null; - float? yLocationMin2 = null; + float? yLocationMin2=null; float yAddForBtmMsg = 0; // useful for debugging pagination issues, lastbreak gets the paragraph at the top of the previous page, shows all // of the locations within 'range' on the next page. @@ -1626,9 +1626,9 @@ namespace Volian.Print.Library // } // } //} - foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. + foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. { - foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation + foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation { float spaceOnPage = yUpperLimit + yLocation; vlnParagraph myPara = myList[stepLevel][yLocation]; @@ -1651,11 +1651,11 @@ namespace Volian.Print.Library // The following lines were added for Comanche Peak ECA-TP-11-001A.SProcedure Steps.S17 (Printed as Step 12) if (spaceOnPage > 0 && myPara.YSize > fullPage && myPara.ChildrenRight != null && myPara.ChildrenRight.Count > 0 && myPara.ChildrenRight[0].YSize <= fullPage && myPara.ChildrenRight[0].YSize > spaceOnPage - // B2018-104: don't return if my parent is a high level - a top continue message was printing - // Was not complete, i.e. caused other pagination problems and was put back in: B2019-170: VCS page break causes printing of step on top of next page. - // Note that this bug fix for WCN was commented out. Harry Julian wanted this on 11/15/19. A new bug will be written for the WCN error. - // B2019-173 reintroduced this line: - && !myPara.MyItemInfo.IsHigh) + // B2018-104: don't return if my parent is a high level - a top continue message was printing + // Was not complete, i.e. caused other pagination problems and was put back in: B2019-170: VCS page break causes printing of step on top of next page. + // Note that this bug fix for WCN was commented out. Harry Julian wanted this on 11/15/19. A new bug will be written for the WCN error. + // B2019-173 reintroduced this line: + && !myPara.MyItemInfo.IsHigh) { //_MyLog.WarnFormat("\r\nMyParaBreak {0},{1},{2},{3},{4}", myPara, myPara.YSize, yUpperLimit, myPara.ChildrenRight[0].YSize, spaceOnPage); if (myPara != lastBreak) @@ -1739,10 +1739,10 @@ namespace Volian.Print.Library //while (myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent; while (myPara.MyParent != null && myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent; int everyNLines = myPara.MyItemInfo.MyPrevious != null && myPara.MyItemInfo.FormatStepData == null ? 1 : myPara.MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; - bool inSameBox = InSameBox(myPara, minPara2); // if this note/caution is in same box as the break, don't break within the notes/cautions in the same box + bool inSameBox = InSameBox(myPara, minPara2); // if this note/caution is in same box as the break, don't break within the notes/cautions in the same box if (!inSameBox && myPara.ChildrenAbove.Count == 0 && wcnChkLstBorder - yLocation < yUpperLimit + yAddForBtmMsg || (everyNLines != 99 && (wcnChkLstBorder - yLocation == yUpperLimit + yAddForBtmMsg))) // Fix for OFN-RJ-23 - //if (-yLocation < yUpperLimit) // Before - //if (-yLocation < yWithinMargins && myList[stepLevel][yLocation].MyItemInfo.MyPrevious != null) + //if (-yLocation < yUpperLimit) // Before + //if (-yLocation < yWithinMargins && myList[stepLevel][yLocation].MyItemInfo.MyPrevious != null) { //ItemInfo prev = myList[stepLevel][yLocation].MyItemInfo.MyPrevious; //if (myList[stepLevel][yLocation].MyItemInfo.ItemID == 5609) Console.WriteLine("aer"); @@ -1768,7 +1768,7 @@ namespace Volian.Print.Library } } // B2019-103, B2019-114 Break at a step if the step will fit on a page by itself and it will - // not fit in the current page + // not fit in the current page float yAdjustLastSubStep = 0; if ((myPara.MyItemInfo.ActiveParent as ItemInfo).IsHigh && myPara.MyItemInfo.NextItem == null) { @@ -1779,8 +1779,8 @@ namespace Volian.Print.Library _MyLog.WarnFormat("Last Substep will fit on page by itself {0}", myPara.MyItemInfo.ShortPath); // add information in the error log } if (StepWillFitOnBlankPageButNotOnCurrentPage(myPara, yLocation, yStart, fullPage + yAdjustLastSubStep)) - if (myPara != lastBreak) - return myPara; + if (myPara != lastBreak) + return myPara; // If this item will not fit on the current page, put a page break if (myPara.YBottom - myPara.YTop > (yUpperLimit + yLocation)) if (myPara != lastBreak) @@ -1800,7 +1800,7 @@ namespace Volian.Print.Library } } //DebugPagination.Write(minBuff.ToString()); - if (-yLocationMin > yUpperLimit && minPara2 != null) minPara = null; + if (-yLocationMin > yUpperLimit && minPara2 != null) minPara = null; // if breaking at a note/caution - don't break within the same box. Clear minPara (like code above) // so that minPara2 is used. @@ -1816,7 +1816,7 @@ namespace Volian.Print.Library DebugPagination.WriteLine("B2020-148 {0}", minPara2); _MyLog.WarnFormat("\r\n+++ Paginagion Change B2020-148 {0}", minPara2); } - return minPara ?? minPara2; + return minPara ?? minPara2; } // B2020-013 premature break in RNO column - Callaway OTO-AC-00002 step 2 @@ -1824,7 +1824,7 @@ namespace Volian.Print.Library // B2020-073 was not keeping all of RNO sub-step together - Comanche Peak FRC-0.1 (unit 1) Step 14 // B2020-081 was breaking on an AER substep that has an long RNO - should keep AER substep and part of RNO on the page = D.C. Cook "Current (Post FLEX) U1 NOP NOT [EOPs]" set, ES-0.1 step 1. // B2020-085 was breaking first child of second RNO (third IF in RNO) - should break on second child of second RNO - D.C. Cook AOP Unit 1 002-020 Step 15 - // B2020-099 was breaking on last sub-step of previous RNO - Calvert Approved Procedures; Abnormal Procedures <20> Unit 2; AOP-2A; Section VII; Step 11.RNO.11.1.c + // B2020-099 was breaking on last sub-step of previous RNO - Calvert Approved Procedures; Abnormal Procedures – Unit 2; AOP-2A; Section VII; Step 11.RNO.11.1.c private vlnParagraph HasSecondRNOThatWillFit(float yStart, float yLowerLimit, float yUpperLimit, StepLevelList myList, int stepLevel, float yTop) { // B2020-120: for calvert alarms/condition response table, don't run code for second rno @@ -1836,7 +1836,7 @@ namespace Volian.Print.Library return this; // see if there is a second RNO then see if it will fit on the page vlnParagraph tmp = this; - while (!tmp.MyItemInfo.IsRNOPart && tmp.MyParent != null) tmp = tmp.MyParent; // if on a substep of an RNO, move up the substep's parent (RNO) + while (!tmp.MyItemInfo.IsRNOPart && tmp.MyParent!=null) tmp = tmp.MyParent; // if on a substep of an RNO, move up the substep's parent (RNO) vlnParagraph parent = tmp; while (parent.MyParent != null && !parent.MyParent.MyItemInfo.IsSection) parent = parent.MyParent; // this will take us to the High level step float yTopParent = parent.YTopMost; // this is where the HLS starts printing @@ -1875,13 +1875,13 @@ namespace Volian.Print.Library return maxBottomMost; } - private static bool StepWillFitOnBlankPageButNotOnCurrentPage(vlnParagraph myPara, float yLocation, float yStart, float fullPage) + private static bool StepWillFitOnBlankPageButNotOnCurrentPage(vlnParagraph myPara, float yLocation, float yStart,float fullPage) { // B2019-150 & B2019-151 Pagination Bugs Seen for Summer EOP4.1 Step 10 and // SAG Step 9. Added format flag to limit when this logic would be used. if (myPara.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnStepThatWillFitOnBlankPage == false) return false; - float spaceOnCurrentPage = fullPage - (-yLocation + yStart); + float spaceOnCurrentPage = fullPage - (-yLocation+yStart); // B2019-124 - Pagination - if substep will fit on a blank page but will not fit on the current page // And is not the first substep then break // B2019-130 - in Calvert data (FSG-1 Appendix 1 Unit 1 Actions, step E.1.g) the THEN sub step was placed on the next page @@ -1927,7 +1927,7 @@ namespace Volian.Print.Library if (myPara.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertPagination) return (myPara.YOffset <= myParaBreak.YOffset && (myPara.YOffset + myPara.Height) >= myParaBreak.YOffset); - return (myPara.YOffset == myParaBreak.YOffset); + return(myPara.YOffset == myParaBreak.YOffset); } private bool HasAncestor(vlnParagraph myParaBreak) { @@ -1982,7 +1982,7 @@ namespace Volian.Print.Library tsa = MyGrid.SpaceAvailable + MyGrid.LeadingSpaceAvailable; if (btmRight != 0) { - //_MyLog.WarnFormat("Item={00}, B={1} BR={2} T={3} TR={4}",MyItemInfo.ItemID , btm, btmRight, tsa, tsaRight); + //_MyLog.WarnFormat("Item={00}, B={1} BR={2} T={3} TR={4}",MyItemInfo.ItemID , btm, btmRight, tsa, tsaRight); if (btm < btmRight) tsa = tsaRight; } @@ -1992,7 +1992,7 @@ namespace Volian.Print.Library } public partial class VlnSvgPageHelper : SvgPageHelper { - private bool _OriginalPageBreak; // use 16bit page breaks. + private bool _OriginalPageBreak; // use 16bit page breaks. public bool OriginalPageBreak { get { return _OriginalPageBreak; } diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index e6de52f1..61b32bc1 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -179,10 +179,8 @@ namespace Volian.Print.Library get { return _PDFFile; } set { _PDFFile = value; } } - // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. - // C2024-003 values needed to print individual sections. - private int[] _prtSectID = new int[] { -1, -1, 0 }; - public int[] PrtSectID + private int _prtSectID = -1; + public int PrtSectID { get { return _prtSectID; } set { _prtSectID = value; } @@ -325,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, int[] PrtSectID = null) + ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, int removeTrailngHardReturnsAndManualPageBreaks, string blankPageText, bool didAll, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1) { Prefix = prefix; // RHM20150506 Multiline ItemID TextBox _MyItem = myItem; @@ -343,8 +341,6 @@ namespace Volian.Print.Library _BatchPrint = batchPrint; _MyReaderHelper = new ReaderHelper(this); _SaveLinks = saveLinks; - // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. - _prtSectID = PrtSectID; // C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. if (removeTrailngHardReturnsAndManualPageBreaks == 1 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveTrailingHardReturnsAndSpaces = new List(); if (removeTrailngHardReturnsAndManualPageBreaks == 2 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveManualPageBreaks = new List(); @@ -352,7 +348,8 @@ namespace Volian.Print.Library _DidAll = didAll; _MergeNotIncluded = false; _MergedPdf = mergedPdf; - + _prtSectID = PrtSectID; + //_MyReaderHelper.LoadTree(myItem); } // Pass 1 PDF Name private string _BeforePageNumberPdf = null; @@ -371,11 +368,11 @@ namespace Volian.Print.Library // B2019-152: MergedLandscapePages is a dictionary whose key is the pdf file name & values are all of the page numbers // 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, int[] PrtSectID = null) + public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary, int PrtSectID = -1) { if (_MyItem is ProcedureInfo) { - _prtSectID = PrtSectID; // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. + _prtSectID = PrtSectID; ProcedureConfig pcfg = (ProcedureConfig)(_MyItem as ProcedureInfo).MyConfig; if (DidAll && pcfg.Print_NotInMergeAll) // will be merging a pdf, so don't print this procedure if user set that on procedure propertures { @@ -807,46 +804,23 @@ namespace Volian.Print.Library VlnItextFont.RegisterFontFolder(); //B2019-174 register the font folder so that symbols will display on auto TOC if (myProcedure.Sections != null) { - SectionInfo CurSection = null; // C2024-003 detrimine if the user in printing a sub section. - if (Convert.ToBoolean(PrtSectID[2])) // If section is a CurSection retrieved the CurSection. - { - foreach (SectionInfo si2 in myProcedure.Sections) - { - if (si2.ItemID == PrtSectID[0]) - { - foreach (SectionInfo subsi in si2.Sections) // Find Parent Section - { - if (subsi.ItemID == PrtSectID[1]) // Find sub section - { - CurSection = subsi; // Assign the subsection object to CurSection. - } - } - } - } - } int cnt = 0; foreach (SectionInfo mySection in myProcedure.Sections) { - if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0])) // C2024-003 check if the user is printing a section + if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID)) { - - if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection. CurSection contains any type of section. + if (!mySection.MyDocStyle.IsStepSection && !mySection.IsAutoTOCSection) { - CurSection = mySection; // if section is not a sub section. - } - - if (!CurSection.MyDocStyle.IsStepSection && !CurSection.IsAutoTOCSection) - { - VEPROMS.CSLA.Library.Document.ConvertWordSectionToDOCX((ItemInfo)CurSection); // B2023-093 Convert a Word section to the DOCX Word format if needed before printing + 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 && (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y") - || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y")) + if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y") + || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y")) { // if floating foldouts, need a list of sections & foldoutreaders. Just do first for now. - _MyFoldoutSection.Add(CurSection); - string foldoutPdf = PrintProcedureOrFoldout(myProcedure, CurSection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false, false); + _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++; } @@ -977,67 +951,44 @@ namespace Volian.Print.Library string clr = pc.GetValue("PSI", "WATERMARKOVERRIDECLR"); if (clr != null && clr != "") WatermarkOverrideColor = clr.ToUpper().Contains("DEFAULT") ? "BLUE" : clr; } - - SectionInfo CurSection = null; // C2024-003 detrimine if the user is printing a sub section.1639 - if (Convert.ToBoolean(PrtSectID[2])) - { - foreach (SectionInfo si2 in myProcedure.Sections) // Find parent section. - { - if (si2.ItemID == PrtSectID[0]) - { - foreach (SectionInfo subsi in si2.Sections) // Find selected sub section. - { - if (subsi.ItemID == PrtSectID[1]) - { - CurSection = subsi; // Assign sub section object to CurSection. - } - } - } - } - } foreach (SectionInfo mySection in myProcedure.Sections) { - if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0])) - { - if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection - { - CurSection = mySection; - } - - // B2020-115 Calculate maximum available space on a page for figures - vlnParagraph.hMax = ((float)CurSection.MyDocStyle.Layout.PageLength); - vlnParagraph.wMax = ((float)CurSection.MyDocStyle.Layout.PageWidth) - ((float)CurSection.MyDocStyle.Layout.LeftMargin - 12); + 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 = (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box + bool isFoldoutSection = (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box if (((isFoldoutSection && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts) || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection)) != doingFoldout) continue; - if (myFoldoutSection != null && myFoldoutSection.ItemID != CurSection.ItemID) continue; - PrintOverride.CompressSuper = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper; - PrintOverride.CompressSub = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub; - PrintOverride.CompressPropSubSup = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup; + 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((CurSection.DisplayNumber ?? "") == "" ? CurSection.DisplayText : CurSection.DisplayNumber, PromsPrinterStatusType.Progress, progress++); + OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++); // Set up Helper for the particular Section if (_MyHelper == null) { - LastFmtName = CurSection.ActiveFormat.Name; - lastDocStyle = (int)CurSection.MyDocStyle.Index; + LastFmtName = mySection.ActiveFormat.Name; + lastDocStyle = (int)mySection.MyDocStyle.Index; string hlsText = ""; int hlsItemId = 0; - if (CurSection.IsStepSection && CurSection.Steps != null && CurSection.Steps.Count > 0) + if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0) { - hlsItemId = CurSection.Steps[0].ItemID; - hlsText = CurSection.Steps[0].DisplayText; // save the High level step text for use in the page list + 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(CurSection, this, hlsText, hlsItemId, PrtSectID); + 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 (!CurSection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)CurSection, ((CurSection.DisplayNumber ?? "") == "" ? "" : CurSection.DisplayNumber + " - ") + CurSection.DisplayText, null); + if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null); if (DebugOutput) { // 16-bit background @@ -1048,7 +999,7 @@ namespace Volian.Print.Library _MyHelper.BackgroundFile = procedureFileName; float x = 0; float y = 0; - if (!(CurSection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF + if (!(mySection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF { // X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's // characters per inch. @@ -1084,29 +1035,29 @@ namespace Volian.Print.Library { //added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section _MyHelper.MyGaps.Clear(); - //Console.WriteLine("'{0}' PromsPrinter", CurSection.DisplayText); + //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText); // if pagination is separate or we've changed the format, we have not done the first page // (if this format has the useonfirst page docstyle flag) - if (LastFmtName != CurSection.ActiveFormat.Name || lastDocStyle != (int)CurSection.MyDocStyle.Index || CurSection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) + if (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) { _MyHelper.DidFirstPageDocStyle = false; - lastDocStyle = (int)CurSection.MyDocStyle.Index; - LastFmtName = CurSection.ActiveFormat.Name; + lastDocStyle = (int)mySection.MyDocStyle.Index; + LastFmtName = mySection.ActiveFormat.Name; } - if (!CurSection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)CurSection, ((CurSection.DisplayNumber ?? "") == "" ? "" : CurSection.DisplayNumber + " - ") + CurSection.DisplayText, null); - _MyHelper.MySection = CurSection; + 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 (CurSection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList) + if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList) { // get config for section - SectionConfig sc = CurSection.MyConfig as SectionConfig; + SectionConfig sc = mySection.MyConfig as SectionConfig; if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y") { - DocVersionConfig dvc = CurSection.MyDocVersion.MyConfig as DocVersionConfig; + DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig; if (dvc != null) { string phlist = dvc.Print_PhoneList; @@ -1131,13 +1082,13 @@ namespace Volian.Print.Library } _MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID - if (CurSection.IsAutoTOCSection) + if (mySection.IsAutoTOCSection) { if (((cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage) || myProcedure.ProcHasSupInfoData) && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even { InsertBlankPage(cb); } - GenerateTOC(CurSection, myProcedure, cb, _TextLayer); + GenerateTOC(mySection, myProcedure, cb, _TextLayer); // B2020-102: extra page printing after auto TOC for summer. Retested for Farley and was successful also // 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 @@ -1147,21 +1098,21 @@ namespace Volian.Print.Library } else { - if (CurSection.IsStepSection) + if (mySection.IsStepSection) { - if (CurSection.Steps != null && CurSection.Steps.Count > 0) + if (mySection.Steps != null && mySection.Steps.Count > 0) { // get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1) - ItemInfo firstStep = CurSection.Steps[0]; + ItemInfo firstStep = mySection.Steps[0]; // B2019-165 Don't print the duplex foldout (on the back of the page) if the Don't Include Duplex Foldout check box was checked in section properties - if (firstStep.FoldoutIndex() > -1 && (CurSection.MyPrevious == null || !((CurSection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout))) + if (firstStep.FoldoutIndex() > -1 && (mySection.MyPrevious == null || !((mySection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout))) DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages); 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 (CurSection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !CurSection.SearchPrev.MyDocStyle.DontInsertBlankPages) + if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !mySection.SearchPrev.MyDocStyle.DontInsertBlankPages) { // only insert a blank page if this section does not have a foldout (but the procedure as a whole does) // and the checkbox on the print dialog to add blank pages is checked @@ -1173,18 +1124,18 @@ namespace Volian.Print.Library { // If the procedure has supplemental facing pages, but this section does not & it's the first section, // need a blank 'facing page'. Sections after the first will get blank 'facing page' in print's pagination logic - if (SupInfoPrintType == E_SupInfoPrintType.Merge && !CurSection.HasSupInfoSteps && firstStepSec && InsertBlankPages) + if (SupInfoPrintType == E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages) { InsertBlankPage(cb); } } } firstStepSec = false; - CreateStepPdf(CurSection, cb); + CreateStepPdf(mySection, cb); } else { - CreateWordDocPdf(cb, CurSection); + CreateWordDocPdf(cb, mySection); } } _MyHelper.PrintedSectionPage = 0; @@ -1631,44 +1582,19 @@ namespace Volian.Print.Library // C2018-004 create meta file for baseline compares Volian.Base.Library.BaselineMetaFile.WriteLine("TOC Ystart {0} LeftMar {1} ScNmPos {2} ScTtlPos {3} ScPgPos {4}", yPageStart, leftMargin, secNumPos, secTitlePos, secPagePos); bool inGroup = false; - - SectionInfo CurSection = null; // C2024-003 detrimine determine if the user in printing a sub section. - if (Convert.ToBoolean(PrtSectID[2])) - { - foreach (SectionInfo si2 in ii.Sections) // Find parent section. - { - if (si2.ItemID == PrtSectID[0]) - { - foreach (SectionInfo subsi in si2.Sections) // Find sub section. - { - if (subsi.ItemID == PrtSectID[1]) - { - CurSection = subsi; // Assigned sub section object to CurSection. - } - } - } - } - } - foreach (SectionInfo mySection in ii.Sections) { - - if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0])) + if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID)) { - if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection - { - CurSection = mySection; - } - sectCnt++; - SectionConfig sc = CurSection.MyConfig as SectionConfig; - if ((CurSection.MyDocStyle != null && CurSection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y")) - || ((CurSection.MyDocStyle == null || !CurSection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y"))) + 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"))) { // 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 = CurSection as ItemInfo; + ItemInfo iilvl = mySection as ItemInfo; while (!iilvl.IsProcedure) { level++; @@ -1710,7 +1636,7 @@ namespace Volian.Print.Library // 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 = CurSection.MyContent.Number == null || CurSection.MyContent.Number == "" ? " " : CurSection.DisplayNumber;// B2017-019 - process "" in section number + 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)) { @@ -1739,7 +1665,7 @@ namespace Volian.Print.Library // logic put in for V.C. Summer who wants to their auto table of contents to print "OPERATOR ACTIONS" (set in the format) instead of "Procedure Steps" // - note that Summer didn't want to change the section title because they want transition to say "procedure step" for the section title. 03/08/2016 - string tocSecTitle = CurSection.FormattedDisplayText;// B2017-019 - process "" in section title + 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; @@ -1805,7 +1731,7 @@ namespace Volian.Print.Library // 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 && CurSection.MyContent.Text != null && CurSection.MyContent.Text != "") yLocation += (retval - ttlRetval); + if (retval != ttlRetval && mySection.MyContent.Text != null && mySection.MyContent.Text != "") yLocation += (retval - ttlRetval); // retval = the minimum (further down the page) between section number and // title - this accounts for multi line title. @@ -1813,7 +1739,7 @@ namespace Volian.Print.Library lastyLocation = retval; // check that the page number should be in the TOC (some BGE sections do not have the page number) - if (!((CurSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC)) + if (!((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC)) { // add a template for the page number: // if the space character is not null & is not a space, the we've got to put out @@ -1864,8 +1790,8 @@ namespace Volian.Print.Library } // if in the pre-table of content list, just put the page number out as text. // otherwise, add a template _MyHelper.MyTOCPageCounts - string key = "TOC" + CurSection.ItemID.ToString(); - if (CurSection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key)) + 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); @@ -1879,10 +1805,10 @@ namespace Volian.Print.Library //If the format wants single spacing within subsections (2nd level and lower), then need to figure out // spacing (vcb1 table of contents) //bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0) - // && (CurSection.MyParent.IsSection && ((CurSection.Sections != null && CurSection.Sections.Count > 0) || (level > 0 && CurSection.NextItem != null)))) + // && (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null)))) // || didGrp; doSubY = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0) - && (CurSection.MyParent.IsSection && (/* CurSection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205 + && (mySection.MyParent.IsSection && (/* mySection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205 || didGrp; //float spc = (float)(tOfC.TofCLineSpacing ?? 1); if (doSubY) @@ -1911,12 +1837,12 @@ namespace Volian.Print.Library } // C2021-015: Barakah High Level Steps in Table of Contents - check to see if we need to add the high level steps on // table of contents for this section, format flag & section has steps: - if (CurSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCAllowHLS && - CurSection.IsStepSection && CurSection.Steps != null && CurSection.Steps.Count > 0) - yLocation = AddHLSToTOC(tocSection, CurSection, tOfC, cb, yPageStart, yLocation, doSubY, level + 1, adjSecTitlePos); + 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, CurSection, tOfC, cb, yPageStart, yLocation, doSubY); + yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY); if (savYLoc == yLocation) // nothing was outputted i.e. the subsections are not included on the TOC // B2016-205 { if (doSubY && sectCnt == ii.Sections.Count) @@ -3015,39 +2941,17 @@ namespace Volian.Print.Library private void LoadSectionTree(ItemInfo ii) { if (ii.Sections == null) return; // B2021-067 crash on null reference - SectionInfo CurSection = null; - if (Convert.ToBoolean(MyPromsPrinter.PrtSectID[2])) // C2024-003 determine if the user is printing a sub section. If so assign it to CurSection. - { - foreach (SectionInfo si2 in ii.Sections) // Find parent section - { - if (si2.ItemID == MyPromsPrinter.PrtSectID[0]) - { - foreach (SectionInfo subsi in si2.Sections) // Find sub section. - { - if (subsi.ItemID == MyPromsPrinter.PrtSectID[1]) - { - CurSection = subsi; // Assign sub section object to CurSection. - break; - } - } - } - - } - } foreach (SectionInfo si in ii.Sections) - if (MyPromsPrinter.PrtSectID[0] == -1 || (MyPromsPrinter.PrtSectID[0] > -1 && si.ItemID == MyPromsPrinter.PrtSectID[0])) + { + if (MyPromsPrinter.PrtSectID == -1 || (MyPromsPrinter.PrtSectID > -1 && si.ItemID == MyPromsPrinter.PrtSectID)) { - if (!Convert.ToBoolean(MyPromsPrinter.PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection + if (si.IsStepSection) { - CurSection = si; - } - if (CurSection.IsStepSection) - { - if (CurSection.Sections != null) LoadSectionTree(CurSection); + if (si.Sections != null) LoadSectionTree(si); } else { - MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(CurSection); + MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(si); if (MyPdfFile != null) { try @@ -3056,18 +2960,18 @@ namespace Volian.Print.Library 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(CurSection.DisplayNumber + " " + CurSection.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(si.DisplayNumber + " " + si.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null; string key = string.Empty; for (int i = 1; i <= MyReader.NumberOfPages; i++) { - key = string.Format("{0}.{1}", CurSection.ItemID, i); + key = string.Format("{0}.{1}", si.ItemID, i); dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i)); 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 (!((CurSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width) + if (!((si.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width) rectgl = new iTextSharp.text.Rectangle(rectgl.Height, rectgl.Width); dicSize.Add(key, rectgl); //dicSize.Add(key, MyReader.GetPageSizeWithRotation(i)); @@ -3077,41 +2981,41 @@ namespace Volian.Print.Library { 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}", CurSection.ItemID, CurSection.DisplayNumber, CurSection.DisplayText), ex); + _MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", si.ItemID, si.DisplayNumber, si.DisplayText), ex); } } } - } + } + } } } + //public class PrintTimer + //{ + // private DateTime _StartTime = DateTime.Now; + + // public DateTime StartTime + // { + // get { return _StartTime; } + // set { _StartTime = value; } + // } + // private string _Description = "Start"; + // public string Description + // { + // get { return _Description; } + // set + // { + // DateTime dtNext = DateTime.Now; + // //Console.WriteLine("{0},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - LastTime.Ticks).TotalSeconds, Description); + // _Description = value; + // _LastTime = dtNext; + // } + // } + // private DateTime _LastTime = DateTime.Now; + // public DateTime LastTime + // { + // get { return _LastTime; } + // set { _LastTime = value; } + // } + //} } -//public class PrintTimer -//{ -// private DateTime _StartTime = DateTime.Now; - -// public DateTime StartTime -// { -// get { return _StartTime; } -// set { _StartTime = value; } -// } -// private string _Description = "Start"; -// public string Description -// { -// get { return _Description; } -// set -// { -// DateTime dtNext = DateTime.Now; -// //Console.WriteLine("{0},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - LastTime.Ticks).TotalSeconds, Description); -// _Description = value; -// _LastTime = dtNext; -// } -// } -// private DateTime _LastTime = DateTime.Now; -// public DateTime LastTime -// { -// get { return _LastTime; } -// set { _LastTime = value; } -// } -//} - diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index cf3cc0f5..ea078716 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -12,7 +12,7 @@ using Volian.Base.Library; namespace Volian.Print.Library { - public partial class VlnSvgPageHelper : SvgPageHelper + public partial class VlnSvgPageHelper:SvgPageHelper { private float _TableAdjustment = 0;// RHM20150525 - Table Scrunch public float TableAdjustment @@ -52,14 +52,14 @@ namespace Volian.Print.Library private float? _BottomContent = null;// RHM20150525 - Table Scrunch public float? BottomContent { - get - { - return _BottomContent; + get + { + return _BottomContent; } - set - { - if (value == null || _BottomContent == null || _BottomContent > value) - _BottomContent = value; + set + { + if(value == null || _BottomContent == null || _BottomContent > value) + _BottomContent = value; } } private PageBookmarks _PageBookmarks = new PageBookmarks(); @@ -85,45 +85,43 @@ namespace Volian.Print.Library get { return _TopMessage; } set { _TopMessage = value; } } - // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag. - // C2024-003 values needed to print section. - private int[] _prtSectID = new int[] { -1, -1, 0 }; - public int[] PrtSectID + 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) + private List _TopMessageRs=new List(); // Added if there are 2 messages, in AER AND RNO (for BGE) public List TopMessageRs { get { return _TopMessageRs; } set { _TopMessageRs = value; } } - private List _TopMessageSub1s = new List(); // BGE Alarms: in CONDITION/RESPONSE if break within substep + private List _TopMessageSub1s=new List(); // BGE Alarms: in CONDITION/RESPONSE if break within substep public List TopMessageSub1s { get { return _TopMessageSub1s; } set { _TopMessageSub1s = value; } } - private List _TopMessageSub2s = new List(); // BGE Alarms: in CONDITION/RESPONSE if break within substep + private List _TopMessageSub2s=new List(); // BGE Alarms: in CONDITION/RESPONSE if break within substep public List TopMessageSub2s { get { return _TopMessageSub2s; } set { _TopMessageSub2s = value; } } - private List _BottomMessage = new List(); // B2017-203) any continuous sections with end messages may have more than 1 message on a page + private List _BottomMessage = new List(); // B2017-203) any continuous sections with end messages may have more than 1 message on a page public List BottomMessage { get { return _BottomMessage; } set { _BottomMessage = value; } } - private vlnText _BottomMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE) + private vlnText _BottomMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE) public vlnText BottomMessageR { get { return _BottomMessageR; } set { _BottomMessageR = value; } } - private vlnText _BottomMessageA; // Added if there are 3 messages, at bottom AND in AER AND RNO (for BGEALARMS) + private vlnText _BottomMessageA; // Added if there are 3 messages, at bottom AND in AER AND RNO (for BGEALARMS) public vlnText BottomMessageA { get { return _BottomMessageA; } @@ -188,12 +186,12 @@ namespace Volian.Print.Library public PdfWriter MyPdfWriter { get { return _MyPdfWriter; } - set + set { MyPageCounts = new PageCounts(); MyTOCPageCounts = new PageCounts(); MyTOCPageNums = new Dictionary(); - _MyPdfWriter = value; + _MyPdfWriter = value; } } private PdfContentByte _MyPdfContentByte; @@ -228,7 +226,7 @@ namespace Volian.Print.Library // when false, no page has been printed yet (for determining whether a blank page before print // needs done if first section has foldouts) private bool _PrintedAPage = false; - public bool PrintedAPage + public bool PrintedAPage { get { return _PrintedAPage; } set { _PrintedAPage = value; } @@ -268,7 +266,7 @@ namespace Volian.Print.Library //Console.WriteLine("End {0}",path); int profileDepth = ProfileTimer.Push(">>>> OnEndPage"); InitialsPrinted = false; - MyPromsPrinter.OnStatusChanged(string.Format("Page {0}", CurrentPageNumber + 1)); + MyPromsPrinter.OnStatusChanged(string.Format("Page {0}", CurrentPageNumber+1)); // B2019-152: Landscape page merged page numbers if (this.MySection != null && MySection.MyDocStyle.LandscapePageList) PromsPrinter.AddMergedLandscapePage(this, MyPromsPrinter.PDFFile); bool onBlankPage = OnBlankPage; @@ -289,15 +287,15 @@ namespace Volian.Print.Library { DrawRuler(writer.DirectContent); float x = MySection == null ? 555 : (float)MySection.MyDocStyle.Layout.PageWidth; - DrawBottomRuler(writer.DirectContent, x / 2 - 144); //aer column - DrawBottomRuler(writer.DirectContent, x - 144); //rno column + DrawBottomRuler(writer.DirectContent, x / 2 - 144); //aer column + DrawBottomRuler(writer.DirectContent, x - 144); //rno column } } else { - E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence ?? 0; + E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0; // if a foldout is only printing within its section, don't do increments on pagecounts: - if (numseq == E_NumberingSequence.WithinEachSection) + if (numseq==E_NumberingSequence.WithinEachSection) MyPageCounts.CanIncrement = false; else MyPageCounts.CanIncrement = true; @@ -307,7 +305,7 @@ namespace Volian.Print.Library } // added the check for onBlankPage and Foldouts to fix bug found in V.C. Summer auto table of contents - 03/08/2016 //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box - if (!onBlankPage && (MySection.MyDocStyle.StructureStyle.Style == null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0) && + if (!onBlankPage && (MySection.MyDocStyle.StructureStyle.Style==null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0) && !(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (MySection.MyConfig as SectionConfig).Section_IsFoldout == "Y")) CurrentTOCPageNumber++; if (MySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList) @@ -342,12 +340,12 @@ namespace Volian.Print.Library if (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) { - float left = (float)MySection.MyDocStyle.Layout.LeftMargin + 4.40f - 6; // used 4.40 -6 to line up with the macro & not touch two digit sub-step tabs. - float right = (float)MySection.MyDocStyle.Layout.PageWidth - .76f; // used -.76 to make bge alarm lines closest to lining up with macro + float left = (float)MySection.MyDocStyle.Layout.LeftMargin + 4.40f - 6; // used 4.40 -6 to line up with the macro & not touch two digit sub-step tabs. + float right = (float)MySection.MyDocStyle.Layout.PageWidth - .76f; // used -.76 to make bge alarm lines closest to lining up with macro if (AlarmYoffStart > 0) { // draw vertical - either to the alarmyoffend or bottom of page - if (AlarmYoffEnd > 0) // ends on this page. + if (AlarmYoffEnd > 0) // ends on this page. { DrawVertical(writer.DirectContent, left, AlarmYoffStart, AlarmYoffEnd); DrawVertical(writer.DirectContent, right, AlarmYoffStart, AlarmYoffEnd); @@ -405,7 +403,7 @@ namespace Volian.Print.Library cb.LineTo(x, y); cb.Stroke(); } - for (float y = yBottom; y <= yTop; y += 10) + for (float y = yBottom; y <= yTop; y += 10) { float w = 10; if (i % 10 == 0) w = 30; @@ -416,7 +414,7 @@ namespace Volian.Print.Library cb.LineTo(x, y); cb.Stroke(); } - i = 0; +i = 0; cb.Stroke(); cb.RestoreState(); cb.EndLayer(); @@ -428,7 +426,7 @@ namespace Volian.Print.Library if (PageListLayer != null) cb.BeginLayer(PageListLayer); cb.SetColorStroke(new Color(PrintOverride.SvgColor)); cb.SetLineWidth(1.05f); // Tweak the line width to match vlnmacro - //cb.SetColorStroke(lineColor); + //cb.SetColorStroke(lineColor); cb.MoveTo(x, top); cb.LineTo(x, bottom); cb.Stroke(); @@ -523,13 +521,13 @@ namespace Volian.Print.Library { if (_MyGaps == null) _MyGaps = new Gaps(); - return _MyGaps; + return _MyGaps; } } public void AddGap(float top, float bottom, float left, float right) { float center = MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0; - if (center == 0) return; + if(center == 0) return; if (center > right || center < left) return; MyGaps.Add(top, bottom); } @@ -580,7 +578,7 @@ namespace Volian.Print.Library if ((MySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) { //Console.WriteLine("{0} ResetDocStyleAndValues", MySection.MyDocStyle.Name); - ItemInfo ii = (ItemInfo)MySection; + ItemInfo ii = (ItemInfo) MySection; int indx = (int)MySection.MyDocStyle.IndexOtherThanFirstPage; foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList) { @@ -616,7 +614,7 @@ namespace Volian.Print.Library cb.SetColorStroke(new Color(System.Drawing.Color.CornflowerBlue)); float yTop = (float)(cb.PdfWriter.PageSize.Height - layout.TopMargin); //Console.WriteLine("Page,yTop,yTopMargin {0},{1},{2}", cb.PdfDocument.PageNumber, yTop, YTopMargin); - if (YTopMargin != null) yTop = (float)YTopMargin; + if(YTopMargin != null) yTop = (float)YTopMargin; float yBottom = (float)(cb.PdfWriter.PageSize.Height - (layout.TopMargin + layout.PageLength)); //Console.WriteLine("'{0}',{1},{2}", MySection.MyDocStyle.Name, yTop, yBottom); cb.MoveTo(x, yTop); @@ -657,14 +655,14 @@ namespace Volian.Print.Library } cb.SetLineWidth(w / 30); i++; - cb.MoveTo(x + w, y - 1); - cb.LineTo(x, y - 1); + cb.MoveTo(x + w, y-1); + cb.LineTo(x, y-1); cb.Stroke(); } cb.SetLineWidth(.1F); cb.Rectangle((float)layout.LeftMargin, yTop, (float)layout.PageWidth - (float)layout.LeftMargin, yBottom - yTop); - float yFooter = yBottom + (float)layout.FooterLength; - cb.MoveTo((float)layout.LeftMargin, yFooter); + float yFooter = yBottom+(float)layout.FooterLength; + cb.MoveTo((float)layout.LeftMargin,yFooter); cb.LineTo((float)layout.PageWidth, yFooter); float yRuler = 612; cb.MoveTo(0, yRuler); @@ -673,17 +671,17 @@ namespace Volian.Print.Library { if (x1 % 72 == 0) { - cb.MoveTo(x1, yRuler - 20); - cb.LineTo(x1, yRuler + 20); + cb.MoveTo(x1, yRuler-20); + cb.LineTo(x1, yRuler+20); } else if (x1 % 36 == 0) { - cb.MoveTo(x1, yRuler - 10); - cb.LineTo(x1, yRuler + 10); + cb.MoveTo(x1, yRuler-10); + cb.LineTo(x1, yRuler+10); } else { - cb.MoveTo(x1, yRuler - 5); + cb.MoveTo(x1, yRuler-5); cb.LineTo(x1, yRuler); } } @@ -722,24 +720,20 @@ namespace Volian.Print.Library foreach (PageBookmark pb in PageBookmarks) { int lev = pb.Level; - if (MyPdfOutlines.Count < lev || lev == 0) + if (MyPdfOutlines.Count < lev || lev==0) { PdfDestination dest = new PdfDestination(PdfDestination.FIT); PdfOutline pdo = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false); - if (!Convert.ToBoolean(_prtSectID[2])) - { - if (MyPdfOutlines.Count == lev) - MyPdfOutlines.Add(pdo); - else - MyPdfOutlines[lev] = pdo; - } - + if (MyPdfOutlines.Count == lev) + MyPdfOutlines.Add(pdo); + else + MyPdfOutlines[lev] = pdo; } else { - PdfDestination dest = pb.PdfDestination; - if (dest == null) dest = new PdfDestination(PdfDestination.FIT); - PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev - 1], dest, Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", string.Empty), false); + PdfDestination dest =pb.PdfDestination; + if(dest==null) dest = new PdfDestination(PdfDestination.FIT); + PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev-1], dest,Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", string.Empty), false); if (MyPdfOutlines.Count == lev) MyPdfOutlines.Add(pdo); else @@ -762,10 +756,10 @@ namespace Volian.Print.Library // to the physical page location. ntfn.YOffset = yTopMargin - myYOff; ntfn.YTopMost = yTopMargin - myYOff; - + ntfn.Processed = false; // process from here - // Only use ParagraphToPdf for printing of a single step. - // This is assuming that footnotes do not have child steps. + // Only use ParagraphToPdf for printing of a single step. + // This is assuming that footnotes do not have child steps. ntfn.ParagraphToPdf(cb, yTopMargin, yTopMargin, tmp); //ntfn.ToPdf(cb, yTopMargin, ref yTopMargin, ref tmp); @@ -850,11 +844,11 @@ namespace Volian.Print.Library // TODO: Pass in zeroes because topdf is inherited. vcb.ToPdf(cb, topMargin, ref tmp, ref tmp); } - _MyChangeBars = new List(); + _MyChangeBars = new List(); } #region SectionLevelData private ChangeBarDefinition _ChangeBarDefinition; - public ChangeBarDefinition ChangeBarDefinition + public ChangeBarDefinition ChangeBarDefinition { get { return _ChangeBarDefinition; } set { _ChangeBarDefinition = value; } @@ -885,8 +879,7 @@ namespace Volian.Print.Library DidFirstPageDocStyle = false; if (DidFirstPageDocStyle) forceLoadSvg = SetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this) - if (_prtSectID[0] > -1) - { + if (_prtSectID > -1) { forceLoadSvg = true; } Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg); @@ -903,7 +896,7 @@ namespace Volian.Print.Library private int _MaxRNO; public int MaxRNO { - get + get { return _MySection.ColumnMode; } @@ -946,7 +939,7 @@ namespace Volian.Print.Library foreach (vlnChangeBar cb in MyChangeBars) { // only look at changebars in same column - if (cb.XOffset == vcb.XOffset) + if (cb.XOffset == vcb.XOffset) { // if the two change bars end at same location, set prevCB which will // adjust the length (top position) of the change bar. This condition @@ -979,7 +972,7 @@ namespace Volian.Print.Library float yChangeBarBottomExtend = prevCB.YChangeBarBottomExtend; prevCB.Height = Math.Max(prevCB.Height, vcb.Height); prevCB.YExtendLine = prevCB.YChangeBarBottom - Math.Min(yChangeBarBottomExtend, vcb.YChangeBarBottomExtend); //Math.Max(prevCB.YExtendLine, vcb.YExtendLine); - // if a change bar message at this ychangebarbottom exists, see which message is used + // if a change bar message at this ychangebarbottom exists, see which message is used if (cbmess != null && prevCB.Messages.ContainsKey(prevCB.YChangeBarBottom)) UpdateCbMessage(cbmess, prevCB, vcb.XOffset); return; } @@ -989,7 +982,7 @@ namespace Volian.Print.Library float yChangeBarBottomExtend1 = prevCB.YChangeBarBottomExtend; prevCB.YChangeBarBottom = Math.Min(prevCB.YChangeBarBottom, vcb.YChangeBarBottom); prevCB.YExtendLine = prevCB.YChangeBarBottom - Math.Min(yChangeBarBottomExtend1, vcb.YChangeBarBottomExtend); //Math.Max(prevCB.YExtendLine, vcb.YExtendLine); - // Two messages at this location, determine which one to use + // Two messages at this location, determine which one to use if (cbmess != null && prevCB.Messages.ContainsKey(prevCB.YChangeBarBottom)) UpdateCbMessage(cbmess, prevCB, vcb.XOffset); // no message at this location, just add it. @@ -1024,7 +1017,7 @@ namespace Volian.Print.Library if (cb.MyParent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && (vcb.MyParent.MyItemInfo.IsTable || cb.MyParent.MyItemInfo.IsTable || cb.BottomIsTable)) tolerance *= 1.5f; bool bothFootnotes = cb.MyParent.MyItemInfo.IsFootnote && vcb.MyParent.MyItemInfo.IsFootnote; - if (!bothFootnotes && cb.MyParent.MyItemInfo.MyHLS != null && vcb.MyParent.MyItemInfo.MyHLS != null && + if (!bothFootnotes && cb.MyParent.MyItemInfo.MyHLS != null && vcb.MyParent.MyItemInfo.MyHLS != null && cb.MyParent.MyItemInfo.MyHLS.ItemID != vcb.MyParent.MyItemInfo.MyHLS.ItemID) return false; // cb.Yoffset is within range of vcb: if (cb.YOffset <= vcb.YOffset && @@ -1047,7 +1040,7 @@ namespace Volian.Print.Library set { _MyPromsPrinter = value; } } private int _MyRomanPage = 1; - public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int[] PrtSectID = null) + public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int PrtSectID) : base() { _prtSectID = PrtSectID; @@ -1102,7 +1095,7 @@ namespace Volian.Print.Library } //if (sPag == SectionConfig.SectionPagination.Continuous && !mySection.DidFirstPageDocStyle) return null; if (forceLoad) return mySvg; - if (sPag == SectionConfig.SectionPagination.Continuous) return null; + if (sPag == SectionConfig.SectionPagination.Continuous) return null; return mySvg; } public PageCounts MyPageCounts = null; @@ -1155,7 +1148,7 @@ namespace Volian.Print.Library //string tocKey = "TOC" + MySection.ItemID.ToString(); if (args.MyText.Contains("{PAGE}") || args.MyText.Contains("{OF}")) { - + #region numberingseq /* public enum E_NumberingSequence : uint @@ -1177,8 +1170,8 @@ namespace Volian.Print.Library // default for the key is to make it NumberingSequence. Then handle // specific cases. string key = ((int)MySection.MyDocStyle.NumberingSequence).ToString(); - - E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence ?? 0; + + E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0; //Console.WriteLine("\"{0}\"\t\"{1}\"\t{2}", MySection.DisplayNumber, MySection.DisplayText, numseq); switch (numseq) { @@ -1209,7 +1202,7 @@ namespace Volian.Print.Library key = key + "." + MySection.ItemID; break; case E_NumberingSequence.WithinEachSectionNumber: - key = key + "." + (MySection.DisplayNumber == string.Empty ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber); + key = key + "." + ( MySection.DisplayNumber == string.Empty ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber); break; case E_NumberingSequence.GroupedByLevel: case E_NumberingSequence.Like6_ButDoesntNeedSubsection: @@ -1245,7 +1238,7 @@ namespace Volian.Print.Library if (!args.MyText.StartsWith("Non-printing ")) MyPdfContentByte.AddTemplate(tmp, args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); return string.Empty; } - if (args.MyText.Contains("{FINALPAGE}")) + if (args.MyText.Contains("{FINALPAGE}")) { if (MySection.ItemID == FinalMessageSectionID) { @@ -1288,7 +1281,7 @@ namespace Volian.Print.Library { // If subformat and does not have its own genmac, find an inherited genmac. FormatInfo tmpf = FormatInfo.Get(activeFormat.ParentID); - while (tmpf.FormatID != 1 && (sGenMac == null || sGenMac == string.Empty)) + while (tmpf.FormatID!=1 && (sGenMac==null||sGenMac==string.Empty)) { sGenMac = tmpf.GenMac; tmpf = FormatInfo.Get(tmpf.ParentID); @@ -1339,7 +1332,7 @@ namespace Volian.Print.Library SectionConfig sc = section.MyConfig as SectionConfig; // C2018-004 create meta file for baseline compares Volian.Base.Library.BaselineMetaFile.WriteLine("SecNum=\"{0}\" SecTitle=\"{1}\" DocStyle=\"{2}\" Format=\"{3}\" ItemID={4}", section.DisplayNumber, section.DisplayText, section.MyDocStyle.Name, sc.FormatSelection, section.ItemID); - Volian.Base.Library.BaselineMetaFile.WriteLine(" Pagination=\"{0}\" MSWordPgCnt={1} NumPages={2} WordMargin={3}", sc.Section_Pagination, section.MSWordPageCount, (string.IsNullOrEmpty(sc.Section_NumPages)) ? "0" : sc.Section_NumPages, (string.IsNullOrEmpty(sc.Section_WordMargin)) ? "N" : sc.Section_WordMargin); + Volian.Base.Library.BaselineMetaFile.WriteLine(" Pagination=\"{0}\" MSWordPgCnt={1} NumPages={2} WordMargin={3}", sc.Section_Pagination, section.MSWordPageCount, (string.IsNullOrEmpty(sc.Section_NumPages)) ? "0" : sc.Section_NumPages, (string.IsNullOrEmpty(sc.Section_WordMargin))?"N":sc.Section_WordMargin); if (PgLogicals == null) PgLogicals = new Dictionary(); else PgLogicals.Clear(); @@ -1383,7 +1376,7 @@ namespace Volian.Print.Library } VE_Font useFontForCheckOffHeader = null; - if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag == 0) && (pageItem.Row < 0)))) + if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0)))) { //if (PrevRow > 0) //{ @@ -1397,12 +1390,12 @@ namespace Volian.Print.Library // prevLPI = curLPI; // } //} - // C2019-006 - Moved and modified the RO_Lookup() logic here, before we process the tokens in the page list - // this allows us to use RO_Lookup() in a "PS=" conditional token (is usually a PSI check box) - // A while loop was also added to the we can have more than one call to RO_Lookup() on a pagelist line - // this logic was put in for Barakah Alarms - // Note that each Alarm is defined as its own RO in the Referenced Object database, with multiple return values - // to define the Window ID, Alarm, Source, Setpoint, etc. for example. + // C2019-006 - Moved and modified the RO_Lookup() logic here, before we process the tokens in the page list + // this allows us to use RO_Lookup() in a "PS=" conditional token (is usually a PSI check box) + // A while loop was also added to the we can have more than one call to RO_Lookup() on a pagelist line + // this logic was put in for Barakah Alarms + // Note that each Alarm is defined as its own RO in the Referenced Object database, with multiple return values + // to define the Window ID, Alarm, Source, Setpoint, etc. for example. string pltok = pageItem.Token; while (pltok.Contains("RO_Lookup(")) { @@ -1448,11 +1441,11 @@ namespace Volian.Print.Library int idx = procnum.IndexOf('-'); otherChildUnit = procnum.Substring(0, idx); // we need to get RO info for the Other child applicability - this gets child's number } - ROLookupVal = ROLookup(parts[0], parts[1], string.Empty, otherChildUnit); // will return empty string if alarm point is not found in RO database + ROLookupVal = ROLookup(parts[0], parts[1], string.Empty,otherChildUnit); // will return empty string if alarm point is not found in RO database usePSIvalue = (ROLookupVal != section.MyProcedure.DisplayNumber); // use PSI value if child alarm ID not found or does not match resolved procedure number (alarm point) } // C2021-065 if usePSIvalue is true, then we know alarm point info is not in the RO database, so just use the default (PSI) value - if (usePSIvalue) + if (usePSIvalue) ROLookupVal = parts[2]; // C2021-065 use the value defined in the PSI else ROLookupVal = ROLookup(parts[0], parts[1], parts[2], otherChildUnit); @@ -1483,18 +1476,18 @@ namespace Volian.Print.Library } // C2021-065 (BNPP Alarms format) we are processing a paglist flag (ROLkUpMatch) to determine how to get Alarm Point information // Nothing else is on this page list item, so use "continue" to jump to the next pagelist item as nothing gets printed for this item - if (pageItem.ROLkUpMatch) + if (pageItem.ROLkUpMatch) continue; MatchCollection matches = regexFindToken.Matches(pltok);//(pageItem.Token); if (matches.Count > 0) { - string plstr = string.Empty; + string plstr = string.Empty; // When a pagelist line (row) has more than one token that is resolved to text, each resolved token text was place on top // of each other. Use a temporary string (plstr) to process the pagelist tokens for each pagelist line (row) before adding // it to the svgGroup. - plstr = pltok;//pageItem.Token; - // F2017-046: Remove the '@@' characters that were getting printed on SAMG Sup Info facing pages for Calvert (BGESAM1 format). + plstr = pltok;//pageItem.Token; + // F2017-046: Remove the '@@' characters that were getting printed on SAMG Sup Info facing pages for Calvert (BGESAM1 format). if (MyPromsPrinter.DoingFacingPage && plstr.Contains("@@")) plstr = plstr.Replace("@@", string.Empty); foreach (Match match in matches) { @@ -1526,8 +1519,8 @@ namespace Volian.Print.Library if (relval == "Y") { //svgGroup.Add(PageItemToSvgText(pageItem.Token, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection)); - svgGroup.Add(PageItemToSvgText(pltok, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection)); - plstr = string.Empty; // Clear it so it isn't put out twice (used below) + svgGroup.Add(PageItemToSvgText(pltok, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection)); + plstr = string.Empty; // Clear it so it isn't put out twice (used below) } } } @@ -1538,7 +1531,7 @@ namespace Volian.Print.Library } if (val != null && val != string.Empty && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null); //if (val == null || val == string.Empty) - //val = " "; + //val = " "; if (val == null) val = string.Empty; plstr = plstr.Replace(token, val); @@ -1626,7 +1619,7 @@ namespace Volian.Print.Library } } else - svgGroup.Add(PageItemToSvgText(pageItem, pltok, MySection, supInfoMargAdj)); + svgGroup.Add(PageItemToSvgText(pageItem, pltok, MySection, supInfoMargAdj)); } } // Proms page numbering designed requires a "{PAGE}" token to increment the page counter. So the easiest way @@ -1656,7 +1649,7 @@ namespace Volian.Print.Library private string ROLookup(string accpageid, string multiid, string deflt, string overrideChild) { ROFSTLookup myLookup = MySection.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MySection.MyDocVersion, overrideChild); - + string accpgid = accpageid; ROFSTLookup.rochild roc = myLookup.GetROChildByAccPageID("<" + accpgid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix); @@ -1692,10 +1685,10 @@ namespace Volian.Print.Library public string HLSText { get { return _HLSText; } - set + set { if (_HLSText == string.Empty) - _HLSText = value; + _HLSText = value; } } private string _HLSTAB = string.Empty; @@ -1789,7 +1782,7 @@ namespace Volian.Print.Library plstr = plstr.Replace(token, string.Empty); svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(token), supInfoMargAdj)); break; - case "{PMODEBOX}": // need to set either 1 or 2 depending on number of columns + case "{PMODEBOX}": // need to set either 1 or 2 depending on number of columns case "[PMODEBOX]": string box = "1"; if (_MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.Four) @@ -1831,7 +1824,7 @@ namespace Volian.Print.Library case "[PROCTITLE3]": case "{COVERPROCTITLE}": case "[COVERPROCTITLE]": - int tlen = (token.Contains("COVERPROCTITLE")) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength; + int tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength; //float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12; float linelen = tlen * (float)pageItem.Font.CPI / 12; string title = section.MyProcedure.MyContent.Text; @@ -1859,7 +1852,7 @@ namespace Volian.Print.Library break; case "{TITLE&UNIT}": case "[TITLE&UNIT]": - tlen = (token.Contains("COVERPROCTITLE")) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength; + tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength; linelen = tlen * (float)pageItem.Font.CPI / 12; plstr = SplitTitleAndUnit(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token, plstr); //,rowAdj); break; @@ -1906,8 +1899,8 @@ namespace Volian.Print.Library case "{PDFTime}": plstr = plstr.Replace("{PDFTime}", DateTime.Now.ToString("HH:mm:ss")); break; - // F2023-087: Added PDFDate at PDFTime - note that cannot have multiple tokens in a conditional because of reg expression - // processing. + // F2023-087: Added PDFDate at PDFTime - note that cannot have multiple tokens in a conditional because of reg expression + // processing. case "[PDFDateAtTime]": plstr = plstr.Replace("[PDFDateAtTime]", DateTime.Now.ToString("MM/dd/yyyy") + " at " + DateTime.Now.ToString("HH:mm:ss")); break; @@ -1923,12 +1916,12 @@ namespace Volian.Print.Library if (unitnum.Length > 0) { if (unitnum.Contains("#")) - eopnum = unitnum.Replace("#", eopnum); + eopnum = unitnum.Replace("#", eopnum); if (unitnum.Contains("!")) eopnum = unitnum.Replace("!", unitname); if (eopnum == string.Empty) eopnum = section.MyProcedure.MyContent.Number; - + if (eopnum.ToUpper().Contains(@"") && !section.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle) printsectlevel = false; } - if (MyPromsPrinter.DoingFacingPage) printsectlevel = false; // don't put out section title/number if doing SAMG facing pages + if (MyPromsPrinter.DoingFacingPage) printsectlevel = false; // don't put out section title/number if doing SAMG facing pages if (printsectlevel) { string stitle = section.DisplayText; @@ -1992,11 +1985,11 @@ namespace Volian.Print.Library && token.Contains("ATTACHTITLECONT") && DidFirstPageDocStyle) { string myMsg = section.MyDocStyle.Continue.Top.Message; - if (myMsg != null && myMsg != string.Empty) stitle = stitle + myMsg; + if (myMsg != null && myMsg != string.Empty)stitle = stitle + myMsg; } // B2023-043: Beaver Valley AOP - allow attributes, such as superscript on section titles when printing - if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SectionTitleWithAttributes) - stitle = section.FormattedDisplayText; + if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SectionTitleWithAttributes) + stitle = section.FormattedDisplayText; // B2021-119: large titles on Landscape Word Attachments are printing on 2 lines. // B2022-149: crash on cast if null int? stl = (int?)section.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumberAndTitleLength; @@ -2011,7 +2004,7 @@ namespace Volian.Print.Library plstr = plstr.Replace(token, string.Empty); //svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText)); break; - case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current) starting from a sub-section + case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current) starting from a sub-section case "[METASECTIONTITLE]": if (section.MyParent.IsSection) { @@ -2061,9 +2054,9 @@ namespace Volian.Print.Library // text starts with a ' - ' - remove it. else if (plstr.StartsWith(" - ") && plstr.IndexOf("{SECTIONLEVELTITLE}") == 3) plstr = plstr.Substring(3); - //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber))); - break; - case "{METASECTIONNUMBER}": // This will print the top level section number when starting from a sub-section + //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber))); + break; + case "{METASECTIONNUMBER}": // This will print the top level section number when starting from a sub-section case "[METASECTIONNUMBER]": if (section.MyParent.IsSection) { @@ -2125,12 +2118,12 @@ namespace Volian.Print.Library break; case "{ATTACHNUM}": case "[ATTACHNUM]": - plstr = plstr.Replace(token, "1"); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre) + plstr = plstr.Replace(token, "1"); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre) break; case "{ATTACHNUM1}": case "[ATTACHNUM1]": string numAtt = GetAttachNum1(); - plstr = plstr.Replace(token, numAtt); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre) + plstr = plstr.Replace(token, numAtt); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre) break; case "{CHKOFFHEADING}": case "[CHKOFFHEADING]": @@ -2219,7 +2212,7 @@ namespace Volian.Print.Library // plants that have been delivered - so added special code for BGE. if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) { - if (Regex.IsMatch(procnum.Substring(0, 1), "[A-Za-z]")) + if (Regex.IsMatch(procnum.Substring(0,1),"[A-Za-z]")) plstr = pd.ProcDescr1; else plstr = string.Empty; @@ -2275,12 +2268,12 @@ namespace Volian.Print.Library plstr = plstr.Replace(token, thisDate2.ToString("H:mm")); break; case "{HLRNO}": - plstr = HLRNO == null ? string.Empty : plstr.Replace(token, HLRNO); + plstr = HLRNO==null?string.Empty:plstr.Replace(token, HLRNO); break; case "{HLSTAB}": if (HLSTAB.Contains("{!Clock}")) // F2022-024 replace with the clock symbol defined in GenMac format file { - HLSTAB = HLSTAB.Replace("{!Clock}", string.Empty).TrimStart(" ".ToCharArray()); + HLSTAB = HLSTAB.Replace("{!Clock}",string.Empty).TrimStart(" ".ToCharArray()); svgGroup.Add(PageItemToSvgUse(pageItem, "Clock", supInfoMargAdj)); } plstr = plstr.Replace(token, HLSTAB); @@ -2399,7 +2392,7 @@ namespace Volian.Print.Library } if (token.Contains(@"RO-")) { - plstr = token.Replace("{", string.Empty).Replace("}", string.Empty); + plstr = token.Replace("{",string.Empty).Replace("}",string.Empty); svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection, 0)); } if (token.Contains(@"PS-")) @@ -2414,7 +2407,7 @@ namespace Volian.Print.Library { val = procConfig.GetValue("PSI", token.Substring(4, token.Length - 5)); // F2021-034: Resolve applicability unit tokens (not just '') - if (val.ToUpper().Contains("") || val.ToUpper().Contains("") || val.ToUpper().Contains(" 0 || (pageItem.MaxWidthCurPage ?? 0) > 0) + if ((pageItem.MaxWidth ?? 0) > 0 || (pageItem.MaxWidthCurPage ?? 0) > 0) { - int locwid = ((pageItem.MaxWidth ?? 0) > 0) ? (int)pageItem.MaxWidth : (int)pageItem.MaxWidthCurPage; + int locwid = ((pageItem.MaxWidth??0)>0)?(int)pageItem.MaxWidth:(int)pageItem.MaxWidthCurPage; AdjustTopMarginForMultiLinePageListItems = SplitTextMaxWidth(svgGroup, pageItem, val, locwid, token, ref plstr); if ((pageItem.MaxWidthCurPage ?? 0) > 0) AdjustTopMarginForMultiLinePageListItems = 0; } @@ -2568,7 +2561,7 @@ namespace Volian.Print.Library foreach (string line in titleLines) { cnt++; - if (cnt == 1 && yOffset == 0) + if (cnt == 1 && yOffset == 0) plstr = plstr.Replace(match, line); else { @@ -2586,7 +2579,7 @@ namespace Volian.Print.Library } return Math.Max(0, yOffset); } - private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr, int? numAndTitleLen) + private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr,int? numAndTitleLen) { bool includePrecedingText = false; if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty); @@ -2597,7 +2590,7 @@ namespace Volian.Print.Library // This logic does not handle any pagelist tokens following the section title. // "@@" acts like a hanging indent (Calvert) so don't include stuff before the title // For now, made this explicite with the use of SectionLevelTitle - if ((numAndTitleLen != null && numAndTitleLen > 0) && !plstr.Contains("@@") && (plstr.IndexOf("{SECTIONLEVELTITLE}") > 0)) + if ((numAndTitleLen != null && numAndTitleLen > 0) && !plstr.Contains("@@") && (plstr.IndexOf("{SECTIONLEVELTITLE}") > 0)) { int idx = plstr.IndexOf(match); title = plstr.Replace(match, title); // include everthing on this line for splitting @@ -2610,11 +2603,11 @@ namespace Volian.Print.Library // B2022-061: don't print '\line' as part of procedure title in pagelist items. if (match == "{PROCTITLE}") title = title.Replace("\\line ", string.Empty); if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty); // this would have been done in proctitle1 - plstr = plstr.Replace(match, title).Replace("@@", string.Empty); + plstr = plstr.Replace(match, title).Replace("@@",string.Empty); //svgGroup.Add(PageItemToSvgText(pageItem, title)); return plstr; } - + // BGE has a '@@' in its section number/title pagelist item for eops. If the title goes onto two lines, // the '@@' marked the starting location for the title. Process this differently than other split titles: if (plstr.Contains("@@")) @@ -2623,7 +2616,7 @@ namespace Volian.Print.Library return string.Empty; // all resolved pagelist items were already added to svgGroup for printing. } // Otherwise determine how many line to split the text into - List titleLines = Volian.Base.Library.RtfTools.SplitText(title, (includePrecedingText) ? (int)numAndTitleLen : (int)len); + ListtitleLines = Volian.Base.Library.RtfTools.SplitText(title,(includePrecedingText)?(int)numAndTitleLen: (int)len); // Adjust y location based on which pagelist token & how many lines. Proctitle1 is adjusted if // there are more than 2 lines (proctitle1 should have it's own y location that is used if there are 1 or 2 lines.) @@ -2669,11 +2662,11 @@ namespace Volian.Print.Library public PageItem PIInitials { get { return _PIInitials; } - set + set { if (_PIInitials != null && value == null) _LastPIInitials = _PIInitials; - _PIInitials = value; + _PIInitials = value; } } private PageItem _LastPIInitials = null; @@ -2694,11 +2687,11 @@ namespace Volian.Print.Library get { return _InitialsPrinted; } set { _InitialsPrinted = value; } } - public bool PrintInitials(PdfContentByte cb, float yLocation, float leftMargin) + public bool PrintInitials(PdfContentByte cb,float yLocation, float leftMargin) { if (InitialsPrinted) return false; InitialsPrinted = true; - vlnParagraph.TextAt(cb, this, PIInitials ?? LastPIInitials, yLocation, leftMargin); + vlnParagraph.TextAt(cb,this, PIInitials ?? LastPIInitials, yLocation, leftMargin); return true; } private void DoSpecialSectNumTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr) @@ -2787,7 +2780,7 @@ namespace Volian.Print.Library } // if the token was proctitle, dont' adjust. If the token was PROCTITLE1/2 then // move down 6. - // int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6; +// int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6; int adj = (titleLines.Count > 2) ? -6 : 0; float yOffset = adj * (titleLines.Count - 2); int lnCnt = 0; @@ -2860,7 +2853,7 @@ namespace Volian.Print.Library // Take the difference between the width in Points of a character at 12CPI and a character // at the defined font's CPI. Multiply that times the length of title and divide by two // to find the half-way point. - + // if the PageItem's font CPI is null, then default to 12 CPI colAdj16bit = (1 + text.Length) * ((72 / (float)(pageItem.Font.CPI ?? 12)) - (72 / 12)) / 2; } @@ -2884,11 +2877,11 @@ namespace Volian.Print.Library } // F2023-035: WCN - allow for change in left margin for supplemental information pages by // setting a value in the DocStyle for the adjustment. - svgText.X = new SvgMeasurement((float)lcol - colAdj16bit + supmargadj, E_MeasurementUnits.PT); // F2023-035: Add in supplemental info margin adjust + svgText.X = new SvgMeasurement((float)lcol - colAdj16bit + supmargadj, E_MeasurementUnits.PT); // F2023-035: Add in supplemental info margin adjust svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT); if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace - // C2018-004 create meta file for baseline compares - Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text)); + // C2018-004 create meta file for baseline compares + Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text)); return svgText; } // F2021-070 & 066 - shrink font size of page list items if format has amount. ShrinkIt compares size (width) of text with input font and @@ -2975,7 +2968,7 @@ namespace Volian.Print.Library svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT); svgText.Y = new SvgMeasurement((float)(yOffset + pageItem.Row ?? 0), E_MeasurementUnits.PT); if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace - // C2018-004 create meta file for baseline compares + // C2018-004 create meta file for baseline compares Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text)); return svgText; } @@ -3022,8 +3015,8 @@ namespace Volian.Print.Library svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT); svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT); if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace - // C2018-004 create meta file for baseline compares - Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text)); + // C2018-004 create meta file for baseline compares + Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text)); return svgText; } private static List _MissingTokens = new List(); @@ -3035,7 +3028,7 @@ namespace Volian.Print.Library return CurrentPageNumber.ToString(); case "{OF}": // Total Page Count for this section return CurrentPageOf.ToString(); - case "{REV}": // Revision Number and/or Revision string. + case "{REV}": // Revision Number and/or Revision string. case "{REV2}": // The 16bit code has a revision number & then a revision date. This revision date // was actually either a date OR a string. The 32bit code no longer will call this @@ -3046,14 +3039,14 @@ namespace Volian.Print.Library if (Rev != null && Rev != string.Empty) Rev = Rev.TrimStart(" ".ToCharArray()); // Now check the format flags to determine if/how the Rev string should be parsed. - if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/")) + if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/")) || (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && Rev.Contains("\\"))) { int indx = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/'); - if (match.Value == "{REV}") return Rev.Substring(0, indx); - return Rev.Substring(indx + 1); + if (match.Value == "{REV}") return Rev.Substring(0,indx); + return Rev.Substring(indx+1); } - if (match.Value == "{REV}") return Rev; + if (match.Value == "{REV}")return Rev; return System.DateTime.Today.ToShortDateString(); case "{CHKOFFHEADING}": return PageListTopCheckOffHeader; @@ -3116,8 +3109,8 @@ namespace Volian.Print.Library private ItemInfo _MyItemInfo; public ItemInfo MyItemInfo { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } + get { return _MyItemInfo; } + set { _MyItemInfo = value; } } private string _Title; public string Title @@ -3195,7 +3188,7 @@ namespace Volian.Print.Library } /* * could have line thickness (set default from 16-bit), line color (set default as black), line style - */ + */ public ChangeBarDefinition() { } diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index b9ba7b35..761b18e1 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -166,7 +166,7 @@ namespace Volian.Print.Library if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh) { yoff += vlnPrintObject.SixLinesPerInch; - Parent.AdjustForMatchUpRNO = vlnPrintObject.SixLinesPerInch; // B2020-112 + Parent.AdjustForMatchUpRNO = vlnPrintObject.SixLinesPerInch; // B2020-112 } } // if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that @@ -215,7 +215,7 @@ namespace Volian.Print.Library yoff += vlnPrintObject.SixLinesPerInch; } box.YOffset = yoff; - int ln = 1; // a format flag determines whether there is a space before the note/caution. + int ln = 1; // a format flag determines whether there is a space before the note/caution. if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote)) { @@ -267,7 +267,7 @@ namespace Volian.Print.Library box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; // F2021-038: SHE/SHEA format - Less space after boxes if (didSeparateBoxChgYAdjust && childItemInfo.IsStep && childItemInfo.FormatStepData.NoYBxAdjust) yoff -= vlnPrintObject.SixLinesPerInch; - int ln = 1; // a format flag determines whether there is a space before the note/caution. + int ln = 1; // a format flag determines whether there is a space before the note/caution. //if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; if (childItemInfo.MixCautionNotesDiffType()) ln += 2; box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch); @@ -361,9 +361,9 @@ namespace Volian.Print.Library // Third section a step section // skip the logic in the next three lines. (if to else) //if (para.YBottomMost > 0) - yoff = para.YBottomMost; + yoff = para.YBottomMost; //else - //Console.WriteLine("ERROR Would have changed yoff from {0} to zero",yoff); + //Console.WriteLine("ERROR Would have changed yoff from {0} to zero",yoff); } // don't adjust YBottomost until after yoff is set for the RNO Separator para.YBottomMost += para.YBottomMostAdjust; @@ -410,7 +410,7 @@ namespace Volian.Print.Library if (childItemInfo.IsSequential && childItemInfo.NextItem != null && childItemInfo.MyParent.IsHigh && ((childItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.XBlankW1stLevSub) == E_DocStructStyle.XBlankW1stLevSub)) { yoff += vlnPrintObject.SixLinesPerInch; - if (para != null) para.AdjustForXBlankW1stLevSub = vlnPrintObject.SixLinesPerInch; // B2020-112 + if (para != null) para.AdjustForXBlankW1stLevSub = vlnPrintObject.SixLinesPerInch; // B2020-112 } boxHLS = false; lastChild = childItemInfo; @@ -467,8 +467,8 @@ namespace Volian.Print.Library } public partial class vlnParagraph : vlnPrintObject { - // B2020-115 Create Static properties for vlnParagraph to limit the size of a figure and paginate large figures properly onto their own page. - public static float wMax = 0; + // B2020-115 Create Static properties for vlnParagraph to limit the size of a figure and paginate large figures properly onto their own page. + public static float wMax = 0; public static float hMax = 0; private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public override string ToString() @@ -481,7 +481,7 @@ namespace Volian.Print.Library get { return _PageBreakOnStep; } set { _PageBreakOnStep = value; } } - private bool HasCalvertMacro = false; // this step has the Calvert (BGE) Alarm CONDITION/RESPONSE macro associated with it + private bool HasCalvertMacro = false; // this step has the Calvert (BGE) Alarm CONDITION/RESPONSE macro associated with it private float WidthNoLimit = 0; private vlnTable _MyGrid; public vlnTable MyGrid @@ -496,7 +496,7 @@ namespace Volian.Print.Library get { return _IsWordDocPara; } set { _IsWordDocPara = value; } } - public static bool HasPrefPageBreak = false; // use to track page breaks for supp info + public static bool HasPrefPageBreak = false; // use to track page breaks for supp info public bool PrefPageBreak = false; private bool _ShowSectionTitles; public bool ShowSectionTitles @@ -722,7 +722,7 @@ namespace Volian.Print.Library } catch (Exception ex) { - return retval + 2 * SixLinesPerInch; // couldn't print equation, just print 2 blank lines. + return retval + 2 * SixLinesPerInch; // couldn't print equation, just print 2 blank lines. } return retval; } @@ -764,13 +764,13 @@ namespace Volian.Print.Library // count # of '{\par} commands in prefix and suffix. int countLine = 0; string preSuf_Fix = (ii.FormatStepData.Prefix != null && ii.FormatStepData.Prefix != "") ? ii.FormatStepData.Prefix : null; - if (preSuf_Fix != null) countLine++; // account for a line of prefix (if no \par) + if (preSuf_Fix != null) countLine++; // account for a line of prefix (if no \par) // if this is a proportional font, need to 'draw' the prefix/suffix. NOTE that the suffix should // just list the headers and the prefix can be 'empty'. if (ii.FormatStepData.Font.FontIsProportional()) { - float yLocVertLine = yLocation + (lpi * 1.5F); // +(lpi / 2); - // Prefix, i.e. Top line: + float yLocVertLine = yLocation + (lpi * 1.5F); // +(lpi / 2); + // Prefix, i.e. Top line: Paragraph topLeftLine = new Paragraph(bx.BXULC, iSymblFont); Rtf2Pdf.TextAt(cb, topLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); Paragraph topRightLine = new Paragraph(bx.BXURC, iSymblFont); @@ -785,7 +785,7 @@ namespace Volian.Print.Library // Vertical Lines around HLS //int countLine = (int)(this.Height / lpi); - yLocVertLine = yLocation + (lpi / 2);// -(lpi / 2); + yLocVertLine = yLocation + (lpi/2);// -(lpi / 2); for (int i = 0; i < 1; i++) { Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); @@ -844,7 +844,7 @@ namespace Volian.Print.Library } } else - #region OriginalHLS + #region OriginalHLS { int hIndx = preSuf_Fix.IndexOf(@"{\par}"); while (preSuf_Fix != null && hIndx >= 0) @@ -853,7 +853,7 @@ namespace Volian.Print.Library countLine++; } preSuf_Fix = (ii.FormatStepData.Suffix != null && ii.FormatStepData.Suffix != "") ? ii.FormatStepData.Suffix : null; - if (preSuf_Fix != null) countLine++; // account for a line of suffix (if no \par) + if (preSuf_Fix != null) countLine++; // account for a line of suffix (if no \par) hIndx = preSuf_Fix.IndexOf(@"{\par}"); while (preSuf_Fix != null && hIndx >= 0) { @@ -962,7 +962,7 @@ namespace Volian.Print.Library // B2018-033 Account for bottom continue message when seeing if a scrunched table will fit float ySizeBtmCtnMess = GetBottomContinueMessageSize(MyItemInfo.MyDocStyle); // B2018-085 Ignore the bottom continue message if the Table is the last part of the step. - if (ySizeBtmCtnMess > 0 && MyParent.MyItemInfo.IsHigh && YBottomMost == MyParent.YBottomMost) ySizeBtmCtnMess = 0; + if(ySizeBtmCtnMess > 0 && MyParent.MyItemInfo.IsHigh && YBottomMost == MyParent.YBottomMost) ySizeBtmCtnMess = 0; // TableScrunch Phase 1: Is height of table greater than what will fit on current page. if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase1) && heightBefore > (yLocation - (yBottomMargin + ySizeBtmCtnMess))) { @@ -974,10 +974,10 @@ namespace Volian.Print.Library MyPageHelper.TableAdjustment += (heightBefore - heightAfter); MyPageHelper.AdjustedTable = this; // B2020-059 - save the information of the table that is being compressed (used in RTF2PDF.cs TextAt()) MyPageHelper.AdjustedTableYtop = yLocation; // B2020-059 save the top location of the compressed table (used in RTF2PDF.cs TextAt()) - // B2018-092 Determine if the Table is too big by checking it including either 6 LPI or 7 LPI as appropriate + //B2018-092 Determine if the Table is too big by checking it including either 6 LPI or 7 LPI as appropriate if (heightAfter * MyPageHelper.YMultiplier < (yLocation - yBottomMargin - ySizeBtmCtnMess)) { - // B2018-081 - Removed error log message if the code was able to properly adjust the table + // B2018-081 - Removed error log message if the code was able to properly adjust the table //_MyLog.WarnFormat("\r\n==> Table is too big to fit on page, Vertical Padding adjusted to fit in\r\n" + // " [{0}] {1}\r\n" + // " in {2}\r\n" + @@ -1008,7 +1008,7 @@ namespace Volian.Print.Library MyPageHelper.BottomContent = yLocation - (MyGrid.Height + 4) * MyPageHelper.YMultiplier; float retval = Rtf2Pdf.GridAt(cb, MyGrid, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); //B2018-092 Determine if the Table is too big by checking it including either 6 LPI or 7 LPI as appropriate - if ((MyGrid.Height + 4) * MyPageHelper.YMultiplier > (yLocation - yBottomMargin - ySizeBtmCtnMess)) + if ((MyGrid.Height + 4)* MyPageHelper.YMultiplier > (yLocation - yBottomMargin - ySizeBtmCtnMess)) { // B2018-081 Changed the Error Log Message to be more useful when a table is too big. _MyLog.ErrorFormat("\r\n===> Table is too big to fit on page, expect pagination problems in\r\n" + @@ -1017,7 +1017,7 @@ namespace Volian.Print.Library " 3> Height Before={3:N2} Height After={4:N2} SpaceAvailable={5:N2}\r\n" + " 4> ACTION REQUIRED: Table should be restructured or split over multiple pages", MyItemInfo.ItemID, _MyItemInfo.ShortPath, - _MyItemInfo.SearchDVPath.Replace("\a", "/"), heightBefore / 72, MyGrid.Height / 72, (yTopMargin - yBottomMargin) / 72); + _MyItemInfo.SearchDVPath.Replace("\a", "/"), heightBefore/72, MyGrid.Height/72, (yTopMargin - yBottomMargin)/72); //_MyLog.ErrorFormat("<<< ERROR >>> Table is too big to fit on page, expect pagination problems\r\n==>'Table Too Big',{0},'{1}','{2}',{3},{4},{5}" // RHM20150429 - Table Scrunch // , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath, heightBefore, MyGrid.Height, (yTopMargin - yBottomMargin)); } @@ -1060,7 +1060,7 @@ namespace Volian.Print.Library // F2021-042: Added FormatStepData.AlwaysCenter for BNPP1 - Critical Step text always must be centered // B2022-146: Left Justify Note & Caution text that has sub-steps (for Beaver Valley) bool cnWithChildren = !MyItemInfo.IsStepSection && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.CenterOnlyIfNoSubs && MyItemInfo.HasChildren; - if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.CenterOneLineOnly && !cnWithChildren && ((MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null) + if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.CenterOneLineOnly && !cnWithChildren && ((MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null) || MyItemInfo.FormatStepData.SeparateBox || doAlign || MyItemInfo.FormatStepData.AlwaysCenter) && Height < (1.2F * IParagraph.Leading)) IParagraph.Alignment = Element.ALIGN_CENTER; // if this step is centered, but not part of the checklist or valvelist format, use itextsharp to center it. @@ -1119,7 +1119,7 @@ namespace Volian.Print.Library { // B2018-034 The following code previously used IParagraph rather than _IParagraph. See first Comment Chunk chk1 = _IParagraph.Chunks[0] as Chunk; - if (MyItemInfo.MyContent.Text.ToUpper().Contains("LINK:TR") && MyItemInfo.MyContent.ContentTransitionCount == 0) + if (MyItemInfo.MyContent.Text.ToUpper().Contains("LINK:TR") && MyItemInfo.MyContent.ContentTransitionCount==0) Console.WriteLine("Missing Transition {0}", MyItemInfo.ItemID); chk1.SetLocalDestination(string.Format("ItemID={0}", MyItemInfo.ItemID)); // Destination // B2019-052: If multiple ROs/Transitions within a step, each should have a their own link rather than all linking to same thing. @@ -1127,7 +1127,7 @@ namespace Volian.Print.Library // The code that remained here was the code that marks the destination for each step & the code that does the pdf links for // enhanced steps. // Also, the method GetDefaultItemInfo was moved to Rtf2iTextSharp.cs also - it was only called from code that was moved. - + StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config); DVEnhancedDocuments dveds = MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments; foreach (EnhancedDocument ed in sc.MyEnhancedDocuments) @@ -1141,17 +1141,17 @@ namespace Volian.Print.Library MyPageHelper.BottomContent = yLocation - (Height * MyPageHelper.YMultiplier); retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo + string.Format(",YLines = {0}", YSize / SixLinesPerInch), yBottomMargin, MyItemInfo.ItemID); // C2018-004 ItemID for create meta file for baseline compares ProfileTimer.Pop(profileDepth); - if (retval == 0) // problem occurred - paragraph was not able to be printed on page - { // pagination logic needs to be fixed. - // oooooooooooo ooooooooo. o8o . o8o - // `888' `8 `888 `Y88. `"' .o8 `"' - // 888 .ooooo. oooo d8b .ooooo. .ooooo. 888 .d88' .oooo. .oooooooo oooo ooo. .oo. .oooo. .o888oo oooo .ooooo. ooo. .oo. - // 888oooo8 d88' `88b `888""8P d88' `"Y8 d88' `88b 888ooo88P' `P )88b 888' `88b `888 `888P"Y88b `P )88b 888 `888 d88' `88b `888P"Y88b - // 888 " 888 888 888 888 888ooo888 888 .oP"888 888 888 888 888 888 .oP"888 888 888 888 888 888 888 - // 888 888 888 888 888 .o8 888 .o 888 d8( 888 `88bod8P' 888 888 888 d8( 888 888 . 888 888 888 888 888 - // o888o `Y8bod8P' d888b `Y8bod8P' `Y8bod8P' o888o `Y888""8o `8oooooo. o888o o888o o888o `Y888""8o "888" o888o `Y8bod8P' o888o o888o - // d" YD - // "Y88888P' + if (retval == 0) // problem occurred - paragraph was not able to be printed on page + { // pagination logic needs to be fixed. + // oooooooooooo ooooooooo. o8o . o8o + // `888' `8 `888 `Y88. `"' .o8 `"' + // 888 .ooooo. oooo d8b .ooooo. .ooooo. 888 .d88' .oooo. .oooooooo oooo ooo. .oo. .oooo. .o888oo oooo .ooooo. ooo. .oo. + // 888oooo8 d88' `88b `888""8P d88' `"Y8 d88' `88b 888ooo88P' `P )88b 888' `88b `888 `888P"Y88b `P )88b 888 `888 d88' `88b `888P"Y88b + // 888 " 888 888 888 888 888ooo888 888 .oP"888 888 888 888 888 888 .oP"888 888 888 888 888 888 888 + // 888 888 888 888 888 .o8 888 .o 888 d8( 888 `88bod8P' 888 888 888 d8( 888 888 . 888 888 888 888 888 + // o888o `Y8bod8P' d888b `Y8bod8P' `Y8bod8P' o888o `Y888""8o `8oooooo. o888o o888o o888o `Y888""8o "888" o888o `Y8bod8P' o888o o888o + // d" YD + // "Y88888P' ForcePagination(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation, ref retval); } else @@ -1249,7 +1249,7 @@ namespace Volian.Print.Library get { return _PrintHeader; } set { _PrintHeader = value; } } - private bool CalvertPrintedSubSectTitle = false; // B2020-123 + private bool CalvertPrintedSubSectTitle = false; // B2020-123 private static List myAttributes = new List(); private static void AddAttribute(string attr) { @@ -1349,8 +1349,8 @@ namespace Volian.Print.Library } // B2020-115 Limit the figure size to the space available in a page. float mult = 1.0F; - if (Width > (vlnParagraph.wMax - 12)) mult = (vlnParagraph.wMax - 24) / Width; - if (Height > (vlnParagraph.hMax - 36)) mult = Math.Min(mult, (vlnParagraph.hMax - 36) / Height); + if (Width > (vlnParagraph.wMax-12)) mult = (vlnParagraph.wMax-24) / Width; + if (Height > (vlnParagraph.hMax-36)) mult = Math.Min(mult, (vlnParagraph.hMax-36) / Height); if (mult < 1.0F) { Width = Width * mult; @@ -1468,7 +1468,7 @@ namespace Volian.Print.Library // C2018-004 create meta file for baseline compares // B2020-008: removed some code that was causing the header to not get refreshed, and uncommented // out the ResetSvg command below. - Volian.Base.Library.BaselineMetaFile.WriteLine("Reset DocStyle to \"{0}\"", ds.Name); + Volian.Base.Library.BaselineMetaFile.WriteLine("Reset DocStyle to \"{0}\"",ds.Name); MyItemInfo.ActiveSection.MyDocStyle = ds; MyPageHelper.MySection = MyItemInfo.ActiveSection as SectionInfo; MyPageHelper.MySection.MyDocStyle = ds; @@ -1485,7 +1485,7 @@ namespace Volian.Print.Library } // B2020-047 move check of PrintSectionPage to after the ResetSvg // B2020-152 un-did the change for B2020-047 which was put in for Westinghouse. The issue reported for B2020-047 remained corrected - else if (MyPageHelper.PrintedSectionPage > 0) + else if (MyPageHelper.PrintedSectionPage > 0) { MyPageHelper.ResetSvg(); if (MyItemInfo.ActiveSection != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PrintSectOnFirst) == E_DocStructStyle.DSS_PrintSectOnFirst) @@ -1500,7 +1500,7 @@ namespace Volian.Print.Library { ItemInfo itemInfo = tmp; if (itemInfo.IsCautionOrNotePart) itemInfo = itemInfo.ActiveParent as ItemInfo; // if caution/note get to its associated step - itemInfo = itemInfo.ActiveParent as ItemInfo; // don't want this one in the combined tab, start at parent + itemInfo = itemInfo.ActiveParent as ItemInfo; // don't want this one in the combined tab, start at parent // B2018-084: continue message had bullets in it that didn't have correct font. The message should not have had bullets at // all - in the following line, there was an 'if' rather than a 'while' - go up parents until find the correct step type // don't just go up 1 level. @@ -1546,7 +1546,7 @@ namespace Volian.Print.Library return (prTab + thisTab.Trim()).TrimEnd(".".ToCharArray()); } private static bool DoSubs = true; // flag whether to print substeps (don't if doing continued checklist header) - public float AdjustForXBlankW1stLevSub = 0; // B2020-112 this & next line + public float AdjustForXBlankW1stLevSub = 0; // B2020-112 this & next line public float AdjustForMatchUpRNO = 0; protected float _ContinueHeight = 0; public virtual float ContinueHeight @@ -1567,31 +1567,31 @@ namespace Volian.Print.Library } set { _Height = value; } } - // Check if the parent section has both an editable steps section and a sub-section - private bool ParentHasSectionAndSteps() - { - if (!MyItemInfo.ActiveParent.IsSection) return false; - SectionInfo parent = MyItemInfo.ActiveParent as SectionInfo; - bool hasSteps = false; - bool hasSections = false; - foreach (PartInfo pi in parent.MyContent.ContentParts) - { - if (pi.FromType == (int)E_FromType.Step && parent.SectionConfig.SubSection_Edit == "Y") hasSteps = true; - if (pi.FromType == (int)E_FromType.Section) hasSections = true; - } - return hasSteps && hasSections; - } + // Check if the parent section has both an editable steps section and a sub-section + private bool ParentHasSectionAndSteps() + { + if (!MyItemInfo.ActiveParent.IsSection) return false; + SectionInfo parent = MyItemInfo.ActiveParent as SectionInfo; + bool hasSteps = false; + bool hasSections = false; + foreach(PartInfo pi in parent.MyContent.ContentParts) + { + if (pi.FromType == (int)E_FromType.Step && parent.SectionConfig.SubSection_Edit == "Y") hasSteps = true; + if (pi.FromType == (int)E_FromType.Section) hasSections = true; + } + return hasSteps && hasSections; + } public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) { int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.ToPdf"); - if (MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && MyItemInfo.IsSection && ParentHasSectionAndSteps()) - MyPageHelper.BottomMessage.Clear(); // B2017-266 reset the END message on the sub-section + if (MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && MyItemInfo.IsSection && ParentHasSectionAndSteps()) + MyPageHelper.BottomMessage.Clear(); // B2017-266 reset the END message on the sub-section if (MyItemInfo.IsFootnote && Processed) { ProfileTimer.Pop(profileDepth); return yPageStart; } - if (MyItemInfo.IsInSupInfo) // if generating the pdf for supinfos (facing page) pdf, need a different cb to go to that file. + if (MyItemInfo.IsInSupInfo) // if generating the pdf for supinfos (facing page) pdf, need a different cb to go to that file. { MyContentByte = cb; MyPageHelper = null; @@ -1606,9 +1606,8 @@ namespace Volian.Print.Library // don't do the following for the WCN training format: // if parent was continuous & this is separate, don't reset document style to subsection (next page) type // this was putting incorrect pagelist item on parent section's page. This occurred in BGE/OI3 set/OI-7 procedure/10.0 Attachments. - // B2017-273 added a check for Farley format, we don't want the subsection pagelist infor to appear on the parent section page - works with Paginate() logic - (section has steps and a sub-section ex: FNP-2-EEP-0 Attachment 4) - // C2024-003 fixed a null exception bug by changing MyParent.MyItemInfo to MyItemInfo.MyParent. - if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && !MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyItemInfo.MyParent as SectionInfo).IsSeparatePagination() || !(MyItemInfo as SectionInfo).IsSeparatePagination()) + // B2017-273 added a check for Farley format, we don't want the subsection pagelist infor to appear on the parent section page - works with Paginate() logic - (section has steps and a sub-section ex: FNP-2-EEP-0 Attachment 4) + if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && !MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyParent.MyItemInfo as SectionInfo).IsSeparatePagination() || !(MyItemInfo as SectionInfo).IsSeparatePagination()) { MyPageHelper.MySection = MyItemInfo as SectionInfo; MyPageHelper.ResetSvg(); @@ -1655,7 +1654,7 @@ namespace Volian.Print.Library if (DebugText.IsOpen) DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortPath, XOffset, yLocation, yPageStart, YTopMost); int profileDepth1 = ProfileTimer.Push(">>>> vlnParagraph.Paginate"); - int paginate = Paginate(yLocation, yTopMargin, yBottomMargin); + int paginate = Paginate(yLocation, yTopMargin, yBottomMargin); ProfileTimer.Pop(profileDepth1); bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null); bool doSectionTitleContinued = false; // will add " Continued" to the section title if format flag is set @@ -1746,7 +1745,7 @@ namespace Volian.Print.Library } if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) yPageStart -= SixLinesPerInch; - if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep) + if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep) MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; if (CompressFoldout) MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; @@ -1766,10 +1765,10 @@ namespace Volian.Print.Library { // page break here, determine if there is caution/note above where the page break actually needs to go: int aboveSupinfoId = ChildrenAboveHaveSupInfo(); - if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0 && aboveSupinfoId > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId); + if (supInfoSect!=null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0 && aboveSupinfoId > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId); else if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); else MyPromsPrinter.NeedSupInfoBreak = true; - if (supInfoSect != null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); + if (supInfoSect!=null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); } YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); docstyle = MyItemInfo.MyDocStyle; @@ -1783,13 +1782,13 @@ namespace Volian.Print.Library // F2023-015 for Beaver Valley as two sub-sections that are printed continuously followed by a third sub-section printed // with separate pagination. This section type uses a different pagelist for the pages after the first page. // Needed to call ResetDocStyleAndValues to set the new page with the other pagelist sytle. - ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); + ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); RefreshDocStyle(); yTopMargin = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize) - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin; // C2018-003 fixed use of getting the active section // C2020-002 paper size is now set in the format files yBottomMargin = Math.Max(0, yTopMargin - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.PageLength); // C2018-003 fixed use of getting the active section yPageStart = yTopMargin; } - else if (MyItemInfo.IsSection || (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null)) //do not reset for 1st step + else if (MyItemInfo.IsSection || (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null)) //do not reset for 1st step { //Console.WriteLine("'b1',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); @@ -1808,7 +1807,7 @@ namespace Volian.Print.Library // B2018-108 if paginating on first step don't add blank page (it was already added at this point) // B2023-011: Beaver Valley - continuous section printing on its own page throws off CAS/blank pages // added the IsSection check to the else if - else if (PromsPrinter.MyFoldoutReader.Count > 0 && MyPageHelper.MyPromsPrinter.InsertBlankPages && (MyItemInfo.IsSection || (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null))) + else if (PromsPrinter.MyFoldoutReader.Count > 0 && MyPageHelper.MyPromsPrinter.InsertBlankPages && (MyItemInfo.IsSection || (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null))) { // insert a blank page if this step section had a foldout associated and the checkbox // on the print dialog, to add blank pages, is checked AND the page did NOT have a @@ -1830,7 +1829,7 @@ namespace Volian.Print.Library } else { - MyPromsPrinter.InsertBlankPage(cb); // C2019-004: Allow user to define duplex blank page text + MyPromsPrinter.InsertBlankPage(cb); // C2019-004: Allow user to define duplex blank page text } } if (MyItemInfo.MyDocStyle.LandscapePageList) @@ -1844,13 +1843,13 @@ namespace Volian.Print.Library if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CustomSpacing) yPageStart += (float)MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[25].StepLayoutData.STExtraSpace; DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - SectionTopMessage(cb, yTopMargin, yLocation); // does wcntraining & suppinfo section title + SectionTopMessage(cb, yTopMargin, yLocation); // does wcntraining & suppinfo section title if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch); if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, null); // If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it // B2020-164 added check for SpecialCaseCalvert to bypass IsSeparateSubsection STP O-67B-2 step 6.5 - if ((!MyItemInfo.IsSection || MyItemInfo.IsSubsection) && - MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && + if ((!MyItemInfo.IsSection || MyItemInfo.IsSubsection) && + MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || (MyItemInfo.IsSeparateSubsection || MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert))) { // B2020-162 - SpecialCaseCalvert flag affect single column procedures, use SpecialCaseCalvertPagination for Two Column procedures instead @@ -1877,9 +1876,9 @@ namespace Volian.Print.Library case 2: // Break within a Step' if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks) { - if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); + if (supInfoSect!=null&& MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); else MyPromsPrinter.NeedSupInfoBreak = true; - if (supInfoSect != null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); + if (supInfoSect!=null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); } YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); docstyle = MyItemInfo.MyDocStyle; @@ -1911,14 +1910,14 @@ namespace Volian.Print.Library } if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); // B2019-115 Locate Bottom Continue Message below AER Table if necesssary - float bcm_yLocation = TableBottom == -1 ? yLocation : Math.Min(TableBottom, yLocation); + float bcm_yLocation = TableBottom == -1 ? yLocation: Math.Min(TableBottom,yLocation); DoBottomContinueMsg(cb, yBottomMargin, bcm_yLocation, docstyle, doThreeContinues); MyPromsPrinter.NewPage(); // C2018-003 fixed use of getting the active section // F2023-112 Vogtle Units 3 & 4 background document format DSS_PageListBkgndStpContMsg to print continue message next to step number - if (MyItemInfo.IsStep && (MyItemInfo.ActiveSection != null && + if (MyItemInfo.IsStep && (MyItemInfo.ActiveSection != null && ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) || - ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListBkgndStpContMsg) == E_DocStructStyle.DSS_PageListBkgndStpContMsg))) + ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListBkgndStpContMsg) == E_DocStructStyle.DSS_PageListBkgndStpContMsg))) { // check if parent (can be HLS, Caution or Note) has the UseOldTemplate. If so, // flag that a continue message should be printed as part of a pagelist header (if pagelist @@ -1939,7 +1938,7 @@ namespace Volian.Print.Library DebugText.WriteLine("Paginate2"); if (MyItemInfo.MyHLS.FoldoutIndex() > -1) - MyPromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.MyHLS.FoldoutIndex(), false); // temporary foldout + MyPromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.MyHLS.FoldoutIndex(), false); // temporary foldout else if (PromsPrinter.MyFoldoutReader.Count > 0 && MyPageHelper.MyPromsPrinter.InsertBlankPages) { MyPromsPrinter.InsertBlankPage(cb); @@ -2013,7 +2012,7 @@ namespace Volian.Print.Library doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; } } - addExtraLines = SectionTopMessage(cb, yTopMargin, yLocation); // this does wcntraining top section continue message and supplemental info message + addExtraLines = SectionTopMessage(cb, yTopMargin, yLocation); // this does wcntraining top section continue message and supplemental info message if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch); if (!addExtraLines && (!doSectionTitleContinued || !SectionShowTitles)) addExtraLines = DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues && MyItemInfo.MyParent != null && MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.CleanText : null); @@ -2037,7 +2036,7 @@ namespace Volian.Print.Library PartsLeft.Add(vlnm); MyPageHelper.AlarmYoffStart = alrmY - SixLinesPerInch; yPageStart -= (4 * SixLinesPerInch); - if (ChildrenRight.Count > 0 && ChildrenRight[0].ChildrenAbove.Count > 0 && ChildrenRight[0].ChildrenAbove[0].MyItemInfo.IsCautionOrNotePart) + if(ChildrenRight.Count>0 && ChildrenRight[0].ChildrenAbove.Count > 0 && ChildrenRight[0].ChildrenAbove[0].MyItemInfo.IsCautionOrNotePart) yPageStart += (SixLinesPerInch); // B2020-121: Account for Header on Caution or Note } // For Calvert Alarms, if there is no box & this is top of page, if previous step @@ -2048,7 +2047,7 @@ namespace Volian.Print.Library if (MyItemInfo.MyPrevious != null && MyItemInfo.MyPrevious.TemplateIndex > 0 && MyItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[MyItemInfo.MyPrevious.TemplateIndex].hmacro > 0) yPageStart += (3 * SixLinesPerInch); } - // Now check if this is a template type step & if so, add the HLS's prefix/suffix to it. + // Now check if this is a template type step & if so, add the HLS's prefix/suffix to it. // Since the entire checklist HLS (checklist table header) is printed as part of the // continue, create a new paragraph to handle pagination and printing. if (MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate) @@ -2073,17 +2072,17 @@ namespace Volian.Print.Library case 3: // Break on High Level Step (SevenLinesPerInch) if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks) { - if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); + if (supInfoSect!=null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); else MyPromsPrinter.NeedSupInfoBreak = true; - if (supInfoSect != null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); + if(supInfoSect!=null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); } - if (!firstHighLevelStep || (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyPageHelper.CreatingSupInfoPage)) // B2017-229: Added supinfo print check to run facing page logic + if (!firstHighLevelStep || (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyPageHelper.CreatingSupInfoPage)) // B2017-229: Added supinfo print check to run facing page logic { YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); - MyPromsPrinter.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection) - // _MyLog.InfoFormat("NewPage 12 {0}", cb.PdfWriter.CurrentPageNumber); - // Console.WriteLine("'b3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); + MyPromsPrinter.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection) + //_MyLog.InfoFormat("NewPage 12 {0}", cb.PdfWriter.CurrentPageNumber); + //Console.WriteLine("'b3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); //Console.WriteLine("'a3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); DebugText.WriteLine("Paginate3"); @@ -2122,7 +2121,7 @@ namespace Volian.Print.Library titlePrinted &= (ShowSectionTitles && !MyItemInfo.MyDocStyle.CancelSectTitle); } if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null && !titlePrinted) - MyPromsPrinter.InsertBlankPage(cb); + MyPromsPrinter.InsertBlankPage(cb); } } if (MyItemInfo.MyDocStyle.LandscapePageList) @@ -2188,7 +2187,7 @@ namespace Volian.Print.Library vt.XOffset = secContinueTabXoff; vt.Width = secContinueXoff - secContinueTabXoff; sectContPara.XOffset = secContinueXoff; - if ((wd + 12) > secContinueXoff - secContinueTabXoff) // 12 is 2 characters + if ((wd + 12) > secContinueXoff - secContinueTabXoff) // 12 is 2 characters { float dif = wd + 12 - (secContinueXoff - secContinueTabXoff); vt.Width += dif; @@ -2274,7 +2273,7 @@ namespace Volian.Print.Library yPageStart = yPageStartRNO; yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one + if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one { docstyle = MyItemInfo.MyDocStyle; // if the EndForSingle format flag is set to false, then we do not print an End message if the section @@ -2284,7 +2283,7 @@ namespace Volian.Print.Library // B2017-201 if si is null we need to get it via the ItemID if (si == null) si = SectionInfo.Get(MyItemInfo.MyActiveSection.ItemID); // MyActiveSection does not try to resolve anything - ActiveSection is call above and will resolve and set MyActiveSection - bool _skipEndMessage = (si == null || si.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One) && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle; + bool _skipEndMessage = (si == null ||si.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One) && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle; bool _lastSect = true; if (si != null && si.MyActiveParent.IsSection) // is this meta/subsection. Only put end message out on last section { @@ -2312,12 +2311,12 @@ namespace Volian.Print.Library //} //if (foundpar) myMsg = myMsg.Replace("{par}", ""); // use the 'flag' to position the message. - if (docstyle.End.Flag > 2) // >2 position at an absolute location defined by docstyle.End.Flag. + if (docstyle.End.Flag > 2) // >2 position at an absolute location defined by docstyle.End.Flag. { msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch); } float adjMsgY = 0; - if (docstyle.End.Flag < 0) // Adjust this many lines down the page. + if (docstyle.End.Flag < 0) // Adjust this many lines down the page. { adjMsgY = (float)(-docstyle.End.Flag * SixLinesPerInch); if (msg_yLocation - adjMsgY > docstyle.Layout.FooterLength) msg_yLocation = msg_yLocation - adjMsgY; @@ -2415,13 +2414,13 @@ namespace Volian.Print.Library // see if any substeps of this item have supinfo, and if so, return the substep's id int id = GetSubThatHasSupInfoItems(ii, startid); if (id != -1) return id; - if (FoundStepPageBreak) return -1; // Set in GetSubThatHasSupInfoItems + if (FoundStepPageBreak) return -1; // Set in GetSubThatHasSupInfoItems // Now go to the next item, check if it or any of its substeps have supinfo, and if so, return the id ItemInfo sib = ii.NextItem; id = GetIdThatHasSupInfoItemsSibNext(sib, startid); if (id != -1) return id; - if (FoundStepPageBreak) return -1; // Set in GetIdThatHasSupInfoItemsSibNext + if (FoundStepPageBreak) return -1; // Set in GetIdThatHasSupInfoItemsSibNext // B2017-122: if this is a note or caution off substep, check if substep has supinfo: if ((ii.IsNote || ii.IsCaution) && !ii.MyParent.IsHigh) @@ -2429,7 +2428,7 @@ namespace Volian.Print.Library if (ii.MyParent.SupInfos != null && ii.MyParent.SupInfos.Count > 0) return ii.MyParent.SupInfos[0].ItemID; int sbfromNC = GetSubThatHasSupInfoItems(ii.MyParent, startid); if (sbfromNC != -1) return sbfromNC; - if (FoundStepPageBreak) return -1; // Set in GetSubThatHasSupInfoItems + if (FoundStepPageBreak) return -1; // Set in GetSubThatHasSupInfoItems } // Go to the parent, and find its next and check if it or any of its substeps or next steps or any of their substeps have supinfo, @@ -2562,7 +2561,7 @@ namespace Volian.Print.Library else { // B2016-134: Account for section top continue if item has container, i.e. move section top continue message above the container - sectMsgY = CalculateYLocation(YTopMost - (SixLinesPerInch * 3), yTopMargin); // 3 is # of lines: header, box, blank line moving up page + sectMsgY = CalculateYLocation(YTopMost - (SixLinesPerInch * 3), yTopMargin); // 3 is # of lines: header, box, blank line moving up page addextra = true; } VE_Font sctMsgFont = MyItemInfo.MyDocStyle.SectTop.Font; @@ -2732,7 +2731,7 @@ namespace Volian.Print.Library // the second, third, etc background Caution/Note pages begin printing two additional lines from the top of the page // to fix, added a check to see the the item we are printing has the PageBrrakOnStep flag set, if it's set, // then DON'T add two lines to the yPageStart (for the top conitnue message) - if (myMsg != null && myMsg != "" && !MyItemInfo.IsSection && !MyItemInfo.FormatStepData.PageBreakOnStep) // B2020-123 + if (myMsg != null && myMsg != "" && !MyItemInfo.IsSection && !MyItemInfo.FormatStepData.PageBreakOnStep) // B2020-123 { // C2019-044 for BNPP put the top continue message on the same row as the Checkoff/Signoff header // This is done by specifing a row positon in the top continue definition in the format. @@ -2825,9 +2824,9 @@ namespace Volian.Print.Library // Top Continue message includes high level step tab and text if ((docstyle.Continue.Top.HLS ?? 0) == 1) { - myMsg = docstyle.Continue.Top.Message; // reset because we did replace strings in code above - ItemInfo parentStep = MyItemInfo.MyHLS; // get the high level step - myMsg = string.Format(myMsg, parentStep.CombinedTab, parentStep.DisplayTextKeepSpecialChars); + myMsg = docstyle.Continue.Top.Message; // reset because we did replace strings in code above + ItemInfo parentStep = MyItemInfo.MyHLS; // get the high level step + myMsg = string.Format(myMsg, parentStep.CombinedTab, parentStep.DisplayTextKeepSpecialChars); } // B2023-115 Top continue message for Vogtle Alarms: 1st version done on 12/6/23. Changes to logic as per request // from engineering done on 12/12/23. See comment below for logic for 12/12/23 (history of this file has previous @@ -2835,18 +2834,18 @@ namespace Volian.Print.Library if ((docstyle.Continue.Top.HLS ?? 0) == 4) { // Vogtle Alarms: Their alarms are set up differently than standard procedures - the HLS in Vogtle - // alarms is a section in other procedures. The top continue message is shown when a break occurs: - // β€’ A continued message will appear on the top of the page ONLY if the pagination occurs anywhere + // alarms is a section in other procedures. The top continue message is shown when a break occurs: + // • A continued message will appear on the top of the page ONLY if the pagination occurs anywhere // within the first level substep. If, for example, the page break occurs between substep 3 and substep // 4 as in example 2, no continued message will appear on the top of the page. - // β€’ If a continued message is needed, the continued message will include the first level substep number - // if it is a sequential substep, such as β€œ5. (continued)”. If it is NOT a sequential substep, then only - // the word β€œ(continued)” will appear. - // β€’ If a page break occurs between high level steps, such as before β€œCauses:”, then no continued message is needed. + // • If a continued message is needed, the continued message will include the first level substep number + // if it is a sequential substep, such as “5. (continued)”. If it is NOT a sequential substep, then only + // the word “(continued)” will appear. + // • If a page break occurs between high level steps, such as before “Causes:”, then no continued message is needed. bool doMessage = true; - if (MyItemInfo.IsHigh) doMessage = false; // at high, don't do message - if (MyItemInfo.MyParent.IsHigh) doMessage = false; // at first level, don't do message - // Caution/Note on first level, don't do message + if (MyItemInfo.IsHigh) doMessage = false; // at high, don't do message + if (MyItemInfo.MyParent.IsHigh) doMessage = false; // at first level, don't do message + // Caution/Note on first level, don't do message if ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyParent.MyParent.IsHigh) doMessage = false; myMsg = docstyle.Continue.Top.Message; if (doMessage) @@ -2870,7 +2869,7 @@ namespace Volian.Print.Library myMsg = docstyle.Continue.Top.Message; // reset because we did replace strings in code above ItemInfo parentStep = MyItemInfo.MyHLS; string ctab = parentStep.CombinedTab; - if (!MyItemInfo.MyParent.IsHigh) // If lower sub-step, get parent substep tab, skipping caution/note if in one of those + if (!MyItemInfo.MyParent.IsHigh) // If lower sub-step, get parent substep tab, skipping caution/note if in one of those ctab = (MyItemInfo.IsInCautionOrNote) ? MyItemInfo.MyParent.MyParent.CombinedTab : MyItemInfo.MyParent.CombinedTab; myMsg = string.Format(myMsg, ctab, parentStep.DisplayTextKeepSpecialChars); } @@ -2901,22 +2900,21 @@ namespace Volian.Print.Library // CONDITION/RESPONSE table. Messages only get printed if the break is on a substep at steplevel > 2. // see comments within code for what the tab contains, it varies depending on which side // break occurred & how deep in the step the break occurred. - if (subTab != null && MyItemInfo.StepLevel > 2) - { + if (subTab != null && MyItemInfo.StepLevel > 2) { bool incond = !MyItemInfo.IsInRNO; float ybot = yTopMargin + (4 * SixLinesPerInch); - string concatrnoTab = ""; // constructed tab for Response side - string concataerTab = ""; // constructed tab for Condition side - float xoffTab = 0; // position for Response tab - float xoffMsg = 0; // position for Response message - vlnParagraph useAerParaForTab = null; // use this paragraph under Conditions for locating tab & message + string concatrnoTab = ""; // constructed tab for Response side + string concataerTab = ""; // constructed tab for Condition side + float xoffTab = 0; // position for Response tab + float xoffMsg = 0; // position for Response message + vlnParagraph useAerParaForTab = null; // use this paragraph under Conditions for locating tab & message if (incond) { // If break is in Condition side of table, use Condition tab of parent & no tab for Response side. // Both sides have the message '(continued)'. useAerParaForTab = MyParent; concataerTab = MyParent.MyTab != null ? MyParent.MyTab.Text.TrimEnd() : ""; - xoffTab = 0; // no rno tab + xoffTab = 0; // no rno tab xoffMsg = ToInt(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColRTable, 1) + (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ((useAerParaForTab != null && useAerParaForTab.MyTab != null) ? useAerParaForTab.MyTab.Width : 7.2f); } else @@ -2971,9 +2969,9 @@ namespace Volian.Print.Library float colPos = docstyle.Layout.LeftMargin + docstyle.Continue.Top.Margin ?? 0; if (!docstyle.Continue.Top.PlaceAtLeftMargin) //F2019-033 when true position with respect only to the left margin colPos += XOffsetBox; //XOffsetbox get set when the tables, figures & equations were beyond the border and needed repositioned - // C2019-044 for BNPP, put the top continue message on the same row as the checkoff/signoff heading - // RowOverride specifies the position of the top continue message - // For BNPP, RowOverride is set to the same row as the checkoff header is set to in the pagelist + // C2019-044 for BNPP, put the top continue message on the same row as the checkoff/signoff heading + // RowOverride specifies the position of the top continue message + // For BNPP, RowOverride is set to the same row as the checkoff header is set to in the pagelist if (docstyle.Continue.Top.RowOverride != null) { float adjRowPosition = (float)docstyle.Layout.TopMargin - (float)docstyle.Continue.Top.RowOverride; @@ -3033,17 +3031,17 @@ namespace Volian.Print.Library } switch (docstyle.Continue.Bottom.Location) { - case E_ContBottomLoc.EndOfText: // place continue string at end of text + case E_ContBottomLoc.EndOfText: // place continue string at end of text // msg_yLocation accounts for extra lines in message from docstyle; and BottomContent is the actual // location of the last line of text on page. - // msg_yLocation = ((float)(MyPageHelper.BottomContent??0) - (SixLinesPerInch * MyPageHelper.YMultiplier)); // B2018-080 null reference check added + //msg_yLocation = ((float)(MyPageHelper.BottomContent??0) - (SixLinesPerInch * MyPageHelper.YMultiplier)); // B2018-080 null reference check added // B2019-079 changed yLocaton - msg_yLocation to '+'. The msg_ylocation has an adjustment for adding an extra line by moving down the page, this was moving // the line up the page (double negative). msg_yLocation = yLocation + msg_yLocation - (SixLinesPerInch * MyPageHelper.YMultiplier); //B2019-021 yLocation accounts for checkoffs if (yBottomMargin + (docstyle.Layout.FooterLength ?? 0) > msg_yLocation) { // Adjusted Continue Message Y Offset - //DebugPagination.WriteLine("====>> {0},'{1}'", msg_yLocation, MyItemInfo.ShortPath); - //msg_yLocation = (float) MyPageHelper.BottomContent - SixLinesPerInch; // Account for how low the lowest Item is on the page + //DebugPagination.WriteLine("====>> {0},'{1}'", msg_yLocation, MyItemInfo.ShortPath); + //msg_yLocation = (float) MyPageHelper.BottomContent - SixLinesPerInch; // Account for how low the lowest Item is on the page float msg_yLocationOld = msg_yLocation = yBottomMargin + (docstyle.Layout.FooterLength ?? 0); if (MyPageHelper.BottomContent != null) msg_yLocation = Math.Min(yBottomMargin + (docstyle.Layout.FooterLength ?? 0), (float)MyPageHelper.BottomContent - SixLinesPerInch);// RHM20150525 - Table Scrunch @@ -3051,14 +3049,14 @@ namespace Volian.Print.Library _MyLog.WarnFormat("Continue Message Moved from {0} to {1} for {2}", msg_yLocationOld, msg_yLocation, this);// RHM20150525 - Table Scrunch } break; - case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page + case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2); // +SixLinesPerInch; // (need this for IP3) msg_yLocation = Math.Max(msg_yLocation, yBottomMargin + SixLinesPerInch); break; - case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page - // msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin + case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page + //msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin msg_yLocation = msg_yLocation + yBtmMarginForMsg + (float)docstyle.Layout.FooterLength; - // if (MyPageHelper.YMultiplier != 1.0F) msg_yLocation = msg_yLocation / MyPageHelper.YMultiplier; + // if (MyPageHelper.YMultiplier != 1.0F) msg_yLocation = msg_yLocation / MyPageHelper.YMultiplier; break; case E_ContBottomLoc.BelowBottom1: msg_yLocation = msg_yLocation + yBtmMarginForMsg; @@ -3159,7 +3157,7 @@ namespace Volian.Print.Library if (myMsg.IndexOf(@"%3d") > -1) myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString()); // F2020-023: tab includes parent tab and if caution/note don't use its parent, go up another level - if (myMsg.IndexOf(@"%s") > -1) // %s was added for F2020-023 + if (myMsg.IndexOf(@"%s") > -1) // %s was added for F2020-023 { string tmp = tb.Trim(); if (!MyItemInfo.MyParent.IsHigh) @@ -3200,7 +3198,7 @@ namespace Volian.Print.Library get { if (TopMostChild.PartsAbove.Count == 0) return false; - if (TopMostChild.PartsContainer != null && TopMostChild.PartsContainer.Count > 0) return false; // B2016-198: not 'EmptyTopMostPart' if there is a box. + if (TopMostChild.PartsContainer != null && TopMostChild.PartsContainer.Count > 0) return false; // B2016-198: not 'EmptyTopMostPart' if there is a box. foreach (vlnPrintObject po in TopMostChild.PartsAbove) { vlnHeader hd = po as vlnHeader; @@ -3257,7 +3255,7 @@ namespace Volian.Print.Library // B2019-028: see above comment (same check was added) //if (vPara.MyItemInfo.ActiveSection.ItemID == this.MyItemInfo.ActiveSection.ItemID && (this.MyItemInfo.ItemID != vPara.MyItemInfo.ItemID)) // RHM20150507 Table Scrunch - if (this.MyItemInfo.ItemID != vPara.MyItemInfo.ItemID) // B2019-077: see above + if (this.MyItemInfo.ItemID != vPara.MyItemInfo.ItemID) // B2019-077: see above { process.Add(vPara); _MyLog.WarnFormat("New AerRno PageBreak Logic: Step Could Have Fit {0}, {1}", MyItemInfo.ItemID, MyItemInfo.ShortPath); @@ -3279,10 +3277,10 @@ namespace Volian.Print.Library { vPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); // B2019-115 Locate Bottom Continue Message below AER Table if necessary - if (vPara.MyItemInfo.IsTable) + if(vPara.MyItemInfo.IsTable) { if (TableBottom == -1) - TableBottom = (yPageStart - vPara.YOffset) - vPara.Height - SixLinesPerInch; + TableBottom = (yPageStart-vPara.YOffset)-vPara.Height- SixLinesPerInch; else TableBottom = Math.Min(TableBottom, (yPageStart - vPara.YOffset) - vPara.Height - SixLinesPerInch); } @@ -3469,7 +3467,7 @@ namespace Volian.Print.Library foreach (vlnParagraph child in ChildrenBelow) child.BuildLocationList(yTopMost, myLocations); } - private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short) + private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short) private bool IsTitleType(ItemInfo itm) { if (itm.FormatStepData != null && (itm.FormatStepData.Index == 42 || itm.FormatStepData.Index == 43)) return true; @@ -3588,7 +3586,7 @@ namespace Volian.Print.Library if (itemInfo.IsSection && itemInfo.ActiveSection.DisplayText.ToUpper().Contains("") && !itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle) ShowSectionTitles = false; HasIndent = itemInfo.IsStep && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.DontResetIndentOnNewline; - int MetaLevel = 0; // if meta section, stores what level this section is. + int MetaLevel = 0; // if meta section, stores what level this section is. float savCheckListBottomMost = 0; //int[] problemIDs = { 889 }; //List lProblemIDs = new List(problemIDs); @@ -3636,13 +3634,13 @@ namespace Volian.Print.Library // if this is a Note or Caution off of a Note or Caution (Catawba EG/1A/CSAM/SACGR1 step 1) // then indent it the length of its tab if (itemInfo.IsCaution || itemInfo.IsNote) - XOffset += (!itemInfo.IsBackgroundStep()) ? (itemInfo.FormatStepData.TabData.IdentPrint.Length - 1) * 6 : 0; // B2018-139 don't adjust XOffset when processing a Caution, or Note background text is is off of Caution or Note WCN BG SAG-10 step 4 + XOffset += (!itemInfo.IsBackgroundStep()) ? (itemInfo.FormatStepData.TabData.IdentPrint.Length - 1) * 6 : 0; // B2018-139 don't adjust XOffset when processing a Caution, or Note background text is is off of Caution or Note WCN BG SAG-10 step 4 else if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) - XOffset = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset); - else - XOffset += 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); + XOffset = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset); + else + XOffset += 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); } if (itemInfo.IsStep && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && @@ -3687,7 +3685,7 @@ namespace Volian.Print.Library // if printing the supplemental info facing page, don't put out the section title. ToPdf will put out 'Supplemental Information' title. if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && MyPageHelper.CreatingSupInfoPage && itemInfo.IsSection) doprint = false; if (doprint && itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && (itemInfo.MyConfig as SectionConfig).Section_IsFoldout != "Y") //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box - { + { doSectTab = true; if (itemInfo.IsStepSection && formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Just.Contains("PSLeft")) { @@ -3765,7 +3763,7 @@ namespace Volian.Print.Library } if (!itemInfo.IsSection || doSectTab) { - if (itemInfo.IsSupInfoPart) // get combined tab if on a supinfo facing page: + if (itemInfo.IsSupInfoPart) // get combined tab if on a supinfo facing page: mytab = GetSupInfoTab(cb, itemInfo, yoff, mytab, doSectTab, localXOffset); else if (itemInfo.MyTab.AltPrintTab != null) mytab = new vlnTab(cb, this, itemInfo.MyTab.AltPrintTab, itemInfo.MyTab.AltPrintTab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); @@ -3775,7 +3773,7 @@ namespace Volian.Print.Library if (mytab.MyMacro != null) PartsLeft.Add(mytab.MyMacro); } } - else if (itemInfo.IsSupInfoPart) // if it was an empty tab - it may have been a caution/note + else if (itemInfo.IsSupInfoPart) // if it was an empty tab - it may have been a caution/note { mytab = GetSupInfoTab(cb, itemInfo, yoff, mytab, doSectTab, XOffset); PartsLeft.Add(mytab); @@ -3960,7 +3958,7 @@ namespace Volian.Print.Library ChildrenAbove.StepDesignator = null; ChildrenAbove.StepDesignatorColumn = null; } - DoAnnotationPrintableText(cb, itemInfo, yoff); // Look in annotation type to see if annotation has text that should be printed (like a step designator) + DoAnnotationPrintableText(cb, itemInfo, yoff); // Look in annotation type to see if annotation has text that should be printed (like a step designator) // if this is a hls with a box, adjust the starting y location for the hls. this is done here // in case this hls had a boxed caution and/or note before it. Also, this code is here rather @@ -4000,7 +3998,7 @@ namespace Volian.Print.Library if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.MyPrevious == null && MyItemInfo.FormatStepData.ThreeBlanksAbove && (!MyItemInfo.IsNote || MyItemInfo.MyParent.Cautions == null)) addExtraSpace = 24; // already has one blank line above, added two more - // if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace > 0) + //if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace > 0) // addExtraSpace = (float)MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace; // if this plant has the AlwaysUseExtraLines and there are notes/cautions above the hls, don't add in the // extra space: @@ -4110,17 +4108,17 @@ namespace Volian.Print.Library { CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); YOffset = yoff; - yoff += Height * .6f; // .6 is used as a scale factor in RtfRawAt (rtf2pdf). Use it here too for moving down page after equation. + yoff += Height * .6f; // .6 is used as a scale factor in RtfRawAt (rtf2pdf). Use it here too for moving down page after equation. yoff = (float)Math.Ceiling(yoff); yoff += AdjustForBlankLines(); } - else if (itemInfo.IsFigure) // if a figure we've got to determine the size: + else if (itemInfo.IsFigure) // if a figure we've got to determine the size: { int profileDepth2 = ProfileTimer.Push(">>>> Before vlnParagraph.Figure"); string erMsg = null; - if (itemInfo.MyContent.Text != null) // ro image + if (itemInfo.MyContent.Text != null) // ro image { - if (itemInfo.MyContent.Text != "") // also check for text, there is an RO image then: + if (itemInfo.MyContent.Text != "") // also check for text, there is an RO image then: { ProcedureInfo proc = itemInfo.MyProcedure; DocVersionInfo dvi = proc.MyDocVersion; @@ -4289,7 +4287,7 @@ namespace Volian.Print.Library } } } - if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables. + if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables. { Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth); CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); @@ -4305,7 +4303,7 @@ namespace Volian.Print.Library if (lim > docStyleLim) { - WidthNoLimit = Width; // Use this width to calculate childrens' width, without this, code was making children to narrow! + WidthNoLimit = Width; // Use this width to calculate childrens' width, without this, code was making children to narrow! Width = docStyleLim - (MyTab == null ? (XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) : MyTab.XOffset + MyTab.Width); } } @@ -4408,7 +4406,7 @@ namespace Volian.Print.Library } } } - if (co != null && !MyItemInfo.IsInSupInfo) // C2018-002: don't print checkboxes on supplemental infromation pages. + if (co != null && !MyItemInfo.IsInSupInfo) // C2018-002: don't print checkboxes on supplemental infromation pages. { // if this item's content is empty, and the flag is set to 'notonempty', don't print out the // checkoff - this was added for shearon harris: @@ -4493,8 +4491,8 @@ namespace Volian.Print.Library //B2020-160 use YTopMost instead of Yoffset if there are children above. // Get the minimun value between the AER and RNO YtopMost. // example. Calvert AOP-7E/XIII/Step A5.h Unit 2 Approved set - // B2021-027 use YOffset if there isn't any children above (AER). - // example: Catawba Unit 1 AP's; AP/1/A/5500/050; Enclosure 8 step 1 + //B2021-027 use YOffset if there isn't any children above (AER). + // example: Catawba Unit 1 AP’s; AP/1/A/5500/050; Enclosure 8 step 1 if (ChildrenAbove.Count == 0) YTopMost = ChildrenRight[0].ChildrenAbove[0].YOffset; //B2021-027 else @@ -4516,12 +4514,12 @@ namespace Volian.Print.Library { MyFlexGrid.LoadGrid(itemInfo.Tables[0]); // B2018-077 added check for caution and note parts in which case we want the blank line - fix for Calvert OI-27B 6.11.B and 6.12.B - if (MyFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !MyFlexGrid.TopRowHasBorder() && !MyItemInfo.IsCautionOrNotePart) + if (MyFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !MyFlexGrid.TopRowHasBorder() && !MyItemInfo.IsCautionOrNotePart) yoffadj = -SixLinesPerInch; } // B2023-008: when an equation is off a paragraph sub-step in single column mode, extra lines were added so // when in single column mode & the substep has an equation (rtfraw), then don't reset yoffright to yverybottom - bool rtfRawInSingleCol = (itemInfo.ColumnMode == ((int)VEPROMS.CSLA.Library.SectionConfig.SectionColumnMode.One - 1)) && (itemInfo.Tables != null && itemInfo.Tables.Count > 0 && itemInfo.Tables[0].IsRtfRaw); + bool rtfRawInSingleCol = (itemInfo.ColumnMode == ((int)VEPROMS.CSLA.Library.SectionConfig.SectionColumnMode.One-1)) && (itemInfo.Tables != null && itemInfo.Tables.Count > 0 && itemInfo.Tables[0].IsRtfRaw); if (yOffRight < yoffRightParent) yOffRight = yoffRightParent; // find the very bottom Yoffset (don't do this is in single column mode for cautions/notes: B2016-261) vlnParagraph parentPar = parent; @@ -4542,7 +4540,7 @@ namespace Volian.Print.Library } else // AER or RNO Table if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff + yoffadj, yOffRight + yoffadj, rnoLevel, maxRNO, formatInfo); + yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff + yoffadj, yOffRight + yoffadj, rnoLevel, maxRNO, formatInfo); } yOffRight = Math.Max(yOffRight, yoffLeft); // Look for the meta section case where the 'Editable' flag is set to 'N', which means that @@ -4845,9 +4843,9 @@ namespace Volian.Print.Library // This code handles whether user enters \r\n to separate lines or not. The // max width that a line can be in the Responsibility column is a format flag (passed in) List results = new List(); - int width = 0; // keep track of current width of current 'line' while looking for space to break - int start = 0; // start of line (index into string 'text') - int lastspace = 0; // location of lastspace (index into string) + int width = 0; // keep track of current width of current 'line' while looking for space to break + int start = 0; // start of line (index into string 'text') + int lastspace = 0; // location of lastspace (index into string) for (int indx = 0; indx < responsStr.Length; indx++) { if ((indx + 1) < responsStr.Length && responsStr.Substring(indx, 2) == "\r\n") @@ -4920,18 +4918,18 @@ namespace Volian.Print.Library } // C2018-024 I in Arial font changed to I in TimesNewRoman private static System.Drawing.Font _TNR; - // F2018-013 Changed to static and public so that it can be used with step identifiers for bullets + // F2018-013 Changed to static and public so that it can be used with step identifiers for bullets public static string FixRTFToPrint(ItemInfo myItemInfo, string rtf) { // Only do this if the text contains symbols. - if ((rtf.Contains("VESymbFix") || rtf.Contains(Volian.Base.Library.vlnFont.ProportionalSymbolFont))) // C2017-036 get best available proportional font for symbols + if ((rtf.Contains("VESymbFix") || rtf.Contains(Volian.Base.Library.vlnFont.ProportionalSymbolFont))) // C2017-036 get best available proportional font for symbols { // bug fix: B2017-117 was getting an out of window handles error when doing a print all for Bryon // add the using statment to free up window handle that is created doing a New RichTextBox() using (System.Windows.Forms.RichTextBox rtb = new System.Windows.Forms.RichTextBox()) { rtb.Rtf = rtf.Replace(@"\\", ""); // rename backslash character to avoid RTF confusion - //string showRTF = rtf; + //string showRTF = rtf; bool changed = false; // C2018-024 I in Arial font changed to I in TimesNewRoman if (myItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ChangeFontUpperCaseIinArial) @@ -4981,7 +4979,7 @@ namespace Volian.Print.Library for (int i = 0; i < rtb.TextLength; i++) { rtb.Select(i, 1); - if ((rtb.SelectedRtf.Contains("VESymbFix") || rtb.SelectedRtf.Contains(Volian.Base.Library.vlnFont.ProportionalSymbolFont)) && rtb.SelectedText.Length > 0) // C2017-036 get best available proportional font for symbols + if ((rtb.SelectedRtf.Contains("VESymbFix") || rtb.SelectedRtf.Contains(Volian.Base.Library.vlnFont.ProportionalSymbolFont)) && rtb.SelectedText.Length > 0) // C2017-036 get best available proportional font for symbols { for (int j = 0; j < SymReplaceList.MaxIndex; j++) { @@ -5224,11 +5222,11 @@ namespace Volian.Print.Library // Get SectionInfos to access specific section config items... //SectionInfo si = SectionInfo.Get(mySectionInfo.ItemID); - SectionInfo si = (mySectionInfo != null) ? mySectionInfo.GetSectionInfo() : null; + SectionInfo si = (mySectionInfo != null)? mySectionInfo.GetSectionInfo() : null; int sindx = si.CheckOffHeadingIndex(); //SectionInfo subi = mySubSectionInfo == null ? null : SectionInfo.Get(mySubSectionInfo.ItemID); - SectionInfo subi = (mySubSectionInfo == null) ? null : mySubSectionInfo.GetSectionInfo(); - int subindx = (subi == null) ? -1 : subi.CheckOffHeadingIndex(); + SectionInfo subi = (mySubSectionInfo == null)? null : mySubSectionInfo.GetSectionInfo(); + int subindx = (subi == null)? -1 : subi.CheckOffHeadingIndex(); // if there is no subsections & the main section doesn't use a header OR // if there is a subsection, & it does not use a header... Return. @@ -5248,20 +5246,20 @@ namespace Volian.Print.Library // This checks to see if the section is starting at the top of the page. // If it is, then we want to use PageList to print the checkoff/sighoff header // else the checkoff/signoff header will be printed across from the section title where ever it is on the page (i.e. section pagination set to continuous) - else if (subi == null) //no subsection + else if (subi == null) //no subsection { // B2021-106 added check if the section has a note or caution - if ((yPageStart - YOffset) == yTopMargin || mySectionInfo.HasCautionOrNote) usePageListCOHdr = true; + if ((yPageStart - YOffset) == yTopMargin || mySectionInfo.HasCautionOrNote) usePageListCOHdr = true; } else // there is a sub-section { // B2021-106 added check if the section has a note or caution - if (mySectionInfo == itemInfo && ((yPageStart - YOffset) == yTopMargin) || mySectionInfo.HasCautionOrNote) usePageListCOHdr = true; + if (mySectionInfo == itemInfo && ((yPageStart - YOffset) == yTopMargin) || mySectionInfo.HasCautionOrNote) usePageListCOHdr = true; if (!usePageListCOHdr && mySubSectionInfo != itemInfo) return; } // grab the string from the format, depending on whether it should get it from the section or subsection. - string cohead = (mySubSectionInfo != null) ? mySubSectionInfo.SectionCheckOffHeader : (mySectionInfo != null) ? mySectionInfo.SectionCheckOffHeader : null; + string cohead = (mySubSectionInfo != null) ? mySubSectionInfo.SectionCheckOffHeader : (mySectionInfo != null)? mySectionInfo.SectionCheckOffHeader : null; if (cohead == "" || cohead == null) return; // PageListCheckOffHeader is an svgtext - but really we only need the x/y location for this (pagelist support) @@ -5337,7 +5335,7 @@ namespace Volian.Print.Library if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) ctrCalvertAlarmTbl = MyItemInfo.IsWithInSingleColumnTemplate(); // B2019-049 added check for table being in a Caution or Note - if so, use the single column setting for the format variable TableCenterPos - float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[(itemInfo.IsInCautionOrNote) ? 0 : itemInfo.ColumnMode]); + float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[(itemInfo.IsInCautionOrNote)?0:itemInfo.ColumnMode]); if (ctrCalvertAlarmTbl || formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) XOffset = leftMargin + (pageWidth - leftMargin - (scale * Width)) / 2; else @@ -5375,7 +5373,7 @@ namespace Volian.Print.Library // two numbers. XOffset -= (XOffset - (XOffset * (float)MyItemInfo.FormatStepData.Font.CPI / 12)); } - XOffset -= 12; // This makes the 16bit & 32bit align very closely. + XOffset -= 12; // This makes the 16bit & 32bit align very closely. // if outside of the page margins then center within the page margins float xOffset2 = (float)itemInfo.MyDocStyle.Layout.LeftMargin; float xWidth2 = (float)itemInfo.MyDocStyle.Layout.PageWidth; @@ -5514,7 +5512,7 @@ namespace Volian.Print.Library List myMacros = itemInfo.MyMacros; if (myMacros != null) { - int colMode = (MyItemInfo.ActiveSection != null) ? MyItemInfo.ActiveSection.ColumnMode : 0; // C2018-003 fixed use of getting the active section + int colMode = (MyItemInfo.ActiveSection != null)? MyItemInfo.ActiveSection.ColumnMode : 0; // C2018-003 fixed use of getting the active section foreach (Macro myMacro in myMacros) { // if the format has the 'LocWithXOff' locate the macro along with the tab's offset. @@ -5648,14 +5646,14 @@ namespace Volian.Print.Library // if this is a caution or note, put the change bar to the right of the text: //if ((paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) && fixedChgCol < -10) return -fixedChgCol; if ((fixedChgCol == 0))// && paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) - // if ((fixedChgCol==0) || paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) + //if ((fixedChgCol==0) || paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) { float rightEdge = (paragraph.XOffset + paragraph.Width + 5); rightEdge -= (float)paragraph.MyItemInfo.MyDocStyle.Layout.LeftMargin; if (bxCautNote != null) rightEdge = (float)bxCautNote.End + 10; // used for notes and cautions in the Prairie Island Alarms format rightEdge = rightEdge / paragraph.MyItemInfo.FormatStepData.Font.CharsToTwips; - return MyItemInfo.IsFigure ? rightEdge + 1 : rightEdge; // B2017-111: Add a little more space between figure & change bar + return MyItemInfo.IsFigure ? rightEdge + 1 : rightEdge; // B2017-111: Add a little more space between figure & change bar } if (fixedChgCol < -10 || fixedChgCol >= 0) return ((fixedChgCol > 0) ? fixedChgCol : @@ -5787,11 +5785,11 @@ namespace Volian.Print.Library { Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; if (bx.TabPos > 0) - xoff += (float)bx.TabPos; // xoff starts as left margin + xoff += (float)bx.TabPos; // xoff starts as left margin else - xoff += (float)((bx.TxtStart + _MyBoxLeftAdj + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin + xoff += (float)((bx.TxtStart + _MyBoxLeftAdj + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin } - else if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.IsInRNO && (itemInfo.IsCaution || itemInfo.IsNote)) // C2014-009 + else if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.IsInRNO && (itemInfo.IsCaution || itemInfo.IsNote)) // C2014-009 xoff = XOffset + (para.Width / 2) - (hdrWidth / 2); else if (formatInfo.MyStepSectionLayoutData.Separator.Location > 0) xoff = XOffset + AdjustToCharPosition((float)((para.Width - hdrWidth) / formatInfo.MyStepSectionLayoutData.Separator.Location), itemInfo.MyHeader.MyFont.CPI); @@ -5800,22 +5798,22 @@ namespace Volian.Print.Library else if (itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].NumberWithLevel) xoff = XOffset + (para.Width / 2) - (hdrWidth / 2); else - xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included + xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included } else - xoff = XOffset; // XOffset has left margin included - // KEEP: This may be needed in the future to fix location of 'OR's when Separator location="0" - // the following code would place the 'OR' at the location of the tab rather than text. This - // is how 16bit was. However, a number of plants had been sent out with the xoffset at the xlocation - // of text (does not match 16bit) when this was found for BGE OI3/OI-1B/6.1.B.4. Previous releases - // went to CAT, MCG, FPL, NSP. - //{ - // if (this.MyTab != null) - // xoff = this.MyTab.XOffset; - // else - // xoff = XOffset; - //} - // B2018-096 AEP 082.002CD Note Box overlapping Step Box + xoff = XOffset; // XOffset has left margin included + // KEEP: This may be needed in the future to fix location of 'OR's when Separator location="0" + // the following code would place the 'OR' at the location of the tab rather than text. This + // is how 16bit was. However, a number of plants had been sent out with the xoffset at the xlocation + // of text (does not match 16bit) when this was found for BGE OI3/OI-1B/6.1.B.4. Previous releases + // went to CAT, MCG, FPL, NSP. + //{ + // if (this.MyTab != null) + // xoff = this.MyTab.XOffset; + // else + // xoff = XOffset; + //} + // B2018-096 AEP 082.002CD Note Box overlapping Step Box vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff + AdjustHeader + _MyBoxLeftAdj, YOffset, itemInfo.MyHeader.MyFont); PartsAbove.Add(myHeader); //return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? SixLinesPerInch : 0); @@ -5864,13 +5862,13 @@ namespace Volian.Print.Library get { return vlnParagraph._PathPrefix; } set { vlnParagraph._PathPrefix = value; } } - protected float _YBottomMost; // Bottom of the paragraph including the children + protected float _YBottomMost; // Bottom of the paragraph including the children public float YBottomMost { get { return _YBottomMost; } - set + set { - _YBottomMost = value; + _YBottomMost = value; } } private float _YBottomPagination; // B2019-111 Keep table with Parent @@ -5885,13 +5883,13 @@ namespace Volian.Print.Library get { return _YBottomMostAdjust; } set { _YBottomMostAdjust = value; } } - protected float _YTopMost; // Top of the paragraph including the children + protected float _YTopMost; // Top of the paragraph including the children public float YTopMost { get { return _YTopMost; } set { _YTopMost = value; } } - protected float _YTop; // Top of the paragraph including parts + protected float _YTop; // Top of the paragraph including parts public float YTop { get { return _YTop; } @@ -5908,7 +5906,7 @@ namespace Volian.Print.Library // table. get { return (MyItemInfo.IsHigh && MyItemInfo.FormatStepData.UseSmartTemplate) ? SixLinesPerInch : 0; } } - public float YSize // How big this paragraph is with all of its children + public float YSize // How big this paragraph is with all of its children { get { @@ -6082,13 +6080,13 @@ namespace Volian.Print.Library // B2023-069 allow for the adjustment of the Supplemental Information tab at the section level (SecOvrideSupInfoTabOff). // this will also override the SupInoTabOff setting which is for the entire format int secOvrSupInfoTab = itemInfo.MyDocStyle.SecOvrideSupInfoTabOff == null ? 0 : (int)itemInfo.MyDocStyle.SecOvrideSupInfoTabOff; - if (secOvrSupInfoTab != 0) sitabloc = secOvrSupInfoTab; + if (secOvrSupInfoTab != 0) sitabloc = secOvrSupInfoTab; XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + sitabloc; if (myTab != null) { myTab.XOffset = XOffset - ((myTab == null) ? 0 : myTab.Width) - 12; // B2017-253 - Limit the tab offset to 2 points inside the left margin - myTab.XOffset = Math.Max(myTab.XOffset, itemInfo.MyDocStyle.Layout.LeftMargin ?? 72) + 2; + myTab.XOffset = Math.Max(myTab.XOffset,itemInfo.MyDocStyle.Layout.LeftMargin ?? 72)+2; float mytbwidth = myTab.Width; myTab.Width = 2.5f * myTab.Width; // C2018-022: adjust xoffset of text by 12 if the tab would overwrite the text and the format flag is on: @@ -6167,7 +6165,7 @@ namespace Volian.Print.Library { //B2018-139 use XOffset when processing HLS, Caution, or Note background text and tab if (itemInfo.IsHigh || (itemInfo.IsNote && (itemInfo.MyParent.IsHigh || itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote)) || (itemInfo.IsCaution && (itemInfo.MyParent.IsHigh || itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote))) - myTab.XOffset = XOffset; + myTab.XOffset = XOffset; else { // F2018-041 seq tabs off of TitleWithTextBelow were running into the step text @@ -6177,8 +6175,8 @@ namespace Volian.Print.Library } XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * adj); // indent 2 characters for background steps // B2018-146 Adjust the width to match the HLS Right Margin. - // if (itemInfo.ActiveFormat.Name.StartsWith("WCN")) -- Not needed since IsBackgroundStep - Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset; + //if (itemInfo.ActiveFormat.Name.StartsWith("WCN")) -- Not needed since IsBackgroundStep + Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset; //else // Width -= (itemInfo.FormatStepData.Font.CharsToTwips * adj); // Adjust width by 2 characters return; @@ -6197,7 +6195,7 @@ namespace Volian.Print.Library else XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; // B2018-146 Adjust the width to match the HLS Right Margin. - if (itemInfo.IsPartOfBackgroundStep()) + if(itemInfo.IsPartOfBackgroundStep()) //if(itemInfo.ActiveFormat.Name.StartsWith("WCN")) Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset; return; @@ -6257,7 +6255,7 @@ namespace Volian.Print.Library // B2019-057 Added a check to see if there is a width override for this step element (Robinson AOP Backgrounds - paragraphs) float wdthovrd = (itemInfo.FormatStepData.WidthOverride == null) ? 0 : (float)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO); if ((!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || !UseTemplateWidthOrXOff(itemInfo.MyParent)) && wdthovrd == 0) - Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG2; + Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG2; } return; } @@ -6313,7 +6311,7 @@ namespace Volian.Print.Library } } else - XOffset = MyParent.XOffset; // unnumbered hls + XOffset = MyParent.XOffset; // unnumbered hls return; } } @@ -6526,7 +6524,7 @@ namespace Volian.Print.Library myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); Width = MyParent.Width - myTab.Width; } - else // if no left justify, right align the tab + else // if no left justify, right align the tab { XOffset += tabWidth - (myTab == null ? 0 : myTab.TabAlign); if (myTab != null) @@ -6543,7 +6541,7 @@ namespace Volian.Print.Library // MyTab.XOffset = XOffset; // return; //} - else // if no left justify, right align the tab + else // if no left justify, right align the tab { // The following fixes F2016-033: Print the Verification Point at left margin. if (itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB") && (itemInfo.FormatStepData.ColOverride ?? 0) > 0) @@ -6618,7 +6616,7 @@ namespace Volian.Print.Library int? bxIndx = itemInfo.IsStep ? itemInfo.FormatStepData.StepLayoutData.STBoxindex : null; float? widOvrd = 0; float xwid = 0; - if (itemInfo.IsStep && itemInfo.MyHLS != null && UseTemplateWidthOrXOff(itemInfo) && (xwid = GetWidthOrStartFromTemplate(itemInfo, formatInfo, true)) > 0) + if (itemInfo.IsStep && itemInfo.MyHLS != null && UseTemplateWidthOrXOff(itemInfo) && (xwid = GetWidthOrStartFromTemplate(itemInfo, formatInfo, true)) > 0) widOvrd = xwid; else widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride == null ? null : @@ -6696,7 +6694,7 @@ namespace Volian.Print.Library if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert || itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckoffsWithoutHeader) { SectionInfo si = itemInfo.ActiveSection.GetSectionInfo(); - ChkOff = si.HasInitials; // this determines if any steps within the section have checkoffs. + ChkOff = si.HasInitials; // this determines if any steps within the section have checkoffs. } bool FmtHasAdj = false; if (ChkOff) @@ -6707,7 +6705,7 @@ namespace Volian.Print.Library CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment; } // C2019-040 use format flag to not readjust the CheckOffAdj value - previously we check if the format file name starts with VCB (VCB no longer a customer) - if (!itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckoffsWithoutHeader) // Don't do the following if in a vcb format (part of fix F2016-039) + if (!itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckoffsWithoutHeader) // Don't do the following if in a vcb format (part of fix F2016-039) { if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0) CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment @@ -6862,7 +6860,7 @@ namespace Volian.Print.Library else Width = MyParent.Width; } - else if (itemInfo.IsRtfRaw) // this needs to be before the check for 'IsTablePart' - the rtfraw may be a table part, but the size is defined by raw rtf + else if (itemInfo.IsRtfRaw) // this needs to be before the check for 'IsTablePart' - the rtfraw may be a table part, but the size is defined by raw rtf { System.Drawing.Size sz = RtfRawItem.GetRtfRawSize(MyItemInfo.MyContent.Text); Height = sz.Height; @@ -6873,7 +6871,7 @@ namespace Volian.Print.Library { Width = 72 * 7; // TODO: Need to determine the Width of the Table based upon the contents } - else if (itemInfo.MyParent.FormatStepData != null && itemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight") // B2019-141: Background steps width too small + else if (itemInfo.MyParent.FormatStepData != null && itemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight") // B2019-141: Background steps width too small { Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - XOffset; } @@ -7072,7 +7070,7 @@ namespace Volian.Print.Library // B2020-151: check for SpecialCaseCalvertPagination flag instead of SpecialCase Calvert flag so only EOPs/AOPs are affected float adjust = 0; if (para.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertPagination) - adjust = para.YVeryTop - para.YTop; + adjust = para.YVeryTop - para.YTop; //if (para.MyItemInfo.MyParent.IsHigh && (para.ChildrenAbove == null || para.ChildrenAbove.Count == 0)) //{ // //Console.WriteLine("Adjust Add extra Line (flag) = '{0}'", para); @@ -7214,12 +7212,10 @@ namespace Volian.Print.Library public int StepLevel { get { return _StepLevel; } - set - { + set { //if (MyParagraph.MyItemInfo.InList(97960,84472,91010)) // Console.WriteLine("stop"); - _StepLevel = value; - } + _StepLevel = value; } } private vlnParagraph _MyParagraph; public vlnParagraph MyParagraph