diff --git a/Common/Interfaces/CommonInterface/idl/ManagmentDefinitions.midl b/Common/Interfaces/CommonInterface/idl/ManagmentDefinitions.midl index ac9daeb7c1dfaf1d4e319d9cb653725abee22e85..3eaf865d5894b0c50a35a556dd51038e379bb6c5 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 aaa28b809a8efc37c5662ccfab73c34a858d9a2f..bb2bd2801e3dae0bfffee312497c6e819e07f04e 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 6bf11f76ccc733a559753fa30ecd85553b26bd9f..26e38822ffd25e9fadbe2a2336c5c1b94706f5a1 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 195c312b17db775cf91a936b64c80adab5ce8854..624686ee0f55f64c80c31e459faf80e68be497f2 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 09b21a1620215a0d0547670d212b4bfbb742065a..d556385bd973708926b67bad6c63019bad2daf51 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 0000000000000000000000000000000000000000..e9937eb0d142afb167a31e9e51b96bb0d65717a8 --- /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 0000000000000000000000000000000000000000..1a6aa90771798955f888f7498a4b4e49c4db459b --- /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 0000000000000000000000000000000000000000..2dd4709e6ce2eaabc3761ddc124223c9f435daac --- /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 e63d571c19776bf98f66f4df026822e0c95944bf..d124f728fe11d34e1183373fe4607b482ebe0f1a 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 1b7595fec8c6d9b8e00150878ce754fdb4b69341..9aef735f4b874580c0bf8ba64f77b070c4e6d3b5 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 71c3af57cbc879f9912dd3f92ffb6c9dc8bcb31c..dd1a2aaa32e5d165b9237ab1b430b7626be86fab 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 f55b85b25ddfd856a59d9382b085604c95c88af3..e3666a40f183792e4b822d4dc8479f21a9f2decc 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 4e2d99c4fbd8ca4ca88c2491c72d86b44ee1899d..cd1142e67a7e703bc93f6335c244a36c0345004b 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 1ed5c983e011f73f497dd346a4c81f885e858170..6e02498ddf37191490406c086c8a9df8e759621a 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 40cddc4f42fdd98e78704c6ecfb35876e6a351f2..42364075f5dd6f31c1fd2b96f4d48bea23191299 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 e9efbdd5aa438d20db99da6f356a5bb8330d4b36..39e6884392a86b45ec280b44e63874cf3cf577d1 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 c3ec13728ca30ac9eb921646022a22aa4d5da927..cd80c5a2f97db848c73576cb06d3538ce7814dd8 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 22765dc65034b40953ada6ace65bc600398fd95e..50afc35d5c4ebee4f93081a85b834c3f9a1ce9bc 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 8ab194632cdbd8d9aaca5c001e20f603f28b77b7..189edd856cb7118fae3a7118a17ac90a3015fd62 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 0fa85e0e939dd6de035378c573fd96afeb72f7c2..6dd525b44a3f69795f61a2155167fb33443c2ec1 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 c689dc7ace24420beefb59a3f651b31a5f3ef382..4c6e724009531d7dbb9d20988704663eda005efe 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 773ff68882948c23c879be70b4aa593a2c1f2e81..4d62b90b8b3c88df28d6fddfe40938f52c71b852 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 cbd55e335e8bdd07725c78310170b73de695cc09..5cf1408c2aebd9339134394cf875429fbcfe6bb8 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 194a940f7af288b14d7d0b24a1cfc713a949e34a..255469b7beb0364b158ca714fe199f08ed0a5c45 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 3ca41eb1a3f5aa830336e83195ca7d3d3cf61046..3cda6288c213c3cde208e2da750ef89fffdd198a 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 580ef9ce43e75957acda31b588c0f3d4cc77015c..7859c3099d507c7c56fcc606b946194d9ce701fc 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 ba1818c29ca409462636fa38461bd6a1ac38abaa..f3f7b1cbfabed2511ceb66d273248245897c80d0 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 2720f48d73c08a91e01e103cf3b993b4a9a74e8a..700764f2aaf6fdc79dce2cb848ddaacf8826b5c7 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 689cd8b491630ed1063ad2cbe5b7a890bb884b9d..92ab5ba735db2ab1b6caf9aaf1636cd1e6f605d8 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 01e5278b84d4f49c6f52710ca4a19e5ede180500..1e8554cbeb60687a07f648a278f174b61b963e4b 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 4053120a9a708119b6ae25c91d2644a8d17cf027..2e3206cdb0f3b4bed2d8571bc2b53285ba522477 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 235a2254d63edc3855ab8128c9997bc1c87246ac..80c9dadd16629e874b892ef63de54d045aa44c71 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 a9d76238ff4672cbf1ad31e6e6e98e10444dfcae..cbd199194b5632a2aedeca2ee48d3dbc9b5dca04 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 7a09fe24551137196a19e6537c34c61ca0758509..e762f51566a305976f3f6eac1c07612e6257356f 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 582c2d03b720b8f8b7d47fbf5354cf36508291f9..8599aab9ab4eceb824e4573e1f07456f50eabdc2 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 af5e519a2d8e84d00351bcf23a74ff61198d65da..ad91a3414f90c52a9a907f058d99dc082e92b146 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 5ec3b8f2e105610b7b5135dffbb5376e6115e65a..2d98af1a0f4ef79d9a247d40c8884576fe1d96c2 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 242f0aaea8add5c9f9d437db87e5a05bdf450307..0b4a1dbe2ad5a2c057e43a7398b13af106f9aa35 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 b8ed13c2fcef81bb8df7ba40a4c90750ca6e3c75..07804bb133f91aea8830268a9410041b86987b5c 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 d6a56b45c0c23afde5807eba4121d76ae49693e5..bc7b4c65aff1cca0a2772be730686b1ba2495f1b 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 0ade6227769ce1aa7633cbb2125b5c7840ec3a26..c7b58f16e2d64ea6a69fe6dcdb9e9ca7e03552dc 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 6a6c8b9dc4f3bb38bf3574c730a65713b979118c..3798f75ad70967658808303ae1e9f8b60528bb2f 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 b727b4aa17a36b307af15d59690d92d9f09a46b0..8ecf352a7c310a60676f96f8ea2fb00613a5e492 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 1d7bc48b42319e483b00855a41284a919b50c5c6..177d103b2019c9625e5a1745976dd32b1fe6e0a3 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 43c6f31c2dcc366848548f59a46cf338e02687ce..c090d68a0647a6623402f13f86cefaaf5b49aee6 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 a3281eb7ae9123f2fe9963dc3c430929ab18f8ae..b5c04c87708ba5e649cab7c79702326af8fa1a3b 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 917a15a2e9fa8a0b999746ebba5e6d523edab4be..5290ef93f4662fe76db045a1f7f6fa5641b50b4e 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 0929f6b301de371f6aae3874a6b72af8c53eddf9..d12b059a90938396c24d1cdea1e3d9a809435bad 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 f60b52e578394ccf62b9ac8aca286f3b2908662b..a492af98449ead0866bf5d9bfd98e92c44b5b0cb 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 074abb9de5b82cf500572caf76566471f352b7ce..72384b60b49e416640fda5cd08242808589638cf 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 a8638a58a93b48791d67a9773e20213a505f4693..1be543cc7bcf9075214aade52fb1168e00cf4ddd 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 291c4bf039ff7d254dfb0b40578dd74ed0ae0de4..1bfc392bf46701665e08a81bf09912704838aaa4 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 3562b635e60508d9460806528384b079009255ff..3bb68f83fd4d2af97c929d39417e3a5773e6e95f 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 c9eacbbf0cf3f52fae484349f547f06b7619a848..e6c3c61365f3509271c22787f7b97f3b1318c421 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 514e7893ae7cdf5998aa2a9e2e0b1457fe97b171..f74619cbba97ad311b103d10f457bbe29e21fa67 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 5122fba5eab678c303d4a22e56498d63f933f145..beff06fd64a9721a61ff20461ed149da36cb2cae 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 056ecb8077778e56bf811079e5f994c8225aca12..339deb281ed3c65e411360360314ae139d266036 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 \