From bcbc52c7747b51c9c37f7814672ec9c7827573ed Mon Sep 17 00:00:00 2001 From: Jake Date: Tue, 26 Jul 2022 20:16:48 +0000 Subject: [PATCH] B2022-083: Support Conditional RO Values --- PROMS/Volian.Controls.Library/EditItem.cs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index bc3719e1..e3cc8b90 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -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