This commit is contained in:
2011-06-16 10:32:59 +00:00
parent f1d48204c6
commit 37dc25c7cb
3 changed files with 63 additions and 31 deletions

View File

@@ -1996,15 +1996,45 @@ namespace VEPROMS.CSLA.Library
{
int level = 0;
ItemInfo par = this;
ItemInfo LastRNO = null;
while (!par.IsHigh)
{
// 16bit TODO:
//if (par.IsRNO) // do I need to save 'lastrnoptr'
//if (!IsRNO(ptr) && (IsSequential(ptr) ||
// (!IsText(ptr) && CountAllSubLevels))) - Add this line of code for non-hlp
if (!par.IsRNOPart && par.IsSequential) level++;
if (par.IsRNOPart) LastRNO = par.MyParent;
if (!par.IsRNOPart && (par.IsSequential || (!(par.IsCaution || par.IsNote)
&& ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CountAllSubLevels)))
level++;
par = par.MyParent;
}
// ImperfectStructure is used so that the sequential numbering for substeps under an RNO is not same
// numbering (alpha vs numeric), if the HLS has substeps - WCNS uses this, as well as other plants.
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructure && IsSequential
&& (LastRNO !=null) && LastRNO.IsHigh && LastRNO.HasChildren
&& LastRNO.FirstChild(E_FromType.Step) != null && LastRNO.FirstChild(E_FromType.Step).IsSequential)
{
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) level += 2;
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectSubstep && !ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4)
level--;
}
// ImperfectStructure for substeps - only good for level 1 RNOs
else if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectSubstep && RNOLevel == 1)
{
par = this;
while (!par.IsRNOPart) par = par.MyParent; // get to the rno.
if (par.MyParent.HasChildren) // if hls has children?
{
ItemInfo tchild = par.FirstChild(E_FromType.Step);
if (tchild != null)
{
int typ = (int)tchild.MyContent.Type - 20000;
if (ActiveFormat.PlantFormat.FormatData.StepDataList[typ].TabData.IdentPrint.Contains("{seq}"))
{
level++;
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) level += 1;
if (!ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) level -= 1;
}
}
}
}
SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList;
tbformat = seqtabs[level % seqtabs.Count].PrintTabFormat;
// If token includes 'Wpar', the parent tab prefix's the tab.
@@ -2045,11 +2075,15 @@ namespace VEPROMS.CSLA.Library
tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : ordinal.ToString().PadLeft(2));
tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString());
if (tbformat.IndexOf("{!C0}") > -1)
if (tbformat.IndexOf("{!C0}") > -1) // wolf creek uses this to get lines above/below step number
{
cltext = cltext == null ? tbformat.Replace("{!C0}", "") : cltext.Replace("{!C0}", "");
cltext = cltext + " ";
}
if (FormatStepData.Sep != null && MyPrevious != null)
// "{Null}" was introduced so that inheritance in format files could differentiate between an
// empty string, and null. And also, so that if a tab was null but it's parent had text in the
// tab, don't inherit the parent's tab, use a null.
if ((FormatStepData.Sep != null && FormatStepData.Sep !="{Null}")&& MyPrevious != null)
{
if (_MyHeader == null) _MyHeader = new MetaTag(FormatStepData.TabData.Font);
_MyHeader.Text = FormatStepData.Sep;
@@ -2090,7 +2124,6 @@ namespace VEPROMS.CSLA.Library
//wkstr = wkstr.Replace("{!asterisk}", "\\fs10 \\b*\\b0"); // was font size 20 in 16-bit
//wkstr = Regex.Replace(wkstr, @"{![.*?]}", @"{!$1}");
//wkstr = wkstr.Replace("{}", "");
//wkstr = wkstr.Replace("<22>", "{!C0}");
//if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0,"{!C0}");
//wkstr = wkstr.Replace("<22>", @"{Box Step}");
@@ -2134,9 +2167,18 @@ namespace VEPROMS.CSLA.Library
_MyHeader.Text = tbformat.Trim(); ;
_MyHeader.CleanText = StripRtfFormatting(_MyHeader.Text);
// if there is only step in the group - no bullet is used, if more that one replace the tab
// with a bullet
// with a bullet. Also, if only one in group and tab text ends with 'S', remove it:
if (MyPrevious == null && NextItem == null)
{
if (_MyHeader.CleanText.ToUpper().EndsWith("S"))
{
string origTxt = _MyHeader.CleanText;
_MyHeader.CleanText = _MyHeader.CleanText.Substring(0, _MyHeader.CleanText.Length - 1);
// Text may have rtf commands:
_MyHeader.Text = _MyHeader.Text.Replace(origTxt, _MyHeader.CleanText);
}
tbformat = "";
}
else
{
if (MyPrevious != null) _MyHeader = null;
@@ -2301,7 +2343,6 @@ namespace VEPROMS.CSLA.Library
public ContentAlignment Justify = ContentAlignment.MiddleLeft;
public string Text; // may include tokens, such as macros for circles/diamonds, etc
public string CleanText; // all tokens removed
//public bool _TagsSetup = false;
public MetaTag()
{
}