From 627d12e5cffbb6ce377571a73e24b629fd428422 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 24 Mar 2021 19:52:19 +0000 Subject: [PATCH] =?UTF-8?q?F2021-009=20PROMS=20Express=20=E2=80=93=20Chang?= =?UTF-8?q?e=20tool=20tip=20of=20the=20insert=20sub-step=20ribbon=20button?= =?UTF-8?q?=20to=20warn=20user=20when=20they=20are=20exceeding=20the=20num?= =?UTF-8?q?ber=20of=20sub-steps=20defined=20in=20the=20format.=20Added=20c?= =?UTF-8?q?all=20to=20check=20sub-step=20levels=20when=20doing=20a=20Paste?= =?UTF-8?q?=20of=20a=20CopyStep.=20=20Added=20a=20message=20box=20to=20war?= =?UTF-8?q?n=20user=20when=20they=20are=20adding=20excessive=20sub-step=20?= =?UTF-8?q?levels=20when=20using=20the=20=20shortcut=20key?= =?UTF-8?q?=20stroke.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Volian.Controls.Library/StepTabRibbon.cs | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index ad1c58b1..c1cbf25a 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -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