This commit is contained in:
parent
2357a04870
commit
29a180368e
@ -77,8 +77,11 @@ namespace VEPROMS.CSLA.Library
|
||||
private HybridDictionary dicRos;
|
||||
private HybridDictionary dicRosIntIDs;
|
||||
|
||||
public ROFST(string path)
|
||||
private DocVersionInfo docVerInfo = null;
|
||||
|
||||
public ROFST(string path, DocVersionInfo docverinfo)
|
||||
{
|
||||
docVerInfo = docverinfo;
|
||||
fstPath = path;
|
||||
if (!File.Exists(fstPath))
|
||||
{
|
||||
@ -166,6 +169,7 @@ namespace VEPROMS.CSLA.Library
|
||||
tmp.title = Encoding.Default.GetString(ab, myOffset + 6, slen);
|
||||
myOffset += (7 + slen);
|
||||
rogrp tmpg = LoadGroup(ab, childOffset);
|
||||
MultipleReturnValuesInheritType(ref tmpg, tmp.type);
|
||||
tmp.ID = tmpg.ID;
|
||||
tmp.ParentID = tmpg.ParentID;
|
||||
tmp.children = tmpg.children;
|
||||
@ -185,13 +189,59 @@ namespace VEPROMS.CSLA.Library
|
||||
else
|
||||
{
|
||||
int slen = StringLength(ab, offset + 12);
|
||||
myGrp.value = Encoding.Default.GetString(ab, offset + 12, slen);
|
||||
//myGrp.value = Encoding.Default.GetString(ab, offset + 12, slen);
|
||||
ProcessROReturnValue(ref myGrp, Encoding.Default.GetString(ab, offset + 12, slen));
|
||||
int slen2 = StringLength(ab, offset + 13 + slen);
|
||||
myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2);
|
||||
}
|
||||
return myGrp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This function will take the raw RO return value and resolve any macros, conditionals, and
|
||||
/// generated the return value or a list of multiple return values.
|
||||
/// </summary>
|
||||
/// <param name="myGrp"></param>
|
||||
/// <param name="rawvalue"></param>
|
||||
private void ProcessROReturnValue(ref rogrp myGrp, string rawvalue)
|
||||
{
|
||||
List<string> lstROVals = GetROReturnValue(rawvalue);
|
||||
if (lstROVals.Count > 1) // mulitple return values
|
||||
{
|
||||
myGrp.children = new rochild[lstROVals.Count];
|
||||
for (int i = 0; i < lstROVals.Count; i++)
|
||||
{
|
||||
myGrp.children[i].value = lstROVals[i];
|
||||
myGrp.children[i].roid = TableID.ToString("X4") + myGrp.ID.ToString("X8") + i.ToString("X4");
|
||||
myGrp.children[i].type = -1; // Multiple return value inherit type from parent
|
||||
myGrp.children[i].title = lstROVals[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
myGrp.value = lstROVals[0];
|
||||
return;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Multiple return values need to get the type from the parent node.
|
||||
/// </summary>
|
||||
/// <param name="myGrp"></param>
|
||||
/// <param name="parenttype"></param>
|
||||
private void MultipleReturnValuesInheritType(ref rogrp myGrp, int parenttype)
|
||||
{
|
||||
if (myGrp.children != null)
|
||||
{
|
||||
for (int cnt = 0; cnt < myGrp.children.Length; cnt++ )
|
||||
{
|
||||
if (myGrp.children[cnt].type == -1)
|
||||
{
|
||||
myGrp.children[cnt].type = parenttype;
|
||||
myGrp.children[cnt].appid = myGrp.appid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseIntoDictionary()
|
||||
{
|
||||
FileStream fsIn = new FileStream(fstPath, FileMode.Open,FileAccess.Read, FileShare.Read);
|
||||
@ -280,5 +330,33 @@ namespace VEPROMS.CSLA.Library
|
||||
return null;
|
||||
}
|
||||
|
||||
public string GetFstPath()
|
||||
{
|
||||
return fstPath;
|
||||
}
|
||||
|
||||
public string GetDefaultGraphicExtension()
|
||||
{
|
||||
if (docVerInfo != null)
|
||||
return docVerInfo.DocVersionConfig.Graphics_defaultext;
|
||||
else
|
||||
return "TIF"; // this is the Volian Default
|
||||
}
|
||||
|
||||
public string GetDefaultROPrefix()
|
||||
{
|
||||
if (docVerInfo != null)
|
||||
return docVerInfo.DocVersionConfig.RODefaults_setpointprefix;
|
||||
else
|
||||
return "SP1"; // Not Sure about this...
|
||||
}
|
||||
|
||||
public string GetDefaultGraphicsPrefix()
|
||||
{
|
||||
if (docVerInfo != null)
|
||||
return docVerInfo.DocVersionConfig.RODefaults_graphicsprefix;
|
||||
else
|
||||
return "IG1"; // Not Sure about this...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user