Calvert: for VALTYPE & STARTUP page list tokens, if there are no steps in section, check for 1st subsection steps

only change availability of notes/cautions if in the Calvert Alarm format when checking if IsInCalvertConditionResponse
This commit is contained in:
Kathy Ruffing 2014-12-05 15:22:47 +00:00
parent 27c8d89bed
commit 298354f4fd
2 changed files with 65 additions and 29 deletions

View File

@ -450,7 +450,8 @@ namespace Volian.Controls.Library
btnCMInsHLS.Enabled = btnCMInsRNO.Enabled = btnCMInsSubStps.Enabled = btnCMInsCaution.Enabled = btnCMInsHLS.Enabled = btnCMInsRNO.Enabled = btnCMInsSubStps.Enabled = btnCMInsCaution.Enabled =
btnCMInsNote.Enabled = btnCMInsTable.Enabled = btnCMInsFigure.Enabled = allow; btnCMInsNote.Enabled = btnCMInsTable.Enabled = btnCMInsFigure.Enabled = allow;
// if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes // if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes
btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = allow && !MyItemInfo.IsInCalvertConditionResponse; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = allow && !MyItemInfo.IsInCalvertConditionResponse;
} }
void MyFlexGrid_SelChange(object sender, EventArgs e) void MyFlexGrid_SelChange(object sender, EventArgs e)
@ -879,7 +880,8 @@ namespace Volian.Controls.Library
btnInsCaut.Enabled = true; btnInsCaut.Enabled = true;
} }
// if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes // if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes
btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = setting && !MyItemInfo.IsInCalvertConditionResponse; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = setting && !MyItemInfo.IsInCalvertConditionResponse;
} }
private void SetButtonAndMenuEnabling(bool docontextmenus) private void SetButtonAndMenuEnabling(bool docontextmenus)
{ {
@ -1208,7 +1210,8 @@ namespace Volian.Controls.Library
btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true; btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true;
// if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes // if in Calvert Alarms Condition/Response, disable insert of Cautions and Notes
btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = !MyItemInfo.IsInCalvertConditionResponse; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = !MyItemInfo.IsInCalvertConditionResponse;
_RibbonControl.Refresh(); // jsj- added this because Table Design ribbon tab grouping was not going away when not on a table step type _RibbonControl.Refresh(); // jsj- added this because Table Design ribbon tab grouping was not going away when not on a table step type
} }

View File

@ -1575,38 +1575,51 @@ namespace Volian.Print.Library
plstr = plstr.Replace(token, HLSText); plstr = plstr.Replace(token, HLSText);
break; break;
case "{VALTYPE}": case "{VALTYPE}":
ItemInfo firstHigh = section.Steps[0]; ItemInfo firstHigh = ValveGetFirstStep(section);
int typ = (int)firstHigh.MyContent.Type - 20000; if (firstHigh != null)
switch (typ)
{ {
case 2: int typ = (int)firstHigh.MyContent.Type - 20000;
plstr = plstr.Replace(token, "VALVE"); switch (typ)
break; {
case 9: case 2:
plstr = plstr.Replace(token, "SWITCH"); plstr = plstr.Replace(token, "VALVE");
break; break;
case 3: case 9:
plstr = plstr.Replace(token, "BREAKER"); plstr = plstr.Replace(token, "SWITCH");
break; break;
case 3:
plstr = plstr.Replace(token, "BREAKER");
break;
default:
plstr = plstr.Replace(token, "");
break;
}
} }
else
plstr = plstr.Replace(token, "");
break; break;
case "{STARTUP}": case "{STARTUP}":
ItemInfo firstHighs = section.Steps[0]; ItemInfo firstHighs = ValveGetFirstStep(section);
int typs = (int)firstHighs.MyContent.Type - 20000; if (firstHighs != null)
switch (typs)
{ {
case 2: int typs = (int)firstHighs.MyContent.Type - 20000;
// the following test for OI-3A came from 16bit code: switch (typs)
if (section.MyProcedure.MyContent.Number.ToUpper().Equals("OI-3A")) {
plstr = plstr.Replace(token, " SDC/"); case 2:
else // the following test for OI-3A came from 16bit code:
plstr = plstr.Replace(token, "STARTUP/"); string num = section.MyProcedure.MyContent.Number.ToUpper().Replace(@"\U8209?", "-");
break; if (num.Equals("OI-3A"))
case 9: plstr = plstr.Replace(token, " SDC/");
case 3: else
plstr = plstr.Replace(token, ""); plstr = plstr.Replace(token, "STARTUP/");
break; break;
default:
plstr = plstr.Replace(token, "");
break;
}
} }
else
plstr = plstr.Replace(token, "");
break; break;
case "{PROCDES}": case "{PROCDES}":
ProcDescrList pdl = section.ActiveFormat.PlantFormat.FormatData.PrintData.ProcDescrList; ProcDescrList pdl = section.ActiveFormat.PlantFormat.FormatData.PrintData.ProcDescrList;
@ -1813,6 +1826,26 @@ namespace Volian.Print.Library
return retval; return retval;
} }
private static ItemInfo ValveGetFirstStep(VEPROMS.CSLA.Library.SectionInfo section)
{
ItemInfo firstHigh = null;
if (section.Steps == null || section.Steps.Count == 0)
{
// see if there is a 1st subsection with a step. The formats must match
// if this is true, use that step. Otherwise just clear the token.
if (section.Sections != null && section.Sections.Count > 0 &&
section.Sections[0].Steps != null || section.Sections[0].Steps.Count != 0)
{
if (section.ActiveFormat.FormatID == section.Sections[0].ActiveFormat.FormatID &&
section.MyContent.Type == section.Sections[0].MyContent.Type)
firstHigh = section.Sections[0].Steps[0];
}
}
else
firstHigh = section.Steps[0];
return firstHigh;
}
private string GetAttachNum1() private string GetAttachNum1()
{ {
int cnt = 0; int cnt = 0;