From d0f6d2d522ea40a54f63867cdf56e9cf9fb4734e Mon Sep 17 00:00:00 2001 From: Marco Buttu Date: Mon, 25 May 2015 12:48:43 +0000 Subject: [PATCH] Added external calibaration mark control to the ReceiverBoss --- .../ReceiversBoss/include/ReceiversBossImpl.h | 22 ++++- .../ReceiversBoss/include/RecvBossCore.h | 9 ++ .../ReceiversBoss/src/ReceiversBossImpl.cpp | 52 +++++++++-- .../ReceiversBoss/src/RecvBossCore.cpp | 89 ++++++++++++++++++- 4 files changed, 157 insertions(+), 15 deletions(-) diff --git a/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h b/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h index 2ea6331cb..c5276c66f 100644 --- a/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h +++ b/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h @@ -11,6 +11,7 @@ /* Andrea Orlati(aorlati@ira.inaf.it) 22/07/2010 Given implementation of command function */ /* Andrea Orlati(aorlati@ira.inaf.it) 13/09/2010 Given implementation of new signature of getTaper() method */ /* Andrea Orlati(aorlati@ira.inaf.it) 12/02/2013 Changed the method command as new commandInterpreter interface requires */ +/* Marco Buttu (mbuttu@oa-cagliari.inaf.it) 25/05/2015 Added external mark control */ @@ -111,6 +112,23 @@ public: */ void calOff() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); + /** + * This method is used to enable the external control of the calibration mark + * @throw CORBA::SystemExcpetion + * @throw ComponentErrors::ComponentErrorsEx + * @thorw ReceiversErrors::ReceiversErrorsEx + */ + void externalCalOn() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); + + /** + * This method is used to disable the external control of the calibration mark + * @throw CORBA::SystemExcpetion + * @throw ComponentErrors::ComponentErrorsEx + * @thorw ReceiversErrors::ReceiversErrorsEx + */ + void externalCalOff() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); + + /** * This method allows to set local oscillator. Depending on the curretly configured receiver one or more values are considered. * @param lo the list contains the values in MHz for the local oscillator @@ -336,10 +354,6 @@ public: */ virtual void derotatorRewind(CORBA::Long steps) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); - virtual void externalCalOn() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); - - virtual void externalCalOff() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); - /** * It allows to set the initial position (receivers feed geometry) of the derotator. It is valid only in case the FIXED or CUSTOM configuration diff --git a/Common/Servers/ReceiversBoss/include/RecvBossCore.h b/Common/Servers/ReceiversBoss/include/RecvBossCore.h index acae66bb6..1848fa7a2 100644 --- a/Common/Servers/ReceiversBoss/include/RecvBossCore.h +++ b/Common/Servers/ReceiversBoss/include/RecvBossCore.h @@ -11,6 +11,7 @@ /* Andrea Orlati(aorlati@ira.inaf.it) 28/02/2011 For computation is now considered the real band, given by the receiver band and the backend filter */ /* Andrea Orlati(aorlati@ira.inaf.it) 8/04/2013 changes to fit the new K band, dual feed in Medicina */ /* Andrea Orlati(aorlati@ira.inaf.it) 18/06/2013 changes in order to make the length of sequence properties equal to IFs*feeds */ +/* Marco Buttu (mbuttu@oa-cagliari.inaf.it) 25/05/2015 Added external mark control */ #ifdef COMPILE_TARGET_MED @@ -79,6 +80,14 @@ public: void calOff() throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, ComponentErrors::UnexpectedExImpl); + void externalCalOn() throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, + ComponentErrors::UnexpectedExImpl); + + void externalCalOff() throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, + ComponentErrors::UnexpectedExImpl); + + + void setLO(const ACS::doubleSeq& lo) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CORBAProblemExImpl, ReceiversErrors::UnavailableReceiverOperationExImpl,ComponentErrors::UnexpectedExImpl); diff --git a/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp b/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp index 7858164a7..90f8ca002 100644 --- a/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp +++ b/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp @@ -121,6 +121,8 @@ void ReceiversBossImpl::initialize() throw (ACSErr::ACSbaseExImpl) m_parser->add("receiversMode",new function1 >(m_core,&CRecvBossCore::setMode),1); m_parser->add("calOn",new function0(m_core,&CRecvBossCore::calOn),0); m_parser->add("calOff",new function0(m_core,&CRecvBossCore::calOff),0); + m_parser->add("externalCalOn",new function0(m_core,&CRecvBossCore::externalCalOn),0); + m_parser->add("externalCalOff",new function0(m_core,&CRecvBossCore::externalCalOff),0); m_parser->add("setLO",new function1 >(m_core,&CRecvBossCore::setLO),1); m_parser->add("antennaUnitOn",new function0(m_core,&CRecvBossCore::AUOn),0); m_parser->add("antennaUnitOff",new function0(m_core,&CRecvBossCore::AUOff),0); @@ -252,6 +254,47 @@ void ReceiversBossImpl::calOff() throw (CORBA::SystemException,ComponentErrors:: } } + +void ReceiversBossImpl::externalCalOn() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) +{ + try { + m_core->externalCalOn(); + } + catch (ComponentErrors::ComponentErrorsExImpl& ex) { + ex.log(LM_DEBUG); + throw ex.getComponentErrorsEx(); + } + catch (ReceiversErrors::ReceiversErrorsExImpl& ex) { + ex.log(LM_DEBUG); + throw ex.getReceiversErrorsEx(); + } + catch (...) { + _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"ReceiversBossImpl::externalCalOn()"); + impl.log(LM_DEBUG); + throw impl.getComponentErrorsEx(); + } +} + +void ReceiversBossImpl::externalCalOff() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) +{ + try { + m_core->externalCalOff(); + } + catch (ComponentErrors::ComponentErrorsExImpl& ex) { + ex.log(LM_DEBUG); + throw ex.getComponentErrorsEx(); + } + catch (ReceiversErrors::ReceiversErrorsExImpl& ex) { + ex.log(LM_DEBUG); + throw ex.getReceiversErrorsEx(); + } + catch (...) { + _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"ReceiversBossImpl::externalCalOff()"); + impl.log(LM_DEBUG); + throw impl.getComponentErrorsEx(); + } +} + void ReceiversBossImpl::setLO(const ACS::doubleSeq& lo) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) { try { @@ -732,15 +775,6 @@ void ReceiversBossImpl::getDewarParameter(Receivers::TDerotatorConfigurations_ou } -void ReceiversBossImpl::externalCalOn() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) -{ - -} - -void ReceiversBossImpl::externalCalOff() throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) -{ -} - _PROPERTY_REFERENCE_CPP(ReceiversBossImpl,ACS::ROdoubleSeq,m_plocalOscillator,LO); _PROPERTY_REFERENCE_CPP(ReceiversBossImpl,ACS::ROstring,m_pactualSetup,actualSetup); diff --git a/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp b/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp index a4a057843..029b040ac 100644 --- a/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp +++ b/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp @@ -118,6 +118,48 @@ void CRecvBossCore::calOn() throw (ComponentErrors::ValidationErrorExImpl,Compon } } +void CRecvBossCore::externalCalOn() throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, + ComponentErrors::UnexpectedExImpl) +{ + baci::ThreadSyncGuard guard(&m_mutex); + if (m_currentRecvCode=="") { + _EXCPT(ComponentErrors::ValidationErrorExImpl,impl,"CRecvBossCore::externalCalOn()"); + impl.setReason("Receiver not configured yet"); + changeBossStatus(Management::MNG_WARNING); + throw impl; + } + loadReceiver(); // ComponentErrors::CouldntGetComponentExImpl + try { + m_currentRecv->externalCalOn(); + } + catch (CORBA::SystemException& ex) { + _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CRecvBossCore::externalCalOn()"); + impl.setName(ex._name()); + impl.setMinor(ex.minor()); + changeBossStatus(Management::MNG_FAILURE); + m_currentRecvError=true; + throw impl; + } + catch (ComponentErrors::ComponentErrorsEx& ex) { + _ADD_BACKTRACE(ReceiversErrors::UnavailableReceiverOperationExImpl,impl,ex,"CRecvBossCore::externalCalOn()"); + impl.setReceiverCode((const char *)m_currentRecvCode); + changeBossStatus(Management::MNG_FAILURE); + throw impl; + } + catch (ReceiversErrors::ReceiversErrorsEx& ex) { + _ADD_BACKTRACE(ReceiversErrors::UnavailableReceiverOperationExImpl,impl,ex,"CRecvBossCore::externalCalOn()"); + impl.setReceiverCode((const char *)m_currentRecvCode); + changeBossStatus(Management::MNG_FAILURE); + throw impl; + } + catch (...) { + _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CRecvBossCore::externalCalOn()"); + changeBossStatus(Management::MNG_FAILURE); + m_currentRecvError=true; + throw impl; + } +} + void CRecvBossCore::AUOn() throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, ComponentErrors::UnexpectedExImpl) { @@ -225,7 +267,7 @@ void CRecvBossCore::calOff() throw (ComponentErrors::ValidationErrorExImpl,Compo throw impl; } catch (ComponentErrors::ComponentErrorsEx& ex) { - _ADD_BACKTRACE(ReceiversErrors::UnavailableReceiverOperationExImpl,impl,ex,"CRecvBossCore::calOf()f"); + _ADD_BACKTRACE(ReceiversErrors::UnavailableReceiverOperationExImpl,impl,ex,"CRecvBossCore::calOff()"); impl.setReceiverCode((const char *)m_currentRecvCode); changeBossStatus(Management::MNG_FAILURE); throw impl; @@ -237,13 +279,56 @@ void CRecvBossCore::calOff() throw (ComponentErrors::ValidationErrorExImpl,Compo throw impl; } catch (...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CRecvBossCore::calOn()"); + _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CRecvBossCore::calOff()"); changeBossStatus(Management::MNG_FAILURE); m_currentRecvError=true; throw impl; } } +void CRecvBossCore::externalCalOff() throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, + ComponentErrors::UnexpectedExImpl) +{ + baci::ThreadSyncGuard guard(&m_mutex); + if (m_currentRecvCode=="") { + _EXCPT(ComponentErrors::ValidationErrorExImpl,impl,"CRecvBossCore::externalCalOff()"); + impl.setReason("Receiver not configured yet"); + changeBossStatus(Management::MNG_WARNING); + throw impl; + } + loadReceiver(); // ComponentErrors::CouldntGetComponentExImpl + try { + m_currentRecv->externalCalOff(); + } + catch (CORBA::SystemException& ex) { + _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CRecvBossCore::externalCalOff()"); + impl.setName(ex._name()); + impl.setMinor(ex.minor()); + changeBossStatus(Management::MNG_FAILURE); + m_currentRecvError=true; + throw impl; + } + catch (ComponentErrors::ComponentErrorsEx& ex) { + _ADD_BACKTRACE(ReceiversErrors::UnavailableReceiverOperationExImpl,impl,ex,"CRecvBossCore::externalCalOff()"); + impl.setReceiverCode((const char *)m_currentRecvCode); + changeBossStatus(Management::MNG_FAILURE); + throw impl; + } + catch (ReceiversErrors::ReceiversErrorsEx& ex) { + _ADD_BACKTRACE(ReceiversErrors::UnavailableReceiverOperationExImpl,impl,ex,"CRecvBossCore::externalCalOff()"); + impl.setReceiverCode((const char *)m_currentRecvCode); + changeBossStatus(Management::MNG_FAILURE); + throw impl; + } + catch (...) { + _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CRecvBossCore::externalCalOff()"); + changeBossStatus(Management::MNG_FAILURE); + m_currentRecvError=true; + throw impl; + } +} + + double CRecvBossCore::getDerotatorPosition(const ACS::Time& epoch) throw (ComponentErrors::CouldntGetComponentExImpl, ReceiversErrors::DewarPositionerCommandErrorExImpl,ComponentErrors::CORBAProblemExImpl,ComponentErrors::UnexpectedExImpl) { -- GitLab