diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index c698a372..af624c61 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -72,12 +72,12 @@ namespace VEPROMS.CSLA.Library get { // TODO: eventually want styles - if (_WindowsFont == null) - { + //if (_WindowsFont == null) + //{ FontStyle style = FontStyle.Regular; if (Style != E_Style.None) { - if ((Style & E_Style.Bold) != 0) + if (((Style & E_Style.Bold) != 0) || ((Style & E_Style.MmBold) !=0)) style |= FontStyle.Bold; if ((Style & E_Style.Italics) != 0) style |= FontStyle.Italic; @@ -85,7 +85,7 @@ namespace VEPROMS.CSLA.Library style |= FontStyle.Underline; } _WindowsFont = new Font(Family, (float)Size, style); - } + //} return _WindowsFont; } } @@ -258,7 +258,7 @@ namespace VEPROMS.CSLA.Library } return top; } - public List StepGetLevelTypes(StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo) + public List StepGetLevelTypes(bool alwaysAdd, StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo) { List sds = new List(); int retval = -1; @@ -284,14 +284,17 @@ namespace VEPROMS.CSLA.Library } } - // some menu items (step change types) can only be done in aer column, check for that.... - else if ((topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu) || - (topType.StepEditData.TypeMenu.InMenu && !topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO) || - (topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO)) + // some menu items (step change types) can only be done in aer column, check for that.... + // also tables and figures off caution/notes must use rno data. + else if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) || + (!topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO && !_CurItemInfo.IsCaution && !_CurItemInfo.IsNote) || + (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO) || + (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsCaution) || + (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsNote)))) { if (!topType.Inactive) { - if (_CurItemInfo.IsInRNO && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") + if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index))); else sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); @@ -303,7 +306,7 @@ namespace VEPROMS.CSLA.Library { if (sd.ParentType == topType.Type) { - int tmpindx = DoListChildStepTypes(ref sds, sd, curType, _CurItemInfo, ref cntitm); + int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm); if (sd.Type == curType) retval = tmpindx; if (retval < 0 && tmpindx > 0) retval = tmpindx; } @@ -313,16 +316,18 @@ namespace VEPROMS.CSLA.Library return sds; } - private int DoListChildStepTypes(ref List sds, StepData topType, string curType, ItemInfo _CurItemInfo, ref int cntitm) + private int DoListChildStepTypes(bool alwaysAdd, ref List sds, StepData topType, string curType, ItemInfo _CurItemInfo, ref int cntitm) { int retval = -1; - if ((topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu) || - (topType.StepEditData.TypeMenu.InMenu && !topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO) || - (topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO)) + if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) || + (!topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO&&!_CurItemInfo.IsCaution&&!_CurItemInfo.IsNote) || + (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO) || + (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsCaution) || + (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsNote)))) { if (!topType.Inactive) { - if (_CurItemInfo.IsInRNO && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") + if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index))); else sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); @@ -334,7 +339,7 @@ namespace VEPROMS.CSLA.Library { if (sd.ParentType == topType.Type) { - int tmpindx = DoListChildStepTypes(ref sds, sd, curType, _CurItemInfo, ref cntitm); + int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm); if (sd.Type == curType) retval = tmpindx; if (retval < 0 && tmpindx > 0) retval = tmpindx; } @@ -342,6 +347,17 @@ namespace VEPROMS.CSLA.Library } return retval; } + /// + /// for format data given a string representing the Type of step, find the index. + /// + public int GetIndexFromType(string type) + { + foreach (StepData sd in StepDataList) + { + if (sd.Type == type) return (int)sd.Index; + } + return 0; // default to the base + } } #endregion #region Symbols @@ -3561,6 +3577,125 @@ namespace VEPROMS.CSLA.Library } } public StepDataList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } + private StepData _HLS; + public StepData HLS + { + get + { + if (_HLS!=null) return _HLS; + foreach (StepData sd in this) + { + if (sd.Type == "High") + { + _HLS = sd; + return sd; + } + } + return null; + } + } + private StepData _Caution; + public StepData Caution + { + get + { + if (_Caution != null) return _Caution; + foreach (StepData sd in this) + { + if (sd.Type == "Caution") + { + _Caution = sd; + return sd; + } + } + return null; + } + } + private StepData _Note; + public StepData Note + { + get + { + if (_Note != null) return _Note; + foreach (StepData sd in this) + { + if (sd.Type == "Note") + { + _Note = sd; + return sd; + } + } + return null; + } + } + private StepData _RNO; + public StepData RNO + { + get + { + if (_RNO != null) return _RNO; + foreach (StepData sd in this) + { + if (sd.Type == "RNOType") + { + _RNO = sd; + return sd; + } + } + return null; + } + } + private StepData _Fig; + public StepData Fig + { + get + { + if (_Fig != null) return _Fig; + foreach (StepData sd in this) + { + if (sd.Type == "Figure") + { + _Fig = sd; + return sd; + } + } + return null; + } + } + private StepData _Table; + public StepData Table + { + get + { + if (_Table != null) return _Table; + foreach (StepData sd in this) + { + if (sd.Type == "Table") + { + _Table = sd; + return sd; + } + } + return null; + } + } + private StepData _Substep; + public StepData Substep + { + get + { + if (_Substep != null) return _Substep; + foreach (StepData sd in this) + { + if (sd.Type == "Substep") + { + _Substep = sd; + return sd; + } + } + return null; + } + } } #endregion #region StepLayoutData diff --git a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs index abc882c4..db66669c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs @@ -155,7 +155,7 @@ namespace VEPROMS.CSLA.Library } public static XmlNode InheritLookup(XmlNode xmlNode, string path, bool stepLookup) { - stepLookup = false; // 8/2 change for inheritance + //stepLookup = false; // 8/2 change for inheritance if (xmlNode == null) return null;// No path to match string xPath = Path(xmlNode);// Build xPath from xmlNode vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument