diff --git a/MAC/APL/RTDBCommon/src/ClaimMgrTask.h b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h similarity index 96% rename from MAC/APL/RTDBCommon/src/ClaimMgrTask.h rename to MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h index 9c3e6754db4c4f4eb91c550dce3095b9f7daf489..3fc8c378e855f0deef79baf6f63c5f560354e37c 100644 --- a/MAC/APL/RTDBCommon/src/ClaimMgrTask.h +++ b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h @@ -51,7 +51,7 @@ public: static ClaimMgrTask* instance(bool temporary = false); static void release(); - // member functions + // Ask the claimManager the claim an object. An ClaimReply event is send to the given port. void claimObject(const string& objectType, const string& nameInAppl, GCFPortInterface& replyPort); diff --git a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am index aa8ccc6d38a00871a9c2997f3d94f4f55bc20dbb..8b8a74bc5dd3f78d956601e0e5d1dbef6f2fa97a 100644 --- a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am +++ b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am @@ -1,4 +1,4 @@ -INSTHDRS = RTDButilities.h +INSTHDRS = RTDButilities.h ClaimMgrTask.h NOINSTHDRS = TCCHDRS = diff --git a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc index 666884f12fc00bd23aef4377be4a362998a37b2a..f6e998a35ac56c03715b45d3302efddf24c604e8 100644 --- a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc +++ b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc @@ -26,8 +26,8 @@ #include <GCF/PVSS/GCF_PVString.h> #include <GCF/RTDB/DP_Protocol.ph> +#include <APL/RTDBCommon/ClaimMgrTask.h> #include "CM_Protocol.ph" -#include "ClaimMgrTask.h" namespace LOFAR { using namespace GCF::TM; @@ -219,7 +219,13 @@ GCFEvent::TResult ClaimMgrTask::operational(GCFEvent& event, GCFPortInterface& p } if (itsFieldsReceived >= 3) { LOG_DEBUG_STR("@@@@@ NewObjectName = " << itsResultDPname); - // ... BACK TO USER + // Report claimresult back to the user + CMClaimResultEvent cmEvent; + cmEvent.typeName = itsObjectType; + cmEvent.nameInAppl = itsNameInAppl; + cmEvent.DPname = itsResultDPname; + itsReplyPort->send(cmEvent); + // clear admin to reaceive a new calim request. itsObjectType.clear(); itsNameInAppl.clear(); itsResultDPname.clear(); diff --git a/MAC/APL/RTDBCommon/src/Makefile.am b/MAC/APL/RTDBCommon/src/Makefile.am index 0fd1c3f2912b3bb6b49ed0b00f5185a89bfb7b1a..855b277dafa72ba1250804af7c51dfbe88467fa8 100644 --- a/MAC/APL/RTDBCommon/src/Makefile.am +++ b/MAC/APL/RTDBCommon/src/Makefile.am @@ -12,7 +12,7 @@ clean-local: bin_PROGRAMS = versionrtdbcommon -INSTHDRS = CM_Protocol.ph ClaimMgrTask.h +INSTHDRS = CM_Protocol.ph NOINSTHDRS = BUILT_SOURCES = CM_Protocol.cc \ CM_Protocol.ph diff --git a/MAC/APL/RTDBCommon/test/tClaimManager.cc b/MAC/APL/RTDBCommon/test/tClaimManager.cc index 7907bfa93aaf43b25acfb913ce937c3690baf2ee..6fd330d35256f6dab47a7e5e4a957d4330c810e1 100644 --- a/MAC/APL/RTDBCommon/test/tClaimManager.cc +++ b/MAC/APL/RTDBCommon/test/tClaimManager.cc @@ -43,6 +43,8 @@ MgrTest::MgrTest(const string& name) : itsTimerPort = new GCFTimerPort(*this, "timerPort"); ASSERTSTR(itsTimerPort, "=@=@= Can't allocate GCFTimerPort"); + itsMsgPort = new GCFITCPort (*this, *this, "ITCPort", GCFPortInterface::SAP, CM_PROTOCOL); + ASSERTSTR(itsMsgPort, "=@=@= Can't allocate GCFITCPort"); registerProtocol(F_FSM_PROTOCOL, F_FSM_PROTOCOL_STRINGS); registerProtocol(CM_PROTOCOL, CM_PROTOCOL_STRINGS); @@ -71,7 +73,7 @@ GCFEvent::TResult MgrTest::doTest(GCFEvent& event, GCFPortInterface& port) ASSERTSTR(itsClaimMgrTask, "Can't construct a claimMgrTask"); LOG_DEBUG_STR("=@=@= Calling claimManager for 'Observation7'"); - itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation7", *itsTimerPort); + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation7", *itsMsgPort); itsTimerPort->setTimer(10.0); break; diff --git a/MAC/APL/RTDBCommon/test/tClaimManager.h b/MAC/APL/RTDBCommon/test/tClaimManager.h index de6c02bfa1d16be44104915caec6ea1a5f84f75b..7d011b55dddad0849549df3b7f440acfc170b6a0 100644 --- a/MAC/APL/RTDBCommon/test/tClaimManager.h +++ b/MAC/APL/RTDBCommon/test/tClaimManager.h @@ -40,6 +40,7 @@ public: private: GCFTimerPort* itsTimerPort; + GCFITCPort* itsMsgPort; ClaimMgrTask* itsClaimMgrTask; };