From 48ee3854a2ff8a5682473739e18a75bf3260040b Mon Sep 17 00:00:00 2001 From: John Date: Mon, 24 Feb 2014 16:36:20 +0000 Subject: [PATCH] Fixed checkoff logic so that it handles Signoff style of checkoffs The checkoff/signoff list was not always refreshing in the step properties panel. Added format flag CheckoffOnSubStepsOnly for Bryon and Braidwood --- .../frmSectionProperties.cs | 19 +++++++++++++------ PROMS/VEPROMS User Interface/frmVEPROMS.cs | 1 + .../Format/PlantFormat.cs | 9 +++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 9ee991f3..e461e807 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -25,6 +25,7 @@ namespace VEPROMS private Document _DocumentToDelete = null; private StepTabRibbon _MyStepTabRibbon; private bool _isStepSection = true; + private bool _hasSectionCheckoffDefault = false; public frmSectionProperties(SectionConfig sectionConfig) { @@ -84,8 +85,8 @@ namespace VEPROMS CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList; CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList; if (ppGpbxSignoffCheckoff.Enabled && (chkoffList != null && chkoffList.Count > 1) - && (ppCmbxCheckoffType.SelectedIndex != _SectionConfig.Section_CheckoffListSelection - 1)) - _SectionConfig.Section_CheckoffListSelection = ppCmbxCheckoffType.SelectedIndex + 1; + && (ppCmbxCheckoffType.SelectedIndex != _SectionConfig.Section_CheckoffListSelection - (_hasSectionCheckoffDefault? 1:0))) + _SectionConfig.Section_CheckoffListSelection = ppCmbxCheckoffType.SelectedIndex + (_hasSectionCheckoffDefault? 1:0); if (ppCmbxCheckoffHeading.Enabled && chkoffHeaderList != null && chkoffHeaderList.Count > 1) _SectionConfig.Section_CheckoffHeaderSelection = ppCmbxCheckoffHeading.SelectedIndex; @@ -464,18 +465,24 @@ namespace VEPROMS PlantFormat pf = _SectionConfig.MyFormat!=null?_SectionConfig.MyFormat.PlantFormat:_SectionConfig.MyDefaultFormat.PlantFormat; CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList; CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList; - if (chkoffList != null && chkoffList.Count > 0) + if (chkoffList != null && chkoffList.Count > 0 && + (pf.FormatData.ProcData.CheckOffData.Menu == "Signoff" || chkoffList[0].MenuItem.ToUpper().Equals("{SECTION DEFAULT}"))) { if (SectionPropertyCheckOffList!=null)SectionPropertyCheckOffList.Clear(); SectionPropertyCheckOffList = new List(); // Don't put up the first item in the chkoffList, it is '{Section Default}'. - for (int i = 1; i < chkoffList.Count; i++) + _hasSectionCheckoffDefault = false; + //for (int i = 1; i < chkoffList.Count; i++) + for (int i = 0; i < chkoffList.Count; i++) { - SectionPropertyCheckOffList.Add(chkoffList[i]); + if (!chkoffList[i].MenuItem.ToUpper().Equals("{SECTION DEFAULT}")) + SectionPropertyCheckOffList.Add(chkoffList[i]); + else + _hasSectionCheckoffDefault = true; } ppGpbxSignoffCheckoff.Enabled = true; ppCmbxCheckoffType.DataSource = SectionPropertyCheckOffList; - ppCmbxCheckoffType.SelectedIndex = _SectionConfig.Section_CheckoffListSelection-1; + ppCmbxCheckoffType.SelectedIndex = _SectionConfig.Section_CheckoffListSelection - (_hasSectionCheckoffDefault ? 1 : 0); } else { diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 6b75630e..7bbe9342 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -1909,6 +1909,7 @@ namespace VEPROMS infotabFoldoutMaint.Visible = infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = infotabHistory.Visible = infotabApplicability.Visible = false; // When infotabTags is set to InVisible, the matching panel also needs to be set to invisible infotabControlPanelTags.Visible = false; + displayTags.MyEditItem = null; displayTags.Visible = false; SelectedStepTabPanel = null; lblItemID.Text = "No Item Selected"; diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 79f41e4a..beb3c443 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -1250,6 +1250,15 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _SkipSpaces, "@SkipSpaces"); } } + // put in for Bryon and Braidwood + private LazyLoad _CheckoffOnSubStepsOnly; + public bool CheckoffOnSubStepsOnly + { + get + { + return LazyLoad(ref _CheckoffOnSubStepsOnly, "@CheckoffOnSubStepsOnly"); + } + } } #endregion //#region RightCheckOffBox