B2022-083: Support Conditional RO Values

This commit is contained in:
Jake 2022-07-26 20:16:48 +00:00
parent d327ab08af
commit bcbc52c774

View File

@ -3549,20 +3549,26 @@ namespace Volian.Controls.Library
// Get the RO value for the given RO AccPageID and multiple Return Value option
private string ROLookupForEditorView(SectionInfo MySection, string accpageid, string multiid, string deflt)
{
ROFSTLookup myLookup = MySection.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MySection.MyDocVersion, "");
ROFSTLookup myLookup = MySection.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MySection.MyDocVersion, null);
string accpgid = accpageid;
string val = myLookup.GetROValueByAccPagID(string.Format("<{0}.{1}>",accpgid,multiid), MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
if (val == null)
//B2022 - 083: Support Conditional RO Values
ROFSTLookup.rochild roc = myLookup.GetROChildByAccPageID(string.Format("<{0}.{1}>", accpgid, multiid), MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
if (roc.value == null)
{
accpgid = accpgid.Replace(@"\u8209?", "-");
val = myLookup.GetROValueByAccPagID(string.Format("<{0}.{1}>", accpgid, multiid), MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
roc = myLookup.GetROChildByAccPageID(string.Format("<{0}.{1}>", accpgid, multiid), MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
}
if (!deflt.StartsWith("[") && val != null && val.Trim().Length > 0) // don't return val if it's an empty or blank string - jsj 01-28-2019
if (!deflt.StartsWith("[") && !string.IsNullOrEmpty(roc.value) && roc.value.Trim().Length > 0) // don't return val if it's an empty or blank string - jsj 01-28-2019
{
val = val.Replace("[xB3]", "\xB3");
val = val.Replace("[xB2]", "\xB2");
return val;
roc.value = roc.value.Replace("[xB3]", "\xB3");
roc.value = roc.value.Replace("[xB2]", "\xB2");
return roc.value;
}
return deflt;
}
// C2021-018 used to display Alarm Point Table RO values in the editor