From 852d8555a52e1b079dd2fbf08f062100f49864bb Mon Sep 17 00:00:00 2001 From: marco-buttu Date: Tue, 3 Mar 2020 11:17:11 +0000 Subject: [PATCH] Fix issue for LBand and CBand --- CHANGELOG.md | 1 + .../src/MFKBandBaseCore.cpp | 4 +- .../SRT7GHzReceiver/src/ComponentCore.cpp | 71 +++++++++++++------ .../SRTLPBandReceiver/src/ComponentCore.cpp | 64 ++++++++++++----- 4 files changed, 102 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ffd11ea..2e7ae4ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,4 +90,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/ ## Fixed issue #518 - In case of communication error we set a dummy value (100000) for the temperature properties, and the related timestamp keeps the value of the last communication timestamp. + issue #525 - When in LOCAL mode the receivers can turn on/off the noise mark. There is no more MNG_FAILURE logging in case of LOCAL mode: only the initial status (during component startup) and the change of status (local to remote and viceversa) are written to the logfile. ## Changed diff --git a/Common/Servers/MFKBandBaseReceiver/src/MFKBandBaseCore.cpp b/Common/Servers/MFKBandBaseReceiver/src/MFKBandBaseCore.cpp index 59524049f..71289855e 100644 --- a/Common/Servers/MFKBandBaseReceiver/src/MFKBandBaseCore.cpp +++ b/Common/Servers/MFKBandBaseReceiver/src/MFKBandBaseCore.cpp @@ -75,14 +75,14 @@ CConfiguration const * const CComponentCore::execute() throw ( if(m_control->isRemoteOn()) { _IRA_LOGFILTER_LOG( LM_INFO, - "CComponentCore::updateIsRemote()", + "CComponentCore::execute()", "RECEVER_REMOTELY_CONTROLLABLE" ); } else { _IRA_LOGFILTER_LOG( LM_INFO, - "CComponentCore::updateIsRemote()", + "CComponentCore::execute()", "RECEVER_NOT_REMOTELY_CONTROLLABLE" ); } diff --git a/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp b/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp index 9839a49b3..d1fe3190b 100644 --- a/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp +++ b/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp @@ -65,6 +65,21 @@ CConfiguration const * const CComponentCore::execute() throw (ComponentErrors:: m_localOscillatorValue=m_configuration.getDefaultLO()[i]; } m_setupMode=""; + + if(m_control->isRemoteOn()) { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::execute()", + "RECEVER_REMOTELY_CONTROLLABLE" + ); + } + else { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::execute()", + "RECEVER_NOT_REMOTELY_CONTROLLABLE" + ); + } return &m_configuration; } @@ -162,10 +177,10 @@ void CComponentCore::externalCalOn() throw ( throw impl; } guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOn()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOn()"); + // throw impl; + // } try { m_control->setExtCalibrationOn(); } @@ -202,10 +217,10 @@ void CComponentCore::externalCalOff() throw ( throw impl; } guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOff()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOff()"); + // throw impl; + // } try { m_control->setExtCalibrationOff(); } @@ -274,10 +289,10 @@ void CComponentCore::calOn() throw (ReceiversErrors::NoRemoteControlErrorExImpl, throw impl; } // guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOn()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOn()"); + // throw impl; + // } try { m_control->setCalibrationOn(); } @@ -301,10 +316,10 @@ void CComponentCore::calOff() throw (ReceiversErrors::NoRemoteControlErrorExImpl throw impl; } // guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOff()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOff()"); + // throw impl; + // } try { m_control->setCalibrationOff(); } @@ -698,10 +713,10 @@ void CComponentCore::updateComponent() { baci::ThreadSyncGuard guard(&m_mutex); m_componentStatus=Management::MNG_OK; - if (checkStatusBit(LOCAL)) { - setComponentStatus(Management::MNG_FAILURE); - _IRA_LOGFILTER_LOG(LM_CRITICAL,"CComponentCore::updateComponent()","RECEVER_NOT_REMOTELY_CONTROLLABLE"); - } + // if (checkStatusBit(LOCAL)) { + // setComponentStatus(Management::MNG_FAILURE); + // _IRA_LOGFILTER_LOG(LM_CRITICAL,"CComponentCore::updateComponent()","RECEVER_NOT_REMOTELY_CONTROLLABLE"); + // } if (checkStatusBit(VACUUMPUMPFAULT)) { setComponentStatus(Management::MNG_WARNING); _IRA_LOGFILTER_LOG(LM_WARNING,"CComponentCore::updateComponent()","VACUUM_PUMP_FAILURE"); @@ -837,6 +852,22 @@ void CComponentCore::updateIsRemote() throw (ReceiversErrors::ReceiverControlBoa setStatusBit(CONNECTIONERROR); throw impl; } + + if (checkStatusBit(LOCAL) && answer) { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::updateIsRemote()", + "RECEVER_SWITCHED_FROM_LOCAL_TO_REMOTE" + ); + } + else if (!checkStatusBit(LOCAL) && !answer) { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::updateIsRemote()", + "RECEVER_SWITCHED_FROM_REMOTE_TO_LOCAL" + ); + } + if (!answer) setStatusBit(LOCAL); else clearStatusBit(LOCAL); clearStatusBit(CONNECTIONERROR); // the communication was ok so clear the CONNECTIONERROR bit diff --git a/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp b/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp index 1e38dc136..41fddbebd 100755 --- a/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp +++ b/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp @@ -70,6 +70,22 @@ CConfiguration const * const CComponentCore::execute() throw ( m_localOscillatorValue = m_configuration.getDefaultLO()[0]; m_actualMode=""; + + if(m_control->isRemoteOn()) { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::execute()", + "RECEVER_REMOTELY_CONTROLLABLE" + ); + } + else { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::execute()", + "RECEVER_NOT_REMOTELY_CONTROLLABLE" + ); + } + return &m_configuration; } @@ -237,10 +253,10 @@ void CComponentCore::externalCalOn() throw ( throw impl; } guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOn()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOn()"); + // throw impl; + // } try { m_control->setExtCalibrationOn(); } @@ -277,10 +293,10 @@ void CComponentCore::externalCalOff() throw ( throw impl; } guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOff()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::externalCalOff()"); + // throw impl; + // } try { m_control->setExtCalibrationOff(); } @@ -324,10 +340,10 @@ void CComponentCore::calOn() throw ( throw impl; } // guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOn()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOn()"); + // throw impl; + // } try { m_control->setCalibrationOn(); m_calDiode=true; @@ -364,10 +380,10 @@ void CComponentCore::calOff() throw ( throw impl; } // guard.release(); - if (checkStatusBit(LOCAL)) { - _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOff()"); - throw impl; - } + // if (checkStatusBit(LOCAL)) { + // _EXCPT(ReceiversErrors::NoRemoteControlErrorExImpl,impl,"CComponentCore::calOff()"); + // throw impl; + // } try { m_control->setCalibrationOff(); m_calDiode=false; @@ -1082,6 +1098,22 @@ void CComponentCore::updateIsRemote() throw (ReceiversErrors::ReceiverControlBoa setStatusBit(CONNECTIONERROR); throw impl; } + + if (checkStatusBit(LOCAL) && answer) { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::updateIsRemote()", + "RECEVER_SWITCHED_FROM_LOCAL_TO_REMOTE" + ); + } + else if (!checkStatusBit(LOCAL) && !answer) { + _IRA_LOGFILTER_LOG( + LM_INFO, + "CComponentCore::updateIsRemote()", + "RECEVER_SWITCHED_FROM_REMOTE_TO_LOCAL" + ); + } + if (!answer) { setStatusBit(LOCAL); } -- GitLab