diff --git a/.gitattributes b/.gitattributes index a6704427e179a4a1242521252c7cd1d8addc530e..b2b797e2f3b7e81790d6a195f69ce6564e8c4c34 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2142,6 +2142,7 @@ LCS/AMC/AMCImpl/src/AMCServer.cc -text LCS/AMC/amc_main_classes.png -text LCS/AMC/amc_package.png -text LCS/ApplCommon/include/ApplCommon/StationDatatypes.h -text +LCS/ApplCommon/src/PosixTime.cc -text LCS/ApplCommon/src/StationDatatypes.cc -text LCS/ApplCommon/test/tAntField.in_de -text LCS/ApplCommon/test/tAntField.in_rs -text @@ -3344,7 +3345,6 @@ MAC/Navigator2/scripts/monitorStateReset.ctl -text MAC/Navigator2/scripts/monitorStationAlarms.ctl -text MAC/Navigator2/scripts/readStationBGPconnections.ctl -text MAC/Navigator2/scripts/readStationConfigs.ctl -text -MAC/Navigator2/scripts/transferMPs.ctl -text MAC/Test/APL/PVSSproject/colorDB/Lofar[!!-~]colors -text svneol=native#application/octet-stream MAC/Test/APL/PVSSproject/colorDB/colorDB_de -text svneol=native#application/octet-stream MAC/Test/APL/PVSSproject/config/config -text svneol=native#application/octet-stream diff --git a/.subversion/config b/.subversion/config index 0812a72b3c6ce9fbb316ebb838bc54fee336b3d1..b7f6f49ab1c76afa7d0d352a43ebe45f16763000 100644 --- a/.subversion/config +++ b/.subversion/config @@ -5,37 +5,22 @@ ### Section for authentication and authorization customizations. [auth] -### Set password stores used by Subversion. They should be -### delimited by spaces or commas. The order of values determines -### the order in which password stores are used. -### Valid password stores: -### gnome-keyring (Unix-like systems) -### kwallet (Unix-like systems) -### keychain (Mac OS X) -### windows-cryptoapi (Windows) -password-stores = gnome-keyring,kwallet -### To disable all password stores, use an empty list: -# password-stores = -### -### Set KWallet wallet used by Subversion. If empty or unset, -### then the default network wallet will be used. -# kwallet-wallet = -### -### Include PID (Process ID) in Subversion application name when -### using KWallet. It defaults to 'no'. -# kwallet-svn-application-name-with-pid = yes -### -### The rest of the [auth] section in this file has been deprecated. -### Both 'store-passwords' and 'store-auth-creds' can now be -### specified in the 'servers' file in your config directory -### and are documented there. Anything specified in this section -### is overridden by settings specified in the 'servers' file. +### Set store-passwords to 'no' to avoid storing passwords in the +### auth/ area of your config directory. It defaults to 'yes'. +### Note that this option only prevents saving of *new* passwords; +### it doesn't invalidate existing passwords. (To do that, remove +### the cache files by hand as described in the Subversion book.) # store-passwords = no +### Set store-auth-creds to 'no' to avoid storing any subversion +### credentials in the auth/ area of your config directory. +### It defaults to 'yes'. Note that this option only prevents +### saving of *new* credentials; it doesn't invalidate existing +### caches. (To do that, remove the cache files by hand.) # store-auth-creds = no ### Section for configuring external helper applications. [helpers] -### Set editor-cmd to the command used to invoke your text editor. +### Set editor to the command used to invoke your text editor. ### This will override the environment variables that Subversion ### examines by default to find this information ($EDITOR, ### et al). @@ -44,21 +29,13 @@ password-stores = gnome-keyring,kwallet ### This will override the compile-time default, which is to use ### Subversion's internal diff implementation. # diff-cmd = diff_program (diff, gdiff, etc.) -### Diff-extensions are arguments passed to an external diff -### program or to Subversion's internal diff implementation. -### Set diff-extensions to override the default arguments ('-u'). -# diff-extensions = -u -p ### Set diff3-cmd to the absolute path of your 'diff3' program. ### This will override the compile-time default, which is to use ### Subversion's internal diff3 implementation. # diff3-cmd = diff3_program (diff3, gdiff3, etc.) -### Set diff3-has-program-arg to 'yes' if your 'diff3' program -### accepts the '--diff-program' option. -# diff3-has-program-arg = [yes | no] -### Set merge-tool-cmd to the command used to invoke your external -### merging tool of choice. Subversion will pass 5 arguments to -### the specified command: base theirs mine merged wcfile -# merge-tool-cmd = merge_command +### Set diff3-has-program-arg to 'true' or 'yes' if your 'diff3' +### program accepts the '--diff-program' option. +# diff3-has-program-arg = [true | false] ### Section for configuring tunnel agents. [tunnels] @@ -75,7 +52,7 @@ password-stores = gnome-keyring,kwallet ### passed to the tunnel agent as <user>@<hostname>.) If the ### built-in ssh scheme were not predefined, it could be defined ### as: -# ssh = $SVN_SSH ssh -q -o ControlMaster=no +# ssh = $SVN_SSH ssh ### If you wanted to define a new 'rsh' scheme, to be used with ### 'svn+rsh:' URLs, you could do so as follows: # rsh = rsh @@ -89,11 +66,14 @@ password-stores = gnome-keyring,kwallet ### Section for configuring miscelleneous Subversion options. [miscellany] ### Set global-ignores to a set of whitespace-delimited globs -### which Subversion will ignore in its 'status' output, and -### while importing or adding files and directories. -### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. -# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo -# *.rej *~ #*# .#* .*.swp .DS_Store +### which Subversion will ignore in its 'status' output. +global-ignores = *~ *.log *.private *.result *.tmp installed \ + aclocal.m4 autom4te.cache boot.md5 boot.md5-check \ + build config.guess config.h.in config.sub configure \ + depcomp install-sh libtool.m4 ltmain.sh lt~obsolete.m4 \ + ltoptions.m4 ltsugar.m4 ltversion.m4 Makefile.in missing \ + *.pyc + ### Set log-encoding to the default encoding for log messages # log-encoding = latin1 ### Set use-commit-times to make checkout/update/switch/revert @@ -102,37 +82,19 @@ password-stores = gnome-keyring,kwallet ### Set no-unlock to prevent 'svn commit' from automatically ### releasing locks on files. # no-unlock = yes -### Set mime-types-file to a MIME type registry file, used to -### provide hints to Subversion's MIME type auto-detection -### algorithm. -# mime-types-file = /path/to/mime.types -### Set preserved-conflict-file-exts to a whitespace-delimited -### list of patterns matching file extensions which should be -### preserved in generated conflict file names. By default, -### conflict files use custom extensions. -# preserved-conflict-file-exts = doc ppt xls od? ### Set enable-auto-props to 'yes' to enable automatic properties ### for 'svn add' and 'svn import', it defaults to 'no'. ### Automatic properties are defined in the section 'auto-props'. -# enable-auto-props = yes -### Set interactive-conflicts to 'no' to disable interactive -### conflict resolution prompting. It defaults to 'yes'. -# interactive-conflicts = no -### Set memory-cache-size to define the size of the memory cache -### used by the client when accessing a FSFS repository via -### ra_local (the file:// scheme). The value represents the number -### of MB used by the cache. -# memory-cache-size = 16 +enable-auto-props = yes ### Section for configuring automatic properties. [auto-props] ### The format of the entries is: ### file-name-pattern = propname[=value][;propname[=value]...] ### The file-name-pattern can contain wildcards (such as '*' and -### '?'). All entries which match (case-insensitively) will be -### applied to the file. Note that auto-props functionality -### must be enabled, which is typically done by setting the -### 'enable-auto-props' option. +### '?'). All entries which match will be applied to the file. +### Note that auto-props functionality must be enabled, which +### is typically done by setting the 'enable-auto-props' option. *.am = svn:eol-style=native;svn:keywords=Author Date Id Revision *.bat = svn:eol-style=CRLF;svn:keywords=Author Date Id Revision *.bib = svn:eol-style=native diff --git a/CMake/TODO b/CMake/TODO index b6019b07c7304971e63bd297fa73cec3823adb45..c1966dd2b442a31b139d021f4374bee9a4b962fe 100644 --- a/CMake/TODO +++ b/CMake/TODO @@ -3,12 +3,6 @@ = TODO - List of things to do = ============================================================================== -* When not configuring explicitly for PyBDSM, a warning is printed that the - Fortran compiler could not be determined, which may cause trouble later on. - PyBDSM builds without problems, though. Probable cause: the Fortran - language is added too late to the CMake project, i.e. only after F2Py - searches for a suitable Fortran compiler. - * Python byte-code compilation fails during install when using DESTDIR option to specify a different install directory. @@ -32,6 +26,14 @@ 2) For every target, the library prefix must be cleared and an (additional) install directory -- python/site-packages -- must be added. +* Use something like set_if_not_set() in the variants files for non-cached + CMake variables. Contrary to options, which are just cached variables of + type bool, non-cached variables will be overwritten. So, in fact, for + non-cached variables the include-order of variants file should be exactly + the opposite of the order for cached variables. The proper way to solve + this, IMO, is to use something like set_if_not_set(), which will only set a + non-cached variable when it has not already been set. + * Switch from FindPthread to FindThreads, which is the "standard" CMake module to use (and it also used by FindBLAS and FindLAPACK). Unfortunately, the variables that FindThreads sets are completely non-standard, so we may diff --git a/CMake/variants/BGPCN.cmake b/CMake/variants/BGPCN.cmake index 1a007a642db493e5bda460ec83519587c856ef1d..62330b11285c1e999a96bcb293a6be8ae9106ab8 100644 --- a/CMake/variants/BGPCN.cmake +++ b/CMake/variants/BGPCN.cmake @@ -10,7 +10,6 @@ set(LOFAR_BUILD_VARIANTS DEBUG OPT) # Options option(BUILD_STATIC_EXECUTABLES "Build static executables" ON) -option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(USE_BACKTRACE "Use backtrace" ON) option(USE_LOG4CPLUS "Use log4cplus" OFF) option(USE_SHMEM "Use shmem" OFF) diff --git a/CMake/variants/variants b/CMake/variants/variants index 818a6a35ab83ba6df329ac7eac236f9bd816b69d..6910205634b051f9c1e44a482642bd8f90926980 100644 --- a/CMake/variants/variants +++ b/CMake/variants/variants @@ -22,7 +22,7 @@ set_if_not_set(LOFAR_SEARCH_PATH # NOT IMPLEMENTED YET: These options may be overridden for a given compiler # suite. For example: option(USE_BOOST_GNU "Use Boost for GNU" OFF) option(BUILD_DOCUMENTATION "Build code documentation" OFF) -option(BUILD_SHARED_LIBS "Build shared libraries" ON) +option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(BUILD_STATIC_EXECUTABLES "Build static executables" OFF) option(BUILD_TESTING "Build the testing tree" ON) option(LOFAR_VERBOSE_CONFIGURE "Be verbose when configuring" ON) diff --git a/CMake/variants/variants.RS005C b/CMake/variants/variants.RS005C index 07b2fa35cef162b44bb0ef5b20a6c48c1dbc9fa1..2fb3ca3b231ba6d8a6861d380307be03647505e1 100644 --- a/CMake/variants/variants.RS005C +++ b/CMake/variants/variants.RS005C @@ -11,7 +11,7 @@ set(CPPLAPACK_ROOT_DIR /usr) set(LOG4CPLUS_ROOT_DIR /usr/local/log4cplus) # Path to PVSS -set(PVSS_ROOT_DIR /opt/WinCC_OA/3.10) +set(PVSS_PROJ_DIR /opt/pvss/pvssproj) set(PVSS_DEFINITIONS "-Wno-deprecated") # Path to Matlab diff --git a/CMake/variants/variants.dop131 b/CMake/variants/variants.dop131 index 4a466bc69b697581e3ce49fb9d0480ddea36873a..c62db6ec07951e328fd392c6bc0b6b9c8232d35d 100644 --- a/CMake/variants/variants.dop131 +++ b/CMake/variants/variants.dop131 @@ -1,2 +1,3 @@ +option(BUILD_SHARED_LIBS "Build shared libraries" ON) #set(CASACORE_ROOT_DIR /opt/lofar/external/casacore) set(ENV{JAVA_HOME} /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0) diff --git a/CMake/variants/variants.kis001 b/CMake/variants/variants.kis001 index 13d9387ba28c6956cbe3a313173695d1eed50f5e..bb3f6b1974c6aa945c17b7f3cb2ed4dba4b8b7d6 100644 --- a/CMake/variants/variants.kis001 +++ b/CMake/variants/variants.kis001 @@ -1,6 +1,7 @@ set(ENV{JAVA_HOME} /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0) #set(PVSS_ROOT_DIR /opt/pvss/pvss2_v3.7) -set(PVSS_ROOT_DIR /opt/WinCC_OA/3.10) +#set(PVSS_ROOT_DIR /opt/WinCC_OA/3.10) +set(PVSS_PROJ_DIR /opt/pvss/pvssproj) set(PVSS_DEFINITIONS "-Wno-deprecated") set(LOG4CPLUS_ROOT_DIR "/usr/local/log4cplus") diff --git a/CMake/variants/variants.lce072 b/CMake/variants/variants.lce072 index f203bc5dd0409bdd3c64b22f3c418f6a2d4b105c..ccc44214f64da8c438048ba78bd35ec0fa4466de 100644 --- a/CMake/variants/variants.lce072 +++ b/CMake/variants/variants.lce072 @@ -1,3 +1,5 @@ +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + set(CASACORE_ROOT_DIR /opt/cep/LofIm/daily/casacore) set(CASAREST_ROOT_DIR /opt/cep/LofIm/daily/casarest) set(LDA_ROOT_DIR /opt/cep/lda) diff --git a/CMake/variants/variants.lfe001 b/CMake/variants/variants.lfe001 index b72d84db644a764f932c92f9f744e0cd00792729..2bf1ea99e27ec8d83f6efed367896d69f09b17d4 100644 --- a/CMake/variants/variants.lfe001 +++ b/CMake/variants/variants.lfe001 @@ -1,3 +1,5 @@ +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + set(CASACORE_ROOT_DIR /opt/cep/casacore) set(CASAREST_ROOT_DIR /opt/cep/casarest) set(LDA_ROOT_DIR /opt/cep/lda) diff --git a/CMake/variants/variants.lfe002 b/CMake/variants/variants.lfe002 index b72d84db644a764f932c92f9f744e0cd00792729..2bf1ea99e27ec8d83f6efed367896d69f09b17d4 100644 --- a/CMake/variants/variants.lfe002 +++ b/CMake/variants/variants.lfe002 @@ -1,3 +1,5 @@ +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + set(CASACORE_ROOT_DIR /opt/cep/casacore) set(CASAREST_ROOT_DIR /opt/cep/casarest) set(LDA_ROOT_DIR /opt/cep/lda) diff --git a/CMake/variants/variants.lhn001 b/CMake/variants/variants.lhn001 index 70a36aa44504a824a7791f7b349b22ce172cb3ed..ec7471769b4689da707dea90afe625bd4ea0a0a6 100644 --- a/CMake/variants/variants.lhn001 +++ b/CMake/variants/variants.lhn001 @@ -1,3 +1,5 @@ +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + set(CASACORE_ROOT_DIR /opt/cep/casacore) set(CASAREST_ROOT_DIR /opt/cep/casarest) set(DAL_ROOT_DIR /opt/cep/dal/current) diff --git a/CMake/variants/variants.macdiepen b/CMake/variants/variants.macdiepen index 63018fbdc3d0c3a93fd0478938de8d0d2d1f0715..ebfc84d2dda6a51f8ebbfc37e47ee1ac42ffc06e 100644 --- a/CMake/variants/variants.macdiepen +++ b/CMake/variants/variants.macdiepen @@ -1,4 +1,5 @@ # Specific options +option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(USE_BACKTRACE "No backtrace" OFF) option(USE_LOG4CPLUS "log4cxx is used" OFF) option(USE_LOG4CXX "log4cxx is used" OFF) diff --git a/LCS/ApplCommon/include/ApplCommon/CMakeLists.txt b/LCS/ApplCommon/include/ApplCommon/CMakeLists.txt index b301c20b43812d75a86f5437477ae5c4b247d247..573101c6971d27095cc8ea6d642d014aa4b0a7ea 100644 --- a/LCS/ApplCommon/include/ApplCommon/CMakeLists.txt +++ b/LCS/ApplCommon/include/ApplCommon/CMakeLists.txt @@ -6,6 +6,7 @@ set(inst_HEADERS AntennaSets.h LofarDirs.h Observation.h + PosixTime.h StationConfig.h StationDatatypes.h StationInfo.h) diff --git a/LCS/ApplCommon/include/ApplCommon/Observation.h b/LCS/ApplCommon/include/ApplCommon/Observation.h index 4ff478784dc46dbcc97db4f78858c7910c1f6173..1e5f7db02f30b3290846b0ac73ba3ee861319cc5 100644 --- a/LCS/ApplCommon/include/ApplCommon/Observation.h +++ b/LCS/ApplCommon/include/ApplCommon/Observation.h @@ -34,6 +34,7 @@ #include <Common/lofar_vector.h> #include <Common/lofar_string.h> #include <Common/LofarConstants.h> +#include <ctime> namespace LOFAR { diff --git a/LCS/Common/include/Common/lofar_datetime.h b/LCS/ApplCommon/include/ApplCommon/PosixTime.h similarity index 57% rename from LCS/Common/include/Common/lofar_datetime.h rename to LCS/ApplCommon/include/ApplCommon/PosixTime.h index 3ffbb23b654587ebbca1127654e2362466fb00a7..90c6d55b2254ccd46851c823398faa65ae307ad3 100644 --- a/LCS/Common/include/Common/lofar_datetime.h +++ b/LCS/ApplCommon/include/ApplCommon/PosixTime.h @@ -1,6 +1,6 @@ -//# lofar_datetime.h: namespace wrapper for Boost.Date_Time Posix classes +//# PosixTime.h: conversion routines from/to Unix to/from Posix time. //# -//# Copyright (C) 2002 +//# Copyright (C) 2002-2012 //# ASTRON (Netherlands Institute for Radio Astronomy) //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands //# @@ -20,31 +20,26 @@ //# //# $Id$ -#ifndef LOFAR_COMMON_DATETIME_H -#define LOFAR_COMMON_DATETIME_H +#ifndef APPLCOMMON_POSIXTIME_H +#define APPLCOMMON_POSIXTIME_H // \file -// namespace wrapper for Boost.Date_Time Posix classes +// Conversion routines from/to Unix to/from Posix time. -#if !defined(HAVE_BOOST) +#if !defined(HAVE_BOOST_DATE_TIME) #error Boost.Date_Time is required. #endif -#include <boost/date_time/posix_time/posix_time.hpp> +#include <ctime> + +//# Forward declarations +namespace boost { namespace posix_time { class ptime; } } namespace LOFAR { - using namespace boost::posix_time; - - inline time_t to_time_t(ptime aPtime) { - ptime epoch(boost::gregorian::date(1970, 1, 1)); - time_duration diff(aPtime - epoch); - return diff.total_seconds(); - } + time_t to_time_t(boost::posix_time::ptime aPtime); - inline ptime from_ustime_t(double secsEpoch1970) { - return (from_time_t((time_t)trunc(secsEpoch1970)) + microseconds((int64_t)((secsEpoch1970-trunc(secsEpoch1970))*1000000))); - } + boost::posix_time::ptime from_ustime_t(double secsEpoch1970); } #endif diff --git a/LCS/ApplCommon/src/CMakeLists.txt b/LCS/ApplCommon/src/CMakeLists.txt index b5f596ea6096113e02712c01f5d7cfd664f8c43c..ecb6bd4c9e3628e13865c01c5dce78e1e082dbd9 100644 --- a/LCS/ApplCommon/src/CMakeLists.txt +++ b/LCS/ApplCommon/src/CMakeLists.txt @@ -7,6 +7,7 @@ lofar_add_library(applcommon AntField.cc AntennaSets.cc Observation.cc + PosixTime.cc StationConfig.cc StationDatatypes.cc StationInfo.cc) diff --git a/LCS/ApplCommon/src/Observation.cc b/LCS/ApplCommon/src/Observation.cc index 3f33ef36bd2d34a5ed22c66ebe0feacb7a54d5aa..edd8fef0ae84ed2ff2cf62191615e6afcde30bd4 100644 --- a/LCS/ApplCommon/src/Observation.cc +++ b/LCS/ApplCommon/src/Observation.cc @@ -25,7 +25,7 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> +#include <ApplCommon/PosixTime.h> #include <Common/lofar_set.h> #include <Common/lofar_string.h> #include <Common/lofar_vector.h> @@ -35,9 +35,11 @@ #include <ApplCommon/Observation.h> #include <Common/lofar_map.h> +#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/format.hpp> using boost::format; +using namespace boost::posix_time; namespace LOFAR { diff --git a/LCS/ApplCommon/src/PosixTime.cc b/LCS/ApplCommon/src/PosixTime.cc new file mode 100644 index 0000000000000000000000000000000000000000..ef9a540310bf1773014ab53e7c91c93c40daee0a --- /dev/null +++ b/LCS/ApplCommon/src/PosixTime.cc @@ -0,0 +1,46 @@ +//# PosixTime.h: conversion routines from/to Unix to/from Posix time. +//# +//# Copyright (C) 2002-2012 +//# ASTRON (Netherlands Institute for Radio Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands +//# +//# This file is part of the LOFAR software suite. +//# The LOFAR software suite is free software: you can redistribute it and/or +//# modify it under the terms of the GNU General Public License as published +//# by the Free Software Foundation, either version 3 of the License, or +//# (at your option) any later version. +//# +//# The LOFAR software suite is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License along +//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. +//# +//# $Id: PosixTime.h 22959 2012-11-23 11:09:22Z loose $ + +#include <lofar_config.h> +#include <ApplCommon/PosixTime.h> +#include <boost/date_time/posix_time/posix_time.hpp> + +namespace LOFAR +{ + using namespace boost; + + time_t to_time_t(posix_time::ptime aPtime) + { + posix_time::ptime epoch(gregorian::date(1970, 1, 1)); + posix_time::time_duration diff(aPtime - epoch); + return diff.total_seconds(); + } + + posix_time::ptime from_ustime_t(double secsEpoch1970) + { + time_t sec(static_cast<time_t>(secsEpoch1970)); + long usec(static_cast<long>(1000000 * (secsEpoch1970 - sec))); + return posix_time::from_time_t(sec) + posix_time::microseconds(usec); + } + +} + diff --git a/LCS/Common/include/Common/CMakeLists.txt b/LCS/Common/include/Common/CMakeLists.txt index 6ab3bf84263d9683836f751d9e625790b29e18b0..404b806c127824333e27f90a6072058515239907 100644 --- a/LCS/Common/include/Common/CMakeLists.txt +++ b/LCS/Common/include/Common/CMakeLists.txt @@ -30,7 +30,6 @@ install(FILES LofarBitModeInfo.h LofarConstants.h lofar_complex.h - lofar_datetime.h lofar_deque.h lofar_fstream.h lofar_iomanip.h diff --git a/LCS/Stream/CMakeLists.txt b/LCS/Stream/CMakeLists.txt index 028948ec56c37ef7f46f7cf2efe8ff12be418bfe..123c1d6978efd59d434781506cc6097363e62497 100644 --- a/LCS/Stream/CMakeLists.txt +++ b/LCS/Stream/CMakeLists.txt @@ -2,6 +2,9 @@ lofar_package(Stream 0.1 DEPENDS Common) +include(LofarFindPackage) +lofar_find_package(Boost REQUIRED) + add_subdirectory(include/Stream) add_subdirectory(src) add_subdirectory(test) diff --git a/MAC/APL/APLCommon/CMakeLists.txt b/MAC/APL/APLCommon/CMakeLists.txt index 7669476b48c5f1fe66a8881a14ac70bc7421ec08..6186630b3104455c203bb1ece8253aaed5bb1e11 100644 --- a/MAC/APL/APLCommon/CMakeLists.txt +++ b/MAC/APL/APLCommon/CMakeLists.txt @@ -4,6 +4,7 @@ lofar_package(APLCommon 3.1 DEPENDS Common ApplCommon GCFTM MACIO) include(LofarFindPackage) lofar_find_package(Blitz REQUIRED) +lofar_find_package(Boost REQUIRED COMPONENTS date_time) add_definitions(-DBOOST_DISABLE_THREADS) diff --git a/MAC/APL/APLCommon/include/APL/APLCommon/ParentControl.h b/MAC/APL/APLCommon/include/APL/APLCommon/ParentControl.h index 1ddc0da6a14e0144275d7eb5421435d7376a97ba..06cadb000f20d27a0578203e28504c8d586d9507 100644 --- a/MAC/APL/APLCommon/include/APL/APLCommon/ParentControl.h +++ b/MAC/APL/APLCommon/include/APL/APLCommon/ParentControl.h @@ -29,7 +29,6 @@ //# Never #include <config.h> or #include <lofar_config.h> in a header file! //# Includes #include <Common/lofar_string.h> -#include <Common/lofar_datetime.h> #include <Common/lofar_list.h> #include <GCF/TM/GCF_Control.h> #include <GCF/TM/GCF_TCPPort.h> @@ -38,6 +37,8 @@ #include <APL/APLCommon/APL_Defines.h> #include "CTState.h" +#include <boost/date_time/posix_time/posix_time.hpp> + // Avoid 'using namespace' in headerfiles namespace LOFAR { @@ -50,6 +51,8 @@ namespace LOFAR { using APLCommon::CTState; namespace APLCommon { +using boost::posix_time::ptime; + // \addtogroup APLCommon // @{ diff --git a/MAC/APL/APLCommon/src/ParentControl.cc b/MAC/APL/APLCommon/src/ParentControl.cc index 538726e7f495a9f0f9b0248b2e3d2c061f7f1619..9c9474299629a218623bb0b72d469d97954fc6a2 100644 --- a/MAC/APL/APLCommon/src/ParentControl.cc +++ b/MAC/APL/APLCommon/src/ParentControl.cc @@ -37,6 +37,7 @@ namespace LOFAR { using namespace GCF::TM; + using namespace boost::posix_time; namespace APLCommon { typedef struct stateFlow_t { diff --git a/MAC/APL/APLCommon/src/swlevel.conf b/MAC/APL/APLCommon/src/swlevel.conf index 5ffd797cad27a3737f2f25e0b085ce30e300b456..48ee9d1b738d2853d2880ac4d660afe5c0f6a54f 100644 --- a/MAC/APL/APLCommon/src/swlevel.conf +++ b/MAC/APL/APLCommon/src/swlevel.conf @@ -10,7 +10,8 @@ #1:u:d:::LogClient 1:u:d:::CEPlogProcessor 1:u:d:::ServiceBroker -#1:u:d:::SASGateway +1:u:d:::SoftwareMonitor +1:u:d:::SASGateway 1:u:d:::ACDaemon # 2:u:d:r::_EPAStub diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc index e2a9fbc7d22e61a68fa7283a3b6c4a61844a5c96..64b50993a527ac17702aae0049bab4a7f29b0241 100644 --- a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc +++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc @@ -36,54 +36,49 @@ using namespace LOFAR::CEPCU; int main(int argc, char* argv[]) { - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, "CEPHardwareMonitor"); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, "CEPHardwareMonitor"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor"); - LOG_INFO(Version::getInfo<CEPCUVersion>("CEPHardwareMonitor")); + LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor"); + LOG_INFO(Version::getInfo<CEPCUVersion>("CEPHardwareMonitor")); - // Create tasks and call initial routines - BlueGeneMonitor* bgm(0); - ClusterMonitor* ctm(0); - - // monitor BLUEGENE? - if (globalParameterSet()->getUint32("WatchBlueGene",0)) { - bgm = new BlueGeneMonitor("BlueGeneMonitor"); - bgm->start(); - LOG_INFO("Monitoring the BlueGene"); - } + // Create tasks and call initial routines + BlueGeneMonitor* bgm(0); + ClusterMonitor* ctm(0); + + // monitor BLUEGENE? + if (globalParameterSet()->getUint32("WatchBlueGene",0)) { + bgm = new BlueGeneMonitor("BlueGeneMonitor"); + bgm->start(); + LOG_INFO("Monitoring the BlueGene"); + } - // monitor CEP2Cluster? - if (globalParameterSet()->getUint32("WatchCluster",0)) { - ctm = new ClusterMonitor("ClusterMonitor"); - ctm->start(); - LOG_INFO("Monitoring the Cluster"); - } + // monitor CEP2Cluster? + if (globalParameterSet()->getUint32("WatchCluster",0)) { + ctm = new ClusterMonitor("ClusterMonitor"); + ctm->start(); + LOG_INFO("Monitoring the Cluster"); + } - // sanity check - if (!bgm && !ctm) { - LOG_FATAL_STR("Non of the monitortask (WatchBlueGene, WatchCluster) " - "was switched on in the configfile, terminating program"); - return (0); - } + // sanity check + if (!bgm && !ctm) { + LOG_FATAL_STR("Non of the monitortask (WatchBlueGene, WatchCluster) " + "was switched on in the configfile, terminating program"); + return (0); + } - // ok, we have something to do, do it. - GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown - GCFScheduler::instance()->run(); // until stop was called + // ok, we have something to do, do it. + GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown + GCFScheduler::instance()->run(); // until stop was called - if (bgm) { - bgm->quit(); // let task quit nicely - } - if (ctm) { - ctm->quit(); // let task quit nicely - } - double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); - GCFScheduler::instance()->run(postRunTime); // let processes die. - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; + if (bgm) { + bgm->quit(); // let task quit nicely + } + if (ctm) { + ctm->quit(); // let task quit nicely } + double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); + GCFScheduler::instance()->run(postRunTime); // let processes die. return (0); } diff --git a/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc b/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc index 146070a681404d3e1aa9a20039926418214f1dec..79d6d55cfa8b21488b43576deadea44cc8d2baea 100644 --- a/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc +++ b/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc @@ -49,11 +49,15 @@ int main (int argc, char* argv[]) loggerTask.start(); // make initial transition GCFScheduler::instance()->run(); + + LOG_INFO_STR("Shutting down: " << argv[0]); } catch (LOFAR::Exception& ex) { LOG_FATAL_STR("Caught exception: " << ex); + LOG_FATAL ("Terminated by exception!"); return (1); } + LOG_INFO("Terminated normally"); return (0); } diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc index 6eaaed5618060f2f38d7b8d84b3e4794321de319..8da5578db85ed3e87acd999ab7a5bdfe80b23d1f 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc @@ -50,6 +50,7 @@ using namespace LOFAR::GCF::PVSS; using namespace LOFAR::GCF::TM; using namespace LOFAR::GCF::RTDB; using namespace std; +using namespace boost::posix_time; namespace LOFAR { using namespace APLCommon; @@ -614,7 +615,7 @@ GCFEvent::TResult OnlineControl::finishing_state(GCFEvent& event, GCFPortInterfa int32 result = system (startCmd.c_str()); LOG_INFO_STR ("Result of command = " << result); - itsTimerPort->setTimer(302.0); // IONProc, and thus CEPlogProcessor, can take up to 5 minutes to wrap up + itsTimerPort->setTimer(2.0); break; } diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h index 09e695da178ecd507c4aea046f97d215ec09545e..9a0b674f790cf5445e2f812c6e9dc9c08d7366c2 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h @@ -26,7 +26,6 @@ //# Common Includes #include <Common/lofar_string.h> #include <Common/lofar_vector.h> -#include <Common/lofar_datetime.h> #include <Common/LofarLogger.h> //# ACC Includes @@ -43,6 +42,8 @@ #include <CEPApplMgr.h> +#include <boost/date_time/posix_time/posix_time.hpp> + // forward declaration namespace LOFAR { @@ -56,7 +57,7 @@ using GCF::TM::GCFPortInterface; using GCF::TM::GCFTask; using GCF::RTDB::RTDBPropertySet; using APLCommon::ParentControl; - +using boost::posix_time::ptime; class OnlineControl : public GCFTask, public CEPApplMgrInterface diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc index a1daffe7a2df34771e53c0ce7385552c3a9f6403..1a0dadbfb119ca7d17b1862b81eb7be052a8122b 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc @@ -42,20 +42,15 @@ int main(int argc, char* argv[]) return(-1); } - try { - GCFScheduler::instance()->init(argc, argv, argv[1]); + GCFScheduler::instance()->init(argc, argv, argv[1]); - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition - OnlineControl olc(argv[1]); - olc.start(); // make initial transition + OnlineControl olc(argv[1]); + olc.start(); // make initial transition - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->run(); return (0); } diff --git a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc index 60cdd0b0f9490d54a624a18df6ca438c0e1e1e7e..9fa935bd723bc8ab05211317dd12e71ebacb2340 100644 --- a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc +++ b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc @@ -50,7 +50,10 @@ #include "PythonControl.h" #include "PVSSDatapointDefs.h" +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace std; +using namespace boost::posix_time; namespace LOFAR { using namespace APLCommon; diff --git a/MAC/APL/CEPCU/src/PythonControl/PythonControl.h b/MAC/APL/CEPCU/src/PythonControl/PythonControl.h index f07c3fce92ca6cdaf85dc8e07e3971572468addb..a28d4309a6980cb8476ef36a2e80ff56083a0331 100644 --- a/MAC/APL/CEPCU/src/PythonControl/PythonControl.h +++ b/MAC/APL/CEPCU/src/PythonControl/PythonControl.h @@ -26,7 +26,6 @@ //# Common Includes #include <Common/lofar_string.h> #include <Common/lofar_vector.h> -#include <Common/lofar_datetime.h> #include <Common/LofarLogger.h> //# ACC Includes diff --git a/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc b/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc index 3ee05cbb8fdf0fc1c96ddf69190c729761d091c5..a9ff9f09e88a9be79c372158d32099135c2e48e7 100644 --- a/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc +++ b/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) } try { - GCFScheduler::instance()->init(argc, argv, "PythonControl"); + GCFScheduler::instance()->init(argc, argv, argv[1]); ParentControl* pc = ParentControl::instance(); pc->start(); // make initial transition diff --git a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.cc b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.cc index 3f09b4c7612d4a9aacb689ef4347ef7bdfd02b7a..2a624c31c01c6821fc8f276cf96a711d007ca636 100644 --- a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.cc +++ b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.cc @@ -25,6 +25,7 @@ #include <boost/shared_array.hpp> #include <Common/ParameterSet.h> #include <Common/Exceptions.h> +#include <ApplCommon/PosixTime.h> #include <GCF/GCF_PVTypes.h> #include <GCF/PAL/GCF_PVSSInfo.h> #include <GCF/Utils.h> diff --git a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.h b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.h index 85d4a2bbaa69e9ede57178f8c2ba9217514c2d6c..1a5ce55f7d36a726bf127c123d1a9c60295f790f 100644 --- a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.h +++ b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControl.h @@ -26,7 +26,6 @@ //# Common Includes #include <Common/lofar_string.h> #include <Common/lofar_vector.h> -#include <Common/lofar_datetime.h> #include <Common/LofarLogger.h> //# ACC Includes diff --git a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc index 48941455ee2b756ad49f5ffc744ee1597eb90a65..f827d1fedfbff9aef19b27e08e6fe62e95fb27cb 100644 --- a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc +++ b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc @@ -38,21 +38,15 @@ int main(int argc, char* argv[]) printf("%s usage: %s <controller name>\n",argv[0],argv[0]); exit(-1); } + GCFTask::init(argc, argv); - try { - GCFTask::init(argc, argv); + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition + OfflineControl ofc(argv[1]); + ofc.start(); // make initial transition - OfflineControl ofc(argv[1]); - ofc.start(); // make initial transition - - GCFTask::run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFTask::run(); return 0; } diff --git a/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc b/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc index 48b47c13aedc3b642327af449300352cf318983b..d78c0e9c4784d7c5a2554f017e6ccfd2a60fde8b 100644 --- a/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc +++ b/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc @@ -35,20 +35,15 @@ int main(int argc, char* argv[]) { // signal (SIGCHLD, SIG_IGN); - try { - GCFScheduler::instance()->init(argc, argv, "CTStartDaemon"); + GCFScheduler::instance()->init(argc, argv, "CTStartDaemon"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_CTStartDaemon"); + LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_CTStartDaemon"); - CUDaemons::CTStartDaemon sd("StartDaemon"); // give myself a name + CUDaemons::CTStartDaemon sd("StartDaemon"); // give myself a name - sd.start(); // make initial transition + sd.start(); // make initial transition - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc b/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc index fa9848e6985357e178cb252c9cd6d24f57697081..cc23478288b343a04a449c0f6131eeba52bdf26b 100644 --- a/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc +++ b/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc @@ -36,20 +36,15 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char *argv[]) { - try { - GCFScheduler::instance()->init(argc, argv, "ServiceBroker"); - - LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_ServiceBroker"); + GCFScheduler::instance()->init(argc, argv, "ServiceBroker"); + + LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_ServiceBroker"); - ServiceBroker sb; - - sb.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + ServiceBroker sb; + + sb.start(); // make initial transition + + GCFScheduler::instance()->run(); - return 0; + return 0; } diff --git a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc index 3ed26dc0fc9d20885f667f80e171003480dda02a..96337bed91b4bc585ff4880ea69685eac0795795 100644 --- a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc +++ b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc @@ -21,7 +21,7 @@ //# $Id$ #include <lofar_config.h> -#include <Common/lofar_datetime.h> +#include <ApplCommon/PosixTime.h> #include <Common/LofarLogger.h> #include <Common/Version.h> #include <Common/ParameterSet.h> @@ -36,6 +36,7 @@ #include <OTDB/TreeValue.h> #include "KeyValueLogger.h" #include <CURTDBDaemons/Package__Version.h> +#include <boost/date_time/posix_time/posix_time.hpp> namespace LOFAR { using namespace MACIO; @@ -46,6 +47,8 @@ namespace LOFAR { using namespace RTDB; namespace RTDBDaemons { +using namespace boost::posix_time; + // // CodeloggingProcessor() // diff --git a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc index 10e89211e210afbd86b76e38289219758c586494..bfb6138b975dd939d9e8e3cb7cd5b02b6bec2bb0 100644 --- a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc +++ b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc @@ -35,18 +35,13 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char *argv[]) { - try { - GCFScheduler::instance()->init(argc, argv, "KeyValueLogger"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_KVLogger"); - - KeyValueLogger kvl("KeyValueLogger"); - kvl.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->init(argc, argv, "KeyValueLogger"); + LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_KVLogger"); + + KeyValueLogger kvl("KeyValueLogger"); + kvl.start(); // make initial transition + + GCFScheduler::instance()->run(); return (0); } diff --git a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc index 9b4132e8c3b68ceec69a7e7867ea99796c836ba8..65cd3c3ceddb4333eda0613478c95cc015df3471 100644 --- a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc +++ b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc @@ -35,18 +35,13 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char *argv[]) { - try { - GCFScheduler::instance()->init(argc, argv, "LogProcessor"); - // LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_LogProcessor"); - - LogProcessor clp("LogProcessor"); - clp.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->init(argc, argv, "LogProcessor"); +// LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_LogProcessor"); + + LogProcessor clp("LogProcessor"); + clp.start(); // make initial transition + + GCFScheduler::instance()->run(); return (0); } diff --git a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc index e5d22c19c22182a988e43de45c2b42bc596f4cb9..ef752bda6579d54f8c40247c58dd17ceeb3ff0d5 100644 --- a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc +++ b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc @@ -36,6 +36,7 @@ #include <OTDB/TreeValue.h> #include "SASGateway.h" #include <CURTDBDaemons/Package__Version.h> +#include <boost/date_time/posix_time/posix_time.hpp> namespace LOFAR { using namespace MACIO; @@ -46,6 +47,8 @@ namespace LOFAR { using namespace RTDB; namespace RTDBDaemons { +using namespace boost::posix_time; + // // SASGateway() // diff --git a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc index d265a8f6b058d41f18639a9a2a82fe8c4189fd35..e7c3000739a1cd3acc7befd7d4740cca83226a40 100644 --- a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc +++ b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc @@ -35,18 +35,13 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char *argv[]) { - try { - GCFScheduler::instance()->init(argc, argv, "SASGateway"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_SASGateway"); - - SASGateway SGW("SASGateway"); - SGW.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->init(argc, argv, "SASGateway"); + LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_SASGateway"); + + SASGateway SGW("SASGateway"); + SGW.start(); // make initial transition + + GCFScheduler::instance()->run(); return (0); } diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc index fe578f42de9fbb06606e0b87893c5cbd4a38a88f..a1c9969cd39aefcf263acc2452843d0a418c049a 100644 --- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc +++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc @@ -40,33 +40,28 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, "SoftwareMonitor"); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, "SoftwareMonitor"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_SoftwareMonitor"); - LOG_INFO(Version::getInfo<CURTDBDaemonsVersion>("SoftwareMonitor")); + LOG_INFO("MACProcessScope: LOFAR_PermSW_SoftwareMonitor"); + LOG_INFO(Version::getInfo<CURTDBDaemonsVersion>("SoftwareMonitor")); - // for debugging purposes - registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); + // for debugging purposes + registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); - // Create tasks and call initial routines - SoftwareMonitor* swm = new SoftwareMonitor("SoftwareMonitor"); - ASSERTSTR(swm, "Can't create an software monitortask"); - swm->start(); + // Create tasks and call initial routines + SoftwareMonitor* swm = new SoftwareMonitor("SoftwareMonitor"); + ASSERTSTR(swm, "Can't create an software monitortask"); + swm->start(); - // ok, we have something to do, do it. - GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown - GCFScheduler::instance()->run(); // until stop was called + // ok, we have something to do, do it. + GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown + GCFScheduler::instance()->run(); // until stop was called - swm->quit(); // let task quit nicely + swm->quit(); // let task quit nicely - double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); - GCFScheduler::instance()->run(postRunTime); // let processes die. - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); + GCFScheduler::instance()->run(postRunTime); // let processes die. return (0); } diff --git a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc index c3b12b9db1808233973140ad54981c1e26e7ea4d..13e674d03b55176e431946c95b17bd1d95eb40cf 100644 --- a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc +++ b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc @@ -34,6 +34,7 @@ #include <ApplCommon/LofarDirs.h> #include <ApplCommon/StationInfo.h> #include <ApplCommon/Observation.h> +#include <ApplCommon/PosixTime.h> #include <MACIO/MACServiceInfo.h> #include <GCF/PVSS/GCF_PVTypes.h> @@ -49,10 +50,12 @@ #include "TriggerControl.h" #include "PVSSDatapointDefs.h" +#include <boost/date_time/posix_time/posix_time.hpp> using namespace LOFAR::GCF::TM; using namespace LOFAR::GCF::PVSS; using namespace LOFAR::GCF::RTDB; +using namespace boost::posix_time; using namespace std; using namespace LOFAR::StringUtil; diff --git a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.h b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.h index ec99d33d702008432db9fd9b1a27ee77e85bbbc0..1b45866c32587cb4a0d327a2416a42e1f942db74 100644 --- a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.h +++ b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.h @@ -26,7 +26,6 @@ //# Common Includes #include <Common/LofarLogger.h> #include <Common/lofar_string.h> -#include <Common/lofar_datetime.h> //# GCF Includes #include <MACIO/GCF_Event.h> @@ -35,6 +34,8 @@ #include <GCF/RTDB/GCF_RTDBPort.h> #include <GCF/RTDB/DPservice.h> +#include <boost/date_time/posix_time/posix_time.hpp> + // forward declaration namespace LOFAR { @@ -48,6 +49,8 @@ namespace LOFAR { using GCF::RTDB::GCFRTDBPort; namespace MainCU { +using boost::posix_time::ptime; + class TriggerControl : public GCFTask { public: diff --git a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc index 19e80f6cc378bf4bec08c7f130f9853cacff9cc0..7fd6086d47c292ecdd95fd09da16a1cee8d4df23 100644 --- a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc +++ b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc @@ -35,18 +35,14 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - // args: cntlrname - GCFScheduler::instance()->init(argc, argv, argv[0]); - - TriggerControl tc(argv[0]); - tc.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + + // args: cntlrname + GCFScheduler::instance()->init(argc, argv, argv[0]); + + TriggerControl tc(argv[0]); + tc.start(); // make initial transition + + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc index 639fc98adb5a8d199609969d8bfdcc580173b64a..f0311610aa37e54666afa660000e5090c23c1455 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc +++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc @@ -41,10 +41,13 @@ #include "PVSSDatapointDefs.h" #include <MainCU/Package__Version.h> +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace LOFAR::GCF::PVSS; using namespace LOFAR::GCF::TM; using namespace LOFAR::GCF::RTDB; using namespace LOFAR::OTDB; +using namespace boost::posix_time; using namespace std; namespace LOFAR { diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.h b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.h index 280f13b64f6947a4449696d3297c88ae9deed77c..d45b6280b397e95fefae5e66a0ad91454acc0ad1 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.h +++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.h @@ -48,6 +48,8 @@ #include "ObsClaimer.h" +#include <boost/date_time/posix_time/posix_time.hpp> + // forward declaration namespace LOFAR { @@ -61,6 +63,8 @@ namespace LOFAR { using APLCommon::ChildControl; namespace MainCU { +using boost::posix_time::ptime; +using boost::posix_time::min_date_time; class MACScheduler : public GCFTask { diff --git a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc index d03e2036e340e3bc829865fa96bf144bf1a8fa7e..5f6b5ab611740cd6d905fcf605ffe06a88305c9b 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc +++ b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc @@ -36,20 +36,15 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - GCFScheduler::instance()->init(argc, argv, "MACScheduler"); - - ChildControl* cc = ChildControl::instance(); - cc->start(); // make initial transition - - MACScheduler ms; - ms.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->init(argc, argv, "MACScheduler"); + + ChildControl* cc = ChildControl::instance(); + cc->start(); // make initial transition + + MACScheduler ms; + ms.start(); // make initial transition + + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc index 9cede9a2715854810a00ad25a68bc07a6624eaec..8c36a9e70d185ef5f5b9697b451fe17ac611ea23 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc @@ -27,6 +27,7 @@ #include <Common/SystemUtil.h> #include <ApplCommon/StationInfo.h> #include <ApplCommon/LofarDirs.h> +#include <ApplCommon/PosixTime.h> #include <MACIO/MACServiceInfo.h> #include <APL/APLCommon/APL_Defines.h> @@ -42,6 +43,9 @@ #include "PVSSDatapointDefs.h" #include <MainCU/Package__Version.h> +#include <boost/date_time/posix_time/posix_time.hpp> + +using namespace boost::posix_time; namespace LOFAR { using namespace APLCommon; diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h index 93ce5299b9bec3f8b4a0b6f57f438213b30a4e0a..c9c2c56a2bdfe55bf76054256f41eea784a256dd 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h @@ -42,11 +42,12 @@ #include <Common/lofar_string.h> #include <Common/lofar_vector.h> #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> //# ACC Includes #include <Common/ParameterSet.h> +#include <boost/date_time/posix_time/posix_time.hpp> + // forward declaration namespace LOFAR { @@ -64,6 +65,8 @@ namespace LOFAR { using APLCommon::CTState; namespace MainCU { +using boost::posix_time::ptime; + class ObservationControl : public GCFTask { public: diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc index e3ed26971c012aaae0dc4df06a50dd57a39871dd..7c52a1dce68ffbf319b2daf6e4837b9f902396f3 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc @@ -36,24 +36,19 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, argv[1]); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, argv[1]); - ChildControl* cc = ChildControl::instance(); - cc->start(); // make initial transition + ChildControl* cc = ChildControl::instance(); + cc->start(); // make initial transition - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition - ObservationControl oc(argv[1]); - oc.start(); // make initial transition + ObservationControl oc(argv[1]); + oc.start(); // make initial transition - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/PAC/IBS_Protocol/CMakeLists.txt b/MAC/APL/PAC/IBS_Protocol/CMakeLists.txt index 585054ed8cd5861bece37dbf51ad0496034bc07c..e768a7a1adfbf4949dcd2b97db9fbb9e897f7e95 100644 --- a/MAC/APL/PAC/IBS_Protocol/CMakeLists.txt +++ b/MAC/APL/PAC/IBS_Protocol/CMakeLists.txt @@ -20,6 +20,9 @@ lofar_package(IBS_Protocol 1.0 DEPENDS Common MACIO RTCCommon RSP_Protocol) +include(LofarFindPackage) +lofar_find_package(Boost REQUIRED) + add_subdirectory(include/APL/IBS_Protocol) add_subdirectory(src) #add_subdirectory(test) diff --git a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc index 3a5fc4a405f36658b878e987bb3c236fc6ed2541..362a1491c092ffed4118ffa87768350fcaec4ad4 100644 --- a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc +++ b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc @@ -1251,7 +1251,7 @@ void SICommand::send() request.settings()(0).setXSI(m_siOn); request.settings()(0).setYSI(m_siOn); - logMessage(cout,formatString("bypassSetting =%02X", request.settings()(0).getAsUint8())); + logMessage(cout,formatString("bypassSetting =%02X", request.settings()(0).getAsUint16())); m_rspport.send(request); } diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h index f1dd042faf3b51b3594a4ab861daa0a30b769d4d..c8811409b9b142a42a2f16a7ec2366d3817a1340 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h @@ -56,7 +56,7 @@ public: void setYSI(bool on) { bypass.siy_enable = on ? 1 : 0; } bool getXSI() const { return (bypass.six_enable); } bool getYSI() const { return (bypass.siy_enable); } - uint8 getAsUint8() const { return *reinterpret_cast<const uint8*>(&bypass); } // Yak + uint16 getAsUint16() const { return (*((uint16*) &bypass)); } // Yak DIAGBypass getRaw() const { return (bypass); } void setRaw(const DIAGBypass newBypass) { bypass = newBypass; } private: diff --git a/MAC/APL/StationCU/CMakeLists.txt b/MAC/APL/StationCU/CMakeLists.txt index e33cd2f466a86670ea65e6c9734013ef8d4802f4..349378323fbd919b378db84129c65cc9897799df 100644 --- a/MAC/APL/StationCU/CMakeLists.txt +++ b/MAC/APL/StationCU/CMakeLists.txt @@ -8,6 +8,7 @@ IBS_Protocol CAL_Protocol RSP_Protocol TBB_Protocol VHECR CR_Protocol) include(LofarFindPackage) lofar_find_package(Blitz REQUIRED) +lofar_find_package(Boost REQUIRED date_time) add_subdirectory(include/APL/ClockProtocol) add_subdirectory(src) diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc index e12b87698223b87085be122a0f8aafeafa655a0f..cc7235dc47f23ef00d2aa6348ccdadb0954c912b 100644 --- a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc +++ b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc @@ -44,10 +44,13 @@ #include "PVSSDatapointDefs.h" #include <StationCU/Package__Version.h> +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace LOFAR::GCF::TM; using namespace LOFAR::GCF::PVSS; using namespace LOFAR::GCF::RTDB; using namespace LOFAR::APL::RTDBCommon; +using namespace boost::posix_time; using namespace std; namespace LOFAR { diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControl.h b/MAC/APL/StationCU/src/BeamControl/BeamControl.h index 5909b4e6366875563433b55d6cb86a94ee17de3d..2e8ab10378b0a725d8b0e5dc1f2634b6d0b00f8e 100644 --- a/MAC/APL/StationCU/src/BeamControl/BeamControl.h +++ b/MAC/APL/StationCU/src/BeamControl/BeamControl.h @@ -25,7 +25,6 @@ //# Common Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <Common/lofar_set.h> #include <Common/lofar_string.h> #include <Common/ParameterSet.h> diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc b/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc index b42ebef64418622035cabf50fe041321077be0b0..b6eab6f10ce6c4614fec117fd03e0d1546945448 100644 --- a/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc +++ b/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc @@ -34,21 +34,16 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, argv[1]); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, argv[1]); - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition - BeamControl bc(argv[1]); - bc.start(); // make initial transition + BeamControl bc(argv[1]); + bc.start(); // make initial transition - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc index de7558ab56baa62fe1eba0c0c7d2f01bd0e8a3c0..fe1d2cb3e3022d1e3ea700144bdef7fb5ece0feb 100644 --- a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc +++ b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc @@ -21,7 +21,6 @@ //# $Id$ #include <lofar_config.h> #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <Common/Version.h> #include <ApplCommon/LofarDirs.h> #include <ApplCommon/StationConfig.h> @@ -40,10 +39,13 @@ #include "PVSSDatapointDefs.h" #include <StationCU/Package__Version.h> +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace LOFAR::GCF::TM; using namespace LOFAR::GCF::PVSS; using namespace LOFAR::GCF::RTDB; using namespace LOFAR::APL::RTDBCommon; +using namespace boost::posix_time; namespace LOFAR { using namespace APLCommon; diff --git a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc index 3fb2dac4b0b3b0f31a3a9fc7a89c3e373818c4ea..d6f05db5fba6edbc54b9fd47394b87275b09edf7 100644 --- a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc +++ b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc @@ -34,21 +34,16 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, argv[1]); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, argv[1]); - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition - CalibrationControl cc(argv[1]); - cc.start(); // make initial transition + CalibrationControl cc(argv[1]); + cc.start(); // make initial transition - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc b/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc index 6e3105283f9bac999db0f5e8e6e064aa86dffd3a..23e3a6158a5e16f9e97c05c35a80e2b56f708055 100644 --- a/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc +++ b/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc @@ -39,21 +39,16 @@ int main(int argc, char* argv[]) return (1); } - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, "ClockControl"); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, "ClockControl"); - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition - ClockControl cc(argv[1]); - cc.start(); // make initial transition + ClockControl cc(argv[1]); + cc.start(); // make initial transition - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc index f2934a228ad9991a50d0eb34f628c8b132664392..344af412a745a6eeb81d9d5be86aa2d25381f5c6 100644 --- a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc +++ b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc @@ -24,7 +24,6 @@ #include <Common/ParameterSet.h> #include <Common/LofarLogger.h> #include <Common/LofarConstants.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <Common/hexdump.h> diff --git a/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc b/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc index 281322d4a6f98718a6e6cd639e695b2a87878732..f671ca5b3a421f529ff1bbb7034bdcf2c5824f7d 100644 --- a/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc +++ b/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc @@ -42,70 +42,65 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, "HardwareMonitor"); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, "HardwareMonitor"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor"); - LOG_INFO(Version::getInfo<StationCUVersion>("HardwareMonitor")); + LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor"); + LOG_INFO(Version::getInfo<StationCUVersion>("HardwareMonitor")); - // for debugging purposes - registerProtocol (RSP_PROTOCOL, RSP_PROTOCOL_STRINGS); - registerProtocol (TBB_PROTOCOL, TBB_PROTOCOL_STRINGS); - registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); + // for debugging purposes + registerProtocol (RSP_PROTOCOL, RSP_PROTOCOL_STRINGS); + registerProtocol (TBB_PROTOCOL, TBB_PROTOCOL_STRINGS); + registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); - // Create tasks and call initial routines - RSPMonitor* rsp(0); - TBBMonitor* tbb(0); - ECMonitor* ec(0); - - // monitor RSP? - if (globalParameterSet()->getUint32("WatchRSPboards",0)) { - rsp = new RSPMonitor("RSPMonitor"); - rsp->start(); - LOG_INFO("Monitoring the RSP boards"); - } + // Create tasks and call initial routines + RSPMonitor* rsp(0); + TBBMonitor* tbb(0); + ECMonitor* ec(0); + + // monitor RSP? + if (globalParameterSet()->getUint32("WatchRSPboards",0)) { + rsp = new RSPMonitor("RSPMonitor"); + rsp->start(); + LOG_INFO("Monitoring the RSP boards"); + } - // monitor TBB? - if (globalParameterSet()->getUint32("WatchTBboards",0)) { - tbb = new TBBMonitor("TBBMonitor"); - tbb->start(); - LOG_INFO("Monitoring the TB boards"); - } + // monitor TBB? + if (globalParameterSet()->getUint32("WatchTBboards",0)) { + tbb = new TBBMonitor("TBBMonitor"); + tbb->start(); + LOG_INFO("Monitoring the TB boards"); + } - // monitor EC? - if (globalParameterSet()->getUint32("WatchEnvCntrl",0)) { - ec = new ECMonitor("ECMonitor"); - ec->start(); - LOG_INFO("Monitoring the Environment Controller"); - } + // monitor EC? + if (globalParameterSet()->getUint32("WatchEnvCntrl",0)) { + ec = new ECMonitor("ECMonitor"); + ec->start(); + LOG_INFO("Monitoring the Environment Controller"); + } - // sanity check - if (!tbb && !rsp && !ec) { - LOG_FATAL_STR("Non of the monitortask (WatchRSPboards, WatchTBboards, WatchEnvCntrl) " - "was switched on in the configfile, terminating program"); - return (0); - } + // sanity check + if (!tbb && !rsp && !ec) { + LOG_FATAL_STR("Non of the monitortask (WatchRSPboards, WatchTBboards, WatchEnvCntrl) " + "was switched on in the configfile, terminating program"); + return (0); + } - // ok, we have something to do, do it. - GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown - GCFScheduler::instance()->run(); // until stop was called + // ok, we have something to do, do it. + GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown + GCFScheduler::instance()->run(); // until stop was called - if (rsp) { - rsp->quit(); // let task quit nicely - } - if (tbb) { - tbb->quit(); // let task quit nicely - } - if (ec) { - ec->quit(); // let task quit nicely - } - double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); - GCFScheduler::instance()->run(postRunTime); // let processes die. - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; + if (rsp) { + rsp->quit(); // let task quit nicely + } + if (tbb) { + tbb->quit(); // let task quit nicely + } + if (ec) { + ec->quit(); // let task quit nicely } + double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); + GCFScheduler::instance()->run(postRunTime); // let processes die. return (0); } diff --git a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc index 6e625f85a5f9f9025eaf4d7db426d3ff95a663f3..e6ecabf756501d1d96282a0b857cf9f2756ddd5f 100644 --- a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc +++ b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc @@ -22,7 +22,6 @@ #include <lofar_config.h> #include <Common/LofarLogger.h> #include <Common/LofarConstants.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <GCF/PVSS/GCF_PVTypes.h> @@ -39,6 +38,9 @@ #include "RCUConstants.h" #include "PVSSDatapointDefs.h" +#include <boost/date_time/posix_time/posix_time.hpp> + +using namespace boost::posix_time; namespace LOFAR { using namespace GCF::TM; diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.cc b/MAC/APL/StationCU/src/StationControl/StationControl.cc index 798f6c779acd78e76d1b23b3d576350a35d52f2f..1277b8e67c0199aed60185698d8a363b4a780554 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControl.cc +++ b/MAC/APL/StationCU/src/StationControl/StationControl.cc @@ -34,6 +34,7 @@ #include <ApplCommon/StationConfig.h> #include <ApplCommon/StationInfo.h> #include <ApplCommon/AntennaSets.h> +//#include <ApplCommon/PosixTime.h> #include <Common/ParameterSet.h> #include <GCF/PVSS/GCF_PVTypes.h> @@ -54,10 +55,13 @@ #include "Clock_Protocol.ph" #include <StationCU/Package__Version.h> +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace LOFAR::GCF::TM; using namespace LOFAR::GCF::PVSS; using namespace LOFAR::GCF::RTDB; using namespace LOFAR::APL::RTDBCommon; +using namespace boost::posix_time; using namespace std; namespace LOFAR { @@ -848,7 +852,6 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor LOG_INFO_STR("new observation also uses clock " << itsClock); itsTimerPort->setTimer(0.0); } - break; } case 1: { @@ -867,7 +870,6 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor CLKCTRLSetSplittersEvent setEvent; setEvent.splittersOn = splitterState; itsClkCtrlPort->send(setEvent); // will result in CLKCTRL_SET_SPLITTERS_ACK - break; } case 2: { @@ -899,7 +901,6 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor LOG_INFO_STR("new observation also uses bitmode " << itsBitmode); itsTimerPort->setTimer(0.0); } - break; } default: { @@ -911,7 +912,6 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor LOG_INFO("Going back to operational state"); itsStartingObs = itsObsMap.end(); TRAN(StationControl::operational_state); - break; } } } diff --git a/MAC/APL/StationCU/src/StationControl/StationControlMain.cc b/MAC/APL/StationCU/src/StationControl/StationControlMain.cc index f199efe9479233092cfcf823b57fe4c4c92dde7f..38ff113ea9e627c501b9ae2e5eaa6a946e4f8969 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControlMain.cc +++ b/MAC/APL/StationCU/src/StationControl/StationControlMain.cc @@ -37,31 +37,26 @@ int main(int argc, char* argv[]) { using LOFAR::basename; - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, basename(argv[0])); + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, basename(argv[0])); - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition - ChildControl* cc = ChildControl::instance(); - cc->start(); // make initial transition + ChildControl* cc = ChildControl::instance(); + cc->start(); // make initial transition - string myName; - if (argc < 2) { // started by swlevel? - myName = myHostname(false) + ":" + basename(argv[0]); - } - else { - myName = argv[1]; - } - StationControl sc(myName.c_str()); - sc.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; + string myName; + if (argc < 2) { // started by swlevel? + myName = myHostname(false) + ":" + basename(argv[0]); + } + else { + myName = argv[1]; } + StationControl sc(myName.c_str()); + sc.start(); // make initial transition + + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/StationCU/src/TBBControl/TBBControl.cc b/MAC/APL/StationCU/src/TBBControl/TBBControl.cc index e5c517cbdd45ef26fd3fa8d9c0a278997f60737f..14a33bb0c7f105f14dfd22026fd964120edaf447 100644 --- a/MAC/APL/StationCU/src/TBBControl/TBBControl.cc +++ b/MAC/APL/StationCU/src/TBBControl/TBBControl.cc @@ -55,7 +55,11 @@ #include "PVSSDatapointDefs.h" #include "TBBObservation.h" +#include <boost/date_time/posix_time/posix_time.hpp> + +using namespace boost::posix_time; using namespace std; + namespace LOFAR { using namespace GCF::TM; using namespace GCF::PVSS; diff --git a/MAC/APL/StationCU/src/TBBControl/TBBControl.h b/MAC/APL/StationCU/src/TBBControl/TBBControl.h index f3442526106131bfcc338c05766c1c8e2a1ffb8c..3a1c2b73f5558acc8c01f72df57e1e5ce3baa144 100644 --- a/MAC/APL/StationCU/src/TBBControl/TBBControl.h +++ b/MAC/APL/StationCU/src/TBBControl/TBBControl.h @@ -26,7 +26,6 @@ //# Common Includes #include <Common/LofarLogger.h> #include <Common/lofar_string.h> -#include <Common/lofar_datetime.h> #include <APL/APLCommon/AntennaField.h> //# ACC Includes diff --git a/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc b/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc index 162fcef5388c449a8a4ae84f592825620fd1a589..8b99850b0e7775ca5bca42d05dc256d5cc65d467 100644 --- a/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc +++ b/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc @@ -34,22 +34,17 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - try { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, argv[0]); - GCFScheduler::instance()->disableQueue(); // run as fast as possible - - ParentControl* pc = ParentControl::instance(); - pc->start(); // make initial transition - - TBBControl tc(argv[1]); - tc.start(); // make initial transition - - GCFScheduler::instance()->run(); - } catch( Exception &ex ) { - LOG_FATAL_STR("Caught exception: " << ex); - return 1; - } + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, argv[0]); + GCFScheduler::instance()->disableQueue(); // run as fast as possible + + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition + + TBBControl tc(argv[1]); + tc.start(); // make initial transition + + GCFScheduler::instance()->run(); return 0; } diff --git a/MAC/APL/StationCU/src/TBBControl/TBBObservation.cc b/MAC/APL/StationCU/src/TBBControl/TBBObservation.cc index be208369e8dceb2c983a350f89d77d3091b65951..0633ae72f1a4ee90ef7a4822c96ce5bff1f33eb4 100644 --- a/MAC/APL/StationCU/src/TBBControl/TBBObservation.cc +++ b/MAC/APL/StationCU/src/TBBControl/TBBObservation.cc @@ -25,7 +25,6 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include "TBBObservation.h" diff --git a/MAC/APL/TestCtlr/CMakeLists.txt b/MAC/APL/TestCtlr/CMakeLists.txt index 5cd9c6b2998b58c1c5bd6dda15ba708ec8d06478..13a5ee5761330c911cacdb978fdb7bf5a2ca923d 100644 --- a/MAC/APL/TestCtlr/CMakeLists.txt +++ b/MAC/APL/TestCtlr/CMakeLists.txt @@ -3,7 +3,7 @@ lofar_package(TestCtlr 1.0 DEPENDS Common ApplCommon APLCommon MACIO GCFTM) include(LofarFindPackage) -lofar_find_package(Boost REQUIRED) +lofar_find_package(Boost REQUIRED date_time) add_definitions(-DBOOST_DISABLE_THREADS) diff --git a/MAC/APL/TestCtlr/src/ControllerMenu.h b/MAC/APL/TestCtlr/src/ControllerMenu.h index f30bedb6f2ad3b4eca936ee270f2f9cea40c38c6..4c79578cc26260c8ad3262a72addc000988fef6d 100644 --- a/MAC/APL/TestCtlr/src/ControllerMenu.h +++ b/MAC/APL/TestCtlr/src/ControllerMenu.h @@ -38,12 +38,13 @@ //# Common Includes #include <Common/lofar_string.h> #include <Common/lofar_vector.h> -#include <Common/lofar_datetime.h> #include <Common/LofarLogger.h> //# ACC Includes #include <Common/ParameterSet.h> +#include <boost/date_time/posix_time/posix_time.hpp> + // forward declaration namespace LOFAR { @@ -56,6 +57,7 @@ using GCF::TM::GCFPort; using GCF::TM::GCFPortInterface; using GCF::TM::GCFTask; using APLCommon::ChildControl; +using boost::posix_time::ptime; class ControllerMenu : public GCFTask { diff --git a/MAC/APL/VHECR/include/VHECR/VHECRTask.h b/MAC/APL/VHECR/include/VHECR/VHECRTask.h index cbc424966da70cd0c1ab654dc7a285d505c38396..12393084ff40ee96054536df05e9f1cd74edf75d 100644 --- a/MAC/APL/VHECR/include/VHECR/VHECRTask.h +++ b/MAC/APL/VHECR/include/VHECR/VHECRTask.h @@ -27,7 +27,6 @@ #include <Common/ParameterSet.h> #include <Common/LofarLogger.h> #include <Common/lofar_string.h> -#include <Common/lofar_datetime.h> //# local includes diff --git a/MAC/APL/VHECR/src/TBBReadCmd.cc b/MAC/APL/VHECR/src/TBBReadCmd.cc index 97156db8d67e59afe2ae89ea3058d659c346ca34..182992613b8d7b5a921b64703db8004902ad78c2 100644 --- a/MAC/APL/VHECR/src/TBBReadCmd.cc +++ b/MAC/APL/VHECR/src/TBBReadCmd.cc @@ -25,12 +25,14 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <VHECR/TBBReadCmd.h> +#include <boost/date_time/posix_time/posix_time.hpp> namespace LOFAR { namespace VHECR { +using namespace boost::posix_time; + // // TBBReadCmd(...) // diff --git a/MAC/APL/VHECR/src/TBBTrigger.cc b/MAC/APL/VHECR/src/TBBTrigger.cc index 77ce2f65dba5e1aaa290bf547e5d8ecf515e02b2..39e908b082d7261f10b845ca4596aeab22d4bbe0 100644 --- a/MAC/APL/VHECR/src/TBBTrigger.cc +++ b/MAC/APL/VHECR/src/TBBTrigger.cc @@ -25,7 +25,6 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include "VHECR/TBBTrigger.h" // path for online use diff --git a/MAC/APL/VHECR/src/VHECRsettings.cc b/MAC/APL/VHECR/src/VHECRsettings.cc index 2366d0f71af925b9728f9f9c5119c11645fbf2c8..228e23322553198ea1af698c5b30397bb03e35cc 100644 --- a/MAC/APL/VHECR/src/VHECRsettings.cc +++ b/MAC/APL/VHECR/src/VHECRsettings.cc @@ -25,7 +25,6 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include "VHECR/VHECRsettings.h" diff --git a/MAC/Deployment/data/bin/load_OTDB_comps.cc b/MAC/Deployment/data/bin/load_OTDB_comps.cc index a0f8db51ae6045e9fce87de849f1cc83ce37b46a..fca64ba2b888d954bbc014961e2825217115f7e9 100644 --- a/MAC/Deployment/data/bin/load_OTDB_comps.cc +++ b/MAC/Deployment/data/bin/load_OTDB_comps.cc @@ -29,6 +29,7 @@ #include <Common/lofar_fstream.h> #include <Common/lofar_string.h> #include <Common/lofar_vector.h> +#include <Common/lofar_iomanip.h> #include <Common/Exception.h> #include <OTDB/TreeMaintenance.h> diff --git a/MAC/GCF/LogSys/KVLogSys/src/KeyValueLoggerMaster.cc b/MAC/GCF/LogSys/KVLogSys/src/KeyValueLoggerMaster.cc index ac2fd2e1e4840a5dcc3e498732d3f1f5581a8d3f..444ad67cf5a6b5178b704853d562bb1c6998d9d6 100644 --- a/MAC/GCF/LogSys/KVLogSys/src/KeyValueLoggerMaster.cc +++ b/MAC/GCF/LogSys/KVLogSys/src/KeyValueLoggerMaster.cc @@ -33,7 +33,6 @@ #include <OTDB/TreeTypeConv.h> #include <OTDB/TreeStateConv.h> #include <OTDB/ClassifConv.h> -#include <Common/lofar_datetime.h> namespace LOFAR { using namespace OTDB; diff --git a/MAC/MACIO/CMakeLists.txt b/MAC/MACIO/CMakeLists.txt index 9c6b261c8aa9e6a5db307575c9070b545e67b46e..f30d81ebc7d89ef4cca014dfbaacd933d3e6160a 100644 --- a/MAC/MACIO/CMakeLists.txt +++ b/MAC/MACIO/CMakeLists.txt @@ -1,6 +1,6 @@ # $Id$ -lofar_package(MACIO 1.0 DEPENDS Common) +lofar_package(MACIO 1.0 DEPENDS ApplCommon Common) include(LofarFindPackage) lofar_find_package(Boost COMPONENTS date_time) diff --git a/MAC/MACIO/test/tKVTLogger.cc b/MAC/MACIO/test/tKVTLogger.cc index c399d9bcac2233db6fe77f62bf93f446eee976a0..63f078e4a02230d49ef5bb6dda6f8c65baae5d6c 100644 --- a/MAC/MACIO/test/tKVTLogger.cc +++ b/MAC/MACIO/test/tKVTLogger.cc @@ -25,7 +25,6 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <MACIO/KVTLogger.h> #include <MACIO/KVT_Protocol.ph> diff --git a/MAC/Navigator2/config/progs.ccu b/MAC/Navigator2/config/progs.ccu index 7234d9dea2a73a5c3a59acb226f503d8e81fd8f1..50869e5d953b4344e9fe559b5d11a11f1635929c 100644 --- a/MAC/Navigator2/config/progs.ccu +++ b/MAC/Navigator2/config/progs.ccu @@ -14,9 +14,8 @@ PVSS00event | always | 30 | 3 | 1 | PVSS00ctrl | always | 30 | 3 | 1 |-f pvss_scripts.lst PVSS00sim | always | 30 | 3 | 1 | PVSS00dist | always | 30 | 3 | 1 | -PVSS00ctrl | once | 30 | 2 | 2 |readStationBGPconnections.ctl -PVSS00ctrl | always | 30 | 2 | 2 |transferMPs.ctl PVSS00ctrl | always | 30 | 2 | 2 |claim.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateChanges.ctl +PVSS00ctrl | once | 30 | 2 | 2 |readStationBGPconnections.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateReset.ctl PVSS00ui | manual | 30 | 2 | 2 |-m para diff --git a/MAC/Navigator2/config/progs.dist.station b/MAC/Navigator2/config/progs.dist.station index 1456b2e940ba8bf30ace0b3b81c8a6cbba66f3fa..0163de4f87f1d4d94307c4f43b9a98a461d2a205 100644 --- a/MAC/Navigator2/config/progs.dist.station +++ b/MAC/Navigator2/config/progs.dist.station @@ -10,9 +10,8 @@ PVSS00event | always | 30 | 3 | 1 | PVSS00ctrl | always | 30 | 3 | 1 |-f pvss_scripts.lst PVSS00sim | always | 30 | 3 | 1 | PVSS00dist | always | 30 | 3 | 1 | -PVSS00ctrl | once | 30 | 2 | 2 |readStationConfigs.ctl -PVSS00ctrl | always | 30 | 2 | 2 |transferMPs.ctl -PVSS00ctrl | always | 30 | 2 | 2 |claim.ctl +PVSS00ctrl | once | 30 | 2 | 2 |claim.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateChanges.ctl +PVSS00ctrl | once | 30 | 2 | 2 |readStationConfigs.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateReset.ctl PVSS00ui | manual | 30 | 2 | 2 |-m para -display localhost:10.0 diff --git a/MAC/Navigator2/config/progs.maincu b/MAC/Navigator2/config/progs.maincu index 64677f23a81e96527ec599f4fae01817ae2b4576..af37c7aa87aff90c2e1ab592e136a54984df5ceb 100644 --- a/MAC/Navigator2/config/progs.maincu +++ b/MAC/Navigator2/config/progs.maincu @@ -10,7 +10,6 @@ PVSS00event | always | 30 | 3 | 1 | PVSS00ctrl | always | 30 | 3 | 1 |-f pvss_scripts.lst PVSS00sim | always | 30 | 3 | 1 | PVSS00dist | always | 30 | 3 | 1 | -PVSS00ctrl | always | 30 | 2 | 2 |transferMPs.ctl PVSS00ctrl | always | 30 | 2 | 2 |claim.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateChanges.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateReset.ctl diff --git a/MAC/Navigator2/config/progs.standalone.station b/MAC/Navigator2/config/progs.standalone.station index 53bdf6f4b0e3e93a07645a75da5faa5eb7f83cc4..dfd4a6710abf356a7a6a7892207f4f1e241e6093 100644 --- a/MAC/Navigator2/config/progs.standalone.station +++ b/MAC/Navigator2/config/progs.standalone.station @@ -9,10 +9,9 @@ PVSS00valarch | always | 30 | 3 | 1 |-num 2 PVSS00event | always | 30 | 3 | 1 | PVSS00ctrl | always | 30 | 3 | 1 |-f pvss_scripts.lst PVSS00sim | always | 30 | 3 | 1 | -PVSS00ctrl | once | 30 | 2 | 2 |readStationConfigs.ctl -PVSS00ctrl | always | 30 | 2 | 2 |claim.ctl -PVSS00ctrl | always | 30 | 2 | 2 |transferMPs.ctl +PVSS00ctrl | once | 30 | 2 | 2 |claim.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateChanges.ctl +PVSS00ctrl | once | 30 | 2 | 2 |readStationConfigs.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStateReset.ctl PVSS00ctrl | always | 30 | 2 | 2 |monitorStationAlarms.ctl PVSS00ui | manual | 30 | 2 | 2 |-m para -display localhost:10.0 diff --git a/MAC/Navigator2/panels/Processes/CEP_Processes.pnl b/MAC/Navigator2/panels/Processes/CEP_Processes.pnl index 4a178dc17d85d6d0a70c86f161f53303646d233e..94cf82ae878db3def26dc8dd64f8f8acad7c252f 100644 --- a/MAC/Navigator2/panels/Processes/CEP_Processes.pnl +++ b/MAC/Navigator2/panels/Processes/CEP_Processes.pnl @@ -374,7 +374,7 @@ LANG:1 0 3 41 "PANEL_REF42" -1 "objects\\Processes\\controller_small.pnl" 0 280 T 55 1 0 1 0 15 1 -"$name""Daemons_SoftwareMonitor" +"$name""SoftwareMonitor" 3 42 "PANEL_REF42" -1 "objects\\Processes\\daemon_small.pnl" 0 40 T 55 1 0 1 0 20 1 diff --git a/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl b/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl index 54a1439643026c914129e00521b776d854122496..e0e6e35b6aeefb4c88f262014908a1a600d2bc30 100644 --- a/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl +++ b/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl @@ -400,9 +400,9 @@ LANG:1 0 1 "$name""MACScheduler" 3 20 "PANEL_REF21" -1 -"objects\\Processes\\controller_small.pnl" 0 280 T 35 1 0 1 0 -30 +"objects\\Processes\\controller_small.pnl" 0 280 T 35 1 0 1 0 -32 1 -"$name""Daemons_SoftwareMonitor" +"$name""SoftwareMonitor" 3 21 "PANEL_REF22" -1 "objects\\Processes\\daemon_small.pnl" 0 140 T 35 1 0 1 0 12 1 diff --git a/MAC/Navigator2/panels/Processes/Station_Processes.pnl b/MAC/Navigator2/panels/Processes/Station_Processes.pnl index 04e65629561017e2aa1075a4e1637f70f415974b..b2bd0c83af1a82cbd7e22058148d40fa48c21d62 100644 --- a/MAC/Navigator2/panels/Processes/Station_Processes.pnl +++ b/MAC/Navigator2/panels/Processes/Station_Processes.pnl @@ -524,5 +524,5 @@ LANG:1 0 3 38 "PANEL_REF39" -1 "objects\\Processes\\controller_small.pnl" 10 470 T 44 1 0 1 -10 14 1 -"$name""Daemons_SoftwareMonitor" -0 +"$name""SoftwareMonitor" +0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl b/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl index 6f45caea2b8a35a38940d957d457afd60250c8b0..05fe78fa9d2516ba6f5c0e0ef0e9932cfe9754f0 100644 --- a/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl +++ b/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl @@ -22,10 +22,10 @@ PANEL,-1 -1 388 166 N "_3DFace" 2 if (dpExists(\"MCU001:LOFAR_PermSW_MACScheduler.activeObservations\")) { if (dpConnect(\"observationChanged\", \"MCU001:LOFAR_PermSW_MACScheduler.activeObservations:_online.._value\", \"MCU001:LOFAR_PermSW_MACScheduler.activeObservations:_online.._invalid\") == -1) { - LOG_ERROR(\"SWController_small.pnl:main|Couldn't connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\"); + LOG_ERROR(\"Observation_small.pnl:main|Couldn't connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\"); } } else { - if (!isStandalone()) LOG_ERROR(\"SWController_small.pnl:main|Couldn't find DP to connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\"); + if (!isStandalone()) LOG_ERROR(\"Observation_small.pnl:main|Couldn't find DP to connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\"); } } else { reload(); @@ -118,8 +118,7 @@ void dblClick() { if (dpExists(baseDP) ) { LOG_DEBUG(\"SWcontroller_small.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+baseDP); g_currentDatapoint=baseDP; - //we also have to set the tabctrl to think this was initiated from the ProcessesTab, otherwise we will get the wrong panel. - navPanel_setEvent(\"Processes\",\"ChangeTab\"); + navPanel_setEvent(station,\"ChangePanel\"); } // set delay to avoid click event will be triggered diff --git a/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl b/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl index 46d485e4b37b53bf3a5937bc11eafdc8f77a7449..eaa9901f02d2b0fa8cefc1cf076500b9c1077904 100644 --- a/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl +++ b/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl @@ -1,4 +1,4 @@ -V 11 +V 10 1 LANG:1 0 PANEL,-1 -1 1013 750 N "_3DFace" 1 @@ -45,6 +45,8 @@ PANEL,-1 -1 1013 750 N "_3DFace" 1 showSelfState(baseDP); reload(); + + LOG_DEBUG($daemonName+\".pnl:main|HardwareTree found: \"+ result); } updateStates(string dp1, string message, @@ -151,8 +153,9 @@ LANG:1 0 0 1 -LANG:1 33 MS Shell Dlg,-1,13,5,50,0,0,0,0,0 -0 28 168 992 462 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 28 168 992 462 EE 1 0 1 5 1 "time" 12 1 0 "s" 1 LANG:1 4 time E @@ -188,8 +191,9 @@ LANG:1 0 LANG:1 2 #1 10 30 1 -LANG:1 33 MS Shell Dlg,-1,13,5,50,0,0,0,0,0 -0 0 1 2 1 7 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +0 1 2 1 7 1 0 1 21 0 "" 1 0 @@ -206,8 +210,9 @@ LANG:1 0 0 1 -LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 138 48 991 69 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 138 48 991 69 2 "0s" 0 0 0 0 0 -1 E E E 2 3 "TopLabel" @@ -222,11 +227,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 480 10 677 30 +E E 0 1 1 2 1 E U 1 E 480 10 677 31 0 2 2 "0s" 0 0 0 192 0 0 480 10 1 1 -LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 22 Station: CTStartDaemon 2 7 "PRIMITIVE_TEXT2" @@ -241,11 +247,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 34 84 115 97 +E E 0 1 1 2 1 E U 1 E 34 84 115 98 0 2 2 "0s" 0 0 0 192 0 0 34 84 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 14 Current Action 2 8 "PRIMITIVE_TEXT3" @@ -260,11 +267,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 34 51 128 64 +E E 0 1 1 2 1 E U 1 E 34 51 128 65 0 2 2 "0s" 0 0 0 192 0 0 34 51 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 15 Status Message: 14 9 "processAction" @@ -279,8 +287,9 @@ LANG:1 0 0 1 -LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 138 78 432 99 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 138 78 432 99 2 "0s" 0 0 0 0 0 -1 E E E 2 10 "PRIMITIVE_TEXT4" @@ -295,11 +304,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 34 114 106 127 +E E 0 1 1 2 1 E U 1 E 34 114 106 128 0 2 2 "0s" 0 0 0 192 0 0 34 114 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 13 Current Error 14 11 "processError" @@ -314,8 +324,9 @@ LANG:1 0 0 1 -LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 138 108 432 129 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 138 108 432 129 2 "0s" 0 0 0 0 0 -1 E E E 2 12 "PRIMITIVE_TEXT5" @@ -330,11 +341,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 34 150 119 163 +E E 0 1 1 2 1 E U 1 E 34 150 119 164 0 2 2 "0s" 0 0 0 192 0 0 34 150 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 13 Log Messages: 2 13 "PRIMITIVE_TEXT6" @@ -349,11 +361,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 32 472 124 485 +E E 0 1 1 2 1 E U 1 E 32 472 124 486 0 2 2 "0s" 0 0 0 192 0 0 32 472 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 14 Daemon Values: 2 15 "PRIMITIVE_TEXT7" @@ -368,11 +381,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 462 84 516 97 +E E 0 1 1 2 1 E U 1 E 462 84 516 98 0 2 2 "0s" 0 0 0 192 0 0 462 84 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 9 StartTime 2 16 "PRIMITIVE_TEXT8" @@ -387,11 +401,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 462 114 515 127 +E E 0 1 1 2 1 E U 1 E 462 114 515 128 0 2 2 "0s" 0 0 0 192 0 0 462 114 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 8 StopTime 14 17 "processStartTime" @@ -406,8 +421,9 @@ LANG:1 0 0 1 -LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 530 78 824 99 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 530 78 824 99 2 "0s" 0 0 0 0 0 -1 E E E 14 18 "processStopTime" @@ -422,8 +438,9 @@ LANG:1 0 0 1 -LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 530 108 824 129 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 530 108 824 129 2 "0s" 0 0 0 0 0 -1 E E E 2 19 "PRIMITIVE_TEXT9" @@ -438,11 +455,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E E 0 1 1 2 1 E U 1 E 852 84 869 97 +E E 0 1 1 2 1 E U 1 E 852 84 869 98 0 2 2 "0s" 0 0 0 192 0 0 852 84 1 1 -LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0 -0 1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" +1 LANG:1 3 ID: 14 20 "processID" @@ -457,8 +475,9 @@ LANG:1 0 0 1 -LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0 -0 870 78 990 99 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 870 78 990 99 2 "0s" 0 0 0 0 0 -1 E E E 0 LAYER, 1 @@ -489,7 +508,7 @@ LAYER, 7 1 LANG:1 0 0 -3 0 "selfState" -1 +3 0 "selfState" "objects\\lofar_self_state.pnl" 9.500000000000011 10.5 T 1 1 0 1 0.499999999999993 2.5 0 -0 +0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl b/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl index c38abba4a042ebb95737e7d3d41f8cf8ba3b5523..932c6f11710c0c24af609fa6287edca8a8c40ce2 100644 --- a/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl +++ b/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl @@ -103,7 +103,7 @@ LANG:1 0 3 1 "PANEL_REF1" -1 "objects\\Processes\\SWControler_small.pnl" 0 0 T 18 U 2 -"$name""PermSW_Daemons_SoftwareMonitor" +"$name""PermSW_SoftwareMonitor" "$station""$station" 3 2 "PANEL_REF2" -1 "objects\\Processes\\SWControler_small.pnl" 20 0 T 19 1 0 1 -4 0 diff --git a/MAC/Navigator2/panels/objects/swlevel.pnl b/MAC/Navigator2/panels/objects/swlevel.pnl index a88023126f034dd3a4a857f2634977bfb6b8106f..c2b4d265795bcd1b89b8c505829619d967690bfa 100644 --- a/MAC/Navigator2/panels/objects/swlevel.pnl +++ b/MAC/Navigator2/panels/objects/swlevel.pnl @@ -10,7 +10,7 @@ PANEL,-1 -1 251 88 N "_3DFace" 1 station = $station; station_text.text = station; - baseDP = station+\":LOFAR_PermSW_Daemons_SoftwareMonitor\"; + baseDP = station+\":LOFAR_PermSW_SoftwareMonitor\"; if (dpExists(baseDP)) { showLevels(); @@ -19,56 +19,14 @@ PANEL,-1 -1 251 88 N "_3DFace" 1 } } " 0 - E "main(int x, int y) -{ - click(); -}" 0 - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - 1 -1 -1 0 0 0 + E E E E 1 -1 -1 0 0 0 ""0 1 E "#uses \"navPanel.ctl\" string station = \"\"; string baseDP=\"\"; -bool bDoubleClicked = false; int filled=0; -// routine for single mouse click -void click() { - // set delay in case double click was meant - delay(0, 100); - if (!bDoubleClicked) { - navPanel_setEvent(station,\"EventClick\"); - } -} - -// routine for double mouse click -void dblClick() { - // indicate this is a doubleClick - bDoubleClicked = true; - - if (dpExists(baseDP) ) { - LOG_DEBUG(\"swlevel.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+baseDP); - g_currentDatapoint=baseDP; - navPanel_setEvent(station,\"ChangePanel\"); - } - - // set delay to avoid click event will be triggered - delay(0, 500); - bDoubleClicked = false; -} - -// routine for right mouse click -void rClick() { - -} // **************************************** // Name: showLogging @@ -197,15 +155,7 @@ LANG:1 0 "level1_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 0 0 0 0 0 0 E E E 0 @@ -214,24 +164,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -180 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -180 -140 1 E 230 150 234 159 2 1 "station_text" "" 1 10 9 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 1 0 0 0 0 0 E E E 0 @@ -240,11 +178,7 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E U 0 E 10 9 38 22 +E E 0 1 1 2 1 E U 0 E 10 9 38 22 0 2 2 "0s" 0 0 0 192 0 0 10 9 1 1 LANG:1 34 MS Shell Dlg 2,8,-1,5,50,0,0,0,0,0 @@ -254,15 +188,7 @@ LANG:1 5 cs001 "level2_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 2 0 0 0 0 0 E E E 0 @@ -271,24 +197,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -175 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -175 -140 1 E 230 150 234 159 6 3 "level3_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 3 0 0 0 0 0 E E E 0 @@ -297,24 +211,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -170 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -170 -140 1 E 230 150 234 159 6 4 "level4_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 4 0 0 0 0 0 E E E 0 @@ -323,24 +225,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -165 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -165 -140 1 E 230 150 234 159 6 5 "level5_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 5 0 0 0 0 0 E E E 0 @@ -349,24 +239,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -160 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -160 -140 1 E 230 150 234 159 6 6 "level6_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 6 0 0 0 0 0 E E E 0 @@ -375,24 +253,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -155 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -155 -140 1 E 230 150 234 159 6 7 "level7_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 7 0 0 0 0 0 E E E 0 @@ -401,24 +267,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -150 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -150 -140 1 E 230 150 234 159 6 8 "level8_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 8 0 0 0 0 0 E E E 0 @@ -427,24 +281,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -145 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -145 -140 1 E 230 150 234 159 6 9 "level9_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 9 0 0 0 0 0 E E E 0 @@ -453,24 +295,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -140 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -140 -140 1 E 230 150 234 159 6 10 "level10_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 10 0 0 0 0 0 E E E 0 @@ -479,24 +309,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -135 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -135 -140 1 E 230 150 234 159 6 11 "level11_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 11 0 0 0 0 0 E E E 0 @@ -505,24 +323,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -130 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -130 -140 1 E 230 150 234 159 6 12 "level12_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 12 0 0 0 0 0 E E E 0 @@ -531,24 +337,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -125 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -125 -140 1 E 230 150 234 159 6 13 "level13_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 13 0 0 0 0 0 E E E 0 @@ -557,24 +351,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -120 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -120 -140 1 E 230 150 234 159 6 14 "level14_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 14 0 0 0 0 0 E E E 0 @@ -583,24 +365,12 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -115 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -115 -140 1 E 230 150 234 159 6 15 "level15_text" "" 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E - "main() -{ - rClick(); -}" 0 - "main(int x, int y) -{ - dblClick(); -}" 0 - + E E 15 0 0 0 0 0 E E E 0 @@ -609,11 +379,7 @@ LANG:1 0 1 "dashclr"N "_Transparent" -E "main(int x, int y) -{ - click(); -}" 0 - 0 1 1 2 1 E 1 0 1 -110 -140 1 E 230 150 234 159 +E E 0 1 1 2 1 E 1 0 1 -110 -140 1 E 230 150 234 159 0 LAYER, 1 1 diff --git a/MAC/Navigator2/scripts/transferMPs.ctl b/MAC/Navigator2/scripts/transferMPs.ctl deleted file mode 100644 index df3585c138e95c0c3b66906f9f6587ad801625db..0000000000000000000000000000000000000000 --- a/MAC/Navigator2/scripts/transferMPs.ctl +++ /dev/null @@ -1,121 +0,0 @@ -#uses "da.ctl" - -// To copy all _mp defined functionality (archives , dp_fct etc to the real DP's -// we use this script after setup (or each time that the scriptInfo.paramDone is set to false) -// we run this script -bool bDebug=false; - -void main() -{ - // connect to debugflag to be able to switch debug on/off during run - if (dpExists("scriptInfo.transferMPs.debug")) { - dpConnect("debugCB",true,"scriptInfo.transferMPs.debug"); - } else { - DebugTN("transferMPs.ctl:main|scriptInfo.transferMPs.runDone point not found in Database"); - exit(); - } - - if (dpExists("scriptInfo.transferMPs.runDone")) { - dpConnect("startTransferMP",true,"scriptInfo.transferMPs.runDone"); - } else { - DebugTN("transferMPs.ctl:main|scriptInfo.transferMPs.runDone point not found in Database"); - exit(); - } -} - -private void debugCB(string dp1, bool debug) { - if (bDebug != debug) bDebug=debug; -} - -// Transfer all _mp_settings to all DP's -private void startTransferMP(string dp1, bool done ) { - int i, j, k, l, ll, l1, iError; - dyn_float df; - dyn_string dsConfigs, ds; - string sDestinationDPE; - - if (done) return; - - DebugTN("transferMPs.ctl:main|start transfer of MPconfigs to all DP's"); - - - string query="SELECT '_original.._value' FROM '_mp_*'"; - dyn_dyn_anytype tab; - dyn_string dps; - dpQuery(query,tab); - string olddp=""; - for(int z=2;z<=dynlen(tab);z++) { - string dp = dpSubStr(tab[z][1],DPSUB_DP); - if (olddp != dp) { - olddp=dp; - if (!skipDP(dp)) { - dynAppend(dps,dp); - } - } - } - - for (k=1;k <= dynlen(dps); k++) { - string dpstr = dps[k]; - dyn_string dsDpes = dpNames( dpstr + ".**"), - dsDps = dpNames("*",dpTypeName(dpstr)); - - // no datapoints found - if ( dynlen(dsDps) > 1 ) { - - l = dynlen(dsDpes); - l1 = dynlen(dsDps); - ll = l * (l1 - 1); - // !!! dynlen(dsDpes) * dynlen(dsDps) verwenden mit der 2-Sek-Verzögerung - - for ( i = 1; i <= l; i++ ) { - if ( strpos(dsDpes[i],".") < 1 ) dsDpes[i] += "."; - dsConfigs = dpNames( dsDpes[i] + ":*" ); - for ( j = dynlen(dsConfigs); j > 0; j--) { - strreplace(dsConfigs[j], dsDpes[i] + ":", ""); - } - if ( dynlen(dsConfigs) < 1 ) continue; - - for ( j = 1; j <= dynlen(dsDps); j++ ) { - - if ( dpSubStr(dsDps[j],DPSUB_DP) == dpSubStr(dsDpes[i],DPSUB_DP) ) { - continue; - } - sDestinationDPE = dsDpes[i]; - strreplace( sDestinationDPE, dpSubStr(dsDpes[i], DPSUB_DP), dpSubStr(dsDps[j], DPSUB_DP)); - daCheckDPE(sDestinationDPE); - - dpCopyConfig(dsDpes[i], sDestinationDPE, dsConfigs, iError); - } - } - } - } - dpSet("scriptInfo.transferMPs.runDone",true); - DebugTN("MPTransfer Done."); -} - -bool skipDP(string dp) { -// We only want to look at our own DB points that have a _mp_ sadly enough PVSS -// keeps some of their own datapoints in the database, and there is no way to -// determine what are theirs and what are or own points, other then a hard compare. - if (strpos(dp,"_mp__") > -1) return true; - if (strpos(dp,"WH_SC_SUB") > -1) return true; - if (strpos(dp,"WH_SC1") > -1) return true; - if (strpos(dp,"ANALOG1") > -1) return true; - if (strpos(dp,"ANALOG2") > -1) return true; - if (strpos(dp,"DRIVE1") > -1) return true; - if (strpos(dp,"DRIVE2") > -1) return true; - if (strpos(dp,"SETPOINT") > -1) return true; - if (strpos(dp,"SLIDE_VALVE1") > -1) return true; - if (strpos(dp,"SLIDE_VALVE2") > -1) return true; - if (strpos(dp,"PUMP2") > -1) return true; - if (strpos(dp,"PUMP1") > -1) return true; - if (strpos(dp,"BIT_CONDITION") > -1) return true; - if (strpos(dp,"COUNTER1") > -1) return true; - if (strpos(dp,"COUNTER_SUB") > -1) return true; - if (strpos(dp,"LABOR_ANALOG") > -1) return true; - if (strpos(dp,"LABOR_COUNTER") > -1) return true; - if (strpos(dp,"SLIDE_VALVE_HAND1") > -1) return true; - if (strpos(dp,"WH_SC_SERVICE") > -1) return true; - if (strpos(dp,"MODE_CMD") > -1) return true; - return false; -} diff --git a/RTCP/CNProc/src/CN_Processing.cc b/RTCP/CNProc/src/CN_Processing.cc index fb9d3488d0cef29ee2382b480bfb3667ef456e21..e6f868ee21d1f37e4be00baf3e8fa795b02dc007 100644 --- a/RTCP/CNProc/src/CN_Processing.cc +++ b/RTCP/CNProc/src/CN_Processing.cc @@ -54,7 +54,7 @@ #endif #include <boost/format.hpp> - +#include <sys/time.h> #if defined HAVE_BGP //#define LOG_CONDITION (itsLocationInfo.rankInPset() == 0) diff --git a/RTCP/IONProc/CMakeLists.txt b/RTCP/IONProc/CMakeLists.txt index 80e705e18b524895175c253d744d35d1b42d049f..280e6ef1c0ab79cd9936e422441a7a17a08c7e76 100644 --- a/RTCP/IONProc/CMakeLists.txt +++ b/RTCP/IONProc/CMakeLists.txt @@ -6,6 +6,7 @@ lofar_package(IONProc 1.0 include(LofarFindPackage) lofar_find_package(Boost REQUIRED) lofar_find_package(Libssh2) +lofar_find_package(OpenSSL) lofar_find_package(Valgrind) lofar_find_package(Casacore COMPONENTS measures REQUIRED) diff --git a/RTCP/IONProc/src/BeamletBufferToComputeNode.cc b/RTCP/IONProc/src/BeamletBufferToComputeNode.cc index 09f0b3596eaea59f213b2195b584371eaa5e4a96..808e82573d13b95f52e876539b6dffd3cbd26e80 100644 --- a/RTCP/IONProc/src/BeamletBufferToComputeNode.cc +++ b/RTCP/IONProc/src/BeamletBufferToComputeNode.cc @@ -41,6 +41,7 @@ #include <cstdio> #include <stdexcept> +#include <iomanip> #include <boost/format.hpp> diff --git a/RTCP/IONProc/src/CommandServer.cc b/RTCP/IONProc/src/CommandServer.cc index dc34f03f2c0431ef3134a8eff9b36770044612a9..730378c978cb57db24030da001f941b0e5bc3b76 100644 --- a/RTCP/IONProc/src/CommandServer.cc +++ b/RTCP/IONProc/src/CommandServer.cc @@ -31,6 +31,7 @@ #include <Stream/SocketStream.h> #include <string> +#include <boost/lexical_cast.hpp> //#if defined HAVE_MPI //#include <mpi.h> diff --git a/RTCP/IONProc/src/ION_main.cc b/RTCP/IONProc/src/ION_main.cc index 339a197ef1d3af035956e417650538dd1c66a69a..809284530d617ff0f810359b66ae8dab11cd948a 100644 --- a/RTCP/IONProc/src/ION_main.cc +++ b/RTCP/IONProc/src/ION_main.cc @@ -51,6 +51,7 @@ #include <sys/mman.h> #include <boost/format.hpp> +#include <boost/lexical_cast.hpp> #if defined HAVE_MPI #include <mpi.h> diff --git a/RTCP/IONProc/src/SSH.cc b/RTCP/IONProc/src/SSH.cc index f7d56708ce85a3af64506cd450d58539213037ab..cf6e19162c3881fcacd421fe01710e4ad392f42d 100644 --- a/RTCP/IONProc/src/SSH.cc +++ b/RTCP/IONProc/src/SSH.cc @@ -43,10 +43,9 @@ #ifdef HAVE_LIBSSH2 #include <Scheduling.h> #include <Interface/SmartPtr.h> -#include <sstream> #include <sys/select.h> -#include <Common/lofar_string.h> #include <Stream/SocketStream.h> +#include <openssl/crypto.h> #endif using namespace std; @@ -560,15 +559,13 @@ const char *explainLibSSH2Error( int error ) case LIBSSH2_ERROR_SOCKET_RECV: explanation ="LIBSSH2_ERROR_SOCKET_RECV"; break; case LIBSSH2_ERROR_ENCRYPT: explanation ="LIBSSH2_ERROR_ENCRYPT"; break; case LIBSSH2_ERROR_BAD_SOCKET: explanation ="LIBSSH2_ERROR_BAD_SOCKET"; break; - case LIBSSH2_ERROR_KNOWN_HOSTS: explanation ="LIBSSH2_ERROR_KNOWN_HOSTS"; break; +// case LIBSSH2_ERROR_KNOWN_HOSTS: explanation ="LIBSSH2_ERROR_KNOWN_HOSTS"; break; //case LIBSSH2_ERROR_BANNER_NONE: explanation ="LIBSSH2_ERROR_BANNER_NONE"; break; } return explanation; } -#include <openssl/crypto.h> - std::vector< SmartPtr<Mutex> > openssl_mutexes; static void lock_callback(int mode, int type, const char *file, int line) diff --git a/RTCP/Interface/CMakeLists.txt b/RTCP/Interface/CMakeLists.txt index 2b21d242021b5022ae698ce1ad7c4ce81ddc1d38..065dde3690838a64d098f8cca0c983d3507fb03c 100644 --- a/RTCP/Interface/CMakeLists.txt +++ b/RTCP/Interface/CMakeLists.txt @@ -1,6 +1,6 @@ # $Id$ -lofar_package(Interface 1.0 DEPENDS Common Stream) +lofar_package(Interface 1.0 DEPENDS ApplCommon Common Stream) include(LofarFindPackage) lofar_find_package(Boost REQUIRED COMPONENTS date_time) diff --git a/RTCP/Interface/include/Interface/Parset.h b/RTCP/Interface/include/Interface/Parset.h index 44732c6ace9a87852bc8f4f92ca792e70826be56..83059bc82da89e3a4f056089a540b0036496e3c8 100644 --- a/RTCP/Interface/include/Interface/Parset.h +++ b/RTCP/Interface/include/Interface/Parset.h @@ -33,7 +33,6 @@ #include <Common/LofarBitModeInfo.h> #include <Common/StreamUtil.h> #include <Common/StringUtil.h> -#include <Common/lofar_datetime.h> #include <Common/LofarLogger.h> #include <Interface/BeamCoordinates.h> #include <Interface/Config.h> @@ -48,9 +47,6 @@ #include <vector> #include <string> -#include <boost/date_time/c_local_time_adjustor.hpp> -#include <boost/format.hpp> - namespace LOFAR { namespace RTCP { @@ -58,19 +54,6 @@ class Transpose2; class CN_Transpose2; enum StokesType { STOKES_I = 0, STOKES_IQUV, STOKES_XXYY, INVALID_STOKES = -1 }; - -static StokesType stokesType( const std::string &name ) { - if (name == "I") - return STOKES_I; - - if (name == "IQUV") - return STOKES_IQUV; - - if (name == "XXYY") - return STOKES_XXYY; - - return INVALID_STOKES; -}; // The Parset class is a public struct that can be used as base-class @@ -307,89 +290,39 @@ struct StreamInfo { std::vector<unsigned> subbands; - void log() const { - LOG_DEBUG_STR( "Stream " << stream << " is sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part << " consisting of subbands " << subbands ); - } + void log() const; }; class Transpose2 { public: - Transpose2( const Parset &parset ) - : - phaseThreeDisjunct( parset.phaseThreeDisjunct() ), - - nrChannels( parset.nrChannelsPerSubband() ), - nrCoherentChannels( parset.coherentStokesChannelsPerSubband() ), - nrIncoherentChannels( parset.incoherentStokesChannelsPerSubband() ), - nrSamples( parset.CNintegrationSteps() ), - coherentTimeIntFactor( parset.coherentStokesTimeIntegrationFactor() ), - incoherentTimeIntFactor( parset.incoherentStokesTimeIntegrationFactor() ), - - nrBeams( parset.totalNrTABs() ), - coherentNrSubbandsPerFile( parset.coherentStokesNrSubbandsPerFile() ), - incoherentNrSubbandsPerFile( parset.incoherentStokesNrSubbandsPerFile() ), - - nrPhaseTwoPsets( parset.phaseTwoPsets().size() ), - nrPhaseTwoCores( parset.phaseOneTwoCores().size() ), - nrPhaseThreePsets( parset.phaseThreePsets().size() ), - nrPhaseThreeCores( parset.phaseThreeCores().size() ), - - nrSubbandsPerPset( parset.nrSubbandsPerPset() ), - streamInfo( generateStreamInfo(parset) ), - nrStreamsPerPset( divideRoundUp( nrStreams(), parset.phaseThreePsets().size() ) ) - { - } - - unsigned nrStreams() const { return streamInfo.size(); } - - // compose and decompose a stream number - unsigned stream( unsigned sap, unsigned beam, unsigned stokes, unsigned part, unsigned startAt = 0) const { - for (unsigned i = startAt; i < streamInfo.size(); i++) { - const struct StreamInfo &info = streamInfo[i]; - - if (sap == info.sap && beam == info.beam && stokes == info.stokes && part == info.part) - return i; - } - - // shouldn't reach this point - ASSERTSTR(false, "Requested non-existing sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part); + Transpose2( const Parset &parset ); - return 0; - } + unsigned nrStreams() const; - void decompose( unsigned stream, unsigned &sap, unsigned &beam, unsigned &stokes, unsigned &part ) const { - const struct StreamInfo &info = streamInfo[stream]; - - sap = info.sap; - beam = info.beam; - stokes = info.stokes; - part = info.part; - } - - std::vector<unsigned> subbands( unsigned stream ) const { ASSERT(stream < streamInfo.size()); return streamInfo[stream].subbands; } - unsigned nrSubbands( unsigned stream ) const { return stream >= streamInfo.size() ? 0 : subbands(stream).size(); } - unsigned maxNrSubbands() const { return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoSubbandsComp )->subbands.size(); } - unsigned maxNrChannels() const { return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoChannelsComp )->nrChannels; } - unsigned maxNrSamples() const { return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoSamplesComp )->nrSamples; } + // compose and decompose a stream number + unsigned stream( unsigned sap, unsigned beam, unsigned stokes, unsigned part, unsigned startAt = 0) const; + void decompose( unsigned stream, unsigned &sap, unsigned &beam, unsigned &stokes, unsigned &part ) const; - size_t subbandSize( unsigned stream ) const { const StreamInfo &info = streamInfo[stream]; return (size_t)info.nrChannels * (info.nrSamples|2) * sizeof(float); } + std::vector<unsigned> subbands( unsigned stream ) const; + unsigned nrSubbands( unsigned stream ) const; + unsigned maxNrSubbands() const; + unsigned maxNrChannels() const; + unsigned maxNrSamples() const; - //unsigned maxNrSubbandsPerStream() const { return std::min(nrSubbands, nrSubbandsPerFile); } + size_t subbandSize( unsigned stream ) const; // the pset/core which processes a certain block of a certain subband // note: AsyncTransposeBeams applied the mapping of phaseThreePsets - unsigned sourceCore( unsigned subband, unsigned block ) const { return (block * nrSubbandsPerPset + subband % nrSubbandsPerPset) % nrPhaseTwoCores; } - unsigned sourcePset( unsigned subband, unsigned block ) const { (void)block; return subband / nrSubbandsPerPset; } + unsigned sourceCore( unsigned subband, unsigned block ) const; + unsigned sourcePset( unsigned subband, unsigned block ) const; // the pset/core which processes a certain block of a certain stream // note: AsyncTransposeBeams applied the mapping of phaseTwoPsets - unsigned destCore( unsigned stream, unsigned block ) const { return (block * phaseThreeGroupSize() + stream % nrStreamsPerPset) % nrPhaseThreeCores; } - unsigned destPset( unsigned stream, unsigned block ) const { (void)block; return stream / nrStreamsPerPset; } + unsigned destCore( unsigned stream, unsigned block ) const; + unsigned destPset( unsigned stream, unsigned block ) const; // if phase2 == phase3, each block in phase3 is processed by more cores (more cores idle to align phases 2 and 3) - unsigned phaseThreeGroupSize() const { - return phaseThreeDisjunct ? nrStreamsPerPset : nrSubbandsPerPset; - } + unsigned phaseThreeGroupSize() const; const bool phaseThreeDisjunct; @@ -414,146 +347,20 @@ public: const std::vector<struct StreamInfo> streamInfo; const unsigned nrStreamsPerPset; -private: - - static bool streamInfoSubbandsComp( const struct StreamInfo &a, const struct StreamInfo &b ) { - return a.subbands.size() < b.subbands.size(); - } - - static bool streamInfoChannelsComp( const struct StreamInfo &a, const struct StreamInfo &b ) { - return a.nrChannels < b.nrChannels; - } - - static bool streamInfoSamplesComp( const struct StreamInfo &a, const struct StreamInfo &b ) { - return a.nrSamples < b.nrSamples; - } - - static unsigned divideRoundUp( unsigned a, unsigned b ) { - return b == 0 ? 0 : (a + b - 1) / b; - } - - std::vector<struct StreamInfo> generateStreamInfo( const Parset &parset ) const { - // get all info from parset, since we will be called while constructing our members - // ParameterSets are SLOW, so cache any info we need repeatedly - - std::vector<struct StreamInfo> infoset; - const std::vector<unsigned> sapMapping = parset.subbandToSAPmapping(); - const unsigned nrSAPs = parset.nrBeams(); - const unsigned nrSubbands = parset.nrSubbands(); - const unsigned nrCoherentSubbandsPerFile = parset.coherentStokesNrSubbandsPerFile(); - const unsigned nrIncoherentSubbandsPerFile = parset.incoherentStokesNrSubbandsPerFile(); - - const unsigned nrCoherentStokes = parset.coherentStokes().size(); - const StokesType coherentType = stokesType( parset.coherentStokes() ); - const unsigned nrCoherentChannels = parset.coherentStokesChannelsPerSubband(); - const unsigned nrCoherentTimeIntFactor = parset.coherentStokesTimeIntegrationFactor(); - - const unsigned nrIncoherentStokes = parset.incoherentStokes().size(); - const StokesType incoherentType = stokesType( parset.incoherentStokes() ); - const unsigned nrIncoherentChannels = parset.incoherentStokesChannelsPerSubband(); - const unsigned nrIncoherentTimeIntFactor = parset.incoherentStokesTimeIntegrationFactor(); - - const unsigned nrSamples = parset.CNintegrationSteps(); - - struct StreamInfo info; - info.stream = 0; - - for (unsigned sap = 0; sap < nrSAPs; sap++) { - const unsigned nrBeams = parset.nrTABs(sap); - - info.sap = sap; - - std::vector<unsigned> sapSubbands; - - for (unsigned sb = 0; sb < nrSubbands; sb++) - if (sapMapping[sb] == sap) - sapSubbands.push_back(sb); - - for (unsigned beam = 0; beam < nrBeams; beam++) { - info.beam = beam; - - const bool coherent = parset.isCoherent(sap, beam); - const unsigned nrStokes = coherent ? nrCoherentStokes : nrIncoherentStokes; - - info.coherent = coherent; - info.nrChannels = coherent ? nrCoherentChannels : nrIncoherentChannels; - info.timeIntFactor = coherent ? nrCoherentTimeIntFactor : nrIncoherentTimeIntFactor; - info.nrStokes = nrStokes; - info.stokesType = coherent ? coherentType : incoherentType; - info.nrSamples = nrSamples / info.timeIntFactor; - - const unsigned nrSubbandsPerFile = coherent ? nrCoherentSubbandsPerFile : nrIncoherentSubbandsPerFile; - - for (unsigned stokes = 0; stokes < nrStokes; stokes++) { - info.stokes = stokes; - info.part = 0; - - // split into parts of at most nrSubbandsPerFile - for (unsigned sb = 0; sb < sapSubbands.size(); sb += nrSubbandsPerFile ) { - for (unsigned i = 0; sb + i < sapSubbands.size() && i < nrSubbandsPerFile; i++) - info.subbands.push_back(sapSubbands[sb + i]); - - infoset.push_back(info); - - info.subbands.clear(); - info.part++; - info.stream++; - } - } - } - } - - return infoset; - } +private: + std::vector<struct StreamInfo> generateStreamInfo( const Parset &parset ) const; }; class CN_Transpose2: public Transpose2 { public: - CN_Transpose2( const Parset &parset, unsigned myPset, unsigned myCore ) - : - Transpose2( parset ), - myPset( myPset ), - myCore( myCore ), - - phaseTwoPsetIndex( parset.phaseTwoPsetIndex(myPset) ), - phaseTwoCoreIndex( parset.phaseTwoCoreIndex(myCore) ), - phaseThreePsetIndex( parset.phaseThreePsetIndex(myPset) ), - phaseThreeCoreIndex( parset.phaseThreeCoreIndex(myCore) ) - { - } + CN_Transpose2( const Parset &parset, unsigned myPset, unsigned myCore ); // the stream to process on (myPset, myCore) - int myStream( unsigned block ) const { - unsigned first = phaseThreePsetIndex * nrStreamsPerPset; - unsigned blockShift = (phaseThreeGroupSize() * block) % nrPhaseThreeCores; - unsigned relative = (nrPhaseThreeCores + phaseThreeCoreIndex - blockShift) % nrPhaseThreeCores; - - // such a stream does not exist - if (first + relative >= nrStreams()) - return -1; - - // we could handle this stream, but it's handled by a subsequent pset - if (relative >= nrStreamsPerPset) - return -1; - - return first + relative; - } + int myStream( unsigned block ) const; // the part number of a subband with an absolute index - unsigned myPart( unsigned subband, bool coherent ) const { - for (unsigned i = 0; i < streamInfo.size(); i++) { - const struct StreamInfo &info = streamInfo[i]; - - if ( info.coherent == coherent - && info.subbands[0] <= subband - && info.subbands[info.subbands.size()-1] >= subband ) - return info.part; - } - - // we reach this point if there are no beams of this coherency - return 0; - } + unsigned myPart( unsigned subband, bool coherent ) const; const unsigned myPset; const unsigned myCore; @@ -564,667 +371,6 @@ public: const int phaseThreeCoreIndex; }; -inline std::string Parset::name() const -{ - return itsName; -} - -inline const Transpose2 &Parset::transposeLogic() const -{ - if (!itsTransposeLogic) - itsTransposeLogic = new Transpose2(*this); - - return *itsTransposeLogic; -} - -inline const CN_Transpose2 &Parset::CN_transposeLogic( unsigned pset, unsigned core ) const -{ - if (!itsCN_TransposeLogic) - itsCN_TransposeLogic = new CN_Transpose2(*this, pset, core); - - return *itsCN_TransposeLogic; -} - - -inline unsigned Parset::observationID() const -{ - return getUint32("Observation.ObsID"); -} - -inline double Parset::getTime(const char *name) const -{ - return to_time_t(time_from_string(getString(name))); -} - -inline double Parset::startTime() const -{ - return getTime("Observation.startTime"); -} - -inline double Parset::stopTime() const -{ - return getTime("Observation.stopTime"); -} - -inline unsigned Parset::nrCorrelatedBlocks() const -{ - return static_cast<unsigned>(floor( (stopTime() - startTime()) / IONintegrationTime())); -} - -inline unsigned Parset::nrBeamFormedBlocks() const -{ - return static_cast<unsigned>(floor( (stopTime() - startTime()) / CNintegrationTime())); -} - -inline string Parset::stationName(int index) const -{ - return allStationNames()[index]; -} - -inline int Parset::stationIndex(const std::string &name) const -{ - std::vector<std::string> names = allStationNames(); - for (unsigned i = 0; i < names.size(); i++) - if (names[i] == name) - return i; - - return -1; -} - -inline std::vector<std::string> Parset::allStationNames() const -{ - return getStringVector("OLAP.storageStationNames",true); -} - -inline bool Parset::hasStorage() const -{ - return getString("OLAP.OLAP_Conn.IONProc_Storage_Transport") != "NULL"; -} - -inline string Parset::getTransportType(const string& prefix) const -{ - return getString(prefix + "_Transport"); -} - -inline unsigned Parset::nrStations() const -{ - return allStationNames().size(); -} - -inline unsigned Parset::nrTabStations() const -{ - return getStringVector("OLAP.tiedArrayStationNames",true).size(); -} - -inline std::vector<std::string> Parset::mergedStationNames() const -{ - std::vector<string> tabStations = getStringVector("OLAP.tiedArrayStationNames",true); - - if (tabStations.empty()) - return getStringVector("OLAP.storageStationNames",true); - else - return tabStations; -} - -inline unsigned Parset::nrMergedStations() const -{ - const std::vector<unsigned> list = tabList(); - - if (list.empty()) - return nrStations(); - - return *std::max_element( list.begin(), list.end() ) + 1; -} - -inline unsigned Parset::nrBaselines() const -{ - unsigned stations; - - if (nrTabStations() > 0) - stations = nrTabStations(); - else - stations = nrStations(); - - return stations * (stations + 1) / 2; -} - -inline unsigned Parset::nrCrossPolarisations() const -{ - return (getUint32("Observation.nrPolarisations") * getUint32("Observation.nrPolarisations")); -} - -inline unsigned Parset::clockSpeed() const -{ - return getUint32("Observation.sampleClock") * 1000000; -} - -inline double Parset::subbandBandwidth() const -{ - return 1.0 * clockSpeed() / 1024; -} - -inline double Parset::sampleDuration() const -{ - return 1.0 / subbandBandwidth(); -} - -inline unsigned Parset::dedispersionFFTsize() const -{ - return isDefined("OLAP.CNProc.dedispersionFFTsize") ? getUint32("OLAP.CNProc.dedispersionFFTsize") : CNintegrationSteps(); -} - -inline unsigned Parset::nrBitsPerSample() const -{ - const std::string key = "Observation.nrBitsPerSample"; - - if (isDefined(key)) { - return getUint32(key); - } else { -#ifndef HAVE_BGP_CN - LOG_WARN_STR( "Missing key " << key << ", using the depricated key OLAP.nrBitsPerSample"); -#endif - return getUint32("OLAP.nrBitsPerSample", 16); - } -} - -inline size_t Parset::nrBytesPerComplexSample() const -{ - return 2 * nrBitsPerSample() / 8; -} - -inline unsigned Parset::CNintegrationSteps() const -{ - return getUint32("OLAP.CNProc.integrationSteps"); -} - -inline unsigned Parset::IONintegrationSteps() const -{ - return getUint32("OLAP.IONProc.integrationSteps"); -} - -inline unsigned Parset::integrationSteps() const -{ - return CNintegrationSteps() * IONintegrationSteps(); -} - -inline unsigned Parset::coherentStokesTimeIntegrationFactor() const -{ - return getUint32("OLAP.CNProc_CoherentStokes.timeIntegrationFactor"); -} - -inline unsigned Parset::incoherentStokesTimeIntegrationFactor() const -{ - return getUint32("OLAP.CNProc_IncoherentStokes.timeIntegrationFactor"); -} - -inline unsigned Parset::coherentStokesChannelsPerSubband() const -{ - unsigned numch = getUint32("OLAP.CNProc_CoherentStokes.channelsPerSubband"); - - if (numch == 0) - return nrChannelsPerSubband(); - else - return numch; -} - -inline unsigned Parset::incoherentStokesChannelsPerSubband() const -{ - unsigned numch = getUint32("OLAP.CNProc_IncoherentStokes.channelsPerSubband"); - - if (numch == 0) - return nrChannelsPerSubband(); - else - return numch; -} - -inline std::string Parset::coherentStokes() const -{ - return getString("OLAP.CNProc_CoherentStokes.which"); -} - -inline std::string Parset::incoherentStokes() const -{ - return getString("OLAP.CNProc_IncoherentStokes.which"); -} - -inline bool Parset::outputFilteredData() const -{ - return getBool("Observation.DataProducts.Output_FilteredData.enabled", false); -} - -inline bool Parset::outputCorrelatedData() const -{ - return getBool("Observation.DataProducts.Output_Correlated.enabled", false); -} - -inline bool Parset::outputBeamFormedData() const -{ - return getBool("Observation.DataProducts.Output_Beamformed.enabled", false); -} - -inline bool Parset::outputTrigger() const -{ - return getBool("Observation.DataProducts.Output_Trigger.enabled", false); -} - -inline bool Parset::outputThisType(OutputType outputType) const -{ - return getBool(keyPrefix(outputType) + ".enabled", false); -} - -inline bool Parset::onlineFlagging() const -{ - return getBool("OLAP.CNProc.onlineFlagging", false); -} - -inline bool Parset::onlinePreCorrelationFlagging() const -{ - return getBool("OLAP.CNProc.onlinePreCorrelationFlagging", false); -} - -inline bool Parset::onlinePreCorrelationNoChannelsFlagging() const -{ - return getBool("OLAP.CNProc.onlinePreCorrelationNoChannelsFlagging", false); -} - -inline bool Parset::onlinePostCorrelationFlagging() const -{ - return getBool("OLAP.CNProc.onlinePostCorrelationFlagging", false); -} - - inline unsigned Parset::onlinePreCorrelationFlaggingIntegration() const -{ - return getUint32("OLAP.CNProc.onlinePostCorrelationFlaggingIntegration", 0); -} - - -inline string Parset::onlinePreCorrelationFlaggingType(std::string defaultVal) const -{ - return getString("OLAP.CNProc.onlinePreCorrelationFlaggingType", defaultVal); -} - -inline string Parset::onlinePreCorrelationFlaggingStatisticsType(std::string defaultVal) const -{ - return getString("OLAP.CNProc.onlinePreCorrelationFlaggingStatisticsType", defaultVal); -} - -inline string Parset::onlinePostCorrelationFlaggingType(std::string defaultVal) const -{ - return getString("OLAP.CNProc.onlinePostCorrelationFlaggingType", defaultVal); -} - -inline string Parset::onlinePostCorrelationFlaggingStatisticsType(std::string defaultVal) const -{ - return getString("OLAP.CNProc.onlinePostCorrelationFlaggingStatisticsType", defaultVal); -} - -inline bool Parset::onlinePostCorrelationFlaggingDetectBrokenStations() const -{ - return getBool("OLAP.CNProc.onlinePostCorrelationFlaggingDetectBrokenStations", false); -} - -inline bool Parset::fakeInputData() const -{ - return getBool("OLAP.CNProc.fakeInputData", false); -} - -inline bool Parset::checkFakeInputData() const -{ - return getBool("OLAP.CNProc.checkFakeInputData", false); -} - -inline double Parset::CNintegrationTime() const -{ - return nrSamplesPerSubband() / subbandBandwidth(); -} - -inline double Parset::IONintegrationTime() const -{ - return CNintegrationTime() * IONintegrationSteps(); -} - -inline unsigned Parset::nrSamplesPerChannel() const -{ - return CNintegrationSteps(); -} - -inline unsigned Parset::nrSamplesPerSubband() const -{ - return nrSamplesPerChannel() * nrChannelsPerSubband(); -} - -inline unsigned Parset::nrHistorySamples() const -{ - return nrChannelsPerSubband() > 1 ? (nrPPFTaps() - 1) * nrChannelsPerSubband() : 0; -} - -inline unsigned Parset::nrSamplesToCNProc() const -{ - return nrSamplesPerSubband() + nrHistorySamples() + 32 / (NR_POLARIZATIONS * 2 * nrBitsPerSample() / 8); -} - -inline unsigned Parset::inputBufferSize() const -{ - return (unsigned) (getDouble("OLAP.nrSecondsOfBuffer") * subbandBandwidth()); -} - -inline unsigned Parset::maxNetworkDelay() const -{ - return (unsigned) (getDouble("OLAP.maxNetworkDelay") * subbandBandwidth()); -} - -inline unsigned Parset::nrSubbandsPerPset() const -{ - unsigned psets = phaseTwoPsets().size(); - unsigned subbands = nrSubbands(); - - return (psets == 0 ? 0 : subbands + psets - 1) / psets; -} - -inline unsigned Parset::coherentStokesNrSubbandsPerFile() const -{ - return std::min( getUint32("OLAP.CNProc_CoherentStokes.subbandsPerFile"), nrSubbands() ); -} - -inline unsigned Parset::incoherentStokesNrSubbandsPerFile() const -{ - return std::min( getUint32("OLAP.CNProc_IncoherentStokes.subbandsPerFile"), nrSubbands() ); -} - -inline unsigned Parset::nrPhase3StreamsPerPset() const -{ - return maxNrStreamsPerPset(BEAM_FORMED_DATA) + maxNrStreamsPerPset(TRIGGER_DATA); -} - -inline unsigned Parset::nrPPFTaps() const -{ - return getUint32("OLAP.CNProc.nrPPFTaps"); -} - -inline unsigned Parset::nrChannelsPerSubband() const -{ - return getUint32("Observation.channelsPerSubband"); -} - -inline std::vector<unsigned> Parset::phaseOneTwoCores() const -{ - return getUint32Vector("OLAP.CNProc.phaseOneTwoCores", true); -} - -inline std::vector<unsigned> Parset::phaseThreeCores() const -{ - return getUint32Vector("OLAP.CNProc.phaseThreeCores",true); -} - -inline unsigned Parset::nrCoresPerPset() const -{ - return usedCoresInPset().size(); -} - -inline vector<unsigned> Parset::subbandList() const -{ - return getUint32Vector("Observation.subbandList",true); -} - -inline unsigned Parset::nrSubbands() const -{ - return getUint32Vector("Observation.subbandList",true).size(); -} - -inline unsigned Parset::nrSubbandsPerSAP(unsigned sap) const -{ - std::vector<unsigned> mapping = subbandToSAPmapping(); - - return std::count(mapping.begin(), mapping.end(), sap); -} - -inline std::vector<unsigned> Parset::subbandToSAPmapping() const -{ - return getUint32Vector("Observation.beamList",true); -} - -inline double Parset::channelWidth() const -{ - return subbandBandwidth() / nrChannelsPerSubband(); -} - -inline bool Parset::delayCompensation() const -{ - return getBool("OLAP.delayCompensation"); -} - -inline unsigned Parset::nrCalcDelays() const -{ - return getUint32("OLAP.DelayComp.nrCalcDelays"); -} - -inline string Parset::positionType() const -{ - return getString("OLAP.DelayComp.positionType"); -} - -inline double Parset::clockCorrectionTime(const std::string &station) const -{ - return getDouble(std::string("PIC.Core.") + station + ".clockCorrectionTime",0.0); -} - -inline bool Parset::correctBandPass() const -{ - return getBool("OLAP.correctBandPass"); -} - -inline unsigned Parset::nrPsetsPerStorage() const -{ - return getUint32("OLAP.psetsPerStorage"); -} - -inline unsigned Parset::getLofarStManVersion() const -{ - return getUint32("OLAP.LofarStManVersion", 2); -} - -inline vector<unsigned> Parset::phaseOnePsets() const -{ - return getUint32Vector("OLAP.CNProc.phaseOnePsets",true); -} - -inline vector<unsigned> Parset::phaseTwoPsets() const -{ - return getUint32Vector("OLAP.CNProc.phaseTwoPsets",true); -} - -inline vector<unsigned> Parset::phaseThreePsets() const -{ - return getUint32Vector("OLAP.CNProc.phaseThreePsets",true); -} - -inline unsigned Parset::totalNrPsets() const -{ - const std::string key = "OLAP.IONProc.psetList"; - - if (isDefined(key)) { - return getStringVector(key,true).size(); - } else { - LOG_WARN_STR( "Missing key " << key << ", using the used psets as a fallback"); - return usedPsets().size(); - } -} - -inline vector<unsigned> Parset::tabList() const -{ - return getUint32Vector("OLAP.CNProc.tabList",true); -} - -inline int Parset::phaseOnePsetIndex(unsigned pset) const -{ - return findIndex(pset, phaseOnePsets()); -} - -inline int Parset::phaseTwoPsetIndex(unsigned pset) const -{ - return findIndex(pset, phaseTwoPsets()); -} - -inline int Parset::phaseThreePsetIndex(unsigned pset) const -{ - return findIndex(pset, phaseThreePsets()); -} - -inline int Parset::phaseOneCoreIndex(unsigned core) const -{ - return findIndex(core, phaseOneTwoCores()); -} - -inline int Parset::phaseTwoCoreIndex(unsigned core) const -{ - return findIndex(core, phaseOneTwoCores()); -} - -inline int Parset::phaseThreeCoreIndex(unsigned core) const -{ - return findIndex(core, phaseThreeCores()); -} - -inline double Parset::channel0Frequency(size_t subband) const -{ - double sbFreq = subbandToFrequencyMapping()[subband]; - - if (nrChannelsPerSubband() == 1) - return sbFreq; - - // if the 2nd PPF is used, the subband is shifted half a channel - // downwards, so subtracting half a subband results in the - // center of channel 0 (instead of the bottom). - return sbFreq - 0.5 * subbandBandwidth(); -} - -inline unsigned Parset::nrSlotsInFrame() const -{ - unsigned nrSlots = 0; - - nrSlots = getUint32("Observation.nrSlotsInFrame", 0); - - if (nrSlots == 0) { - // return default - return maxBeamletsPerRSP(nrBitsPerSample()); - } - - return nrSlots; -} - -inline string Parset::partitionName() const -{ - return getString("OLAP.CNProc.partition"); -} - -inline bool Parset::realTime() const -{ - return getBool("OLAP.realTime"); -} - -inline unsigned Parset::nrTABs(unsigned beam) const -{ - using boost::format; - - return getUint32(str(format("Observation.Beam[%u].nrTiedArrayBeams") % beam)); -} - -inline std::vector<unsigned> Parset::nrTABs() const -{ - std::vector<unsigned> counts(nrBeams()); - - for (unsigned beam = 0; beam < nrBeams(); beam++) - counts[beam] = nrTABs(beam); - - return counts; -} - -inline unsigned Parset::totalNrTABs() const -{ - std::vector<unsigned> beams = nrTABs(); - - return std::accumulate(beams.begin(), beams.end(), 0); -} - -inline unsigned Parset::maxNrTABs() const -{ - std::vector<unsigned> beams = nrTABs(); - - return *std::max_element(beams.begin(), beams.end()); -} - -inline BeamCoordinates Parset::TABs(unsigned beam) const -{ - BeamCoordinates coordinates; - - for (unsigned pencil = 0; pencil < nrTABs(beam); pencil ++) { - const std::vector<double> coords = getTAB(beam, pencil); - - // assume ra,dec - coordinates += BeamCoord3D(coords[0],coords[1]); - } - - return coordinates; -} - -inline string Parset::bandFilter() const -{ - return getString("Observation.bandFilter"); -} - -inline string Parset::antennaSet() const -{ - return getString("Observation.antennaSet"); -} - -inline bool Parset::PLC_controlled() const -{ - return getBool("OLAP.IONProc.PLC_controlled",false); -} - -inline string Parset::PLC_ProcID() const -{ - return getString("_processName","CNProc"); -} - -inline string Parset::PLC_Host() const -{ - using boost::format; - - string prefix = getString("_parsetPrefix"); // includes a trailing dot! - - return getString(str(format("%s_ACnode") % prefix)); -} - -inline uint32 Parset::PLC_Port() const -{ - using boost::format; - - string prefix = getString("_parsetPrefix"); // includes a trailing dot! - - return getUint32(str(format("%s_ACport") % prefix)); -} - -inline string Parset::PVSS_TempObsName() const -{ - return getString("_DPname",""); -} - -inline string Parset::AntennaSetsConf() const -{ - return getString("OLAP.Storage.AntennaSetsConf",""); -} - -inline string Parset::AntennaFieldsDir() const -{ - return getString("OLAP.Storage.AntennaFieldsDir",""); -} - -inline string Parset::HBADeltasDir() const -{ - return getString("OLAP.Storage.HBADeltasDir",""); -} - } // namespace RTCP } // namespace LOFAR diff --git a/RTCP/Interface/src/Parset.cc b/RTCP/Interface/src/Parset.cc index 48718807f5235601544171ede6a52ad837f76601..d6e3c4bc0a44192ebbbb30fcde969907c52e85df 100644 --- a/RTCP/Interface/src/Parset.cc +++ b/RTCP/Interface/src/Parset.cc @@ -25,7 +25,7 @@ #include <Common/LofarLogger.h> #include <Common/DataConvert.h> -#include <Common/lofar_datetime.h> +#include <ApplCommon/PosixTime.h> #include <Interface/Parset.h> #include <Interface/SmartPtr.h> #include <Interface/Exceptions.h> @@ -34,6 +34,7 @@ #include <boost/algorithm/string/classification.hpp> #include <boost/format.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string.hpp> @@ -46,6 +47,20 @@ namespace LOFAR { namespace RTCP { +static StokesType stokesType( const std::string &name ) { + if (name == "I") + return STOKES_I; + + if (name == "IQUV") + return STOKES_IQUV; + + if (name == "XXYY") + return STOKES_XXYY; + + return INVALID_STOKES; +}; + + Parset::Parset() { } @@ -320,6 +335,10 @@ unsigned Parset::maxNrStreamsPerPset(OutputType outputType, bool force) const return nrPsets == 0 ? 0 : (nrOutputStreams + nrPsets - 1) / nrPsets; } +size_t Parset::nrBytesPerComplexSample() const +{ + return 2 * nrBitsPerSample() / 8; +} unsigned Parset::nyquistZone() const { @@ -460,12 +479,12 @@ double Parset::beamDuration(unsigned beam) const std::vector<double> Parset::getTAB(unsigned beam, unsigned pencil) const { - std::vector<double> pencilBeam(2); + std::vector<double> TAB(2); - pencilBeam[0] = getDouble(str(boost::format("Observation.Beam[%u].TiedArrayBeam[%u].angle1") % beam % pencil)); - pencilBeam[1] = getDouble(str(boost::format("Observation.Beam[%u].TiedArrayBeam[%u].angle2") % beam % pencil)); + TAB[0] = getDouble(str(boost::format("Observation.Beam[%u].TiedArrayBeam[%u].angle1") % beam % pencil)); + TAB[1] = getDouble(str(boost::format("Observation.Beam[%u].TiedArrayBeam[%u].angle2") % beam % pencil)); - return pencilBeam; + return TAB; } @@ -648,5 +667,922 @@ int Parset::findIndex(unsigned pset, const vector<unsigned> &psets) return index != psets.size() ? static_cast<int>(index) : -1; } +double Parset::getTime(const char *name) const +{ + return to_time_t(boost::posix_time::time_from_string(getString(name))); +} + +unsigned Parset::nrTABs(unsigned beam) const +{ + using boost::format; + return getUint32(str(format("Observation.Beam[%u].nrTiedArrayBeams") % beam)); +} + +string Parset::PLC_Host() const +{ + using boost::format; + string prefix = getString("_parsetPrefix"); // includes a trailing dot! + return getString(str(format("%s_ACnode") % prefix)); +} + +uint32 Parset::PLC_Port() const +{ + using boost::format; + string prefix = getString("_parsetPrefix"); // includes a trailing dot! + return getUint32(str(format("%s_ACport") % prefix)); +} + + +std::string Parset::name() const +{ + return itsName; +} + +const Transpose2 &Parset::transposeLogic() const +{ + if (!itsTransposeLogic) + itsTransposeLogic = new Transpose2(*this); + + return *itsTransposeLogic; +} + +const CN_Transpose2 &Parset::CN_transposeLogic( unsigned pset, unsigned core ) const +{ + if (!itsCN_TransposeLogic) + itsCN_TransposeLogic = new CN_Transpose2(*this, pset, core); + + return *itsCN_TransposeLogic; +} + + +unsigned Parset::observationID() const +{ + return getUint32("Observation.ObsID"); +} + +double Parset::startTime() const +{ + return getTime("Observation.startTime"); +} + +double Parset::stopTime() const +{ + return getTime("Observation.stopTime"); +} + +unsigned Parset::nrCorrelatedBlocks() const +{ + return static_cast<unsigned>(floor( (stopTime() - startTime()) / IONintegrationTime())); +} + +unsigned Parset::nrBeamFormedBlocks() const +{ + return static_cast<unsigned>(floor( (stopTime() - startTime()) / CNintegrationTime())); +} + +string Parset::stationName(int index) const +{ + return allStationNames()[index]; +} + +int Parset::stationIndex(const std::string &name) const +{ + std::vector<std::string> names = allStationNames(); + for (unsigned i = 0; i < names.size(); i++) + if (names[i] == name) + return i; + + return -1; +} + +std::vector<std::string> Parset::allStationNames() const +{ + return getStringVector("OLAP.storageStationNames",true); +} + +bool Parset::hasStorage() const +{ + return getString("OLAP.OLAP_Conn.IONProc_Storage_Transport") != "NULL"; +} + +string Parset::getTransportType(const string& prefix) const +{ + return getString(prefix + "_Transport"); +} + +unsigned Parset::nrStations() const +{ + return allStationNames().size(); +} + +unsigned Parset::nrTabStations() const +{ + return getStringVector("OLAP.tiedArrayStationNames",true).size(); +} + +std::vector<std::string> Parset::mergedStationNames() const +{ + std::vector<string> tabStations = getStringVector("OLAP.tiedArrayStationNames",true); + + if (tabStations.empty()) + return getStringVector("OLAP.storageStationNames",true); + else + return tabStations; +} + +unsigned Parset::nrMergedStations() const +{ + const std::vector<unsigned> list = tabList(); + + if (list.empty()) + return nrStations(); + + return *std::max_element( list.begin(), list.end() ) + 1; +} + +unsigned Parset::nrBaselines() const +{ + unsigned stations; + + if (nrTabStations() > 0) + stations = nrTabStations(); + else + stations = nrStations(); + + return stations * (stations + 1) / 2; +} + +unsigned Parset::nrCrossPolarisations() const +{ + return (getUint32("Observation.nrPolarisations") * getUint32("Observation.nrPolarisations")); +} + +unsigned Parset::clockSpeed() const +{ + return getUint32("Observation.sampleClock") * 1000000; +} + +double Parset::subbandBandwidth() const +{ + return 1.0 * clockSpeed() / 1024; +} + +double Parset::sampleDuration() const +{ + return 1.0 / subbandBandwidth(); +} + +unsigned Parset::dedispersionFFTsize() const +{ + return isDefined("OLAP.CNProc.dedispersionFFTsize") ? getUint32("OLAP.CNProc.dedispersionFFTsize") : CNintegrationSteps(); +} + +unsigned Parset::nrBitsPerSample() const +{ + const std::string key = "Observation.nrBitsPerSample"; + + if (isDefined(key)) { + return getUint32(key); + } else { +#ifndef HAVE_BGP_CN + LOG_WARN_STR( "Missing key " << key << ", using the depricated key OLAP.nrBitsPerSample"); +#endif + return getUint32("OLAP.nrBitsPerSample", 16); + } +} + +unsigned Parset::CNintegrationSteps() const +{ + return getUint32("OLAP.CNProc.integrationSteps"); +} + +unsigned Parset::IONintegrationSteps() const +{ + return getUint32("OLAP.IONProc.integrationSteps"); +} + +unsigned Parset::integrationSteps() const +{ + return CNintegrationSteps() * IONintegrationSteps(); +} + +unsigned Parset::coherentStokesTimeIntegrationFactor() const +{ + return getUint32("OLAP.CNProc_CoherentStokes.timeIntegrationFactor"); +} + +unsigned Parset::incoherentStokesTimeIntegrationFactor() const +{ + return getUint32("OLAP.CNProc_IncoherentStokes.timeIntegrationFactor"); +} + +unsigned Parset::coherentStokesChannelsPerSubband() const +{ + unsigned numch = getUint32("OLAP.CNProc_CoherentStokes.channelsPerSubband"); + + if (numch == 0) + return nrChannelsPerSubband(); + else + return numch; +} + +unsigned Parset::incoherentStokesChannelsPerSubband() const +{ + unsigned numch = getUint32("OLAP.CNProc_IncoherentStokes.channelsPerSubband"); + + if (numch == 0) + return nrChannelsPerSubband(); + else + return numch; +} + +std::string Parset::coherentStokes() const +{ + return getString("OLAP.CNProc_CoherentStokes.which"); +} + +std::string Parset::incoherentStokes() const +{ + return getString("OLAP.CNProc_IncoherentStokes.which"); +} + +bool Parset::outputFilteredData() const +{ + return getBool("Observation.DataProducts.Output_FilteredData.enabled", false); +} + +bool Parset::outputCorrelatedData() const +{ + return getBool("Observation.DataProducts.Output_Correlated.enabled", false); +} + +bool Parset::outputBeamFormedData() const +{ + return getBool("Observation.DataProducts.Output_Beamformed.enabled", false); +} + +bool Parset::outputTrigger() const +{ + return getBool("Observation.DataProducts.Output_Trigger.enabled", false); +} + +bool Parset::outputThisType(OutputType outputType) const +{ + return getBool(keyPrefix(outputType) + ".enabled", false); +} + +bool Parset::onlineFlagging() const +{ + return getBool("OLAP.CNProc.onlineFlagging", false); +} + +bool Parset::onlinePreCorrelationFlagging() const +{ + return getBool("OLAP.CNProc.onlinePreCorrelationFlagging", false); +} + +bool Parset::onlinePreCorrelationNoChannelsFlagging() const +{ + return getBool("OLAP.CNProc.onlinePreCorrelationNoChannelsFlagging", false); +} + +bool Parset::onlinePostCorrelationFlagging() const +{ + return getBool("OLAP.CNProc.onlinePostCorrelationFlagging", false); +} + + unsigned Parset::onlinePreCorrelationFlaggingIntegration() const +{ + return getUint32("OLAP.CNProc.onlinePostCorrelationFlaggingIntegration", 0); +} + + +string Parset::onlinePreCorrelationFlaggingType(std::string defaultVal) const +{ + return getString("OLAP.CNProc.onlinePreCorrelationFlaggingType", defaultVal); +} + +string Parset::onlinePreCorrelationFlaggingStatisticsType(std::string defaultVal) const +{ + return getString("OLAP.CNProc.onlinePreCorrelationFlaggingStatisticsType", defaultVal); +} + +string Parset::onlinePostCorrelationFlaggingType(std::string defaultVal) const +{ + return getString("OLAP.CNProc.onlinePostCorrelationFlaggingType", defaultVal); +} + +string Parset::onlinePostCorrelationFlaggingStatisticsType(std::string defaultVal) const +{ + return getString("OLAP.CNProc.onlinePostCorrelationFlaggingStatisticsType", defaultVal); +} + +bool Parset::onlinePostCorrelationFlaggingDetectBrokenStations() const +{ + return getBool("OLAP.CNProc.onlinePostCorrelationFlaggingDetectBrokenStations", false); +} + +bool Parset::fakeInputData() const +{ + return getBool("OLAP.CNProc.fakeInputData", false); +} + +bool Parset::checkFakeInputData() const +{ + return getBool("OLAP.CNProc.checkFakeInputData", false); +} + +double Parset::CNintegrationTime() const +{ + return nrSamplesPerSubband() / subbandBandwidth(); +} + +double Parset::IONintegrationTime() const +{ + return CNintegrationTime() * IONintegrationSteps(); +} + +unsigned Parset::nrSamplesPerSubband() const +{ + return CNintegrationSteps() * nrChannelsPerSubband(); +} + +unsigned Parset::nrSamplesPerChannel() const +{ + return CNintegrationSteps(); +} + +unsigned Parset::nrHistorySamples() const +{ + return nrChannelsPerSubband() > 1 ? (nrPPFTaps() - 1) * nrChannelsPerSubband() : 0; +} + +unsigned Parset::nrSamplesToCNProc() const +{ + return nrSamplesPerSubband() + nrHistorySamples() + 32 / (NR_POLARIZATIONS * 2 * nrBitsPerSample() / 8); +} + +unsigned Parset::inputBufferSize() const +{ + return (unsigned) (getDouble("OLAP.nrSecondsOfBuffer") * subbandBandwidth()); +} + +unsigned Parset::maxNetworkDelay() const +{ + return (unsigned) (getDouble("OLAP.maxNetworkDelay") * subbandBandwidth()); +} + +unsigned Parset::nrSubbandsPerPset() const +{ + unsigned psets = phaseTwoPsets().size(); + unsigned subbands = nrSubbands(); + + return (psets == 0 ? 0 : subbands + psets - 1) / psets; +} + +unsigned Parset::coherentStokesNrSubbandsPerFile() const +{ + return std::min( getUint32("OLAP.CNProc_CoherentStokes.subbandsPerFile"), nrSubbands() ); +} + +unsigned Parset::incoherentStokesNrSubbandsPerFile() const +{ + return std::min( getUint32("OLAP.CNProc_IncoherentStokes.subbandsPerFile"), nrSubbands() ); +} + +unsigned Parset::nrPhase3StreamsPerPset() const +{ + return maxNrStreamsPerPset(BEAM_FORMED_DATA) + maxNrStreamsPerPset(TRIGGER_DATA); +} + +unsigned Parset::nrPPFTaps() const +{ + return getUint32("OLAP.CNProc.nrPPFTaps"); +} + +unsigned Parset::nrChannelsPerSubband() const +{ + return getUint32("Observation.channelsPerSubband"); +} + +std::vector<unsigned> Parset::phaseOneTwoCores() const +{ + return getUint32Vector("OLAP.CNProc.phaseOneTwoCores", true); +} + +std::vector<unsigned> Parset::phaseThreeCores() const +{ + return getUint32Vector("OLAP.CNProc.phaseThreeCores",true); +} + +unsigned Parset::nrCoresPerPset() const +{ + return usedCoresInPset().size(); +} + +vector<unsigned> Parset::subbandList() const +{ + return getUint32Vector("Observation.subbandList",true); +} + +unsigned Parset::nrSubbands() const +{ + return getUint32Vector("Observation.subbandList",true).size(); +} + +unsigned Parset::nrSubbandsPerSAP(unsigned sap) const +{ + std::vector<unsigned> mapping = subbandToSAPmapping(); + + return std::count(mapping.begin(), mapping.end(), sap); +} + +std::vector<unsigned> Parset::subbandToSAPmapping() const +{ + return getUint32Vector("Observation.beamList",true); +} + +double Parset::channelWidth() const +{ + return subbandBandwidth() / nrChannelsPerSubband(); +} + +bool Parset::delayCompensation() const +{ + return getBool("OLAP.delayCompensation"); +} + +unsigned Parset::nrCalcDelays() const +{ + return getUint32("OLAP.DelayComp.nrCalcDelays"); +} + +string Parset::positionType() const +{ + return getString("OLAP.DelayComp.positionType"); +} + +double Parset::clockCorrectionTime(const std::string &station) const +{ + return getDouble(std::string("PIC.Core.") + station + ".clockCorrectionTime",0.0); +} + +bool Parset::correctBandPass() const +{ + return getBool("OLAP.correctBandPass"); +} + +unsigned Parset::nrPsetsPerStorage() const +{ + return getUint32("OLAP.psetsPerStorage"); +} + +unsigned Parset::getLofarStManVersion() const +{ + return getUint32("OLAP.LofarStManVersion", 2); +} + +vector<unsigned> Parset::phaseOnePsets() const +{ + return getUint32Vector("OLAP.CNProc.phaseOnePsets",true); +} + +vector<unsigned> Parset::phaseTwoPsets() const +{ + return getUint32Vector("OLAP.CNProc.phaseTwoPsets",true); +} + +vector<unsigned> Parset::phaseThreePsets() const +{ + return getUint32Vector("OLAP.CNProc.phaseThreePsets",true); +} + +unsigned Parset::totalNrPsets() const +{ + const std::string key = "OLAP.IONProc.psetList"; + + if (isDefined(key)) { + return getStringVector(key,true).size(); + } else { + LOG_WARN_STR( "Missing key " << key << ", using the used psets as a fallback"); + return usedPsets().size(); + } +} + +vector<unsigned> Parset::tabList() const +{ + return getUint32Vector("OLAP.CNProc.tabList",true); +} + +int Parset::phaseOnePsetIndex(unsigned pset) const +{ + return findIndex(pset, phaseOnePsets()); +} + +int Parset::phaseTwoPsetIndex(unsigned pset) const +{ + return findIndex(pset, phaseTwoPsets()); +} + +int Parset::phaseThreePsetIndex(unsigned pset) const +{ + return findIndex(pset, phaseThreePsets()); +} + +int Parset::phaseOneCoreIndex(unsigned core) const +{ + return findIndex(core, phaseOneTwoCores()); +} + +int Parset::phaseTwoCoreIndex(unsigned core) const +{ + return findIndex(core, phaseOneTwoCores()); +} + +int Parset::phaseThreeCoreIndex(unsigned core) const +{ + return findIndex(core, phaseThreeCores()); +} + +double Parset::channel0Frequency(size_t subband) const +{ + double sbFreq = subbandToFrequencyMapping()[subband]; + + if (nrChannelsPerSubband() == 1) + return sbFreq; + + // if the 2nd PPF is used, the subband is shifted half a channel + // downwards, so subtracting half a subband results in the + // center of channel 0 (instead of the bottom). + return sbFreq - 0.5 * subbandBandwidth(); +} + +unsigned Parset::nrSlotsInFrame() const +{ + unsigned nrSlots = 0; + + nrSlots = getUint32("Observation.nrSlotsInFrame", 0); + + if (nrSlots == 0) { + // return default + return maxBeamletsPerRSP(nrBitsPerSample()); + } + + return nrSlots; +} + +string Parset::partitionName() const +{ + return getString("OLAP.CNProc.partition"); +} + +bool Parset::realTime() const +{ + return getBool("OLAP.realTime"); +} + +std::vector<unsigned> Parset::nrTABs() const +{ + std::vector<unsigned> counts(nrBeams()); + + for (unsigned beam = 0; beam < nrBeams(); beam++) + counts[beam] = nrTABs(beam); + + return counts; +} + +unsigned Parset::totalNrTABs() const +{ + std::vector<unsigned> beams = nrTABs(); + + return std::accumulate(beams.begin(), beams.end(), 0); +} + +unsigned Parset::maxNrTABs() const +{ + std::vector<unsigned> beams = nrTABs(); + + return *std::max_element(beams.begin(), beams.end()); +} + +BeamCoordinates Parset::TABs(unsigned beam) const +{ + BeamCoordinates coordinates; + + for (unsigned pencil = 0; pencil < nrTABs(beam); pencil ++) { + const std::vector<double> coords = getTAB(beam, pencil); + + // assume ra,dec + coordinates += BeamCoord3D(coords[0],coords[1]); + } + + return coordinates; +} + +string Parset::bandFilter() const +{ + return getString("Observation.bandFilter"); +} + +string Parset::antennaSet() const +{ + return getString("Observation.antennaSet"); +} + +bool Parset::PLC_controlled() const +{ + return getBool("OLAP.IONProc.PLC_controlled",false); +} + +string Parset::PLC_ProcID() const +{ + return getString("_processName","CNProc"); +} + +string Parset::PVSS_TempObsName() const +{ + return getString("_DPname",""); +} + +string Parset::AntennaSetsConf() const +{ + return getString("OLAP.Storage.AntennaSetsConf",""); +} + +string Parset::AntennaFieldsDir() const +{ + return getString("OLAP.Storage.AntennaFieldsDir",""); +} + +string Parset::HBADeltasDir() const +{ + return getString("OLAP.Storage.HBADeltasDir",""); +} + +void StreamInfo::log() const +{ + LOG_DEBUG_STR( "Stream " << stream << " is sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part << " consisting of subbands " << subbands ); +} + +static unsigned divideRoundUp( unsigned a, unsigned b ) +{ + return b == 0 ? 0 : (a + b - 1) / b; +} + +Transpose2::Transpose2( const Parset &parset ) +: + phaseThreeDisjunct( parset.phaseThreeDisjunct() ), + + nrChannels( parset.nrChannelsPerSubband() ), + nrCoherentChannels( parset.coherentStokesChannelsPerSubband() ), + nrIncoherentChannels( parset.incoherentStokesChannelsPerSubband() ), + nrSamples( parset.CNintegrationSteps() ), + coherentTimeIntFactor( parset.coherentStokesTimeIntegrationFactor() ), + incoherentTimeIntFactor( parset.incoherentStokesTimeIntegrationFactor() ), + + nrBeams( parset.totalNrTABs() ), + coherentNrSubbandsPerFile( parset.coherentStokesNrSubbandsPerFile() ), + incoherentNrSubbandsPerFile( parset.incoherentStokesNrSubbandsPerFile() ), + + nrPhaseTwoPsets( parset.phaseTwoPsets().size() ), + nrPhaseTwoCores( parset.phaseOneTwoCores().size() ), + nrPhaseThreePsets( parset.phaseThreePsets().size() ), + nrPhaseThreeCores( parset.phaseThreeCores().size() ), + + nrSubbandsPerPset( parset.nrSubbandsPerPset() ), + streamInfo( generateStreamInfo(parset) ), + nrStreamsPerPset( divideRoundUp( nrStreams(), parset.phaseThreePsets().size() ) ) +{ +} + +unsigned Transpose2::nrStreams() const +{ + return streamInfo.size(); +} + +// compose and decompose a stream number +unsigned Transpose2::stream( unsigned sap, unsigned beam, unsigned stokes, unsigned part, unsigned startAt ) const +{ + for (unsigned i = startAt; i < streamInfo.size(); i++) { + const struct StreamInfo &info = streamInfo[i]; + + if (sap == info.sap && beam == info.beam && stokes == info.stokes && part == info.part) + return i; + } + + // shouldn't reach this point + ASSERTSTR(false, "Requested non-existing sap " << sap << " beam " << beam << " stokes " << stokes << " part " << part); + + return 0; +} + +void Transpose2::decompose( unsigned stream, unsigned &sap, unsigned &beam, unsigned &stokes, unsigned &part ) const +{ + const struct StreamInfo &info = streamInfo[stream]; + + sap = info.sap; + beam = info.beam; + stokes = info.stokes; + part = info.part; +} + +std::vector<unsigned> Transpose2::subbands( unsigned stream ) const +{ + ASSERT(stream < streamInfo.size()); + + return streamInfo[stream].subbands; +} + +unsigned Transpose2::nrSubbands( unsigned stream ) const +{ + return stream >= streamInfo.size() ? 0 : subbands(stream).size(); +} + +static bool streamInfoSubbandsComp( const struct StreamInfo &a, const struct StreamInfo &b ) +{ + return a.subbands.size() < b.subbands.size(); +} + +unsigned Transpose2::maxNrSubbands() const +{ + return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoSubbandsComp )->subbands.size(); +} + +static bool streamInfoChannelsComp( const struct StreamInfo &a, const struct StreamInfo &b ) +{ + return a.nrChannels < b.nrChannels; +} + +unsigned Transpose2::maxNrChannels() const { + return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoChannelsComp )->nrChannels; +} + +static bool streamInfoSamplesComp( const struct StreamInfo &a, const struct StreamInfo &b ) +{ + return a.nrSamples < b.nrSamples; +} + +unsigned Transpose2::maxNrSamples() const +{ + return streamInfo.size() == 0 ? 0 : std::max_element( streamInfo.begin(), streamInfo.end(), &streamInfoSamplesComp )->nrSamples; +} + +size_t Transpose2::subbandSize( unsigned stream ) const +{ + const StreamInfo &info = streamInfo[stream]; + + return (size_t)info.nrChannels * (info.nrSamples|2) * sizeof(float); +} + +unsigned Transpose2::sourceCore( unsigned subband, unsigned block ) const +{ + return (block * nrSubbandsPerPset + subband % nrSubbandsPerPset) % nrPhaseTwoCores; +} + +unsigned Transpose2::sourcePset( unsigned subband, unsigned block ) const +{ + (void)block; + return subband / nrSubbandsPerPset; +} + +unsigned Transpose2::destCore( unsigned stream, unsigned block ) const +{ + return (block * phaseThreeGroupSize() + stream % nrStreamsPerPset) % nrPhaseThreeCores; +} + +unsigned Transpose2::destPset( unsigned stream, unsigned block ) const +{ + (void)block; + return stream / nrStreamsPerPset; +} + +unsigned Transpose2::phaseThreeGroupSize() const +{ + return phaseThreeDisjunct ? nrStreamsPerPset : nrSubbandsPerPset; +} + + +std::vector<struct StreamInfo> Transpose2::generateStreamInfo( const Parset &parset ) const +{ + // get all info from parset, since we will be called while constructing our members + + // ParameterSets are SLOW, so cache any info we need repeatedly + + std::vector<struct StreamInfo> infoset; + const std::vector<unsigned> sapMapping = parset.subbandToSAPmapping(); + const unsigned nrSAPs = parset.nrBeams(); + const unsigned nrSubbands = parset.nrSubbands(); + const unsigned nrCoherentSubbandsPerFile = parset.coherentStokesNrSubbandsPerFile(); + const unsigned nrIncoherentSubbandsPerFile = parset.incoherentStokesNrSubbandsPerFile(); + + const unsigned nrCoherentStokes = parset.coherentStokes().size(); + const StokesType coherentType = stokesType( parset.coherentStokes() ); + const unsigned nrCoherentChannels = parset.coherentStokesChannelsPerSubband(); + const unsigned nrCoherentTimeIntFactor = parset.coherentStokesTimeIntegrationFactor(); + + const unsigned nrIncoherentStokes = parset.incoherentStokes().size(); + const StokesType incoherentType = stokesType( parset.incoherentStokes() ); + const unsigned nrIncoherentChannels = parset.incoherentStokesChannelsPerSubband(); + const unsigned nrIncoherentTimeIntFactor = parset.incoherentStokesTimeIntegrationFactor(); + + const unsigned nrSamples = parset.CNintegrationSteps(); + + struct StreamInfo info; + info.stream = 0; + + for (unsigned sap = 0; sap < nrSAPs; sap++) { + const unsigned nrBeams = parset.nrTABs(sap); + + info.sap = sap; + + std::vector<unsigned> sapSubbands; + + for (unsigned sb = 0; sb < nrSubbands; sb++) + if (sapMapping[sb] == sap) + sapSubbands.push_back(sb); + + for (unsigned beam = 0; beam < nrBeams; beam++) { + info.beam = beam; + + const bool coherent = parset.isCoherent(sap, beam); + const unsigned nrStokes = coherent ? nrCoherentStokes : nrIncoherentStokes; + + info.coherent = coherent; + info.nrChannels = coherent ? nrCoherentChannels : nrIncoherentChannels; + info.timeIntFactor = coherent ? nrCoherentTimeIntFactor : nrIncoherentTimeIntFactor; + info.nrStokes = nrStokes; + info.stokesType = coherent ? coherentType : incoherentType; + info.nrSamples = nrSamples / info.timeIntFactor; + + const unsigned nrSubbandsPerFile = coherent ? nrCoherentSubbandsPerFile : nrIncoherentSubbandsPerFile; + + for (unsigned stokes = 0; stokes < nrStokes; stokes++) { + info.stokes = stokes; + info.part = 0; + + // split into parts of at most nrSubbandsPerFile + for (unsigned sb = 0; sb < sapSubbands.size(); sb += nrSubbandsPerFile ) { + for (unsigned i = 0; sb + i < sapSubbands.size() && i < nrSubbandsPerFile; i++) + info.subbands.push_back(sapSubbands[sb + i]); + + infoset.push_back(info); + + info.subbands.clear(); + info.part++; + info.stream++; + } + } + } + } + + return infoset; +} + +CN_Transpose2::CN_Transpose2( const Parset &parset, unsigned myPset, unsigned myCore ) +: + Transpose2( parset ), + myPset( myPset ), + myCore( myCore ), + + phaseTwoPsetIndex( parset.phaseTwoPsetIndex(myPset) ), + phaseTwoCoreIndex( parset.phaseTwoCoreIndex(myCore) ), + phaseThreePsetIndex( parset.phaseThreePsetIndex(myPset) ), + phaseThreeCoreIndex( parset.phaseThreeCoreIndex(myCore) ) +{ +} + +int CN_Transpose2::myStream( unsigned block ) const +{ + unsigned first = phaseThreePsetIndex * nrStreamsPerPset; + unsigned blockShift = (phaseThreeGroupSize() * block) % nrPhaseThreeCores; + unsigned relative = (nrPhaseThreeCores + phaseThreeCoreIndex - blockShift) % nrPhaseThreeCores; + + // such a stream does not exist + if (first + relative >= nrStreams()) + return -1; + + // we could handle this stream, but it's handled by a subsequent pset + if (relative >= nrStreamsPerPset) + return -1; + + return first + relative; +} + +unsigned CN_Transpose2::myPart( unsigned subband, bool coherent ) const +{ + for (unsigned i = 0; i < streamInfo.size(); i++) { + const struct StreamInfo &info = streamInfo[i]; + + if ( info.coherent == coherent + && info.subbands[0] <= subband + && info.subbands[info.subbands.size()-1] >= subband ) + return info.part; + } + + // we reach this point if there are no beams of this coherency + return 0; +} + + } // namespace RTCP } // namespace LOFAR diff --git a/RTCP/MetaDataGatherer/CMakeLists.txt b/RTCP/MetaDataGatherer/CMakeLists.txt index e99cda10c7d864d1e44e836f2241dd9adbb20c4e..cae4d0d207636f1e7b014978819c8911a684d858 100644 --- a/RTCP/MetaDataGatherer/CMakeLists.txt +++ b/RTCP/MetaDataGatherer/CMakeLists.txt @@ -3,7 +3,8 @@ lofar_package(MetaDataGatherer 1.0 DEPENDS Common Stream OTDB Interface Storage) include(LofarFindPackage) -lofar_find_package(Casacore COMPONENTS casa ms tables REQUIRED) +lofar_find_package(Casacore COMPONENTS casa measures REQUIRED) +lofar_find_package(Boost REQUIRED date_time) add_subdirectory(src) add_subdirectory(test) diff --git a/RTCP/MetaDataGatherer/src/FinalMetaDataGatherer.cc b/RTCP/MetaDataGatherer/src/FinalMetaDataGatherer.cc index 69b9d4d011acccd7fda71334884ef9dbf5765f2d..cfaf246c7d34030d4847740e20e5234901d87126 100644 --- a/RTCP/MetaDataGatherer/src/FinalMetaDataGatherer.cc +++ b/RTCP/MetaDataGatherer/src/FinalMetaDataGatherer.cc @@ -45,6 +45,8 @@ // boost #include <boost/format.hpp> +#include <boost/lexical_cast.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> // Casacore #include <measures/Measures/MEpoch.h> @@ -58,6 +60,7 @@ using namespace LOFAR::RTCP; using namespace LOFAR::OTDB; using namespace std; using namespace casa; +using namespace boost::posix_time; // Use a terminate handler that can produce a backtrace. Exception::TerminateHandler t(Exception::terminate); diff --git a/RTCP/MetaDataGatherer/src/failedtilesinfo.cc b/RTCP/MetaDataGatherer/src/failedtilesinfo.cc index 4e5750ec447f1ad5c5861af63992cefb5a28b0c6..1730236d5f0ad434df75b18a7d0ceadd3190f482 100644 --- a/RTCP/MetaDataGatherer/src/failedtilesinfo.cc +++ b/RTCP/MetaDataGatherer/src/failedtilesinfo.cc @@ -47,10 +47,14 @@ #include <measures/Measures/MEpoch.h> #include <casa/Quanta/MVTime.h> +// Boost +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace std; using namespace LOFAR; using namespace LOFAR::OTDB; using namespace casa; +using namespace boost::posix_time; // Use a terminate handler that can produce a backtrace. Exception::TerminateHandler t(Exception::terminate); diff --git a/RTCP/RTCPTools/CMakeLists.txt b/RTCP/RTCPTools/CMakeLists.txt index 5d2d743e3456d925e09ae25836f080402fc59953..1e5a1625fe5c75aa13feb1f97afe9c9e7a6a124b 100644 --- a/RTCP/RTCPTools/CMakeLists.txt +++ b/RTCP/RTCPTools/CMakeLists.txt @@ -2,4 +2,7 @@ lofar_package(RTCPTools 1.0) +include(LofarFindPackage) +lofar_find_package(Boost REQUIRED) + add_subdirectory(src) diff --git a/RTCP/Storage/CMakeLists.txt b/RTCP/Storage/CMakeLists.txt index 1ec905111dc543c0ea6458f7d8fcfb1999dfab4d..cb43c00703f619687d3070b31e5d45fc1de9dd53 100644 --- a/RTCP/Storage/CMakeLists.txt +++ b/RTCP/Storage/CMakeLists.txt @@ -6,6 +6,7 @@ include(LofarFindPackage) lofar_find_package(Casacore COMPONENTS casa ms tables REQUIRED) lofar_find_package(DAL REQUIRED) lofar_find_package(HDF5 REQUIRED) +lofar_find_package(Boost REQUIRED) add_subdirectory(include/Storage) add_subdirectory(src) diff --git a/RTCP/Storage/src/Storage_main.cc b/RTCP/Storage/src/Storage_main.cc index f282b0db84567f72d5e003b01de293c0e9cbe468..06d0a903e7dee9963b0de3d9e32a6e278cf1cc6c 100644 --- a/RTCP/Storage/src/Storage_main.cc +++ b/RTCP/Storage/src/Storage_main.cc @@ -42,6 +42,7 @@ #include <vector> #include <boost/format.hpp> +#include <boost/lexical_cast.hpp> // install a new handler to produce backtraces for bad_alloc diff --git a/RTCP/Storage/src/createHeaders.cc b/RTCP/Storage/src/createHeaders.cc index adb1547b12c417b39a804f4f2f2456ee3a9b563c..fd82618fc7c50959c988eaf272ea106368f53792 100644 --- a/RTCP/Storage/src/createHeaders.cc +++ b/RTCP/Storage/src/createHeaders.cc @@ -20,6 +20,7 @@ #include <string> #include <boost/format.hpp> +#include <boost/lexical_cast.hpp> using namespace LOFAR; using namespace LOFAR::RTCP; diff --git a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jCommon.cc b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jCommon.cc index a32f60924cfea7b061d20d85d695ec96a6b78c88..aa24f69d4a90b2862b28a3be632d922b4447105a 100644 --- a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jCommon.cc +++ b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jCommon.cc @@ -25,8 +25,7 @@ #include <Common/LofarLogger.h> #include <Common/StringUtil.h> #include <jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jCommon.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <boost/date_time/posix_time/time_formatters.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include <string> #include <iostream> #include <map> diff --git a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.cc b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.cc index 634cf75eb8673d5fbd22334242df9560bb63f414..dc87044ed098bb7802491d4ec39db2b34532cc73 100644 --- a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.cc +++ b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.cc @@ -22,7 +22,6 @@ //# Always #include <lofar_config.h> first! #include <lofar_config.h> -# #include <Common/LofarLogger.h> #include <Common/StringUtil.h> #include <jni.h> @@ -36,8 +35,7 @@ #include <OTDB/TreeStateConv.h> #include <OTDB/TreeTypeConv.h> #include <OTDB/UnitConv.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <boost/date_time/posix_time/time_formatters.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include <string> #include <iostream> diff --git a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc index 95df2ce4e028d4cfd04d249ed8e5f8d88ce33432..7abb84e4a5ddf242520e7936f66b10161675061c 100644 --- a/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc +++ b/SAS/OTB/jOTDB3/src/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.cc @@ -29,9 +29,7 @@ #include <jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jCommon.h> #include <jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jOTDBconnection.h> #include <jOTDB3/nl_astron_lofar_sas_otb_jotdb3_jTreeValue.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <boost/date_time/posix_time/time_formatters.hpp> -#include <boost/date_time/posix_time/time_parsers.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include <string> #include <iostream> diff --git a/SAS/OTDB/CMakeLists.txt b/SAS/OTDB/CMakeLists.txt index 36bd8e2e438c871fb5609864c6890eecf89bad45..89150c3510ddf291ce25e07f4e63cb378bb2907e 100644 --- a/SAS/OTDB/CMakeLists.txt +++ b/SAS/OTDB/CMakeLists.txt @@ -1,6 +1,6 @@ # $Id$ -lofar_package(OTDB 1.0 DEPENDS Common) +lofar_package(OTDB 1.0 DEPENDS ApplCommon Common) include(LofarFindPackage) lofar_find_package(Boost REQUIRED COMPONENTS date_time) diff --git a/SAS/OTDB/include/OTDB/CampaignInfo.h b/SAS/OTDB/include/OTDB/CampaignInfo.h index 3a35bac2900a5008c6a82429752c5fdeb9e8dfe0..05e849699a2c8ba3c6bf7159c5e57a0d552956bd 100644 --- a/SAS/OTDB/include/OTDB/CampaignInfo.h +++ b/SAS/OTDB/include/OTDB/CampaignInfo.h @@ -30,9 +30,7 @@ //# Includes #include <OTDB/OTDBconstants.h> #include <OTDB/OTDBtypes.h> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/include/OTDB/Converter.h b/SAS/OTDB/include/OTDB/Converter.h index 0f2ec9abbfb5f0674e971a786220c037a56e815c..74240d53534377e5090adc314ceed1a3586c5835 100644 --- a/SAS/OTDB/include/OTDB/Converter.h +++ b/SAS/OTDB/include/OTDB/Converter.h @@ -31,7 +31,6 @@ #include <Common/lofar_map.h> #include <Common/lofar_string.h> #include <Common/LofarTypes.h> -#include <pqxx/pqxx> namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/include/OTDB/DefaultTemplate.h b/SAS/OTDB/include/OTDB/DefaultTemplate.h index 299b7d0f759a3aa182c6031f49a45bdab7bcfd6b..47ebe27cb6949d055d4c9a7afd661979094de9a3 100644 --- a/SAS/OTDB/include/OTDB/DefaultTemplate.h +++ b/SAS/OTDB/include/OTDB/DefaultTemplate.h @@ -30,10 +30,7 @@ //# Includes #include <OTDB/OTDBconstants.h> #include <OTDB/OTDBtypes.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/include/OTDB/OTDBaction.h b/SAS/OTDB/include/OTDB/OTDBaction.h index cbe7eeb36c16f435c6c857b456c252671f64fc30..be62bea0b9ad2b16c847525528a5c8913b6deee7 100644 --- a/SAS/OTDB/include/OTDB/OTDBaction.h +++ b/SAS/OTDB/include/OTDB/OTDBaction.h @@ -28,7 +28,6 @@ //# Never #include <config.h> or #include <lofar_config.h> in a header file! //# Includes -#include <Common/lofar_datetime.h> #include <OTDB/OTDBtypes.h> namespace LOFAR { diff --git a/SAS/OTDB/include/OTDB/OTDBconnection.h b/SAS/OTDB/include/OTDB/OTDBconnection.h index 318030b4124a54f0471b98ee2858c74415befb28..52a4fc2b7cb80f18b2c561e3ea13db380cde31d5 100644 --- a/SAS/OTDB/include/OTDB/OTDBconnection.h +++ b/SAS/OTDB/include/OTDB/OTDBconnection.h @@ -33,12 +33,14 @@ #include <OTDB/DefaultTemplate.h> #include <Common/lofar_vector.h> #include <Common/lofar_map.h> - -using namespace pqxx; +#include <pqxx/connection> namespace LOFAR { namespace OTDB { +using boost::posix_time::min_date_time; +using boost::posix_time::max_date_time; + // \addtogroup OTDB // @{ @@ -120,7 +122,7 @@ public: //# --- accessor functions --- inline string errorMsg() const; inline uint32 getAuthToken() const; - inline connection* getConn() const; + inline pqxx::connection* getConn() const; inline string getDBName() const; private: @@ -135,7 +137,7 @@ private: string itsHost; string itsPort; bool itsIsConnected; - connection* itsConnection; + pqxx::connection* itsConnection; uint32 itsAuthToken; string itsError; }; @@ -165,7 +167,7 @@ inline uint32 OTDBconnection::getAuthToken() const //# a non copyable object, making it difficult to define a call like: //# work(*) OTDBconnection::transaction(transactionName); //# -inline connection* OTDBconnection::getConn() const +inline pqxx::connection* OTDBconnection::getConn() const { return (itsConnection); } diff --git a/SAS/OTDB/include/OTDB/OTDBeventList.h b/SAS/OTDB/include/OTDB/OTDBeventList.h index b57f4a9b81269681531bc0ab5e3a3340633fa0ed..ea8968cae8b5503f5afe6439859de6001a56fba7 100644 --- a/SAS/OTDB/include/OTDB/OTDBeventList.h +++ b/SAS/OTDB/include/OTDB/OTDBeventList.h @@ -28,7 +28,6 @@ //# Never #include <config.h> or #include <lofar_config.h> in a header file! //# Includes -#include <Common/lofar_datetime.h> #include <Common/lofar_vector.h> #include <OTDB/OTDBtypes.h> #include <OTDB/OTDBevent.h> diff --git a/SAS/OTDB/include/OTDB/OTDBnode.h b/SAS/OTDB/include/OTDB/OTDBnode.h index d65b788a704a277e21d792b91686248033c15003..1985bf1c8acdeedb64620cee096405598f053d63 100644 --- a/SAS/OTDB/include/OTDB/OTDBnode.h +++ b/SAS/OTDB/include/OTDB/OTDBnode.h @@ -30,10 +30,7 @@ //# Includes #include <OTDB/OTDBconstants.h> #include <OTDB/OTDBtypes.h> -#include <boost/date_time/posix_time/ptime.hpp> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/include/OTDB/OTDBparam.h b/SAS/OTDB/include/OTDB/OTDBparam.h index 89b918dab6bf59906c8283551497c7acdb7505db..b5a403bec80bb2da6fe3cb942fd548c7d08e8aff 100644 --- a/SAS/OTDB/include/OTDB/OTDBparam.h +++ b/SAS/OTDB/include/OTDB/OTDBparam.h @@ -31,9 +31,7 @@ #include <OTDB/OTDBconstants.h> #include <OTDB/OTDBtypes.h> #include <boost/date_time/posix_time/ptime.hpp> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/include/OTDB/OTDBtree.h b/SAS/OTDB/include/OTDB/OTDBtree.h index 6df6132bf868091f2496f1bdcd6498d7a047a65c..c8f846cc847d94ffff77ac63f60d652f9a889d45 100644 --- a/SAS/OTDB/include/OTDB/OTDBtree.h +++ b/SAS/OTDB/include/OTDB/OTDBtree.h @@ -30,14 +30,15 @@ //# Includes #include <OTDB/OTDBconstants.h> #include <OTDB/OTDBtypes.h> +#include <Common/lofar_string.h> #include <boost/date_time/posix_time/ptime.hpp> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> namespace LOFAR { namespace OTDB { +using boost::posix_time::ptime; + // \addtogroup OTDB // @{ diff --git a/SAS/OTDB/include/OTDB/OTDBvalue.h b/SAS/OTDB/include/OTDB/OTDBvalue.h index b0714a4441df2b2bf1382872296980e6225d88b7..885e3436ac4ac74c01cda5285dec5ad51abdacd2 100644 --- a/SAS/OTDB/include/OTDB/OTDBvalue.h +++ b/SAS/OTDB/include/OTDB/OTDBvalue.h @@ -31,13 +31,13 @@ #include <OTDB/OTDBconstants.h> #include <OTDB/OTDBtypes.h> #include <boost/date_time/posix_time/ptime.hpp> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> namespace LOFAR { namespace OTDB { +using boost::posix_time::ptime; + // \addtogroup OTDB // @{ diff --git a/SAS/OTDB/include/OTDB/TreeState.h b/SAS/OTDB/include/OTDB/TreeState.h index d2c1d003940f1bfd1e543299cc01fac47a99bd51..212f11af7fbadee524e9bdb4177f2ae16700e399 100644 --- a/SAS/OTDB/include/OTDB/TreeState.h +++ b/SAS/OTDB/include/OTDB/TreeState.h @@ -29,14 +29,14 @@ //# Never #include <config.h> or #include <lofar_config.h> in a header file! //# Includes #include <OTDB/OTDBtypes.h> -#include <Common/lofar_datetime.h> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> +#include <boost/date_time/posix_time/ptime.hpp> namespace LOFAR { namespace OTDB { +using boost::posix_time::ptime; + // \addtogroup OTDB // @{ diff --git a/SAS/OTDB/include/OTDB/TreeValue.h b/SAS/OTDB/include/OTDB/TreeValue.h index ad59242d723c269f6daac322b6c2277bc27d7ce6..b4a8fee96f1b2571f03386f760ddf6ecc89aa239 100644 --- a/SAS/OTDB/include/OTDB/TreeValue.h +++ b/SAS/OTDB/include/OTDB/TreeValue.h @@ -40,6 +40,8 @@ namespace LOFAR { // \addtogroup OTDB // @{ +using boost::posix_time::not_a_date_time; + //# --- Forward Declarations --- //# classes mentioned as parameter or returntype without virtual functions. diff --git a/SAS/OTDB/include/OTDB/VICnodeDef.h b/SAS/OTDB/include/OTDB/VICnodeDef.h index da445153e62ed7a303ad405d20e92c96f8550c2e..9b0cf656b643c0ef327994ce557a01594dae1d58 100644 --- a/SAS/OTDB/include/OTDB/VICnodeDef.h +++ b/SAS/OTDB/include/OTDB/VICnodeDef.h @@ -30,9 +30,7 @@ //# Includes #include <OTDB/OTDBconstants.h> #include <OTDB/OTDBtypes.h> -#include <pqxx/pqxx> - -using namespace boost::posix_time; +#include <pqxx/result> namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/src/Campaign.cc b/SAS/OTDB/src/Campaign.cc index c59f8300b96a2ab3b87b1a01d88aa87dc66be69c..d16381667473088a49cd17a62a7acd15385841af 100644 --- a/SAS/OTDB/src/Campaign.cc +++ b/SAS/OTDB/src/Campaign.cc @@ -25,9 +25,12 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <OTDB/Campaign.h> +#include <pqxx/transaction> + +using namespace pqxx; + namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/src/CampaignInfo.cc b/SAS/OTDB/src/CampaignInfo.cc index acee4a2210b7cb409ca7faf634ba4846051b3565..1e9564f18a6fba2eaaeeaffec198b6e9b573b8a2 100644 --- a/SAS/OTDB/src/CampaignInfo.cc +++ b/SAS/OTDB/src/CampaignInfo.cc @@ -25,7 +25,6 @@ //# Includes #include<Common/LofarLogger.h> -#include<Common/lofar_datetime.h> #include<OTDB/CampaignInfo.h> using namespace pqxx; diff --git a/SAS/OTDB/src/Converter.cc b/SAS/OTDB/src/Converter.cc index d432c501b718330e61a0c71bea0d47d7bfde604f..a035e490d6f23ef7f2cd2e9479ddba8a9d800b51 100644 --- a/SAS/OTDB/src/Converter.cc +++ b/SAS/OTDB/src/Converter.cc @@ -29,6 +29,8 @@ #include <OTDB/OTDBconnection.h> #include <OTDB/Converter.h> +#include <pqxx/transaction> + using namespace pqxx; namespace LOFAR { diff --git a/SAS/OTDB/src/DefaultTemplate.cc b/SAS/OTDB/src/DefaultTemplate.cc index e37df318dfc7b6d45ee489ecb58df6a0304b560d..79fe77d437b8a404768c4407b200042f87428242 100644 --- a/SAS/OTDB/src/DefaultTemplate.cc +++ b/SAS/OTDB/src/DefaultTemplate.cc @@ -25,7 +25,6 @@ //# Includes #include<Common/LofarLogger.h> -#include<Common/lofar_datetime.h> #include<OTDB/DefaultTemplate.h> using namespace pqxx; diff --git a/SAS/OTDB/src/OTDBconnection.cc b/SAS/OTDB/src/OTDBconnection.cc index cb9fe71ef91e147afd184911bcb2d05e17f01412..335920f42665dbeb8963cc9e57aebf362ec81c1e 100644 --- a/SAS/OTDB/src/OTDBconnection.cc +++ b/SAS/OTDB/src/OTDBconnection.cc @@ -26,10 +26,15 @@ //# Includes #include<Common/LofarLogger.h> #include<Common/StringUtil.h> -#include<Common/lofar_datetime.h> #include<OTDB/OTDBconnection.h> #include<OTDB/OTDBconstants.h> +#include <boost/date_time/posix_time/posix_time.hpp> +#include <pqxx/transaction> + +using namespace pqxx; +using namespace boost::posix_time; + namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/src/OTDBevent.cc b/SAS/OTDB/src/OTDBevent.cc index 57334f63375765c651873e5015a35b0275b9cf8f..bb54c19b153640195871db6a238d521853b76721 100644 --- a/SAS/OTDB/src/OTDBevent.cc +++ b/SAS/OTDB/src/OTDBevent.cc @@ -24,7 +24,6 @@ #include <lofar_config.h> //# Includes -#include <Common/lofar_datetime.h> #include <Common/LofarLogger.h> #include <OTDB/OTDBevent.h> diff --git a/SAS/OTDB/src/OTDBnode.cc b/SAS/OTDB/src/OTDBnode.cc index 46ed23ef63f7800b9cab2b99821e52b595d8d1b8..fb9f15e2a890f2d813792a12fa05c1597913203c 100644 --- a/SAS/OTDB/src/OTDBnode.cc +++ b/SAS/OTDB/src/OTDBnode.cc @@ -25,7 +25,6 @@ //# Includes #include<Common/LofarLogger.h> -#include<Common/lofar_datetime.h> #include<OTDB/OTDBnode.h> using namespace pqxx; diff --git a/SAS/OTDB/src/OTDBparam.cc b/SAS/OTDB/src/OTDBparam.cc index 714ea941f79613b854d5d8d26c6022a92387df2e..8fd13bb0c1c55628ab94aea50ab906e3038ac284 100644 --- a/SAS/OTDB/src/OTDBparam.cc +++ b/SAS/OTDB/src/OTDBparam.cc @@ -25,7 +25,6 @@ //# Includes #include<Common/LofarLogger.h> -#include<Common/lofar_datetime.h> #include<OTDB/OTDBparam.h> using namespace pqxx; diff --git a/SAS/OTDB/src/OTDBtree.cc b/SAS/OTDB/src/OTDBtree.cc index 590de2cda9edb8e9d6a93d703f50562e9d55a632..099d51da4b7d8d88632fa490264e278b56fbfd4d 100644 --- a/SAS/OTDB/src/OTDBtree.cc +++ b/SAS/OTDB/src/OTDBtree.cc @@ -25,9 +25,10 @@ //# Includes #include<Common/LofarLogger.h> -#include<Common/lofar_datetime.h> #include<OTDB/OTDBtree.h> +#include <boost/date_time/posix_time/posix_time.hpp> +using namespace boost::posix_time; using namespace pqxx; namespace LOFAR { diff --git a/SAS/OTDB/src/OTDBvalue.cc b/SAS/OTDB/src/OTDBvalue.cc index 4ce3e8dd08c6d1d5bc3adf7333ca8545058d6d1f..dbc869b1a9389e0d49b7de5b3784b8ec3c32a0ed 100644 --- a/SAS/OTDB/src/OTDBvalue.cc +++ b/SAS/OTDB/src/OTDBvalue.cc @@ -25,9 +25,10 @@ //# Includes #include<Common/LofarLogger.h> -#include<Common/lofar_datetime.h> #include<OTDB/OTDBvalue.h> +#include <boost/date_time/posix_time/posix_time.hpp> +using namespace boost::posix_time; using namespace pqxx; namespace LOFAR { diff --git a/SAS/OTDB/src/TreeMaintenance.cc b/SAS/OTDB/src/TreeMaintenance.cc index a1fbd4c91008efed6b8ebc40a41a0377ed7954cf..8445c95b2af593d818915d445839599cbd1083d9 100644 --- a/SAS/OTDB/src/TreeMaintenance.cc +++ b/SAS/OTDB/src/TreeMaintenance.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/StringUtil.h> -#include <Common/lofar_datetime.h> #include <Common/lofar_string.h> #include <fstream> #include <OTDB/TreeMaintenance.h> @@ -34,6 +33,10 @@ #include <OTDB/OTDBparam.h> #include <OTDB/misc.h> +#include <pqxx/transaction> + +using namespace pqxx; + namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/src/TreeState.cc b/SAS/OTDB/src/TreeState.cc index 494b29a9e0ef562fc1f6e3d1908052adfd2393fa..4763b63bfe897b4b014fa7d9191dde58931c812c 100644 --- a/SAS/OTDB/src/TreeState.cc +++ b/SAS/OTDB/src/TreeState.cc @@ -25,10 +25,12 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <OTDB/TreeState.h> +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace pqxx; +using namespace boost::posix_time; namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/src/TreeValue.cc b/SAS/OTDB/src/TreeValue.cc index 0a88ff474f1e41368218500a76ac6c2d46172a0e..c782fa0f765127aef7fbd7f63a6ed7c3e1208343 100644 --- a/SAS/OTDB/src/TreeValue.cc +++ b/SAS/OTDB/src/TreeValue.cc @@ -25,9 +25,14 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <OTDB/TreeValue.h> +#include <pqxx/transaction> +#include <boost/date_time/posix_time/posix_time.hpp> + +using namespace pqxx; +using namespace boost::posix_time; + namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/src/VICnodeDef.cc b/SAS/OTDB/src/VICnodeDef.cc index 62e5d5d3872c834c09ff1f6360f329b6b3cff0ae..8d2a42638f7a1d957384378ff807cedec88563df 100644 --- a/SAS/OTDB/src/VICnodeDef.cc +++ b/SAS/OTDB/src/VICnodeDef.cc @@ -25,7 +25,6 @@ //# Includes #include <Common/LofarLogger.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <OTDB/VICnodeDef.h> #include <OTDB/misc.h> diff --git a/SAS/OTDB/src/loadCompFile.cc b/SAS/OTDB/src/loadCompFile.cc index 4b59b2f09f7833ee2d04710d1477e45c225174eb..6ce898f1009a20d330f00712b01dd64b325e735b 100644 --- a/SAS/OTDB/src/loadCompFile.cc +++ b/SAS/OTDB/src/loadCompFile.cc @@ -39,6 +39,10 @@ #include <OTDB/ClassifConv.h> #include <OTDB/misc.h> +#include <pqxx/transaction> + +using namespace pqxx; + namespace LOFAR { namespace OTDB { diff --git a/SAS/OTDB/test/tBrokenHardware.cc b/SAS/OTDB/test/tBrokenHardware.cc index a66c1a5adba09b28493f90cb1ad4db44594487eb..88c27d70f501264970c1052b119231764035823b 100644 --- a/SAS/OTDB/test/tBrokenHardware.cc +++ b/SAS/OTDB/test/tBrokenHardware.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/ParameterSet.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/TreeValue.h> @@ -37,9 +36,11 @@ #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace LOFAR; using namespace LOFAR::OTDB; - +using namespace boost::posix_time; // // showTreeList diff --git a/SAS/OTDB/test/tCampaign.cc b/SAS/OTDB/test/tCampaign.cc index 2b29b4dd695d4cf91594cff6b5ccf358e94daaee..09604f66eb9277a1ef424a037183b4b722d1bd5a 100644 --- a/SAS/OTDB/test/tCampaign.cc +++ b/SAS/OTDB/test/tCampaign.cc @@ -30,6 +30,7 @@ #include <OTDB/OTDBconnection.h> #include <OTDB/Campaign.h> #include <libgen.h> // for basename +#include <cstring> using namespace LOFAR; using namespace LOFAR::OTDB; diff --git a/SAS/OTDB/test/tConnection.cc b/SAS/OTDB/test/tConnection.cc index 558a92c41bd871891f7b9d4ca1b4262352a47a21..942254b3e9270a5733e29db7f9ed6d5a20031596 100644 --- a/SAS/OTDB/test/tConnection.cc +++ b/SAS/OTDB/test/tConnection.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <OTDB/OTDBconnection.h> #include <OTDB/TreeState.h> @@ -34,8 +33,11 @@ #include <OTDB/TreeMaintenance.h> #include <libgen.h> // for basename +#include <boost/date_time/posix_time/posix_time.hpp> + using namespace LOFAR; using namespace LOFAR::OTDB; +using namespace boost::posix_time; // // show tree result diff --git a/SAS/OTDB/test/tPICtree.cc b/SAS/OTDB/test/tPICtree.cc index bb7eea8c7dc14c35848d7e17257e2ca79f7e46b7..870b2ca4401c3c7d688a0377fa0d874608591773 100644 --- a/SAS/OTDB/test/tPICtree.cc +++ b/SAS/OTDB/test/tPICtree.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/OTDBtypes.h> @@ -35,6 +34,7 @@ #include <OTDB/TreeStateConv.h> #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <cstring> using namespace LOFAR; using namespace LOFAR::OTDB; diff --git a/SAS/OTDB/test/tPICvalue.cc b/SAS/OTDB/test/tPICvalue.cc index 7cd6167c98a6fdaacc8f14e821b597d3fd3d12fe..fcb3095d5c940468d03cbd1cf60dded8dc75e6bb 100644 --- a/SAS/OTDB/test/tPICvalue.cc +++ b/SAS/OTDB/test/tPICvalue.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/ParameterSet.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/TreeValue.h> @@ -36,10 +35,13 @@ #include <OTDB/TreeStateConv.h> #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <cstring> + +#include <boost/date_time/posix_time/posix_time.hpp> using namespace LOFAR; using namespace LOFAR::OTDB; - +using namespace boost::posix_time; // // showTreeList diff --git a/SAS/OTDB/test/tParamTypeConv.cc b/SAS/OTDB/test/tParamTypeConv.cc index 8eef75079caec84b05f0a69914ba07300a65d913..990514c8ae0a86c0f6639f85d163a3c59dc6604d 100644 --- a/SAS/OTDB/test/tParamTypeConv.cc +++ b/SAS/OTDB/test/tParamTypeConv.cc @@ -26,10 +26,10 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/SystemUtil.h> #include <OTDB/OTDBconnection.h> #include <OTDB/ParamTypeConv.h> +#include <cstring> using namespace LOFAR; using namespace LOFAR::OTDB; diff --git a/SAS/OTDB/test/tQueryPIC.cc b/SAS/OTDB/test/tQueryPIC.cc index 99f85c5be5433d332d098bf83c1897ff897dc0ae..b3acaea190ce523ff7ab2eaceb63a4e9a1ef2d06 100644 --- a/SAS/OTDB/test/tQueryPIC.cc +++ b/SAS/OTDB/test/tQueryPIC.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/TreeValue.h> @@ -37,9 +36,13 @@ #include <OTDB/TreeTypeConv.h> #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <cstring> + +#include <boost/date_time/posix_time/posix_time.hpp> using namespace LOFAR; using namespace LOFAR::OTDB; +using namespace boost::posix_time; // // show the resulting list of Values diff --git a/SAS/OTDB/test/tVHtree.cc b/SAS/OTDB/test/tVHtree.cc index 6bbf31616cb0c5a8bdc3c8b39dacf87114f45d7c..152e395160b58fa51e873dafe87ec029c3749b95 100644 --- a/SAS/OTDB/test/tVHtree.cc +++ b/SAS/OTDB/test/tVHtree.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/OTDBtypes.h> @@ -36,9 +35,13 @@ #include <OTDB/TreeStateConv.h> #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <cstring> + +#include <boost/date_time/posix_time/posix_time.hpp> using namespace LOFAR; using namespace LOFAR::OTDB; +using namespace boost::posix_time; // // showTreeList diff --git a/SAS/OTDB/test/tVHvalue.cc b/SAS/OTDB/test/tVHvalue.cc index 7bfb095c59d1bc0272d0e3d0a2814388e14e9351..10e7047521ece408d629d53dbb0a88918d371829 100644 --- a/SAS/OTDB/test/tVHvalue.cc +++ b/SAS/OTDB/test/tVHvalue.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/ParameterSet.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/TreeValue.h> @@ -36,9 +35,13 @@ #include <OTDB/TreeStateConv.h> #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <cstring> + +#include <boost/date_time/posix_time/posix_time.hpp> using namespace LOFAR; using namespace LOFAR::OTDB; +using namespace boost::posix_time; // diff --git a/SAS/OTDB/test/tVICcomp.cc b/SAS/OTDB/test/tVICcomp.cc index 81d9edcf556b30ea5e6ba473d9b8c0e98a314336..a1dfefac19f7a5b561b36216fa1449e7133abb95 100644 --- a/SAS/OTDB/test/tVICcomp.cc +++ b/SAS/OTDB/test/tVICcomp.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/OTDBtypes.h> @@ -34,6 +33,7 @@ #include <OTDB/OTDBparam.h> #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <cstring> using namespace LOFAR; using namespace LOFAR::OTDB; diff --git a/SAS/OTDB/test/tVTtree.cc b/SAS/OTDB/test/tVTtree.cc index e3cc919019b0954f011e156b910a44d763ed5755..3a16cb8e338c820cbd2893577e4a14836de87916 100644 --- a/SAS/OTDB/test/tVTtree.cc +++ b/SAS/OTDB/test/tVTtree.cc @@ -26,7 +26,6 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/lofar_fstream.h> -#include <Common/lofar_datetime.h> #include <Common/StringUtil.h> #include <OTDB/TreeMaintenance.h> #include <OTDB/OTDBtypes.h> @@ -36,9 +35,13 @@ #include <OTDB/TreeStateConv.h> #include <OTDB/ClassifConv.h> #include <libgen.h> // for basename +#include <cstring> + +#include <boost/date_time/posix_time/posix_time.hpp> using namespace LOFAR; using namespace LOFAR::OTDB; +using namespace boost::posix_time; // // showTreeList