diff --git a/MAC/APL/CEPCU/src/OnlineControl/CEPApplicationManager.cc b/MAC/APL/CEPCU/src/OnlineControl/CEPApplicationManager.cc new file mode 100644 index 0000000000000000000000000000000000000000..d3d89cd9044e816db1f48795675f5e14a53a9e22 --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/CEPApplicationManager.cc @@ -0,0 +1,129 @@ +//# CEPApplicationManager.cc: Implementation of the Virtual CEPApplicationManager task +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program 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 2 of the License, or +//# (at your option) any later version. +//# +//# This program 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 this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ + +#include <lofar_config.h> +#include "CEPApplicationManager.h" + +namespace LOFAR +{ + +using namespace ACC::ALC; + + namespace CEPCU + { +INIT_TRACER_CONTEXT(CEPApplicationManager, LOFARLOGGER_PACKAGE); + + +void CEPApplicationManager::workProc() +{ + if (_continuePoll) + { + _acClient.processACmsgFromServer(); + } +} + +void CEPApplicationManager::handleAckMsg(ACCmd cmd, + uint16 result, + const string& info) +{ + LOG_INFO(formatString("command: %d, result: %d, info: %s", cmd, result, info.c_str())); + switch (cmd) + { + case ACCmdBoot: + if (result == AcCmdMaskOk) + { + _lastOkCmd = cmd; + } + _interface.appBooted(result); + break; + + case ACCmdQuit: + if (result == AcCmdMaskOk && result == 0) + { + _continuePoll = false; + } + _interface.appQuitDone(result); + break; + + case ACCmdDefine: + if (result == AcCmdMaskOk) + { + _lastOkCmd = cmd; + } + _interface.appDefined(result); + break; + + case ACCmdInit: + if (result == AcCmdMaskOk) + { + _lastOkCmd = cmd; + } + _interface.appInitialized(result); + break; + + case ACCmdPause: + _interface.appPaused(result); + break; + + case ACCmdRun: + if (result == AcCmdMaskOk) + { + _lastOkCmd = cmd; + } + _interface.appRunDone(result); + break; + + case ACCmdSnapshot: + _interface.appSnapshotDone(result); + break; + + case ACCmdRecover: + _interface.appRecovered(result); + break; + + case ACCmdReinit: + _interface.appReinitialized(result); + break; + + case ACCmdReplace: + _interface.appReplaced(result); + break; + + default: + LOG_WARN_STR("Received command = " << cmd << ", result = " << result + << ", info = " << info << " not handled!"); + break; + } +} + +void CEPApplicationManager::handleAnswerMsg (const string& answer) +{ + _interface.appSupplyInfoAnswer(answer); +} + +string CEPApplicationManager::supplyInfoFunc (const string& keyList) +{ + return _interface.appSupplyInfo(keyList); +} + + } // namespace CEPCU +} // namespace LOFAR diff --git a/MAC/APL/CEPCU/src/OnlineControl/CEPApplicationManager.h b/MAC/APL/CEPCU/src/OnlineControl/CEPApplicationManager.h new file mode 100644 index 0000000000000000000000000000000000000000..c2c756ed7d5579e2041ab8e3a611c3b15b3e995a --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/CEPApplicationManager.h @@ -0,0 +1,229 @@ +//# CEPApplicationManager.h: factory class for Virtual Backends. +//# +//# Copyright (C) 2002-2005 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program 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 2 of the License, or +//# (at your option) any later version. +//# +//# This program 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 this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ + +#ifndef CEPAPPLICATIONMANAGER_H +#define CEPAPPLICATIONMANAGER_H + +//# Includes +#include <ALC/ACAsyncClient.h> +#include <GCF/TM/GCF_Handler.h> + +//# local includes +//# Common Includes + +// forward declaration + +namespace LOFAR +{ + namespace CEPCU + { + +class CEPApplicationManagerInterface +{ + protected: + CEPApplicationManagerInterface() {} + + public: + virtual ~CEPApplicationManagerInterface() {} + + public: + virtual void appBooted(uint16 result) = 0; + virtual void appDefined(uint16 result) = 0; + virtual void appInitialized(uint16 result) = 0; + virtual void appRunDone(uint16 result) = 0; + virtual void appPaused(uint16 result) = 0; + virtual void appQuitDone(uint16 result) = 0; + virtual void appSnapshotDone(uint16 result) = 0; + virtual void appRecovered(uint16 result) = 0; + virtual void appReinitialized(uint16 result) = 0; + virtual void appReplaced(uint16 result) = 0; + virtual string appSupplyInfo(const string& keyList) = 0; + virtual void appSupplyInfoAnswer(const string& answer) = 0; + + private: + // protected copy constructor + CEPApplicationManagerInterface(const CEPApplicationManagerInterface&); + // protected assignment operator + CEPApplicationManagerInterface& operator=(const CEPApplicationManagerInterface&); +}; + +class CEPApplicationManager : public ACC::ALC::ACClientFunctions, + GCF::TM::GCFHandler +{ + public: + CEPApplicationManager(CEPApplicationManagerInterface& interface, const string& appName); + virtual ~CEPApplicationManager(); + + public: // methods may be called from specialized CEPApplicationManagerInterface + bool boot (const time_t scheduleTime, + const string& configID); + bool define (const time_t scheduleTime) const; + bool init (const time_t scheduleTime) const; + bool run (const time_t scheduleTime) const; + bool pause (const time_t scheduleTime, + const time_t maxWaitTime, + const string& condition) const; + bool quit (const time_t scheduleTime) const; + bool shutdown (const time_t scheduleTime) const; + bool snapshot (const time_t scheduleTime, + const string& destination) const; + bool recover (const time_t scheduleTime, + const string& source) const; + bool reinit (const time_t scheduleTime, + const string& configID) const; + bool replace (const time_t scheduleTime, + const string& processList, + const string& nodeList, + const string& configID) const; + string askInfo (const string& keylist) const; + bool cancelCmdQueue () const; + ACC::ALC::ACCmd getLastOkCmd() const; + + private: // implemenation of abstract GCFHandler methods + friend class GCF::TM::GCFHandler; + void workProc(); + void stop(); + + private: // implemenation of abstract ACClientFunctions methods + friend class ACC::ALC::ACClientFunctions; + void handleAckMsg (ACC::ALC::ACCmd cmd, + uint16 result, + const string& info); + + void handleAnswerMsg (const string& answer); + + string supplyInfoFunc (const string& keyList); + + protected: + // protected copy constructor + CEPApplicationManager(const CEPApplicationManager&); + // protected assignment operator + CEPApplicationManager& operator=(const CEPApplicationManager&); + + private: + CEPApplicationManagerInterface& _interface; + ACC::ALC::ACAsyncClient _acClient; + bool _continuePoll; + ACC::ALC::ACCmd _lastOkCmd; + + ALLOC_TRACER_CONTEXT +}; + +inline CEPApplicationManager::CEPApplicationManager( + CEPApplicationManagerInterface& interface, + const string& appName) : + _interface(interface), + _acClient(this, appName, 10, 100, 1, 0), + _continuePoll(false), + _lastOkCmd(ACC::ALC::ACCmdNone) + +{ + use(); // to avoid that this object will be deleted in GCFTask::stop; +} + +inline CEPApplicationManager::~CEPApplicationManager() +{ + GCFTask::deregisterHandler(*this); +} + +inline bool CEPApplicationManager::boot (const time_t scheduleTime, + const string& configID) +{ + _continuePoll = true; + return _acClient.boot(scheduleTime, configID); +} + +inline bool CEPApplicationManager::define (const time_t scheduleTime) const +{ + return _acClient.define(scheduleTime); +} + +inline bool CEPApplicationManager::init (const time_t scheduleTime) const +{ + return _acClient.init(scheduleTime); +} + +inline bool CEPApplicationManager::run (const time_t scheduleTime) const +{ + return _acClient.run(scheduleTime); +} + +inline bool CEPApplicationManager::pause (const time_t scheduleTime, + const time_t maxWaitTime, + const string& condition) const +{ + return _acClient.pause(scheduleTime, maxWaitTime, condition); +} + +inline bool CEPApplicationManager::quit (const time_t scheduleTime) const +{ + return _acClient.quit(scheduleTime); +} + +inline bool CEPApplicationManager::shutdown (const time_t scheduleTime) const +{ + return _acClient.shutdown(scheduleTime); +} + +inline bool CEPApplicationManager::snapshot (const time_t scheduleTime, + const string& destination) const +{ + return _acClient.snapshot(scheduleTime, destination); +} + +inline bool CEPApplicationManager::recover (const time_t scheduleTime, + const string& source) const +{ + return _acClient.recover(scheduleTime, source); +} + +inline bool CEPApplicationManager::reinit (const time_t scheduleTime, + const string& configID) const +{ + return _acClient.reinit(scheduleTime, configID); +} + +inline bool CEPApplicationManager::replace (const time_t scheduleTime, + const string& processList, + const string& nodeList, + const string& configID) const +{ + return _acClient.replace(scheduleTime, processList, nodeList, configID); +} + +inline bool CEPApplicationManager::cancelCmdQueue () const +{ + return _acClient.cancelCmdQueue(); +} + +inline ACC::ALC::ACCmd CEPApplicationManager::getLastOkCmd() const +{ + return _lastOkCmd; +} + +inline void CEPApplicationManager::stop() +{ +} + + } // namespace CEPCU +} // namespace LOFAR +#endif diff --git a/MAC/APL/CEPCU/src/OnlineControl/Makefile.am b/MAC/APL/CEPCU/src/OnlineControl/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..aff754eecf25db63398a7998b4a681af46d9cfc6 --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/Makefile.am @@ -0,0 +1,38 @@ +bin_PROGRAMS = OnlineControl + +OnlineControl_CPPFLAGS = -Wno-deprecated \ + -fmessage-length=0 \ + -fdiagnostics-show-location=once + +OnlineControl_SOURCES = CEPApplicationManager.cc \ + OnlineControl.cc \ + OnlineControlMain.cc + +OnlineControl_LDADD = $(LOFAR_DEPEND) +OnlineControl_DEPENDENCIES = $(LOFAR_DEPEND) + +NOINSTHDRS = CEPApplicationManager.h \ + OnlineControl.h \ + OnlineControlDefines.h + +INSTHDRS = + +pkginclude_HEADERS = $(NOINSTHDRS) $(INSTHDRS) + +DOCHDRS = $(pkginclude_HEADERS) $(BUILT_SOURCES) + +EXTRA_DIST = $(configfiles_DATA) $(sysconf_DATA) + +#in case of make install these files will be copied to the bindir beside the test apps +configfilesdir=$(bindir) +configfiles_DATA = + +sysconf_DATA = OnlineControl.log_prop + +%.log_prop: %.log_prop.in + cp $< $@ + +clean-local: + rm -f *.ph + +include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/CEPCU/src/OnlineControl/Makefile.in b/MAC/APL/CEPCU/src/OnlineControl/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..1c5b74b301055156e7bba58ae788338ec1b834e6 --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/Makefile.in @@ -0,0 +1,928 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Some common rules. + + + +SOURCES = $(OnlineControl_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = OnlineControl$(EXEEXT) +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.common +subdir = src/OnlineControl +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/autoconf_share/am_rpm_init.m4 \ + $(top_srcdir)/autoconf_share/lofar_docxx.m4 \ + $(top_srcdir)/autoconf_share/lofar_external.m4 \ + $(top_srcdir)/autoconf_share/lofar_general.m4 \ + $(top_srcdir)/autoconf_share/lofar_init.m4 \ + $(top_srcdir)/autoconf_share/lofar_internal.m4 \ + $(top_srcdir)/autoconf_share/lofar_logger.m4 \ + $(top_srcdir)/autoconf_share/lofar_pvss.m4 \ + $(top_srcdir)/autoconf_share/lofar_qatools.m4 \ + $(top_srcdir)/autoconf_share/lofar_shmem.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configfilesdir)" \ + "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(pkgincludedir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_OnlineControl_OBJECTS = \ + OnlineControl-CEPApplicationManager.$(OBJEXT) \ + OnlineControl-OnlineControl.$(OBJEXT) \ + OnlineControl-OnlineControlMain.$(OBJEXT) +OnlineControl_OBJECTS = $(am_OnlineControl_OBJECTS) +am__DEPENDENCIES_1 = +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(OnlineControl_SOURCES) +DIST_SOURCES = $(OnlineControl_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +configfilesDATA_INSTALL = $(INSTALL_DATA) +sysconfDATA_INSTALL = $(INSTALL_DATA) +DATA = $(configfiles_DATA) $(sysconf_DATA) +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AR_FLAGS = @AR_FLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCPP = @DOCPP@ +DOCPPFLAGS = @DOCPPFLAGS@ +DOXYGEN = @DOXYGEN@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +HAVE_ALC_FALSE = @HAVE_ALC_FALSE@ +HAVE_ALC_TRUE = @HAVE_ALC_TRUE@ +HAVE_APLCOMMON_FALSE = @HAVE_APLCOMMON_FALSE@ +HAVE_APLCOMMON_TRUE = @HAVE_APLCOMMON_TRUE@ +HAVE_APS_FALSE = @HAVE_APS_FALSE@ +HAVE_APS_TRUE = @HAVE_APS_TRUE@ +HAVE_BOOST_FALSE = @HAVE_BOOST_FALSE@ +HAVE_BOOST_TRUE = @HAVE_BOOST_TRUE@ +HAVE_COMMON_FALSE = @HAVE_COMMON_FALSE@ +HAVE_COMMON_TRUE = @HAVE_COMMON_TRUE@ +HAVE_DOCPP_FALSE = @HAVE_DOCPP_FALSE@ +HAVE_DOCPP_TRUE = @HAVE_DOCPP_TRUE@ +HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@ +HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@ +HAVE_GCFCOMMON_FALSE = @HAVE_GCFCOMMON_FALSE@ +HAVE_GCFCOMMON_TRUE = @HAVE_GCFCOMMON_TRUE@ +HAVE_GCFPAL_FALSE = @HAVE_GCFPAL_FALSE@ +HAVE_GCFPAL_TRUE = @HAVE_GCFPAL_TRUE@ +HAVE_GCFTM_FALSE = @HAVE_GCFTM_FALSE@ +HAVE_GCFTM_TRUE = @HAVE_GCFTM_TRUE@ +HAVE_LOG4CPLUS_FALSE = @HAVE_LOG4CPLUS_FALSE@ +HAVE_LOG4CPLUS_TRUE = @HAVE_LOG4CPLUS_TRUE@ +HAVE_PVSS_FALSE = @HAVE_PVSS_FALSE@ +HAVE_PVSS_TRUE = @HAVE_PVSS_TRUE@ +HAVE_SHMEM_FALSE = @HAVE_SHMEM_FALSE@ +HAVE_SHMEM_TRUE = @HAVE_SHMEM_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LOFARROOT = @LOFARROOT@ +LOFAR_DEPEND = @LOFAR_DEPEND@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKE_RPMS = @MAKE_RPMS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RPMBUILD_PROG = @RPMBUILD_PROG@ +RPM_ARGS = @RPM_ARGS@ +RPM_CONFIGURE_ARGS = @RPM_CONFIGURE_ARGS@ +RPM_DIR = @RPM_DIR@ +RPM_PROG = @RPM_PROG@ +RPM_RELEASE = @RPM_RELEASE@ +RPM_TARBALL = @RPM_TARBALL@ +RPM_TARGET = @RPM_TARGET@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +docpp_found = @docpp_found@ +doxygen_dot_found = @doxygen_dot_found@ +doxygen_found = @doxygen_found@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +lofar_compiler = @lofar_compiler@ +lofar_doctool = @lofar_doctool@ +lofar_root = @lofar_root@ +lofar_root_libdir = @lofar_root_libdir@ +lofar_sharedir = @lofar_sharedir@ +lofar_top_srcdir = @lofar_top_srcdir@ +lofar_use_root = @lofar_use_root@ +lofar_variant = @lofar_variant@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +OnlineControl_CPPFLAGS = -Wno-deprecated \ + -fmessage-length=0 \ + -fdiagnostics-show-location=once + +OnlineControl_SOURCES = CEPApplicationManager.cc \ + OnlineControl.cc \ + OnlineControlMain.cc + +OnlineControl_LDADD = $(LOFAR_DEPEND) +OnlineControl_DEPENDENCIES = $(LOFAR_DEPEND) +NOINSTHDRS = CEPApplicationManager.h \ + OnlineControl.h \ + OnlineControlDefines.h + +INSTHDRS = +pkginclude_HEADERS = $(NOINSTHDRS) $(INSTHDRS) +DOCHDRS = $(pkginclude_HEADERS) $(BUILT_SOURCES) +EXTRA_DIST = $(configfiles_DATA) $(sysconf_DATA) + +#in case of make install these files will be copied to the bindir beside the test apps +configfilesdir = $(bindir) +configfiles_DATA = +sysconf_DATA = OnlineControl.log_prop +#CLEANFILES += tca.* .inslog* *.cc *.h $(top_builddir)/pure_cache docxxhtml/* *.log docxx_hdrs.names +DISTCLEANFILES = \ + pkgext\ + pkgextcppflags\ + pkgextcxxflags\ + pkgextobjs\ + lofar_config.old-h\ + lofar_config.h-pkg\ + lofar_config.h\ + .doxygenrc \ + *.spec \ + *.err + + +# Rules for building documentation using doxygen or doc++. +# Default output directory is docxxhtml. +DOCDIR := docxxhtml + +# +# +# Target to be able to do a system build. +# By default it does a check, but no install. +WITH_CLEAN = 0 +WITH_INSTALL = 0 +WITH_CHECK = 1 +CHECKTOOL = +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.common $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/OnlineControl/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/OnlineControl/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +OnlineControl$(EXEEXT): $(OnlineControl_OBJECTS) $(OnlineControl_DEPENDENCIES) + @rm -f OnlineControl$(EXEEXT) + $(CXXLINK) $(OnlineControl_LDFLAGS) $(OnlineControl_OBJECTS) $(OnlineControl_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OnlineControl-CEPApplicationManager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OnlineControl-OnlineControl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OnlineControl-OnlineControlMain.Po@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +OnlineControl-CEPApplicationManager.o: CEPApplicationManager.cc +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OnlineControl-CEPApplicationManager.o -MD -MP -MF "$(DEPDIR)/OnlineControl-CEPApplicationManager.Tpo" -c -o OnlineControl-CEPApplicationManager.o `test -f 'CEPApplicationManager.cc' || echo '$(srcdir)/'`CEPApplicationManager.cc; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/OnlineControl-CEPApplicationManager.Tpo" "$(DEPDIR)/OnlineControl-CEPApplicationManager.Po"; else rm -f "$(DEPDIR)/OnlineControl-CEPApplicationManager.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CEPApplicationManager.cc' object='OnlineControl-CEPApplicationManager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OnlineControl-CEPApplicationManager.o `test -f 'CEPApplicationManager.cc' || echo '$(srcdir)/'`CEPApplicationManager.cc + +OnlineControl-CEPApplicationManager.obj: CEPApplicationManager.cc +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OnlineControl-CEPApplicationManager.obj -MD -MP -MF "$(DEPDIR)/OnlineControl-CEPApplicationManager.Tpo" -c -o OnlineControl-CEPApplicationManager.obj `if test -f 'CEPApplicationManager.cc'; then $(CYGPATH_W) 'CEPApplicationManager.cc'; else $(CYGPATH_W) '$(srcdir)/CEPApplicationManager.cc'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/OnlineControl-CEPApplicationManager.Tpo" "$(DEPDIR)/OnlineControl-CEPApplicationManager.Po"; else rm -f "$(DEPDIR)/OnlineControl-CEPApplicationManager.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CEPApplicationManager.cc' object='OnlineControl-CEPApplicationManager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OnlineControl-CEPApplicationManager.obj `if test -f 'CEPApplicationManager.cc'; then $(CYGPATH_W) 'CEPApplicationManager.cc'; else $(CYGPATH_W) '$(srcdir)/CEPApplicationManager.cc'; fi` + +OnlineControl-OnlineControl.o: OnlineControl.cc +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OnlineControl-OnlineControl.o -MD -MP -MF "$(DEPDIR)/OnlineControl-OnlineControl.Tpo" -c -o OnlineControl-OnlineControl.o `test -f 'OnlineControl.cc' || echo '$(srcdir)/'`OnlineControl.cc; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/OnlineControl-OnlineControl.Tpo" "$(DEPDIR)/OnlineControl-OnlineControl.Po"; else rm -f "$(DEPDIR)/OnlineControl-OnlineControl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OnlineControl.cc' object='OnlineControl-OnlineControl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OnlineControl-OnlineControl.o `test -f 'OnlineControl.cc' || echo '$(srcdir)/'`OnlineControl.cc + +OnlineControl-OnlineControl.obj: OnlineControl.cc +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OnlineControl-OnlineControl.obj -MD -MP -MF "$(DEPDIR)/OnlineControl-OnlineControl.Tpo" -c -o OnlineControl-OnlineControl.obj `if test -f 'OnlineControl.cc'; then $(CYGPATH_W) 'OnlineControl.cc'; else $(CYGPATH_W) '$(srcdir)/OnlineControl.cc'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/OnlineControl-OnlineControl.Tpo" "$(DEPDIR)/OnlineControl-OnlineControl.Po"; else rm -f "$(DEPDIR)/OnlineControl-OnlineControl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OnlineControl.cc' object='OnlineControl-OnlineControl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OnlineControl-OnlineControl.obj `if test -f 'OnlineControl.cc'; then $(CYGPATH_W) 'OnlineControl.cc'; else $(CYGPATH_W) '$(srcdir)/OnlineControl.cc'; fi` + +OnlineControl-OnlineControlMain.o: OnlineControlMain.cc +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OnlineControl-OnlineControlMain.o -MD -MP -MF "$(DEPDIR)/OnlineControl-OnlineControlMain.Tpo" -c -o OnlineControl-OnlineControlMain.o `test -f 'OnlineControlMain.cc' || echo '$(srcdir)/'`OnlineControlMain.cc; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/OnlineControl-OnlineControlMain.Tpo" "$(DEPDIR)/OnlineControl-OnlineControlMain.Po"; else rm -f "$(DEPDIR)/OnlineControl-OnlineControlMain.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OnlineControlMain.cc' object='OnlineControl-OnlineControlMain.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OnlineControl-OnlineControlMain.o `test -f 'OnlineControlMain.cc' || echo '$(srcdir)/'`OnlineControlMain.cc + +OnlineControl-OnlineControlMain.obj: OnlineControlMain.cc +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OnlineControl-OnlineControlMain.obj -MD -MP -MF "$(DEPDIR)/OnlineControl-OnlineControlMain.Tpo" -c -o OnlineControl-OnlineControlMain.obj `if test -f 'OnlineControlMain.cc'; then $(CYGPATH_W) 'OnlineControlMain.cc'; else $(CYGPATH_W) '$(srcdir)/OnlineControlMain.cc'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/OnlineControl-OnlineControlMain.Tpo" "$(DEPDIR)/OnlineControl-OnlineControlMain.Po"; else rm -f "$(DEPDIR)/OnlineControl-OnlineControlMain.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OnlineControlMain.cc' object='OnlineControl-OnlineControlMain.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OnlineControl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OnlineControl-OnlineControlMain.obj `if test -f 'OnlineControlMain.cc'; then $(CYGPATH_W) 'OnlineControlMain.cc'; else $(CYGPATH_W) '$(srcdir)/OnlineControlMain.cc'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-configfilesDATA: $(configfiles_DATA) + @$(NORMAL_INSTALL) + test -z "$(configfilesdir)" || $(mkdir_p) "$(DESTDIR)$(configfilesdir)" + @list='$(configfiles_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(configfilesDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configfilesdir)/$$f'"; \ + $(configfilesDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configfilesdir)/$$f"; \ + done + +uninstall-configfilesDATA: + @$(NORMAL_UNINSTALL) + @list='$(configfiles_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(configfilesdir)/$$f'"; \ + rm -f "$(DESTDIR)$(configfilesdir)/$$f"; \ + done +install-sysconfDATA: $(sysconf_DATA) + @$(NORMAL_INSTALL) + test -z "$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)" + @list='$(sysconf_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ + $(sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ + done + +uninstall-sysconfDATA: + @$(NORMAL_UNINSTALL) + @list='$(sysconf_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ + done +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(mkdir_p) $(distdir)/../.. + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configfilesdir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-configfilesDATA install-pkgincludeHEADERS + +install-exec-am: install-binPROGRAMS install-sysconfDATA + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-configfilesDATA \ + uninstall-info-am uninstall-pkgincludeHEADERS \ + uninstall-sysconfDATA + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-local ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-configfilesDATA \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man \ + install-pkgincludeHEADERS install-strip install-sysconfDATA \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-configfilesDATA uninstall-info-am \ + uninstall-pkgincludeHEADERS uninstall-sysconfDATA + + +%.log_prop: %.log_prop.in + cp $< $@ + +clean-local: + rm -f *.ph + +# CLEANFILES cannot delete directories, therefore use target clean-generic. +clean-generic: + -rm -rf ti_files + -rm -f tca.* + -rm -f .inslog* + -rm -f *.log + -rm -f *.i + -rm -f *.s + -rm -f src/*.h + -rm -f *.hh + -rm -f *.cc + -rm -f *.cs_cc + -rm -f doxygen.cfg + -rm -rf $(top_builddir)/pure_cache + -rm -rf docxxhtml + +# Rule to delete all files generated by bootstrap. +# This is sometimes needed when switching to another version of autotools. +confclean: pkgclean +pkgclean: distclean + -rm -rf $(srcdir)/autom4te.cache + -rm -f $(srcdir)/config.* + -rm -f $(srcdir)/{configure,aclocal.m4,depcomp,install-sh,ltmain.sh} + -rm -f $(srcdir)/{Makefile.in,missing,mkinstalldirs} + -rm -f $(srcdir)/{Makefile.common,autoconf_share,lofarconf} + +# Make the rpm if possible. +# Note: +# MAKE_RPMS is set by lofar_init and possibly overwritten by lofar_general. +# Older package releases include Makefile.common from $lofar_sharedir +# with the effect that the include is handled by make. +# Newer releases (as of 1-11-2005) include Makefile.common from $top_srcdir +# with the effect that the include is handled by automake. +# To be compatible with older releases, it was decided that the MAKE_RPMS +# should be handled by make, hence the blank before endif. Otherwise +# automake complains about an endif without an if. + ifeq "$(MAKE_RPMS)" "true" + rpm: dist @RPM_TARGET@ + $(RPM_TARGET): $(DISTFILES) + ${MAKE} dist + -mkdir -p $(RPM_DIR)/SRPMS + -mkdir -p `dirname $(RPM_TARGET)` + $(RPM_PROG) $(RPM_ARGS) $(RPM_TARBALL) + @echo Congratulations, $(RPM_TARGET) "(and friends)" should now exist. + endif +# Put the phony target outside the if, otherwise automake gives +# warnings if a .PHONY is also defined in the Makefile.am. +.PHONY: rpm + +# Only preprocess the file. +%.i: %.cc + $(CXX) -E $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $< > $@ +%.i: %.c + $(CC) -E $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $< > $@ + +# Only compile (but not assemble) the file. +%.s: %.cc + $(CXX) -S $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $< +%.s: %.c + $(CC) -S $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $< + +# Rules for preprocessing idl files. +# There should be a corresponding .cc file in the source directory +# including the .cs_cc file. +%.cs_cc: %.idl + $(IDLCXX) $(IDLFLAGS) $(AM_IDLFLAGS) $< + echo '#include "$*_c.cc"' > $*.cs_cc + echo '#include "$*_s.cc"' >> $*.cs_cc + +# Rules for preprocessing Qt sources. +%.moc.cc: %.h + $(QT_DIR)/bin/moc $< -o $@ + +# Rule to build all test programs. +test: $(check_PROGRAMS) + +# Rule to build and run one or more test programs. +# The programs to build/run must be defined in the PGM variable. +checkrun: + @if [ "$(PGM)" = "" ] ; then \ + echo "Error: use as: make (mem)checkrun PGM=testprogram"; \ + else \ + curwd=`pwd`; \ + bcurwd=`basename $$curwd`; \ + if [ "$$bcurwd" != test ]; then \ + echo "Error: run (mem)checkrun in test directory"; \ + else \ + PGMB=; \ + PGMT=; \ + for PGMVAR in $(PGM) ; \ + do \ + grep "^ *$${PGMVAR}_SOURCES" $(srcdir)/Makefile.am >& /dev/null; \ + if [ $$? = 0 ]; then \ + PGMB="$$PGMB $$PGMVAR"; \ + fi; \ + PGMTST=$$PGMVAR; \ + if [ -f $(srcdir)/$${PGMVAR}.sh ] ; then \ + PGMTST=$(srcdir)/$${PGMVAR}.sh; \ + elif [ -f $(srcdir)/$${PGMVAR}_test.sh ] ; then \ + PGMTST=$(srcdir)/$${PGMVAR}_test.sh; \ + fi; \ + PGMT="$$PGMT $$PGMTST"; \ + done; \ + echo "make check CHECKTOOL='$(CHECKTOOL)' check_PROGRAMS='$$PGMB' TESTS='$$PGMT'"; \ + make check CHECKTOOL="$(CHECKTOOL)" check_PROGRAMS="$$PGMB" TESTS="$$PGMT"; \ + fi \ + fi + +# Rule to run test programs using valgrind's memcheck tool. +memcheck: + @$(RM) `find . -name "*.valgrind.*"` + make check CHECKTOOL='valgrind --tool=memcheck --num-callers=50 --leak-check=yes --track-fds=yes --log-file=[PROGNAME].valgrind' + @vgfils=`find . -name "*.valgrind.*"`; \ + vgfils=`echo $$vgfils`; \ + nrvg=`echo "$$vgfils" | wc -w`; \ + nrvg=`echo $$nrvg`; \ + if [ "$$nrvg" != 0 -a "$$nrvg" != "" ]; then \ + echo ''; \ + echo "memcheck error summary from $$nrvg *.valgrind.* file(s)"; \ + echo '--------------------------------------------------'; \ + (grep "ERROR SUMMARY: " `echo $$vgfils` | grep -v " 0 errors ") || echo "No memory check errors"; \ + (grep "definitely lost: " `echo $$vgfils` | grep -v " 0 bytes ") || echo "No definite memory leaks"; \ + (grep "possibly lost: " `echo $$vgfils` | grep -v " 0 bytes ") || echo "No possible memory leaks"; \ + (grep " open file descriptor " `echo $$vgfils` | grep -v "descriptor [012]:") || echo "No file descriptor leaks"; \ + fi + +# Rule to build and run memcheck for one or more test programs. +# The programs to build/run must be defined in the PGM variable. +memcheckrun: + $(RM) `find . -name "*.valgrind.*"` + make checkrun CHECKTOOL='valgrind --tool=memcheck --num-callers=50 --leak-check=yes --track-fds=yes --log-file=[PROGNAME].valgrind' PGM="$(PGM)" + @vgfils=`find . -name "*.valgrind.*"`; \ + vgfils=`echo $$vgfils`; \ + nrvg=`echo "$$vgfils" | wc -w`; \ + nrvg=`echo $$nrvg`; \ + if [ "$$nrvg" != 0 -a "$$nrvg" != "" ]; then \ + echo ''; \ + echo "memcheckrun error summary from $$nrvg *.valgrind.* file(s)"; \ + echo '-----------------------------------------------------'; \ + (grep "ERROR SUMMARY: " `echo $$vgfils` | grep -v " 0 errors ") || echo "No memory check errors"; \ + (grep "definitely lost: " `echo $$vgfils` | grep -v " 0 bytes ") || echo "No definite memory leaks"; \ + (grep "possibly lost: " `echo $$vgfils` | grep -v " 0 bytes ") || echo "No possible memory leaks"; \ + (grep " open file descriptor " `echo $$vgfils` | grep -v "descriptor [012]:") || echo "No file descriptor leaks"; \ + fi + +doc: + @if [ "$(lofar_doctool)" = "doxygen" ] ; then \ + cp $(top_builddir)/.doxygenrc doxygen.cfg ; \ + projnm=`(cd $(srcdir) && pwd) | sed -e "s%.*/LOFAR/%%"` ; \ + echo "PROJECT_NAME = $$projnm" >> doxygen.cfg ; \ + echo "INPUT = $(srcdir)" >> doxygen.cfg ; \ + echo "RECURSIVE = YES" >> doxygen.cfg ; \ + echo "HTML_OUTPUT = $(DOCDIR)" >> doxygen.cfg ; \ + echo "EXCLUDE = $(srcdir)/build $(srcdir)/test $(srcdir)/demo" >> doxygen.cfg; \ + echo "GENERATE_TAGFILE = `basename $$projnm`.tag" >> doxygen.cfg ; \ + $(DOXYGEN) doxygen.cfg ; \ + else \ + if [ "$(lofar_doctool)" = "docpp" ] ; then \ + $(DOCPP) $(DOCPPFLAGS) --dir $(DOCDIR) `find $(srcdir) -name "*.h" -print` ; \ + else \ + echo "Error: No documentation tool configured" ; \ + fi \ + fi + +docthis: + @if [ "$(lofar_doctool)" = "doxygen" ] ; then \ + cp $(top_builddir)/.doxygenrc doxygen.cfg ; \ + projnm=`(cd $(srcdir) && pwd) | sed -e "s%.*/LOFAR/%%"` ; \ + echo "PROJECT_NAME = $$projnm" >> doxygen.cfg ; \ + echo "INPUT = $(srcdir)/src" >> doxygen.cfg ; \ + echo "RECURSIVE = NO" >> doxygen.cfg ; \ + echo "HTML_OUTPUT = $(DOCDIR)" >> doxygen.cfg ; \ + $(DOXYGEN) doxygen.cfg ; \ + else \ + if [ "$(lofar_doctool)" = "docpp" ] ; then \ + $(DOCPP) $(DOCPPFLAGS) --dir $(DOCDIR) $(srcdir)/*.h ; \ + else \ + echo "Error: No documentation tool configured" ; \ + fi \ + fi +build_system: + @if test 2 -eq $(WITH_CLEAN); then \ + $(MAKE) cleandist ; \ + ../../lofarconf; \ + fi; \ + if test 1 -eq $(WITH_CLEAN); then \ + $(MAKE) clean ; \ + fi; \ + $(MAKE); \ + if test 1 -eq $(WITH_CHECK); then \ + $(MAKE) check CHECKTOOL="$(CHECKTOOL)"; \ + fi; \ + if test 1 -eq $(WITH_INSTALL); then \ + $(MAKE) install ; \ + fi; + +# Show the important make variables. +show: + @echo "CXX = $(CXX)"; + @echo " `$(CXX) --version | head -1`"; + @echo "CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS)"; + @echo "CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS)"; + @echo "LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS)"; + @echo "LIBS = $(LIBS)"; + @echo "MPIBIN = $(MPIBIN)"; + @echo "AIPSPP = $(AIPSPP)"; + @echo "prefix = $(prefix)"; + +help: + @echo "make targets"; + @echo "------------"; + @echo "show show important make variables"; + @echo "pgm build test program pgm (in test directory)"; + @echo "test build all test programs"; + @echo "check build, run, and check all test programs"; + @echo "check CHECKTOOL= check test programs with a checktool (like valgrind)"; + @echo "memcheck check CHECKTOOL='valgrind --tool=memcheck" + @echo " --num-callers=50 --leak-check=yes --track-fds=yes'" + @echo "checkrun PGM= build, run, and check given test program(s)"; + @echo "memcheckrun PGM= build, run, and memcheck given test program(s)"; + @echo "" + @echo "file.o make object file (in src or test directory)"; + @echo "file.i make preprocessed file"; + @echo "file.s make assembly file"; + @echo "clean remove object files, etc." + @echo "distclean remove almost everything; requires a new lofarconf"; + @echo "pkgclean distclean and remove files generated by bootstrap"; + @echo " requires a new bootstrap and lofarconf"; + @echo "install install package in $(prefix)"; + @echo "dist make a distribution"; + @echo "distcheck make and check a distribution"; + @echo "rpm make an rpm"; + +# Define the default variables to export to the test scripts. +#TESTS_ENVIRONMENT = LOFARROOT="$(LOFARROOT)" \ +# lofar_sharedir="$(lofar_sharedir)" \ +# prefix="$(prefix)" \ +# top_srcdir="$(top_srcdir)" \ +# srcdir="$(srcdir)" \ +# CHECKTOOLPROGS="$(CHECKTOOLPROGS)" \ +# MPIBIN="$(MPIBIN)" \ +# AIPSPP="$(AIPSPP)" +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc new file mode 100644 index 0000000000000000000000000000000000000000..a9607daeff19d47205bd36516a481441947024ef --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc @@ -0,0 +1,669 @@ +//# OnlineControl.cc: Implementation of the MAC Scheduler task +//# +//# Copyright (C) 2006 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program 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 2 of the License, or +//# (at your option) any later version. +//# +//# This program 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 this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include <boost/shared_array.hpp> +#include <APS/ParameterSet.h> +#include <APS/Exceptions.h> +#include <GCF/GCF_PVTypes.h> +#include <GCF/PAL/GCF_PVSSInfo.h> +#include <GCF/Utils.h> +#include <GCF/GCF_ServiceInfo.h> +#include <GCF/Protocols/PA_Protocol.ph> +#include <APL/APLCommon/APL_Defines.h> +#include <APL/APLCommon/APLUtilities.h> +#include <APL/APLCommon/APLCommonExceptions.h> +#include <APL/APLCommon/Controller_Protocol.ph> +#include <APL/APLCommon/StationInfo.h> +#include <APL/APLCommon/APLUtilities.h> + +#include "OnlineControl.h" +#include "OnlineControlDefines.h" + +using namespace LOFAR::GCF::Common; +using namespace LOFAR::GCF::TM; +using namespace LOFAR::GCF::PAL; +using namespace std; + +namespace LOFAR { + using namespace APLCommon; + using namespace ACC::APS; + using namespace ACC::ALC; + namespace CEPCU { + +// +// OnlineControl() +// +OnlineControl::OnlineControl(const string& cntlrName) : + GCFTask ((State)&OnlineControl::initial_state,cntlrName), + PropertySetAnswerHandlerInterface(), + itsPropertySetAnswer(*this), + itsPropertySet (), + itsPropertySetInitialized (false), + itsParentControl (0), + itsParentPort (0), + itsTimerPort (0), + itsCepApplication (*this, cntlrName), + itsCepAppParams (), + itsResultParams (), + itsState (CTState::NOSTATE), + itsTreePrefix (""), + itsInstanceNr (0), + itsStartTime (), + itsStopTime (), + itsClaimPeriod (), + itsPreparePeriod () +{ + LOG_TRACE_OBJ_STR (cntlrName << " construction"); + + // First readin our observation related config file. + LOG_DEBUG_STR("Reading parset file:" << LOFAR_SHARE_LOCATION << "/" << cntlrName); + globalParameterSet()->adoptFile(string(LOFAR_SHARE_LOCATION)+"/"+cntlrName); + + + // Readin some parameters from the ParameterSet. + itsTreePrefix = globalParameterSet()->getString("prefix"); + itsInstanceNr = globalParameterSet()->getUint32("_instanceNr"); + + // get Observation based information + itsStartTime = time_from_string(globalParameterSet()-> + getString("Observation.startTime")); + itsStopTime = time_from_string(globalParameterSet()-> + getString("Observation.stopTime")); + itsClaimPeriod = globalParameterSet()->getTime ("Observation.claimPeriod"); + itsPreparePeriod = globalParameterSet()->getTime ("Observation.preparePeriod"); + + // attach to parent control task + itsParentControl = ParentControl::instance(); + itsParentPort = new GCFITCPort (*this, *itsParentControl, "ParentITCport", + GCFPortInterface::SAP, CONTROLLER_PROTOCOL); + ASSERTSTR(itsParentPort, "Cannot allocate ITCport for Parentcontrol"); + itsParentPort->open(); // will result in F_CONNECTED + + // need port for timers. + itsTimerPort = new GCFTimerPort(*this, "TimerPort"); + + // for debugging purposes + registerProtocol (CONTROLLER_PROTOCOL, CONTROLLER_PROTOCOL_signalnames); + registerProtocol (PA_PROTOCOL, PA_PROTOCOL_signalnames); + + setState(CTState::CREATED); +} + + +// +// ~OnlineControl() +// +OnlineControl::~OnlineControl() +{ + LOG_TRACE_OBJ_STR (getName() << " destruction"); + + if (itsPropertySet) { + itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("down")); + itsPropertySet->disable(); + } + + // ... +} + +// +// setState(CTstateNr) +// +void OnlineControl::setState(CTState::CTstateNr newState) +{ + itsState = newState; + + if (itsPropertySet) { + CTState cts; + itsPropertySet->setValue(string(PVSSNAME_FSM_STATE), + GCFPVString(cts.name(newState))); + } +} + + +// +// handlePropertySetAnswer(answer) +// +void OnlineControl::handlePropertySetAnswer(GCFEvent& answer) +{ + LOG_DEBUG_STR ("handlePropertySetAnswer:" << evtstr(answer)); + + switch(answer.signal) { + case F_MYPS_ENABLED: { + GCFPropSetAnswerEvent* pPropAnswer=static_cast<GCFPropSetAnswerEvent*>(&answer); + if(pPropAnswer->result != GCF_NO_ERROR) { + LOG_ERROR(formatString("%s : PropertySet %s NOT ENABLED", + getName().c_str(), pPropAnswer->pScope)); + } + // always let timer expire so main task will continue. + itsTimerPort->setTimer(1.0); + break; + } + + case F_PS_CONFIGURED: { + GCFConfAnswerEvent* pConfAnswer=static_cast<GCFConfAnswerEvent*>(&answer); + if(pConfAnswer->result == GCF_NO_ERROR) { + LOG_DEBUG(formatString("%s : apc %s Loaded", + getName().c_str(), pConfAnswer->pApcName)); + //apcLoaded(); + } + else { + LOG_ERROR(formatString("%s : apc %s NOT LOADED", + getName().c_str(), pConfAnswer->pApcName)); + } + break; + } + + case F_VGETRESP: + case F_VCHANGEMSG: { + // check which property changed + // GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&answer); + + // TODO: implement something usefull. + break; + } + +// case F_SUBSCRIBED: +// case F_UNSUBSCRIBED: +// case F_PS_CONFIGURED: +// case F_EXTPS_LOADED: +// case F_EXTPS_UNLOADED: +// case F_MYPS_ENABLED: +// case F_MYPS_DISABLED: +// case F_VGETRESP: +// case F_VCHANGEMSG: +// case F_SERVER_GONE: + + default: + break; + } +} + + +// +// initial_state(event, port) +// +// Setup all connections. +// +GCFEvent::TResult OnlineControl::initial_state(GCFEvent& event, + GCFPortInterface& port) +{ + LOG_DEBUG_STR ("initial:" << evtstr(event) << "@" << port.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (event.signal) { + case F_ENTRY: + break; + + case F_INIT: { + // Get access to my own propertyset. + LOG_DEBUG ("Activating PropertySet"); + string propSetName = formatString(ONC_PROPSET_NAME, itsInstanceNr); + itsPropertySet = GCFMyPropertySetPtr(new GCFMyPropertySet(propSetName.c_str(), + ONC_PROPSET_TYPE, + PS_CAT_TEMPORARY, + &itsPropertySetAnswer)); + itsPropertySet->enable(); + // Wait for timer that is set in PropertySetAnswer on ENABLED event + } + break; + + case F_TIMER: + if (!itsPropertySetInitialized) { + itsPropertySetInitialized = true; + + // update PVSS. + LOG_TRACE_FLOW ("Updateing state to PVSS"); + itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("initial")); + itsPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); + + // Start ParentControl task + LOG_DEBUG ("Enabling ParentControl task"); + itsParentPort = itsParentControl->registerTask(this); + + LOG_DEBUG ("Going to operational state"); + TRAN(OnlineControl::active_state); // go to next state. + } + break; + + case F_CONNECTED: + ASSERTSTR (&port == itsParentPort, + "F_CONNECTED event from port " << port.getName()); + break; + + case F_DISCONNECTED: + break; + + default: + LOG_DEBUG_STR ("initial, default"); + status = GCFEvent::NOT_HANDLED; + break; + } + return (status); +} + + +// +// active_state(event, port) +// +// Normal operation state. +// +GCFEvent::TResult OnlineControl::active_state(GCFEvent& event, GCFPortInterface& port) +{ + LOG_DEBUG_STR ("active:" << evtstr(event) << "@" << port.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (event.signal) { + case F_ENTRY: { + // update PVSS + itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("active")); + itsPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); + break; + } + + case F_INIT: + break; + + case F_ACCEPT_REQ: + break; + + case F_CONNECTED: { + ASSERTSTR (&port == itsParentPort, "F_CONNECTED event from port " << port.getName()); + break; + } + + case F_DISCONNECTED: { + port.close(); + break; + } + + case F_TIMER: +// GCFTimerEvent& timerEvent=static_cast<GCFTimerEvent&>(event); + break; + + // -------------------- EVENTS RECEIVED FROM PARENT CONTROL -------------------- + case CONTROL_CONNECT: { + CONTROLConnectEvent msg(event); + LOG_DEBUG_STR("Received CONNECT(" << msg.cntlrName << ")"); + setState(CTState::CONNECTED); + CONTROLConnectedEvent answer; + answer.cntlrName = msg.cntlrName; + port.send(answer); + break; + } + + case CONTROL_SCHEDULED: { + CONTROLScheduledEvent msg(event); + LOG_DEBUG_STR("Received SCHEDULED(" << msg.cntlrName << ")"); + // TODO: do something usefull with this information! + break; + } + + case CONTROL_CLAIM: { + CONTROLClaimEvent msg(event); + LOG_DEBUG_STR("Received CLAIM(" << msg.cntlrName << ")"); + setState(CTState::CLAIM); + setState(CTState::CLAIMED); + CONTROLClaimedEvent answer; + answer.cntlrName = getName(); + answer.result = doClaim(msg.cntlrName); + if(answer.result == CT_RESULT_NO_ERROR) + { + setState(CTState::CLAIMED); + } + port.send(answer); + + break; + } + + case CONTROL_PREPARE: { + CONTROLPrepareEvent msg(event); + LOG_DEBUG_STR("Received PREPARE(" << msg.cntlrName << ")"); + setState(CTState::PREPARE); + CONTROLPreparedEvent answer; + answer.cntlrName = getName(); + answer.result = doPrepare(msg.cntlrName); + if(answer.result == CT_RESULT_NO_ERROR) + { + setState(CTState::PREPARED); + } + port.send(answer); + break; + } + + case CONTROL_RESUME: { + CONTROLResumeEvent msg(event); + LOG_DEBUG_STR("Received RESUME(" << msg.cntlrName << ")"); + setState(CTState::ACTIVE); + // TODO: implement something useful + CONTROLResumedEvent answer; + answer.cntlrName = msg.cntlrName; + port.send(answer); + break; + } + + case CONTROL_SUSPEND: { + CONTROLSuspendEvent msg(event); + LOG_DEBUG_STR("Received SUSPEND(" << msg.cntlrName << ")"); + setState(CTState::SUSPENDED); + // TODO: implement something useful + CONTROLSuspendedEvent answer; + answer.cntlrName = msg.cntlrName; + port.send(answer); + break; + } + + case CONTROL_RELEASE: { + CONTROLReleaseEvent msg(event); + LOG_DEBUG_STR("Received RELEASED(" << msg.cntlrName << ")"); + setState(CTState::RELEASE); + doRelease(event); + setState(CTState::RELEASED); + CONTROLReleasedEvent answer; + answer.cntlrName = msg.cntlrName; + port.send(answer); + break; + } + + default: + LOG_DEBUG("active_state, default"); + status = GCFEvent::NOT_HANDLED; + break; + } + + return (status); +} + + +// +// doPrepare(cntlrName) +// +uint16_t OnlineControl::doClaim(const string& cntlrName) +{ + uint16_t result = CT_RESULT_NO_ERROR; + try + { + itsCepAppParams.clear(); + + itsCepAppParams.replace("AC.application", cntlrName); + itsCepAppParams.replace("AC.resultfile", formatString("./ACC-%s_result.param", cntlrName.c_str())); + + string processScope("AC.process"); + string onlineCtrlPrefix(globalParameterSet()->locateModule("OnlineCtrl") + "OnlineCtrl."); + + string procName, newProcName, nodeName; + string ldName(getName().c_str()); + + procName = globalParameterSet()->getString(onlineCtrlPrefix+"ApplCtrl.application"); + + itsCepAppParams.adoptCollection(globalParameterSet()->makeSubset(onlineCtrlPrefix+"ApplCtrl", "AC")); + itsCepAppParams.adoptCollection(globalParameterSet()->makeSubset(onlineCtrlPrefix+procName, procName)); + + } + catch(APSException &) + { + // key not found. skip + result = CT_RESULT_UNSPECIFIED; + } + return result; +} + +// +// doPrepare(cntlrName) +// +uint16_t OnlineControl::doPrepare(const string& cntlrName) +{ + uint16_t result = CT_RESULT_NO_ERROR; + + try + { + // TODO use parameterset of 'cntlrname' when being shared controller + + string paramFileName(formatString("ACC-%s.param", cntlrName.c_str())); + itsCepAppParams.writeFile(paramFileName); + + // schedule all ACC commands + time_t startTime = to_time_t(itsStartTime); + time_t initTime = startTime - itsCepAppParams.getTime("AC.timeout.init"); + time_t defineTime = initTime - itsCepAppParams.getTime("AC.timeout.define") - + itsCepAppParams.getTime("AC.timeout.startup"); + time_t bootTime = defineTime - itsCepAppParams.getTime("AC.timeout.createsubsets"); + time_t now = time(0); + time_t stopTime = to_time_t(itsStopTime); + LOG_DEBUG(formatString("%d boot %s", bootTime, ctime(&bootTime))); + LOG_DEBUG(formatString("%d define %s", defineTime, ctime(&defineTime))); + LOG_DEBUG(formatString("%d init %s", initTime, ctime(&initTime))); + LOG_DEBUG(formatString("%d start %s", startTime, ctime(&startTime))); + LOG_DEBUG(formatString("%d now %s time %d", now, ctime(&now), time(0))); + LOG_DEBUG(formatString("%d stop %s", stopTime, ctime(&stopTime))); + + string hostName, remoteParamPath; + hostName = itsCepAppParams.getString("AC.hostname"); + remoteParamPath = itsCepAppParams.getString("AC.remoteParamPath"); + if (now > bootTime) + { + APLCommon::APLUtilities::remoteCopy(paramFileName,hostName,remoteParamPath); + LOG_WARN("Cannot guarantee all CEP processes are started in time."); + } + else + { + switch (itsCepApplication.getLastOkCmd()) + { + case ACCmdNone: + itsCepApplication.boot(bootTime, paramFileName); + break; + + case ACCmdBoot: + itsCepApplication.define(defineTime); + break; + + case ACCmdDefine: + case ACCmdInit: + case ACCmdRun: + itsCepApplication.recover(0, "snapshot-DB"); + break; + + default: + assert(0); + break; + } + APLCommon::APLUtilities::remoteCopy(paramFileName,hostName,remoteParamPath); + } + } + catch(APSException &) + { + // key not found. skip + result = CT_RESULT_UNSPECIFIED; + } + return result; +} + +// +// doRelease(event) +// +void OnlineControl::doRelease(GCFEvent& /*event*/) +{ + string hostName, remoteFile, resultFile; + hostName = itsCepAppParams.getString("AC.hostname"); + resultFile = formatString("ACC-%s_result.param", getName().c_str()); + remoteFile = itsCepAppParams.getString("AC.remoteParamPath") + string("/") + resultFile; + APLCommon::APLUtilities::copyFromRemote(hostName,remoteFile,resultFile); + itsResultParams.adoptFile(resultFile); + // itsResultParams.replace(KVpair(formatString("%s.quality", getName().c_str()), (int) _qualityGuard.getQuality())); + if (!itsResultParams.isDefined(formatString("%s.faultyNodes", getName().c_str()))) + { + itsResultParams.add(formatString("%s.faultyNodes", getName().c_str()), ""); + } + itsResultParams.writeFile(formatString("%s_result.param", getName().c_str())); + + itsCepApplication.quit(0); +} + + +// _connectedHandler(port) +// +void OnlineControl::_connectedHandler(GCFPortInterface& /*port*/) +{ +} + +// +// _disconnectedHandler(port) +// +void OnlineControl::_disconnectedHandler(GCFPortInterface& port) +{ + port.close(); +} + +void OnlineControl::appBooted(uint16 result) +{ + if (result == (AcCmdMaskOk | AcCmdMaskScheduled)) + { + time_t startTime = to_time_t(itsStartTime); + time_t initTime = startTime - itsCepAppParams.getTime("AC.timeout.init"); + time_t defineTime = initTime - itsCepAppParams.getTime("AC.timeout.define") - + itsCepAppParams.getTime("AC.timeout.startup"); + itsCepApplication.define(defineTime); + } + else if (result == 0) // Error + { + LOG_ERROR("Error in ACC. Stops CEP application and releases Online Control."); + itsCepApplication.quit(0); + // _doStateTransition(LOGICALDEVICE_STATE_RELEASING, LD_RESULT_LOW_QUALITY); + } +} + +void OnlineControl::appDefined(uint16 result) +{ + if (result == (AcCmdMaskOk | AcCmdMaskScheduled)) + { + time_t startTime = to_time_t(itsStartTime); + time_t initTime = startTime - itsCepAppParams.getTime("AC.timeout.init"); + + itsCepApplication.init(initTime); + } + else if (result == 0) // Error + { + LOG_ERROR("Error in ACC. Stops CEP application and releases VB."); + itsCepApplication.quit(0); + // _doStateTransition(LOGICALDEVICE_STATE_RELEASING, LD_RESULT_LOW_QUALITY); + } +} + +void OnlineControl::appInitialized(uint16 result) +{ + if (result == AcCmdMaskOk) + { + // _doStateTransition(LOGICALDEVICE_STATE_SUSPENDED); + } + else if (result == (AcCmdMaskOk | AcCmdMaskScheduled)) + { + itsCepApplication.run(to_time_t(itsStartTime)); + } + else if (result == 0) // Error + { + LOG_ERROR("Error in ACC. Stops CEP application and releases VB."); + itsCepApplication.quit(0); + // _doStateTransition(LOGICALDEVICE_STATE_RELEASING, LD_RESULT_LOW_QUALITY); + } +} + +void OnlineControl::appRunDone(uint16 result) +{ + if (result == (AcCmdMaskOk | AcCmdMaskScheduled)) + { + itsCepApplication.quit(to_time_t(itsStopTime)); + } + else if (result == 0) // Error + { + LOG_ERROR("Error in ACC. Stops CEP application and releases VB."); + itsCepApplication.quit(0); + // _doStateTransition(LOGICALDEVICE_STATE_RELEASING, LD_RESULT_LOW_QUALITY); + } +} + +void OnlineControl::appPaused(uint16 /*result*/) +{ +} + +void OnlineControl::appQuitDone(uint16 result) +{ + if (result == AcCmdMaskOk) + { + //_qualityGuard.stopMonitoring(); // not in this increment + } +} + +void OnlineControl::appSnapshotDone(uint16 /*result*/) +{ + time_t rsto(0); + try + { + rsto = globalParameterSet()->getTime("rescheduleTimeOut"); + } + catch (...) {} + itsCepApplication.pause(0, rsto, "condition"); +} + +void OnlineControl::appRecovered(uint16 /*result*/) +{ + + time_t startTime = to_time_t(itsStartTime); + time_t reinitTime = startTime - itsCepAppParams.getTime("AC.timeout.reinit"); + + string paramFileName(formatString("ACC-%s.param", getName().c_str())); + + itsCepApplication.reinit(reinitTime, paramFileName); +} + +void OnlineControl::appReinitialized(uint16 result) +{ + if (result == AcCmdMaskOk) + { + // _doStateTransition(LOGICALDEVICE_STATE_SUSPENDED); + } + else if (result == (AcCmdMaskOk | AcCmdMaskScheduled)) + { + itsCepApplication.run(to_time_t(itsStartTime)); + } +} + +void OnlineControl::appReplaced(uint16 /*result*/) +{ +} + +string OnlineControl::appSupplyInfo(const string& keyList) +{ + string ret(keyList); + return ret; +} + +void OnlineControl::appSupplyInfoAnswer(const string& answer) +{ + LOG_INFO_STR("Answer: " << answer); +} + + +}; // CEPCU +}; // LOFAR diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h new file mode 100644 index 0000000000000000000000000000000000000000..9328c5e29adcd3f6603932eef917fe52167131c6 --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h @@ -0,0 +1,145 @@ +//# OnlineControl.h: Controller for the OnlineControl +//# +//# Copyright (C) 2006 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program 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 2 of the License, or +//# (at your option) any later version. +//# +//# This program 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 this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ + +#ifndef ONLINECONTROL_H +#define ONLINECONTROL_H + +//# Includes +#include <boost/shared_ptr.hpp> + +//# GCF Includes +#include <GCF/PAL/GCF_MyPropertySet.h> +#include <GCF/TM/GCF_Port.h> +#include <GCF/TM/GCF_ITCPort.h> +#include <GCF/TM/GCF_TimerPort.h> +#include <GCF/TM/GCF_Task.h> +#include <GCF/TM/GCF_Event.h> + +//# local includes +#include <APL/APLCommon/PropertySetAnswerHandlerInterface.h> +#include <APL/APLCommon/PropertySetAnswer.h> +#include <APL/APLCommon/APLCommonExceptions.h> +#include <APL/APLCommon/Controller_Protocol.ph> +#include <APL/APLCommon/ParentControl.h> +#include <APL/APLCommon/CTState.h> + +#include <CEPApplicationManager.h> + +//# Common Includes +#include <Common/lofar_string.h> +#include <Common/lofar_vector.h> +#include <Common/lofar_datetime.h> +#include <Common/LofarLogger.h> + +//# ACC Includes +#include <APS/ParameterSet.h> + +// forward declaration + +namespace LOFAR { + namespace CEPCU { + +using GCF::TM::GCFTimerPort; +using GCF::TM::GCFITCPort; +using GCF::TM::GCFPort; +using GCF::TM::GCFEvent; +using GCF::TM::GCFPortInterface; +using GCF::TM::GCFTask; +using APLCommon::ParentControl; + + +class OnlineControl : public GCFTask, + public APLCommon::PropertySetAnswerHandlerInterface, + public CEPApplicationManagerInterface +{ +public: + explicit OnlineControl(const string& cntlrName); + ~OnlineControl(); + + // PropertySetAnswerHandlerInterface method + void handlePropertySetAnswer(GCFEvent& answer); + + // During the initial state all connections with the other programs are made. + GCFEvent::TResult initial_state (GCFEvent& e, + GCFPortInterface& p); + + // Normal control mode. + GCFEvent::TResult active_state (GCFEvent& e, + GCFPortInterface& p); + +protected: // implemenation of abstract CEPApplicationManagerInterface methods + void appBooted(uint16 result); + void appDefined(uint16 result); + void appInitialized(uint16 result); + void appRunDone(uint16 result); + void appPaused(uint16 result); + void appQuitDone(uint16 result); + void appSnapshotDone(uint16 result); + void appRecovered(uint16 result); + void appReinitialized(uint16 result); + void appReplaced(uint16 result); + string appSupplyInfo(const string& keyList); + void appSupplyInfoAnswer(const string& answer); + +private: + // avoid defaultconstruction and copying + OnlineControl(); + OnlineControl(const OnlineControl&); + OnlineControl& operator=(const OnlineControl&); + + uint16_t doClaim(const string& cntlrName); + uint16_t doPrepare(const string& cntlrName); + void doRelease(GCFEvent& event); + void _connectedHandler(GCFPortInterface& port); + void _disconnectedHandler(GCFPortInterface& port); + void setState(CTState::CTstateNr newState); + + typedef boost::shared_ptr<GCF::PAL::GCFMyPropertySet> GCFMyPropertySetPtr; + + APLCommon::PropertySetAnswer itsPropertySetAnswer; + GCFMyPropertySetPtr itsPropertySet; + bool itsPropertySetInitialized; + + // pointer to parent control task + ParentControl* itsParentControl; + GCFITCPort* itsParentPort; + + GCFTimerPort* itsTimerPort; + + CEPApplicationManager itsCepApplication; + ACC::APS::ParameterSet itsCepAppParams; + ACC::APS::ParameterSet itsResultParams; + + CTState::CTstateNr itsState; + + // ParameterSet variables + string itsTreePrefix; + uint32 itsInstanceNr; + ptime itsStartTime; + ptime itsStopTime; + uint32 itsClaimPeriod; + uint32 itsPreparePeriod; +}; + + };//CEPCU +};//LOFAR +#endif diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.log_prop.in b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.log_prop.in new file mode 100644 index 0000000000000000000000000000000000000000..8e62511adc1e7995617d2503e2efd986a4c67ae4 --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.log_prop.in @@ -0,0 +1,20 @@ +# add your custom loggers and appenders here +# + +log4cplus.rootLogger=DEBUG, STDOUT, FILE + +log4cplus.logger.TRC=TRACE2 +log4cplus.additivity.TRC=FALSE + +log4cplus.appender.STDOUT=log4cplus::ConsoleAppender +log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout +log4cplus.appender.STDOUT.layout.ConversionPattern=%D{%d-%m-%y %H:%M:%S.%q} %-5p %c{9} - %m [%.25l]%n +log4cplus.appender.STDOUT.logToStdErr=true + +log4cplus.appender.FILE=log4cplus::RollingFileAppender +log4cplus.appender.FILE.File=../log/OnlineControl.log +log4cplus.appender.FILE.MaxFileSize=5MB +log4cplus.appender.FILE.MaxBackupIndex=5 +log4cplus.appender.FILE.layout=log4cplus::PatternLayout +log4cplus.appender.FILE.layout.ConversionPattern=%D{%d-%m-%y %H:%M:%S.%q} %-5p %c{3} - %m [%.25l]%n + diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControlDefines.h b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlDefines.h new file mode 100644 index 0000000000000000000000000000000000000000..94d9071708ff3e2ea0a553f07fe09fef99cc041e --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlDefines.h @@ -0,0 +1,43 @@ +//# OnlineControlDefines.h: preprocessor definitions of various constants +//# +//# Copyright (C) 2002-2003 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program 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 2 of the License, or +//# (at your option) any later version. +//# +//# This program 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 this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ + +#ifndef ONLINECONTROLDEFINES_H +#define ONLINECONTROLDEFINES_H + +namespace LOFAR { + namespace CEPCU { + +#define ONC_TASKNAME "OnlineCtrl" + +#define ONC_PROPSET_NAME "LOFAR_ObsSW_ObsCtrl%d_OnlineCtrl" +#define ONC_PROPSET_TYPE "OnlineCtrl" +#define ONC_OBSERVATIONSTATE "observationState" + +// next lines should be defined somewhere in Common. +#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_ERROR "error" + + +}; // MCU +}; // LOFAR + +#endif diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc new file mode 100644 index 0000000000000000000000000000000000000000..373591c04432ae1d111bf3219d0a652b17513427 --- /dev/null +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc @@ -0,0 +1,52 @@ +//# OnlineControlMain.cc: Main entry for the OnlineControl controller. +//# +//# Copyright (C) 2006 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program 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 2 of the License, or +//# (at your option) any later version. +//# +//# This program 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 this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ +//# +#include <lofar_config.h> +#include <Common/LofarLogger.h> + +#include "OnlineControl.h" + +using namespace LOFAR::GCF::TM; +using namespace LOFAR::CEPCU; + +int main(int argc, char* argv[]) +{ + // args: cntlrname + if(argc < 2) + { + printf("Unexpected number of arguments: %d\n",argc); + printf("%s usage: %s <controller name>\n",argv[0],argv[0]); + exit(-1); + } + GCFTask::init(argc, argv); + + ParentControl* pc = ParentControl::instance(); + pc->start(); // make initial transition + + OnlineControl ofc(argv[1]); + ofc.start(); // make initial transition + + GCFTask::run(); + + return 0; +} +