Merge pull request 'Development' (#133) from Development into master

Merging C2023-018 from development into master after successful testing.
This commit is contained in:
Devin Jankowski 2023-10-11 09:26:45 -04:00
commit 95130fd9a0
5 changed files with 76 additions and 70 deletions

View File

@ -324,8 +324,10 @@ namespace VEPROMS
{
if (UserInfo.CanEdit(frmVEPROMS.SMyUserInfo, MyPromsPrinter.MyItem.MyDocVersion))
{
if (FlexibleMessageBox.Show(this, "The procedure PDF file was created by removing certain hard returns,\r\ntrailing spaces, and manual page breaks that could affect the\r\n"+
"pagination of the procedure.\r\n\r\nAfter reviewing the PDF file, do you want to save the changes made?",
// 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"+
"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)
{
MyPromsPrinter.SavePaginationFixes();

View File

@ -30,7 +30,6 @@ namespace Volian.Controls.Library
{
this.groupPanelPaginate = new DevComponents.DotNetBar.Controls.GroupPanel();
this.cbPrefPageBreak = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbSubStepPageBreak = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbPageBreak = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbCAS = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cmbCheckoff = new DevComponents.DotNetBar.Controls.ComboBoxEx();
@ -75,7 +74,6 @@ namespace Volian.Controls.Library
this.groupPanelPaginate.BackColor = System.Drawing.Color.Transparent;
this.groupPanelPaginate.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelPaginate.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelPaginate.Controls.Add(this.cbSubStepPageBreak);
this.groupPanelPaginate.Controls.Add(this.cbPrefPageBreak);
this.groupPanelPaginate.Controls.Add(this.cbPageBreak);
this.groupPanelPaginate.DisabledBackColor = System.Drawing.Color.Empty;
@ -132,23 +130,6 @@ namespace Volian.Controls.Library
this.cbPrefPageBreak.Text = "Preferred Page Break (for Sup Info)";
this.cbPrefPageBreak.CheckedChanged += new System.EventHandler(this.cbPrefPageBreak_CheckedChanged);
//
// cbSubStepPageBreak
//
this.cbSubStepPageBreak.AutoSize = true;
//
//
//
this.cbSubStepPageBreak.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbSubStepPageBreak.Location = new System.Drawing.Point(3, 19);
this.cbSubStepPageBreak.Margin = new System.Windows.Forms.Padding(2);
this.cbSubStepPageBreak.Name = "cbSubStepPageBreak";
this.cbSubStepPageBreak.Size = new System.Drawing.Size(195, 15);
this.superTooltipTags.SetSuperTooltip(this.cbSubStepPageBreak, new DevComponents.DotNetBar.SuperTooltipInfo("Page Break for Sub-Steps", "", "When set, starts this step at the top of a page.\r\n\r\nkeyboard command: <Ctrl><Ente" +
"r>", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.cbSubStepPageBreak.TabIndex = 1;
this.cbSubStepPageBreak.Text = "Substep Page Break";
this.cbSubStepPageBreak.CheckedChanged += new System.EventHandler(this.cbSubStepPageBreak_CheckedChanged);
//
// cbPageBreak
//
this.cbPageBreak.AutoSize = true;
@ -789,7 +770,6 @@ namespace Volian.Controls.Library
private System.Windows.Forms.TrackBar trBarFS;
private System.Windows.Forms.Button btnFSrestore;
private DevComponents.DotNetBar.Controls.CheckBoxX cbPrefPageBreak;
private DevComponents.DotNetBar.Controls.CheckBoxX cbSubStepPageBreak;
private DevComponents.DotNetBar.Controls.CheckBoxX cbIncludeInTOC;
private DevComponents.DotNetBar.Controls.CheckBoxX cbTCAS;
}

View File

@ -110,7 +110,6 @@ namespace Volian.Controls.Library
cmbCheckoff.Enabled = false;
cbPageBreak.Enabled = false;
cbPrefPageBreak.Enabled = false;
cbSubStepPageBreak.Enabled = false;
cbPlaceKeeper.Enabled = false;
cbPlaceKeeperCont.Enabled = false;
cbIncludeInTOC.Enabled = false;
@ -179,11 +178,12 @@ namespace Volian.Controls.Library
public void UpdatePageBreakCheckBox() // for use with shortcut keystroke <Ctrl><Enter>
{
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (CurItemInfo.IsHigh) cbPageBreak.Checked = false; // Page Break is set to false
// C2023-018: if high, check oringinal flag, otherwise check sub-step flag for setting checkbox
cbPageBreak.Checked = false; // Page Break is set to false
if (sc != null && CurItemInfo.IsHigh) // otherwise, get data from config
cbPageBreak.Checked = sc.Step_NewManualPagebreak; // High Level Step has a manual page break
else
cbPageBreak.Checked = false; // Page Break is set to false
else if (sc != null && !CurItemInfo.IsCautionOrNotePart)
cbPageBreak.Checked = sc.Step_SubStepPagebreak;
}
public DocVersionInfo Mydvi = null; // this is initialized in vlnTreeComboSetsFillIn()
@ -245,13 +245,23 @@ namespace Volian.Controls.Library
groupPanelFigSize.Style.BackColor = Color.Cornsilk;
cbPageBreak.Checked = false; // will be set below if HLS & config has it on
cbPrefPageBreak.Checked = false;
cbSubStepPageBreak.Checked = false;
cbPlaceKeeper.Checked = false; // will be set below if HLS & config has this set
cbPlaceKeeperCont.Checked = false; // will be set below if substep & config has this set
cbPageBreak.Enabled = CurItemInfo.IsHigh;
// C2023-018: upgrade for 2023, allow page break setting on non-HLS under certain conditions as listed here:
// - HLS only (original)
// - Upgrade for sub-steps: Not in supplemental info (original)
// - Upgrade for sub-steps: Not in Enhanced document
// - Upgrade for sub-steps: Only for single column procedure
// - Upgrade for sub-steps: Sequential sub-steps only
// - Upgrade for sub-steps: First level sub-steps only (CurItemInfo.MyParent.IsHigh)
SectionConfig secConfig = (SectionConfig)CurItemInfo.ActiveSection.MyConfig;
bool isSingleColumn = secConfig != null && secConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One;
bool allowPageBreak = CurItemInfo.IsHigh || (!CurItemInfo.MyDocStyle.SupplementalInformation && !CurItemInfo.IsEnhancedStep
&& isSingleColumn && CurItemInfo.IsSequential && CurItemInfo.MyParent.IsHigh);
cbPageBreak.Enabled = allowPageBreak;
cbPrefPageBreak.Visible = cbPrefPageBreak.Enabled = (!CurItemInfo.IsInSupInfo && CurItemInfo.MyDocStyle.SupplementalInformation);
// C2023-015: Pagination on a sub-step
cbSubStepPageBreak.Visible = cbSubStepPageBreak.Enabled = CurItemInfo.IsSubStep && CurItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.AlarmPagination;
if (!CurItemInfo.IsFigure && !CurItemInfo.IsRtfRaw)
{
cbPlaceKeeper.Enabled = (((SectionConfig)CurItemInfo.ActiveSection.MyConfig).Section_Placekeeper == "Y");
@ -297,7 +307,7 @@ namespace Volian.Controls.Library
}
else if (sc == null) // if there is no config data ...
{
if (CurItemInfo.IsHigh)cbPageBreak.Checked = false; // Page Break is set to false
cbPageBreak.Checked = false; // Page Break is set to false
cbCAS.Checked = CurItemInfo.IncludeOnContActSum; // set based on step type format flag
cbTCAS.Checked = CurItemInfo.IncludeOnTimeCriticalActionSum; // set based on step type format flag
cbPlaceKeeper.Checked = false;
@ -305,10 +315,12 @@ namespace Volian.Controls.Library
}
else // otherwise, get data from config
{
// C2023-018: if high, use original config setting for page break, otherwise you sub-step setting
if (CurItemInfo.IsHigh)
cbPageBreak.Checked = sc.Step_NewManualPagebreak; // High Level Step has a manual page break
else
cbPageBreak.Checked = sc.Step_SubStepPagebreak;
if (cbPrefPageBreak.Enabled) cbPrefPageBreak.Checked = sc.Step_PreferredPagebreak;
if (cbSubStepPageBreak.Enabled) cbSubStepPageBreak.Checked = sc.Step_SubStepPagebreak;
cbPlaceKeeper.Checked = (sc.Step_Placekeeper == "Y"); // step text to be included on PlaceKeeper (Calvert Cliffs)
cbPlaceKeeperCont.Checked = (sc.Step_Placekeeper == "C"); // step is included on Placekeeper and marked as continuous action (Calvert Cliffs)
// set the Continuous Action Summary check box to the saved setting in the config or, if nothing in config, set to format flag setting
@ -547,7 +559,10 @@ namespace Volian.Controls.Library
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (CurItemInfo.IsHigh)
sc.Step_NewManualPagebreak = cbPageBreak.Checked;
else // C2023-018: allow for sub-step page breaks
sc.Step_SubStepPagebreak = cbPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
private void cbCAS_CheckedChanged(object sender, EventArgs e)
@ -896,18 +911,6 @@ namespace Volian.Controls.Library
sc.Step_PreferredPagebreak = cbPrefPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
// C2023-015: Pagination on a sub-step
private void cbSubStepPageBreak_CheckedChanged(object sender, EventArgs e)
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_SubStepPagebreak = cbSubStepPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
//private void txbxAltConActSumText_Leave(object sender, EventArgs e)
//{
// // User left Atlernate Continuous Action Text field. If text changed, then prompt

View File

@ -100,14 +100,16 @@ namespace Volian.Print.Library
return retval;
}
// C2023-015: Pagination on a sub-step added. Do the code if supplemental info or if format supports sub-step pagination
else if ((MyItemInfo.MyDocStyle.SupplementalInformation || MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.AlarmPagination) && MyItemInfo.IsStep)
// C2023-018: Pagination on sub-step (changed from C2023-015), do this code if on a step... will check for config flags in this code
else if (MyItemInfo.IsStep)
{
// C2023-018: only do the following if in supplemental info, doing checks on cautions/notes off substep
// if this is the first caution or note from a substep, if the substep has preferred page break, break at the first caution or note:
if ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyParent.IsSubStep)
if ((MyItemInfo.MyDocStyle.SupplementalInformation && (MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyParent.IsSubStep))
{
StepConfig scs = MyItemInfo.MyParent.MyConfig as StepConfig;
// C2023-015: Pagination on a sub-step added on this check
if (MyItemInfo.MyPrevious == null && (scs.Step_PreferredPagebreak || scs.Step_SubStepPagebreak))
// C2023-015: Pagination on a sub-step added on this check, C2023-018: removed substep check since this cannot occur
if (MyItemInfo.MyPrevious == null && scs.Step_PreferredPagebreak)
{
// B2018-103: The following flags a break within the step. Before returning a '2' (flags break within step), clear it out of the
// ParaBreaks. Without the 'RemoveAt', a page break will occur after this step also.
@ -121,8 +123,16 @@ namespace Volian.Print.Library
}
}
// Now see if there is a preferred page break on this step.
// C2023-018: Added check for sub-step
StepConfig sci = MyItemInfo.MyConfig as StepConfig;
if (sci.Step_PreferredPagebreak || sci.Step_SubStepPagebreak)
{
// C2023-018: if removing manual page breaks - add to list for permanent removal if selected and do not put a page break
// on the sub-step (do not execute the 'else' code)
if (sci.Step_SubStepPagebreak && MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks != null &&
!MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Contains(MyItemInfo.ItemID))
MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Add(MyItemInfo.ItemID);
else
{
if (MyItemInfo.IsHigh) return 1;
// if this is the top caution/note return 1 also. Cautions always are first, that is why the check does not need to know if on a
@ -143,6 +153,7 @@ namespace Volian.Print.Library
return 2;
}
}
}
// if the EndForSingle format flag is set to false, then we do not print an End message if the section
// is a single column section.
//bool _skipEndMessage = MyPageHelper.MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle;
@ -1475,7 +1486,8 @@ namespace Volian.Print.Library
private SortedList<float, vlnParagraph> GetMyPreferredBreaks(StepLevelList myList)
{
// C2023-015: Pagination on a sub-step added. Do the code if supplemental info or if format supports sub-step pagination
if (!MyItemInfo.MyDocStyle.SupplementalInformation && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.AlarmPagination) return null;
// 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<float, vlnParagraph> sdpara = null;
foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest.
{
@ -1484,6 +1496,13 @@ namespace Volian.Print.Library
vlnParagraph myPara = myList[stepLevel][yLocation];
StepConfig sci = myPara.MyItemInfo.MyConfig as StepConfig;
if (sci != null && sci.Step_PreferredPagebreak || sci.Step_SubStepPagebreak)
{
// C2023-018: if removing manual page breaks - add to list for permanent removal if selected and do not add a possible page break
// on the sub-step (do not execute the 'else' code)
if (sci.Step_SubStepPagebreak && MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks != null &&
!MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Contains(MyItemInfo.ItemID))
MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Add(MyItemInfo.ItemID);
else
{
if (sdpara == null) sdpara = new SortedList<float, vlnParagraph>();
if (myPara.ChildrenAbove != null && myPara.ChildrenAbove.Count > 0) sdpara.Add(-yLocation, myPara.ChildrenAbove[0]);
@ -1491,6 +1510,7 @@ namespace Volian.Print.Library
}
}
}
}
return sdpara;
}

View File

@ -2746,6 +2746,7 @@ namespace Volian.Print.Library
{
if (!HasManPagAnnot(ii, "Removed Manual Page Break")) VEPROMS.CSLA.Library.Annotation.MakeAnnotation(itm, AnnotationType.GetByNameOrCreate("Manual Pagination Issues"), null, "Removed Manual Page Break", null);
sc.Step_NewManualPagebreak = false; // reset the flag that was set in the config
if (sc.Step_SubStepPagebreak) sc.Step_SubStepPagebreak = false; // C2023-018: remove substep page break flags
itm.MyContent.Config = sc.ToString();
itm.MyContent.DTS = DateTime.Now;
itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID;