C2016-004: Added new format flag ‘NoDefaultSectReq’ to Transdata to use 1st step section as Default if none defined

This commit is contained in:
Kathy Ruffing 2016-03-18 15:26:13 +00:00
parent 15c96e66b8
commit ba8d5d9ea7
3 changed files with 23 additions and 2 deletions

Binary file not shown.

View File

@ -5797,6 +5797,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _DoSectionTransitions, "@DoSectionTransitions");
}
}
private LazyLoad<bool> _NoDefaultSectReq;
public bool NoDefaultSectReq
{
get
{
return LazyLoad(ref _NoDefaultSectReq, "@NoDefaultSectReq");
}
}
private LazyLoad<bool> _AllowTransitionFromSection;
public bool AllowTransitionFromSection
{

View File

@ -548,6 +548,9 @@ namespace Volian.Controls.Library
}
private void cbTranProcsFillIn(ItemInfo prcitm)
{
ItemInfo curSelProc = null;
if (cbTranProcs.Items.Count > 0) curSelProc = cbTranProcs.SelectedItem as ItemInfo;
if (curSelProc != null && prcitm.ItemID == curSelProc.ItemID) return;
cbTranProcs.Items.Clear();
ItemInfo selitm = prcitm; // this is the selected 'procedure'
prcitm = prcitm.FirstSibling;
@ -885,7 +888,9 @@ namespace Volian.Controls.Library
// 1) Look in ProcedureConfig/SectionStart
// 2) Look in SectionConfig/OriginalSteps
// 3) Search through the procedure's sections for 'Procedure Steps' as the title
// 4) Display message box telling user to set the default section on section properties/format dialog
// 4) If plant has format flag that procedure doesn't require default sections to be set, and none
// have been, return first in list.
// 5) Display message box telling user to set the default section on section properties/format dialog
// (this returns a -1, i.e. error)
// 1) Look in ProcedureConfig/SectionStart
@ -937,7 +942,15 @@ namespace Volian.Controls.Library
return sit.ItemID;
}
}
// 4) Display messagebox to tell user to specify which section should be used as the 'default section'.
// 4) Format has flag that a default section is not required so return 1st section.
if (prcitm.Sections != null)
{
foreach (SectionInfo sid in prcitm.Sections)
{
if (sid.IsStepSection && sid.ActiveFormat.PlantFormat.FormatData.TransData.NoDefaultSectReq) return sid.ItemID;
}
}
// 5) Display messagebox to tell user to specify which section should be used as the 'default section'.
MessageBox.Show("No default step section was found. Set the appropriate Step Section as the default by using the Section Property Page, Format Tab.", "Transition using Default Step Section in Format", MessageBoxButtons.OK,MessageBoxIcon.Error);
return -1;
}