From 216960bce84db893159ff64ea7888dccd2439492 Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 22 Sep 2011 11:42:43 +0000 Subject: [PATCH] --- PROMS/fmtxml/FmtFileToXml.cs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/PROMS/fmtxml/FmtFileToXml.cs b/PROMS/fmtxml/FmtFileToXml.cs index 6d11107b..a719282c 100644 --- a/PROMS/fmtxml/FmtFileToXml.cs +++ b/PROMS/fmtxml/FmtFileToXml.cs @@ -1545,7 +1545,7 @@ namespace fmtxml fmtName = alias; //if (fmtName.ToUpper() != "CPLS" && fmtName.ToUpper() != "BASE") 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 { LoadFormatFile(nm + ".fmt", ref SubXtraFlags); @@ -2669,6 +2669,7 @@ namespace fmtxml arcnt++; 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 j = 0; j < MAXTABS; j++) @@ -4567,12 +4568,18 @@ namespace fmtxml if (tablen < 0) tablen = 0; 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) { - 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; - if (i == 0 && p == null) + if (p == null) return "{seq}"; //Number Formatting // $ - Uppercase Alphabetical (IP2, GEN, CAL2, VLNCAS) @@ -4650,6 +4657,11 @@ namespace fmtxml wkstr = ConvertText(wkstr); return wkstr; } + private bool IsSubType(int indx) + { + for (int i = 0; i < NBRSub; i++) if (indx == SubTypeValue[i]) return true; + return false; + } #endregion #region DoEntireInherit private bool CompareParentSub(FormatData mainFmt, ref FormatData subFmt) @@ -5264,6 +5276,13 @@ namespace fmtxml for (int i = 0; i < MAXSTEPS; i++) { 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 dicParents)