From ff57e045213fa985d2232f8affe0bbf61dadd14e Mon Sep 17 00:00:00 2001 From: John Date: Wed, 20 Aug 2014 17:52:23 +0000 Subject: [PATCH] Added logic to identify that we are in a Condition/Response section of the Calvert Cliffs Alarms Disable the ability to insert a Caution or Note when in a Condition/Response section of the Calvert Cliffs Alarms --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 19 +++++++++++++++++++ .../Volian.Controls.Library/StepTabRibbon.cs | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index b92e3078..54b19fda 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -1331,6 +1331,25 @@ namespace VEPROMS.CSLA.Library return parent.IsInRNO; } } + public bool IsInCalvertConditionResponse + { + get + { + ItemInfo itmifo = this; + bool rtn = false; + if (ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) + { + // TemplateChildColumnMode is set to 2 for the TitleWithTextBelow step type + // we want to stop searching at this level + while (!rtn && itmifo != null && itmifo.IsStep && !itmifo.TemplateChildColumnMode.Equals(2)) + { + rtn = itmifo.TemplateColumnMode.Equals(2); + itmifo = itmifo.MyParent; + } + } + return rtn; + } + } #endregion #region Level Columns Relationships public int RNOLevel diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 862f5c1b..5b818b67 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -448,6 +448,8 @@ namespace Volian.Controls.Library // toggle context menus used with the shortcut key btnCMInsHLS.Enabled = btnCMInsRNO.Enabled = btnCMInsSubStps.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = btnCMInsTable.Enabled = btnCMInsFigure.Enabled = allow; + // if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes + btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = allow && !MyItemInfo.IsInCalvertConditionResponse; } void MyFlexGrid_SelChange(object sender, EventArgs e) @@ -875,6 +877,8 @@ namespace Volian.Controls.Library btnInsNote.Enabled = true; btnInsCaut.Enabled = true; } + // if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes + btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = setting && !MyItemInfo.IsInCalvertConditionResponse; } private void SetButtonAndMenuEnabling(bool docontextmenus) { @@ -1134,6 +1138,9 @@ namespace Volian.Controls.Library btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true; + // if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes + btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = !MyItemInfo.IsInCalvertConditionResponse; + _RibbonControl.Refresh(); // jsj- added this because Table Design ribbon tab grouping was not going away when not on a table step type } ///