Added code to handle diamond1 format item

Added RNOWidthAdj flag for Braidwood
This commit is contained in:
Rich 2014-01-08 20:13:11 +00:00
parent 1b09d64a7f
commit 74886aa3b4
2 changed files with 54 additions and 34 deletions

View File

@ -2192,8 +2192,8 @@ namespace VEPROMS.CSLA.Library
{ {
if (ActiveParent == null) return null; if (ActiveParent == null) return null;
_MyDocVersion = (ActiveParent as ItemInfo).MyDocVersion; _MyDocVersion = (ActiveParent as ItemInfo).MyDocVersion;
}
} }
}
return _MyDocVersion; return _MyDocVersion;
} }
set { _MyDocVersion = value; } set { _MyDocVersion = value; }
@ -2516,7 +2516,7 @@ namespace VEPROMS.CSLA.Library
{ {
_MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText; _MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText;
_MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text; _MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text;
_MyTab.RNOTabWidthAdjust = ((ItemInfo)ActiveParent).FormatStepData.TabData.RNOAdjustTabSize ?? 0; _MyTab.RNOTabWidthAdjust = ((ItemInfo)ActiveParent).FormatStepData.TabData.RNOAdjustTabSize??0;
if (((ItemInfo)ActiveParent).MyTab.Offset != 0) _MyTab.Offset = ((ItemInfo)ActiveParent).MyTab.Offset; if (((ItemInfo)ActiveParent).MyTab.Offset != 0) _MyTab.Offset = ((ItemInfo)ActiveParent).MyTab.Offset;
if (((ItemInfo)ActiveParent).FormatStepData.TabData.RNOExcludeMacros) if (((ItemInfo)ActiveParent).FormatStepData.TabData.RNOExcludeMacros)
_MyTab.Text = Regex.Replace(_MyTab.Text, "{!.+?}", " "); _MyTab.Text = Regex.Replace(_MyTab.Text, "{!.+?}", " ");
@ -2543,11 +2543,11 @@ namespace VEPROMS.CSLA.Library
bool doMeta = false; bool doMeta = false;
if (sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) if (sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)
{ {
if (sd.StepSectionLayoutData.ShowSectionTitles if (sd.StepSectionLayoutData.ShowSectionTitles
&& !MyDocStyle.CancelSectTitle && !MyDocStyle.CancelSectTitle
&& !(MyDocStyle.SpecialStepsFoldout && MyDocStyle.UseColSByLevel)) && !(MyDocStyle.SpecialStepsFoldout && MyDocStyle.UseColSByLevel))
localPrintLevel = PrintLevel + CurrentSectionLevel(); localPrintLevel = PrintLevel + CurrentSectionLevel();
doMeta = true; doMeta = true;
} }
SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList; SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList;
// Start with basic cases of alpha/numeric/seq: // Start with basic cases of alpha/numeric/seq:
@ -2556,7 +2556,7 @@ namespace VEPROMS.CSLA.Library
// the ident of the step: // the ident of the step:
bool useSubStepTabs = false; bool useSubStepTabs = false;
if (doMeta && IsHigh if (doMeta && IsHigh
&& !seqtabs[(localPrintLevel < 0 ? 0 : localPrintLevel) % seqtabs.Count].TabToken.Contains("{numericWpar}") && !seqtabs[(localPrintLevel<0?0:localPrintLevel) % seqtabs.Count].TabToken.Contains("{numericWpar}")
&& tbformat.Contains("{")) useSubStepTabs = true; && tbformat.Contains("{")) useSubStepTabs = true;
// Check to be sure the parent tab should be included... If this sequential is within a note // Check to be sure the parent tab should be included... If this sequential is within a note
@ -2647,9 +2647,9 @@ namespace VEPROMS.CSLA.Library
//16 bit code limits the #2# offset logic to the docstyle cannot have the DSS_ADDDOTZEROSTDHLS & //16 bit code limits the #2# offset logic to the docstyle cannot have the DSS_ADDDOTZEROSTDHLS &
// its HLS is type std high: // its HLS is type std high:
if (!(((MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_AddDotZeroStdHLS) == E_DocStructStyle.DSS_AddDotZeroStdHLS) && this.MyHLS.MyContent.Type == 20002)) if (!(((MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_AddDotZeroStdHLS) == E_DocStructStyle.DSS_AddDotZeroStdHLS) && this.MyHLS.MyContent.Type == 20002))
{ {
int indxlb = tbformat.IndexOf("#"); int indxlb = tbformat.IndexOf("#");
string ofst = tbformat.Substring(indxlb + 1, 3); string ofst = tbformat.Substring(indxlb+1, 3);
_MyTab.Offset = Convert.ToInt32(ofst.Substring(0, 1)) * (int)FormatStepData.TabData.Font.CharsToTwips; _MyTab.Offset = Convert.ToInt32(ofst.Substring(0, 1)) * (int)FormatStepData.TabData.Font.CharsToTwips;
} }
tbformat = tbformat.Replace("#2#", "").Replace("#1#", ""); tbformat = tbformat.Replace("#2#", "").Replace("#1#", "");
@ -2658,9 +2658,9 @@ namespace VEPROMS.CSLA.Library
{ {
int begPos = tbformat.IndexOf("{Pos"); int begPos = tbformat.IndexOf("{Pos");
int endPos = tbformat.IndexOf("}"); int endPos = tbformat.IndexOf("}");
string ofst = tbformat.Substring(begPos + 4, endPos - begPos - 4); string ofst = tbformat.Substring(begPos + 4, endPos-begPos-4);
_MyTab.Position = -(Convert.ToInt32(ofst) * (int)FormatStepData.TabData.Font.CPI); _MyTab.Position = -(Convert.ToInt32(ofst) * (int)FormatStepData.TabData.Font.CPI);
tbformat = tbformat.Remove(begPos, endPos + 1); tbformat = tbformat.Remove(begPos,endPos+1);
} }
// if this is a caution/note type determine where 'NOTE/CAUTION' tab goes, as tab or as 'header' // if this is a caution/note type determine where 'NOTE/CAUTION' tab goes, as tab or as 'header'
// and also determine whether the tab itself gets converted to a bullet. // and also determine whether the tab itself gets converted to a bullet.
@ -2684,9 +2684,9 @@ namespace VEPROMS.CSLA.Library
tbformat = tbformat.Replace("{ALPHAWpar}", alpha); tbformat = tbformat.Replace("{ALPHAWpar}", alpha);
if (tbformat.ToUpper().Contains("ROMAN")) if (tbformat.ToUpper().Contains("ROMAN"))
{ {
string roman = RomanNumbering(ordinal); string roman = RomanNumbering(ordinal);
tbformat = tbformat.Replace("{roman}", roman.ToLower()); tbformat = tbformat.Replace("{roman}", roman.ToLower());
tbformat = tbformat.Replace("{ROMAN}", roman); tbformat = tbformat.Replace("{ROMAN}", roman);
tbformat = tbformat.Substring(0, tbformat.Length - ((roman.Length - 1)>0?(roman.Length - 1):0)); tbformat = tbformat.Substring(0, tbformat.Length - ((roman.Length - 1)>0?(roman.Length - 1):0));
} }
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.VirtualDotInHLSTab && tbformat.Contains("numeric") & ordinal > 9) _MyTab.AdjustTabSpace = true; if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.VirtualDotInHLSTab && tbformat.Contains("numeric") & ordinal > 9) _MyTab.AdjustTabSpace = true;
@ -2695,14 +2695,14 @@ namespace VEPROMS.CSLA.Library
tbformat = tbformat.Replace("{numeric}", ordinal.ToString().PadLeft(2) + ".0"); tbformat = tbformat.Replace("{numeric}", ordinal.ToString().PadLeft(2) + ".0");
tbformat = tbformat.Substring(0, tbformat.Length - 2); tbformat = tbformat.Substring(0, tbformat.Length - 2);
} }
tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2, '0') : ordinal.ToString().PadLeft(2)); tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2,'0') : ordinal.ToString().PadLeft(2));
if (tbformate != null) tbformate = tbformate.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2, '0') : ordinal.ToString().PadLeft(2)); if (tbformate != null) tbformate = tbformate.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2, '0') : ordinal.ToString().PadLeft(2));
tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString()); tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString());
if (tbformat.Contains("{asterisk}")) if (tbformat.Contains("{asterisk}"))
{ {
// if this has a checkoff - need to set location of the asterisk - because the asterisk has to come before // if this has a checkoff - need to set location of the asterisk - because the asterisk has to come before
// the checkoff. Otherwise, it doesn't matter // the checkoff. Otherwise, it doesn't matter
_MyTab.AsteriskOffset = -10; _MyTab.AsteriskOffset = - 10;
tbformat = tbformat.Replace("{asterisk}", ""); // the asteriskoffset flags a '*' to be printed at xloc - this. tbformat = tbformat.Replace("{asterisk}", ""); // the asteriskoffset flags a '*' to be printed at xloc - this.
} }
int macroindx = tbformat.IndexOf("{!C"); int macroindx = tbformat.IndexOf("{!C");
@ -2711,6 +2711,18 @@ namespace VEPROMS.CSLA.Library
cltext = cltext == null ? tbformat.Remove(macroindx, 5) : cltext.Remove(macroindx, 5); cltext = cltext == null ? tbformat.Remove(macroindx, 5) : cltext.Remove(macroindx, 5);
cltext = cltext + " "; cltext = cltext + " ";
} }
macroindx = tbformat.IndexOf("{!diamond1}");
if (macroindx > -1) //i found it
{
cltext = cltext == null ? tbformat.Remove(macroindx, 11) : cltext.Remove(macroindx, 11);
cltext = cltext + " ";
}
macroindx = tbformat.IndexOf("{!diamond}");
if (macroindx > -1) //i found it
{
cltext = cltext == null ? tbformat.Remove(macroindx, 10) : cltext.Remove(macroindx, 10);
cltext = cltext + " ";
}
// "{Null}" was introduced so that inheritance in format files could differentiate between an // "{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 // 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. // tab, don't inherit the parent's tab, use a null.
@ -2740,7 +2752,7 @@ namespace VEPROMS.CSLA.Library
_MyHeader.Justify = ContentAlignment.MiddleRight; _MyHeader.Justify = ContentAlignment.MiddleRight;
break; break;
default: default:
_MyHeader.Justify = ContentAlignment.MiddleCenter; _MyHeader.Justify = ContentAlignment.MiddleCenter;
break; break;
} }
//_MyHeader.Justify = ContentAlignment.MiddleCenter; //_MyHeader.Justify = ContentAlignment.MiddleCenter;
@ -3259,12 +3271,12 @@ namespace VEPROMS.CSLA.Library
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1; if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
ItemInfo tmp = this; ItemInfo tmp = this;
while (!tmp.IsSection) while (!tmp.IsSection)
{ {
if (formatData.TopTemplateTypes.ContainsKey((int)tmp.MyContent.Type - 20001)) return formatData.TopTemplateTypes[(int)tmp.MyContent.Type - 20001]; if (formatData.TopTemplateTypes.ContainsKey((int)tmp.MyContent.Type - 20001)) return formatData.TopTemplateTypes[(int)tmp.MyContent.Type - 20001];
tmp = tmp.MyParent; tmp = tmp.MyParent;
} }
return -1; return -1;
} }
public int GetSmartTemplateIndex(int topIndx, int curStepType) public int GetSmartTemplateIndex(int topIndx, int curStepType)
{ {
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData; FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
@ -3276,7 +3288,7 @@ namespace VEPROMS.CSLA.Library
// now see if we're on the topType, if so, look under this one // now see if we're on the topType, if so, look under this one
// for the step type that we're on. If found return the index of it. // for the step type that we're on. If found return the index of it.
if (formatData.Templates[indx].type == curType) return indx; if (formatData.Templates[indx].type == curType) return indx;
indx++; indx++;
} }
return -1; // didn't find this step type in the template width override list. return -1; // didn't find this step type in the template width override list.
} }
@ -4917,11 +4929,11 @@ namespace VEPROMS.CSLA.Library
} }
else else
{ {
string tmp = DisplayNumber.IndexOf(".") > -1 ? DisplayNumber.Substring(0, DisplayNumber.IndexOf(".")) : DisplayNumber; string tmp = DisplayNumber.IndexOf(".")>-1?DisplayNumber.Substring(0,DisplayNumber.IndexOf(".")):DisplayNumber;
if (underline) if (underline)
retStr = @"\ul " + tmp + "." + Snum.ToString() + @"\ul0 "; retStr = @"\ul " + tmp + "." + Snum.ToString() + @"\ul0 ";
else else
retStr = tmp + "." + Snum.ToString(); retStr = tmp + "." + Snum.ToString();
} }
return retStr; return retStr;
} }

View File

@ -2695,6 +2695,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _RNOWidthAlt, "@RNOWidthAlt"); return LazyLoad(ref _RNOWidthAlt, "@RNOWidthAlt");
} }
} }
private LazyLoad<string> _RNOWidthAdj;
public string RNOWidthAdj
{
get
{
return LazyLoad(ref _RNOWidthAdj, "@RNOWidthAdj");
}
}
private LazyLoad<int?> _HLSWidthOVRD; private LazyLoad<int?> _HLSWidthOVRD;
public int? HLSWidthOVRD public int? HLSWidthOVRD
{ {