From 5cbd0a533b52caf1485ee3bb14b12a72e2661259 Mon Sep 17 00:00:00 2001 From: Andrea Orlati <aorlati@users.noreply.github.com> Date: Mon, 9 May 2022 12:12:17 +0200 Subject: [PATCH] Fix issue #699: Medicina primary receiver cal diode control (#710) * fix issue #699: CDB preparation for the Calmux component * fix issue #699: now primary focus receiver, in Medicina, will fire the diode by controlling the calmux * Update PyCalmux.xml Co-authored-by: Giuseppe Carboni <giuseppecarboni89@live.com> --- .../ComponentProxy/include/BackendsProxy.h | 2 ++ .../ReceiversBoss/include/RecvBossCore.h | 2 ++ .../ReceiversBoss/src/RecvBossCore_mc.i | 12 ++++++--- .../Components/BACKENDS/PyCalmux/PyCalmux.xml | 19 +++++++++++++ .../PyCalmuxContainer/PyCalmuxContainer.xml | 27 +++++++++++++++++++ .../CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml | 11 ++++++++ .../DataBlock/PyCalmux/Mapping/Mapping.xml | 11 ++++++++ .../StationProcedures/StationProcedures.xml | 12 +++++++++ .../Components/BACKENDS/PyCalmux/PyCalmux.xml | 19 +++++++++++++ .../PyCalmuxContainer/PyCalmuxContainer.xml | 27 +++++++++++++++++++ .../CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml | 11 ++++++++ .../DataBlock/PyCalmux/Mapping/Mapping.xml | 11 ++++++++ .../StationProcedures/StationProcedures.xml | 6 +++++ .../MedScripts/app-defaults/discosStartup.xml | 9 +++++++ 14 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 Medicina/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml create mode 100644 Medicina/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml create mode 100644 Medicina/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml create mode 100755 Medicina/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml create mode 100644 Medicina/Configuration/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml create mode 100644 Medicina/Configuration/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml create mode 100644 Medicina/Configuration/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml create mode 100755 Medicina/Configuration/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml diff --git a/Common/Libraries/ComponentProxy/include/BackendsProxy.h b/Common/Libraries/ComponentProxy/include/BackendsProxy.h index 0b11e0f01..c86b6b83a 100644 --- a/Common/Libraries/ComponentProxy/include/BackendsProxy.h +++ b/Common/Libraries/ComponentProxy/include/BackendsProxy.h @@ -6,6 +6,7 @@ #include <HolographyC.h> #include <NoiseGeneratorC.h> #include <TotalPowerC.h> +#include <CalMuxC.h> #include "ComponentProxy.h" @@ -16,6 +17,7 @@ namespace Backends PROXY_COMPONENT(Holography); PROXY_COMPONENT(NoiseGenerator); PROXY_COMPONENT(TotalPower); + PROXY_COMPONENT(CalMux); }; #endif diff --git a/Common/Servers/ReceiversBoss/include/RecvBossCore.h b/Common/Servers/ReceiversBoss/include/RecvBossCore.h index 10f98bcd0..cd613ff69 100644 --- a/Common/Servers/ReceiversBoss/include/RecvBossCore.h +++ b/Common/Servers/ReceiversBoss/include/RecvBossCore.h @@ -28,6 +28,7 @@ #include <acsncSimpleSupplier.h> #include <ParserConnector.h> #include "Configuration.h" +#include <BackendsProxy.h> #define _RECVBOSSCORE_MAX_IFS 4 #elif COMPILE_TARGET_NT @@ -350,6 +351,7 @@ private: ACS::Time m_feedsEpoch; ACS::Time m_IFsEpoch; ACS::Time m_modeEpoch; + Backends::CalMux_proxy m_xalMux_proxy; #elif COMPILE_TARGET_NT diff --git a/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i b/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i index d071c6858..773bc67cb 100644 --- a/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i +++ b/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i @@ -45,6 +45,8 @@ void CRecvBossCore::initialize(maci::ContainerServices* services,CConfiguration catch (...) { _THROW_EXCPT(ComponentErrors::UnexpectedExImpl,"CRecvBossCore::initialize()"); } + m_calMux_proxy.setContainerServices(services); + m_calMux_proxy.setComponentName("IDL:alma/Backends/CalMux:1.0"); ACS_LOG(LM_FULL_INFO,"CRecvBossCore::initialize()",(LM_INFO,"ReceiversBoss notification channel open")); } @@ -108,13 +110,14 @@ void CRecvBossCore::calOn() throw (ComponentErrors::ValidationErrorExImpl,Compon } } else if (m_currentRecvCode=="XXP") { + m_calMux_proxy->calOn(); // turn the marca on through the FS - IRA::CString fsBuffer("calon\n"); + /*IRA::CString fsBuffer("calon\n"); if (!sendToFS((const void *)fsBuffer,fsBuffer.GetLength())) { _EXCPT(ComponentErrors::SocketErrorExImpl,impl,"CRecvBossCore::calOn()"); m_status=Management::MNG_FAILURE; throw impl; - } + }*/ } else { _EXCPT(ComponentErrors::ValidationErrorExImpl,impl,"CRecvBossCore::calOn()"); @@ -173,12 +176,13 @@ void CRecvBossCore::calOff() throw (ComponentErrors::ValidationErrorExImpl,Compo } else if (m_currentRecvCode=="XXP") { // turn the marca on through thr FS - IRA::CString fsBuffer("caloff\n"); + /*IRA::CString fsBuffer("caloff\n"); if (!sendToFS((const void *)fsBuffer,fsBuffer.GetLength())) { _EXCPT(ComponentErrors::SocketErrorExImpl,impl,"CRecvBossCore::calOff()"); m_status=Management::MNG_FAILURE; throw impl; - } + }*/ + m_calMux_proxy->calOff(); } else { _EXCPT(ComponentErrors::ValidationErrorExImpl,impl,"CRecvBossCore::calOff()"); diff --git a/Medicina/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml b/Medicina/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml new file mode 100644 index 000000000..465837987 --- /dev/null +++ b/Medicina/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Giuseppe Carboni <giuseppe.carboni@inaf.it> +--> + +<Component + xmlns="urn:schemas-cosylab-com:Component:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + + Name="PyCalmux" + Code="Calmux.PyCalmuxImpl" + Type="IDL:alma/Backends/CalMux:1.0" + Container="PyCalmuxContainer" + ImplLang="py" + KeepAliveTime="-1" + Default="false" +/> diff --git a/Medicina/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml b/Medicina/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml new file mode 100644 index 000000000..6563a97be --- /dev/null +++ b/Medicina/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<Container xmlns="urn:schemas-cosylab-com:Container:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:log="urn:schemas-cosylab-com:LoggingConfig:1.0" + ImplLang="py" + Timeout="30.0" + UseIFR="true" + ManagerRetry="10" + Recovery="false"> + + <Autoload> + <cdb:_ string="baci" /> + </Autoload> + + <LoggingConfig + centralizedLogger="Log" + minLogLevel="5" + minLogLevelLocal="5" + dispatchPacketSize="0" + immediateDispatchLevel="8" + flushPeriodSeconds="1" + > + </LoggingConfig> + +</Container> diff --git a/Medicina/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml b/Medicina/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml new file mode 100644 index 000000000..7097b1130 --- /dev/null +++ b/Medicina/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml @@ -0,0 +1,11 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<!-- + Andrea Orlati, andrea.orlati@inaf.it +--> +<PyCalmux + xmlns="urn:schemas-cosylab-com:PyCalmux:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + IP="127.0.0.1" + PORT="12500"/> diff --git a/Medicina/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml b/Medicina/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml new file mode 100755 index 000000000..a76f12d5f --- /dev/null +++ b/Medicina/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml @@ -0,0 +1,11 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> + +<CalMuxTable xmlns="urn:schemas-cosylab-com:CalMuxTable:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + +<BackendEntry><Backend>TotalPower</Backend><Channel>0</Channel><Polarity>1</Polarity></BackendEntry> +<BackendEntry><Backend>DBBC</Backend><Channel>6</Channel><Polarity>0</Polarity></BackendEntry> + +</CalMuxTable> diff --git a/Medicina/CDB/alma/Procedures/StationProcedures/StationProcedures.xml b/Medicina/CDB/alma/Procedures/StationProcedures/StationProcedures.xml index 3bb13f44d..5d40085f3 100644 --- a/Medicina/CDB/alma/Procedures/StationProcedures/StationProcedures.xml +++ b/Medicina/CDB/alma/Procedures/StationProcedures/StationProcedures.xml @@ -12,6 +12,8 @@ initialize=CCC setSection=0,*,730.0,*,*,*,* setSection=1,*,730.0,*,*,*,* + dmed=default + calmux=TotalPower device=0 calOff restFrequency=0 @@ -29,6 +31,8 @@ setSection=1,*,300.0,*,*,*,* setAttenuation=0,8 setAttenuation=1,12 + dmed=default + calmux=TotalPower device=0 calOff restFrequency=0 @@ -42,6 +46,8 @@ servoSetup=KKC chooseBackend=TotalPower initialize=KKC + dmed=default + calmux=TotalPower device=0 setAttenuation=0,9 setAttenuation=1,9 @@ -61,6 +67,8 @@ initialize=XXP setSection=0,*,730.0,*,*,*,* setSection=1,*,730.0,*,*,*,* + dmed=default + calmux=TotalPower device=0 calOff restFrequency=0 @@ -77,6 +85,8 @@ initialize=CCCL setSection=0,*,300.0,*,*,*,* setSection=1,*,300.0,*,*,*,* + dmed=default + calmux=TotalPower setAttenuation=0,8 setAttenuation=1,8 device=0 @@ -95,6 +105,8 @@ initialize=CHCL setSection=0,*,300.0,*,*,*,* setSection=1,*,300.0,*,*,*,* + dmed=default + calmux=TotalPower setAttenuation=0,8 setAttenuation=1,8 device=0 diff --git a/Medicina/Configuration/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml b/Medicina/Configuration/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml new file mode 100644 index 000000000..465837987 --- /dev/null +++ b/Medicina/Configuration/CDB/MACI/Components/BACKENDS/PyCalmux/PyCalmux.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Giuseppe Carboni <giuseppe.carboni@inaf.it> +--> + +<Component + xmlns="urn:schemas-cosylab-com:Component:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + + Name="PyCalmux" + Code="Calmux.PyCalmuxImpl" + Type="IDL:alma/Backends/CalMux:1.0" + Container="PyCalmuxContainer" + ImplLang="py" + KeepAliveTime="-1" + Default="false" +/> diff --git a/Medicina/Configuration/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml b/Medicina/Configuration/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml new file mode 100644 index 000000000..6563a97be --- /dev/null +++ b/Medicina/Configuration/CDB/MACI/Containers/PyCalmuxContainer/PyCalmuxContainer.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<Container xmlns="urn:schemas-cosylab-com:Container:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:log="urn:schemas-cosylab-com:LoggingConfig:1.0" + ImplLang="py" + Timeout="30.0" + UseIFR="true" + ManagerRetry="10" + Recovery="false"> + + <Autoload> + <cdb:_ string="baci" /> + </Autoload> + + <LoggingConfig + centralizedLogger="Log" + minLogLevel="5" + minLogLevelLocal="5" + dispatchPacketSize="0" + immediateDispatchLevel="8" + flushPeriodSeconds="1" + > + </LoggingConfig> + +</Container> diff --git a/Medicina/Configuration/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml b/Medicina/Configuration/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml new file mode 100644 index 000000000..403442ffc --- /dev/null +++ b/Medicina/Configuration/CDB/alma/BACKENDS/PyCalmux/PyCalmux.xml @@ -0,0 +1,11 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<!-- + Andrea Orlati, andrea.orlati@inaf.it +--> +<PyCalmux + xmlns="urn:schemas-cosylab-com:PyCalmux:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + IP="192.168.51.202" + PORT="5003"/> diff --git a/Medicina/Configuration/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml b/Medicina/Configuration/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml new file mode 100755 index 000000000..a76f12d5f --- /dev/null +++ b/Medicina/Configuration/CDB/alma/DataBlock/PyCalmux/Mapping/Mapping.xml @@ -0,0 +1,11 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> + +<CalMuxTable xmlns="urn:schemas-cosylab-com:CalMuxTable:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + +<BackendEntry><Backend>TotalPower</Backend><Channel>0</Channel><Polarity>1</Polarity></BackendEntry> +<BackendEntry><Backend>DBBC</Backend><Channel>6</Channel><Polarity>0</Polarity></BackendEntry> + +</CalMuxTable> diff --git a/Medicina/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml b/Medicina/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml index a63c30bbd..c449277cc 100644 --- a/Medicina/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml +++ b/Medicina/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml @@ -11,6 +11,7 @@ chooseBackend=TotalPower initialize=CCC dmed=default + calmux=TotalPower setSection=0,*,730.0,*,*,*,* setSection=1,*,730.0,*,*,*,* device=0 @@ -27,6 +28,7 @@ chooseBackend=TotalPower initialize=CHC dmed=default + calmux=TotalPower setSection=0,*,300.0,*,*,*,* setSection=1,*,300.0,*,*,*,* setAttenuation=0,8 @@ -45,6 +47,7 @@ chooseBackend=TotalPower initialize=KKC dmed=default + calmux=TotalPower device=0 setAttenuation=0,9 setAttenuation=1,9 @@ -63,6 +66,7 @@ chooseBackend=TotalPower initialize=XXP dmed=default + calmux=TotalPower setSection=0,*,730.0,*,*,*,* setSection=1,*,730.0,*,*,*,* device=0 @@ -80,6 +84,7 @@ chooseBackend=TotalPower initialize=CCCL dmed=default + calmux=TotalPower setSection=0,*,300.0,*,*,*,* setSection=1,*,300.0,*,*,*,* setAttenuation=0,8 @@ -99,6 +104,7 @@ chooseBackend=TotalPower initialize=CHCL dmed=default + calmux=TotalPower setSection=0,*,300.0,*,*,*,* setSection=1,*,300.0,*,*,*,* setAttenuation=0,8 diff --git a/Medicina/Misc/MedScripts/app-defaults/discosStartup.xml b/Medicina/Misc/MedScripts/app-defaults/discosStartup.xml index c0e00968c..acc5a3bd5 100644 --- a/Medicina/Misc/MedScripts/app-defaults/discosStartup.xml +++ b/Medicina/Misc/MedScripts/app-defaults/discosStartup.xml @@ -118,6 +118,15 @@ <remoteHost>MASTERHOST</remoteHost> <remoteAccount>discos</remoteAccount> </container> + <container> + <name>PyCalmuxContainer</name> + <type>py</type> + <heapSizeMB></heapSizeMB> + <useDedicatedSettings>true</useDedicatedSettings> + <scriptBase>0</scriptBase> + <remoteHost>MASTERHOST</remoteHost> + <remoteAccount>discos</remoteAccount> + </container> <container> <name>PointContainer</name> <type>cpp</type> -- GitLab