F2021-009 PROMS Express – Change tool tip of the insert sub-step ribbon button to warn user when they are exceeding the number of sub-steps defined in the format. Added call to check sub-step levels when doing a Paste of a CopyStep. Added a message box to warn user when they are adding excessive sub-step levels when using the <Shift><Ctrl><S> shortcut key stroke.

This commit is contained in:
John Jenko 2021-03-24 19:52:19 +00:00
parent 47c64e0ad4
commit 627d12e5cf

View File

@ -2281,12 +2281,16 @@ namespace Volian.Controls.Library
}
}
// If in Proms Express, let user know if they are going to create a new substep deeper than 4 levels. This uses the
// tool tip to display the message.
// F2021-009 If in Proms Express, let user know if they are going to create a new substep deeper than the defined number of sub-step.
// This uses the tool tip to display the message.
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.Express && btn.Name == "btnInsSubstep" && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0))
{
if (MyItemInfo.GetStepLevel() >= 4)
this.superTooltipRibbon.SetSuperTooltip(this.btnInsSubstep, new DevComponents.DotNetBar.SuperTooltipInfo("Per PPA WG Standard If the task exceeds four step levels, consider rewriting the task.", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Red));
if (MyItemInfo.GetStepLevel() >= MyItemInfo.GetDefinedSubStepCount())
{
string tpMsg = "Steps with excessive sub-step levels can be difficult to follow." +
"\nConsider rewriting the step using less sub-steps levels.";
this.superTooltipRibbon.SetSuperTooltip(this.btnInsSubstep, new DevComponents.DotNetBar.SuperTooltipInfo(tpMsg, "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Red));
}
}
rbnStepParts.Refresh();
}
@ -3547,9 +3551,15 @@ namespace Volian.Controls.Library
moveDown = cnt;
cnt++;
}
// If in Proms Express, let user know if they are going to create a new substep deeper than 4 levels:
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.Express && MyItemInfo.GetStepLevel() >= 4)
FlexibleMessageBox.Show("Per PPA WG Standard If the task exceeds four step levels, consider rewriting the task.", "Warning...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// F2021-009 If in Proms Express, let user know if they are going to create a new substep deeper than the defined sub-step levels
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.Express && MyItemInfo.GetStepLevel() >= MyItemInfo.GetDefinedSubStepCount())
{
string msg = "Professional procedure writing standards (PPA) discourages\n" +
"excessive sub-step levels. With each sub-step level, there\n" +
"is less room for text, which could lead to steps that are\n" +
"difficult to follow.";
FlexibleMessageBox.Show(msg, "PPA Writing Standards", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
break;
case "InsCaution":
displayMenu = ((actable & E_AccStep.AddingCaution) > 0) && btnCMInsCaution.Enabled;
@ -3882,6 +3892,8 @@ namespace Volian.Controls.Library
StepTabPanel tmp = Parent as StepTabPanel;
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
SaveTableChanges(); // B2018-055 Save Current Changes to the table
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, false);
MyEditItem.PasteSiblingAfter(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
}
private void btnPasteBefore_Click(object sender, EventArgs e)
@ -3889,6 +3901,8 @@ namespace Volian.Controls.Library
StepTabPanel tmp = Parent as StepTabPanel;
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
SaveTableChanges(); // B2018-055 Save Current Changes to the table
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, false);
MyEditItem.PasteSiblingBefore(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
}
private void btnStepPaste_Click(object sender, EventArgs e)
@ -3927,6 +3941,8 @@ namespace Volian.Controls.Library
{
StepTabPanel tmp = Parent as StepTabPanel;
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, true);
EditItem oldEditItem = MyEditItem;
MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
if (MyEditItem == null) oldEditItem.IdentifyMe(false); // B2017-179 if null then we didn't do the replace but did position to the first transition that needs resolved