From 68950f988816729477941e6579f5e31b2a89beb8 Mon Sep 17 00:00:00 2001 From: Andrea Orlati <aorlati@users.noreply.github.com> Date: Thu, 8 Nov 2018 14:50:34 +0100 Subject: [PATCH] Including some must-have developments into next release (#285) * fix issue #274: fits file history update after the section table update (#276) * Fitzilla completion (#282) * working #38: some keywords in summary file not null anymore * added setDefaultLogfile method to CustomLogger interface * implemented setDefaultLogfile method in CustomLogger component * working issue #38: other set of keywords are now meaningful * issue #38: EXPTIME added to the set of keywords that are not null anymore * closing issue #142: at the end of a schedule the log file is changed to default * issue #38: updated version and file history * DiscosVersion Library not compiled when making the system * fix issue#239: The SINGAL keyword in the main header expanded in order to track the calibration diode status (#278) * fix issue #239: small bug related to cal noise status fixed * Fix #283, removed the unnecessary and wrong lines from sardara DataBlock. (#284) --- .../idl/ManagmentDefinitions.midl | 2 + .../include/ManagementModule.h | 16 +- .../ManagmentInterface/idl/CustomLogger.midl | 6 + .../ManagmentInterface/idl/DataReceiver.idl | 2 + .../idl/CommonReceiverInterface.idl | 3 +- .../DiscosVersion/include/DiscosVersion.h | 50 ++++ .../DiscosVersion/src/DiscosVersion.cpp | 19 ++ Common/Libraries/DiscosVersion/src/Makefile | 221 ++++++++++++++++++ .../CustomLogger/include/CustomLoggerImpl.h | 6 + .../CustomLogger/src/CustomLoggerImpl.cpp | 39 +++- .../FitsWriter/include/DataCollection.h | 16 ++ Common/Servers/FitsWriter/include/MetaData.h | 14 +- .../FitsWriter/include/SummarySchema.h | 2 +- Common/Servers/FitsWriter/include/Version.h | 7 +- .../Servers/FitsWriter/src/DataCollection.cpp | 4 + .../Servers/FitsWriter/src/EngineThread.cpp | 44 +++- Common/Servers/FitsWriter/src/FitsWriter.cpp | 3 +- Common/Servers/FitsWriter/src/Makefile | 7 +- Common/Servers/FitsWriter/src/MetaData.cpp | 13 ++ .../Servers/FitsWriter/src/SummaryWriter.cpp | 2 + Common/Servers/FitsWriter/src/TestSummary.cpp | 20 +- .../ReceiversBoss/include/ReceiversBossImpl.h | 3 +- .../ReceiversBoss/include/RecvBossCore.h | 6 +- .../ReceiversBoss/src/ReceiversBossImpl.cpp | 7 +- .../ReceiversBoss/src/RecvBossCore.cpp | 6 +- .../ReceiversBoss/src/RecvBossCore_mc.i | 6 +- .../ReceiversBoss/src/RecvBossCore_nt.i | 6 +- .../Servers/Scheduler/include/Configuration.h | 6 + Common/Servers/Scheduler/include/Core_Basic.h | 14 +- .../Servers/Scheduler/include/Core_Common.h | 7 +- .../Servers/Scheduler/include/Core_Resource.h | 3 +- .../Scheduler/include/ScheduleReport.h | 2 + .../Servers/Scheduler/src/Configuration.cpp | 10 + Common/Servers/Scheduler/src/Core.cpp | 2 + Common/Servers/Scheduler/src/Core_Basic.i | 46 +++- Common/Servers/Scheduler/src/Core_Common.i | 28 ++- .../Servers/Scheduler/src/Core_Operations.i | 41 +++- .../Scheduler/src/ScheduleExecutor.cpp | 8 +- .../Servers/Scheduler/src/ScheduleReport.cpp | 5 + .../NotoReceivers/include/ComponentCore.h | 5 +- .../NotoReceivers/include/NotoReceiversImpl.h | 2 +- .../NotoReceivers/src/ComponentCore.cpp | 6 +- .../NotoReceivers/src/NotoReceiversImpl.cpp | 4 +- .../CDB/alma/DataBlock/Sardara/Sardara.xml | 4 - .../SRT7GHzReceiver/include/ComponentCore.h | 4 +- .../SRT7GHzReceiver/include/SRT7GHzImpl.h | 5 +- .../SRT7GHzReceiver/src/ComponentCore.cpp | 7 +- .../SRT7GHzReceiver/src/SRT7GHzImpl.cpp | 4 +- .../include/ComponentCore.h | 2 + .../include/SRTKBandMFReceiverImpl.h | 1 + .../SRTKBandMFReceiver/src/ComponentCore.cpp | 9 +- .../src/SRTKBandMFReceiverImpl.cpp | 3 +- .../SRTLPBandReceiver/include/ComponentCore.h | 2 + .../include/SRTLPBandReceiverImpl.h | 1 + .../SRTLPBandReceiver/src/ComponentCore.cpp | 8 +- .../src/SRTLPBandReceiverImpl.cpp | 3 +- SystemMake/Makefile | 2 +- 57 files changed, 691 insertions(+), 83 deletions(-) create mode 100644 Common/Libraries/DiscosVersion/include/DiscosVersion.h create mode 100644 Common/Libraries/DiscosVersion/src/DiscosVersion.cpp create mode 100644 Common/Libraries/DiscosVersion/src/Makefile diff --git a/Common/Interfaces/CommonInterface/idl/ManagmentDefinitions.midl b/Common/Interfaces/CommonInterface/idl/ManagmentDefinitions.midl index ac9daeb7c..3eaf865d5 100644 --- a/Common/Interfaces/CommonInterface/idl/ManagmentDefinitions.midl +++ b/Common/Interfaces/CommonInterface/idl/ManagmentDefinitions.midl @@ -76,6 +76,8 @@ module Management { enum TSubScanSignal { MNG_SIGNAL_SIGNAL, /*!< The subscan signal is on source */ MNG_SIGNAL_REFERENCE, /*!< The subscan signal is off source */ + MNG_SIGNAL_REFCAL, /*!< The subscan signal is off source and calibration diode is fired */ + MNG_SIGNAL_REFSIG, /*!< The subscan signal is on source and the calibration diode is fired */ MNG_SIGNAL_NONE /*!< The subscan signal is undetermined, during OTF for example */ }; diff --git a/Common/Interfaces/CommonInterface/include/ManagementModule.h b/Common/Interfaces/CommonInterface/include/ManagementModule.h index aaa28b809..bb2bd2801 100644 --- a/Common/Interfaces/CommonInterface/include/ManagementModule.h +++ b/Common/Interfaces/CommonInterface/include/ManagementModule.h @@ -103,6 +103,14 @@ public: mode=Management::MNG_SIGNAL_NONE; return true; } + else if (strcasecmp(strScan,"REFCAL")==0) { + mode=Management::MNG_SIGNAL_REFCAL; + return true; + } + else if (strcasecmp(strScan,"REFSIG")==0) { + mode=Management::MNG_SIGNAL_REFSIG; + return true; + } else { return false; } @@ -115,6 +123,12 @@ public: if (scan==Management::MNG_SIGNAL_REFERENCE) { return "REFERENCE"; } + if (scan==Management::MNG_SIGNAL_REFCAL) { + return "REFCAL"; + } + if (scan==Management::MNG_SIGNAL_REFSIG) { + return "REFSIG"; + } else { //Management::MNG_SIGNAL_REFERENCE return "NONE"; } @@ -125,6 +139,4 @@ public: }; - - #endif /* MANAGEMENTMODULE_H_ */ diff --git a/Common/Interfaces/ManagmentInterface/idl/CustomLogger.midl b/Common/Interfaces/ManagmentInterface/idl/CustomLogger.midl index 6bf11f76c..26e38822f 100644 --- a/Common/Interfaces/ManagmentInterface/idl/CustomLogger.midl +++ b/Common/Interfaces/ManagmentInterface/idl/CustomLogger.midl @@ -61,6 +61,12 @@ module Management{ */ void setLogfile(in string base_path, in string filename) raises (ManagementErrors::ManagementErrorsEx); + /** + * Close the actual log files and open a new one for logging. + * This call will automatically open the default log file as set in the CDB + * Tries to create the necessary directory. + */ + void setDefaultLogfile() raises (ManagementErrors::ManagementErrorsEx); /** * Emits a classical ACS logging message. Used mainly for debugging and testing purposes. * @param msg: the logging message diff --git a/Common/Interfaces/ManagmentInterface/idl/DataReceiver.idl b/Common/Interfaces/ManagmentInterface/idl/DataReceiver.idl index 195c312b1..624686ee0 100644 --- a/Common/Interfaces/ManagmentInterface/idl/DataReceiver.idl +++ b/Common/Interfaces/ManagmentInterface/idl/DataReceiver.idl @@ -33,7 +33,9 @@ module Management { string baseName; // name of the file string scanLayout; string schedule; // name of the schedule + string log; //name of the log long device; + string backendName; } TScanSetup; /** diff --git a/Common/Interfaces/ReceiversInterface/idl/CommonReceiverInterface.idl b/Common/Interfaces/ReceiversInterface/idl/CommonReceiverInterface.idl index 09b21a162..d556385bd 100644 --- a/Common/Interfaces/ReceiversInterface/idl/CommonReceiverInterface.idl +++ b/Common/Interfaces/ReceiversInterface/idl/CommonReceiverInterface.idl @@ -121,6 +121,7 @@ module Receivers { * @param ifs is a list that identfies which IFs of the feed we are interested in, usually 0..<i>IFs</i>-1 * @param skyFreq used to return the resulting frequency whan comparing the detector subband and the receiver IF band, the band is the real observed frequency in fact the oscillator is also added (MHz) * @param skyBw used to return the total observed bandwidth. (Mhz) + * @param onoff true if the calibration diode is turned on. * @param scaleFactor this value is used as a weight during system temperature computation in order to scale to a real tsys value. * @return for each subband the list of the noise calibration values in Kelvin degrees. It must be freed by the caller. * @throw ComponentErrors::ComponentErrorsEx @@ -128,7 +129,7 @@ module Receivers { * @throw CORBA::SystemException */ ACS::doubleSeq getCalibrationMark(in ACS::doubleSeq freqs,in ACS::doubleSeq bandwidths,in ACS::longSeq feeds,in ACS::longSeq ifs,out ACS::doubleSeq skyFreq,out ACS::doubleSeq skyBw, - out double scaleFactor) raises (ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); + out boolean onoff,out double scaleFactor) raises (ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); /** diff --git a/Common/Libraries/DiscosVersion/include/DiscosVersion.h b/Common/Libraries/DiscosVersion/include/DiscosVersion.h new file mode 100644 index 000000000..e9937eb0d --- /dev/null +++ b/Common/Libraries/DiscosVersion/include/DiscosVersion.h @@ -0,0 +1,50 @@ +/* ************************************************************************************************************* */ +/* DISCOS project */ +/* */ +/* This code is under GNU General Public Licence (GPL). */ +/* */ +/* Who when What */ +/* Andrea Orlati (a.orlati@ira.inaf.it) 25/05/2017 +*/ + +#include <IRA> + +#ifndef DISCOSVERSION_H_ +#define DISCOSVERSION_H_ + + + +#ifdef COMPILE_TARGET_MED + +#define _STATION "Medicina" + +#elif COMPILE_TARGET_NT + +#define _STATION "Noto" + +#else + +#define _STATION "SRT" + +#endif + +#define _CURRENT_VERSION_MAJOR 1 +#define _CURRENT_VERSION_MINOR 0 + +#define _CURRENT_PRODUCT "DISCOS" + +namespace DiscosVersion { + +class CurrentVersion { +public: + static WORD major; + static WORD minor; + static IRA::CString station; + static IRA::CString product; + static IRA::CString getVersion(); +}; + +} + + +#endif /* DISCOSVERSION_H_ */ diff --git a/Common/Libraries/DiscosVersion/src/DiscosVersion.cpp b/Common/Libraries/DiscosVersion/src/DiscosVersion.cpp new file mode 100644 index 000000000..1a6aa9077 --- /dev/null +++ b/Common/Libraries/DiscosVersion/src/DiscosVersion.cpp @@ -0,0 +1,19 @@ +#include "DiscosVersion.h" + +using namespace DiscosVersion; + + +IRA::CString CurrentVersion::getVersion() +{ + IRA::CString value; + value.Format("%s-%d.%d.%s",(const char *)CurrentVersion::product,CurrentVersion::major,CurrentVersion::minor,(const char *)CurrentVersion::station); + return value; +} + +IRA::CString CurrentVersion::product = IRA::CString(_CURRENT_PRODUCT); +IRA::CString CurrentVersion::station = IRA::CString(_STATION); +WORD CurrentVersion::minor = _CURRENT_VERSION_MINOR; +WORD CurrentVersion::major = _CURRENT_VERSION_MAJOR; + + + diff --git a/Common/Libraries/DiscosVersion/src/Makefile b/Common/Libraries/DiscosVersion/src/Makefile new file mode 100644 index 000000000..2dd4709e6 --- /dev/null +++ b/Common/Libraries/DiscosVersion/src/Makefile @@ -0,0 +1,221 @@ +#******************************************************************************* +# PPPPPPPP +# +# "@(#) $Id$" +# +# Makefile of ........ +# +# who when what +# -------- -------- ---------------------------------------------- +# andrea 25/05/17 created +# + +#******************************************************************************* +# This Makefile follows VLT Standards (see Makefile(5) for more). +#******************************************************************************* +# REMARKS +# None +#------------------------------------------------------------------------ + +# +# user definable C-compilation flags +# this is deprecated, TARGETSYS will now be transformed into STATION in 64 bit version.....and legal values will be SRT, Medicina, Noto +ifeq ($(TARGETSYS),MED) + USER_CFLAGS = -U 'COMPILE_TARGET_SRT' -U 'COMPILE_TARGET_NT' -D 'COMPILE_TARGET_MED' +else ifeq ($(TARGETSYS),NT) + USER_CFLAGS = -U 'COMPILE_TARGET_SRT' -U 'COMPILE_TARGET_MED' -D 'COMPILE_TARGET_NT' +else + USER_CFLAGS = -U 'COMPILE_TARGET_MED' -U 'COMPILE_TARGET_NT' -D 'COMPILE_TARGET_SRT' +endif + + +# +# user definable C-compilation flags +#USER_CFLAGS = + +# +# additional include and library search paths +#USER_INC = +#USER_LIB = + +# +# MODULE CODE DESCRIPTION: +# ------------------------ +# As a general rule: public file are "cleaned" and "installed" +# local (_L) are not "installed". + +# +# C programs (public and local) +# ----------------------------- +EXECUTABLES = +EXECUTABLES_L = + +# +# <brief description of xxxxx program> +xxxxx_OBJECTS = +xxxxx_LDFLAGS = +xxxxx_LIBS = + +# +# special compilation flags for single c sources +#yyyyy_CFLAGS = + +# +# Includes (.h) files (public only) +# --------------------------------- +INCLUDES = DiscosVersion.h + +# +# Libraries (public and local) +# ---------------------------- +LIBRARIES = DiscosVersion +LIBRARIES_L = + +# +# <brief description of lllll library> +DiscosVersion_OBJECTS = DiscosVersion +DiscosVersion_LIBS = IRALibrary + + +# +# Scripts (public and local) +# ---------------------------- +SCRIPTS = +SCRIPTS_L = + +# +# TCL scripts (public and local) +# ------------------------------ +TCL_SCRIPTS = +TCL_SCRIPTS_L = + +# +# Python stuff (public and local) +# ---------------------------- +PY_SCRIPTS = +PY_SCRIPTS_L = + +PY_MODULES = +PY_MODULES_L = + +PY_PACKAGES = +PY_PACKAGES_L = +pppppp_MODULES = + +# +# <brief description of tttttt tcl-script> +tttttt_OBJECTS = +tttttt_TCLSH = +tttttt_LIBS = + +# +# TCL libraries (public and local) +# ------------------------------ +TCL_LIBRARIES = +TCL_LIBRARIES_L = + +# +# <brief description of tttlll library> +tttlll_OBJECTS = + +# +# Configuration Database Files +# ---------------------------- +CDB_SCHEMAS = + +# +# IDL Files and flags +# +IDL_FILES = +TAO_IDLFLAGS = +USER_IDL = +# +# Jarfiles and their directories +# +JARFILES= +jjj_DIRS= +jjj_EXTRAS= +# +# java sources in Jarfile on/off +DEBUG= +# +# ACS XmlIdl generation on/off +# +XML_IDL= +# +# Java Component Helper Classes generation on/off +# +COMPONENT_HELPERS= +# +# Java Entity Classes generation on/off +# +XSDBIND= +# +# Schema Config files for the above +# +XSDBIND_INCLUDE= +# man pages to be done +# -------------------- +MANSECTIONS = +MAN1 = +MAN3 = +MAN5 = +MAN7 = +MAN8 = + +# +# local man pages +# --------------- +MANl = + +# +# ASCII file to be converted into Framemaker-MIF +# -------------------- +ASCII_TO_MIF = + +# +# other files to be installed +#---------------------------- +INSTALL_FILES = + +# +# list of all possible C-sources (used to create automatic dependencies) +# ------------------------------ +CSOURCENAMES = \ + $(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \ + $(foreach rtos, $(RTAI_MODULES) , $($(rtos)_OBJECTS)) \ + $(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS)) + +# +#>>>>> END OF standard rules + +# +# INCLUDE STANDARDS +# ----------------- + +MAKEDIRTMP := $(shell searchFile include/acsMakefile) +ifneq ($(MAKEDIRTMP),\#error\#) + MAKEDIR := $(MAKEDIRTMP)/include + include $(MAKEDIR)/acsMakefile +endif + +# +# TARGETS +# ------- +all: do_all + @echo " . . . 'all' done" + +clean : clean_all + @echo " . . . clean done" + +clean_dist : clean_all clean_dist_all + @echo " . . . clean_dist done" + +man : do_man + @echo " . . . man page(s) done" + +install : install_all + @echo " . . . installation done" + + +#___oOo___ diff --git a/Common/Servers/CustomLogger/include/CustomLoggerImpl.h b/Common/Servers/CustomLogger/include/CustomLoggerImpl.h index e63d571c1..d124f728f 100644 --- a/Common/Servers/CustomLogger/include/CustomLoggerImpl.h +++ b/Common/Servers/CustomLogger/include/CustomLoggerImpl.h @@ -87,6 +87,8 @@ class CustomLoggerImpl: public virtual baci::CharacteristicComponentImpl, virtual void setLogfile(const char *base_path, const char *filename) throw (CORBA::SystemException, ManagementErrors::CustomLoggerIOErrorEx); + virtual void setDefaultLogfile() + throw (CORBA::SystemException, ManagementErrors::CustomLoggerIOErrorEx); virtual void closeLogfile() throw (CORBA::SystemException, ManagementErrors::CustomLoggerIOErrorEx); virtual void emitACSLog(const char *msg) throw (CORBA::SystemException); virtual void emitLog(const char *msg, LogLevel level) throw (CORBA::SystemException); @@ -97,6 +99,10 @@ class CustomLoggerImpl: public virtual baci::CharacteristicComponentImpl, void writeLoggingQueue(bool age_check=true); //invoked by writer thread void handle_xml_error(); private: + /** + * strings for storing deafult values from CDB + */ + IRA::CString _custom_log_path, _custom_log_file, _acs_log_path, _acs_log_file; void _open_log_file(bool custom, const char* base_path, const char* filename) throw (CORBA::SystemException, ManagementErrors::CustomLoggerIOErrorEx); void _close_log_file(bool custom) throw (CORBA::SystemException, ManagementErrors::CustomLoggerIOErrorEx); diff --git a/Common/Servers/CustomLogger/src/CustomLoggerImpl.cpp b/Common/Servers/CustomLogger/src/CustomLoggerImpl.cpp index 1b7595fec..9aef735f4 100644 --- a/Common/Servers/CustomLogger/src/CustomLoggerImpl.cpp +++ b/Common/Servers/CustomLogger/src/CustomLoggerImpl.cpp @@ -192,17 +192,17 @@ CustomLoggerImpl::initialize() throw (ACSErr::ACSbaseExImpl) /* OPEN DEFAULT LOG FILES AND BEGINS LOGGING ============================================*/ - IRA::CString _c_path, _c_file, _a_path, _a_file; + //IRA::CString _c_path, _c_file, _a_path, _a_file; if( - IRA::CIRATools::getDBValue(getContainerServices(), "DefaultACSLogDir", _a_path) && - IRA::CIRATools::getDBValue(getContainerServices(), "DefaultACSLogFile", _a_file) && - IRA::CIRATools::getDBValue(getContainerServices(), "DefaultCustomLogDir", _c_path) && - IRA::CIRATools::getDBValue(getContainerServices(), "DefaultCustomLogFile", _c_file) + IRA::CIRATools::getDBValue(getContainerServices(), "DefaultACSLogDir", _acs_log_path) && + IRA::CIRATools::getDBValue(getContainerServices(), "DefaultACSLogFile", _acs_log_file) && + IRA::CIRATools::getDBValue(getContainerServices(), "DefaultCustomLogDir", _custom_log_path) && + IRA::CIRATools::getDBValue(getContainerServices(), "DefaultCustomLogFile", _custom_log_file) ){ - _open_log_file(false, (const char *)_a_path, (const char *)_a_file); - ACS_SHORT_LOG((LM_DEBUG, "open default full log file - %s/%s", (const char *)_a_path, (const char *)_a_file)); - setLogfile((const char *)_c_path, (const char *)_c_file); - ACS_SHORT_LOG((LM_DEBUG, "open default custom log file - %s/%s", (const char *)_c_path, (const char *)_c_file)); + _open_log_file(false, (const char *)_acs_log_path, (const char *)_acs_log_file); + ACS_SHORT_LOG((LM_DEBUG, "open default full log file - %s/%s", (const char *)_acs_log_path, (const char *)_acs_log_file)); + setLogfile((const char *)_custom_log_path, (const char *)_custom_log_file); + ACS_SHORT_LOG((LM_DEBUG, "open default custom log file - %s/%s", (const char *)_custom_log_path, (const char *)_custom_log_file)); }else{ _EXCPT(ComponentErrors::CDBAccessExImpl, __dummy, "CustomLoggerImpl::initialize"); CUSTOM_EXCPT_LOG(__dummy, LM_DEBUG); @@ -415,6 +415,27 @@ CustomLoggerImpl::setLogfile(const char *base_path, ACS_SHORT_LOG((LM_DEBUG, "CutomLoggerImpl : logging")); }; +/* + * Close the currently open log files if exist and tries to open the default one. + * @throw ManagementErrors::CustomLoggerIOErrorEx: if cannot create directory or open the files + */ +void +CustomLoggerImpl::setDefaultLogfile() + throw (CORBA::SystemException, ManagementErrors::CustomLoggerIOErrorEx) +{ + //Acquire log mutex + baci::ThreadSyncGuard guard(&_log_queue_mutex); + //Writing last message on last opened log files + //if not logging does nothing + handle(get_log_record((std::string("Custom log dir changing to default")).c_str(), C_NOTICE)); + handle(get_log_record((std::string("Custom log file changing to default")).c_str(), C_NOTICE)); + closeLogfile(); + //_custom_log.clear(); + _open_log_file(true, (const char *)_custom_log_path, (const char *)_custom_log_file); //throws + setLogging(true); + ACS_SHORT_LOG((LM_DEBUG, "CutomLoggerImpl : logging")); +}; + bool CustomLoggerImpl::filter(LogRecord& log_record) { diff --git a/Common/Servers/FitsWriter/include/DataCollection.h b/Common/Servers/FitsWriter/include/DataCollection.h index 71c3af57c..dd1a2aaa3 100644 --- a/Common/Servers/FitsWriter/include/DataCollection.h +++ b/Common/Servers/FitsWriter/include/DataCollection.h @@ -295,12 +295,22 @@ public: * Get the name of the observer */ const IRA::CString& getObserverName() const { return m_observer; } + + /** + * Get the name of the backend currently in use + */ + const IRA::CString& getBackendName() const { return m_backendName; } /** * Get the name of the schedule file */ const IRA::CString& getScheduleName() const { return m_scheduleName; } + /** + * Get the name of the log file + */ + const IRA::CString& getLogName() const { return m_logName; } + /** * Get the identifier of the current scan */ @@ -527,6 +537,7 @@ private: IRA::CString m_fullPath; IRA::CString m_project; IRA::CString m_observer; + IRA::CString m_backendName; /** the data block coming from the antenna */ //Antenna::AntennaDataBlock m_antennaData; /** the data block coming from the antenna the previous one */ @@ -589,6 +600,11 @@ private: * Stores the name of the schedule file, currently running */ IRA::CString m_scheduleName; + + /** + * Stores the name of the log file, currenlty running + */ + IRA::CString m_logName; /** * Scan tag */ diff --git a/Common/Servers/FitsWriter/include/MetaData.h b/Common/Servers/FitsWriter/include/MetaData.h index f55b85b25..e3666a40f 100644 --- a/Common/Servers/FitsWriter/include/MetaData.h +++ b/Common/Servers/FitsWriter/include/MetaData.h @@ -126,7 +126,13 @@ public: m_sectionsID=sectionID; m_localOscillator=los; } - + + void setCalDiode(const bool& onoff) { + m_calDiode=onoff; + }; + + IRA::CString subScanSignal(); + void setInputsTable() { m_receiverPolarization.length(0); @@ -254,7 +260,7 @@ private: */ ACS::doubleSeq m_localOscillator; /** - * Stores the identifier od the baclend section (one for each input) + * Stores the identifier of the backend section (one for each input) */ ACS::longSeq m_sectionsID; /** @@ -318,6 +324,10 @@ private: * Sub scan configuration */ Management::TSubScanConfiguration m_subScanConf; + /** + * It reports if the calibration diode has been fired on subscan basis + */ + bool m_calDiode; }; }; diff --git a/Common/Servers/FitsWriter/include/SummarySchema.h b/Common/Servers/FitsWriter/include/SummarySchema.h index 4e2d99c4f..cd1142e67 100644 --- a/Common/Servers/FitsWriter/include/SummarySchema.h +++ b/Common/Servers/FitsWriter/include/SummarySchema.h @@ -22,7 +22,7 @@ #define SCHEMA_HEADER_ENTRY7 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"EQUINOX","Equinox of RA, Dec" ) #define SCHEMA_HEADER_ENTRY8 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"EXPTIME","Total integration time (seconds)" ) #define SCHEMA_HEADER_ENTRY9 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"PROJID","ProjectID" ) -#define SCHEMA_HEADER_ENTRY10 ( 0, _FILE_LONG_TYPE,_FILE_SINGLE_ENTRY,"LST","Local sidereal time" ) +#define SCHEMA_HEADER_ENTRY10 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"LST","Local sidereal time" ) #define SCHEMA_HEADER_ENTRY11 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"SCANTYPE","Scan astronomical type" ) #define SCHEMA_HEADER_ENTRY12 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"SCANMODE","Mapping mode" ) #define SCHEMA_HEADER_ENTRY13 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"SCANGEOM","Scan geometry" ) diff --git a/Common/Servers/FitsWriter/include/Version.h b/Common/Servers/FitsWriter/include/Version.h index 1ed5c983e..6e02498dd 100644 --- a/Common/Servers/FitsWriter/include/Version.h +++ b/Common/Servers/FitsWriter/include/Version.h @@ -20,6 +20,7 @@ #define FITS_VERSION8 "V.1.1" #define FITS_VERSION9 "V.1.11" #define FITS_VERSION10 "V.1.12" +#define FITS_VERSION11 "V.1.2" #define CURRENT_VERSION FITS_VERSION10 @@ -33,8 +34,8 @@ #define HISTORY6 FITS_VERSION6" Added new table to store position of subriflector e primary focus receivers: SERVO TABLE" #define HISTORY7 FITS_VERSION7" New keywords in FEED TABLE header to describe derotator configuration" #define HISTORY8 FITS_VERSION8" Summary.fits file included in order to describe the scan configuration" -#define HISTORY9 FITS_VERSION9" added the keyword SIGNAL in main header of each sub scan fits" -#define HISTORY10 FITS_VERSION10" frequency and bandwidth columns added to Section table reporting backend sampled band" - +#define HISTORY9 FITS_VERSION9" Added the keyword SIGNAL in main header of each sub scan fits" +#define HISTORY10 FITS_VERSION10" Summary.fits has now a number of meaningful keywords" +#define HISTORY11 FITS_VERSION11" Frequency and bandwidth columns added to Section table reporting backend sampled band" #endif /* VERSION_H_ */ diff --git a/Common/Servers/FitsWriter/src/DataCollection.cpp b/Common/Servers/FitsWriter/src/DataCollection.cpp index 40cddc4f4..42364075f 100644 --- a/Common/Servers/FitsWriter/src/DataCollection.cpp +++ b/Common/Servers/FitsWriter/src/DataCollection.cpp @@ -23,7 +23,9 @@ CDataCollection::CDataCollection() m_fileName=m_fullPath=""; m_project=""; m_observer=""; + m_backendName=""; m_scheduleName=""; + m_logName=""; m_status=Management::MNG_OK; m_siteName=""; m_pressure=m_temperature=m_humidity=0.0; @@ -358,7 +360,9 @@ bool CDataCollection::setScanSetup(const Management::TScanSetup& setup,bool& rec m_deviceID=setup.device; m_scanID=setup.scanId; m_observer=setup.observerName; + m_backendName=setup.backendName; m_scheduleName=setup.schedule; + m_logName=setup.log; basePath=setup.path; extraPath=setup.extraPath; baseName=setup.baseName; diff --git a/Common/Servers/FitsWriter/src/EngineThread.cpp b/Common/Servers/FitsWriter/src/EngineThread.cpp index e9efbdd5a..39e688439 100644 --- a/Common/Servers/FitsWriter/src/EngineThread.cpp +++ b/Common/Servers/FitsWriter/src/EngineThread.cpp @@ -10,6 +10,7 @@ #include <ManagementModule.h> #include <AntennaModule.h> #include "CommonTools.h" +#include <DiscosVersion.h> using namespace IRA; using namespace FitsWriter_private; @@ -392,8 +393,6 @@ bool CEngineThread::processData() } } //end for } - - #ifndef FW_DEBUG m_file->add_row(); #endif @@ -405,16 +404,37 @@ void CEngineThread::runLoop() { TIMEVALUE nowEpoch; IRA::CString filePath,fileName; + unsigned totalDumps=0; //CSecAreaResourceWrapper<CDataCollection> data=m_dataWrapper->Get(); IRA::CIRATools::getTime(nowEpoch); // it marks the start of the activity job //cout << "inizio : " << nowEpoch.value().value << endl; if (m_summaryOpened && m_data->isWriteSummary()) { + double exptime=0.0; std::list<double> va; ACS::doubleSeq rf; m_info.getRestFreq(rf); va.clear(); CCommonTools::map(rf,va); m_summary->getFilePointer()->setKeyword("RESTFREQ",va); + if (m_data->getBackendName()!="") { + m_summary->getFilePointer()->setKeyword("BackendName",m_data->getBackendName()); + } + if (m_data->getProjectName()!="") { + m_summary->getFilePointer()->setKeyword("PROJID",m_data->getProjectName()); + } + if (m_data->getObserverName()!="") { + m_summary->getFilePointer()->setKeyword("OBSID",m_data->getObserverName()); + } + m_summary->getFilePointer()->setKeyword("CREATOR",DiscosVersion::CurrentVersion::getVersion()); + m_summary->getFilePointer()->setKeyword("TELESCOP",DiscosVersion::CurrentVersion::station); + m_summary->getFilePointer()->setKeyword("NUSEBANDS",m_data->getSectionsNumber()); + m_summary->getFilePointer()->setKeyword("ScheduleName",m_data->getScheduleName()); + m_summary->getFilePointer()->setKeyword("LogFileName",m_data->getLogName()); + + exptime=(totalDumps*m_data->getIntegrationTime())/1000.0; + m_summary->getFilePointer()->setKeyword("EXPTIME",exptime); + + if ((!m_summary->write()) || (!m_summary->close())) { _EXCPT(ManagementErrors::FitsCreationErrorExImpl,impl,"CEngineThread::runLoop()"); impl.setFileName((const char *)m_data->getSummaryFileName()); @@ -495,8 +515,8 @@ void CEngineThread::runLoop() m_summary->getFilePointer()->setKeyword("LST",lstStr); IRA::CIRATools::timeToStrExtended(currentUT.value().value,lstStr); m_summary->getFilePointer()->setKeyword("DATE-OBS",lstStr); - m_summaryOpened=true; + totalDumps=0; ACS_LOG(LM_FULL_INFO, "CEngineThread::runLoop()",(LM_NOTICE,"SUMMARY_OPENED")); } m_file = new CFitsWriter(); @@ -536,10 +556,6 @@ void CEngineThread::runLoop() //get the data from the minor servo boss...if subsystem is enabled collectMinorServoData(); - //***************************************************************************************** - ACS_LOG(LM_FULL_INFO,"CEngineThread::runLoop()",(LM_NOTICE,"DATA_COLLECTION_COMPLETED")); - //************************* ADDDED FOR DEBUGGING NoData/Roach Could be deleted **************** - // now creates the file, the tables and the headers Backends::TMainHeader mH=m_data->getMainHeader(); Backends::TSectionHeader const *cH=m_data->getSectionHeader(); @@ -757,7 +773,7 @@ void CEngineThread::runLoop() impl.log(LM_ERROR); // not filtered, because the user need to know about the problem immediately m_data->setStatus(Management::MNG_FAILURE); } - else if(!m_file->setPrimaryHeaderKey("Signal",(const char *)Management::Definitions::map(m_info.getSubScanConf().signal),"Flag for position switching phase")) { + else if(!m_file->setPrimaryHeaderKey("Signal",(const char *)m_info.subScanSignal(),"Flag for position switching phase")) { _EXCPT(ManagementErrors::FitsCreationErrorExImpl,impl,"CEngineThread::runLoop()"); impl.setFileName((const char *)m_data->getFileName()); impl.setError(m_file->getLastError()); @@ -859,7 +875,9 @@ void CEngineThread::runLoop() //save all the data in the buffer an then finalize the file if (m_fileOpened) { //cout << "Stopping, cached dumps: " << m_data->getDumpCollectionSize() << endl; - while (processData()); + while (processData()) { + totalDumps++; + }; #ifdef FW_DEBUG m_file.close(); @@ -891,7 +909,9 @@ void CEngineThread::runLoop() // there is still time available....... if (m_fileOpened) { //cout << "cached before dumps: " << m_data->getDumpCollectionSize() << endl; - while (checkTime(nowEpoch.value().value) && checkTimeSlot(nowEpoch.value().value) && processData()); + while (checkTime(nowEpoch.value().value) && checkTimeSlot(nowEpoch.value().value) && processData()) { + totalDumps++; + } //cout << "cached after dumps: " << m_data->getDumpCollectionSize() << endl; //IRA::CIRATools::getTime(nowEpoch); //cout << "fine :" << nowEpoch.value().value << endl; @@ -1312,10 +1332,12 @@ void CEngineThread::collectReceiversData(FitsWriter_private::CFile* summaryFile) ACS::doubleSeq_var IFFreq; ACS::doubleSeq_var IFBw; double scale; + bool onoff; m_data->getInputsConfiguration(sectionsID,feeds,ifs,freqs,bws,atts); - calMarks=m_receiversBoss->getCalibrationMark(freqs,bws,feeds,ifs,skyFreq.out(),skyBw.out(),scale); + calMarks=m_receiversBoss->getCalibrationMark(freqs,bws,feeds,ifs,skyFreq.out(),skyBw.out(),onoff,scale); m_receiversBoss->getIFOutput(feeds,ifs,IFFreq.out(),IFBw.out(),rcvPol.out(),LO.out()); m_info.setInputsTable(sectionsID,feeds,ifs,rcvPol.in(),skyFreq.in(),skyBw.in(),LO.in(),atts,calMarks.in()); + m_info.setCalDiode(onoff); } catch (CORBA::SystemException& ex) { _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CEngineThread::collectReceiversData()"); diff --git a/Common/Servers/FitsWriter/src/FitsWriter.cpp b/Common/Servers/FitsWriter/src/FitsWriter.cpp index c3ec13728..cd80c5a2f 100644 --- a/Common/Servers/FitsWriter/src/FitsWriter.cpp +++ b/Common/Servers/FitsWriter/src/FitsWriter.cpp @@ -231,7 +231,8 @@ bool CFitsWriter::create() if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY7,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY8,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY9,m_lastError)) return false; - if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY10,m_lastError)) return false; + if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY10,m_lastError)) return false; + if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY11,m_lastError)) return false; return true; }; diff --git a/Common/Servers/FitsWriter/src/Makefile b/Common/Servers/FitsWriter/src/Makefile index 22765dc65..50afc35d5 100644 --- a/Common/Servers/FitsWriter/src/Makefile +++ b/Common/Servers/FitsWriter/src/Makefile @@ -43,7 +43,7 @@ testWriter_OBJECTS = TestWriter FitsWriter File SummaryWriter FitsTools testWriter_LIBS = IRALibrary testSummary_OBJECTS = TestSummary File SummaryWriter FitsTools -testSummary_LIBS = IRALibrary +testSummary_LIBS = IRALibrary DiscosVersion # Libraries (public and local) @@ -59,10 +59,7 @@ FitsWriterImpl_LIBS = baci maci FitsWriterStubs DataReceiverStubs ComponentError ManagmentDefinitionsStubs ACSBulkDataError bulkDataStubs IRALibrary\ bulkDataCallback AntennaErrors AntennaDefinitionsStubs AntennaBossStubs MinorServoDefinitionsStubs \ EphemGeneratorStubs BackendsDefinitionsStubs ObservatoryStubs MinorServoBossStubs MinorServoErrors\ - GenericWeatherStationStubs ReceiversBossStubs ReceiversDefinitionsStubs CommonReceiverInterfaceStubs SchedulerStubs ManagmentDefinitionsStubs - - - + GenericWeatherStationStubs ReceiversBossStubs ReceiversDefinitionsStubs CommonReceiverInterfaceStubs SchedulerStubs ManagmentDefinitionsStubs DiscosVersion # # Configuration Database Files diff --git a/Common/Servers/FitsWriter/src/MetaData.cpp b/Common/Servers/FitsWriter/src/MetaData.cpp index 8ab194632..189edd856 100644 --- a/Common/Servers/FitsWriter/src/MetaData.cpp +++ b/Common/Servers/FitsWriter/src/MetaData.cpp @@ -1,4 +1,5 @@ #include "MetaData.h" +#include <ManagementModule.h> using namespace FitsWriter_private; @@ -26,6 +27,7 @@ CMetaData::CMetaData() m_restFreq.length(0); m_azOff=m_elOff=m_raOff=m_decOff=m_lonOff=m_latOff=0.0; m_subScanConf.signal=Management::MNG_SIGNAL_NONE; + m_calDiode=false; } CMetaData::~CMetaData() @@ -46,6 +48,17 @@ void CMetaData::saveFeedHeader(CFitsWriter::TFeedHeader * fH,const WORD& number) m_feedNumber=number; } +IRA::CString CMetaData::subScanSignal() { + Management::TSubScanSignal sg=m_subScanConf.signal; + if ((m_subScanConf.signal==Management::MNG_SIGNAL_REFERENCE) && (m_calDiode)) { + sg=Management::MNG_SIGNAL_REFCAL; + } + else if ((m_subScanConf.signal==Management::MNG_SIGNAL_SIGNAL) && (m_calDiode)) { + sg=Management::MNG_SIGNAL_REFSIG; + } + return Management::Definitions::map(sg); +} + /*************** Private ***********************************************************/ diff --git a/Common/Servers/FitsWriter/src/SummaryWriter.cpp b/Common/Servers/FitsWriter/src/SummaryWriter.cpp index 0fa85e0e9..6dd525b44 100644 --- a/Common/Servers/FitsWriter/src/SummaryWriter.cpp +++ b/Common/Servers/FitsWriter/src/SummaryWriter.cpp @@ -58,6 +58,8 @@ bool CSummaryWriter::create() if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY6,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY7,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY8,m_lastError)) return false; + if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY9,m_lastError)) return false; + if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY10,m_lastError)) return false; m_fitsWritten=false; return true; }; diff --git a/Common/Servers/FitsWriter/src/TestSummary.cpp b/Common/Servers/FitsWriter/src/TestSummary.cpp index c689dc7ac..4c6e72400 100644 --- a/Common/Servers/FitsWriter/src/TestSummary.cpp +++ b/Common/Servers/FitsWriter/src/TestSummary.cpp @@ -1,5 +1,6 @@ #include "SummaryWriter.h" #include "File.h" +#include <DiscosVersion.h> using namespace FitsWriter_private; @@ -8,6 +9,11 @@ int main(int argc, char *argv[]) CSummaryWriter sumWriter; sumWriter.setBasePath("./"); sumWriter.setFileName("summary1.fits"); + TIMEVALUE currentUT; + IRA::CDateTime now; + TIMEDIFFERENCE currentLST; + IRA::CString timeStr; + IRA::CSite site; if (!sumWriter.create()) { @@ -21,11 +27,23 @@ int main(int argc, char *argv[]) //restFreq.push_back(90.1); //restFreq.push_back(123.77); - sumWriter.getFile().setKeyword("TELESCOP","MED"); //string single + // time + IRA::CIRATools::getTime(currentUT); // get the current time + now.setDateTime(currentUT,0.0); // transform the current time in a CDateTime object + now.LST(site).getDateTime(currentLST); // get the current LST time + currentLST.day(0); + IRA::CIRATools::intervalToStr(currentLST.value().value,timeStr); + sumWriter.getFile().setKeyword("LST",timeStr); + IRA::CIRATools::timeToStrExtended(currentUT.value().value,timeStr); + sumWriter.getFile().setKeyword("DATE-OBS",timeStr); + + sumWriter.getFile().setKeyword("TELESCOP",DiscosVersion::CurrentVersion::station); //string single + sumWriter.getFile().setKeyword("CREATOR",DiscosVersion::CurrentVersion::getVersion()); //string single sumWriter.getFile().setKeyword("EXPTIME",10.34); //double single sumWriter.getFile().setKeyword("NUSEBANDS",10L); //long single sumWriter.getFile().setKeyword("RESTFREQ",restFreq); //double multi sumWriter.getFile().setKeyword("TOPOFREQ",restFreq); //double multi + sumWriter.getFile().setKeyword("BackendName","TP"); //string single // //sumWriter.getFile().setKeyword("test",2341.2213); //double single, table header keyword diff --git a/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h b/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h index 773ff6888..4d62b90b8 100644 --- a/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h +++ b/Common/Servers/ReceiversBoss/include/ReceiversBossImpl.h @@ -173,11 +173,12 @@ public: * @param ifs for each subband this indicates the proper IF, given the feed * @param skyFreq for each subband this indicates the corresponding frequency observed (MHz). * @param skyBw for each subband this indicates the resulting bandwidth (MHz) + * @param onoff reports the status of the cal noise diode. true if it is turned on. * @param slaceFactor scaling value to be used when computing system temperature * @return the list of the noise calibration value in Kelvin degrees. */ virtual ACS::doubleSeq * getCalibrationMark (const ACS::doubleSeq& freqs, const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, - ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); + ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Boolean_out onoff,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); /** * this method is called to get the all the receiver output information in one call. An output is identified by providing the feed and the IF identifier. It can process any number of requests at a time. diff --git a/Common/Servers/ReceiversBoss/include/RecvBossCore.h b/Common/Servers/ReceiversBoss/include/RecvBossCore.h index cbd55e335..5cf1408c2 100644 --- a/Common/Servers/ReceiversBoss/include/RecvBossCore.h +++ b/Common/Servers/ReceiversBoss/include/RecvBossCore.h @@ -261,7 +261,7 @@ public: ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl,ComponentErrors::UnexpectedExImpl); void getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq&resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds, - const ACS::longSeq& ifs,double& scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl, + const ACS::longSeq& ifs,bool& onoff,double& scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl, ReceiversErrors::UnavailableReceiverOperationExImpl,ComponentErrors::UnexpectedExImpl); void getIFOutput(const ACS::longSeq& feeds,const ACS::longSeq& ifs,ACS::doubleSeq& freqs,ACS::doubleSeq& bw,ACS::longSeq& pols,ACS::doubleSeq& LO) throw ( @@ -316,6 +316,7 @@ private: IRA::CSocket m_fsSocket; bool m_recvOpened; bool m_fsOpened; + bool m_cal; IRA::CDBTable *m_KKCFeedTable; double m_LO[_RECVBOSSCORE_MAX_IFS]; Receivers::TPolarization m_pols[_RECVBOSSCORE_MAX_IFS]; @@ -342,7 +343,8 @@ private: double m_bandWidth[_RECVBOSSCORE_MAX_IFS]; IRA::CString m_currentReceiver; long m_totalOutputs; - Backends::TotalPower_proxy m_totalPower_proxy; + bool m_cal; + Backends::TotalPower_proxy m_totalPower_proxy; #else #warning "Compiling RecvBossCore with default target" diff --git a/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp b/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp index 194a940f7..255469b7b 100644 --- a/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp +++ b/Common/Servers/ReceiversBoss/src/ReceiversBossImpl.cpp @@ -14,9 +14,6 @@ #include "DevIODerotatorPosition.h" #include <ReceiversModule.h> -static char *rcsId="@(#) $Id: ReceiversBossImpl.cpp $"; -static void *use_rcsId = ((void)&use_rcsId,(void *) &rcsId); - using namespace SimpleParser; using namespace baci; @@ -359,13 +356,13 @@ void ReceiversBossImpl::park() throw (CORBA::SystemException,ManagementErrors::P } ACS::doubleSeq *ReceiversBossImpl::getCalibrationMark(const ACS::doubleSeq& freqs, const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds,const ACS::longSeq& ifs, - ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Double_out scaleFactor) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) + ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Boolean_out onoff,CORBA::Double_out scaleFactor) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) { ACS::doubleSeq_var result=new ACS::doubleSeq; ACS::doubleSeq_var resFreq=new ACS::doubleSeq; ACS::doubleSeq_var resBw=new ACS::doubleSeq; try { - m_core->getCalibrationMark(result,resFreq,resBw,freqs,bandwidths,feeds,ifs,scaleFactor); + m_core->getCalibrationMark(result,resFreq,resBw,freqs,bandwidths,feeds,ifs,onoff,scaleFactor); } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); diff --git a/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp b/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp index 3ca41eb1a..3cda6288c 100644 --- a/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp +++ b/Common/Servers/ReceiversBoss/src/RecvBossCore.cpp @@ -1288,7 +1288,7 @@ void CRecvBossCore::getIFOutput(const ACS::longSeq& feeds,const ACS::longSeq& if } void CRecvBossCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths, - const ACS::longSeq& feeds,const ACS::longSeq& ifs,double &scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl, + const ACS::longSeq& feeds,const ACS::longSeq& ifs,bool& onoff,double &scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl, ReceiversErrors::UnavailableReceiverOperationExImpl,ComponentErrors::UnexpectedExImpl) { baci::ThreadSyncGuard guard(&m_mutex); @@ -1303,10 +1303,12 @@ void CRecvBossCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& re ACS::doubleSeq_var tempRes=new ACS::doubleSeq; ACS::doubleSeq_var tempFreq=new ACS::doubleSeq; ACS::doubleSeq_var tempBw=new ACS::doubleSeq; - tempRes=m_currentRecv->getCalibrationMark(freqs,bandwidths,feeds,ifs,tempFreq.out(),tempBw.out(),scale); + CORBA::Boolean onoff_out; + tempRes=m_currentRecv->getCalibrationMark(freqs,bandwidths,feeds,ifs,tempFreq.out(),tempBw.out(),onoff_out,scale); result.length(tempRes->length()); resFreq.length(tempRes->length()); resBw.length(tempRes->length()); + onoff=onoff_out; for (unsigned i=0;i<result.length();i++) { result[i]=tempRes[i]; resFreq[i]=tempFreq[i]; diff --git a/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i b/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i index 580ef9ce4..7859c3099 100644 --- a/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i +++ b/Common/Servers/ReceiversBoss/src/RecvBossCore_mc.i @@ -155,6 +155,7 @@ void CRecvBossCore::calOn() throw (ComponentErrors::ValidationErrorExImpl,Compon m_status=Management::MNG_WARNING; throw impl; } + m_cal=true; ACS_LOG(LM_FULL_INFO,"CRecvBossCore::calOn()",(LM_NOTICE,"NOISE_CAL_TURNED_ON")); } @@ -214,6 +215,7 @@ void CRecvBossCore::calOff() throw (ComponentErrors::ValidationErrorExImpl,Compo m_status=Management::MNG_WARNING; throw impl; } + m_cal=false; ACS_LOG(LM_FULL_INFO,"CRecvBossCore::calOff()",(LM_NOTICE,"NOISE_CAL_TURNED_OFF")); } @@ -614,6 +616,7 @@ void CRecvBossCore::setup(const char * code) throw (ComponentErrors::SocketError throw impl; } m_status=Management::MNG_OK; + m_cal=false; ACS_LOG(LM_FULL_INFO,"CRecvBossCore::setup()",(LM_NOTICE,"NEW_RECEIVER_CONFIGURED %s",(const char *)m_currentReceiver)); } @@ -914,7 +917,7 @@ void CRecvBossCore::closeScan(ACS::Time& timeToStop) throw (ReceiversErrors::Dew } void CRecvBossCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds, - const ACS::longSeq& ifs,double& scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, + const ACS::longSeq& ifs,bool& onoff,double& scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, ComponentErrors::UnexpectedExImpl) { baci::ThreadSyncGuard guard(&m_mutex); @@ -944,6 +947,7 @@ void CRecvBossCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& re result.length(stdLen); resFreq.length(stdLen); resBw.length(stdLen); + onoff=m_cal; if (m_currentReceiver=="KKC") { scale=1.0; /*double LeftMarkCoeff[7][4] = { {0.2912,-21.21,506.97,-3955.5}, {0.558,-40.436,961.81,-7472.1}, {0.8963,-63.274,1469.2,-11170.0}, diff --git a/Common/Servers/ReceiversBoss/src/RecvBossCore_nt.i b/Common/Servers/ReceiversBoss/src/RecvBossCore_nt.i index ba1818c29..f3f7b1cbf 100644 --- a/Common/Servers/ReceiversBoss/src/RecvBossCore_nt.i +++ b/Common/Servers/ReceiversBoss/src/RecvBossCore_nt.i @@ -95,6 +95,7 @@ void CRecvBossCore::calOn() throw (ComponentErrors::ValidationErrorExImpl,Compon //try{ m_totalPower_proxy->calOn(); //}catch(...) + m_cal=true; CUSTOM_LOG(LM_FULL_INFO,"CRecvBossCore::calOn()",(LM_NOTICE,"NOISE_CAL_TURNED_ON")); } @@ -106,6 +107,7 @@ void CRecvBossCore::calOff() throw (ComponentErrors::ValidationErrorExImpl,Compo //try{ m_totalPower_proxy->calOff(); //}catch(...) + m_cal=false; CUSTOM_LOG(LM_FULL_INFO,"CRecvBossCore::calOn()",(LM_NOTICE,"NOISE_CAL_TURNED_OFF")); } @@ -255,6 +257,7 @@ void CRecvBossCore::setup(const char * code) throw (ComponentErrors::SocketError /*m_fsSocket.Close(err); m_fsOpened=false;*/ m_status=Management::MNG_OK; + m_cal=false; ACS_LOG(LM_FULL_INFO,"CRecvBossCore::setup()",(LM_NOTICE,"NEW_RECEIVER_CONFIGURED %s",(const char *)m_currentReceiver)); } @@ -427,7 +430,7 @@ void CRecvBossCore::CRecvBossCore::startScan(ACS::Time& startUT,const Receivers: } void CRecvBossCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds, - const ACS::longSeq& ifs,double& scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, + const ACS::longSeq& ifs,bool& onoff,double& scale) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::UnavailableReceiverOperationExImpl, ComponentErrors::UnexpectedExImpl) { baci::ThreadSyncGuard guard(&m_mutex); @@ -459,6 +462,7 @@ void CRecvBossCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& re result.length(stdLen); resFreq.length(stdLen); resBw.length(stdLen); + onoff=m_cal; if (m_currentReceiver==BANDAK) { LeftMarkCoeff[0][0]=0.000001; LeftMarkCoeff[0][1]=0.823680; LeftMarkCoeff[0][2]=1825.749665; LeftMarkCoeff[0][3]=-13489491.21593; RightMarkCoeff[0][0]=0.000001; RightMarkCoeff[0][1]=-0.066772; RightMarkCoeff[0][2]=1472.736500; RightMarkCoeff[0][3]=-10827302.569501; diff --git a/Common/Servers/Scheduler/include/Configuration.h b/Common/Servers/Scheduler/include/Configuration.h index 2720f48d7..700764f2a 100644 --- a/Common/Servers/Scheduler/include/Configuration.h +++ b/Common/Servers/Scheduler/include/Configuration.h @@ -123,6 +123,12 @@ public: * @return the path to the directory where to store the data files. */ const IRA::CString& getDataDirectory() const; + + /** + * @return the alias of the currently selected backend. If a backend is not selected an empty string is returned. + */ + const IRA::CString getBackendAlias() const; + /** * @return the path to the directory where to store the system data file or auxiliary data or files not coming from a schedule */ diff --git a/Common/Servers/Scheduler/include/Core_Basic.h b/Common/Servers/Scheduler/include/Core_Basic.h index 689cd8b49..92ab5ba73 100644 --- a/Common/Servers/Scheduler/include/Core_Basic.h +++ b/Common/Servers/Scheduler/include/Core_Basic.h @@ -56,6 +56,7 @@ static void configureBackend(Backends::GenericBackend_ptr backend,bool& backendE * @param path path to the file that has to be created * @param extraPath indicates the extra folder that has to be created (from basePath) in order to contain the file * @param schedule name of the schedule file + * @param log name os the current log file * @param targetID identifier of the target of the subscan * @param layoutName name of the layout configuration * @param layout layout of the scan @@ -65,12 +66,13 @@ static void configureBackend(Backends::GenericBackend_ptr backend,bool& backendE * @param config pointer to the configuration object * @param fullSubscanfileName name of the file that will save the current subscan * @param fullScanfolder name of the folder containing the data related to current scan + * @param backendName name or alias name of the backend currently configured */ static void setupDataTransfer(bool& scanStarted,Management::DataReceiver_ptr writer,bool& writerError,Backends::GenericBackend_ptr backend,bool& backendError, - const bool& streamPrepared,const IRA::CString& obsName,const IRA::CString& prj,const IRA::CString& baseName,const IRA::CString& path,const IRA::CString& extraPath,const IRA::CString& schedule,const IRA::CString& targetID, + const bool& streamPrepared,const IRA::CString& obsName,const IRA::CString& prj,const IRA::CString& baseName,const IRA::CString& path,const IRA::CString& extraPath,const IRA::CString& schedule,const IRA::CString& log,const IRA::CString& targetID, const IRA::CString& layoutName,const ACS::stringSeq& layout,const long& scanTag,const long& device,const DWORD& scanID,const ACS::Time& startTime,const DWORD& subScanID, const Management::TScanAxis& axis,const CConfiguration* config,IRA::CString &fullSubscanFileName, - IRA::CString &fullScanFolder) throw (ComponentErrors::OperationErrorExImpl, + IRA::CString &fullScanFolder,const IRA::CString &backendName) throw (ComponentErrors::OperationErrorExImpl, ComponentErrors::CORBAProblemExImpl,ComponentErrors::ComponentNotActiveExImpl,ComponentErrors::UnexpectedExImpl, ManagementErrors::DataTransferSetupErrorExImpl,ManagementErrors::BackendNotAvailableExImpl); @@ -125,6 +127,14 @@ static void startDataTansfer(Backends::GenericBackend_ptr backend,bool& backendE */ static ACS::Time getUTFromLST(const IRA::CDateTime& currentUT,const IRA::CDateTime& checkUT,const ACS::TimeInterval& lst,const IRA::CSite& site,const double& dut1); +/** + * Return the current file name cointaing the log information. The returned string is basename plus extension (no path included) + * @param logger reference to the logger component + * @param loggerError will be returned back true if an error occurred in the communication to logger component + * @return the nema eof the current log file + */ +static IRA::CString getCurrentLogFile(Management::CustomLogger_ptr logger,bool& loggerError); + /** * Computes the name of the output file, including the lst time * @param ut universal time diff --git a/Common/Servers/Scheduler/include/Core_Common.h b/Common/Servers/Scheduler/include/Core_Common.h index 01e5278b8..1e8554cbe 100644 --- a/Common/Servers/Scheduler/include/Core_Common.h +++ b/Common/Servers/Scheduler/include/Core_Common.h @@ -59,7 +59,7 @@ void doScan(ACS::Time& ut,const Antenna::TTrackingParameters* const prim,const A * @return the time tag at which the recording effectively took place. */ ACS::Time startRecording(const ACS::Time& recUt,const long& scanId, const long& subScanId, const long& scanTag,const IRA::CString& basePath, - const IRA::CString& suffix,const IRA::CString observerName, const IRA::CString& projectName, const IRA::CString& scheduleFileName, + const IRA::CString& suffix,const IRA::CString observerName, const IRA::CString& projectName, const IRA::CString& scheduleFileName,const IRA::CString& logFileName, const IRA::CString& layout, const ACS::stringSeq& layoutProc,IRA::CString &fullSubscanFileName, IRA::CString &fullScanFolder) throw (ComponentErrors::OperationErrorExImpl,ComponentErrors::CORBAProblemExImpl, ComponentErrors::UnexpectedExImpl,ManagementErrors::BackendNotAvailableExImpl, ManagementErrors::DataTransferSetupErrorExImpl, @@ -91,6 +91,11 @@ void startScan(ACS::Time& time,const Antenna::TTrackingParameters *const prim,co void logFile(const IRA::CString& path,const IRA::CString& fileName) throw (ComponentErrors::CouldntGetComponentExImpl, ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl); +/* + * This restores the default log file + */ +void defaultlogFile() throw (ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl); + /* * Sends the Antenna off source for a given number of beams sizes. It calls the corresponding method of the antenna subsystem * @param frame reference frame diff --git a/Common/Servers/Scheduler/include/Core_Resource.h b/Common/Servers/Scheduler/include/Core_Resource.h index 4053120a9..2e3206cdb 100644 --- a/Common/Servers/Scheduler/include/Core_Resource.h +++ b/Common/Servers/Scheduler/include/Core_Resource.h @@ -29,6 +29,7 @@ m_servoRunTime=new MinorServo::TRunTimeParameters; m_servoRunTime->scanAxis=""; \ m_subScanConf.signal=Management::MNG_SIGNAL_NONE; + #define RESOURCE_EXEC ACS_NEW_SIMPLE_CONSUMER(m_antennaNC,Antenna::AntennaDataBlock,Antenna::ANTENNA_DATA_CHANNEL,antennaNCHandler,static_cast<void*>(this)); \ m_antennaNC->consumerReady(); \ @@ -66,7 +67,7 @@ if (m_parser) { \ delete m_parser; \ } \ - ACS_LOG(LM_FULL_INFO,"CCore::cleanUp()",(LM_INFO,"PARSER_DESTROYED")); \ + ACS_LOG(LM_FULL_INFO,"CCore::cleanUp()",(LM_INFO,"PARSER_DESTROYED")); diff --git a/Common/Servers/Scheduler/include/ScheduleReport.h b/Common/Servers/Scheduler/include/ScheduleReport.h index 235a2254d..80c9dadd1 100644 --- a/Common/Servers/Scheduler/include/ScheduleReport.h +++ b/Common/Servers/Scheduler/include/ScheduleReport.h @@ -46,7 +46,9 @@ public: IRA::CString getReportFileName() const; IRA::CString getBackupFolder() const; IRA::CString getPostFix() const { return m_currentPostfix; } + IRA::CString getSchedule() const; bool isActive() const { return m_active; } + /* * Duplicate paths are excluded */ diff --git a/Common/Servers/Scheduler/src/Configuration.cpp b/Common/Servers/Scheduler/src/Configuration.cpp index a9d76238f..cbd199194 100644 --- a/Common/Servers/Scheduler/src/Configuration.cpp +++ b/Common/Servers/Scheduler/src/Configuration.cpp @@ -64,6 +64,16 @@ const IRA::CString& CConfiguration::getDataDirectory() const } } +const IRA::CString CConfiguration::getBackendAlias() const +{ + if ((m_currentBackendIndex>-1) && (m_currentBackendIndex<MAX_BCK_NUMBER)) { + return m_backend[m_currentBackendIndex].alias; + } + else { + return ""; + } +} + void CConfiguration::readProcedures(maci::ContainerServices *services, const IRA::CString& procedureFile, ACS::stringSeq& names, ACS::longSeq& args, ACS::stringSeq *&bodies) throw ( diff --git a/Common/Servers/Scheduler/src/Core.cpp b/Common/Servers/Scheduler/src/Core.cpp index 7a09fe245..e762f5156 100644 --- a/Common/Servers/Scheduler/src/Core.cpp +++ b/Common/Servers/Scheduler/src/Core.cpp @@ -73,6 +73,8 @@ void CCore::execute() throw (ComponentErrors::TimerErrorExImpl,ComponentErrors:: throw Impl; } RESOURCE_EXEC; + loadCustomLogger(m_customLogger,m_customLoggerError); // throw ComponentErrors::CouldntGetComponentExImpl + // spawn schedule executor thread........ try { CCore *tmp=this; diff --git a/Common/Servers/Scheduler/src/Core_Basic.i b/Common/Servers/Scheduler/src/Core_Basic.i index 582c2d03b..8599aab9a 100644 --- a/Common/Servers/Scheduler/src/Core_Basic.i +++ b/Common/Servers/Scheduler/src/Core_Basic.i @@ -77,6 +77,46 @@ ACS::Time CCore::getUTFromLST(const IRA::CDateTime& currentUT,const IRA::CDateTi } } +IRA::CString CCore::getCurrentLogFile(Management::CustomLogger_ptr logger,bool& loggerError) +{ + IRA::CString currentName; + if (CORBA::is_nil(logger)) { + currentName="station.log"; + return currentName; + } + try { //get the current log file name + ACS::ROstring_var filenameRef; + CORBA::String_var fileName; + ACSErr::Completion_var comp; + filenameRef=logger->filename(); + fileName=filenameRef->get_sync(comp.out()); + ACSErr::CompletionImpl compImpl(comp); + if (compImpl.isErrorFree()) { + IRA::CString origFileName((const char *)fileName); + IRA::CString baseDir,baseName,ext; + if (!IRA::CIRATools::extractFileName(origFileName,baseDir,baseName,ext)) { + currentName="station.log"; + ACS_LOG(LM_FULL_INFO,"CCore::getCurrentLogFile()",(LM_WARNING,"Not able to get current log file name, assuming station.log")); + } + else { + currentName=baseName+"."+ext; + ACS_LOG(LM_FULL_INFO,"CCore::execute()",(LM_INFO,"Current log is %s ",(const char *)currentName)); + } + } + else { + ACS_LOG(LM_FULL_INFO,"CCore::execute()",(LM_WARNING,"Not able to get current log file name, assuming station.log")); + currentName="station.log"; + loggerError=true; + } + } + catch (CORBA::SystemException& ex) { + currentName="station.log"; + ACS_LOG(LM_FULL_INFO,"CCore::execute()",(LM_WARNING,"Not able to get current log file name, assuming station.log")); + loggerError=true; + } + return currentName; +} + void CCore::configureBackend(Backends::GenericBackend_ptr backend,bool& backendError,const IRA::CString& name, const std::vector<IRA::CString>& procedure) throw ( ManagementErrors::BackendProcedureErrorExImpl,ComponentErrors::CORBAProblemExImpl,ComponentErrors::UnexpectedExImpl) { @@ -334,6 +374,7 @@ void CCore::setupDataTransfer(bool& scanStarted, const IRA::CString& path, const IRA::CString& extraPath, const IRA::CString& schedule, + const IRA::CString& log, const IRA::CString& targetID, const IRA::CString& layoutName, const ACS::stringSeq& layout, @@ -345,7 +386,8 @@ void CCore::setupDataTransfer(bool& scanStarted, const Management::TScanAxis& axis, const CConfiguration* config, IRA::CString &fullSubscanFileName, - IRA::CString &fullScanFolder + IRA::CString &fullScanFolder, + const IRA::CString &backendName ) throw (ComponentErrors::OperationErrorExImpl,ComponentErrors::CORBAProblemExImpl,ComponentErrors::ComponentNotActiveExImpl, ComponentErrors::UnexpectedExImpl,ManagementErrors::DataTransferSetupErrorExImpl,ManagementErrors::BackendNotAvailableExImpl) { @@ -368,6 +410,8 @@ void CCore::setupDataTransfer(bool& scanStarted, setup.path=CORBA::string_dup((const char *)path); setup.extraPath=CORBA::string_dup((const char *)extraPath); setup.schedule=CORBA::string_dup((const char *)schedule); + setup.schedule=CORBA::string_dup((const char *)log); + setup.backendName=CORBA::string_dup((const char *)backendName); if (layoutName!=_SCHED_NULLTARGET) { setup.scanLayout=CORBA::string_dup((const char *)layoutName); } diff --git a/Common/Servers/Scheduler/src/Core_Common.i b/Common/Servers/Scheduler/src/Core_Common.i index af5e519a2..ad91a3414 100644 --- a/Common/Servers/Scheduler/src/Core_Common.i +++ b/Common/Servers/Scheduler/src/Core_Common.i @@ -335,6 +335,29 @@ void CCore::logFile(const IRA::CString& path,const IRA::CString& fileName) throw } } +void CCore::defaultlogFile() throw (ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl) +{ + baci::ThreadSyncGuard guard(&m_mutex); + loadCustomLogger(m_customLogger,m_customLoggerError); // throw ComponentErrors::CouldntGetComponentExImpl + ACS_LOG(LM_FULL_INFO,"CCore::defaultlogFile()",(LM_NOTICE,"Switched to default log file")); + try { + m_customLogger->flush(); + m_customLogger->setDefaultLogfile(); + } + catch (CORBA::SystemException& ex) { + _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CCore::logFile()"); + impl.setName(ex._name()); + impl.setMinor(ex.minor()); + m_customLoggerError=true; + throw impl; + } + catch (ManagementErrors::ManagementErrorsEx& ex) { + _ADD_BACKTRACE(ManagementErrors::LogFileErrorExImpl,impl,ex,"CCore::logFile()"); + throw impl; + } +} + + void CCore::goOff(const Antenna::TCoordinateFrame& frame,const double& beams) throw (ComponentErrors::CouldntGetComponentExImpl, ComponentErrors::ComponentNotActiveExImpl,ManagementErrors::AntennaScanErrorExImpl,ComponentErrors::CORBAProblemExImpl, ComponentErrors::UnexpectedExImpl) @@ -521,6 +544,7 @@ ACS::Time CCore::startRecording(const ACS::Time& recUt, const IRA::CString observerName, const IRA::CString& projectName, const IRA::CString& scheduleFileName, + const IRA::CString& logFileName, const IRA::CString& layout, const ACS::stringSeq& layoutProc, IRA::CString &fullSubscanFileName, @@ -571,8 +595,8 @@ ACS::Time CCore::startRecording(const ACS::Time& recUt, loadDefaultBackend();// throw (ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::OperationErrorExImpl); loadDefaultDataReceiver(); CCore::setupDataTransfer(m_dataTransferInitialized,m_defaultDataReceiver.in(),m_defaultDataReceiverError,m_defaultBackend.in(),m_defaultBackendError, - m_streamPrepared,observerName,projectName,baseName,path,extraPath,scheduleFileName,targetID,layout,layoutProc,scanTag,getCurrentDevice(),scanId,startUTTime ,subScanId,scanAxis, - m_config,fullSubscanFileName,fullScanFolder); // throws ComponentErrors::OperationErrorExImpl,ComponentErrors::UnexpectedExImpl,ManagementErrors::BackendNotAvailableExImpl,ManagementErrors::DataTransferSetupErrorExImpl + m_streamPrepared,observerName,projectName,baseName,path,extraPath,scheduleFileName,logFileName,targetID,layout,layoutProc,scanTag,getCurrentDevice(),scanId,startUTTime ,subScanId,scanAxis, + m_config,fullSubscanFileName,fullScanFolder,m_config->getBackendAlias()); // throws ComponentErrors::OperationErrorExImpl,ComponentErrors::UnexpectedExImpl,ManagementErrors::BackendNotAvailableExImpl,ManagementErrors::DataTransferSetupErrorExImpl CCore::startDataTansfer(m_defaultBackend.in(),m_defaultBackendError,recUt,m_streamStarted,m_streamPrepared,m_streamConnected); return startUTTime; } diff --git a/Common/Servers/Scheduler/src/Core_Operations.i b/Common/Servers/Scheduler/src/Core_Operations.i index 5ec3b8f2e..2d98af1a0 100644 --- a/Common/Servers/Scheduler/src/Core_Operations.i +++ b/Common/Servers/Scheduler/src/Core_Operations.i @@ -369,7 +369,7 @@ void CCore::_startRecording(const long& subScanId,const ACS::TimeInterval& durat throw dummy; } ACS::Time realStart,waitFor; - IRA::CString prj,path,suffix,obsName,schedule,layoutName; + IRA::CString prj,path,suffix,obsName,schedule,layoutName,log; long scanTag; ACS::stringSeq layout; // throw (ComponentErrors::OperationErrorExImpl,ManagementErrors::BackendNotAvailableExImpl) @@ -383,11 +383,18 @@ void CCore::_startRecording(const long& subScanId,const ACS::TimeInterval& durat _waitOnSource(); }*/ scanTag=0; suffix=""; obsName=IRA::CString("system"); getProjectCode(prj); schedule="none"; + try { // this is aleast importan error so I do not want to block this operation... the case the reference is returned Null is handled by the next call + loadCustomLogger(m_customLogger,m_customLoggerError); // const throw (ComponentErrors::CouldntGetComponentExImpl); + } + catch (...) { + } + log=getCurrentLogFile(m_customLogger,m_customLoggerError); + layout.length(0); layoutName=_SCHED_NULLTARGET; guard.acquire(); m_subScanID=subScanId; realStart=startRecording(m_subScanEpoch,m_scanID,m_subScanID,scanTag,m_config->getSystemDataDirectory(), - suffix,obsName,prj,schedule,layoutName,layout,fullSubscanFileName,fullScanFolder); + suffix,obsName,prj,schedule,log,layoutName,layout,fullSubscanFileName,fullScanFolder); waitFor=realStart+duration; // this is the time at which the stop should be issued guard.release(); //This is to implement a finally clause, if the user abort when the recording has already started I'd like, at least to stop it @@ -901,6 +908,7 @@ void CCore::_callTSys(ACS::doubleSeq& tsys) throw (ComponentErrors::CouldntGetCo ACS::doubleSeq_var mark,tpi,zero,tpiCal; ACS::longSeq_var IFs; double scaleFactor; + bool onoff; long inputs; IRA::CString outLog; IRA::CString backendName; @@ -933,7 +941,7 @@ void CCore::_callTSys(ACS::doubleSeq& tsys) throw (ComponentErrors::CouldntGetCo } // call the receivers boss in order to get the calibration diode values...... try { - mark=m_receiversBoss->getCalibrationMark(freq,bandWidth,feed,IFs,skyFreq.out(),skyBw.out(),scaleFactor); + mark=m_receiversBoss->getCalibrationMark(freq,bandWidth,feed,IFs,skyFreq.out(),skyBw.out(),onoff,scaleFactor); } catch (CORBA::SystemException& ex) { _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CCore::callTSys()"); @@ -952,7 +960,32 @@ void CCore::_callTSys(ACS::doubleSeq& tsys) throw (ComponentErrors::CouldntGetCo impl.setReason("Unable to get calibration diode values"); throw impl; } - //wait for the calibration diode to settle...... + if (onoff) { + try { + m_receiversBoss->calOff(); + } + catch (CORBA::SystemException& ex) { + _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CCore::callTSys()"); + impl.setName(ex._name()); + impl.setMinor(ex.minor()); + m_receiversBossError=true; + throw impl; + } + catch (ComponentErrors::ComponentErrorsEx& ex) { + _ADD_BACKTRACE(ComponentErrors::OperationErrorExImpl,impl,ex,"CCore::callTSys()"); + impl.setReason("Could not turn the calibration mark on"); + throw impl; + } + catch (ReceiversErrors::ReceiversErrorsEx& ex) { + _ADD_BACKTRACE(ComponentErrors::OperationErrorExImpl,impl,ex,"CCore::callTSys()"); + impl.setReason("Could not turn the calibration mark on"); + throw impl; + } + //wait for the calibration diode to switch off completely + guard.release(); + IRA::CIRATools::Wait(m_config->getTsysGapTime()); + guard.acquire(); + } //Now contact the backend to get the TotalPower when the calibration diode is switched off try { tpi=backend->getTpi(); diff --git a/Common/Servers/Scheduler/src/ScheduleExecutor.cpp b/Common/Servers/Scheduler/src/ScheduleExecutor.cpp index 242f0aaea..0b4a1dbe2 100644 --- a/Common/Servers/Scheduler/src/ScheduleExecutor.cpp +++ b/Common/Servers/Scheduler/src/ScheduleExecutor.cpp @@ -318,7 +318,7 @@ void CScheduleExecutor::runLoop() if ((m_currentScan.backendProc!=_SCHED_NULLTARGET) && (m_currentScan.duration>0.0)) { // if the writing has not been disabled and data transfer is started only if the duration is bigger than zero...... m_startRecordTime=m_core->startRecording(m_currentScan.ut,m_currentScan.scanid,m_currentScan.subscanid,m_schedule->getScanTag(), m_config->getDataDirectory(), m_currentScan.suffix,m_schedule->getObserverName(), m_schedule->getProjectName(), - m_schedule->getFileName(),m_currentScan.layout,layoutProc,fullSubscanFileName,fullScanFolder); + m_schedReport.getSchedule(),m_schedReport.getLogFileName(),m_currentScan.layout,layoutProc,fullSubscanFileName,fullScanFolder); if (fullScanFolder!="") { m_schedReport.addScanPath(fullScanFolder); } @@ -719,6 +719,12 @@ void CScheduleExecutor::cleanSchedule(bool error) catch (ACSErr::ACSbaseExImpl& ex) { ex.log(LM_WARNING); } + try { + m_core->defaultlogFile(); + } + catch (ACSErr::ACSbaseExImpl& ex) { + ex.log(LM_WARNING); + } m_closeScanTimer=0; // get rid of the schedule file...... if (m_scheduleLoaded) { diff --git a/Common/Servers/Scheduler/src/ScheduleReport.cpp b/Common/Servers/Scheduler/src/ScheduleReport.cpp index b8ed13c2f..07804bb13 100644 --- a/Common/Servers/Scheduler/src/ScheduleReport.cpp +++ b/Common/Servers/Scheduler/src/ScheduleReport.cpp @@ -78,6 +78,11 @@ IRA::CString CScheduleReport::getLogFileName() const return m_scheduleBaseName+"_"+m_currentPostfix+".log"; } +IRA::CString CScheduleReport::getSchedule() const +{ + return m_scheduleBaseName+"_"+m_currentPostfix; +} + IRA::CString CScheduleReport::getReportFileName() const { return m_reportPath+m_scheduleBaseName+"_"+m_currentPostfix+".rep"; diff --git a/Noto/Servers/NotoReceivers/include/ComponentCore.h b/Noto/Servers/NotoReceivers/include/ComponentCore.h index d6a56b45c..bc7b4c65a 100644 --- a/Noto/Servers/NotoReceivers/include/ComponentCore.h +++ b/Noto/Servers/NotoReceivers/include/ComponentCore.h @@ -88,7 +88,7 @@ public: * @param ifs list of IF identifier, it allows to specifies from which receiver IF the sub band comes from. */ void getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds, - const ACS::longSeq& ifs,double& scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl); + const ACS::longSeq& ifs,bool& onoff,double& scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl); /** * It is called to get the all the receiver output information in one call. @@ -266,8 +266,9 @@ private: double m_vacuumDefault;*/ DWORD m_statusWord; Backends::TotalPower_proxy m_totalPower_proxy; - + bool m_calDiode; Management::TSystemStatus m_componentStatus; + /** * This method prepares the object for execution. diff --git a/Noto/Servers/NotoReceivers/include/NotoReceiversImpl.h b/Noto/Servers/NotoReceivers/include/NotoReceiversImpl.h index 0ade62277..c7b58f16e 100644 --- a/Noto/Servers/NotoReceivers/include/NotoReceiversImpl.h +++ b/Noto/Servers/NotoReceivers/include/NotoReceiversImpl.h @@ -161,7 +161,7 @@ public: * @return the list of the noise calibration value in Kelvin degrees. */ virtual ACS::doubleSeq * getCalibrationMark (const ACS::doubleSeq& freqs, const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, - ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); + ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Boolean_out onoff,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); /** * This method is called in order to know the geometry of the receiver. The geometry is given along the X and Y axis where the central feed is the origin diff --git a/Noto/Servers/NotoReceivers/src/ComponentCore.cpp b/Noto/Servers/NotoReceivers/src/ComponentCore.cpp index 6a6c8b9dc..3798f75ad 100644 --- a/Noto/Servers/NotoReceivers/src/ComponentCore.cpp +++ b/Noto/Servers/NotoReceivers/src/ComponentCore.cpp @@ -143,6 +143,7 @@ void CComponentCore::setMode(const char * mode) throw (ReceiversErrors::ModeErro } setLO(lo); // throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::LocalOscillatorErrorExImpl) m_setupMode=mode; + m_calDiode=false; CUSTOM_LOG(LM_FULL_INFO,"CComponentCore::setMode()",(LM_NOTICE,"New receiver mode: %s",mode)); } @@ -171,6 +172,7 @@ void CComponentCore::calOn() throw (ReceiversErrors::FocusSelectorErrorExImpl,Co _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CComponentCore::calOn()"); setStatusBit(NOISEMARKERROR); } + m_calDiode=true; CUSTOM_LOG(LM_FULL_INFO,"CRecvBossCore::calOn()",(LM_NOTICE,"Noise diode turned on")); clearStatusBit(NOISEMARKERROR); setStatusBit(NOISEMARK); @@ -201,6 +203,7 @@ void CComponentCore::calOff() throw (ReceiversErrors::FocusSelectorErrorExImpl,C _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CComponentCore::calOff()"); setStatusBit(NOISEMARKERROR); } + m_calDiode=false; CUSTOM_LOG(LM_FULL_INFO,"CRecvBossCore::calOff()",(LM_NOTICE,"Noise diode turned off")); clearStatusBit(NOISEMARKERROR); clearStatusBit(NOISEMARK); @@ -317,7 +320,7 @@ void CComponentCore::setLO(const ACS::doubleSeq& lo) throw (ComponentErrors::Val } void CComponentCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds, - const ACS::longSeq& ifs,double &scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl) + const ACS::longSeq& ifs,bool& onoff,double &scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl) { double realFreq,realBw; double *tableLeftFreq=NULL; @@ -381,6 +384,7 @@ void CComponentCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& r } } scaleFactor=1.0; + onoff=m_calDiode; if (tableLeftFreq) delete [] tableLeftFreq; if (tableLeftMark) delete [] tableLeftMark; if (tableRightFreq) delete [] tableRightFreq; diff --git a/Noto/Servers/NotoReceivers/src/NotoReceiversImpl.cpp b/Noto/Servers/NotoReceivers/src/NotoReceiversImpl.cpp index b727b4aa1..8ecf352a7 100644 --- a/Noto/Servers/NotoReceivers/src/NotoReceiversImpl.cpp +++ b/Noto/Servers/NotoReceivers/src/NotoReceiversImpl.cpp @@ -270,13 +270,13 @@ void NotoReceiversImpl::setMode(const char * mode) throw (CORBA::SystemException } ACS::doubleSeq *NotoReceiversImpl::getCalibrationMark(const ACS::doubleSeq& freqs, const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds,const ACS::longSeq& ifs, - ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) + ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Boolean_out onoff,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) { ACS::doubleSeq_var result=new ACS::doubleSeq; ACS::doubleSeq_var resFreq=new ACS::doubleSeq; ACS::doubleSeq_var resBw=new ACS::doubleSeq; try { - m_core.getCalibrationMark(result.inout(),resFreq.inout(),resBw.inout(),freqs,bandwidths,feeds,ifs,scaleFactor); + m_core.getCalibrationMark(result.inout(),resFreq.inout(),resBw.inout(),freqs,bandwidths,feeds,ifs,onoff,scaleFactor); } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); diff --git a/SRT/Configuration/CDB/alma/DataBlock/Sardara/Sardara.xml b/SRT/Configuration/CDB/alma/DataBlock/Sardara/Sardara.xml index 1d7bc48b4..177d103b2 100644 --- a/SRT/Configuration/CDB/alma/DataBlock/Sardara/Sardara.xml +++ b/SRT/Configuration/CDB/alma/DataBlock/Sardara/Sardara.xml @@ -21,9 +21,6 @@ </Configuration> <Configuration> -<<<<<<< HEAD:Medicina/Configuration/CDB/alma/DataBlock/Roach/Roach.xml - <configurationID>RC00</configurationID> -======= <configurationID>SK03</configurationID> <sections>4</sections> <calSwitchingEnabled>TRUE</calSwitchingEnabled> @@ -70,7 +67,6 @@ <Configuration> <configurationID>SC00</configurationID> ->>>>>>> latest64:SRT/Configuration/CDB/alma/DataBlock/Sardara/Sardara.xml <sections>2</sections> <calSwitchingEnabled>TRUE</calSwitchingEnabled> <inputPort>BWG</inputPort> diff --git a/SRT/Servers/SRT7GHzReceiver/include/ComponentCore.h b/SRT/Servers/SRT7GHzReceiver/include/ComponentCore.h index 43c6f31c2..c090d68a0 100644 --- a/SRT/Servers/SRT7GHzReceiver/include/ComponentCore.h +++ b/SRT/Servers/SRT7GHzReceiver/include/ComponentCore.h @@ -91,9 +91,10 @@ public: * @param bandwidth list of the band widths (MHz) * @param feeds list of feed identifier, it allows to specifies form which feed the sub band comes from. In that case it is neglected since the receiver is a single feed * @param ifs list of IF identifier, it allows to specifies from which receiver IF the sub band comes from. + * @param true if the calibration diode is turned on. */ void getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds, - const ACS::longSeq& ifs,double& scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl); + const ACS::longSeq& ifs,bool& onoff,double& scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl); /** * It is called to get the all the receiver output information in one call. @@ -410,6 +411,7 @@ private: double m_cryoLNAWin; double m_vacuumDefault; double m_environmentTemperature; + bool m_calDiode; IRA::ReceiverControl::FetValues m_fetValues; DWORD m_statusWord; // m_ioMarkError is a flag used to know if we already got an IO diff --git a/SRT/Servers/SRT7GHzReceiver/include/SRT7GHzImpl.h b/SRT/Servers/SRT7GHzReceiver/include/SRT7GHzImpl.h index a3281eb7a..b5c04c877 100644 --- a/SRT/Servers/SRT7GHzReceiver/include/SRT7GHzImpl.h +++ b/SRT/Servers/SRT7GHzReceiver/include/SRT7GHzImpl.h @@ -197,11 +197,12 @@ public: * @param ifs for each sub band this indicates the proper IF * @param skyFreq for each sub band it returns the real observed frequency(MHz), included detector, receiver IF and Local Oscillator. * @param skyBw for each sub band it returns the real observed bandwidth(MHz), included detector bandwidth , receiver IF bandwidth + * @param onoff true if the calibration diode is turned on. * @param scaleFactor this is a value to be applied as scale factor during system temperature computation * @return the list of the noise calibration value in Kelvin degrees. */ - virtual ACS::doubleSeq * getCalibrationMark (const ACS::doubleSeq& freqs, const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, - ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); + virtual ACS::doubleSeq * getCalibrationMark(const ACS::doubleSeq& freqs, const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, + ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Boolean_out onoff,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx); /** * This method is called in order to know the geometry of the receiver. The geometry is given along the X and Y axis where the central feed is the origin diff --git a/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp b/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp index 917a15a2e..5290ef93f 100644 --- a/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp +++ b/SRT/Servers/SRT7GHzReceiver/src/ComponentCore.cpp @@ -22,6 +22,7 @@ void CComponentCore::initialize(maci::ContainerServices* services) m_localOscillatorDevice=Receivers::LocalOscillator::_nil(); m_localOscillatorFault=false; m_cryoCoolHead=m_cryoCoolHeadWin= m_cryoLNA=m_cryoLNAWin=m_vacuum=0.0; + m_calDiode=false; m_fetValues.VDL=m_fetValues.IDL=m_fetValues.VGL=m_fetValues.VDR=m_fetValues.IDR=m_fetValues.VGR=0.0; m_statusWord=0; m_ioMarkError = false; @@ -255,6 +256,7 @@ void CComponentCore::setMode(const char * mode) throw (ReceiversErrors::ModeErro } setLO(lo); // throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::LocalOscillatorErrorExImpl) m_setupMode=mode; + m_calDiode=false; ACS_LOG(LM_FULL_INFO,"CComponentCore::setMode()",(LM_NOTICE,"RECEIVER_MODE %s",mode)); } @@ -281,6 +283,7 @@ void CComponentCore::calOn() throw (ReceiversErrors::NoRemoteControlErrorExImpl, throw impl; } setStatusBit(NOISEMARK); + m_calDiode=true; clearStatusBit(CONNECTIONERROR); // the communication was ok so clear the CONNECTIONERROR bit } @@ -307,6 +310,7 @@ void CComponentCore::calOff() throw (ReceiversErrors::NoRemoteControlErrorExImpl throw impl; } clearStatusBit(NOISEMARK); + m_calDiode=false; clearStatusBit(CONNECTIONERROR); // the communication was ok so clear the CONNECTIONERROR bit } @@ -449,7 +453,7 @@ void CComponentCore::setLO(const ACS::doubleSeq& lo) throw (ComponentErrors::Val } void CComponentCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds, - const ACS::longSeq& ifs,double &scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl) + const ACS::longSeq& ifs,bool& onoff,double &scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl) { double realFreq,realBw; double *tableLeftFreq=NULL; @@ -513,6 +517,7 @@ void CComponentCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& r } } scaleFactor=1.0; + onoff=m_calDiode; if (tableLeftFreq) delete [] tableLeftFreq; if (tableLeftMark) delete [] tableLeftMark; if (tableRightFreq) delete [] tableRightFreq; diff --git a/SRT/Servers/SRT7GHzReceiver/src/SRT7GHzImpl.cpp b/SRT/Servers/SRT7GHzReceiver/src/SRT7GHzImpl.cpp index 0929f6b30..d12b059a9 100644 --- a/SRT/Servers/SRT7GHzReceiver/src/SRT7GHzImpl.cpp +++ b/SRT/Servers/SRT7GHzReceiver/src/SRT7GHzImpl.cpp @@ -339,13 +339,13 @@ void SRT7GHzImpl::setMode(const char * mode) throw (CORBA::SystemException,Compo } ACS::doubleSeq *SRT7GHzImpl::getCalibrationMark(const ACS::doubleSeq& freqs, const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds,const ACS::longSeq& ifs, - ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) + ACS::doubleSeq_out skyFreq,ACS::doubleSeq_out skyBw,CORBA::Boolean_out onoff,CORBA::Double_out scaleFactor) throw (CORBA::SystemException,ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx) { ACS::doubleSeq_var result=new ACS::doubleSeq; ACS::doubleSeq_var resFreq=new ACS::doubleSeq; ACS::doubleSeq_var resBw=new ACS::doubleSeq; try { - m_core.getCalibrationMark(result.inout(),resFreq.inout(),resBw.inout(),freqs,bandwidths,feeds,ifs,scaleFactor); + m_core.getCalibrationMark(result.inout(),resFreq.inout(),resBw.inout(),freqs,bandwidths,feeds,ifs,onoff,scaleFactor); } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); diff --git a/SRT/Servers/SRTKBandMFReceiver/include/ComponentCore.h b/SRT/Servers/SRTKBandMFReceiver/include/ComponentCore.h index f60b52e57..a492af984 100644 --- a/SRT/Servers/SRTKBandMFReceiver/include/ComponentCore.h +++ b/SRT/Servers/SRTKBandMFReceiver/include/ComponentCore.h @@ -128,6 +128,7 @@ public: const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, + bool& onoff, double &scale ) throw (ComponentErrors::ValidationErrorExImpl, ComponentErrors::ValueOutofRangeExImpl); @@ -563,6 +564,7 @@ private: double m_cryoLNAWin; double m_vacuumDefault; double m_envTemperature; + bool m_calDiode; IRA::ReceiverControl::FetValues m_fetValues; DWORD m_statusWord; // m_ioMarkError is a flag used to know if we already got an IO diff --git a/SRT/Servers/SRTKBandMFReceiver/include/SRTKBandMFReceiverImpl.h b/SRT/Servers/SRTKBandMFReceiver/include/SRTKBandMFReceiverImpl.h index 074abb9de..72384b60b 100644 --- a/SRT/Servers/SRTKBandMFReceiver/include/SRTKBandMFReceiverImpl.h +++ b/SRT/Servers/SRTKBandMFReceiver/include/SRTKBandMFReceiverImpl.h @@ -269,6 +269,7 @@ public: const ACS::longSeq& ifs, ACS::doubleSeq_out skyFreq, ACS::doubleSeq_out skyBw, + CORBA::Boolean_out onoff, CORBA::Double_out scaleFactor ) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx, ReceiversErrors::ReceiversErrorsEx); diff --git a/SRT/Servers/SRTKBandMFReceiver/src/ComponentCore.cpp b/SRT/Servers/SRTKBandMFReceiver/src/ComponentCore.cpp index a8638a58a..1be543cc7 100644 --- a/SRT/Servers/SRTKBandMFReceiver/src/ComponentCore.cpp +++ b/SRT/Servers/SRTKBandMFReceiver/src/ComponentCore.cpp @@ -26,6 +26,7 @@ void CComponentCore::initialize(maci::ContainerServices* services) m_fetValues.VDL=m_fetValues. IDL=m_fetValues.VGL=m_fetValues.VDR=m_fetValues.IDR=m_fetValues.VGR=0.0; m_statusWord=0; m_ioMarkError = false; + m_calDiode=false; } CConfiguration const * const CComponentCore::execute() throw ( @@ -160,7 +161,8 @@ void CComponentCore::activate() throw ( { baci::ThreadSyncGuard guard(&m_mutex); // Call the f of the derived class (setMode is pure virtual in ComponentCore). - setMode((const char *)m_configuration.getSetupMode()); + setMode((const char *)m_configuration.getSetupMode()); + m_calDiode=false; guard.release(); lnaOn(); // Throw (ReceiversErrors::NoRemoteControlErrorExImpl,ReceiversErrors::ReceiverControlBoardErrorExImpl) externalCalOff(); @@ -271,6 +273,7 @@ void CComponentCore::calOn() throw ( } try { m_control->setCalibrationOn(); + m_calDiode=true; } catch (IRA::ReceiverControlEx& ex) { _EXCPT(ReceiversErrors::ReceiverControlBoardErrorExImpl,impl,"CComponentCore::calOn()"); @@ -288,7 +291,6 @@ void CComponentCore::calOn() throw ( setStatusBit(CONNECTIONERROR); throw impl; } - } @@ -311,6 +313,7 @@ void CComponentCore::calOff() throw ( } try { m_control->setCalibrationOff(); + m_calDiode=false; } catch (IRA::ReceiverControlEx& ex) { _EXCPT(ReceiversErrors::ReceiverControlBoardErrorExImpl,impl,"CComponentCore::calOff()"); @@ -502,6 +505,7 @@ void CComponentCore::getCalibrationMark( const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, + bool &onoff, double& scale ) throw (ComponentErrors::ValidationErrorExImpl, ComponentErrors::ValueOutofRangeExImpl) { @@ -627,6 +631,7 @@ void CComponentCore::getCalibrationMark( resBw[i]=realBw; } scale=1.0; + onoff=m_calDiode; if (tableLeftFreq) delete [] tableLeftFreq; if (tableLeftMark) delete [] tableLeftMark; if (tableRightFreq) delete [] tableRightFreq; diff --git a/SRT/Servers/SRTKBandMFReceiver/src/SRTKBandMFReceiverImpl.cpp b/SRT/Servers/SRTKBandMFReceiver/src/SRTKBandMFReceiverImpl.cpp index 291c4bf03..1bfc392bf 100644 --- a/SRT/Servers/SRTKBandMFReceiver/src/SRTKBandMFReceiverImpl.cpp +++ b/SRT/Servers/SRTKBandMFReceiver/src/SRTKBandMFReceiverImpl.cpp @@ -459,6 +459,7 @@ ACS::doubleSeq * SRTKBandMFReceiverImpl::getCalibrationMark( const ACS::longSeq& ifs, ACS::doubleSeq_out skyFreq, ACS::doubleSeq_out skyBw, + CORBA::Boolean_out onoff, CORBA::Double_out scaleFactor ) throw ( CORBA::SystemException, @@ -470,7 +471,7 @@ ACS::doubleSeq * SRTKBandMFReceiverImpl::getCalibrationMark( ACS::doubleSeq_var resFreq = new ACS::doubleSeq; ACS::doubleSeq_var resBw = new ACS::doubleSeq; try { - m_core.getCalibrationMark(result.inout(), resFreq.inout(), resBw.inout(), freqs, bandwidths, feeds,ifs,scaleFactor); + m_core.getCalibrationMark(result.inout(), resFreq.inout(), resBw.inout(), freqs, bandwidths, feeds,ifs,onoff,scaleFactor); } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); diff --git a/SRT/Servers/SRTLPBandReceiver/include/ComponentCore.h b/SRT/Servers/SRTLPBandReceiver/include/ComponentCore.h index 3562b635e..3bb68f83f 100755 --- a/SRT/Servers/SRTLPBandReceiver/include/ComponentCore.h +++ b/SRT/Servers/SRTLPBandReceiver/include/ComponentCore.h @@ -129,6 +129,7 @@ public: const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, + bool& onoff, double &scale ) throw (ComponentErrors::ValidationErrorExImpl, ComponentErrors::ValueOutofRangeExImpl); @@ -600,6 +601,7 @@ private: double m_cryoLNAWin; double m_vacuumDefault; double m_envTemperature; + bool m_calDiode; IRA::ReceiverControl::FetValues m_fetValues; DWORD m_statusWord; // m_ioMarkError is a flag used to know if we already got an IO diff --git a/SRT/Servers/SRTLPBandReceiver/include/SRTLPBandReceiverImpl.h b/SRT/Servers/SRTLPBandReceiver/include/SRTLPBandReceiverImpl.h index c9eacbbf0..e6c3c6136 100755 --- a/SRT/Servers/SRTLPBandReceiver/include/SRTLPBandReceiverImpl.h +++ b/SRT/Servers/SRTLPBandReceiver/include/SRTLPBandReceiverImpl.h @@ -307,6 +307,7 @@ public: const ACS::longSeq& ifs, ACS::doubleSeq_out skyFreq, ACS::doubleSeq_out skyBw, + CORBA::Boolean_out onoff, CORBA::Double_out scaleFactor ) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx, ReceiversErrors::ReceiversErrorsEx); diff --git a/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp b/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp index 514e7893a..f74619cbb 100755 --- a/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp +++ b/SRT/Servers/SRTLPBandReceiver/src/ComponentCore.cpp @@ -28,6 +28,7 @@ void CComponentCore::initialize(maci::ContainerServices* services) m_fetValues.VGR = 0.0; m_statusWord = 0; m_ioMarkError = false; + m_calDiode=false; m_setupMode = ""; } @@ -328,6 +329,7 @@ void CComponentCore::calOn() throw ( } try { m_control->setCalibrationOn(); + m_calDiode=true; } catch (IRA::ReceiverControlEx& ex) { _EXCPT(ReceiversErrors::ReceiverControlBoardErrorExImpl,impl,"CComponentCore::calOn()"); @@ -345,7 +347,6 @@ void CComponentCore::calOn() throw ( setStatusBit(CONNECTIONERROR); throw impl; } - } @@ -368,6 +369,7 @@ void CComponentCore::calOff() throw ( } try { m_control->setCalibrationOff(); + m_calDiode=false; } catch (IRA::ReceiverControlEx& ex) { _EXCPT(ReceiversErrors::ReceiverControlBoardErrorExImpl,impl,"CComponentCore::calOff()"); @@ -576,6 +578,7 @@ void CComponentCore::getCalibrationMark( const ACS::doubleSeq& bandwidths, const ACS::longSeq& feeds, const ACS::longSeq& ifs, + bool& onoff, double& scale ) throw (ComponentErrors::ValidationErrorExImpl, ComponentErrors::ValueOutofRangeExImpl) { @@ -711,7 +714,7 @@ void CComponentCore::getCalibrationMark( if (tableRightFreq) delete [] tableRightFreq; if (tableRightMark) delete [] tableRightMark; scale = 1.0; - + onoff=m_calDiode; } @@ -878,6 +881,7 @@ void CComponentCore::setSetupMode(const char * setup_mode) throw (ReceiversError // Call the derived class method (setMode is pure virtual in ComponentCore). setMode((const char *)getTargetMode()); + m_calDiode=false; ACS_LOG(LM_FULL_INFO,"CComponentCore::setSetupMode()",(LM_NOTICE,"SETUP_MODE %s", (const char *)getTargetMode())); } diff --git a/SRT/Servers/SRTLPBandReceiver/src/SRTLPBandReceiverImpl.cpp b/SRT/Servers/SRTLPBandReceiver/src/SRTLPBandReceiverImpl.cpp index 5122fba5e..beff06fd6 100755 --- a/SRT/Servers/SRTLPBandReceiver/src/SRTLPBandReceiverImpl.cpp +++ b/SRT/Servers/SRTLPBandReceiver/src/SRTLPBandReceiverImpl.cpp @@ -485,6 +485,7 @@ ACS::doubleSeq * SRTLPBandReceiverImpl::getCalibrationMark( const ACS::longSeq& ifs, ACS::doubleSeq_out skyFreq, ACS::doubleSeq_out skyBw, + CORBA::Boolean_out onoff, CORBA::Double_out scaleFactor ) throw ( CORBA::SystemException, @@ -497,7 +498,7 @@ ACS::doubleSeq * SRTLPBandReceiverImpl::getCalibrationMark( ACS::doubleSeq_var resBw = new ACS::doubleSeq; try { - m_core.getCalibrationMark(result.inout(), resFreq.inout(), resBw.inout(), freqs, bandwidths, feeds,ifs,scaleFactor); + m_core.getCalibrationMark(result.inout(), resFreq.inout(), resBw.inout(), freqs, bandwidths, feeds,ifs,onoff,scaleFactor); } catch (ComponentErrors::ComponentErrorsExImpl& ex) { ex.log(LM_DEBUG); diff --git a/SystemMake/Makefile b/SystemMake/Makefile index 056ecb807..339deb281 100644 --- a/SystemMake/Makefile +++ b/SystemMake/Makefile @@ -28,7 +28,7 @@ COMMON_INTERFACES:=CommonInterface ManagmentInterface AntennaInterface Receivers BackendsInterface MinorServoInterface \ WeatherStationInterface ActiveSurfaceInterface \ XBackendInterface -COMMON_LIBRARIES:=SlaLibrary IRALibrary TextWindowLibrary ParserLibrary \ +COMMON_LIBRARIES:=SlaLibrary IRALibrary DiscosVersion TextWindowLibrary ParserLibrary \ XarcosLibrary ModbusChannel ComponentProxy \ DiscosBackendProtocol PyTestingLibrary \ COMMON_SERVERS:=AntennaBoss Observatory OTF PointingModel Refraction SkySource \ -- GitLab