C2021-027: Procedure level PC/PC

This commit is contained in:
2021-05-20 14:31:59 +00:00
parent 1a543f663d
commit a203bc199b
11 changed files with 138 additions and 51 deletions

View File

@@ -2740,7 +2740,11 @@ namespace VEPROMS.CSLA.Library
return true;
ItemInfo parent = this.ActiveParent as ItemInfo;
IItemConfig cfg = this.MyConfig as IItemConfig;
return (this.IsProcedure || parent.IsApplicable(apple)) && (cfg.MasterSlave_Applicability.GetFlags().Count == 0 || cfg.MasterSlave_Applicability.GetFlags().Contains(apple));
if (IsProcedure) // C2021-027: Procedure level PC/PC. if procedure, don't go to parent.
{
return (cfg.MasterSlave_Applicability.GetFlags().Count == 0 || cfg.MasterSlave_Applicability.GetFlags().Contains(apple));
}
return (parent.IsApplicable(apple)) && (cfg.MasterSlave_Applicability.GetFlags().Count == 0 || cfg.MasterSlave_Applicability.GetFlags().Contains(apple));
}
//end jcb added inherited applicability
public string FormattedDisplayText
@@ -5282,6 +5286,7 @@ namespace VEPROMS.CSLA.Library
{
if (_SectionCheckOffHeader == null)
{
if (ActiveSection == null) return _SectionCheckOffHeader;
// first check if format has checkoff data, including checkoffheaders.
ProcData pd = ActiveFormat.PlantFormat.FormatData.ProcData;
if (pd.CheckOffData == null || pd.CheckOffData.CheckOffHeaderList == null || pd.CheckOffData.CheckOffHeaderList.MaxIndex <= 1) _SectionCheckOffHeader = string.Empty;
@@ -6906,6 +6911,34 @@ namespace VEPROMS.CSLA.Library
[Serializable()]
public partial class ProcedureInfo : ItemInfo, IVEDrillDownReadOnly
{
// C2021-027: Procedure level PC/PC. these 2 methods determine whether a procedure is included, either by an integer index
// or by a string name of the unit
public bool ApplInclude(int ApplicabilityIndex)
{
if (ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
{
ProcedureConfig cfg = MyConfig as ProcedureConfig;
return (cfg.MasterSlave_Applicability.GetFlags().Count == 0 || cfg.MasterSlave_Applicability.GetFlags().Contains(ApplicabilityIndex));
}
return true;
}
public bool ApplIncludeFromStr(string s)
{
// s is the unitname, find this name in list of applicabilities & then see if this one is used
if (ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
{
// get index
int i = 1;
foreach (string str in MyDocVersion.UnitNames)
{
if (str == s) break;
i++;
}
ProcedureConfig cfg = MyConfig as ProcedureConfig;
return (cfg.MasterSlave_Applicability.GetFlags().Count == 0 || cfg.MasterSlave_Applicability.GetFlags().Contains(i));
}
return true;
}
private bool? _ProcHasSupInfoData = null;
public bool ProcHasSupInfoData
{