This commit is contained in:
Kathy Ruffing 2011-09-22 11:42:43 +00:00
parent 883a21891d
commit 216960bce8

View File

@ -1545,7 +1545,7 @@ namespace fmtxml
fmtName = alias; fmtName = alias;
//if (fmtName.ToUpper() != "CPLS" && fmtName.ToUpper() != "BASE") return; //if (fmtName.ToUpper() != "CPLS" && fmtName.ToUpper() != "BASE") return;
//if (fmtName.ToUpper() != "OHLP" && fmtName.ToUpper() != "BASE" && fmtName.ToUpper() != "WCN2") return; //if (fmtName.ToUpper() != "OHLP" && fmtName.ToUpper() != "BASE" && fmtName.ToUpper() != "WCN2") return;
//if (fmtName.ToUpper() != "AEP" && fmtName.ToUpper() != "BASE") return; //if (fmtName.ToUpper() != "WCN2" && fmtName.ToUpper() != "BASE") return;
try try
{ {
LoadFormatFile(nm + ".fmt", ref SubXtraFlags); LoadFormatFile(nm + ".fmt", ref SubXtraFlags);
@ -2669,6 +2669,7 @@ namespace fmtxml
arcnt++; arcnt++;
if (indx > 0) tabstrings[i, 1] = GetStringFromByte(input, indx); if (indx > 0) tabstrings[i, 1] = GetStringFromByte(input, indx);
} }
NBRSub = fmtdata.SectData.StepSectionData.NumberOfSubStepTypes != 0 ? fmtdata.SectData.StepSectionData.NumberOfSubStepTypes : NBRSub;
for (int i = 0; i < MAXSTEPS; i++) for (int i = 0; i < MAXSTEPS; i++)
{ {
for (int j = 0; j < MAXTABS; j++) for (int j = 0; j < MAXTABS; j++)
@ -4567,12 +4568,18 @@ namespace fmtxml
if (tablen < 0) tablen = 0; if (tablen < 0) tablen = 0;
return ColToPoints(tablen, _PlantDefaultFontStyle); return ColToPoints(tablen, _PlantDefaultFontStyle);
} }
private int NBRSub = 16;
// STANDARD,AND,OR,EQUIPMENTLIST,EQUIPMENTWBLANK,EXPLICITAND,IMPLICITOR,PARAGRAPH,
// EQUIPMENTOPT,EQUIPMENTOPTWBLANK,CONTACSEQUENTIAL,CONTACAND,CONTACOR,CONTACPARAGRAPH,TITLEWITHTEXTRIGHT,TITLEWITHTEXTBELOW
private int[] SubTypeValue ={0,3,4,10,13,18,34,23,29,30,43,44,45,46,41,42};
private string DoTabs(VE_Font vefont, string po, int i, string p, bool doNumeric) private string DoTabs(VE_Font vefont, string po, int i, string p, bool doNumeric)
{ {
if ((p == null || p == "") && i != 0) return p ?? ""; // subtypes were defined as the list of types in the comment above from 16bit. These types, if a tab
// string is not defined, should get a {seq}
if ((p == null || p == "") && !IsSubType(i)) return p ?? "";
string wkstr = p; string wkstr = p;
if (i == 0 && p == null) if (p == null)
return "{seq}"; return "{seq}";
//Number Formatting //Number Formatting
// $ - Uppercase Alphabetical (IP2, GEN, CAL2, VLNCAS) // $ - Uppercase Alphabetical (IP2, GEN, CAL2, VLNCAS)
@ -4650,6 +4657,11 @@ namespace fmtxml
wkstr = ConvertText(wkstr); wkstr = ConvertText(wkstr);
return wkstr; return wkstr;
} }
private bool IsSubType(int indx)
{
for (int i = 0; i < NBRSub; i++) if (indx == SubTypeValue[i]) return true;
return false;
}
#endregion #endregion
#region DoEntireInherit #region DoEntireInherit
private bool CompareParentSub(FormatData mainFmt, ref FormatData subFmt) private bool CompareParentSub(FormatData mainFmt, ref FormatData subFmt)
@ -5264,6 +5276,13 @@ namespace fmtxml
for (int i = 0; i < MAXSTEPS; i++) for (int i = 0; i < MAXSTEPS; i++)
{ {
FixInheritance(ref stpdata[i], dicParents); FixInheritance(ref stpdata[i], dicParents);
// Since 'Step' is a structure, the StepParentList (dictionary) needs to be updated each time
// the stpdata is updated. Each instance of Step, because it is a structure, will be a separate copy
// so the dictionary had a distinct copy of the step's format data from what gets passed in by reference.
for (int j = 0; j < MAXSTEPS; j++)
{
if (stpdata[i].Type == stpdata[j].ParentType) StepParentList[0][stpdata[j].Type] = stpdata[i];
}
} }
} }
private void FixInheritance(ref Step step, Dictionary<string, Step> dicParents) private void FixInheritance(ref Step step, Dictionary<string, Step> dicParents)