Fixed checkoff logic so that it handles Signoff style of checkoffs

Fixed the placement of signoff style of checkoffs for Byron and Braidwood
This commit is contained in:
John Jenko 2014-02-24 16:37:25 +00:00
parent 48ee3854a2
commit 1d0dff2198
2 changed files with 53 additions and 10 deletions

View File

@ -156,12 +156,12 @@ namespace Volian.Controls.Library
cmbCheckoff.Enabled = false; // Checkoffs already assigned to RNO. cmbCheckoff.Enabled = false; // Checkoffs already assigned to RNO.
if (StepOverRide()) cmbCheckoff.Enabled = false; // Checkoffs already assigned to AER if (StepOverRide()) cmbCheckoff.Enabled = false; // Checkoffs already assigned to AER
// if there are no checkoffs OR //// if there are no checkoffs OR
// if this is a sign-off, the checkoff list is not enabled either (matches 16bit functionality) At some point, we //// if this is a sign-off, the checkoff list is not enabled either (matches 16bit functionality) At some point, we
// may want to allow them to turn off the checkoff //// may want to allow them to turn off the checkoff
if ((fmtdata.ProcData.CheckOffData.CheckOffList == null || fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0) || //if ((fmtdata.ProcData.CheckOffData.CheckOffList == null || fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0) ||
fmtdata.ProcData.CheckOffData.Menu=="Signoff") // fmtdata.ProcData.CheckOffData.Menu=="Signoff")
cmbCheckoff.Enabled = false; // cmbCheckoff.Enabled = false;
if (sc == null) // if there is no config data, Page Break and CAS check boxes are false if (sc == null) // if there is no config data, Page Break and CAS check boxes are false
{ {
@ -173,8 +173,10 @@ namespace Volian.Controls.Library
if (CurItemInfo.IsHigh) cbPageBreak.Checked = sc.Step_NewManualPagebreak; if (CurItemInfo.IsHigh) cbPageBreak.Checked = sc.Step_NewManualPagebreak;
cbCAS.Checked = sc.Step_CAS; cbCAS.Checked = sc.Step_CAS;
} }
bool _checkoffsAllowed = true;
if (!(fmtdata.ProcData.CheckOffData.CheckOffList == null) && !(fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0)) if (fmtdata.ProcData.CheckOffData.CheckoffOnSubStepsOnly)
_checkoffsAllowed = cmbCheckoff.Enabled = CurItemInfo.IsType("Substep");
if (_checkoffsAllowed && !(fmtdata.ProcData.CheckOffData.CheckOffList == null) && !(fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0))
{ {
cmbCheckoff.Items.Clear(); cmbCheckoff.Items.Clear();
foreach (CheckOff co in fmtdata.ProcData.CheckOffData.CheckOffList) foreach (CheckOff co in fmtdata.ProcData.CheckOffData.CheckOffList)
@ -183,6 +185,17 @@ namespace Volian.Controls.Library
} }
if (sc.Step_CheckOffIndex != -1) cmbCheckoff.SelectedIndex = sc.Step_CheckOffIndex; if (sc.Step_CheckOffIndex != -1) cmbCheckoff.SelectedIndex = sc.Step_CheckOffIndex;
} }
// if there are no checkoffs OR
// if this is a sign-off, the checkoff list is not enabled either (matches 16bit functionality) At some point, we
// may want to allow them to turn off the checkoff
// Catawba and McGuire formats use this
if (_checkoffsAllowed && (fmtdata.ProcData.CheckOffData.CheckOffList == null || fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0) ||
fmtdata.ProcData.CheckOffData.Menu == "Signoff")
{
SectionConfig secf = CurItemInfo.MyActiveSection.MyConfig as SectionConfig;
if (secf.Section_CheckoffListSelection > 0) cmbCheckoff.SelectedIndex = secf.Section_CheckoffListSelection - ((fmtdata.ProcData.CheckOffData.Menu == "Signoff") ? 0 : 1);
cmbCheckoff.Enabled = false;
}
// change bar setting depends on whether step has changed (dts) as compared to date/time off the // change bar setting depends on whether step has changed (dts) as compared to date/time off the
// procedure that it's in. // procedure that it's in.

View File

@ -187,6 +187,8 @@ namespace Volian.Controls.Library
// Deal with change in item data // Deal with change in item data
value.Changed += new ItemInfoEvent(value_Changed); value.Changed += new ItemInfoEvent(value_Changed);
value.OrdinalChanged += new ItemInfoEvent(value_OrdinalChanged); value.OrdinalChanged += new ItemInfoEvent(value_OrdinalChanged);
// do something like this to draw circle around step numbers - note got NULL reference error on NSP data
//if (value.FormatStepData != null && value.FormatStepData.TabData.IdentPrint.Contains("C0")) Circle = true;
} }
} }
void value_Changed(object sender) void value_Changed(object sender)
@ -1693,6 +1695,15 @@ namespace Volian.Controls.Library
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
if (MyItemInfo.IsCaution || MyItemInfo.IsNote) if (MyItemInfo.IsCaution || MyItemInfo.IsNote)
bottom = Top; bottom = Top;
// SameRowAsParent - Comanche Peak Step Designator
//FormatData fmtdata = MyItemInfo.ActiveFormat.PlantFormat.FormatData;
//int formatSteptype = MyItemInfo.FormatStepType;
//if (fmtdata.StepDataList[formatSteptype].SameRowAsParent)
//if (MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2)
// bottom = Top;
if (nextEditItem.Top != bottom) if (nextEditItem.Top != bottom)
{ {
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
@ -2072,6 +2083,11 @@ namespace Volian.Controls.Library
TopMostEditItem.ItemLocation = new Point(TopMostEditItem.ItemLocation.X, _MyParentEditItem.Bottom); TopMostEditItem.ItemLocation = new Point(TopMostEditItem.ItemLocation.X, _MyParentEditItem.Bottom);
//TextWidth = _WidthAdjust + borderWidth + MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1); //TextWidth = _WidthAdjust + borderWidth + MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1);
ContentWidth = _WidthAdjust + BorderWidth + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); ContentWidth = _WidthAdjust + BorderWidth + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode);
//ContentWidth = _WidthAdjust + BorderWidth;
//if (MyItemInfo.FormatStepData.WidthOverrideEdit != null && MyItemInfo.FormatStepData.WidthOverrideEdit > 0)
// ContentWidth += MyStepPanel.ToDisplay(MyItemInfo.FormatStepData.WidthOverrideEdit);
//else
// ContentWidth += MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode);
break; break;
case 2: // Step case 2: // Step
// if Table then determine width and location based upon it's parent's location // if Table then determine width and location based upon it's parent's location
@ -2177,7 +2193,12 @@ namespace Volian.Controls.Library
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
//Location = new Point(_MyParentRTBItem.Left + 20, FindTop(_MyParentRTBItem.Top)); //Location = new Point(_MyParentRTBItem.Left + 20, FindTop(_MyParentRTBItem.Top));
int myTop = MyNextEditItem == null ? _MyParentEditItem.Top : MyNextEditItem.Top; int myTop = MyNextEditItem == null ? _MyParentEditItem.Top : MyNextEditItem.Top;
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote )) //if (MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2)
//{
// if (MyItemInfo.WidthOverride > 0)
// Width = MyStepPanel.ToDisplay(MyItemInfo.WidthOverride) + spaceToRTB;
//}
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote))
{ {
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
//if (MyItemInfo.ItemID == 1 || MyItemInfo.ItemID == 52) //if (MyItemInfo.ItemID == 1 || MyItemInfo.ItemID == 52)
@ -2238,6 +2259,7 @@ namespace Volian.Controls.Library
if (TopMostEditItem == this) if (TopMostEditItem == this)
{ {
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsNote || MyItemInfo.IsCaution)) if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsNote || MyItemInfo.IsCaution))
//if ((MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) || (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsNote || MyItemInfo.IsCaution)))
{ {
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
if (MyItemInfo.IsNote) if (MyItemInfo.IsNote)
@ -2248,6 +2270,7 @@ namespace Volian.Controls.Library
{ {
int top = FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom); int top = FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom);
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && _MyPreviousEditItem.MyItemInfo.IsHigh) if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && _MyPreviousEditItem.MyItemInfo.IsHigh)
//if (MyItemInfo.SameRowAsParent || (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && _MyPreviousEditItem.MyItemInfo.IsHigh))
{ {
if (_MyPreviousEditItem.MyBeforeEditItems != null) if (_MyPreviousEditItem.MyBeforeEditItems != null)
foreach(EditItem ei in _MyPreviousEditItem.MyBeforeEditItems) foreach(EditItem ei in _MyPreviousEditItem.MyBeforeEditItems)
@ -2399,6 +2422,8 @@ namespace Volian.Controls.Library
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
if (MyItemInfo.IsCaution || MyItemInfo.IsNote) if (MyItemInfo.IsCaution || MyItemInfo.IsNote)
top = myParentEditItem.TopMostEditItem.Top; top = myParentEditItem.TopMostEditItem.Top;
//if ((MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) || (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote)))
// top = myParentEditItem.TopMostEditItem.Top;
if (Top < top) if (Top < top)
{ {
LastMethodsPush("SetupRTBItem"); LastMethodsPush("SetupRTBItem");
@ -2505,6 +2530,11 @@ namespace Volian.Controls.Library
else else
{ {
RTBItem ri = this as RTBItem; RTBItem ri = this as RTBItem;
// SkipSpaces puts the checkoff macro (if specified in the format) next to the step tab
// this is used for Bryon and Braidwood
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces)
location = new PointF(ri.MyStepRTB.Left - 50, ri.MyStepRTB.Top);
else
location = new PointF(ri.MyStepRTB.Left + ri.MyStepRTB.Width + 2, ri.MyStepRTB.Top); location = new PointF(ri.MyStepRTB.Left + ri.MyStepRTB.Width + 2, ri.MyStepRTB.Top);
} }
CheckOff co = MyItemInfo.GetCheckOffStep(); CheckOff co = MyItemInfo.GetCheckOffStep();