Loading Common/Servers/Roach/include/CommandLine.h +6 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,10 @@ public: void setup(const char *conf) throw (BackendsErrors::BackendBusyExImpl,BackendsErrors::ConfigurationErrorExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl, ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl,ComponentErrors::CDBAccessExImpl); void setTargetFileName(const char *conf); void sendTargetFileName() throw (BackendsErrors::BackendBusyExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl, ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl); /** * This function can be used to set up an input of the backend. The input is identified by its numeric value. If a configuration * parameter is negative the current value is not changed. Since the backend hardware does not support different sample rates Loading Loading @@ -444,6 +448,8 @@ public: int getCommProtVersion(CORBA::String_out version); IRA::CString m_targetFileName; protected: /** * Automatically called by the framework as a result of a connection request. See super-class for more details. Loading Common/Servers/Roach/src/CommandLine.cpp +46 −1 Original line number Diff line number Diff line Loading @@ -462,7 +462,7 @@ void CCommandLine::setConfiguration(const long& inputId,const double& freq,const throw impl; }*/ if (pol == 2) { // FULL STOKES m_sectionsNumber = m_sectionsNumber/2; m_sectionsNumber = 1; // TBC!!!!!!!!!!!!!!!!!!!!!!!! m_polarization[inputId] = Backends::BKND_FULL_STOKES; } if (inputId>=0) { //check the section id is in valid ranges Loading Loading @@ -917,6 +917,51 @@ void CCommandLine::setDefaultConfiguration(const IRA::CString & config) throw (C ACS_LOG(LM_FULL_INFO,"CCommandLine::setDefaultConfiguration()",(LM_INFO,"DEFAULTS_ARE_SET")); } void CCommandLine::setTargetFileName(const char *conf) { m_targetFileName = (const char*)conf; } void CCommandLine::sendTargetFileName() throw (BackendsErrors::BackendBusyExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl) { AUTO_TRACE("CCommandLine::sendTargetFileName()"); int res; WORD len; char sBuff[SENDBUFFERSIZE]; char rBuff[RECBUFFERSIZE]; // I do not check for backend busy because this is a call done at the initialization and never repeated if (!checkConnection()) { _THROW_EXCPT(BackendsErrors::ConnectionExImpl,"CCommandLine::sendTargetFileName()"); } strcpy (sBuff,"?set-filename,"); strcat (sBuff,(const char*)m_targetFileName); strcat (sBuff,"\r\n"); len = strlen (sBuff); if ((res=sendBuffer(sBuff,len))==SUCCESS) { res=receiveBuffer(rBuff,RECBUFFERSIZE); } if (res>0) { // operation was ok. //if (!CProtocol::setConfiguration(rBuff)) { // _THROW_EXCPT(BackendsErrors::NakExImpl,"CCommandLine::setTargetFileName()"); //} } else if (res==FAIL) { _EXCPT_FROM_ERROR(ComponentErrors::IRALibraryResourceExImpl,dummy,m_Error); dummy.setCode(m_Error.getErrorCode()); dummy.setDescription((const char*)m_Error.getDescription()); m_Error.Reset(); _THROW_EXCPT_FROM_EXCPT(ComponentErrors::SocketErrorExImpl,dummy,"CCommandLine::sendTargetFileName()"); } else if (res==WOULDBLOCK) { _THROW_EXCPT(ComponentErrors::TimeoutExImpl,"CCommandLine::sendTargetFileName()"); } else { _THROW_EXCPT(BackendsErrors::ConnectionExImpl,"CCommandLine::sendTargetFileName()"); } ACS_LOG(LM_FULL_INFO,"CCommandLine::sendTargetFileName()",(LM_INFO,"targetFileName SENT")); } void CCommandLine::setup(const char *conf) throw (BackendsErrors::BackendBusyExImpl,BackendsErrors::ConfigurationErrorExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl, ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl,ComponentErrors::CDBAccessExImpl) { Loading Common/Servers/Roach/src/RoachImpl.cpp +38 −2 Original line number Diff line number Diff line Loading @@ -480,7 +480,7 @@ void RoachImpl::sendStop() throw (CORBA::SystemException, BackendsErrors::Backen throw dummy.getComponentErrorsEx(); } //I explicity release the mutex before accessing the sender thread because it also make use of the command line...just to make sure to avoid deadlock line.Release(); //line.Release(); //m_senderThread->suspendTransfer(); try { Loading @@ -496,6 +496,22 @@ void RoachImpl::sendStop() throw (CORBA::SystemException, BackendsErrors::Backen throw impl.getComponentErrorsEx(); } try { line->sendTargetFileName(); } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getComponentErrorsEx(); } catch (BackendsErrors::BackendsErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getBackendsErrorsEx(); } catch (...) { _EXCPT(ComponentErrors::UnexpectedExImpl,dummy,"RoachImpl::sendStop()"); dummy.log(LM_DEBUG); throw dummy.getComponentErrorsEx(); } } /*void RoachImpl::setAllSections(CORBA::Double freq,CORBA::Double bw,CORBA::Long feed,Backends::TPolarization pol,CORBA::Double sr,CORBA::Long bins) throw ( Loading Loading @@ -548,7 +564,27 @@ void RoachImpl::setSection(CORBA::Long input,CORBA::Double freq,CORBA::Double bw void RoachImpl::setTargetFileName (const char * fileName) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx, BackendsErrors::BackendsErrorsEx) { // nothing to do AUTO_TRACE("RoachImpl::setTargetFileName()"); CSecAreaResourceWrapper<CCommandLine> line=m_commandLine->Get(); line->setTargetFileName(fileName); /*try { } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getComponentErrorsEx(); } catch (BackendsErrors::BackendsErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getBackendsErrorsEx(); } catch (...) { _EXCPT(ComponentErrors::UnexpectedExImpl,dummy,"RoachImpl::setSection()"); dummy.log(LM_DEBUG); throw dummy.getComponentErrorsEx(); }*/ } ACS::doubleSeq *RoachImpl::getTpi() throw (CORBA::SystemException, Loading Loading
Common/Servers/Roach/include/CommandLine.h +6 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,10 @@ public: void setup(const char *conf) throw (BackendsErrors::BackendBusyExImpl,BackendsErrors::ConfigurationErrorExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl, ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl,ComponentErrors::CDBAccessExImpl); void setTargetFileName(const char *conf); void sendTargetFileName() throw (BackendsErrors::BackendBusyExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl, ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl); /** * This function can be used to set up an input of the backend. The input is identified by its numeric value. If a configuration * parameter is negative the current value is not changed. Since the backend hardware does not support different sample rates Loading Loading @@ -444,6 +448,8 @@ public: int getCommProtVersion(CORBA::String_out version); IRA::CString m_targetFileName; protected: /** * Automatically called by the framework as a result of a connection request. See super-class for more details. Loading
Common/Servers/Roach/src/CommandLine.cpp +46 −1 Original line number Diff line number Diff line Loading @@ -462,7 +462,7 @@ void CCommandLine::setConfiguration(const long& inputId,const double& freq,const throw impl; }*/ if (pol == 2) { // FULL STOKES m_sectionsNumber = m_sectionsNumber/2; m_sectionsNumber = 1; // TBC!!!!!!!!!!!!!!!!!!!!!!!! m_polarization[inputId] = Backends::BKND_FULL_STOKES; } if (inputId>=0) { //check the section id is in valid ranges Loading Loading @@ -917,6 +917,51 @@ void CCommandLine::setDefaultConfiguration(const IRA::CString & config) throw (C ACS_LOG(LM_FULL_INFO,"CCommandLine::setDefaultConfiguration()",(LM_INFO,"DEFAULTS_ARE_SET")); } void CCommandLine::setTargetFileName(const char *conf) { m_targetFileName = (const char*)conf; } void CCommandLine::sendTargetFileName() throw (BackendsErrors::BackendBusyExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl) { AUTO_TRACE("CCommandLine::sendTargetFileName()"); int res; WORD len; char sBuff[SENDBUFFERSIZE]; char rBuff[RECBUFFERSIZE]; // I do not check for backend busy because this is a call done at the initialization and never repeated if (!checkConnection()) { _THROW_EXCPT(BackendsErrors::ConnectionExImpl,"CCommandLine::sendTargetFileName()"); } strcpy (sBuff,"?set-filename,"); strcat (sBuff,(const char*)m_targetFileName); strcat (sBuff,"\r\n"); len = strlen (sBuff); if ((res=sendBuffer(sBuff,len))==SUCCESS) { res=receiveBuffer(rBuff,RECBUFFERSIZE); } if (res>0) { // operation was ok. //if (!CProtocol::setConfiguration(rBuff)) { // _THROW_EXCPT(BackendsErrors::NakExImpl,"CCommandLine::setTargetFileName()"); //} } else if (res==FAIL) { _EXCPT_FROM_ERROR(ComponentErrors::IRALibraryResourceExImpl,dummy,m_Error); dummy.setCode(m_Error.getErrorCode()); dummy.setDescription((const char*)m_Error.getDescription()); m_Error.Reset(); _THROW_EXCPT_FROM_EXCPT(ComponentErrors::SocketErrorExImpl,dummy,"CCommandLine::sendTargetFileName()"); } else if (res==WOULDBLOCK) { _THROW_EXCPT(ComponentErrors::TimeoutExImpl,"CCommandLine::sendTargetFileName()"); } else { _THROW_EXCPT(BackendsErrors::ConnectionExImpl,"CCommandLine::sendTargetFileName()"); } ACS_LOG(LM_FULL_INFO,"CCommandLine::sendTargetFileName()",(LM_INFO,"targetFileName SENT")); } void CCommandLine::setup(const char *conf) throw (BackendsErrors::BackendBusyExImpl,BackendsErrors::ConfigurationErrorExImpl,ComponentErrors::TimeoutExImpl,BackendsErrors::ConnectionExImpl, ComponentErrors::SocketErrorExImpl,BackendsErrors::NakExImpl,ComponentErrors::CDBAccessExImpl) { Loading
Common/Servers/Roach/src/RoachImpl.cpp +38 −2 Original line number Diff line number Diff line Loading @@ -480,7 +480,7 @@ void RoachImpl::sendStop() throw (CORBA::SystemException, BackendsErrors::Backen throw dummy.getComponentErrorsEx(); } //I explicity release the mutex before accessing the sender thread because it also make use of the command line...just to make sure to avoid deadlock line.Release(); //line.Release(); //m_senderThread->suspendTransfer(); try { Loading @@ -496,6 +496,22 @@ void RoachImpl::sendStop() throw (CORBA::SystemException, BackendsErrors::Backen throw impl.getComponentErrorsEx(); } try { line->sendTargetFileName(); } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getComponentErrorsEx(); } catch (BackendsErrors::BackendsErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getBackendsErrorsEx(); } catch (...) { _EXCPT(ComponentErrors::UnexpectedExImpl,dummy,"RoachImpl::sendStop()"); dummy.log(LM_DEBUG); throw dummy.getComponentErrorsEx(); } } /*void RoachImpl::setAllSections(CORBA::Double freq,CORBA::Double bw,CORBA::Long feed,Backends::TPolarization pol,CORBA::Double sr,CORBA::Long bins) throw ( Loading Loading @@ -548,7 +564,27 @@ void RoachImpl::setSection(CORBA::Long input,CORBA::Double freq,CORBA::Double bw void RoachImpl::setTargetFileName (const char * fileName) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx, BackendsErrors::BackendsErrorsEx) { // nothing to do AUTO_TRACE("RoachImpl::setTargetFileName()"); CSecAreaResourceWrapper<CCommandLine> line=m_commandLine->Get(); line->setTargetFileName(fileName); /*try { } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getComponentErrorsEx(); } catch (BackendsErrors::BackendsErrorsExImpl& ex) { ex.log(LM_DEBUG); throw ex.getBackendsErrorsEx(); } catch (...) { _EXCPT(ComponentErrors::UnexpectedExImpl,dummy,"RoachImpl::setSection()"); dummy.log(LM_DEBUG); throw dummy.getComponentErrorsEx(); }*/ } ACS::doubleSeq *RoachImpl::getTpi() throw (CORBA::SystemException, Loading