diff --git a/.gitattributes b/.gitattributes index 1dd409ec0e9e4057a2885031d0a0c473e80618a7..ad2d7000a04291452ed27c6541672d3e6b7a9f15 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 0000000000000000000000000000000000000000..a77e7808fe0b9dafa0d4153077c7de95504150fe --- /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; + } +}