This commit is contained in:
Kathy Ruffing 2009-03-05 16:03:34 +00:00
parent abf2a8919c
commit 8a343e24eb
2 changed files with 153 additions and 18 deletions

View File

@ -72,12 +72,12 @@ namespace VEPROMS.CSLA.Library
get get
{ {
// TODO: eventually want styles // TODO: eventually want styles
if (_WindowsFont == null) //if (_WindowsFont == null)
{ //{
FontStyle style = FontStyle.Regular; FontStyle style = FontStyle.Regular;
if (Style != E_Style.None) 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; style |= FontStyle.Bold;
if ((Style & E_Style.Italics) != 0) if ((Style & E_Style.Italics) != 0)
style |= FontStyle.Italic; style |= FontStyle.Italic;
@ -85,7 +85,7 @@ namespace VEPROMS.CSLA.Library
style |= FontStyle.Underline; style |= FontStyle.Underline;
} }
_WindowsFont = new Font(Family, (float)Size, style); _WindowsFont = new Font(Family, (float)Size, style);
} //}
return _WindowsFont; return _WindowsFont;
} }
} }
@ -258,7 +258,7 @@ namespace VEPROMS.CSLA.Library
} }
return top; return top;
} }
public List<StepDataRetval> StepGetLevelTypes(StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo) public List<StepDataRetval> StepGetLevelTypes(bool alwaysAdd, StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo)
{ {
List<StepDataRetval> sds = new List<StepDataRetval>(); List<StepDataRetval> sds = new List<StepDataRetval>();
int retval = -1; 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.... // 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) || // also tables and figures off caution/notes must use rno data.
(topType.StepEditData.TypeMenu.InMenu && !topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO) || else if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) ||
(topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO)) (!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 (!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))); sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index)));
else else
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); 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) 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 (sd.Type == curType) retval = tmpindx;
if (retval < 0 && tmpindx > 0) retval = tmpindx; if (retval < 0 && tmpindx > 0) retval = tmpindx;
} }
@ -313,16 +316,18 @@ namespace VEPROMS.CSLA.Library
return sds; return sds;
} }
private int DoListChildStepTypes(ref List<StepDataRetval> sds, StepData topType, string curType, ItemInfo _CurItemInfo, ref int cntitm) private int DoListChildStepTypes(bool alwaysAdd, ref List<StepDataRetval> sds, StepData topType, string curType, ItemInfo _CurItemInfo, ref int cntitm)
{ {
int retval = -1; int retval = -1;
if ((topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu) || if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) ||
(topType.StepEditData.TypeMenu.InMenu && !topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO) || (!topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO&&!_CurItemInfo.IsCaution&&!_CurItemInfo.IsNote) ||
(topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO)) (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO) ||
(topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsCaution) ||
(topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsNote))))
{ {
if (!topType.Inactive) 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))); sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index)));
else else
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); 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) 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 (sd.Type == curType) retval = tmpindx;
if (retval < 0 && tmpindx > 0) retval = tmpindx; if (retval < 0 && tmpindx > 0) retval = tmpindx;
} }
@ -342,6 +347,17 @@ namespace VEPROMS.CSLA.Library
} }
return retval; return retval;
} }
/// <summary>
/// for format data given a string representing the Type of step, find the index.
/// </summary>
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 #endregion
#region Symbols #region Symbols
@ -3561,6 +3577,125 @@ namespace VEPROMS.CSLA.Library
} }
} }
public StepDataList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } 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 #endregion
#region StepLayoutData #region StepLayoutData

View File

@ -155,7 +155,7 @@ namespace VEPROMS.CSLA.Library
} }
public static XmlNode InheritLookup(XmlNode xmlNode, string path, bool stepLookup) 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 if (xmlNode == null) return null;// No path to match
string xPath = Path(xmlNode);// Build xPath from xmlNode string xPath = Path(xmlNode);// Build xPath from xmlNode
vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument