B2022-083: Support Conditional RO Values

This commit is contained in:
Jake
2022-07-26 20:01:25 +00:00
parent 439cf9de7a
commit d327ab08af
16 changed files with 2670 additions and 1743 deletions

View File

@@ -423,7 +423,8 @@ namespace Volian.Controls.Library
//}
#endregion
string accPageID = GetAccPageID(data);
ROFSTLookup.rochild? roc = MyLookup.GetRoChildByAccPagID(accPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
ROFSTLookup.rochild? roc = MyLookup.GetROChildByAccPageID(accPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
if (roc != null)
{
int index = GetROValueIndex(data);
@@ -449,7 +450,7 @@ namespace Volian.Controls.Library
for (int i = 1; i < 4; i++)
{
tmpAccPageID = accPageID + suffix + i.ToString();
roc = MyLookup.GetRoChildByAccPagID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
roc = MyLookup.GetROChildByAccPageID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
if (roc != null)
{
int index = GetROValueIndex(data);
@@ -460,12 +461,13 @@ namespace Volian.Controls.Library
}
}
}
//try LO1,2,3
suffix = "-LO";
for (int i = 1; i < 4; i++)
{
tmpAccPageID = accPageID + suffix + i.ToString();
roc = MyLookup.GetRoChildByAccPagID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
roc = MyLookup.GetROChildByAccPageID(tmpAccPageID, Mydvi.DocVersionConfig.RODefaults_setpointprefix, Mydvi.DocVersionConfig.RODefaults_graphicsprefix);
if (roc != null)
{
int index = GetROValueIndex(data);
@@ -481,6 +483,7 @@ namespace Volian.Controls.Library
}
return rv;
}
private string GetAccPageID(string txt)
{
//<MEL FWS-MP-02B \\n \\H>
@@ -491,11 +494,14 @@ namespace Volian.Controls.Library
txt = txt.Replace("<ARP ", "ARP-");
int i = txt.IndexOf(" ");
txt = txt.Substring(0, i);
return txt;
}
private int GetROValueIndex(string data)
{
int rv = -1;
if (data.StartsWith("<ARP"))
{
// arp children = \n alarm, \s value, \t type, \d description
@@ -510,7 +516,7 @@ namespace Volian.Controls.Library
else
rv = -1;
}
if (data.StartsWith("<MEL"))
else if (data.StartsWith("<MEL"))
{
//mel children = \n name, \d description, \r room
if (data.IndexOf(@"\n") > 0)
@@ -522,7 +528,7 @@ namespace Volian.Controls.Library
else
rv = -1;
}
if (data.StartsWith("<STP"))
else if (data.StartsWith("<STP"))
{
//stp children = \v value, \d description, \n id
if (data.IndexOf(@"\v") > 0)
@@ -534,8 +540,10 @@ namespace Volian.Controls.Library
else
rv = -1;
}
return rv;
}
private void SaveRO_Click(object sender, EventArgs e)
{
DevComponents.DotNetBar.BaseItem btn = sender as DevComponents.DotNetBar.BaseItem;
@@ -1252,10 +1260,12 @@ namespace Volian.Controls.Library
_MyLog.WarnFormat("Equation Editor executable could not be found.");
return retval;
}
private static string GetVisio() // Added support for Visio
{
string retval = _SpecifiedVisioPath; // use the Visio path specified by the user
if (retval != null && retval != "")
if (!string.IsNullOrEmpty(retval))
{
if (!retval.ToUpper().EndsWith(".EXE"))
retval += (retval.EndsWith("\\")) ? "visio.exe" : "\\visio.exe";
@@ -1265,7 +1275,8 @@ namespace Volian.Controls.Library
retval = null; // look in the registry
}
}
if (retval == null || retval == "")
if (!string.IsNullOrEmpty(retval))
{
try
{
@@ -1279,7 +1290,8 @@ namespace Volian.Controls.Library
_MyLog.WarnFormat("Visio was not found in the registry.");
}
}
return retval;
return retval;
}
private static string _EqnEdtPath = null;
public static string EqnEdtPath