From cb326b58e9509315b89e9cad4284fc9b3a490bdc Mon Sep 17 00:00:00 2001 From: bruijn <sdos@astron.nl> Date: Wed, 30 Mar 2005 11:53:10 +0000 Subject: [PATCH] %[ER: 198]% Navigator function dpAccessable becomes common --- .gitattributes | 1 + .../pvss/scripts/libs/gcf-common.ctl | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 MAC/GCF/GCFCommon/pvss/scripts/libs/gcf-common.ctl diff --git a/.gitattributes b/.gitattributes index 1dd409ec0e9..ad2d7000a04 100644 --- a/.gitattributes +++ b/.gitattributes @@ -225,6 +225,7 @@ MAC/GCF/DEPENDENCIES -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/bootstrap -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/configure.in -text svneol=native#application/octet-stream +MAC/GCF/GCFCommon/pvss/scripts/libs/gcf-common.ctl -text svneol=native#application/octet-stream MAC/GCF/GCFCommon/src/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/HighLevelTools/UITools/Navigator/colorDB/colorDB_fw -text svneol=native#application/octet-stream MAC/GCF/HighLevelTools/UITools/Navigator/dplist/DemoAllNew.dpl -text svneol=native#application/octet-stream diff --git a/MAC/GCF/GCFCommon/pvss/scripts/libs/gcf-common.ctl b/MAC/GCF/GCFCommon/pvss/scripts/libs/gcf-common.ctl new file mode 100644 index 00000000000..a77e7808fe0 --- /dev/null +++ b/MAC/GCF/GCFCommon/pvss/scripts/libs/gcf-common.ctl @@ -0,0 +1,34 @@ + +/////////////////////////////////////////////////////////////////////////// +// Function dpAccessable: Checks whether the given dpName is accessable and +// existing (in case of a distributed system. +// +// Input : datapoint name, including systemName +// Output: TRUE, if accessable and existing, +// FALSE, if not accessable and/or not existing +/////////////////////////////////////////////////////////////////////////// +bool dpAccessable(string dpName) +{ + string dpSystemName = strrtrim(dpSubStr(dpName,DPSUB_SYS),":"); + if(getSystemName()==(dpSystemName+":")) + { + return TRUE; + } + else if (getSystemName()!=(dpSystemName+":")) + { + dyn_int distributedSystems; + dpGet("_DistManager.State.SystemNums", distributedSystems); + //Check if dpSystemName is in the distributedSystems list + if (dynlen(distributedSystems)>0) + { + for(int i=1; i<=dynlen(distributedSystems); i++) + { + if(getSystemName(distributedSystems[i])==(dpSystemName+":")) //if the system is reacheable + { + return dpExists(dpName); + } + } + } + return FALSE; + } +} -- GitLab