C2021-027: Procedure level PC/PC

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

Binary file not shown.

View File

@ -669,6 +669,9 @@ namespace VEPROMS
{
// This is master/slave & a slave has been selected for printing (SelectedSlave > 0)
if (SelectedSlave > 0)
{
bool includeProc = MyProcedure.ApplInclude(SelectedSlave); // C2021-027: Procedure level PC/PC
if (includeProc)
{
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = SelectedSlave;
SetupForProcedure();
@ -694,6 +697,7 @@ namespace VEPROMS
if (frmStatus.CancelPrinting) break;
AddToMergeList(myProc, locpdfname);
}
}
// This is a master/slave for printing of all slaves (SelectedSave == 0)
else if (SelectedSlave == 0)
{

View File

@ -73,10 +73,14 @@ namespace VEPROMS
_MyApproval.StatusUpdated += new ApprovalStatusChangeEvent(_MyApproval_StatusUpdated);
SetupComboBoxes();
foreach (ProcedureInfo pi in myDocVersion.Procedures)
{
bool includeProc = pi.ApplInclude(ApplicabilityIndex); // C2021-027: Procedure level PC/PC
if (includeProc)
{
pi.MyDocVersion.DocVersionConfig.SelectedSlave = ApplicabilityIndex;
_MyApproval.AddProcedure(pi);
}
}
SetupMyApproval();
// C2018-008 redesign of user interface
_initializing = true;
@ -187,6 +191,9 @@ namespace VEPROMS
{
dpl.Clear();
foreach (ProcedureInfo pi in _MyDocVersion.Procedures)
{
bool includeProc = pi.ApplInclude(ApplicabilityIndex); // C2021-027: Procedure level PC/PC
if (includeProc)
{
OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure);
pi.MyDocVersion.DocVersionConfig.SelectedSlave = _MyDocVersion.DocVersionConfig.SelectedSlave;
@ -206,6 +213,7 @@ namespace VEPROMS
tmpProcedures.Add(pi.DisplayNumber, pi);
}
}
}
if (dpl.Count > 0) return false; // C2018-025 cannot load list of procedure - duplicate proc numbers
for (int i = 0; i < clbMore.Items.Count; i++)
{
@ -267,6 +275,7 @@ namespace VEPROMS
// C2018-008 redesign of user interface
expAddProcConChk.Expanded = true;
_initializing = true;
ApplicabilityIndex = myDocVersion.DocVersionConfig.SelectedSlave;
InitializePanelApprove();
InitializePanelSelect();
_initializing = false;

View File

@ -3569,7 +3569,8 @@ namespace VEPROMS
displayTags.IsVisible = true;
}
infotabHistory.Visible = true;
if (args.MyItemInfo.MyDocVersion.MultiUnitCount > 1 && !args.MyItemInfo.IsProcedure)
// C2021-027: Procedure level PC/PC
if (args.MyItemInfo.MyDocVersion.MultiUnitCount > 1 && args.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl) //&& !args.MyItemInfo.IsProcedure)
{
infotabApplicability.Visible = true;
displayApplicability.MyItemInfo = args.MyEditItem.MyItemInfo;

View File

@ -987,7 +987,10 @@ namespace VEPROMS.CSLA.Library
}
set
{
if (value != null)
_Xp["MasterSlave", "Applicability"] = value.FlagList;
else
_Xp["MasterSlave", "Applicability"] = null;
OnPropertyChanged("MasterSlave_Applicability");
}
}

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
{

View File

@ -1395,6 +1395,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _NotesToFootnotes, "@NotesToFootnotes");
}
}
private LazyLoad<bool> _ProcAppl;
public bool ProcAppl // C2021-027: Procedure level PC/PC
{
get
{
return LazyLoad(ref _ProcAppl, "@ProcAppl");
}
}
private LazyLoad<bool> _CountFoldoutPages;
public bool CountFoldoutPages
{

View File

@ -214,7 +214,13 @@ namespace Volian.Controls.Library
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(MyItemInfo.ItemID, MyApplicability);
if (invalidTrans.Count == 0)
{
if (MyItemInfo.IsSection)
// C2021 - 027: Procedure level PC/PC
if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
{
ProcedureConfig sc = MyItemInfo.MyConfig as ProcedureConfig;
sc.MasterSlave_Applicability = Volian.Base.Library.BigNum.MakeBigNum(MyApplicability);
}
else if (MyItemInfo.IsSection)
{
SectionConfig sc = MyItemInfo.MyConfig as SectionConfig;
sc.MasterSlave_Applicability = Volian.Base.Library.BigNum.MakeBigNum(MyApplicability);
@ -237,6 +243,9 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show(sb.ToString(), "Transitions Affected By Applicability Change");
MyItemInfo = MyItemInfo;
}
// C2021 - 027: Procedure level PC/PC - checkbox for applicability changed, fix ribbon's menus
if (MyItemInfo.IsProcedure) _MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.SetParentChildCreatePDFButton(MyItemInfo.MyDocVersion.UnitNames, MyItemInfo);
//using (Content cnt = Content.Get(MyItemInfo.MyContent.ContentID))
//{
// cnt.DTS = DateTime.Now;
@ -375,9 +384,12 @@ namespace Volian.Controls.Library
EnableCheckboxes();
OnApplicabilityViewModeChanged();
EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
while (ei.Enabled == false)
while (ei!=null && ei.Enabled == false)
ei = ei.MyParentEditItem ?? ei.MyPreviousEditItem;
ei.MyStepRTB.Focus();
// C2021 - 027: Procedure level PC/PC - handle procedure level too for viewing in editor
if (MyDisplayTabItem.MyStepTabPanel.SelectedItemInfo != null && MyDisplayTabItem.MyStepTabPanel.SelectedItemInfo.IsProcedure)
ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
if (ei != null) ei.MyStepRTB.Focus();
}
}

View File

@ -263,8 +263,9 @@ namespace Volian.Controls.Library
if (dvi == null) return;
if (dvi.VersionType > 127)
MyStepTabPanel.MyStepPanel.VwMode = E_ViewMode.View;
// C2021 - 027: Procedure level PC/PC - add _MyIteminfo to argument list
if (dvi.MultiUnitCount > 1)
this.MyStepTabPanel.MyStepTabRibbon.SetParentChildCreatePDFButton(dvi.UnitNames); //C2020-013 add parent/child sub menu items for printing specific children (units)
this.MyStepTabPanel.MyStepTabRibbon.SetParentChildCreatePDFButton(dvi.UnitNames, _MyItemInfo); //C2020-013 add parent/child sub menu items for printing specific children (units)
}
void _MyItemInfo_Changed(object sender)
{

View File

@ -716,6 +716,9 @@ namespace Volian.Controls.Library
// if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes
//if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
//btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = allow && !MyItemInfo.IsInCalvertConditionResponse;
// C2021 - 027: Procedure level PC/PC - if text changed, i.e. applicability may have changed, redo the print menus
if (MyItemInfo != null && MyItemInfo.MyDocVersion.MultiUnitCount > 1)
SetParentChildCreatePDFButton(MyItemInfo.MyDocVersion.UnitNames, MyItemInfo);
}
void MyFlexGrid_SelChange(object sender, EventArgs e)
@ -1916,7 +1919,7 @@ namespace Volian.Controls.Library
}
MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave = 0; // unselect the unit (child)
}
public void SetParentChildCreatePDFButton(string[] unitNames)
public void SetParentChildCreatePDFButton(string[] unitNames, ItemInfo ii)
{
btnPdfCreate.SubItems.Clear();
btnPdfCreate.Tag = null;
@ -1930,10 +1933,18 @@ namespace Volian.Controls.Library
int k = 0;
foreach (string s in unitNames)
{
// C2021-027: Procedure level PC/PC - see if menu items for unit should be enabled
bool procAppl = ii.MyProcedure.ApplIncludeFromStr(s);
k++;
btnPdfCreate.SubItems.Add(MakeSubMenuButton(s,k,miMultiUnit_Click));
btnReviewCreatePDF.SubItems.Add(MakeSubMenuButton(s, k, miMultiUnit_Click));
btnCASCreate.SubItems.Add(MakeSubMenuButton(s, k, miMultiUnit_Click));
ButtonItem btn = MakeSubMenuButton(s, k, miMultiUnit_Click);
btn.Enabled = procAppl;
btnPdfCreate.SubItems.Add(btn);
btn = MakeSubMenuButton(s, k, miMultiUnit_Click);
btn.Enabled = procAppl;
btnReviewCreatePDF.SubItems.Add(btn);
btn = MakeSubMenuButton(s, k, miMultiUnit_Click);
btn.Enabled = procAppl;
btnCASCreate.SubItems.Add(btn);
}
btnPdfCreate.AutoExpandOnClick = true;
btnReviewCreatePDF.AutoExpandOnClick = true;

View File

@ -829,12 +829,17 @@ namespace Volian.Controls.Library
int k = 0;
foreach (string s in pri.MyDocVersion.UnitNames)
{
// C2021-027: Procedure level PC/PC - see if menu items for unit should be enabled
bool procAppl = pri.ApplIncludeFromStr(s);
k++;
MenuItem mp = mip.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
mp.Enabled = procAppl;
mp.Tag = k;
MenuItem ma = mia.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
ma.Enabled = procAppl;
ma.Tag = k;
MenuItem mc = micas.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
mc.Enabled = procAppl;
mc.Tag = k;
}
cm.MenuItems.Add(micas);