diff --git a/.gitattributes b/.gitattributes index 64db50840dda9c08328861f1f09d28df7c1eb7a9..ee057093a330c0646e15e3f46c94e19d8d1c889c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -158,7 +158,6 @@ MAC/Config/Apc/b1.apc -text svneol=native#application/octet-stream MAC/Config/Apc/b2.apc -text svneol=native#application/octet-stream MAC/Config/Apc/d1.apc -text svneol=native#application/octet-stream MAC/Config/Apc/e1.apc -text svneol=native#application/octet-stream -MAC/Config/LofarPropertyTypes.pvss -text svneol=native#application/octet-stream MAC/Config/mac.ns -text svneol=native#application/octet-stream MAC/Config/mac.top -text svneol=native#application/octet-stream MAC/Drivers/spid/tools/Makefile -text svneol=native#application/octet-stream @@ -182,21 +181,21 @@ MAC/GCF/TM/test/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/TM/test/tm-test.conf.in -text svneol=native#application/octet-stream MAC/GCF/_PAL/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/Makefile.am -text svneol=native#application/octet-stream -MAC/GCF/_PAL/PA/pvss/config/config -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/config/config.level -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/config/progs -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/panels/GCFPATest.pnl -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/panels/GCFPropSetLoader.pnl -text svneol=native#application/octet-stream -MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-cl.ctl -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-com.ctl -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-cwd.ctl -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-pml.ctl -text svneol=native#application/octet-stream +MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-prep.ctl -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/pvss/scripts/pvss_scripts.lst -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/src/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/src/PA_Protocol.prot -text svneol=native#application/octet-stream +MAC/GCF/_PAL/PA/src/configurePVSSProj -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/src/gcf-pa.conf.in -text svneol=native#application/octet-stream -MAC/GCF/_PAL/PA/src/initPVSSDB -text svneol=native#application/octet-stream MAC/GCF/_PAL/PA/src/loadAPC -text svneol=native#application/octet-stream +MAC/GCF/_PAL/PA/src/preparePVSS-DB -text svneol=native#application/octet-stream MAC/GCF/_PAL/PI/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/_PAL/PI/src/Makefile.am -text svneol=native#application/octet-stream MAC/GCF/_PAL/PI/src/PI_Protocol.prot -text svneol=native#application/octet-stream @@ -334,6 +333,7 @@ MAC/Test/GCF/configure.in -text svneol=native#application/octet-stream MAC/Test/GCF/src/Echo_Protocol.prot -text svneol=native#application/octet-stream MAC/Test/GCF/src/Makefile.am -text svneol=native#application/octet-stream MAC/Test/GCF/src/TST_Protocol.prot -text svneol=native#application/octet-stream +MAC/Test/GCF/src/customPrepPVSSDB.ctl -text svneol=native#application/octet-stream MAC/Test/GCF/src/gcf-test.conf.in -text svneol=native#application/octet-stream MAC/Test/GCF/src/gcftesttypes.dpl -text svneol=native#application/octet-stream MAC/Test/PROTO/Event/MY_Protocol.prot -text svneol=native#application/octet-stream diff --git a/MAC/Config/LofarPropertyTypes.pvss b/MAC/Config/LofarPropertyTypes.pvss deleted file mode 100644 index 7adfcfd12f74a7e516e66d7ad6cbaf5decda714d..0000000000000000000000000000000000000000 --- a/MAC/Config/LofarPropertyTypes.pvss +++ /dev/null @@ -1,19 +0,0 @@ -TypeName -GCFTempRef.GCFTempRef 23#1 -GCFDataType.GCFDataType 1#1 - panelAdmin 9#2 - permanentStatus 23#3 -LPT_BOOL.LPT_BOOL 23#1 -LPT_DOUBLE.LPT_DOUBLE 22#1 -LPT_INTEGER.LPT_INTEGER 21#1 -LPT_CHAR.LPT_CHAR 19#1 -LPT_UNSIGNED.LPT_UNSIGNED 20#1 -LPT_STRING.LPT_STRING 25#1 -LPT_BLOB.LPT_BLOB 46#1 -LPT_DYNBOOL.LPT_DYNBOOL 7#1 -LPT_DYNDOUBLE.LPT_DYNDOUBLE 6#1 -LPT_DYNINTEGER.LPT_DYNINTEGER 5#1 -LPT_DYNCHAR.LPT_DYNCHAR 3#1 -LPT_DYNUNSIGNED.LPT_DYNUNSIGNED 4#1 -LPT_DYNSTRING.LPT_DYNSTRING 9#1 -LPT_DYNBLOB.LPT_DYNBLOB 48#1 diff --git a/MAC/GCF/_PAL/PA/pvss/config/config b/MAC/GCF/_PAL/PA/pvss/config/config deleted file mode 100644 index e7c30c17c239378ca52da4947b4d7a5b7f77cdc5..0000000000000000000000000000000000000000 --- a/MAC/GCF/_PAL/PA/pvss/config/config +++ /dev/null @@ -1,11 +0,0 @@ -[general] -pvss_path = "/usr/pvss/pvss2_v3.0" -proj_path = "/usr/pvss/Lofar/3.0/LCU" -proj_version = "3.0" -userName = "root" -password = "" -langs = "en_US.iso88591" -distributed = 1 - -[dist] -distPeer = "sun:4776" 2 diff --git a/MAC/GCF/_PAL/PA/pvss/config/config.level b/MAC/GCF/_PAL/PA/pvss/config/config.level index 46af9648ea0a6bfb1d022aaa525e41e8266f1a35..71829fa870c32bce8ef2f62c1c599fab31308456 100644 --- a/MAC/GCF/_PAL/PA/pvss/config/config.level +++ b/MAC/GCF/_PAL/PA/pvss/config/config.level @@ -1,5 +1,6 @@ [ctrl] -LoadCtrlLibs = "std.ctl, libCTRL.ctl, hosts.ctl, va.ctl, archiv.ctl, mp.ctl, gcfpa-cwd.ctl, gcfpa-com.ctl" +LoadCtrlLibs = "std.ctl, libCTRL.ctl, hosts.ctl, va.ctl, archiv.ctl, mp.ctl" +LoadCtrlLibs = "gcfpa-cwd.ctl, gcfpa-com.ctl" [ui_extend] LoadCtrlLibs = "para.ctl, ep.ctl, csg.ctl, ngedi.ctl, ini.ctl" @@ -10,7 +11,8 @@ LoadCtrlLibs = "login.ctl, panel.ctl, std.ctl, dist.ctl" LoadCtrlLibs = "hosts.ctl, va.ctl, ac.ctl, dpGroups.ctl" LoadCtrlLibs = "pager.ctl, archiv.ctl, Clk.ctl, tools.ctl, mp.ctl, ax.ctl" LoadCtrlLibs = "pmon.ctl, userMan.ctl" -LoadCtrlLibs = "ft.ctl, pt.ctl, gcfpa-pml.ctl, gcfpa-com.ctl" +LoadCtrlLibs = "ft.ctl, pt.ctl" +LoadCtrlLibs = "gcfpa-pml.ctl, gcfpa-com.ctl" [event] LoadCtrlLibs = "STD_Symbols.ctl" diff --git a/MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-prep.ctl b/MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-prep.ctl new file mode 100644 index 0000000000000000000000000000000000000000..30e0a679caa384b624f9fcc39f1469758bed6d25 --- /dev/null +++ b/MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-prep.ctl @@ -0,0 +1,90 @@ +main() +{ + dyn_dyn_string xxdepes; + dyn_dyn_int xxdepei; + dyn_string types; + types = dpTypes("LPT_*"); + + handleType(types, "LPT_CHAR", DPEL_CHAR); + handleType(types, "LPT_STRING", DPEL_STRING); + handleType(types, "LPT_BOOL", DPEL_BOOL); + handleType(types, "LPT_BLOB", DPEL_BLOB); + handleType(types, "LPT_DOUBLE", DPEL_FLOAT); + handleType(types, "LPT_INTEGER", DPEL_INT); + handleType(types, "LPT_UNSIGNED", DPEL_UINT); + handleType(types, "LPT_DYNCHAR", DPEL_DYN_CHAR); + handleType(types, "LPT_DYNSTRING", DPEL_DYN_STRING); + handleType(types, "LPT_DYNBOOL", DPEL_DYN_BOOL); + handleType(types, "LPT_DYNBLOB", DPEL_DYN_BLOB); + handleType(types, "LPT_DYNDOUBLE", DPEL_DYN_FLOAT); + handleType(types, "LPT_DYNINTEGER", DPEL_DYN_INT); + handleType(types, "LPT_DYNUNSIGNED", DPEL_DYN_UINT); + + types = dpTypes("GCF*"); + if (!dynContains(types, "GCFTempRef")) + { + xxdepes[1] = makeDynString ("GCFTempRef"); + xxdepei[1] = makeDynInt (DPEL_STRING); + dpTypeCreate(xxdepes,xxdepei); + } + else + { + deleteDPs("GCFTempRef"); + } + + if (!dynContains(types, "GCFDataType")) + { + xxdepes[1] = makeDynString ("GCFDataType", ""); + xxdepes[2] = makeDynString ("", "panelAdmin"); + xxdepes[3] = makeDynString ("", "permanentStatus"); + xxdepei[1] = makeDynInt (DPEL_STRUCT); + xxdepei[2] = makeDynInt (0, DPEL_DYNSTRING); + xxdepei[2] = makeDynInt (0, DPEL_BOOL); + dpTypeCreate(xxdepes,xxdepei); + } + + deleteDPs("TTypeA"); + deleteDPs("TTypeB"); + deleteDPs("TTypeC"); + deleteDPs("TTypeD"); + deleteDPs("TTypeE"); + deleteDPs("TTypeF"); + deleteDPs("TTypeG"); + dpCreate("A_K", "TTypeB"); + dpCreate("A_L", "TTypeE"); + dpCreate("B_A_BRD1", "TTypeF"); +} + +deleteDPs(string type) +{ + string dpName; + dyn_string names = dpNames("*",type); + int i, len; + len = dynlen(names); + if (len > 0) + { + for (i = 1; i <= len; i++) + { + dpName = names[i]; + dpDelete(dpName); + DebugN(dpName + " deleted"); + } + } +} + +void handleType(dyn_string types, string type, int dpelType) +{ + if (!dynContains(types, type)) + { + dyn_dyn_string xxdepes; + dyn_dyn_int xxdepei; + xxdepes[1] = makeDynString (type); + xxdepei[1] = makeDynInt (dpelType); + dpTypeCreate(xxdepes,xxdepei); + DebugN("Add type " + type); + } + else + { + deleteDPs(type); + } +} \ No newline at end of file diff --git a/MAC/GCF/_PAL/PA/src/GPA_Controller.cc b/MAC/GCF/_PAL/PA/src/GPA_Controller.cc index b91c914c0a6d93582f0395d38c101bf123aa702a..ebb93871165362fb5d73de541f54b6eb84b34c06 100644 --- a/MAC/GCF/_PAL/PA/src/GPA_Controller.cc +++ b/MAC/GCF/_PAL/PA/src/GPA_Controller.cc @@ -58,6 +58,10 @@ GPAController::GPAController() : // the connection with the PVSS system on construction. Because it will managed // by a singleton the property set only needs to be temporary. GPAPropertySet dummy(*this, _pmlPortProvider); + LOG_INFO("Prepare PVSS DB for proper use by PA"); + system("chmod 777 preparePVSS-DB"); + string sysCmd = "preparePVSS-DB " + GCFPVSSInfo::getProjectName(); + system(sysCmd.c_str()); } GPAController::~GPAController() @@ -96,14 +100,9 @@ GCFEvent::TResult GPAController::initial(GCFEvent& e, GCFPortInterface& p) break; case F_EXIT: - { - LOG_INFO("Initialise PVSS DB"); - system("chmod 777 initPVSSDB"); - string sysCmd = "initPVSSDB " + GCFPVSSInfo::getProjectName(); - system(sysCmd.c_str()); + LOG_INFO("Property Agent is ready!!!"); _garbageTimerId = _distPmlPortProvider.setTimer(2.0, 2.0); break; - } default: status = GCFEvent::NOT_HANDLED; break; diff --git a/MAC/GCF/_PAL/PA/src/Makefile.am b/MAC/GCF/_PAL/PA/src/Makefile.am index 0ef2a22908588ddc83b2ec3956e88c7fef389d69..4f7b386cc10995016e000dfb1689390601e29058 100644 --- a/MAC/GCF/_PAL/PA/src/Makefile.am +++ b/MAC/GCF/_PAL/PA/src/Makefile.am @@ -46,14 +46,13 @@ EXTRA_DIST = \ configfilesdir=$(bindir) configfiles_DATA= \ loadAPC \ - initPVSSDB \ - PropertyAgent.conf \ - LofarPropertyTypes.pvss + preparePVSS-DB \ + configurePVSSProj \ + PropertyAgent.conf -MAC_CONFIG = $(top_srcdir)/../../Config - -%.pvss: $(MAC_CONFIG)/%.pvss - cp $< $@ +install-data-local: + cp -Rf $(top_srcdir)/PA/pvss $(bindir) + chmod 777 $(bindir)/configurePVSSProj %.conf: gcf-pa.conf.in cp $< $@ diff --git a/MAC/GCF/_PAL/PA/src/configurePVSSProj b/MAC/GCF/_PAL/PA/src/configurePVSSProj new file mode 100644 index 0000000000000000000000000000000000000000..a7f442f9e6745afcd1fa09e080a9019c8f4d1c3c --- /dev/null +++ b/MAC/GCF/_PAL/PA/src/configurePVSSProj @@ -0,0 +1,3 @@ +#!/bin/sh + +cp -Rf pvss/* $LOFARHOME/3.0/$1/ \ No newline at end of file diff --git a/MAC/GCF/_PAL/PA/src/initPVSSDB b/MAC/GCF/_PAL/PA/src/initPVSSDB deleted file mode 100644 index 83dc563cd4a150a9e12b72af551ef5f7bcf0d18f..0000000000000000000000000000000000000000 --- a/MAC/GCF/_PAL/PA/src/initPVSSDB +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -PVSS00ctrl -script libs/gcfpa-cl.ctl -proj $1 -PVSS00ascii -in LofarPropertyTypes.pvss -proj $1 diff --git a/MAC/GCF/_PAL/PA/src/preparePVSS-DB b/MAC/GCF/_PAL/PA/src/preparePVSS-DB new file mode 100644 index 0000000000000000000000000000000000000000..75973279d95808f5c6976de4f2f0ce32a8ccec8e --- /dev/null +++ b/MAC/GCF/_PAL/PA/src/preparePVSS-DB @@ -0,0 +1,8 @@ +#!/bin/sh + +PVSS00ctrl -script libs/gcfpa-prep.ctl -proj $1 +if [ -r customPrepPVSSDB.ctl ]; then + cp *.ctl $LOFARHOME/3.0/$1/scripts + PVSS00ctrl -script customPrepPVSSDB.ctl -proj $1 + rm -f $LOFARHOME/3.0/$1/scripts/customPrepPVSSDB.ctl +fi \ No newline at end of file diff --git a/MAC/Test/GCF/src/Makefile.am b/MAC/Test/GCF/src/Makefile.am index a17d465a3472a8f371f0aa8bb7adef052d3dbb6b..2cb26b50776a01dcf57cbc879a90433c405c1927 100644 --- a/MAC/Test/GCF/src/Makefile.am +++ b/MAC/Test/GCF/src/Makefile.am @@ -61,7 +61,8 @@ configfiles_DATA= \ RTPing.conf \ Application1.conf \ Application2.conf \ - log4cplus.properties + log4cplus.properties \ + customPrepPVSSDB.ctl MAC_CONFIG = $(top_srcdir)/../../Config %.properties: $(MAC_CONFIG)/%.properties @@ -70,5 +71,8 @@ MAC_CONFIG = $(top_srcdir)/../../Config %.conf: gcf-test.conf.in cp $< $@ +%.ctl: *.ctl + cp $< $@ + include $(lofar_sharedir)/Makefile.common diff --git a/MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-cl.ctl b/MAC/Test/GCF/src/customPrepPVSSDB.ctl similarity index 73% rename from MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-cl.ctl rename to MAC/Test/GCF/src/customPrepPVSSDB.ctl index 8e46a2a968b4d6ee72fac98789aa64b9d015a4a7..18059a50cf4ff60da55b572e66df1eac0b7ce833 100644 --- a/MAC/GCF/_PAL/PA/pvss/scripts/libs/gcfpa-cl.ctl +++ b/MAC/Test/GCF/src/customPrepPVSSDB.ctl @@ -1,12 +1,5 @@ main() { - deleteDPs("LPT_CHAR"); - deleteDPs("LPT_BOOL"); - deleteDPs("LPT_STRING"); - deleteDPs("LPT_DOUBLE"); - deleteDPs("LPT_INTEGER"); - deleteDPs("LPT_UNSIGNED"); - deleteDPs("GCFTempRef"); deleteDPs("TTypeA"); deleteDPs("TTypeB"); deleteDPs("TTypeC"); @@ -34,4 +27,4 @@ deleteDPs(string type) DebugN(dpName + " deleted"); } } -} +} \ No newline at end of file