|
|
|
@@ -434,8 +434,38 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
List<StepDataRetval> sds = new List<StepDataRetval>();
|
|
|
|
|
foreach (StepData sd in StepDataList)
|
|
|
|
|
{
|
|
|
|
|
if (!sd.Inactive && sd.StepEditData.Searchable && sd.StepEditData.TypeMenu.InMenu)
|
|
|
|
|
sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index)));
|
|
|
|
|
if (!sd.Inactive && sd.StepEditData.Searchable && sd.StepEditData.TypeMenu.InMenu)
|
|
|
|
|
sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index)));
|
|
|
|
|
}
|
|
|
|
|
// now add any from the inherited list (but only if type is not in the list)
|
|
|
|
|
IFormatOrFormatInfo parentFormat = MyParentFormat;
|
|
|
|
|
while (parentFormat != null)
|
|
|
|
|
{
|
|
|
|
|
vlnIndexedFormatList<StepData> InheritedList = parentFormat.PlantFormat.FormatData.StepDataList;
|
|
|
|
|
foreach (StepData sd1 in InheritedList)
|
|
|
|
|
{
|
|
|
|
|
if (!sd1.Inactive && sd1.StepEditData.Searchable && sd1.StepEditData.TypeMenu.InMenu)
|
|
|
|
|
{
|
|
|
|
|
// if not in the sds list, add it:
|
|
|
|
|
// note that the list of StepDataRetval (sds) 'Contains' method did not find an existing StepData item - that is why the code loops
|
|
|
|
|
// through list rather than using 'Contains':
|
|
|
|
|
bool found = false;
|
|
|
|
|
foreach (StepDataRetval lrtvl in sds)
|
|
|
|
|
{
|
|
|
|
|
if (lrtvl.Index == sd1.Index)
|
|
|
|
|
{
|
|
|
|
|
found = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found)
|
|
|
|
|
{
|
|
|
|
|
StepDataRetval tmpsdrv = new StepDataRetval(sd1.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd1.Index));
|
|
|
|
|
sds.Add(tmpsdrv);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
parentFormat = parentFormat.PlantFormat.FormatData.MyParentFormat;
|
|
|
|
|
}
|
|
|
|
|
return sds;
|
|
|
|
|
}
|
|
|
|
@@ -444,15 +474,35 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
StepData top = sd;
|
|
|
|
|
while (top.ParentType != "Base")
|
|
|
|
|
{
|
|
|
|
|
bool foundit = false;
|
|
|
|
|
string sParStp = StepDataList[formatStepType].ParentType;
|
|
|
|
|
foreach (StepData stp in StepDataList)
|
|
|
|
|
{
|
|
|
|
|
if (top.ParentType == stp.Type)
|
|
|
|
|
{
|
|
|
|
|
top = stp;
|
|
|
|
|
foundit = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!foundit)
|
|
|
|
|
{
|
|
|
|
|
IFormatOrFormatInfo parentFormat = MyParentFormat;
|
|
|
|
|
while (parentFormat != null && !foundit)
|
|
|
|
|
{
|
|
|
|
|
vlnIndexedFormatList<StepData> InheritedList = parentFormat.PlantFormat.FormatData.StepDataList;
|
|
|
|
|
foreach (StepData stp1 in InheritedList)
|
|
|
|
|
{
|
|
|
|
|
if (top.ParentType == stp1.Type)
|
|
|
|
|
{
|
|
|
|
|
top = stp1;
|
|
|
|
|
foundit = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
parentFormat = parentFormat.PlantFormat.FormatData.MyParentFormat;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return top;
|
|
|
|
|
}
|
|
|
|
@@ -500,13 +550,36 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
if (topType.Type == curType) retval = cntitm;
|
|
|
|
|
cntitm++;
|
|
|
|
|
}
|
|
|
|
|
bool foundInCur = false;
|
|
|
|
|
foreach (StepData sd in StepDataList)
|
|
|
|
|
{
|
|
|
|
|
if (sd.ParentType == topType.Type)
|
|
|
|
|
{
|
|
|
|
|
int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm);
|
|
|
|
|
int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm, false);
|
|
|
|
|
if (sd.Type == curType) retval = tmpindx;
|
|
|
|
|
if (retval < 0 && tmpindx > 0) retval = tmpindx;
|
|
|
|
|
foundInCur = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Handle inheritance (step data may not be in current format, may inherit from parents):
|
|
|
|
|
if (!foundInCur)
|
|
|
|
|
{
|
|
|
|
|
IFormatOrFormatInfo parentFormat = MyParentFormat;
|
|
|
|
|
bool foundit = false;
|
|
|
|
|
while (parentFormat != null && !foundit)
|
|
|
|
|
{
|
|
|
|
|
vlnIndexedFormatList<StepData> InheritedList = parentFormat.PlantFormat.FormatData.StepDataList;
|
|
|
|
|
foreach (StepData sd1 in InheritedList)
|
|
|
|
|
{
|
|
|
|
|
if (sd1.ParentType == topType.Type)
|
|
|
|
|
{
|
|
|
|
|
int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd1, curType, _CurItemInfo, ref cntitm, true);
|
|
|
|
|
if (sd1.Type == curType) retval = tmpindx;
|
|
|
|
|
if (retval < 0 && tmpindx > 0) retval = tmpindx;
|
|
|
|
|
foundit = true; // stop after finding the type in the closest parent, i.e. don't keep walking up tree.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
parentFormat = parentFormat.PlantFormat.FormatData.MyParentFormat;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -514,7 +587,7 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
return sds;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int DoListChildStepTypes(bool alwaysAdd, 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, bool doInherit)
|
|
|
|
|
{
|
|
|
|
|
int retval = -1;
|
|
|
|
|
if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) ||
|
|
|
|
@@ -538,13 +611,36 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
cntitm++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bool foundInCur = false;
|
|
|
|
|
foreach (StepData sd in StepDataList)
|
|
|
|
|
{
|
|
|
|
|
if (sd.ParentType == topType.Type)
|
|
|
|
|
{
|
|
|
|
|
int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm);
|
|
|
|
|
int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm, false);
|
|
|
|
|
if (sd.Type == curType) retval = tmpindx;
|
|
|
|
|
if (retval < 0 && tmpindx > 0) retval = tmpindx;
|
|
|
|
|
foundInCur = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Handle inheritance (step data may not be in current format, may inherit from parents):
|
|
|
|
|
if (!foundInCur && doInherit)
|
|
|
|
|
{
|
|
|
|
|
IFormatOrFormatInfo parentFormat = MyParentFormat;
|
|
|
|
|
bool foundit = false;
|
|
|
|
|
while (parentFormat != null && !foundit)
|
|
|
|
|
{
|
|
|
|
|
vlnIndexedFormatList<StepData> InheritedList = parentFormat.PlantFormat.FormatData.StepDataList;
|
|
|
|
|
foreach (StepData sd1 in InheritedList)
|
|
|
|
|
{
|
|
|
|
|
if (sd1.ParentType == topType.Type)
|
|
|
|
|
{
|
|
|
|
|
int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd1, curType, _CurItemInfo, ref cntitm, true);
|
|
|
|
|
if (sd1.Type == curType) retval = tmpindx;
|
|
|
|
|
if (retval < 0 && tmpindx > 0) retval = tmpindx;
|
|
|
|
|
foundit = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
parentFormat = parentFormat.PlantFormat.FormatData.MyParentFormat;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -4832,22 +4928,25 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
{
|
|
|
|
|
foreach (StepData stepData in this)
|
|
|
|
|
if (stepData.Type == type) return stepData;
|
|
|
|
|
//foreach (StepData stepData1 in InheritedList)
|
|
|
|
|
// if (stepData1.Type == type) return stepData1;
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public StepData this[int index]
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
foreach (StepData stepData in this)
|
|
|
|
|
if (stepData.Index == index) return stepData;
|
|
|
|
|
//foreach (StepData stepData1 in InheritedList)
|
|
|
|
|
// if (stepData1.Index == index) return stepData1;
|
|
|
|
|
StepDataList ttlParent = (StepDataList) InheritedList; //Check Inherited Value
|
|
|
|
|
if (ttlParent != null)
|
|
|
|
|
return ttlParent[type]; // note that this is recursive, i.e. if doesn't get found in parent, goes to parent's parent.
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// the following was commented out because it uses the vlnFormat version of the code that indexes the list.
|
|
|
|
|
//public StepData this[int index]
|
|
|
|
|
//{
|
|
|
|
|
// get
|
|
|
|
|
// {
|
|
|
|
|
// foreach (StepData stepData in this)
|
|
|
|
|
// if (stepData.Index == index) return stepData;
|
|
|
|
|
// StepDataList ttlParent = (StepDataList)InheritedList; //Check Inherited Value
|
|
|
|
|
// if (ttlParent != null)
|
|
|
|
|
// return ttlParent[index];
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
public StepDataList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList, myFormat) { }
|
|
|
|
|
private StepData _HLS;
|
|
|
|
|
public StepData HLS
|
|
|
|
@@ -5008,14 +5107,24 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
return sd;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//foreach (StepData sdi in InheritedList)
|
|
|
|
|
//{
|
|
|
|
|
// if (sdi.Type == "Equation")
|
|
|
|
|
// {
|
|
|
|
|
// _Equation = sdi;
|
|
|
|
|
// return sdi;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
// Handle inheritance (step data may not be in current format, may inherit from parents):
|
|
|
|
|
IFormatOrFormatInfo parentFormat = this.MyFormat.PlantFormat.FormatData.MyParentFormat;
|
|
|
|
|
while (parentFormat != null)
|
|
|
|
|
{
|
|
|
|
|
vlnIndexedFormatList<StepData> InheritedList = parentFormat.PlantFormat.FormatData.StepDataList;
|
|
|
|
|
if (InheritedList != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (StepData sdi in InheritedList)
|
|
|
|
|
{
|
|
|
|
|
if (sdi.Type == "Equation")
|
|
|
|
|
{
|
|
|
|
|
_Equation = sdi;
|
|
|
|
|
return sdi;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
parentFormat = parentFormat.PlantFormat.FormatData.MyParentFormat;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|