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:
parent
27c8d89bed
commit
298354f4fd
@ -450,6 +450,7 @@ namespace Volian.Controls.Library
|
||||
btnCMInsHLS.Enabled = btnCMInsRNO.Enabled = btnCMInsSubStps.Enabled = btnCMInsCaution.Enabled =
|
||||
btnCMInsNote.Enabled = btnCMInsTable.Enabled = btnCMInsFigure.Enabled = allow;
|
||||
// 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;
|
||||
}
|
||||
|
||||
@ -879,6 +880,7 @@ namespace Volian.Controls.Library
|
||||
btnInsCaut.Enabled = true;
|
||||
}
|
||||
// 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 = setting && !MyItemInfo.IsInCalvertConditionResponse;
|
||||
}
|
||||
private void SetButtonAndMenuEnabling(bool docontextmenus)
|
||||
@ -1208,6 +1210,7 @@ namespace Volian.Controls.Library
|
||||
btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true;
|
||||
|
||||
// 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 = !MyItemInfo.IsInCalvertConditionResponse;
|
||||
|
||||
_RibbonControl.Refresh(); // jsj- added this because Table Design ribbon tab grouping was not going away when not on a table step type
|
||||
|
@ -1575,7 +1575,9 @@ namespace Volian.Print.Library
|
||||
plstr = plstr.Replace(token, HLSText);
|
||||
break;
|
||||
case "{VALTYPE}":
|
||||
ItemInfo firstHigh = section.Steps[0];
|
||||
ItemInfo firstHigh = ValveGetFirstStep(section);
|
||||
if (firstHigh != null)
|
||||
{
|
||||
int typ = (int)firstHigh.MyContent.Type - 20000;
|
||||
switch (typ)
|
||||
{
|
||||
@ -1588,25 +1590,36 @@ namespace Volian.Print.Library
|
||||
case 3:
|
||||
plstr = plstr.Replace(token, "BREAKER");
|
||||
break;
|
||||
default:
|
||||
plstr = plstr.Replace(token, "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
plstr = plstr.Replace(token, "");
|
||||
break;
|
||||
case "{STARTUP}":
|
||||
ItemInfo firstHighs = section.Steps[0];
|
||||
ItemInfo firstHighs = ValveGetFirstStep(section);
|
||||
if (firstHighs != null)
|
||||
{
|
||||
int typs = (int)firstHighs.MyContent.Type - 20000;
|
||||
switch (typs)
|
||||
{
|
||||
case 2:
|
||||
// the following test for OI-3A came from 16bit code:
|
||||
if (section.MyProcedure.MyContent.Number.ToUpper().Equals("OI-3A"))
|
||||
string num = section.MyProcedure.MyContent.Number.ToUpper().Replace(@"\U8209?", "-");
|
||||
if (num.Equals("OI-3A"))
|
||||
plstr = plstr.Replace(token, " SDC/");
|
||||
else
|
||||
plstr = plstr.Replace(token, "STARTUP/");
|
||||
break;
|
||||
case 9:
|
||||
case 3:
|
||||
default:
|
||||
plstr = plstr.Replace(token, "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
plstr = plstr.Replace(token, "");
|
||||
break;
|
||||
case "{PROCDES}":
|
||||
ProcDescrList pdl = section.ActiveFormat.PlantFormat.FormatData.PrintData.ProcDescrList;
|
||||
@ -1813,6 +1826,26 @@ namespace Volian.Print.Library
|
||||
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()
|
||||
{
|
||||
int cnt = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user