B2021-149: When changing applicability for a procedure, internal transitions should not prevent change
This commit is contained in:
parent
b1ecf81391
commit
0c96445942
@ -212,7 +212,9 @@ namespace Volian.Controls.Library
|
||||
// }
|
||||
//}
|
||||
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(MyItemInfo.ItemID, MyApplicability);
|
||||
if (invalidTrans.Count == 0)
|
||||
// B2021-149: for Procedure level PC/PC, continue processing if all 'invalid' transitions are internal (query used
|
||||
// return internal and external for the procedure level)
|
||||
if ((!MyItemInfo.IsProcedure && invalidTrans.Count == 0) || IsProcWithNoExternalTrans(MyItemInfo, invalidTrans))
|
||||
{
|
||||
// C2021 - 027: Procedure level PC/PC
|
||||
if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
|
||||
@ -236,8 +238,11 @@ namespace Volian.Controls.Library
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("Changing the applicability for this step will invalidate a transition in the following steps...");
|
||||
sb.AppendLine();
|
||||
// B2021-149: if step, put out line for every invalidTrans, if procedure only put out those that are external
|
||||
// determine this by looking strings for source and target (to), if procedure level and internal the target starts
|
||||
// with the src, i.e. procedure.
|
||||
foreach (InvalidTransition inv in invalidTrans)
|
||||
sb.AppendLine(string.Format("From {0} to {1}", inv.SrcStep, inv.TgtStep));
|
||||
if (!MyItemInfo.IsProcedure || !inv.TgtStep.StartsWith(inv.SrcStep))sb.AppendLine(string.Format("From {0} to {1}",inv.TgtStep, inv.SrcStep));
|
||||
// MessageBox.Show(sb.ToString());
|
||||
// B2013-185 use FlexibleMessageBox to display a long list with a scroll bar
|
||||
FlexibleMessageBox.Show(sb.ToString(), "Transitions Affected By Applicability Change");
|
||||
@ -261,6 +266,18 @@ namespace Volian.Controls.Library
|
||||
// s.Save();
|
||||
//}
|
||||
}
|
||||
// B2021-149: for procedure, only consider external transitions as invalid
|
||||
private bool IsProcWithNoExternalTrans(ItemInfo ii, List<InvalidTransition> invalidTrans)
|
||||
{
|
||||
if (invalidTrans.Count == 0) return true;
|
||||
foreach (InvalidTransition iT in invalidTrans)
|
||||
{
|
||||
// if target (to location) does not start with source location (procedure) then this is external
|
||||
// i.e. from a different procedure
|
||||
if (!iT.TgtStep.StartsWith(iT.SrcStep)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private bool AllNumbered(CheckState checkState)
|
||||
{
|
||||
foreach (CheckBox cb in MyCheckBoxes.Values)
|
||||
|
Loading…
x
Reference in New Issue
Block a user