diff --git a/.gitattributes b/.gitattributes index 797c1ac59a3e3a85c6bb61cda20e6ab1108f3f4f..fe92bdccd8024908c0b22ee627fac11db65b4971 100644 --- a/.gitattributes +++ b/.gitattributes @@ -350,22 +350,6 @@ MAC/APL/PIC/MIS/test/test.sh -text svneol=native#application/octet-stream MAC/APL/PIC/TBBDriver/test/StubRawEvent.cc -text MAC/APL/PIC/TBBDriver/test/StubRawEvent.h -text MAC/APL/PIC/TBB_Protocol/include/Makefile.am -text -MAC/APL/PIC/_NodeManager/Makefile.am -text svneol=native#application/octet-stream -MAC/APL/PIC/_NodeManager/bootstrap -text svneol=native#application/octet-stream -MAC/APL/PIC/_NodeManager/configure.in -text svneol=native#application/octet-stream -MAC/APL/PIC/_NodeManager/src/Makefile.am -text svneol=native#application/octet-stream -MAC/APL/PIC/_NodeManager/src/NM_Protocol.prot -text svneol=native#application/octet-stream -MAC/APL/PIC/_NodeManager/src/NodeManager.conf.in -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/Makefile.am -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/bootstrap -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/configure.in -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/pvss/LiteNavigator.pnl -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/src/Makefile.am -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.conf.in -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.log_prop.in -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/test/Makefile.am -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/test/aratest.conf.in -text svneol=native#application/octet-stream -MAC/APL/PIC/_RegisterAccess/test/aratest.log_prop.in -text svneol=native#application/octet-stream MAC/APL/PIC/rsuctl/lofar.jpg -text svneol=unset#unset MAC/APL/PIC/rsuctl/ndump.tgz -text svneol=unset#unset MAC/APL/PIC/rsuctl/rsuctl3.pl -text diff --git a/.gitignore b/.gitignore index af71c539cb399a5884b7941357347a1548eecce1..10a7e4ed751edefad9a13182f7f236ecf6a7ab61 100644 --- a/.gitignore +++ b/.gitignore @@ -159,9 +159,6 @@ MAC/APL/PIC/MIS/Makefile.common MAC/APL/PIC/MIS/autoconf_share MAC/APL/PIC/MIS/lofarconf MAC/APL/PIC/Makefile.common -MAC/APL/PIC/RSPCtlFE/Makefile.common -MAC/APL/PIC/RSPCtlFE/autoconf_share -MAC/APL/PIC/RSPCtlFE/lofarconf MAC/APL/PIC/RSPDriver/Makefile.common MAC/APL/PIC/RSPDriver/autoconf_share MAC/APL/PIC/RSPDriver/lofarconf @@ -174,12 +171,6 @@ MAC/APL/PIC/TBBDriver/lofarconf MAC/APL/PIC/TBB_Protocol/Makefile.common MAC/APL/PIC/TBB_Protocol/autoconf_share MAC/APL/PIC/TBB_Protocol/lofarconf -MAC/APL/PIC/_NodeManager/Makefile.common -MAC/APL/PIC/_NodeManager/autoconf_share -MAC/APL/PIC/_NodeManager/lofarconf -MAC/APL/PIC/_RegisterAccess/Makefile.common -MAC/APL/PIC/_RegisterAccess/autoconf_share -MAC/APL/PIC/_RegisterAccess/lofarconf MAC/APL/PIC/autoconf_share MAC/APL/PIC/lofarconf MAC/APL/PIC/rsuctl/Makefile.common diff --git a/MAC/APL/PIC/RSPCtlFE/Makefile.am b/MAC/APL/PIC/RSPCtlFE/Makefile.am deleted file mode 100755 index d0d58e8d6509a7b433adbf6f0586f9d86a24cb2f..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS=src - -ACLOCAL_AMFLAGS = -I $(top_srcdir)/autoconf_share - -pkgextdir = $(prefix)/config/$(PACKAGE) -pkgext_DATA = pkgext pkgextcppflags pkgextcxxflags pkgextldflags - -DISTCHECK_CONFIGURE_FLAGS=\ - --with-common=$(prefix) - -EXTRA_DIST = \ - Makefile.common \ - RSPCtlFE.spec \ - autoconf_share/compiletool - -include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/PIC/RSPCtlFE/RSPCtlFE.spec.in b/MAC/APL/PIC/RSPCtlFE/RSPCtlFE.spec.in deleted file mode 100644 index f66e55922257e6132f3b90f354509c3595ada341..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/RSPCtlFE.spec.in +++ /dev/null @@ -1,165 +0,0 @@ -# -*- Mode:rpm-spec -*- -# RSPCtlFE.spec.in -# - -############################################################################## -# -# Preamble -# -############################################################################## - -Summary: RSPCtlFE is a PVSS frontend to the RSP Driver - -%define release @RPM_RELEASE@ -%define version @VERSION@ -%define pkgname @PACKAGE@ -%define pkgdir %{pkgname}-%{version}-%{release} -%define prefix /opt/lofar -%define configure_args @RPM_CONFIGURE_ARGS@ -##define build_kernel_version @BUILD_KERNEL_VERSION@ - -Name: %{pkgname} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Application/System -Source: %{pkgname}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{pkgdir}-root -URL: http://www.astron.nl -Prefix: %{prefix} -BuildArchitectures: i386 # Target platforms, i.e., i586 -Requires: Common = 2.3 -Requires: GCFTM = 6.0 -Requires: GCFCommon = 6.0 -Requires: GCFPAL = 6.0 -Requires: RTCCommon = 1.0 -Requires: RSP_Protocol = 1.0 -Packager: %{packager} -Distribution: The LOFAR project -Vendor: ASTRON - -AutoReqProv: no - -%description - -RSPCtlFE is a PVSS frontend to the RSP Driver. - -############################################################################## -# -# prep -# -############################################################################## -%prep -echo $prefix - -# create the build directory, untar the source -%setup - -############################################################################## -# -# build -# -############################################################################## -%build -./configure %{configure_args} --prefix=%{prefix} && make - -############################################################################## -# -# install -# -############################################################################## -%install -# To make things work with BUILDROOT -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi -mkdir -p $RPM_BUILD_ROOT%{prefix} -make DESTDIR="$RPM_BUILD_ROOT" install - -#uninstall - -############################################################################## -# -# verify -# -############################################################################## -#verify - -############################################################################## -# -# clean -# -############################################################################## -%clean -# Call me paranoid, but I do not want to be responsible for nuking -# someone's harddrive! -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi - -############################################################################## -# -# files -# -############################################################################## - -# empty 'files' means all distributed files -%files -%defattr(-, root, root) -%{prefix} - -# Your application file list goes here -# %{prefix}/lib/lib*.so* - -# Documentation -# doc COPYING ChangeLog README AUTHORS NEWS -# doc doc/* - -# link the module to the correct path -%post - -# before uninstall -%preun - -# after uninstall -%postun - -############################################################################## -# -# package devel -# -############################################################################## - -#package devel -#Summary: Development files for %{pkgname} -#Group: Applications/System -#description devel -#Development files for %{pkgname}. - -#files devel - -# Your development files go here -# Programmers documentation goes here -#doc doc - -# end of file diff --git a/MAC/APL/PIC/RSPCtlFE/bootstrap b/MAC/APL/PIC/RSPCtlFE/bootstrap deleted file mode 100755 index 7f674c416802db5e7c438f093a99e63f63c784aa..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../../autoconf_share/bootstrap ../../../../autoconf_share diff --git a/MAC/APL/PIC/RSPCtlFE/configure.in b/MAC/APL/PIC/RSPCtlFE/configure.in deleted file mode 100755 index 46a8ea86d6bf85a8a17a0b87e0fd114d086330b4..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/configure.in +++ /dev/null @@ -1,72 +0,0 @@ -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -AC_INIT -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(rspctlfe, 6.0, no-define) - -dnl Initialize for LOFAR (may set compilers) -lofar_INIT - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_CC -AC_PROG_CXX -AC_PROG_INSTALL -AC_PROG_LN_S -AC_DISABLE_SHARED -AC_PROG_LIBTOOL -AC_PROG_YACC -AM_PROG_LEX - -dnl Checks for libraries. - -dnl dnl Replace `main' with a function in -lfl: -dnl AC_CHECK_LIB(fl, main) -dnl dnl Replace `main' with a function in -lcosev_r: -dnl AC_CHECK_LIB(cosev_r, main) -dnl dnl Replace `main' with a function in -lcosnm_r: -dnl AC_CHECK_LIB(cosnm_r, main) -dnl dnl Replace `main' with a function in -lorb_r: - -dnl dnl Replace `main' with a function in -lpthread: -dnl AC_CHECK_LIB(pthread, main) -dnl dnl Replace `main' with a function in -lvport_r: -dnl AC_CHECK_LIB(vport_r, main) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) -AC_CHECK_HEADERS(sys/capability.h) -dnl This is trick to be able to use "if HAVE_SYS_CAPABILITY_H" in Makefile.am -AM_CONDITIONAL(HAVE_SYS_CAPABILITY_H, test `eval echo '${'$as_ac_Header'}'` = yes) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_FUNC_VPRINTF - -dnl -dnl Check for LOFAR specific things -dnl -lofar_GENERAL -lofar_COMPILETOOLS -lofar_PVSS(1) -lofar_INTERNAL(LCS/Common, common, , 1, Common/LofarTypes.h,,) -lofar_INTERNAL(MAC/GCF/TM, GCFTM, rc2, 1, GCF/TM/GCF_Control.h,,) -lofar_INTERNAL(MAC/GCF/PAL, GCFPAL, rc2, 1, GCF/PAL/GCF_Answer.h,,) -lofar_INTERNAL(MAC/GCF/GCFCommon, GCFCommon, rc2, 1, GCF/GCF_Defines.h,,) -lofar_INTERNAL(MAC/APL/RTCCommon, RTCCommon, devel1, 1, APL/RTCCommon/Marshalling.h,,) -lofar_INTERNAL(MAC/APL/PIC/RSP_Protocol, RSP_Protocol, devel1,1, APL/RSP_Protocol/RSP_Protocol.ph,,) -lofar_EXTERNAL(boost,1,boost/shared_ptr.hpp,"") - -dnl -dnl Output Makefiles -dnl -AC_OUTPUT( - Makefile - src/Makefile - RSPCtlFE.spec -) diff --git a/MAC/APL/PIC/RSPCtlFE/src/Makefile.am b/MAC/APL/PIC/RSPCtlFE/src/Makefile.am deleted file mode 100644 index c5cb0e960bad92d659830288bcfea3cc76741bb0..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/src/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -bin_PROGRAMS = rspctlfe - -rspctlfe_CPPFLAGS= \ - -DBOOST_DISABLE_THREADS \ - -Wno-deprecated \ - -fmessage-length=0 \ - -fdiagnostics-show-location=once \ - -DUSE_TCPPORT_INSTEADOF_PVSSPORT - -rspctlfe_SOURCES = \ - rspctlfe.h \ - rspctlfe.cc - -rspctlfe_LDADD = $(LOFAR_DEPEND) -rspctlfe_DEPENDENCIES = $(LOFAR_DEPEND) - -NOINSTHDRS = - -INSTHDRS = - -pkginclude_HEADERS = $(NOINSTHDRS) $(INSTHDRS) - -DOCHDRS = $(pkginclude_HEADERS) - -include_HEADERS = - -BUILT_SOURCES = \ - rspctlfe.conf - -EXTRA_DIST = $(BUILT_SOURCES) $(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= $(BUILT_SOURCES) - -%.log_prop: %.log_prop.in - cp $< $@ - -%.conf: %.conf.in - cp $< $@ - -include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.cc b/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.cc deleted file mode 100644 index 64ba6b8e1124b1f8840d3146a3a65f4804003f1c..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.cc +++ /dev/null @@ -1,409 +0,0 @@ -//# -//# rspctlfe.cc: Front end for the command line interface to the RSPDriver -//# -//# 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$ -//# - -//# -//# Usage: -//# -//# rspctlfe --id=<number> # set the id of the frontend. Used in the name of the propertyset -//# -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -#include <getopt.h> -#include <unistd.h> - -#include <GCF/GCF_PValue.h> -#include <GCF/GCF_PVString.h> -#include <GCF/GCF_ServiceInfo.h> - -#include "rspctlfe.h" -#include <APL/RSP_Protocol/RSPFE_Protocol.ph> - -using namespace std; -using namespace LOFAR; -using namespace GCF::PAL; -using namespace GCF::TM; -using namespace GCF::Common; -using namespace RSPFE_Protocol; -using namespace rspctl; - -// local funtions -static void usage(); - -const string RSPCtlFE::FE_PROPSET_NAME("PIC_CaptureStats%d"); -const string RSPCtlFE::FE_PROPSET_TYPENAME("TLcuPicCaptureStats"); -const string RSPCtlFE::FE_PROPERTY_COMMAND("command"); -const string RSPCtlFE::FE_PROPERTY_STATUS("status"); - -INIT_TRACER_CONTEXT(RSPCtlFE, LOFARLOGGER_PACKAGE); - -RSPCtlFEAnswer::RSPCtlFEAnswer(RSPCtlFE& rspctlfe) : - _rspctlfe(rspctlfe) -{ -} - -void RSPCtlFEAnswer::handleAnswer (GCFEvent& answer) -{ - switch (answer.signal) - { - case F_VCHANGEMSG: - case F_VGETRESP: - { - GCFPropValueEvent& vcEvent = (GCFPropValueEvent&) answer; - string propName(vcEvent.pPropName); - string val = ((GCFPVString*)(vcEvent.pValue))->getValue(); - _rspctlfe.valueChanged(propName, val); - break; - } - default: - break; - } -} - -RSPCtlFE::RSPCtlFE(string name, int argc, char** argv) - : GCFTask((State)&RSPCtlFE::initial, name), - m_propertySetAnswer(*this), - m_id(-1), - m_myPropertySet(), - m_server(), - m_rspctlOutputTimer(0), - m_rspctlOutputPosition(0), - m_rspctlOutputFilename() -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, getName().c_str()); - - registerProtocol(RSPFE_PROTOCOL, RSPFE_PROTOCOL_signalnames); - - parse_options(argc, argv); - - if(m_id == -1) - { - string msg("Error: argument --id is required"); - LOG_FATAL(msg.c_str()); - cerr << msg << endl; - exit(EXIT_FAILURE); - } - - string propertySetName(formatString(FE_PROPSET_NAME.c_str(),m_id)); - m_myPropertySet = boost::shared_ptr<GCFMyPropertySet>(new GCFMyPropertySet( - propertySetName.c_str(), - FE_PROPSET_TYPENAME.c_str(), - PS_CAT_TEMPORARY, - &m_propertySetAnswer)); - m_myPropertySet->enable(); - - //string servername(formatString("server%d",m_id)); - - m_server.init(*this, MAC_SVCMASK_RSPCTLFE, GCFPortInterface::SPP, RSPFE_PROTOCOL), - - m_rspctlOutputFilename = string(formatString("rspctlfe%doutput.log",m_id)); -} - -RSPCtlFE::~RSPCtlFE() -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, getName().c_str()); - -} - -void RSPCtlFE::valueChanged(const string& propName, const string& value) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, getName().c_str()); - - if(propName.find(FE_PROPERTY_COMMAND) != string::npos) - { - if(value == string("stop")) - { - if(m_server.isConnected()) - { - RSPFEStopRspctlEvent stopEvent; - m_server.send(stopEvent); - } - } - else - { - // only allow the FE to start rspctl when there is no connection with rspctl - if(!m_server.isConnected()) - { - // start the rspctl executable with the options specified. - string commandLine("rspctl "); - commandLine += value; - - string hostname(m_server.getHostName()); - if(hostname.length() == 0) - { - char localHostName[200]; - gethostname(localHostName,200); - hostname = string(localHostName); - } - commandLine += string(formatString(" --feport=%s:%d",hostname.c_str(),m_server.getPortNumber())); - - commandLine += string(" &> ") + m_rspctlOutputFilename + string(" &"); - - // remove the current logfile - m_rspctlOutputPosition=0; - remove(m_rspctlOutputFilename.c_str()); - - int i=system(commandLine.c_str()); - if(i!=0) - { - LOG_FATAL(formatString("unable to start the rspctl executable using: %s",commandLine.c_str())); - m_myPropertySet->setValue(FE_PROPERTY_STATUS,"unable to start the rspctl executable"); - } - else - { - LOG_INFO(formatString("started rspctl using: %s",commandLine.c_str())); - m_myPropertySet->setValue(FE_PROPERTY_STATUS,"rspctl started"); - - m_rspctlOutputTimer = m_server.setTimer((long)1); - } - } - } - } -} - -GCFEvent::TResult RSPCtlFE::initial(GCFEvent& e, GCFPortInterface& port) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, getName().c_str()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch(e.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - // open the server port - if (!m_server.isConnected()) - { - m_server.open(); - } - } - break; - - case F_CONNECTED: - { - if (m_server.isConnected()) - { - TRAN(RSPCtlFE::operational); - } - } - break; - - case F_DISCONNECTED: - { - m_myPropertySet->setValue(FE_PROPERTY_STATUS,"rspctl stopped"); - port.setTimer((long)5); - port.close(); - } - break; - - case F_TIMER: - { - GCFTimerEvent& timerEvent=static_cast<GCFTimerEvent&>(e); - if(timerEvent.id == m_rspctlOutputTimer) - { - pollRspCtlOutput(); - m_rspctlOutputTimer = m_server.setTimer((long)1); - } - else - { - // reopen the server port - m_server.open(); - } - } - break; - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult RSPCtlFE::operational(GCFEvent& e, GCFPortInterface& port) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, getName().c_str()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) - { - case F_ENTRY: - { - } - break; - - case RSPFE_STATUS_UPDATE: - { - RSPFEStatusUpdateEvent statusUpdateEvent(e); - m_myPropertySet->setValue(FE_PROPERTY_STATUS,statusUpdateEvent.status); - } - break; - - case F_DISCONNECTED: - { - m_myPropertySet->setValue(FE_PROPERTY_STATUS,"rspctl stopped"); - port.close(); - TRAN(RSPCtlFE::initial); - } - break; - - case F_TIMER: - { - GCFTimerEvent& timerEvent=static_cast<GCFTimerEvent&>(e); - if(timerEvent.id == m_rspctlOutputTimer) - { - pollRspCtlOutput(); - m_rspctlOutputTimer = m_server.setTimer((long)1); - } - } - break; - - default: - cerr << "Error: unhandled event." << endl; - break; - } - - return status; -} - -void RSPCtlFE::pollRspCtlOutput() -{ - // check new additions to the rspctl output file and log them - char line[300]; - FILE* pFile = fopen(m_rspctlOutputFilename.c_str(),"r"); - if(pFile != 0) - { - fseek(pFile,m_rspctlOutputPosition,SEEK_SET); - while(!feof(pFile)) - { - if(fgets (line, 300 , pFile) != 0) - { - LOG_INFO(formatString("rspctl log:%s",line)); - } - } - m_rspctlOutputPosition = ftell(pFile); - fclose(pFile); - } -} - -void RSPCtlFE::mainloop() -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, getName().c_str()); - - start(); // make initial transition - GCFTask::run(); -} - -static void usage() -{ - cout << "rspctlfe usage:" << endl; - cout << endl; - cout << "rspctlfe --id=<number> # set the id of the front end." << endl; -} - -void RSPCtlFE::parse_options(int argc, char** argv) -{ - optind = 0; // reset option parsing - //opterr = 0; // no error reporting to stderr - while (1) - { - static struct option long_options[] = - { - { "id", required_argument, 0, 'i' }, - { "help", no_argument, 0, 'h' }, - - { 0, 0, 0, 0 }, - }; - - int option_index = 0; - int c = getopt_long(argc, argv, - "i:h", long_options, &option_index); - - if (c == -1) - break; - - switch (c) - { - case 'i': - if (optarg) - { - m_id = atoi(optarg); - if(m_id < 0) - { - string msg("Error: argument to --id out of range, value must be >= 0"); - LOG_FATAL(msg.c_str()); - cerr << msg << endl; - exit(EXIT_FAILURE); - } - } - else - { - string msg("Error: option '--id' requires an argument."); - LOG_FATAL(msg.c_str()); - cerr << msg << endl; - exit(EXIT_FAILURE); - } - break; - - case 'h': - usage(); - break; - - case '?': - default: - exit(EXIT_FAILURE); - break; - } - } -} - -int main(int argc, char** argv) -{ - GCFTask::init(argc, argv); - - LOG_INFO(formatString("Program %s has started", argv[0])); - - RSPCtlFE c("RSPCtlFE", argc, argv); - - try - { - c.mainloop(); - } - catch (Exception e) - { - LOG_FATAL(formatString("Exception: %s", e.text().c_str())); - cout << "Exception: " << e.text() << endl; - exit(EXIT_FAILURE); - } - - LOG_INFO("Normal termination of program"); - - return 0; -} diff --git a/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.conf.in b/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.conf.in deleted file mode 100644 index 3107bb19e7d8d91496600ac93b5f5d43f72a8ce8..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.conf.in +++ /dev/null @@ -1,3 +0,0 @@ -# -# Configuration of the RSPCtlFe communication ports. -# diff --git a/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.h b/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.h deleted file mode 100644 index 30036f1345ad4392494ec0ef04a2a83e4a8b4631..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSPCtlFE/src/rspctlfe.h +++ /dev/null @@ -1,123 +0,0 @@ -//# -*- mode: c++ -*- -//# -//# rspctlfe.h: Front end for the command line interface to the RSPDriver -//# -//# 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$ - -#ifndef RSPCTLFE_H_ -#define RSPCTLFE_H_ - -#include <string> -#include <boost/shared_ptr.hpp> - -#include <GCF/TM/GCF_Control.h> -#include <GCF/PAL/GCF_Answer.h> -#include <GCF/PAL/GCF_MyPropertySet.h> - -namespace LOFAR -{ - -namespace rspctl -{ - -class RSPCtlFE; - -/** - * Answer class for propertysets - */ -class RSPCtlFEAnswer : public GCF::PAL::GCFAnswer -{ - public: - RSPCtlFEAnswer(RSPCtlFE& rspctlfe); - void handleAnswer(GCF::TM::GCFEvent& answer); - - private: - RSPCtlFE& _rspctlfe; -}; - - -/** - * Controller class for rspctlfe - */ -class RSPCtlFE : public GCFTask -{ -public: - static const string FE_PROPSET_NAME; - static const string FE_PROPSET_TYPENAME; - static const string FE_PROPERTY_COMMAND; - static const string FE_PROPERTY_STATUS; - - /** - * The constructor of the RSPCtlFE task. - * @param name The name of the task. The name is used for looking - * up connection establishment information using the GTMNameService and - * GTMTopologyService classes. - */ - RSPCtlFE(string name, int argc, char** argv); - virtual ~RSPCtlFE(); - - // state methods - - /** - * The initial state. In this state the FE server is started - */ - GCFEvent::TResult initial(GCFEvent& e, GCFPortInterface &p); - - /** - * In this state the Front End waits for updates of the command property - * and writes status changes of the rspctl to the status property - */ - GCFEvent::TResult operational(GCFEvent& e, GCFPortInterface &p); - - /** - * Start the controller main loop. - */ - void mainloop(); - - void valueChanged(const string& propName, const string& value); - -private: - // private methods - void parse_options(int argc, char** argv); - void pollRspCtlOutput(); - -private: - typedef boost::shared_ptr< GCF::PAL::GCFMyPropertySet > GCFMyPropertySetSharedPtr; - - // property sets - RSPCtlFEAnswer m_propertySetAnswer; - int m_id; - GCFMyPropertySetSharedPtr m_myPropertySet; - // server port - GCF::TM::GCFTCPPort m_server; - // rspctl output - unsigned long m_rspctlOutputTimer; - long m_rspctlOutputPosition; - string m_rspctlOutputFilename; - - ALLOC_TRACER_CONTEXT -}; - -}; - -}; - -#endif /* RSPCTLFE_H_ */ diff --git a/MAC/APL/PIC/_NodeManager/Makefile.am b/MAC/APL/PIC/_NodeManager/Makefile.am deleted file mode 100644 index 80dcc9efcbf2ac6e2f99bf01d6d8af8263ab4ac9..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS=src include - -ACLOCAL_AMFLAGS = -I $(top_srcdir)/autoconf_share - -pkgextdir = $(prefix)/config/$(PACKAGE) -pkgext_DATA = pkgext pkgextcppflags pkgextcxxflags pkgextldflags - -#DISTCHECK_CONFIGURE_FLAGS=\ -# --with-common=$(prefix) # "common" is an example - -EXTRA_DIST = \ - Makefile.common \ - NodeManager.spec \ - autoconf_share/compiletool - -include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/PIC/_NodeManager/NodeManager.spec.in b/MAC/APL/PIC/_NodeManager/NodeManager.spec.in deleted file mode 100644 index 0c9716ab1ad7229e81d7322dd470e3c6c270440c..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/NodeManager.spec.in +++ /dev/null @@ -1,164 +0,0 @@ -# -*- Mode:rpm-spec -*- -# NodeManager.spec.in -# - -############################################################################## -# -# Preamble -# -############################################################################## - -Summary: NodeManager contains the NodeManager application and the library, which can be used to talk with the NM. - -%define release @RPM_RELEASE@ -%define version @VERSION@ -%define pkgname @PACKAGE@ -%define pkgdir %{pkgname}-%{version}-%{release} -%define prefix /opt/lofar -%define configure_args @RPM_CONFIGURE_ARGS@ -##define build_kernel_version @BUILD_KERNEL_VERSION@ - -Name: %{pkgname} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Application/System -Source: %{pkgname}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{pkgdir}-root -URL: http://www.astron.nl -Prefix: %{prefix} -BuildArchitectures: i386 # Target platforms, i.e., i586 -Requires: Common >= 2.3 -Requires: GCFTM >= 6.0 -Requires: GCFCommon >= 6.0 -Requires: GCFPAL >= 6.0 -Requires: APLCommon >= 3.1 -Packager: %{packager} -Distribution: The LOFAR project -Vendor: ASTRON - -AutoReqProv: no - -%description - -NodeManager contains the NodeManager application and the library, which can be used to talk with the NM. - -############################################################################## -# -# prep -# -############################################################################## -%prep -echo $prefix - -# create the build directory, untar the source -%setup - -############################################################################## -# -# build -# -############################################################################## -%build -./configure %{configure_args} --prefix=%{prefix} && make - -############################################################################## -# -# install -# -############################################################################## -%install -# To make things work with BUILDROOT -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi -mkdir -p $RPM_BUILD_ROOT%{prefix} -make DESTDIR="$RPM_BUILD_ROOT" install - -#uninstall - -############################################################################## -# -# verify -# -############################################################################## -#verify - -############################################################################## -# -# clean -# -############################################################################## -%clean -# Call me paranoid, but I do not want to be responsible for nuking -# someone's harddrive! -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi - -############################################################################## -# -# files -# -############################################################################## - -# empty 'files' means all distributed files -%files -%defattr(-, root, root) -%{prefix} - -# Your application file list goes here -# %{prefix}/lib/lib*.so* - -# Documentation -# doc COPYING ChangeLog README AUTHORS NEWS -# doc doc/* - -# link the module to the correct path -%post - -# before uninstall -%preun - -# after uninstall -%postun - -############################################################################## -# -# package devel -# -############################################################################## - -#package devel -#Summary: Development files for %{pkgname} -#Group: Applications/System -#description devel -#Development files for %{pkgname}. - -#files devel - -# Your development files go here -# Programmers documentation goes here -#doc doc - -# end of file diff --git a/MAC/APL/PIC/_NodeManager/bootstrap b/MAC/APL/PIC/_NodeManager/bootstrap deleted file mode 100644 index 7f674c416802db5e7c438f093a99e63f63c784aa..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../../autoconf_share/bootstrap ../../../../autoconf_share diff --git a/MAC/APL/PIC/_NodeManager/configure.in b/MAC/APL/PIC/_NodeManager/configure.in deleted file mode 100644 index 915df48d0b63169a75f71ff9e32a7e9b18446111..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/configure.in +++ /dev/null @@ -1,54 +0,0 @@ -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -AC_INIT(include/APL/NodeManager/NodeManager.h) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(NodeManager, 1.0, no-define) - -dnl Initialize for LOFAR (may set compilers) -lofar_INIT - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_YACC -AC_PROG_CC -AC_PROG_CXX -AM_PROG_LEX -AC_PROG_INSTALL -AC_PROG_LN_S -AC_DISABLE_SHARED -AC_PROG_LIBTOOL - -dnl Checks for libraries. - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_FUNC_VPRINTF - -dnl -dnl Check for LOFAR specific things -dnl -lofar_GENERAL -lofar_PVSS -lofar_INTERNAL(LCS/Common, common, , 1, Common/LofarTypes.h,,) -lofar_INTERNAL(MAC/GCF/GCFCommon, gcfcommon, , 1, GCF/GCF_Defines.h,,) -lofar_INTERNAL(MAC/GCF/TM, gcftm, , 1, GCF/TM/GCF_Task.h,,) -lofar_INTERNAL(MAC/GCF/PAL, gcfpal, , 1, GCF/PAL/GCF_PVSSInfo.h,,) - -dnl -dnl Output Makefiles -dnl -AC_OUTPUT( -src/Makefile -include/APL/NodeManager/Makefile -include/Makefile -Makefile -NodeManager.spec -) diff --git a/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/Makefile.am b/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/Makefile.am deleted file mode 100644 index 0626121722706f96d0fa22c0287de30778c1a9fd..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -pkgincludedir = $(includedir)/APL/NodeManager -pkginclude_HEADERS = \ - NodeManager.h \ - NMUtilities.h - -include $(top_srcdir)/Makefile.common - diff --git a/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/NMUtilities.h b/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/NMUtilities.h deleted file mode 100644 index 972f92340ea6eff5b51206daf96885ec2efdce76..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/NMUtilities.h +++ /dev/null @@ -1,68 +0,0 @@ -//# NMUtilities.h: Utility functions -//# -//# 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$ - -#ifndef NMUTILITIES_H -#define NMUTILITIES_H - -//# Includes - -//# Common Includes -#include <Common/lofar_string.h> - -//# GCF Includes - -//# local includes - - -const std::string NM_NODE_SCOPE("PIC_CEP_"); - -// forward declaration - -namespace LOFAR -{ - - namespace ANM - { - -class NMUtilities -{ - public: - - NMUtilities() {} - virtual ~NMUtilities() {} - - static string extractNodeName(string propName); - - protected: - // protected copy constructor - NMUtilities(const NMUtilities&); - // protected assignment operator - NMUtilities& operator=(const NMUtilities&); - - private: - - ALLOC_TRACER_CONTEXT -}; - - } // namespace ANM -} // namespace LOFAR -#endif diff --git a/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/NodeManager.h b/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/NodeManager.h deleted file mode 100644 index 9aece5426d973647a3fc00ab58c494f963d4ec10..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/include/APL/NodeManager/NodeManager.h +++ /dev/null @@ -1,84 +0,0 @@ -//# NodeManager.h: -//# -//# 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 NODEMANAGER_H -#define NODEMANAGER_H - -#include <GCF/TM/GCF_Task.h> -#include <GCF/TM/GCF_TCPPort.h> - -#include <set> -using std::set; - -namespace LOFAR -{ - namespace ANM - { - -typedef set<string> TNodeList; - -class NodeManagerInterface -{ - protected: - NodeManagerInterface() {} - virtual ~NodeManagerInterface() {} - - public: - virtual void nodesClaimed(TNodeList& newClaimedNodes, - TNodeList& releasedNodes, - TNodeList& faultyNodes) = 0; - virtual void nodesReleased() = 0; - - private: - // protected copy constructor - NodeManagerInterface(const NodeManagerInterface&); - // protected assignment operator - NodeManagerInterface& operator=(const NodeManagerInterface&); -}; - -class NodeManager : public GCF::TM::GCFTask -{ - public: - NodeManager (NodeManagerInterface& interface); - virtual ~NodeManager () {} - - public: // member functions - void claimNodes(TNodeList& nodesToClaim); - void releaseNodes(TNodeList& nodesToRelease); - - private: // state methods - GCF::TM::GCFEvent::TResult initial (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult operational (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - - private: // helper methods - - private: // data members - GCF::TM::GCFTCPPort _nmPort; - NodeManagerInterface& _interface; - - private: // admin members -}; - - } // namespace ANM -} // namespace LOFAR - -#endif diff --git a/MAC/APL/PIC/_NodeManager/include/Makefile.am b/MAC/APL/PIC/_NodeManager/include/Makefile.am deleted file mode 100644 index d063454cc2b566c70a967bcb4ecf4966b89fe751..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/include/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = APL/NodeManager - -include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/PIC/_NodeManager/src/Makefile.am b/MAC/APL/PIC/_NodeManager/src/Makefile.am deleted file mode 100644 index 1a2a945164ca292f837219ec1b31962b4499eb09..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -AUTOGEN = autogen -SUFFIXES = .ph - -%.ph: %.prot - $(AUTOGEN) --writable -L $(datadir)/GCF/TM $< - -DOCHDRS = $(BUILT_SOURCES) \ - NodeManagerDaemon.h \ - NodeManagerClient.h \ - PropertyProxy.h \ - NMDefines.h - -lib_LTLIBRARIES = libnm.la - -libnm_la_SOURCES = $(DOCHDRS) \ - NodeManager.cc - -libnm_la_LIBADD = libsnm.la - -noinst_LTLIBRARIES = libnmd.la libsnm.la - -libnmd_la_SOURCES = $(DOCHDRS) \ - NodeManagerDaemon.cc \ - NodeManagerClient.cc \ - PropertyProxy.cc - -libsnm_la_SOURCES = $(DOCHDRS) \ - NMUtilities.cc \ - NM_Protocol.cc - -bin_PROGRAMS = NodeManager - -NodeManager_SOURCES = NMMain.cc -NodeManager_LDADD = libnmd.la libsnm.la $(LOFAR_DEPEND) -NodeManager_DEPENDENCIES = libnmd.la libsnm.la $(LOFAR_DEPEND) - -BUILT_SOURCES = \ - NM_Protocol.ph - -EXTRA_DIST = $(sysconf_DATA) - -sysconf_DATA= \ - NodeManager.conf - -%.conf: %.conf.in - cp $< $@ - -clean-local: - rm -f *.ph - -include $(top_srcdir)/Makefile.common - diff --git a/MAC/APL/PIC/_NodeManager/src/NMDefines.h b/MAC/APL/PIC/_NodeManager/src/NMDefines.h deleted file mode 100644 index dfaa2deac771f8bb13e27b7582be40e3ea19a3dd..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NMDefines.h +++ /dev/null @@ -1,46 +0,0 @@ -//# NMDefines.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 NMDEFINES_H -#define NMDEFINES_H - -#include <GCF/GCF_Defines.h> - -namespace LOFAR -{ - namespace ANM - { - -const string NM_TASK_NAME("APL-NM"); -const string NM_CONF("NodeManager.conf"); -const string NM_PORT_NAME("client"); - -const string NMC_TASK_NAME("APL-NMC"); -const string NMC_PORT_NAME("nmd-client"); - -const string NMD_TASK_NAME("APL-NMD"); -const string NMD_PORT_NAME("server"); - - } // namespace ANM -} // namespace LOFAR - -#endif diff --git a/MAC/APL/PIC/_NodeManager/src/NMMain.cc b/MAC/APL/PIC/_NodeManager/src/NMMain.cc deleted file mode 100644 index 8f7c723cfa653259e70404cda67105d0d31f0cb3..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NMMain.cc +++ /dev/null @@ -1,43 +0,0 @@ -//# NMMain.cc: -//# -//# 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$ - -#include <lofar_config.h> - -#include <NodeManagerDaemon.h> -#include <GCF/TM/GCF_Control.h> - -using namespace LOFAR; - -int main(int argC, char *argV[]) -{ - GCF::TM::GCFTask::init(argC, argV); - - LOG_INFO("MACProcessScope: APL.PIC.NM"); - - ANM::NodeManagerDaemon nmd; - - nmd.start(); // make initial transition - - GCF::TM::GCFTask::run(); - - return 0; -} diff --git a/MAC/APL/PIC/_NodeManager/src/NMUtilities.cc b/MAC/APL/PIC/_NodeManager/src/NMUtilities.cc deleted file mode 100644 index 7aa2147fd93126bd264567add61240021cb5afcf..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NMUtilities.cc +++ /dev/null @@ -1,47 +0,0 @@ -//# NMUtilities.cc: Utility functions -//# -//# 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 <Common/LofarLogger.h> -#include <APL/NodeManager/NMUtilities.h> -#include <GCF/PAL/GCF_PVSSInfo.h> - -namespace LOFAR -{ -using namespace GCF::PAL; - namespace ANM - { - -INIT_TRACER_CONTEXT(NMUtilities, LOFARLOGGER_PACKAGE); - -string NMUtilities::extractNodeName(string propName) -{ - string resName(propName); - - resName.erase(0, GCFPVSSInfo::getLocalSystemName().length() + strlen(":PIC_CEP_")); - resName.erase(resName.rfind(".")); - - return resName; -} - } // namespace ANM -} // namespace LOFAR diff --git a/MAC/APL/PIC/_NodeManager/src/NM_Protocol.prot b/MAC/APL/PIC/_NodeManager/src/NM_Protocol.prot deleted file mode 100644 index 41b43963cc5673dd0356cec3c0dc9e391ad7801d..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NM_Protocol.prot +++ /dev/null @@ -1,59 +0,0 @@ -// -// Protocol definition for the NodeManager -// -autogen definitions protocol; - -description = "Protocol for the NodeManager"; -prefix = "NM"; // for the signal names -id = "(LOFAR::GCF::TM::F_APL_PROTOCOL + 20)"; - -include = '<GCF/GCF_Defines.h>'; - -prelude = << PRELUDE_END - -PRELUDE_END; -// -// An "event" has a "signal" and a "dir" (direction) -// and zero or more "param"s. -// "dir" can be one of "IN" or "OUT". -// A "param" has a "name" and a "type". -// -event = { - signal = CLAIM; - dir = IN; - param = { - name = "nodesToClaim"; - type = "string"; - }; -}; - -event = { - signal = CLAIMED; - dir = OUT; - param = { - name = "newClaimedNodes"; - type = "string"; - }; - param = { - name = "releasedNodes"; - type = "string"; - }; - param = { - name = "faultyNodes"; - type = "string"; - }; -}; - -event = { - signal = RELEASE; - dir = IN; - param = { - name = "nodesToRelease"; - type = "string"; - }; -}; - -event = { - signal = RELEASED; - dir = OUT; -}; \ No newline at end of file diff --git a/MAC/APL/PIC/_NodeManager/src/NodeManager.cc b/MAC/APL/PIC/_NodeManager/src/NodeManager.cc deleted file mode 100644 index 91fc9f3352b7c7a7925ba6d8a7c2296d9a8c1122..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NodeManager.cc +++ /dev/null @@ -1,146 +0,0 @@ -//# NodeManager.cc: -//# -//# 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$ - -#include <lofar_config.h> - -#include <APL/NodeManager/NodeManager.h> -#include <GCF/LogSys/GCF_KeyValueLogger.h> -#include <GCF/GCF_PVChar.h> -#include <GCF/Utils.h> -#include <GCF/ParameterSet.h> -#include <NM_Protocol.ph> -#include <NMDefines.h> - -namespace LOFAR -{ -using namespace GCF::Common; -using namespace GCF::TM; - namespace ANM - { - -NodeManager::NodeManager(NodeManagerInterface& interface) : - GCFTask((State)&NodeManager::initial, NM_TASK_NAME), - _interface(interface) -{ - // register the protocol for debugging purposes - registerProtocol(NM_PROTOCOL, NM_PROTOCOL_signalnames); - - _nmPort.init(*this, NM_PORT_NAME, GCFPortInterface::SAP, NM_PROTOCOL); - ParameterSet::instance()->adoptFile(NM_CONF); - start(); -} - -GCFEvent::TResult NodeManager::initial(GCFEvent& e, GCFPortInterface& p) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - switch (e.signal) - { - case F_INIT: - break; - - case F_ENTRY: - case F_TIMER: - if (!_nmPort.isConnected()) - { - _nmPort.open(); - } - break; - - case F_CONNECTED: - TRAN(NodeManager::operational); - break; - - case F_DISCONNECTED: - p.setTimer(1.0); // try again after 1 second - break; - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult NodeManager::operational(GCFEvent& e, GCFPortInterface& p) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) - { - case F_DISCONNECTED: - LOG_INFO("Connection lost to the NodeManager daemon."); - p.close(); - break; - - case F_CLOSED: - TRAN(NodeManager::initial); - break; - - case NM_CLAIMED: - { - NMClaimedEvent inResponse(e); - TNodeList newClaimedNodes, releasedNodes, faultyNodes; - convStringToSet(newClaimedNodes, inResponse.newClaimedNodes); - convStringToSet(releasedNodes, inResponse.releasedNodes); - convStringToSet(faultyNodes, inResponse.faultyNodes); - _interface.nodesClaimed(newClaimedNodes, releasedNodes, faultyNodes); - break; - } - case NM_RELEASED: - { - NMReleasedEvent inResponse(e); - - _interface.nodesReleased(); - break; - } - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -void NodeManager::claimNodes(TNodeList& nodesToClaim) -{ - NMClaimEvent outRequest; - - convSetToString(outRequest.nodesToClaim, nodesToClaim); - if (_nmPort.isConnected()) - { - _nmPort.send(outRequest); - } -} - -void NodeManager::releaseNodes(TNodeList& nodesToRelease) -{ - NMReleaseEvent outRequest; - - convSetToString(outRequest.nodesToRelease, nodesToRelease); - if (_nmPort.isConnected()) - { - _nmPort.send(outRequest); - } -} - } // namespace ANM -} // namespace LOFAR diff --git a/MAC/APL/PIC/_NodeManager/src/NodeManager.conf.in b/MAC/APL/PIC/_NodeManager/src/NodeManager.conf.in deleted file mode 100644 index 7485207664755fc5e7487276d498845b676750ff..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NodeManager.conf.in +++ /dev/null @@ -1,2 +0,0 @@ -mac.ns.APL-NMD.server.type=TCP -mac.top.APL-NM.client.remoteservice=APL-NMD:server \ No newline at end of file diff --git a/MAC/APL/PIC/_NodeManager/src/NodeManagerClient.cc b/MAC/APL/PIC/_NodeManager/src/NodeManagerClient.cc deleted file mode 100644 index 2bab0cbebdb104177cf004fcaa4cf76d049ec0a0..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NodeManagerClient.cc +++ /dev/null @@ -1,430 +0,0 @@ -//# NodeManagerClient.cc: -//# -//# 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$ - -#include <lofar_config.h> - -#include <NodeManagerClient.h> -#include <NodeManagerDaemon.h> -#include <GCF/LogSys/GCF_KeyValueLogger.h> -#include <GCF/GCF_PVInteger.h> -#include <GCF/PAL/GCF_Answer.h> -#include <GCF/Utils.h> -#include <NM_Protocol.ph> -#include <APL/NodeManager/NMUtilities.h> -#include <NMDefines.h> - -#define FULL_RS_DP(rsname) formatString("%s%s.state", NM_NODE_SCOPE.c_str(), (rsname).c_str()) - -enum -{ - RS_DEFECT = -4, - RS_SUSPECT, - RS_VERIFY, - RS_OFFLINE, - RS_IDLE, - RS_BUSY, -}; - -namespace LOFAR -{ -using namespace GCF::Common; -using namespace GCF::TM; -using namespace GCF::PAL; - namespace ANM - { -NodeManagerClient::NodeManagerClient(NodeManagerDaemon& daemon) : - GCFTask((State)&NodeManagerClient::initial, NMC_TASK_NAME), - _daemon(daemon), - _propertyProxy(*this), - _nrOfValueGetRequests(0) -{ - _nmcPort.init(*this, NMC_PORT_NAME, GCFPortInterface::SPP, NM_PROTOCOL); - _daemon.getPortProvider().accept(_nmcPort); -} - -GCFEvent::TResult NodeManagerClient::initial(GCFEvent& e, GCFPortInterface& /*p*/) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - switch (e.signal) - { - case F_INIT: - break; - - case F_ENTRY: - break; - - case F_CONNECTED: - _daemon.clientConnected(*this); - TRAN(NodeManagerClient::operational); - break; - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult NodeManagerClient::operational(GCFEvent& e, GCFPortInterface& p) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - - static TNodeList claimNodes; - - switch (e.signal) - { - case F_DISCONNECTED: - LOG_INFO("Connection lost to a NodeManager client."); - p.close(); - break; - - case F_CLOSED: - TRAN(NodeManagerClient::closing); - break; - - case NM_CLAIM: - { - NMClaimEvent inRequest(e); - - claimNodes.clear(); - _nodesToRelease.clear(); - _faultyNodes.clear(); - _newClaimedNodes.clear(); - _releasedNodes.clear(); - - convStringToSet(claimNodes, inRequest.nodesToClaim); - - _nodesToRelease = _curClaimedNodes; - TNodeList::iterator curClaimedNode; - // find out whether nodes must be claimed or released - for (TNodeList::iterator nodeToClaim = claimNodes.begin(); - nodeToClaim != claimNodes.end(); ++nodeToClaim) - { - curClaimedNode = _curClaimedNodes.find(*nodeToClaim); - - if (curClaimedNode == _curClaimedNodes.end()) - { - // node not yet claimed - - // get current state value - if (_propertyProxy.requestPropValue(FULL_RS_DP(*nodeToClaim)) != GCF_NO_ERROR) - { - _faultyNodes.insert(*nodeToClaim); - } - else - { - _newClaimedNodes.insert(*nodeToClaim); - _nrOfValueGetRequests++; - } - } - else - { - _nodesToRelease.erase(*curClaimedNode); - } - - } - // now we have a list with which are currently claimed but not needed anymore - // so they have to release - for (TNodeList::iterator nodeToRelease = _nodesToRelease.begin(); - nodeToRelease != _nodesToRelease.end(); ++nodeToRelease) - { - if (_propertyProxy.requestPropValue(FULL_RS_DP(*nodeToRelease)) != GCF_NO_ERROR) - { - // could not be released in the right way so pretend this is already - // done here - _releasedNodes.insert(*nodeToRelease); - } - else - { - _nrOfValueGetRequests++; - } - } - if (_nrOfValueGetRequests == 0) - { - // no state value has to be updated so the response can be sent here - LOG_INFO("Ready with claiming. All requested nodes are already claimed!"); - NMClaimedEvent outResponse; - convSetToString(outResponse.newClaimedNodes, _newClaimedNodes); - convSetToString(outResponse.releasedNodes, _releasedNodes); - convSetToString(outResponse.faultyNodes, _faultyNodes); - _nmcPort.send(outResponse); - } - else - { - TRAN(NodeManagerClient::claiming); - } - break; - } - case NM_RELEASE: - { - NMReleaseEvent inRequest(e); - TNodeList releaseNodes; - convStringToSet(releaseNodes, inRequest.nodesToRelease); - for (TNodeList::iterator nodeToRelease = releaseNodes.begin(); - nodeToRelease != releaseNodes.end(); ++nodeToRelease) - { - if (_propertyProxy.requestPropValue(FULL_RS_DP(*nodeToRelease)) != GCF_NO_ERROR) - { - // could not be released in the right way so pretend this is already - // done here - _releasedNodes.insert(*nodeToRelease); - } - else - { - _nrOfValueGetRequests++; - } - } - if (_nrOfValueGetRequests == 0) - { - // no state value has to be updated so the response can be sent here - LOG_INFO("Ready with releasing. All requested nodes are already (automatically) released!"); - NMReleasedEvent outResponse; - _nmcPort.send(outResponse); - } - else - { - TRAN(NodeManagerClient::releasing); - } - break; - } - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - - -GCFEvent::TResult NodeManagerClient::claiming(GCFEvent& e, GCFPortInterface& p) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - switch (e.signal) - { - case F_DISCONNECTED: - LOG_INFO("Connection lost to a NodeManager client."); - p.close(); - break; - - case F_CLOSED: - TRAN(NodeManagerClient::closing); - break; - - case F_VGETRESP: - { - GCFPropValueEvent& getResp = (GCFPropValueEvent&) e; - GCFPVInteger& value = (GCFPVInteger&) (*getResp.pValue); - - string resName(NMUtilities::extractNodeName(getResp.pPropName)); - - TNodeList::iterator nodeToRelease; - for (nodeToRelease = _nodesToRelease.begin(); - nodeToRelease != _nodesToRelease.end(); ++nodeToRelease) - { - if (*nodeToRelease == resName) - { - // node was selected to be released - if (value.getValue() > RS_IDLE) - { - value.setValue(value.getValue() - 1); // decrease usecount - LOG_INFO(formatString( - "Decreases the usecount of '%s' to %d", - resName.c_str(), - value.getValue())); - _propertyProxy.setPropValue(getResp.pPropName, value); - } - else - { - LOG_INFO(formatString( - "Could not decrease the usecount of '%s' (state == %d)", - resName.c_str(), - value.getValue())); - } - _releasedNodes.insert(*nodeToRelease); - _curClaimedNodes.erase(*nodeToRelease); - break; - } - } - - if (nodeToRelease == _nodesToRelease.end()) - { - // not in releasedNodes list, so it must be claimed - if (value.getValue() < RS_IDLE) - { - LOG_INFO(formatString( - "Could not increase the usecount of '%s' (state == %d)", - resName.c_str(), - value.getValue())); - // could not be claimed due to the malfunctioning state of the node - _faultyNodes.insert(resName); - _newClaimedNodes.erase(resName); - } - else - { - value.setValue(value.getValue() + 1); // increase usecount - LOG_INFO(formatString( - "Increases the usecount of '%s' to %d", - resName.c_str(), - value.getValue())); - - _propertyProxy.setPropValue(getResp.pPropName, value); - _curClaimedNodes.insert(resName); - } - } - - _nrOfValueGetRequests--; - if (_nrOfValueGetRequests == 0) - { - LOG_INFO("Ready with claiming."); - NMClaimedEvent outResponse; - convSetToString(outResponse.newClaimedNodes, _newClaimedNodes); - convSetToString(outResponse.releasedNodes, _releasedNodes); - convSetToString(outResponse.faultyNodes, _faultyNodes); - _nmcPort.send(outResponse); - TRAN(NodeManagerClient::operational); - } - break; - } - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult NodeManagerClient::releasing(GCFEvent& e, GCFPortInterface& p) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - switch (e.signal) - { - case F_DISCONNECTED: - LOG_INFO("Connection lost to a NodeManager client."); - p.close(); - break; - - case F_CLOSED: - TRAN(NodeManagerClient::closing); - break; - - case F_VGETRESP: - { - GCFPropValueEvent& getResp = (GCFPropValueEvent&) e; - GCFPVInteger& value = (GCFPVInteger&) (*getResp.pValue); - - // extract the resource (node) name from the propName - string resName(NMUtilities::extractNodeName(getResp.pPropName)); - - if (value.getValue() > RS_IDLE) - { - value.setValue(value.getValue() - 1); // decrease usecount - LOG_INFO(formatString( - "Decreases the usecount of '%s' to %d", - resName.c_str(), - value.getValue())); - _propertyProxy.setPropValue(getResp.pPropName, value); - } - else - { - LOG_INFO(formatString( - "Could not decrease the usecount of '%s' (state == %d)", - resName.c_str(), - value.getValue())); - } - _curClaimedNodes.erase(resName); - - _nrOfValueGetRequests--; - if (_nrOfValueGetRequests == 0) - { - LOG_INFO("Ready with releasing."); - NMReleasedEvent outResponse; - _nmcPort.send(outResponse); - TRAN(NodeManagerClient::operational); - } - break; - } - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult NodeManagerClient::closing(GCFEvent& e, GCFPortInterface& /*p*/) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - switch (e.signal) - { - case F_ENTRY: - { - LOG_INFO("Client gone. Start autoreleasing of all currently claimed nodes."); - for (TNodeList::iterator nodeToRelease = _curClaimedNodes.begin(); - nodeToRelease != _curClaimedNodes.end(); ++nodeToRelease) - { - if (_propertyProxy.requestPropValue(FULL_RS_DP(*nodeToRelease)) == GCF_NO_ERROR) - { - _nrOfValueGetRequests++; - } - } - if (_nrOfValueGetRequests == 0) - { - _daemon.clientClosed(*this); - } - break; - } - case F_VGETRESP: - { - GCFPropValueEvent& getResp = (GCFPropValueEvent&) e; - GCFPVInteger& value = (GCFPVInteger&) (*getResp.pValue); - - // extract the resource (node) name from the propName - string resName(NMUtilities::extractNodeName(getResp.pPropName)); - - if (value.getValue() > RS_IDLE) - { - value.setValue(value.getValue() - 1); // decrease usecount - LOG_INFO(formatString( - "Decreases the usecount of '%s' to %d", - resName.c_str(), - value.getValue())); - _propertyProxy.setPropValue(getResp.pPropName, value); - } - - _nrOfValueGetRequests--; - if (_nrOfValueGetRequests == 0) - { - LOG_INFO("Ready with autoreleasing."); - _daemon.clientClosed(*this); - } - break; - } - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - } // namespace ANM -} // namespace LOFAR diff --git a/MAC/APL/PIC/_NodeManager/src/NodeManagerClient.h b/MAC/APL/PIC/_NodeManager/src/NodeManagerClient.h deleted file mode 100644 index 9005b62b6a79e72c308ab03002f56a1281f28115..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NodeManagerClient.h +++ /dev/null @@ -1,74 +0,0 @@ -//# NodeManagerClient.h: -//# -//# 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 NODEMANAGERCLIENT_H -#define NODEMANAGERCLIENT_H - -#include <GCF/TM/GCF_Task.h> -#include <GCF/TM/GCF_Port.h> -#include <GCF/TM/GCF_TCPPort.h> -#include <PropertyProxy.h> -#include <APL/NodeManager/NodeManager.h> // for the type TNodeList - -namespace LOFAR -{ - namespace ANM - { - -class NodeManagerDaemon; -/** -*/ - -class NodeManagerClient : public GCF::TM::GCFTask -{ - public: - NodeManagerClient (NodeManagerDaemon& daemon); - virtual ~NodeManagerClient () {} - - public: // member functions - - private: // state methods - GCF::TM::GCFEvent::TResult initial (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult operational (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult claiming (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult releasing (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult closing (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - - private: // helper methods - - private: // data members - GCF::TM::GCFTCPPort _nmcPort; - NodeManagerDaemon& _daemon; - TNodeList _curClaimedNodes; - PropertyProxy _propertyProxy; - - private: // admin members - TNodeList _newClaimedNodes; - TNodeList _nodesToRelease; - TNodeList _releasedNodes; - TNodeList _faultyNodes; - unsigned int _nrOfValueGetRequests; -}; - } // namespace ANM -} // namespace LOFAR - -#endif diff --git a/MAC/APL/PIC/_NodeManager/src/NodeManagerDaemon.cc b/MAC/APL/PIC/_NodeManager/src/NodeManagerDaemon.cc deleted file mode 100644 index 00cf7009093416e49bb4950589a45e0b2a58bbc1..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NodeManagerDaemon.cc +++ /dev/null @@ -1,145 +0,0 @@ -//# NodeManagerDaemon.cc: -//# -//# 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$ - -#include <lofar_config.h> - -#include "NodeManagerDaemon.h" -#include <GCF/LogSys/GCF_KeyValueLogger.h> -#include <GCF/Utils.h> -#include <NodeManagerClient.h> -#include <NM_Protocol.ph> -#include <NMDefines.h> - -namespace LOFAR -{ -using namespace GCF::Common; -using namespace GCF::TM; - namespace ANM - { - -NodeManagerDaemon::NodeManagerDaemon() : - GCFTask((State)&NodeManagerDaemon::initial, NMD_TASK_NAME) -{ - // register the protocol for debugging purposes - registerProtocol(NM_PROTOCOL, NM_PROTOCOL_signalnames); - - // initialize the port - _nmdPortProvider.init(*this, NMD_PORT_NAME, GCFPortInterface::MSPP, NM_PROTOCOL); -} - -GCFEvent::TResult NodeManagerDaemon::initial(GCFEvent& e, GCFPortInterface& p) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - switch (e.signal) - { - case F_INIT: - break; - - case F_ENTRY: - case F_TIMER: - if (!_nmdPortProvider.isConnected()) - { - _nmdPortProvider.open(); - } - break; - - case F_CONNECTED: - TRAN(NodeManagerDaemon::operational); - break; - - case F_DISCONNECTED: - p.setTimer(1.0); // try again after 1 second - break; - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult NodeManagerDaemon::operational(GCFEvent& e, GCFPortInterface& p) -{ - GCFEvent::TResult status = GCFEvent::HANDLED; - static unsigned long garbageTimerID = 0; - - switch (e.signal) - { - case F_DISCONNECTED: - DBGFAILWHEN(&_nmdPortProvider == &p && "NMD port provider may not be disconnected."); - break; - - case F_TIMER: - { - // cleanup the garbage of closed ports to master clients - NodeManagerClient* pClient; - for (TClients::iterator iter = _clientsGarbage.begin(); - iter != _clientsGarbage.end(); ++iter) - { - pClient = *iter; - delete pClient; - } - _clientsGarbage.clear(); - break; - } - case F_CLOSED: - DBGFAILWHEN(&_nmdPortProvider == &p); - break; - - case F_CONNECTED: - DBGFAILWHEN(&_nmdPortProvider == &p); - break; - - case F_ACCEPT_REQ: - { - LOG_INFO("New NodeManger client accepted!"); - NodeManagerClient* nmc = new NodeManagerClient(*this); - nmc->start(); - break; - } - case F_ENTRY: - garbageTimerID = _nmdPortProvider.setTimer(1.0, 5.0); - break; - - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -void NodeManagerDaemon::clientConnected(NodeManagerClient& client) -{ - _clients.push_back(&client); -} - -void NodeManagerDaemon::clientClosed(NodeManagerClient& client) -{ - _clients.remove(&client); - _clientsGarbage.push_back(&client); -} - - } // namespace ANM -} // namespace LOFAR diff --git a/MAC/APL/PIC/_NodeManager/src/NodeManagerDaemon.h b/MAC/APL/PIC/_NodeManager/src/NodeManagerDaemon.h deleted file mode 100644 index 619dac79a4f466aca8e6960853b3e9272126ca2c..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/NodeManagerDaemon.h +++ /dev/null @@ -1,73 +0,0 @@ -//# NodeManagerDaemon.h: -//# -//# 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 NODEMANAGERDAEMON_H -#define NODEMANAGERDAEMON_H - -#include <GCF/TM/GCF_Task.h> -#include <GCF/TM/GCF_Port.h> -#include <GCF/TM/GCF_TCPPort.h> - -namespace LOFAR -{ - namespace ANM - { - -class NodeManagerClient; - -/** -*/ - -class NodeManagerDaemon : public GCF::TM::GCFTask -{ - public: - NodeManagerDaemon (); - virtual ~NodeManagerDaemon () {} - - public: // member functions - GCF::TM::GCFTCPPort& getPortProvider(); - void clientConnected(NodeManagerClient& client); - void clientClosed(NodeManagerClient& client); - - private: // state methods - GCF::TM::GCFEvent::TResult initial (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult operational (GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - - private: // helper methods - - private: // data members - GCF::TM::GCFTCPPort _nmdPortProvider; - typedef list<NodeManagerClient*> TClients; - TClients _clients; - - private: // admin members - TClients _clientsGarbage; -}; - -inline GCF::TM::GCFTCPPort& NodeManagerDaemon::getPortProvider() -{ - return _nmdPortProvider; -} - } // namespace ANM -} // namespace LOFAR - -#endif diff --git a/MAC/APL/PIC/_NodeManager/src/PropertyProxy.cc b/MAC/APL/PIC/_NodeManager/src/PropertyProxy.cc deleted file mode 100644 index 061a4a97fd2eef0735d5f6ef94af1d4d032169a2..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/PropertyProxy.cc +++ /dev/null @@ -1,48 +0,0 @@ -//# PropertyProxy.cc: -//# -//# 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$ - -#include <lofar_config.h> - -#include <PropertyProxy.h> -#include <NodeManagerClient.h> -#include <GCF/PAL/GCF_Answer.h> - -namespace LOFAR -{ -using namespace GCF::Common; -using namespace GCF::TM; -using namespace GCF::PAL; - namespace ANM - { - -GCFDummyPort PropertyProxy::_dummyPort(0, "ANM", F_PML_PROTOCOL); - -void PropertyProxy::propValueGet(const string& propName, const GCFPValue& value) -{ - GCFPropValueEvent e(F_VGETRESP); - e.pValue = &value; - e.pPropName = propName.c_str(); - _client.dispatch(e, _dummyPort); -} - - } // namespace ANM -} // namespace LOFAR diff --git a/MAC/APL/PIC/_NodeManager/src/PropertyProxy.h b/MAC/APL/PIC/_NodeManager/src/PropertyProxy.h deleted file mode 100644 index 45e1c133d087d1df57a4c5a0112be11c2242490e..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_NodeManager/src/PropertyProxy.h +++ /dev/null @@ -1,56 +0,0 @@ -//# PropertyProxy.h: -//# -//# 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 PROPERTYPROXY_H -#define PROPERTYPROXY_H - -#include <GCF/PAL/GCF_PropertyProxy.h> -#include <GCF/TM/GCF_Fsm.h> - -namespace LOFAR -{ - namespace ANM - { -class NodeManagerClient; - -class PropertyProxy : public GCF::PAL::GCFPropertyProxy -{ - public: - PropertyProxy(NodeManagerClient& client) : - _client(client) {} - virtual ~PropertyProxy() {}; - - protected: - void propSubscribed(const string& /*propName*/) {} - void propSubscriptionLost(const string& /*propName*/) {} - void propUnsubscribed(const string& /*propName*/) {} - void propValueGet(const string& propName, const GCF::Common::GCFPValue& value); - void propValueChanged(const string& /*propName*/, const GCF::Common::GCFPValue& /*value*/) {} - void propValueSet(const string& /*propName*/) {} - - private: - NodeManagerClient& _client; - static GCF::TM::GCFDummyPort _dummyPort; -}; - } // namespace NM -} // namespace LOFAR -#endif diff --git a/MAC/APL/PIC/_RegisterAccess/Makefile.am b/MAC/APL/PIC/_RegisterAccess/Makefile.am deleted file mode 100644 index 400dea00dbf2142e91e226f4969800481e3e2698..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS=src test - -ACLOCAL_AMFLAGS = -I $(top_srcdir)/autoconf_share - -pkgextdir = $(prefix)/config/$(PACKAGE) -pkgext_DATA = pkgext pkgextcppflags pkgextcxxflags pkgextldflags - -DISTCHECK_CONFIGURE_FLAGS=\ - --with-common=$(prefix) - -EXTRA_DIST = \ - Makefile.common \ - RegisterAccess.spec \ - autoconf_share/compiletool - -include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/PIC/_RegisterAccess/RegisterAccess.spec.in b/MAC/APL/PIC/_RegisterAccess/RegisterAccess.spec.in deleted file mode 100644 index ebf8357ada916ec4f3c6edf548c17ed5a898b45f..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/RegisterAccess.spec.in +++ /dev/null @@ -1,167 +0,0 @@ -# -*- Mode:rpm-spec -*- -# RegisterAccess.spec.in -# - -############################################################################## -# -# Preamble -# -############################################################################## - -Summary: RegisterAccess is the executable that provides a low level interface to the RSP Driver. - -%define release @RPM_RELEASE@ -%define version @VERSION@ -%define pkgname @PACKAGE@ -%define pkgdir %{pkgname}-%{version}-%{release} -%define prefix /opt/lofar -%define configure_args @RPM_CONFIGURE_ARGS@ -##define build_kernel_version @BUILD_KERNEL_VERSION@ - -Name: %{pkgname} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Application/System -Source: %{pkgname}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{pkgdir}-root -URL: http://www.astron.nl -Prefix: %{prefix} -BuildArchitectures: i386 # Target platforms, i.e., i586 -Requires: Common = 2.3 -Requires: GCFTM = 6.0 -Requires: GCFCommon = 6.0 -Requires: GCFPAL = 6.0 -Requires: Suite = 6.0 -Requires: RTCCommon = 1.0 -Requires: RSP_Protocol = 1.0 -Requires: APLCommon = 3.1 -Packager: %{packager} -Distribution: The LOFAR project -Vendor: ASTRON - -AutoReqProv: no - -%description - -RegisterAccess is the executable that provides a low level interface to the RSP Driver. - -############################################################################## -# -# prep -# -############################################################################## -%prep -echo $prefix - -# create the build directory, untar the source -%setup - -############################################################################## -# -# build -# -############################################################################## -%build -./configure %{configure_args} --prefix=%{prefix} && make - -############################################################################## -# -# install -# -############################################################################## -%install -# To make things work with BUILDROOT -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi -mkdir -p $RPM_BUILD_ROOT%{prefix} -make DESTDIR="$RPM_BUILD_ROOT" install - -#uninstall - -############################################################################## -# -# verify -# -############################################################################## -#verify - -############################################################################## -# -# clean -# -############################################################################## -%clean -# Call me paranoid, but I do not want to be responsible for nuking -# someone's harddrive! -if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ] -then - echo - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo @ @ - echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @ - echo @ @ - echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo -else - echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT" - rm -rf "$RPM_BUILD_ROOT" -fi - -############################################################################## -# -# files -# -############################################################################## - -# empty 'files' means all distributed files -%files -%defattr(-, root, root) -%{prefix} - -# Your application file list goes here -# %{prefix}/lib/lib*.so* - -# Documentation -# doc COPYING ChangeLog README AUTHORS NEWS -# doc doc/* - -# link the module to the correct path -%post - -# before uninstall -%preun - -# after uninstall -%postun - -############################################################################## -# -# package devel -# -############################################################################## - -#package devel -#Summary: Development files for %{pkgname} -#Group: Applications/System -#description devel -#Development files for %{pkgname}. - -#files devel - -# Your development files go here -# Programmers documentation goes here -#doc doc - -# end of file diff --git a/MAC/APL/PIC/_RegisterAccess/bootstrap b/MAC/APL/PIC/_RegisterAccess/bootstrap deleted file mode 100755 index 7f674c416802db5e7c438f093a99e63f63c784aa..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../../autoconf_share/bootstrap ../../../../autoconf_share diff --git a/MAC/APL/PIC/_RegisterAccess/configure.in b/MAC/APL/PIC/_RegisterAccess/configure.in deleted file mode 100644 index 82375056bc7aa3ccc3f7c7f0e2dd184b44e26077..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/configure.in +++ /dev/null @@ -1,76 +0,0 @@ -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -AC_INIT -dnl AC_CONFIG_AUX_DIR(config) -dnl AM_CONFIG_HEADER(config/config.h) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(RegisterAccess, 3.1, no-define) - -dnl -dnl Initialize for LOFAR (may set compilers) -dnl -lofar_INIT - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_CC -AC_PROG_CXX -AC_PROG_INSTALL -AC_PROG_LN_S -AC_DISABLE_SHARED -AC_PROG_LIBTOOL -AC_PROG_YACC -AM_PROG_LEX - -dnl Checks for libraries. - -dnl dnl Replace `main' with a function in -lfl: -dnl AC_CHECK_LIB(fl, main) -dnl dnl Replace `main' with a function in -lcosev_r: -dnl AC_CHECK_LIB(cosev_r, main) -dnl dnl Replace `main' with a function in -lcosnm_r: -dnl AC_CHECK_LIB(cosnm_r, main) -dnl dnl Replace `main' with a function in -lorb_r: -dnl AC_CHECK_LIB(orb_r, main) -dnl dnl Replace `main' with a function in -lpthread: -dnl AC_CHECK_LIB(pthread, main) -dnl dnl Replace `main' with a function in -lvport_r: -dnl AC_CHECK_LIB(vport_r, main) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_FUNC_VPRINTF - -dnl -dnl Check for LOFAR specific things -dnl -lofar_GENERAL -lofar_COMPILETOOLS -lofar_PVSS(1) -lofar_INTERNAL(LCS/Common, common, , 1, Common/LofarTypes.h,,) -lofar_INTERNAL(MAC/APL/PIC/RSP_Protocol, RSP_Protocol, ,1, APL/RSP_Protocol/RSP_Protocol.ph,,) -lofar_INTERNAL(MAC/Test/Suite, suite, , 1, Suite/test.h,,) -lofar_INTERNAL(MAC/GCF/TM, GCFTM, , 1, GCF/TM/GCF_Control.h,,) -lofar_INTERNAL(MAC/GCF/GCFCommon, GCFCommon, , 1, GCF/GCF_Defines.h,,) -lofar_INTERNAL(MAC/GCF/PAL, GCFPAL, , 1, GCF/PAL/GCF_Property.h,,) -lofar_INTERNAL(MAC/APL/APLCommon, APLCommon, , 1, APL/APLCommon/APL_Defines.h,,) -lofar_EXTERNAL(BLITZ,1,blitz/blitz.h,,,,'gnu3:-Wno-unused gnu3:-ftemplate-depth-30',,-lm) -lofar_EXTERNAL(boost,1,boost/shared_ptr.hpp,"") - -dnl -dnl Output Makefiles -dnl -AC_OUTPUT( -src/Makefile -test/Makefile -Makefile -RegisterAccess.spec -) diff --git a/MAC/APL/PIC/_RegisterAccess/pvss/LiteNavigator.pnl b/MAC/APL/PIC/_RegisterAccess/pvss/LiteNavigator.pnl deleted file mode 100644 index 4784941ec49f67e5f27236a4b6b620d9960dcdda..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/pvss/LiteNavigator.pnl +++ /dev/null @@ -1,2409 +0,0 @@ -V 10 -1 -LANG:1 13 LiteNavigator -PANEL,40 103 732 456 N "_3DFace" 0 -"main() -{ - addGlobal(\"g_connectedDatapoints\",DYN_STRING_VAR); - dynClear(g_connectedDatapoints); - - addGlobal(\"g_buttonDatapoints\",DYN_STRING_VAR); - dynClear(g_buttonDatapoints); -}" 0 - E E E E 1 -1 -1 0 10 10 -""0 1 -E "int countLeadingSpaces(string text) -{ - int spaces=0; - while(spaces<strlen(text)&&text[spaces]==' ') - { - spaces++; - } - return spaces; -} - -string buildPath() -{ - string path; - string tempString; - int leadingSpaces=0; - int i; - int tempSpaces; - int tempSpacesPrev; - string selectedResource = SelectionList1.selectedText; - int selectedItem = SelectionList1.selectedPos; - dyn_string items = SelectionList1.items; - - path = strltrim(selectedResource); - - // count the number of spaces - leadingSpaces = countLeadingSpaces(selectedResource); - - // work up the hierarchy until there are no leading spaces - tempSpaces=0; - tempSpacesPrev = leadingSpaces; - for(i=selectedItem;i>0;i--) - { - tempSpaces = countLeadingSpaces(items[i]); - if(tempSpaces < tempSpacesPrev) - { - path = strltrim(items[i]) + \"_\" + path; - tempSpacesPrev = tempSpaces; - } - } - return path; -} - -void enableFields(dyn_string labelTexts, dyn_string dpNames) -{ -dyn_errClass err; - - string dpOnlineString; - string dpOriginalString; - string dataPointBase = buildPath(); - string shapeString; - int i,j; - string selection=strltrim(SelectionList1.selectedText); - shape caption=getShape(\"TextSelectedResource\"); - caption.visible=(dynlen(labelTexts)>0); - caption.text=dataPointBase; - - // disconnect existing dpConnections - for(i=0;i<dynlen(g_connectedDatapoints);i++) - { - if(dpExists( g_connectedDatapoints[i+1] )) - { - shapeString = \"updateTextField\"+(i+1); - if(!dpDisconnect(shapeString,g_connectedDatapoints[i+1])) - { - err = getLastError(); - if (dynlen(err) > 0) - { -DebugN(\"Error disconnecting from datapoint : \", g_connectedDatapoints[i+1],err); - } - } - } - } - dynClear(g_connectedDatapoints); - dynClear(g_buttonDatapoints); - - for(i=0;i<dynlen(labelTexts)&&i<dynlen(dpNames);i++) - { - shape l=getShape(\"Text\" + (i+1)); - shape f=getShape(\"TextField\" + (i+1)); - shape b=getShape(\"Button\" + (i+1)); - l.visible = true; - l.text = labelTexts[i+1]; - f.visible = true; - b.visible = true; - - dpOnlineString = \"System1:\" + dataPointBase+dpNames[i+1] + \":_online.._value\"; - dpOriginalString = \"System1:\" + dataPointBase+dpNames[i+1] + \":_original.._value\"; - - if( !dpExists( dpOnlineString )) - { - f.visible = false; -DebugN(\"Datapoint does not exist : \", dpOnlineString); - } - else - { - shapeString = \"updateTextField\"+(i+1); - dpConnect(shapeString,dpOnlineString); - err = getLastError(); - if (dynlen(err) > 0) - { - f.visible = false; -DebugN(\"Error connecting to datapoint : \", dpOnlineString,err); - } - else - { - dynAppend(g_connectedDatapoints,dpOnlineString); - dynAppend(g_buttonDatapoints,dpOriginalString); - } - } - } - for(j=i;j<12;j++) - { - shape l=getShape(\"Text\" + (j+1)); - shape f=getShape(\"TextField\" + (j+1)); - shape b=getShape(\"Button\" + (j+1)); - l.visible=false; - f.visible=false; - b.visible = false; - } -} - -void enableSelectedFields() -{ - string selection=strltrim(SelectionList1.selectedText); - if(selection == \"PIC\") - { - enableFields( - makeDynString(\"Status\",\"Maintenance status\",\"Maintenance from\",\"Maintenance to\"), - makeDynString(\".status\", \"_Maintenance.status\", \"_Maintenance.fromTime\", \"_Maintenance.toTime\")); - } - else if(substr(selection,0,4) == \"Rack\") - { - enableFields( - makeDynString(\"Status\",\"Maintenance status\",\"Maintenance from\",\"Maintenance to\",\"Alert status\"), - makeDynString(\".status\", \"_Maintenance.status\", \"_Maintenance.fromTime\", \"_Maintenance.toTime\", \"_Alert.status\") ); - } - else if(substr(selection,0,7) == \"SubRack\") - { - enableFields( - makeDynString(\"Status\",\"Maintenance status\",\"Maintenance from\",\"Maintenance to\",\"Alert status\"), - makeDynString(\".status\", \"_Maintenance.status\", \"_Maintenance.fromTime\", \"_Maintenance.toTime\", \"_Alert.status\") ); - } - else if(substr(selection,0,5) == \"Board\") - { - enableFields( - makeDynString(\"Status\",\"Maintenance status\",\"Maintenance from\",\"Maintenance to\",\"Alert status\"), - makeDynString(\".status\", \"_Maintenance.status\", \"_Maintenance.fromTime\", \"_Maintenance.toTime\", \"_Alert.status\") ); - } - else if(substr(selection,0,3) == \"ETH\") - { - enableFields( - makeDynString(\"Packets received\",\"Packets erroneous\"), - makeDynString(\".packetsReceived\",\".packetsError\")); - } - else if(substr(selection,0,2) == \"BP\") - { - enableFields( - makeDynString(\"Alive\",\"Temperature\"), - makeDynString(\".alive\",\".temperature\")); - } - else if(substr(selection,0,2) == \"AP\") - { - enableFields( - makeDynString(\"Alive\",\"Temperature\"), - makeDynString(\".alive\",\".temperature\")); - } - else if(substr(selection,0,3) == \"RCU\") - { - enableFields( - makeDynString(\"Statistics ready\",\"RCU V error\",\"RCU H error\",\"RING error\",\"Maintenance status\",\"Maintenance from\",\"Maintenance to\"), - makeDynString(\".statsReady\",\".RCUVerr\",\".RCUHerr\",\".ringErr\",\"_Maintenance.status\",\"_Maintenance.fromTime\",\"_Maintenance.toTime\") ); - } - else if(substr(selection,0,2) == \"WaveFormGenerator\") - { - enableFields( - makeDynString(\"Mode\",\"Amplitude\",\"Frequency\"), - makeDynString(\".mode\",\".amplitude\",\".frequency\")); - } - else if(substr(selection,0,7) == \"Subband\") - { - enableFields( - makeDynString(\"Status\"), - makeDynString(\".status\")); - } - else - { - dyn_string empty; - dynClear(empty); - enableFields(empty); - } -} - -updateTextField1(string dp, unsigned uNewValue) -{ - setValue(\"TextField1\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField2(string dp, unsigned uNewValue) -{ - setValue(\"TextField2\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField3(string dp, unsigned uNewValue) -{ - setValue(\"TextField3\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField4(string dp, unsigned uNewValue) -{ - setValue(\"TextField4\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField5(string dp, unsigned uNewValue) -{ - setValue(\"TextField5\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField6(string dp, unsigned uNewValue) -{ - setValue(\"TextField6\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField7(string dp, unsigned uNewValue) -{ - setValue(\"TextField7\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField8(string dp, unsigned uNewValue) -{ - setValue(\"TextField8\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField9(string dp, unsigned uNewValue) -{ - setValue(\"TextField9\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField10(string dp, unsigned uNewValue) -{ - setValue(\"TextField10\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField11(string dp, unsigned uNewValue) -{ - setValue(\"TextField11\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField12(string dp, unsigned uNewValue) -{ - setValue(\"TextField12\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - -updateTextField13(string dp, unsigned uNewValue) -{ - setValue(\"TextField13\", \"text\", dpValToString(dp, uNewValue, TRUE) ); -} - - -void SelectionList1EventChange() -{ - enableSelectedFields(); -} - -void SelectionList1EventInitialize() -{ - enableSelectedFields(); -} -" 0 - 2 -"CBRef""1" -"EClose"E -"" -DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 -LAYER, 0 -1 -LANG:1 6 Layer1 -2 3 -"Text1" -"" -1 180 50 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -4 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 52 217 67 -0 2 0 "s" 0 0 0 192 0 0 182 52 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text1 -2 4 -"Text2" -"" -1 180 80 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -5 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 82 217 97 -0 2 0 "s" 0 0 0 192 0 0 182 82 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text2 -2 6 -"Text3" -"" -1 180 110 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -7 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 112 217 127 -0 2 0 "s" 0 0 0 192 0 0 182 112 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text3 -2 8 -"Text4" -"" -1 180 140 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -9 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 142 217 157 -0 2 0 "s" 0 0 0 192 0 0 182 142 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text4 -2 10 -"Text5" -"" -1 180 170 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -11 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 172 217 187 -0 2 0 "s" 0 0 0 192 0 0 182 172 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text5 -2 12 -"Text6" -"" -1 180 200 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -13 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 202 217 217 -0 2 0 "s" 0 0 0 192 0 0 182 202 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text6 -2 14 -"Text7" -"" -1 180 230 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -15 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 232 217 247 -0 2 0 "s" 0 0 0 192 0 0 182 232 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text7 -2 16 -"Text8" -"" -1 180 260 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -17 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 262 217 277 -0 2 0 "s" 0 0 0 192 0 0 182 262 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text8 -2 18 -"Text9" -"" -1 180 290 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -19 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 292 217 307 -0 2 0 "s" 0 0 0 192 0 0 182 292 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 5 Text9 -2 20 -"Text10" -"" -1 180 320 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -21 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 322 224 337 -0 2 0 "s" 0 0 0 192 0 0 182 322 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 6 Text10 -2 22 -"Text11" -"" -1 180 350 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -23 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 352 224 367 -0 2 0 "s" 0 0 0 192 0 0 182 352 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 6 Text11 -2 24 -"Text12" -"" -1 180 380 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -25 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 382 224 397 -0 2 0 "s" 0 0 0 192 0 0 182 382 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 6 Text12 -2 26 -"Text13" -"" -1 180 410 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -27 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 412 224 427 -0 2 0 "s" 0 0 0 192 0 0 182 412 1 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 6 Text13 -2 29 -"TextSelectedResource" -"" -1 180 20 E E E 1 E 0 E N {0,0,0} E N "_Transparent" E E - E E -30 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -1 -"dashclr"N "_Transparent" -E E 0 1 1 0 1 E U 0 E 182 22 382 40 -0 2 0 "s" 0 0 0 192 0 0 182 22 1 -1 -LANG:1 54 -alias-fixed-bold-r-normal-*-*-160-75-75-*-*-iso8859-1 -0 -"" 1 -LANG:1 20 TextSelectedResource -17 1 -"SelectionList1" -"" -1 10 10 E E E 1 E 1 E N "_WindowText" E N "_Window" E E - E E -2 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 8 8 162 442 -274 -1 -LANG:1 3 PIC - -1 -1 -LANG:1 6 Rack1 - -0 -1 -LANG:1 10 SubRack1 - -0 -1 -LANG:1 9 Board1 - -0 -1 -LANG:1 7 ETH - -0 -1 -LANG:1 6 BP - -0 -1 -LANG:1 7 AP1 - -0 -1 -LANG:1 9 RCU1 - -0 -1 -LANG:1 9 RCU2 - -0 -1 -LANG:1 7 AP2 - -0 -1 -LANG:1 9 RCU1 - -0 -1 -LANG:1 9 RCU2 - -0 -1 -LANG:1 7 AP3 - -0 -1 -LANG:1 9 RCU1 - -0 -1 -LANG:1 9 RCU2 - -0 -1 -LANG:1 7 AP4 - -0 -1 -LANG:1 9 RCU1 - -0 -1 -LANG:1 9 RCU2 - -0 -1 -LANG:1 11 Subband001 - -0 -1 -LANG:1 11 Subband002 - -0 -1 -LANG:1 11 Subband003 - -0 -1 -LANG:1 11 Subband004 - -0 -1 -LANG:1 11 Subband005 - -0 -1 -LANG:1 11 Subband006 - -0 -1 -LANG:1 11 Subband007 - -0 -1 -LANG:1 11 Subband008 - -0 -1 -LANG:1 11 Subband009 - -0 -1 -LANG:1 11 Subband010 - -0 -1 -LANG:1 11 Subband011 - -0 -1 -LANG:1 11 Subband012 - -0 -1 -LANG:1 11 Subband013 - -0 -1 -LANG:1 11 Subband014 - -0 -1 -LANG:1 11 Subband015 - -0 -1 -LANG:1 11 Subband016 - -0 -1 -LANG:1 11 Subband017 - -0 -1 -LANG:1 11 Subband018 - -0 -1 -LANG:1 11 Subband019 - -0 -1 -LANG:1 11 Subband020 - -0 -1 -LANG:1 11 Subband021 - -0 -1 -LANG:1 11 Subband022 - -0 -1 -LANG:1 11 Subband023 - -0 -1 -LANG:1 11 Subband024 - -0 -1 -LANG:1 11 Subband025 - -0 -1 -LANG:1 11 Subband026 - -0 -1 -LANG:1 11 Subband027 - -0 -1 -LANG:1 11 Subband028 - -0 -1 -LANG:1 11 Subband029 - -0 -1 -LANG:1 11 Subband030 - -0 -1 -LANG:1 11 Subband031 - -0 -1 -LANG:1 11 Subband032 - -0 -1 -LANG:1 11 Subband033 - -0 -1 -LANG:1 11 Subband034 - -0 -1 -LANG:1 11 Subband035 - -0 -1 -LANG:1 11 Subband036 - -0 -1 -LANG:1 11 Subband037 - -0 -1 -LANG:1 11 Subband038 - -0 -1 -LANG:1 11 Subband039 - -0 -1 -LANG:1 11 Subband040 - -0 -1 -LANG:1 11 Subband041 - -0 -1 -LANG:1 11 Subband042 - -0 -1 -LANG:1 11 Subband043 - -0 -1 -LANG:1 11 Subband044 - -0 -1 -LANG:1 11 Subband045 - -0 -1 -LANG:1 11 Subband046 - -0 -1 -LANG:1 11 Subband047 - -0 -1 -LANG:1 11 Subband048 - -0 -1 -LANG:1 11 Subband049 - -0 -1 -LANG:1 11 Subband050 - -0 -1 -LANG:1 11 Subband051 - -0 -1 -LANG:1 11 Subband052 - -0 -1 -LANG:1 11 Subband053 - -0 -1 -LANG:1 11 Subband054 - -0 -1 -LANG:1 11 Subband055 - -0 -1 -LANG:1 11 Subband056 - -0 -1 -LANG:1 11 Subband057 - -0 -1 -LANG:1 11 Subband058 - -0 -1 -LANG:1 11 Subband059 - -0 -1 -LANG:1 11 Subband060 - -0 -1 -LANG:1 11 Subband061 - -0 -1 -LANG:1 11 Subband062 - -0 -1 -LANG:1 11 Subband063 - -0 -1 -LANG:1 11 Subband064 - -0 -1 -LANG:1 11 Subband065 - -0 -1 -LANG:1 11 Subband066 - -0 -1 -LANG:1 11 Subband067 - -0 -1 -LANG:1 11 Subband068 - -0 -1 -LANG:1 11 Subband069 - -0 -1 -LANG:1 11 Subband070 - -0 -1 -LANG:1 11 Subband071 - -0 -1 -LANG:1 11 Subband072 - -0 -1 -LANG:1 11 Subband073 - -0 -1 -LANG:1 11 Subband074 - -0 -1 -LANG:1 11 Subband075 - -0 -1 -LANG:1 11 Subband076 - -0 -1 -LANG:1 11 Subband077 - -0 -1 -LANG:1 11 Subband078 - -0 -1 -LANG:1 11 Subband079 - -0 -1 -LANG:1 11 Subband080 - -0 -1 -LANG:1 11 Subband081 - -0 -1 -LANG:1 11 Subband082 - -0 -1 -LANG:1 11 Subband083 - -0 -1 -LANG:1 11 Subband084 - -0 -1 -LANG:1 11 Subband085 - -0 -1 -LANG:1 11 Subband086 - -0 -1 -LANG:1 11 Subband087 - -0 -1 -LANG:1 11 Subband088 - -0 -1 -LANG:1 11 Subband089 - -0 -1 -LANG:1 11 Subband090 - -0 -1 -LANG:1 11 Subband091 - -0 -1 -LANG:1 11 Subband092 - -0 -1 -LANG:1 11 Subband093 - -0 -1 -LANG:1 11 Subband094 - -0 -1 -LANG:1 11 Subband095 - -0 -1 -LANG:1 11 Subband096 - -0 -1 -LANG:1 11 Subband097 - -0 -1 -LANG:1 11 Subband098 - -0 -1 -LANG:1 11 Subband099 - -0 -1 -LANG:1 11 Subband100 - -0 -1 -LANG:1 11 Subband101 - -0 -1 -LANG:1 11 Subband102 - -0 -1 -LANG:1 11 Subband103 - -0 -1 -LANG:1 11 Subband104 - -0 -1 -LANG:1 11 Subband105 - -0 -1 -LANG:1 11 Subband106 - -0 -1 -LANG:1 11 Subband107 - -0 -1 -LANG:1 11 Subband108 - -0 -1 -LANG:1 11 Subband109 - -0 -1 -LANG:1 11 Subband110 - -0 -1 -LANG:1 11 Subband111 - -0 -1 -LANG:1 11 Subband112 - -0 -1 -LANG:1 11 Subband113 - -0 -1 -LANG:1 11 Subband114 - -0 -1 -LANG:1 11 Subband115 - -0 -1 -LANG:1 11 Subband116 - -0 -1 -LANG:1 11 Subband117 - -0 -1 -LANG:1 11 Subband118 - -0 -1 -LANG:1 11 Subband119 - -0 -1 -LANG:1 11 Subband120 - -0 -1 -LANG:1 11 Subband121 - -0 -1 -LANG:1 11 Subband122 - -0 -1 -LANG:1 11 Subband123 - -0 -1 -LANG:1 11 Subband124 - -0 -1 -LANG:1 11 Subband125 - -0 -1 -LANG:1 11 Subband126 - -0 -1 -LANG:1 11 Subband127 - -0 -1 -LANG:1 11 Subband128 - -0 -1 -LANG:1 11 Subband129 - -0 -1 -LANG:1 11 Subband130 - -0 -1 -LANG:1 11 Subband131 - -0 -1 -LANG:1 11 Subband132 - -0 -1 -LANG:1 11 Subband133 - -0 -1 -LANG:1 11 Subband134 - -0 -1 -LANG:1 11 Subband135 - -0 -1 -LANG:1 11 Subband136 - -0 -1 -LANG:1 11 Subband137 - -0 -1 -LANG:1 11 Subband138 - -0 -1 -LANG:1 11 Subband139 - -0 -1 -LANG:1 11 Subband140 - -0 -1 -LANG:1 11 Subband141 - -0 -1 -LANG:1 11 Subband142 - -0 -1 -LANG:1 11 Subband143 - -0 -1 -LANG:1 11 Subband144 - -0 -1 -LANG:1 11 Subband145 - -0 -1 -LANG:1 11 Subband146 - -0 -1 -LANG:1 11 Subband147 - -0 -1 -LANG:1 11 Subband148 - -0 -1 -LANG:1 11 Subband149 - -0 -1 -LANG:1 11 Subband150 - -0 -1 -LANG:1 11 Subband151 - -0 -1 -LANG:1 11 Subband152 - -0 -1 -LANG:1 11 Subband153 - -0 -1 -LANG:1 11 Subband154 - -0 -1 -LANG:1 11 Subband155 - -0 -1 -LANG:1 11 Subband156 - -0 -1 -LANG:1 11 Subband157 - -0 -1 -LANG:1 11 Subband158 - -0 -1 -LANG:1 11 Subband159 - -0 -1 -LANG:1 11 Subband160 - -0 -1 -LANG:1 11 Subband161 - -0 -1 -LANG:1 11 Subband162 - -0 -1 -LANG:1 11 Subband163 - -0 -1 -LANG:1 11 Subband164 - -0 -1 -LANG:1 11 Subband165 - -0 -1 -LANG:1 11 Subband166 - -0 -1 -LANG:1 11 Subband167 - -0 -1 -LANG:1 11 Subband168 - -0 -1 -LANG:1 11 Subband169 - -0 -1 -LANG:1 11 Subband170 - -0 -1 -LANG:1 11 Subband171 - -0 -1 -LANG:1 11 Subband172 - -0 -1 -LANG:1 11 Subband173 - -0 -1 -LANG:1 11 Subband174 - -0 -1 -LANG:1 11 Subband175 - -0 -1 -LANG:1 11 Subband176 - -0 -1 -LANG:1 11 Subband177 - -0 -1 -LANG:1 11 Subband178 - -0 -1 -LANG:1 11 Subband179 - -0 -1 -LANG:1 11 Subband180 - -0 -1 -LANG:1 11 Subband181 - -0 -1 -LANG:1 11 Subband182 - -0 -1 -LANG:1 11 Subband183 - -0 -1 -LANG:1 11 Subband184 - -0 -1 -LANG:1 11 Subband185 - -0 -1 -LANG:1 11 Subband186 - -0 -1 -LANG:1 11 Subband187 - -0 -1 -LANG:1 11 Subband188 - -0 -1 -LANG:1 11 Subband189 - -0 -1 -LANG:1 11 Subband190 - -0 -1 -LANG:1 11 Subband191 - -0 -1 -LANG:1 11 Subband192 - -0 -1 -LANG:1 11 Subband193 - -0 -1 -LANG:1 11 Subband194 - -0 -1 -LANG:1 11 Subband195 - -0 -1 -LANG:1 11 Subband196 - -0 -1 -LANG:1 11 Subband197 - -0 -1 -LANG:1 11 Subband198 - -0 -1 -LANG:1 11 Subband199 - -0 -1 -LANG:1 11 Subband200 - -0 -1 -LANG:1 11 Subband201 - -0 -1 -LANG:1 11 Subband202 - -0 -1 -LANG:1 11 Subband203 - -0 -1 -LANG:1 11 Subband204 - -0 -1 -LANG:1 11 Subband205 - -0 -1 -LANG:1 11 Subband206 - -0 -1 -LANG:1 11 Subband207 - -0 -1 -LANG:1 11 Subband208 - -0 -1 -LANG:1 11 Subband209 - -0 -1 -LANG:1 11 Subband210 - -0 -1 -LANG:1 11 Subband211 - -0 -1 -LANG:1 11 Subband212 - -0 -1 -LANG:1 11 Subband213 - -0 -1 -LANG:1 11 Subband214 - -0 -1 -LANG:1 11 Subband215 - -0 -1 -LANG:1 11 Subband216 - -0 -1 -LANG:1 11 Subband217 - -0 -1 -LANG:1 11 Subband218 - -0 -1 -LANG:1 11 Subband219 - -0 -1 -LANG:1 11 Subband220 - -0 -1 -LANG:1 11 Subband221 - -0 -1 -LANG:1 11 Subband222 - -0 -1 -LANG:1 11 Subband223 - -0 -1 -LANG:1 11 Subband224 - -0 -1 -LANG:1 11 Subband225 - -0 -1 -LANG:1 11 Subband226 - -0 -1 -LANG:1 11 Subband227 - -0 -1 -LANG:1 11 Subband228 - -0 -1 -LANG:1 11 Subband229 - -0 -1 -LANG:1 11 Subband230 - -0 -1 -LANG:1 11 Subband231 - -0 -1 -LANG:1 11 Subband232 - -0 -1 -LANG:1 11 Subband233 - -0 -1 -LANG:1 11 Subband234 - -0 -1 -LANG:1 11 Subband235 - -0 -1 -LANG:1 11 Subband236 - -0 -1 -LANG:1 11 Subband237 - -0 -1 -LANG:1 11 Subband238 - -0 -1 -LANG:1 11 Subband239 - -0 -1 -LANG:1 11 Subband240 - -0 -1 -LANG:1 11 Subband241 - -0 -1 -LANG:1 11 Subband242 - -0 -1 -LANG:1 11 Subband243 - -0 -1 -LANG:1 11 Subband244 - -0 -1 -LANG:1 11 Subband245 - -0 -1 -LANG:1 11 Subband246 - -0 -1 -LANG:1 11 Subband247 - -0 -1 -LANG:1 11 Subband248 - -0 -1 -LANG:1 11 Subband249 - -0 -1 -LANG:1 11 Subband250 - -0 -1 -LANG:1 11 Subband251 - -0 -1 -LANG:1 11 Subband252 - -0 -1 -LANG:1 11 Subband253 - -0 -1 -LANG:1 11 Subband254 - -0 -1 -LANG:1 11 Subband255 - -0 -1 -LANG:1 11 Subband256 - -0 - -"main() -{ - SelectionList1.selectedPos=1; - SelectionList1EventInitialize(); -} - -" 0 - -" -main() -{ - SelectionList1EventChange(); -} -" 0 - -E - -3 1 -14 2 -"TextField1" -"" -1 403.3888888888889 52 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -3 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 50 644 76 -3 "s" 0 0 0 0 0 -1 E E E -14 5 -"TextField2" -"" -1 403.3888888888889 82 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -6 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 80 644 106 -3 "s" 0 0 0 0 0 -1 E E E -14 7 -"TextField3" -"" -1 403.3888888888889 112 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -8 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 110 644 136 -3 "s" 0 0 0 0 0 -1 E E E -14 9 -"TextField4" -"" -1 403.3888888888889 142 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -10 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 140 644 166 -3 "s" 0 0 0 0 0 -1 E E E -14 11 -"TextField5" -"" -1 403.3888888888889 172 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -12 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 170 644 196 -3 "s" 0 0 0 0 0 -1 E E E -14 13 -"TextField6" -"" -1 403.3888888888889 202 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -14 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 200 644 226 -3 "s" 0 0 0 0 0 -1 E E E -14 15 -"TextField7" -"" -1 403.3888888888889 232 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -16 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 230 644 256 -3 "s" 0 0 0 0 0 -1 E E E -14 17 -"TextField8" -"" -1 403.3888888888889 262 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -18 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 260 644 286 -3 "s" 0 0 0 0 0 -1 E E E -14 19 -"TextField9" -"" -1 403.3888888888889 292 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -20 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 290 644 316 -3 "s" 0 0 0 0 0 -1 E E E -14 21 -"TextField10" -"" -1 403.3888888888889 322 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -22 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 320 644 346 -3 "s" 0 0 0 0 0 -1 E E E -14 23 -"TextField11" -"" -1 403.3888888888889 352 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -24 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 350 644 376 -3 "s" 0 0 0 0 0 -1 E E E -14 25 -"TextField12" -"" -1 403.3888888888889 382 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -26 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 380 644 406 -3 "s" 0 0 0 0 0 -1 E E E -14 27 -"TextField13" -"" -1 403.3888888888889 412 E E E 1 E 0 E N "_WindowText" E N "_Window" E E - E E -28 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 400 410 644 436 -3 "s" 0 0 0 0 0 -1 E E E -13 30 -"Button1" -"" -1 652 52 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -31 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 50 724 76 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[1], TextField1.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 44 -"Button2" -"" -1 652 82 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -45 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 80 724 106 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[2], TextField2.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -} -" 0 - E E E -13 45 -"Button5" -"" -1 652 172 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -46 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 170 724 196 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[5], TextField5.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 46 -"Button4" -"" -1 652 142 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -47 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 140 724 166 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[4], TextField4.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 47 -"Button3" -"" -1 652 112 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -48 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 110 724 136 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[3], TextField3.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 48 -"Button6" -"" -1 652 202 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -49 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 200 724 226 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[6], TextField6.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 49 -"Button7" -"" -1 652 232 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -50 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 230 724 256 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[7], TextField7.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 50 -"Button8" -"" -1 652 262 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -51 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 260 724 286 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[8], TextField8.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 51 -"Button9" -"" -1 652 292 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -52 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 290 724 316 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[9], TextField9.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 52 -"Button10" -"" -1 652 322 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -53 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 320 724 346 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[10], TextField10.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 53 -"Button11" -"" -1 652 352 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -54 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 350 724 376 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[11], TextField11.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 54 -"Button12" -"" -1 652 382 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -55 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 380 724 406 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[12], TextField12.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -13 55 -"Button13" -"" -1 652 412 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E - E E -56 0 0 0 0 0 -E E E -0 -1 -LANG:1 0 - -0 -1 -LANG:1 60 -adobe-helvetica-medium-r-normal-*-*-120-75-75-*-*-iso8859-1 -0 -"" 650 410 724 436 - -T -1 -LANG:1 3 Set -"main() -{ - setField(g_buttonDatapoints[13], TextField13.text); -} - -void setField(string datapoint, string text) -{ -dyn_errClass err; - - dpSetWait(datapoint, text); - err = getLastError(); - if (dynlen(err) > 0) - errorDialog(err); -}" 0 - E E E -0 -LAYER, 1 -1 -LANG:1 6 Layer2 -0 -LAYER, 2 -1 -LANG:1 6 Layer3 -0 -LAYER, 3 -1 -LANG:1 6 Layer4 -0 -LAYER, 4 -1 -LANG:1 6 Layer5 -0 -LAYER, 5 -1 -LANG:1 6 Layer6 -0 -LAYER, 6 -1 -LANG:1 6 Layer7 -0 -LAYER, 7 -1 -LANG:1 6 Layer8 -0 -0 \ No newline at end of file diff --git a/MAC/APL/PIC/_RegisterAccess/pvss/picmodel.txt b/MAC/APL/PIC/_RegisterAccess/pvss/picmodel.txt deleted file mode 100644 index 081ffd6454bc62edb41ca7191ea3119b47396483..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/pvss/picmodel.txt +++ /dev/null @@ -1,392 +0,0 @@ -PIC - Rack1 - SubRack1 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack2 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack3 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack4 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - Rack2 - SubRack1 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack2 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack3 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack4 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - Rack3 - SubRack1 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack2 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack3 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack4 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - Rack4 - SubRack1 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack2 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack3 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack4 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - Rack5 - SubRack1 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack2 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack3 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack4 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - Rack6 - SubRack1 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack2 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack3 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - SubRack4 - Board1 - ETH - BP - AP1 - RCU1 - RCU2 - AP2 - RCU1 - RCU2 - AP3 - RCU1 - RCU2 - AP4 - RCU1 - RCU2 - \ No newline at end of file diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARAAnswer.cc b/MAC/APL/PIC/_RegisterAccess/src/ARAAnswer.cc deleted file mode 100644 index 2d7dd2e880b04b0a746d097a8f837b9ad74a8fb3..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARAAnswer.cc +++ /dev/null @@ -1,66 +0,0 @@ -//# ARAAnswer.cc: Implementation of the ARAAnswer object -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -#include "ARAAnswer.h" -#include <GCF/TM/GCF_Task.h> - -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; - -namespace LOFAR -{ - -namespace ARA -{ - -ARAAnswer::ARAAnswer() : - m_dummyPort(), - m_task(0) -{ -} - -ARAAnswer::~ARAAnswer() -{ -} - -void ARAAnswer::setTask(GCFTask* pTask) -{ - m_task=pTask; -} - -void ARAAnswer::handleAnswer(GCFEvent& answer) -{ - if(m_task!=0) - m_task->dispatch(answer,m_dummyPort); -} - - -} // namespace ARA - - -} // namespace LOFAR - diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARAAnswer.h b/MAC/APL/PIC/_RegisterAccess/src/ARAAnswer.h deleted file mode 100644 index 4b368c4ef0731427a548602c70c57c59779c3acb..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARAAnswer.h +++ /dev/null @@ -1,55 +0,0 @@ -//# ARAAnswer.h -//# -//# 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$ - -#ifndef ARAAnswer_H -#define ARAAnswer_H - -#include <GCF/PAL/GCF_Answer.h> -#include <GCF/TM/GCF_Port.h> - -namespace LOFAR -{ - -class GCF::TM::GCFEvent; -class GCF::TM::GCFTask; - -namespace ARA -{ - - class ARAAnswer : public GCF::PAL::GCFAnswer - { - public: - ARAAnswer(); - ~ARAAnswer(); - - void setTask(GCF::TM::GCFTask* t); - void handleAnswer(GCF::TM::GCFEvent& answer); - - private: - GCF::TM::GCFPort m_dummyPort; - GCF::TM::GCFTask* m_task; - }; - -}; - -} // namespace LOFAR -#endif diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARAConstants.h b/MAC/APL/PIC/_RegisterAccess/src/ARAConstants.h deleted file mode 100644 index 4a0bd41fda3e7710d0ce29fffd4baadecfaabc50..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARAConstants.h +++ /dev/null @@ -1,45 +0,0 @@ -//# -//# ARAConstants.h: constants related to the BeamServer -//# -//# 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$ - -#ifndef ARACONSTANTS_H_ -#define ARACONSTANTS_H_ - -namespace LOFAR -{ - -namespace ARA -{ - - const char PARAM_N_RACKS[] = "mac.apl.ara.N_RACKS"; - const char PARAM_N_SUBRACKS_PER_RACK[] = "mac.apl.ara.N_SUBRACKS_PER_RACK"; - const char PARAM_N_BOARDS_PER_SUBRACK[] = "mac.apl.ara.N_BOARDS_PER_SUBRACK"; - const char PARAM_N_APS_PER_BOARD[] = "mac.apl.ara.N_APS_PER_BOARD"; - const char PARAM_N_RCUS_PER_AP[] = "mac.apl.ara.N_RCUS_PER_AP"; - const char PARAM_STATUS_UPDATE_INTERVAL[] = "mac.apl.ara.STATUS_UPDATE_INTERVAL"; - const char PARAM_STATISTICS_UPDATE_INTERVAL[] = "mac.apl.ara.STATISTICS_UPDATE_INTERVAL"; - const char PARAM_STATISTICS_CENTRALIZED[] = "mac.apl.ara.STATISTICS_CENTRALIZED"; - -}; - -} // namespace LOFAR -#endif /* ARACONSTANTS_H_ */ diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARAMain.cc b/MAC/APL/PIC/_RegisterAccess/src/ARAMain.cc deleted file mode 100644 index 9846a36ae0786981484825c8de3f5bec42d0f746..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARAMain.cc +++ /dev/null @@ -1,50 +0,0 @@ -//# ARAMain.cc: Main entry for the Register Access application -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -#include "ARARegisterAccessTask.h" - -using namespace LOFAR; -using namespace ARA; -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; -using namespace std; - -int main(int argc, char* argv[]) -{ - GCFTask::init(argc, argv); - - LOG_INFO(formatString("Program %s has started", argv[0])); - - RegisterAccessTask ara("ARA"); - - ara.start(); // make initial transition - - GCFTask::run(); - - LOG_INFO(formatString("Normal termination of program %s", argv[0])); - return 0; -} diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARAPhysicalModel.cc b/MAC/APL/PIC/_RegisterAccess/src/ARAPhysicalModel.cc deleted file mode 100644 index a832f438853804921f91d41d2afc02976a03e899..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARAPhysicalModel.cc +++ /dev/null @@ -1,167 +0,0 @@ -//# ARAPhysicalModel.cc: Implementation of the ARAPhysicalModel object -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -#include <GCF/PAL/GCF_ExtProperty.h> -#include <GCF/GCF_PVUnsigned.h> -#include <APS/ParameterSet.h> -#include <Common/LofarLocators.h> - -#include "ARAPhysicalModel.h" -#include "ARAPropertyDefines.h" -#include "ARAConstants.h" - -using namespace std; -using namespace boost; - -using namespace LOFAR::ACC::APS; -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; - -namespace LOFAR -{ - -namespace ARA -{ - -ARAPhysicalModel::ARAPhysicalModel() : - m_maintenanceModel(), - m_maintenanceFlags() -{ - int rack,subrack,board,ap,rcu; - - try - { - ConfigLocator cl; - globalParameterSet()->adoptFile(cl.locate("RegisterAccess.conf")); - } - catch (Exception e) - { - LOG_ERROR_STR("Failed to load configuration files: " << e.text()); - exit(EXIT_FAILURE); - } - - int n_racks = globalParameterSet()->getInt32(PARAM_N_RACKS); - int n_subracks_per_rack = globalParameterSet()->getInt32(PARAM_N_SUBRACKS_PER_RACK); - int n_boards_per_subrack = globalParameterSet()->getInt32(PARAM_N_BOARDS_PER_SUBRACK); - int n_aps_per_board = globalParameterSet()->getInt32(PARAM_N_APS_PER_BOARD); - int n_rcus_per_ap = globalParameterSet()->getInt32(PARAM_N_RCUS_PER_AP); - - char tempString[200]; - vector<string> childrenPIC,childrenRack,childrenSubRack,childrenBoard; - for(rack=1;rack<=n_racks;rack++) - { - for(subrack=1;subrack<=n_subracks_per_rack;subrack++) - { - for(board=1;board<=n_boards_per_subrack;board++) - { - for(ap=1;ap<=n_aps_per_board;ap++) - { - for(rcu=1;rcu<=n_rcus_per_ap;rcu++) - { - sprintf(tempString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_Maintenance,rack,subrack,board,ap,rcu); - childrenBoard.push_back(string(tempString)); - } - } - sprintf(tempString,SCOPE_PIC_RackN_SubRackN_BoardN_Maintenance,rack,subrack,board); - m_maintenanceModel[tempString] = childrenBoard; - childrenBoard.clear(); - - childrenSubRack.push_back(string(tempString)); - } - sprintf(tempString,SCOPE_PIC_RackN_SubRackN_Maintenance,rack,subrack); - m_maintenanceModel[tempString] = childrenSubRack; - childrenSubRack.clear(); - - childrenRack.push_back(string(tempString)); - } - sprintf(tempString,SCOPE_PIC_RackN_Maintenance,rack); - m_maintenanceModel[tempString] = childrenRack; - childrenRack.clear(); - - childrenPIC.push_back(string(tempString)); - } - m_maintenanceModel[tempString] = childrenPIC; - childrenPIC.clear(); -} - -ARAPhysicalModel::~ARAPhysicalModel() -{ -} - -void ARAPhysicalModel::inMaintenance(bool maintenance, string& resource) -{ - if(maintenance) - { - m_maintenanceFlags.insert(resource); - // set maintenance status in database of every child resource - - PhysicalModelIterT pIt = m_maintenanceModel.find(resource); - if(pIt != m_maintenanceModel.end()) - { - vector<string>::iterator mIt; - for(mIt=pIt->second.begin();mIt!=pIt->second.end();++mIt) - { - string propName(*mIt + string(".") + string(PROPNAME_STATUS)); - TPropertyInfo propInfo(propName.c_str(),LPT_UNSIGNED); - GCFExtProperty extPropMaintenance(propInfo); - GCFPVUnsigned inMaintenance(1); - extPropMaintenance.setValue(inMaintenance); - } - } - } - else - { - m_maintenanceFlags.erase(resource); - // reset maintenance status in database of every child resource, - // except the ones that exist in the maintenance flags list. - - PhysicalModelIterT pIt = m_maintenanceModel.find(resource); - if(pIt != m_maintenanceModel.end()) - { - vector<string>::iterator mIt; - for(mIt=pIt->second.begin();mIt!=pIt->second.end();++mIt) - { - MaintenanceFlagsIterT fIt = m_maintenanceFlags.find(*mIt); - if(fIt == m_maintenanceFlags.end()) - { - // maintenance of resource is not individually set - string propName(*mIt + string(".") + string(PROPNAME_STATUS)); - TPropertyInfo propInfo(propName.c_str(),LPT_UNSIGNED); - GCFExtProperty extPropMaintenance(propInfo); - GCFPVUnsigned inMaintenance(0); - extPropMaintenance.setValue(inMaintenance); - } - } - } - } -} - -} // namespace ARA - - -} // namespace LOFAR - diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARAPhysicalModel.h b/MAC/APL/PIC/_RegisterAccess/src/ARAPhysicalModel.h deleted file mode 100644 index a71764f1b02fa5e3f5c015be9b7791c681b66ca9..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARAPhysicalModel.h +++ /dev/null @@ -1,60 +0,0 @@ -//# ARAPhysicalModel.h -//# -//# 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$ - -#ifndef ARAPhysicalModel_H -#define ARAPhysicalModel_H - -#include <vector> -#include <string> -#include <map> -#include <set> -#include <list> -#include <boost/utility.hpp> - -namespace LOFAR -{ - -namespace ARA -{ - class ARAPhysicalModel : boost::noncopyable // prohibits access to copy construction and assignment - { - public: - ARAPhysicalModel(); - ~ARAPhysicalModel(); - - void inMaintenance(bool maintenance, std::string& resource); - - protected: - - private: - typedef std::map<std::string, std::vector<std::string> > PhysicalModelT; - typedef PhysicalModelT::iterator PhysicalModelIterT; - typedef std::set<std::string> MaintenanceFlagsT; - typedef MaintenanceFlagsT::iterator MaintenanceFlagsIterT; - - PhysicalModelT m_maintenanceModel; - MaintenanceFlagsT m_maintenanceFlags; - }; -}; - -} // namespace LOFAR -#endif diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARAPropertyDefines.h b/MAC/APL/PIC/_RegisterAccess/src/ARAPropertyDefines.h deleted file mode 100644 index e1dbae65c3937ca9d121bc0e4ad15394e7870325..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARAPropertyDefines.h +++ /dev/null @@ -1,530 +0,0 @@ -//# ARAPropertyDefines.h: common defines for the AVT package -//# -//# 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$ - -#ifndef ARAPropertyDefines_H -#define ARAPropertyDefines_H - -#include "GCF/GCF_Defines.h" -#include "GCF/GCF_PValue.h" - -namespace LOFAR -{ - -namespace ARA -{ - -const int STATUS_OK = 0; -const int STATUS_ERROR = 1; - -/* -const int N_RACKS = 3; // 6 -const int N_SUBRACKS_PER_RACK = 2; // 4 -const int N_BOARDS_PER_SUBRACK = 4; -const int N_APS_PER_BOARD = 4; -const int N_RCUS_PER_AP = 2; -const int N_RCUS = N_RCUS_PER_AP* - N_APS_PER_BOARD* - N_BOARDS_PER_SUBRACK* - N_SUBRACKS_PER_RACK* - N_RACKS; -*/ - -const int BIT_LBAENABLE = 0; -const int BIT_HBAENABLE = 1; -const int BIT_BANDSEL = 2; -const int BIT_FILSEL0 = 3; -const int BIT_FILSEL1 = 4; -const int BIT_VLENABLE = 5; -const int BIT_VHENABLE = 6; -const int BIT_VDDVCCEN = 7; - -const char APC_Station[] = "ApcStationType"; -const char APC_Rack[] = "ApcRackType"; -const char APC_SubRack[] = "ApcSubRackType"; -const char APC_Board[] = "ApcBoardType"; -const char APC_Ethernet[] = "ApcEthernetType"; -const char APC_FPGA[] = "ApcFPGAType"; -const char APC_RCU[] = "ApcRCUType"; -const char APC_LFA[] = "ApcLFAType"; -const char APC_HFA[] = "ApcHFAType"; -const char APC_ADCStatistics[] = "ApcADCStatisticsType"; -const char APC_Maintenance[] = "ApcMaintenanceType"; -const char APC_Alert[] = "ApcAlertType"; -const char APC_MEPStatus[] = "ApcMEPStatusType"; -const char APC_SYNCStatus[] = "ApcSYNCStatusType"; -const char APC_BoardRCUStatus[] = "ApcBoardRCUStatusType"; - -const char SCOPE_PIC[] = "LOFAR_PIC"; -const char SCOPE_PIC_RackN[] = "LOFAR_PIC_Cabinet%d"; -const char SCOPE_PIC_RackN_SubRackN[] = "LOFAR_PIC_Cabinet%d_Subrack%d"; -const char SCOPE_PIC_RackN_SubRackN_BoardN[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_MEPStatus[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.MEPStatus"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_ETH[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.ETH"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_BP[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.BP"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_SYNCStatus[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.SYNCStatus"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_BoardRCUStatus[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.BoardRCUStatus"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_LFA[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.LFA"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.HFA"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_ADCStatistics[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.ADCStatistics"; -const char SCOPE_PIC_Maintenance[] = "LOFAR_PIC_Maintenance"; -const char SCOPE_PIC_RackN_Maintenance[] = "LOFAR_PIC_Cabinet%d_Maintenance"; -const char SCOPE_PIC_RackN_SubRackN_Maintenance[] = "LOFAR_PIC_Cabinet%d_Subrack%d_Maintenance"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_Maintenance[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.Maintenance"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_Maintenance[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.Maintenance"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_LFA_Maintenance[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.LFA.Maintenance"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA_Maintenance[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.HFA.Maintenance"; -const char SCOPE_PIC_RackN_Alert[] = "LOFAR_PIC_Cabinet%d_Alert"; -const char SCOPE_PIC_RackN_SubRackN_Alert[] = "LOFAR_PIC_Cabinet%d_Subrack%d_Alert"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_Alert[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.Alert"; -const char SCOPE_PIC_Command[] = "LOFAR_PIC_Command"; -const char SCOPE_PIC_RackN_SubRackN_Command[] = "LOFAR_PIC_Cabinet%d_Subrack%d_Command"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_Command[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.Command"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_Command[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.Command"; -const char SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA_Command[] = "LOFAR_PIC_Cabinet%d_Subrack%d_RSPBoard%d.AP%d.RCU%d.HFA.Command"; - -const char TYPE_LCU_PIC[] = "StnPIC"; -const char TYPE_LCU_PIC_Maintenance[] = "Maintenance"; -const char TYPE_LCU_PIC_Rack[] = "Cabinet"; -const char TYPE_LCU_PIC_Alert[] = "Alert"; -const char TYPE_LCU_PIC_SubRack[] = "SubRack"; -const char TYPE_LCU_PIC_Board[] = "RSPBoard"; -const char TYPE_LCU_PIC_MEPStatus[] = "TLcuPicMEPStatus"; -const char TYPE_LCU_PIC_SYNCStatus[] = "TLcuPicSYNCStatus"; -const char TYPE_LCU_PIC_BoardRCUStatus[]= "TLcuPicBoardRCUStatus"; -const char TYPE_LCU_PIC_Ethernet[] = "TLcuPicEthernet"; -const char TYPE_LCU_PIC_FPGA[] = "TLcuPicFPGA"; -const char TYPE_LCU_PIC_RCU[] = "TLcuPicRCU"; -const char TYPE_LCU_PIC_ADCStatistics[] = "TLcuPicADCStatistics"; -const char TYPE_LCU_PIC_LFA[] = "TLcuPicLFA"; -const char TYPE_LCU_PIC_HFA[] = "TLcuPicHFA"; -const char TYPE_LCU_PIC_Command[] = "TLcuPicCommand"; -const char TYPE_LCU_PAC_LogicalDeviceScheduler[] = "TLcuPacLogicalDeviceScheduler"; - -const GCF::Common::TPSCategory PSCAT_LCU_PIC = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_Alert = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_Maintenance = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_Rack = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_SubRack = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_Board = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_MEPStatus = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_SYNCStatus = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_BoardRCUStatus= GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_Ethernet = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_FPGA = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_RCU = GCF::Common::PS_CAT_PERMANENT; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_ADCStatistics = GCF::Common::PS_CAT_PERMANENT; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_LFA = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_HFA = GCF::Common::PS_CAT_PERM_AUTOLOAD; -const GCF::Common::TPSCategory PSCAT_LCU_PIC_Command = GCF::Common::PS_CAT_PERM_AUTOLOAD; - - -// the following constants cannot be defined as const char because they are used -// as char* elsewhere -#define PROPNAME_STATUS "status" -#define PROPNAME_COMMAND "command" -#define PROPNAME_RESULT "result" -#define PROPNAME_RESULT_CODE "resultCode" -#define PROPNAME_VOLTAGE12 "voltage12" -#define PROPNAME_VOLTAGE25 "voltage25" -#define PROPNAME_VOLTAGE33 "voltage33" -#define PROPNAME_PCBTEMP "pcbTemp" -#define PROPNAME_FRAMESRECEIVED "packetsReceived" -#define PROPNAME_FRAMESERROR "packetsError" -#define PROPNAME_LASTERROR "lastError" -#define PROPNAME_FFI0 "ffi0" -#define PROPNAME_FFI1 "ffi1" -#define PROPNAME_FFI2 "ffi2" -#define PROPNAME_ALIVE "alive" -#define PROPNAME_TEMPERATURE "temperature" -#define PROPNAME_VERSION "version" -#define PROPNAME_OVERFLOW "overflow" -#define PROPNAME_VDDVCCEN "VddVccEn" -#define PROPNAME_VHENABLE "VhEnable" -#define PROPNAME_VLENABLE "VlEnable" -#define PROPNAME_FILSEL1 "filSel1" -#define PROPNAME_FILSEL0 "filSel0" -#define PROPNAME_BANDSEL "bandSel" -#define PROPNAME_HBAENABLE "HBAEnable" -#define PROPNAME_LBAENABLE "LBAEnable" -#define PROPNAME_FROMTIME "fromTime" -#define PROPNAME_TOTIME "toTime" -#define PROPNAME_STATISTICSSUBBANDPOWER "statisticsSubbandPower" -#define PROPNAME_STATISTICSBEAMLETPOWER "statisticsBeamletPower" -#define PROPNAME_XCSTATISTICS "statisticsCrosslet" -#define PROPNAME_INTEGRATIONTIME "integrationTime" -#define PROPNAME_INTEGRATIONMETHOD "integrationMethod" -#define PROPNAME_SEQNR "seqnr" -#define PROPNAME_ERROR "error" -#define PROPNAME_SAMPLECOUNT "sampleCount" -#define PROPNAME_SYNCCOUNT "syncCount" -#define PROPNAME_ERRORCOUNT "errorCount" -#define PROPNAME_NOFOVERFLOW "nofOverflow" -#define PROPNAME_FUNCTIONALITY "functionality" -#define PROPNAME_STABLE "stable" - -const string commandGetID("getID"); -const string commandTestRegisterReadWrite("testRegisterReadWrite"); -const string commandTestPPS("testPPS"); -const string commandReadSattelitePositions("readSattelitePositions"); -const string commandReadTimeConstant("readTimeConstant"); -const string commandReadConfiguration("readConfiguration"); -const string commandReadStatistics("readStatistics"); -const string commandReadPPSlockStatus("readPPSlockStatus"); -const string commandReadPLLlockStatus("readPLLlockStatus"); -const string commandReadCurrent("readCurrent"); -const string commandTestRSPlinkSpeed("testRSPlinkSpeed"); -const string commandTestRCUlinkSpeed("testRCUlinkSpeed"); -const string commandTestSerdesSpeed("testSerdesSpeed"); -const string commandTestTBBlinkSpeed("testTBBlinkSpeed"); -const string commandTestBoundaryScan("testBoundaryScan"); -const string commandTestWaveform("testWaveform"); -const string commandTestTransient("testTransient"); -const string commandTestClock("testClock"); -const string commandTestFPGAlinkSpeed("testFPGAlinkSpeed"); -const string commandTestEthernetLoopBack("testEthernetLoopBack"); -const string commandTestSerdesLoopBack("testSerdesLoopBack"); -const string commandTestFPGAmemoryRandom("testFPGAmemoryRandom"); -const string commandTestFPGAmemory("testFPGAmemory"); -const string commandTestDataReception("testDataReception"); -const string commandTestRoundTripSpeed("testRoundTripSpeed"); -const string commandReset("reset"); - -typedef enum -{ - COMMAND_RESULT_OK=0, - COMMAND_RESULT_EXECUTING, - COMMAND_RESULT_ERROR -} TCommandResultCode; - -#define GCF_READWRITE_PROP (GCF_READABLE_PROP | GCF_WRITABLE_PROP) - -#define PROPERTYCONFIG_BEGIN(_name_) \ - const LOFAR::GCF::Common::TPropertyConfig _name_[] = \ - { - -#define PROPERTYCONFIG_ITEM(_propname_,_flags_,_default_) \ - {_propname_,_flags_,_default_}, - -#define PROPERTYCONFIG_END \ - {0,0,0} \ - }; - -PROPERTYCONFIG_BEGIN(PROPS_Station) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM(PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM(PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM(PROPNAME_XCSTATISTICS, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM(PROPNAME_INTEGRATIONTIME, GCF_WRITABLE_PROP, 0) // 0 means no default -PROPERTYCONFIG_ITEM(PROPNAME_INTEGRATIONMETHOD, GCF_WRITABLE_PROP, 0) // 0 means no default -PROPERTYCONFIG_ITEM(PROPNAME_STABLE, GCF_READABLE_PROP, 0) -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_Rack) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_SubRack) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_Board) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM(PROPNAME_VOLTAGE12, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_VOLTAGE25, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_VOLTAGE33, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_PCBTEMP, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_VERSION, GCF_READABLE_PROP, "") - -/* this is getting ugly */ -PROPERTYCONFIG_ITEM("MEPStatus."PROPNAME_SEQNR, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("MEPStatus."PROPNAME_ERROR, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("ETH."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("ETH."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("ETH."PROPNAME_FRAMESRECEIVED, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM("ETH."PROPNAME_FRAMESERROR, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM("ETH."PROPNAME_LASTERROR, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM("BP."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("BP."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("BP."PROPNAME_TEMPERATURE, GCF_READABLE_PROP, "0.0") -PROPERTYCONFIG_ITEM("BP."PROPNAME_VERSION, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP0."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP0."PROPNAME_TEMPERATURE, GCF_READABLE_PROP, "0.0") -PROPERTYCONFIG_ITEM("AP0."PROPNAME_VERSION, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP0.SYNCStatus."PROPNAME_SAMPLECOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.SYNCStatus."PROPNAME_SYNCCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.SYNCStatus."PROPNAME_ERRORCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP0.RCU0."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP0.RCU0.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.RCU0.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP0.RCU0.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.RCU0.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP0.RCU0.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP0.RCU1."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP0.RCU1.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.RCU1.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP0.RCU1.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP0.RCU1.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP0.RCU1.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") - -PROPERTYCONFIG_ITEM("AP1."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP1."PROPNAME_TEMPERATURE, GCF_READABLE_PROP, "0.0") -PROPERTYCONFIG_ITEM("AP1."PROPNAME_VERSION, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP1.SYNCStatus."PROPNAME_SAMPLECOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.SYNCStatus."PROPNAME_SYNCCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.SYNCStatus."PROPNAME_ERRORCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP1.RCU0."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP1.RCU0.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.RCU0.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP1.RCU0.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.RCU0.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP1.RCU0.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP1.RCU1."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP1.RCU1.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.RCU1.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP1.RCU1.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP1.RCU1.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP1.RCU1.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") - -PROPERTYCONFIG_ITEM("AP2."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP2."PROPNAME_TEMPERATURE, GCF_READABLE_PROP, "0.0") -PROPERTYCONFIG_ITEM("AP2."PROPNAME_VERSION, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP2.SYNCStatus."PROPNAME_SAMPLECOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.SYNCStatus."PROPNAME_SYNCCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.SYNCStatus."PROPNAME_ERRORCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP2.RCU0."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP2.RCU0.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.RCU0.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP2.RCU0.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.RCU0.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP2.RCU0.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP2.RCU1."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP2.RCU1.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.RCU1.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP2.RCU1.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP2.RCU1.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP2.RCU1.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") - -PROPERTYCONFIG_ITEM("AP3."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP3."PROPNAME_TEMPERATURE, GCF_READABLE_PROP, "0.0") -PROPERTYCONFIG_ITEM("AP3."PROPNAME_VERSION, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP3.SYNCStatus."PROPNAME_SAMPLECOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.SYNCStatus."PROPNAME_SYNCCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.SYNCStatus."PROPNAME_ERRORCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP3.RCU0."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP3.RCU0.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.RCU0.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP3.RCU0.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.RCU0.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP3.RCU0.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP3.RCU1."PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM("AP3.RCU1.LFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.RCU1.LFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP3.RCU1.HFA."PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM("AP3.RCU1.HFA."PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM("AP3.RCU1.ADCStatistics."PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") - -/* I warned you, didn't I? */ -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_Ethernet) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM(PROPNAME_FRAMESRECEIVED, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FRAMESERROR, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_LASTERROR, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FFI0, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FFI1, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FFI2, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_FPGA) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM(PROPNAME_TEMPERATURE, GCF_READABLE_PROP, "0.0") -PROPERTYCONFIG_ITEM(PROPNAME_VERSION, GCF_READABLE_PROP, "") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_RCU) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_ITEM(PROPNAME_VDDVCCEN, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_VHENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_VLENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_FILSEL1, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_FILSEL0, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_BANDSEL, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_HBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_LBAENABLE, GCF_READWRITE_PROP, "false") -PROPERTYCONFIG_ITEM(PROPNAME_STATISTICSSUBBANDPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_ITEM(PROPNAME_STATISTICSBEAMLETPOWER, GCF_READABLE_PROP, "") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_BoardRCUStatus) -PROPERTYCONFIG_ITEM(PROPNAME_FFI0, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FFI1, GCF_READABLE_PROP, "0") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_LFA) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_HFA) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READWRITE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FUNCTIONALITY, GCF_READABLE_PROP, "true") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_ADCStatistics) -PROPERTYCONFIG_ITEM(PROPNAME_OVERFLOW, GCF_READABLE_PROP, "false") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_MEPStatus) -PROPERTYCONFIG_ITEM(PROPNAME_SEQNR, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_ERROR, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FFI0, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_SYNCStatus) -PROPERTYCONFIG_ITEM(PROPNAME_SAMPLECOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_SYNCCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_ERRORCOUNT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_Maintenance) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_FROMTIME, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_ITEM(PROPNAME_TOTIME, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_Alert) -PROPERTYCONFIG_ITEM(PROPNAME_STATUS, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_END - -PROPERTYCONFIG_BEGIN(PROPS_Command) -PROPERTYCONFIG_ITEM(PROPNAME_COMMAND, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "") -PROPERTYCONFIG_ITEM(PROPNAME_RESULT, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "") -PROPERTYCONFIG_ITEM(PROPNAME_RESULT_CODE, GCF_READABLE_PROP | GCF_WRITABLE_PROP, "0") -PROPERTYCONFIG_END - -}; - -} // namespace LOFAR - -#endif // ARAPropertyDefines_H diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARARegisterAccessTask.cc b/MAC/APL/PIC/_RegisterAccess/src/ARARegisterAccessTask.cc deleted file mode 100644 index 3b030266cfa473ae6fe1be12c47e0cb46ff3d555..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARARegisterAccessTask.cc +++ /dev/null @@ -1,2710 +0,0 @@ -//# -//# ARARegisterAccessTask.cc: implementation of ARARegisterAccessTask class -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -// this include needs to be first! -#include <APL/RSP_Protocol/RSP_Protocol.ph> -#include <APL/RSP_Protocol/MEPHeader.h> - -#include "ARARegisterAccessTask.h" -#include "ARAConstants.h" - -#include <Common/lofar_iostream.h> -#include <Common/lofar_sstream.h> -#include <time.h> -#include <Common/lofar_string.h> -#include <Common/lofar_vector.h> -#include <Common/LofarLocators.h> - -#include <boost/date_time/posix_time/posix_time.hpp> - -#include <APS/ParameterSet.h> -#include <GCF/GCF_Defines.h> -#include <GCF/GCF_PValue.h> -#include <GCF/GCF_PVInteger.h> -#include <GCF/GCF_PVUnsigned.h> -#include <GCF/GCF_PVBool.h> -#include <GCF/GCF_PVDouble.h> -#include <GCF/GCF_PVString.h> -#include <GCF/GCF_PVDynArr.h> -#include <APL/APLCommon/APL_Defines.h> -#include "ARAPropertyDefines.h" -#include "ARAPhysicalModel.h" - -using namespace LOFAR::ACC::APS; -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; -using namespace LOFAR::EPA_Protocol; - -using namespace std; -using namespace boost::posix_time; -using namespace boost::gregorian; - - -namespace LOFAR -{ - -namespace ARA -{ -INIT_TRACER_CONTEXT(RegisterAccessTask,LOFARLOGGER_PACKAGE); - -string RegisterAccessTask::m_RSPserverName("RSPserver"); - -RegisterAccessTask::RegisterAccessTask(string name) - : GCFTask((State)&RegisterAccessTask::initial_state, name), - m_answer(), - m_myPropertySetMap(), - m_myPropsLoaded(false), - m_myPropsLoadCounter(0), - m_RSPclient(*this, m_RSPserverName, GCFPortInterface::SAP, RSP_PROTOCOL), - m_physicalModel(), - m_propertySet2RCUMap(), - m_subStatusHandle(0), - m_subStatsHandleSubbandPower(0), - m_subStatsHandleBeamletPower(0), - m_subXcStatsHandle(0), - m_n_racks(1), - m_n_subracks_per_rack(1), - m_n_boards_per_subrack(1), - m_n_aps_per_board(1), - m_n_rcus_per_ap(2), - m_n_rcus(2), - m_n_rspboards(1), - m_status_update_interval(1), - m_stats_update_interval(1), - m_centralized_stats(false), - m_integrationTime(0), - m_integrationMethod(0), - m_integratingStatisticsSubband(), - m_numStatisticsSubband(0), - m_integratingStatisticsBeamlet(), - m_numStatisticsBeamlet(0), - m_integratingXcStatistics(), - m_numXcStatistics(0), - m_integrationTimerID(0), - m_commandHandle(0), - m_pendingCommands() -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - registerProtocol(RSP_PROTOCOL, RSP_PROTOCOL_signalnames); - m_answer.setTask(this); - - try - { - ConfigLocator cl; - globalParameterSet()->adoptFile(cl.locate("RegisterAccess.conf")); - } - catch (Exception e) - { - LOG_ERROR_STR("Failed to load configuration files: " << e.text()); - exit(EXIT_FAILURE); - } - - m_status_update_interval = globalParameterSet()->getInt32(PARAM_STATUS_UPDATE_INTERVAL); - m_stats_update_interval = globalParameterSet()->getInt32(PARAM_STATISTICS_UPDATE_INTERVAL); - m_centralized_stats = (0!=globalParameterSet()->getInt32(PARAM_STATISTICS_CENTRALIZED)); - - // need port for timers. - itsTimerPort = new GCFTimerPort(*this, "TimerPort"); - -} - -RegisterAccessTask::~RegisterAccessTask() -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - -} - -// -// -// -void RegisterAccessTask::addMyPropertySet(const char* scope, - const char* type, - TPSCategory category, - const TPropertyConfig propconfig[], - GCFMyPropertySet::TDefaultUse defaultUse) -{ - boost::shared_ptr<GCFMyPropertySet> propsPtr(new GCFMyPropertySet(scope,type,category,&m_answer, defaultUse)); - m_myPropertySetMap[scope]=propsPtr; - - propsPtr->initProperties(propconfig); -} - -// -// -// -bool RegisterAccessTask::isConnected() -{ - return m_RSPclient.isConnected(); -} - -// -// -// -GCFEvent::TResult RegisterAccessTask::initial_state(GCFEvent& e, GCFPortInterface& port) -{ - LOG_DEBUG_STR("initial_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch(e.signal) { - case F_INIT: { - break; - } - - case F_ENTRY: { - if (!m_RSPclient.isConnected()) { - bool res=m_RSPclient.open(); // need this otherwise GTM_Sockethandler is not called - LOG_DEBUG(formatString("m_RSPclient.open() returned %s",(res?"true":"false"))); - if(!res) { - m_RSPclient.setTimer((long)3); - } - } - break; - } - - case F_CONNECTED: { - LOG_DEBUG(formatString("port '%s' connected", port.getName().c_str())); - if (isConnected()) { - TRAN(RegisterAccessTask::connected_state); - } - break; - } - - case F_DISCONNECTED: { - port.setTimer((long)3); // try again in 3 seconds - LOG_WARN(formatString("port '%s' disconnected, retry in 3 seconds...", port.getName().c_str())); - port.close(); - break; - } - - case F_TIMER: { - LOG_DEBUG(formatString("port '%s' retry of open...", port.getName().c_str())); - port.open(); - break; - } - - case F_EXIT: { - // cancel timers - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -// -// -// -GCFEvent::TResult RegisterAccessTask::connected_state(GCFEvent& e, GCFPortInterface& port) -{ - LOG_DEBUG_STR("connected_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) { - - case F_INIT: - break; - - case F_ENTRY: { - // get config - RSPGetconfigEvent getconfig; - m_RSPclient.send(getconfig); - - break; - } - - case F_TIMER: - { - break; - } - - case RSP_GETCONFIGACK: { - LOG_DEBUG("RSP_GETCONFIGACK received"); - RSPGetconfigackEvent ack(e); - LOG_DEBUG(formatString("n_rcus =%d",ack.n_rcus)); - LOG_DEBUG(formatString("n_rspboards =%d",ack.n_rspboards)); - LOG_DEBUG(formatString("max_rspboards =%d",ack.max_rspboards)); - - m_n_racks = globalParameterSet()->getInt32(PARAM_N_RACKS); - m_n_subracks_per_rack = globalParameterSet()->getInt32(PARAM_N_SUBRACKS_PER_RACK); - m_n_boards_per_subrack= globalParameterSet()->getInt32(PARAM_N_BOARDS_PER_SUBRACK); - m_n_aps_per_board = globalParameterSet()->getInt32(PARAM_N_APS_PER_BOARD); - m_n_rcus_per_ap = globalParameterSet()->getInt32(PARAM_N_RCUS_PER_AP); - m_n_rcus = ack.n_rcus; - m_n_rspboards = ack.n_rspboards; - if(m_n_rcus != m_n_rcus_per_ap* - m_n_aps_per_board* - m_n_boards_per_subrack* - m_n_subracks_per_rack* - m_n_racks) { - LOG_ERROR(formatString("Number of rcus (%d) differs from calculated number",m_n_rcus)); - LOG_DEBUG_STR("rcus/AP :" << m_n_rcus_per_ap); - LOG_DEBUG_STR("APs/board :" << m_n_aps_per_board); - LOG_DEBUG_STR("boards/subrack:" << m_n_boards_per_subrack); - LOG_DEBUG_STR("subrack/rack :" << m_n_subracks_per_rack); - LOG_DEBUG_STR("racks :" << m_n_racks); - LOG_DEBUG_STR("total :" << m_n_rcus_per_ap * m_n_aps_per_board * - m_n_boards_per_subrack * m_n_subracks_per_rack * m_n_racks); - } - - char scopeString[300]; - int rack(-1); - int subrack(-1); - int board(0); - for (board = 0; board < m_n_rspboards; board++) { - // new rack? - if (board % (m_n_boards_per_subrack * m_n_subracks_per_rack) == 0) { - rack++; - sprintf(scopeString, SCOPE_PIC_RackN, rack); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Rack, PSCAT_LCU_PIC_Rack, PROPS_Rack); - } - - // new subrack? - if (board % m_n_boards_per_subrack == 0) { - subrack++; - sprintf(scopeString, SCOPE_PIC_RackN_SubRackN, rack, subrack); - addMyPropertySet(scopeString, TYPE_LCU_PIC_SubRack, PSCAT_LCU_PIC_SubRack, PROPS_SubRack); - } - - // alloc board - sprintf(scopeString, SCOPE_PIC_RackN_SubRackN_BoardN, rack, subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Board, PSCAT_LCU_PIC_Board, PROPS_Board); - } - -/* - // fill MyPropertySets map - addMyPropertySet(SCOPE_PIC, TYPE_LCU_PIC, PSCAT_LCU_PIC, PROPS_Station, GCFMyPropertySet::USE_DB_DEFAULTS); - addMyPropertySet(SCOPE_PIC_Maintenance, TYPE_LCU_PIC_Maintenance, PSCAT_LCU_PIC_Maintenance, PROPS_Maintenance); - addMyPropertySet(SCOPE_PIC_Command, TYPE_LCU_PIC_Command, PSCAT_LCU_PIC_Command, PROPS_Command); - for(rack=0;rack<m_n_racks;rack++) { - sprintf(scopeString,SCOPE_PIC_RackN,rack); - addMyPropertySet(scopeString,TYPE_LCU_PIC_Rack, PSCAT_LCU_PIC_Rack, PROPS_Rack); - sprintf(scopeString,SCOPE_PIC_RackN_Maintenance,rack); - addMyPropertySet(scopeString,TYPE_LCU_PIC_Maintenance, PSCAT_LCU_PIC_Maintenance, PROPS_Maintenance); - sprintf(scopeString,SCOPE_PIC_RackN_Alert,rack); - addMyPropertySet(scopeString,TYPE_LCU_PIC_Alert, PSCAT_LCU_PIC_Alert, PROPS_Alert); - - for(subrack=0;subrack<m_n_subracks_per_rack;subrack++) { - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN,rack,subrack); - addMyPropertySet(scopeString, TYPE_LCU_PIC_SubRack, PSCAT_LCU_PIC_SubRack, PROPS_SubRack); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_Maintenance,rack,subrack); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Maintenance, PSCAT_LCU_PIC_Maintenance, PROPS_Maintenance); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_Alert,rack,subrack); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Alert, PSCAT_LCU_PIC_Alert, PROPS_Alert); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_Command,rack,subrack); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Command, PSCAT_LCU_PIC_Command, PROPS_Command); - - for(board=0;board<m_n_boards_per_subrack;board++) { - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN,rack,subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Board, PSCAT_LCU_PIC_Board, PROPS_Board); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_MEPStatus,rack,subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_MEPStatus, PSCAT_LCU_PIC_MEPStatus, PROPS_MEPStatus); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_Maintenance,rack,subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Maintenance, PSCAT_LCU_PIC_Maintenance, PROPS_Maintenance); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_Alert,rack,subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Alert, PSCAT_LCU_PIC_Alert, PROPS_Alert); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_Command,rack,subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Command, PSCAT_LCU_PIC_Command, PROPS_Command); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_ETH,rack,subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Ethernet, PSCAT_LCU_PIC_Ethernet, PROPS_Ethernet); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_BP,rack,subrack,board); - addMyPropertySet(scopeString, TYPE_LCU_PIC_FPGA, PSCAT_LCU_PIC_FPGA, PROPS_FPGA); - - for(ap=0;ap<m_n_aps_per_board;ap++) - { - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rack,subrack,board,ap); - addMyPropertySet(scopeString, TYPE_LCU_PIC_FPGA, PSCAT_LCU_PIC_FPGA, PROPS_FPGA); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_SYNCStatus,rack,subrack,board,ap); - addMyPropertySet(scopeString, TYPE_LCU_PIC_SYNCStatus, PSCAT_LCU_PIC_SYNCStatus, PROPS_SYNCStatus); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_BoardRCUStatus,rack,subrack,board,ap); - addMyPropertySet(scopeString, TYPE_LCU_PIC_BoardRCUStatus, PSCAT_LCU_PIC_BoardRCUStatus, PROPS_BoardRCUStatus); - for(rcu=0;rcu<m_n_rcus_per_ap;rcu++) - { - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_RCU, PSCAT_LCU_PIC_RCU, PROPS_RCU); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_Command,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Command, PSCAT_LCU_PIC_Command, PROPS_Command); - - m_propertySet2RCUMap[string(scopeString)] = globalRcuNr++; - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_ADCStatistics,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_ADCStatistics, PSCAT_LCU_PIC_ADCStatistics, PROPS_ADCStatistics); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_Maintenance,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Maintenance, PSCAT_LCU_PIC_Maintenance, PROPS_Maintenance); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_LFA,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_LFA, PSCAT_LCU_PIC_LFA, PROPS_LFA); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_HFA, PSCAT_LCU_PIC_HFA, PROPS_HFA); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_LFA_Maintenance,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Maintenance, PSCAT_LCU_PIC_Maintenance, PROPS_Maintenance); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA_Maintenance,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Maintenance, PSCAT_LCU_PIC_Maintenance, PROPS_Maintenance); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA_Command,rack,subrack,board,ap,rcu); - addMyPropertySet(scopeString, TYPE_LCU_PIC_Command, PSCAT_LCU_PIC_Command, PROPS_Command); - } - } - } - } -*/ - - TRAN(RegisterAccessTask::enablingMyPropsets_state); -// } - break; - } - - case F_DISCONNECTED: - { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_EXIT: - { - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -// -// -// -GCFEvent::TResult RegisterAccessTask::enablingMyPropsets_state(GCFEvent& e, GCFPortInterface& port) -{ - static TMyPropertySetMap::iterator propIter; - - LOG_DEBUG_STR("enablingMyPropsets_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch(e.signal) { - case F_INIT: { - break; - } - - case F_ENTRY: { - LOG_DEBUG("Enabling MyPropertySets..."); - m_myPropsLoadCounter=0; - propIter = m_myPropertySetMap.begin(); - if (propIter != m_myPropertySetMap.end()) { - propIter->second->enable(); - } - break; - } - - case F_MYPS_ENABLED: { - GCFPropSetAnswerEvent* pPropAnswer = static_cast<GCFPropSetAnswerEvent*>(&e); - assert(pPropAnswer); - if (pPropAnswer->result != 0) { - LOG_WARN(formatString("MyPropset %s could not be enabled: %d",pPropAnswer->pScope,pPropAnswer->result)); - } - m_myPropsLoadCounter++; - LOG_DEBUG(formatString("MyPropset %d enabled", m_myPropsLoadCounter)); - if(m_myPropsLoadCounter == m_myPropertySetMap.size()) { - m_myPropsLoaded=true; - TRAN(RegisterAccessTask::getVersion_state); - } - else { - propIter++; - if (propIter != m_myPropertySetMap.end()) { - propIter->second->enable(); - } - } - break; - } - - case F_VGETRESP: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - case F_VCHANGEMSG: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - - case F_DISCONNECTED: { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_EXIT: { - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - return status; -} - - -GCFEvent::TResult RegisterAccessTask::getVersion_state(GCFEvent& e, GCFPortInterface& port) -{ - LOG_DEBUG_STR("getVersion_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) { - case F_INIT: - break; - -// case F_TIMER: { - case F_ENTRY: { - LOG_DEBUG_STR("Setting timer to give subscription some time"); - itsTimerPort->setTimer(10.0); - break; - } - -// case F_ENTRY: { - case F_TIMER: { - // get versions - RSPGetversionEvent getversion; - getversion.timestamp.setNow(); - getversion.cache = true; - m_RSPclient.send(getversion); - break; - } - - case RSP_GETVERSIONACK: { - LOG_DEBUG("RSP_GETVERSIONACK received"); - RSPGetversionackEvent ack(e); - - if(ack.status != SUCCESS) { - LOG_ERROR("RSP_GETVERSION failure"); - } - else { - char scopeString[300]; - char version[20]; - int board = 0; - int rackNr; - int subRackNr; - int relativeBoardNr; - for (board = 0; board < m_n_rspboards; board++) { - getBoardRelativeNumbers(board,rackNr,subRackNr,relativeBoardNr); - sprintf(version,"%d.%d",ack.versions.bp()(board).rsp_version >> 4,ack.versions.bp()(board).rsp_version & 0xF); - LOG_DEBUG(formatString("board[%d].version = 0x%x",board,ack.versions.bp()(board).rsp_version)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN,rackNr,subRackNr,relativeBoardNr); - updateVersion(scopeString,string(version),double(ack.timestamp)); - - sprintf(version,"%d.%d",ack.versions.bp()(board).fpga_maj,ack.versions.bp()(board).fpga_min); - LOG_DEBUG(formatString("bp[%d].version = %s",board, version)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_BP,rackNr,subRackNr,relativeBoardNr); - updateVersion(scopeString,string(version),double(ack.timestamp)); - - for (int ap = 0; ap < MEPHeader::N_AP; ap++) { - sprintf(version,"%d.%d",ack.versions.ap()(board * MEPHeader::N_AP + ap).fpga_maj, - ack.versions.ap()(board * MEPHeader::N_AP + ap).fpga_min); - LOG_DEBUG(formatString("ap[%d][%d].version = %s",board,ap,version)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rackNr,subRackNr,relativeBoardNr,ap); - updateVersion(scopeString,string(version),double(ack.timestamp)); - } - } - } - - TRAN(RegisterAccessTask::subscribingStatus_state); - break; - } - - case F_VGETRESP: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - - case F_VCHANGEMSG: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - - case F_DISCONNECTED: { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_EXIT: { - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult RegisterAccessTask::subscribingStatus_state(GCFEvent& e, GCFPortInterface &port) -{ - LOG_DEBUG_STR("subscribingStatus_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) { - case F_INIT: - break; - - case F_ENTRY: { - // subscribe to status updates - RSPSubstatusEvent substatus; - substatus.timestamp.setNow(); - substatus.rspmask = std::bitset<MAX_N_RSPBOARDS>((1<<m_n_rspboards)-1); - substatus.period = m_status_update_interval; - m_RSPclient.send(substatus); - - break; - } - - case RSP_SUBSTATUSACK: { - LOG_DEBUG("RSP_SUBSTATUSACK received"); - RSPSubstatusackEvent ack(e); - - if(ack.status != SUCCESS) { - LOG_ERROR("RSP_SUBSTATUS failure"); - } - else { - m_subStatusHandle = ack.handle; - } - - TRAN(RegisterAccessTask::subscribingStatsSubbandPower_state); - - break; - } - - case RSP_UPDSTATUS: - { - // handle updstatus events even though we are not subscribed to them yet - // this is done to relax the requirements for the ARAtest application - // (or you might call it lazyness) - LOG_DEBUG("RSP_UPDSTATUS received"); - status = handleUpdStatus(e,port); - break; - } - - case F_VGETRESP: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - case F_VCHANGEMSG: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - - case F_DISCONNECTED: { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_EXIT: { - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - - -GCFEvent::TResult RegisterAccessTask::subscribingStatsSubbandPower_state(GCFEvent& e, GCFPortInterface &port) -{ - LOG_DEBUG_STR("subscribingStatsSubbandPower_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) { - - case F_INIT: - break; - - case F_ENTRY: { - // subscribe to status updates - RSPSubstatsEvent substats; - substats.timestamp.setNow(); - substats.rcumask = std::bitset<MEPHeader::MAX_N_RCUS>((1<<m_n_rcus)-1); - substats.period = m_stats_update_interval; - substats.type = RSP_Protocol::Statistics::SUBBAND_POWER; - substats.reduction = RSP_Protocol::REPLACE; - m_RSPclient.send(substats); - - break; - } - - case RSP_SUBSTATSACK: { - LOG_DEBUG("RSP_SUBSTATSACK received"); - RSPSubstatsackEvent ack(e); - - if(ack.status != SUCCESS) { - LOG_ERROR("RSP_SUBSTATS failure"); - } - else { - m_subStatsHandleSubbandPower = ack.handle; - } - - TRAN(RegisterAccessTask::subscribingStatsBeamletPower_state); - break; - } - - case F_VGETRESP: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - case F_VCHANGEMSG: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - - case F_DISCONNECTED: { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_EXIT: { - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult RegisterAccessTask::subscribingStatsBeamletPower_state(GCFEvent& e, GCFPortInterface &port) -{ - LOG_DEBUG_STR("subscribingStatsBeamletPower_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) { - - case F_INIT: - break; - - case F_ENTRY: { - // subscribe to status updates - RSPSubstatsEvent substats; - substats.timestamp.setNow(); - substats.rcumask = std::bitset<MEPHeader::MAX_N_RCUS>((1<<m_n_rcus)-1); - substats.period = m_stats_update_interval; - substats.type = RSP_Protocol::Statistics::BEAMLET_POWER; - substats.reduction = RSP_Protocol::REPLACE; - m_RSPclient.send(substats); - - break; - } - - case RSP_SUBSTATSACK: { - LOG_DEBUG("RSP_SUBSTATSACK received"); - RSPSubstatsackEvent ack(e); - - if(ack.status != SUCCESS) { - LOG_ERROR("RSP_SUBSTATS failure"); - } - else { - m_subStatsHandleBeamletPower = ack.handle; - } - - TRAN(RegisterAccessTask::subscribingXcStats_state); - break; - } - - case F_VGETRESP: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - case F_VCHANGEMSG: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - - case F_DISCONNECTED: { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_EXIT: { - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult RegisterAccessTask::subscribingXcStats_state(GCFEvent& e, GCFPortInterface &port) -{ - LOG_DEBUG_STR("subscribingXcStats_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) { - - case F_INIT: - break; - - case F_ENTRY: { - // subscribe to xc stats updates - RSPSubxcstatsEvent substats; - substats.timestamp.setNow(); -// substats.rcumask = std::bitset<MEPHeader::MAX_N_RCUS>((1<<m_n_rcus)-1); - substats.period = m_stats_update_interval; - m_RSPclient.send(substats); - - break; - } - - case RSP_SUBXCSTATSACK: { - LOG_DEBUG("RSP_SUBXCSTATSACK received"); - RSPSubxcstatsackEvent ack(e); - - if(ack.status != SUCCESS) { - LOG_ERROR("RSP_SUBXCSTATS failure"); - } - else { - m_subXcStatsHandle = ack.handle; - } - - TRAN(RegisterAccessTask::operational_state); - break; - } - - case F_VGETRESP: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - case F_VCHANGEMSG: { - GCFPropValueEvent* pPropAnswer=static_cast<GCFPropValueEvent*>(&e); - - if(strstr(pPropAnswer->pPropName,"Maintenance.status") != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, "status") != 0) { - LOG_DEBUG("status property changed"); - - _refreshFunctionality(); - } - break; - } - - case F_DISCONNECTED: { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_EXIT: { - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult RegisterAccessTask::operational_state(GCFEvent& e, GCFPortInterface& port) -{ - LOG_DEBUG_STR("operational_state:" << evtstr(e) << "@" << port.getName()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (e.signal) { - - case F_INIT: - break; - - case F_ENTRY: { - TMyPropertySetMap::iterator propsetIt = m_myPropertySetMap.find(SCOPE_PIC); - if(propsetIt != m_myPropertySetMap.end()) { - boost::shared_ptr<GCFPVInteger> pvIntegrationTime(static_cast<GCFPVInteger*>(propsetIt->second->getValue(PROPNAME_INTEGRATIONTIME))); - if(pvIntegrationTime != 0) { - m_integrationTime = pvIntegrationTime->getValue(); - if(m_integrationTime > 0) { - m_integrationTimerID = m_RSPclient.setTimer(static_cast<double>(m_integrationTime)); - } - } - boost::shared_ptr<GCFPVInteger> pvIntegrationMethod(static_cast<GCFPVInteger*>(propsetIt->second->getValue(PROPNAME_INTEGRATIONMETHOD))); - if(pvIntegrationMethod != 0) { - m_integrationMethod = pvIntegrationMethod->getValue(); - } - } - - break; - } - - case RSP_UPDSTATUS: { - LOG_DEBUG("RSP_UPDSTATUS received"); - status = handleUpdStatus(e,port); - break; - } - - case RSP_UPDSTATS: { - LOG_DEBUG("RSP_UPDSTATS received"); - status = handleUpdStats(e,port); - break; - } - - case RSP_UPDXCSTATS: { - LOG_DEBUG("RSP_UPDXCSTATS received"); - status = handleUpdXcStats(e,port); - break; - } - - case RSP_SETRCUACK: { - LOG_DEBUG("RSP_SETRCUACK received"); - break; - } - -//TODO case RSP_COMMANDRESULT: -//TODO { -//TODO LOG_DEBUG("RSP_COMMANDRESULT received"); -//TODO handleCommandResult(e); -//TODO break; -//TODO } - - case F_DISCONNECTED: { - LOG_DEBUG(formatString("port %s disconnected", port.getName().c_str())); - port.close(); - - TRAN(RegisterAccessTask::initial_state); - break; - } - - case F_VCHANGEMSG: { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&e); - assert(pPropAnswer); - - if(strstr(pPropAnswer->pPropName,"Maintenance."PROPNAME_STATUS) != 0) { - handleMaintenance(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,"Command."PROPNAME_COMMAND) != 0) { - handleCommand(string(pPropAnswer->pPropName),*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName, PROPNAME_STATUS) != 0) { - _refreshFunctionality(); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_LBAENABLE) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_LBAENABLE,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_HBAENABLE) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_HBAENABLE,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_BANDSEL) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_BANDSEL,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_FILSEL0) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_FILSEL0,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_FILSEL1) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_FILSEL1,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_VLENABLE) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_VLENABLE,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_VHENABLE) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_VHENABLE,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_VDDVCCEN) != 0) { - handleRCUSettings(string(pPropAnswer->pPropName),BIT_VDDVCCEN,*pPropAnswer->pValue); - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_INTEGRATIONTIME) != 0) { - GCFPVInteger pvInt; - pvInt.copy(*pPropAnswer->pValue); - m_integrationTime = pvInt.getValue(); - LOG_INFO(formatString("integration time changed to %d",m_integrationTime)); - - m_RSPclient.cancelTimer(m_integrationTimerID); - - if(m_integrationTime == 0) { - m_integratingStatisticsSubband.free(); - m_numStatisticsSubband=0; - m_integratingStatisticsBeamlet.free(); - m_numStatisticsBeamlet=0; - } - else { - m_integratingStatisticsSubband.free(); - m_numStatisticsSubband=0; - m_integratingStatisticsBeamlet.free(); - m_numStatisticsBeamlet=0; - m_integrationTimerID = m_RSPclient.setTimer(static_cast<double>(m_integrationTime)); - } - } - else if(strstr(pPropAnswer->pPropName,PROPNAME_INTEGRATIONMETHOD) != 0) { - GCFPVInteger pvInt; - pvInt.copy(*pPropAnswer->pValue); - m_integrationMethod = pvInt.getValue(); - LOG_INFO(formatString("integration method changed to %d",m_integrationMethod)); - } - break; - } - - case F_TIMER: { - GCFTimerEvent& timerEvent=static_cast<GCFTimerEvent&>(e); - if(timerEvent.id == m_integrationTimerID) { - _integrateStatistics(); - m_integrationTimerID = m_RSPclient.setTimer(static_cast<double>(m_integrationTime)); - } - break; - } - - case F_EXIT: { - m_RSPclient.cancelTimer(m_integrationTimerID); - - // unsubscribe from status updates - RSPUnsubstatusEvent unsubStatus; - unsubStatus.handle = m_subStatusHandle; // remove subscription with this handle - m_RSPclient.send(unsubStatus); - - // unsubscribe from status updates - RSPUnsubstatsEvent unsubStats; - unsubStats.handle = m_subStatsHandleSubbandPower; // remove subscription with this handle - m_RSPclient.send(unsubStats); - unsubStats.handle = m_subStatsHandleBeamletPower; // remove subscription with this handle - m_RSPclient.send(unsubStats); - RSPUnsubxcstatsEvent unsubXcStats; - unsubXcStats.handle = m_subXcStatsHandle; // remove subscription with this handle - m_RSPclient.send(unsubXcStats); - break; - } - - default: - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult RegisterAccessTask::handleUpdStatus(GCFEvent& e, GCFPortInterface& /*port*/) -{ - LOG_DEBUG_STR("handleUpdStatus:" << evtstr(e)); - - GCFEvent::TResult status = GCFEvent::HANDLED; - { - RSPUpdstatusEvent updStatusEvent(e); - - time_t curTime=(time_t)updStatusEvent.timestamp.sec(); - LOG_DEBUG(formatString("UpdStatus:time:%s:status:%d:handle:%d", - ctime(&curTime), - updStatusEvent.status, - updStatusEvent.handle)); - - blitz::Array<EPA_Protocol::BoardStatus, 1>& boardStatus = updStatusEvent.sysstatus.board(); - - int rackNr; - int subRackNr; - int relativeBoardNr; - char scopeString[300]; - double timestamp = double(updStatusEvent.timestamp); - - int boardNr; - for(boardNr=boardStatus.lbound(blitz::firstDim); boardNr <= boardStatus.ubound(blitz::firstDim); ++boardNr) { - getBoardRelativeNumbers(boardNr,rackNr,subRackNr,relativeBoardNr); - LOG_DEBUG(formatString("UpdStatus:Rack:%d:SubRack:%d:Board::%d\n",rackNr,subRackNr,relativeBoardNr)); - - uint8 rspVoltage_1_2 = boardStatus(boardNr).rsp.voltage_1_2; - uint8 rspVoltage_2_5 = boardStatus(boardNr).rsp.voltage_2_5; - uint8 rspVoltage_3_3 = boardStatus(boardNr).rsp.voltage_3_3; - LOG_DEBUG(formatString("UpdStatus:RSP voltage_1_2:%d:voltage_2_5:%d:voltage_3_3:%d",rspVoltage_1_2,rspVoltage_2_5,rspVoltage_3_3)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN,rackNr,subRackNr,relativeBoardNr); - updateBoardProperties(scopeString,rspVoltage_1_2,rspVoltage_2_5,rspVoltage_3_3,timestamp); - - uint8 pcbTemp = boardStatus(boardNr).rsp.pcb_temp; - uint8 bpTemp = boardStatus(boardNr).rsp.bp_temp; - uint8 ap0Temp = boardStatus(boardNr).rsp.ap0_temp; - uint8 ap1Temp = boardStatus(boardNr).rsp.ap1_temp; - uint8 ap2Temp = boardStatus(boardNr).rsp.ap2_temp; - uint8 ap3Temp = boardStatus(boardNr).rsp.ap3_temp; - uint8 bpClock = boardStatus(boardNr).rsp.bp_clock; - LOG_DEBUG(formatString("UpdStatus:PCB temp:%d",pcbTemp)); - LOG_DEBUG(formatString("UpdStatus:BP temp:%d",bpTemp)); - LOG_DEBUG(formatString("UpdStatus:AP0 temp:%d",ap0Temp)); - LOG_DEBUG(formatString("UpdStatus:AP1 temp:%d",ap1Temp)); - LOG_DEBUG(formatString("UpdStatus:AP2 temp:%d",ap2Temp)); - LOG_DEBUG(formatString("UpdStatus:AP3 temp:%d",ap3Temp)); - LOG_DEBUG(formatString("UpdStatus:BP clock:%d",bpClock)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN,rackNr,subRackNr,relativeBoardNr); - updateFPGAboardProperties(scopeString,timestamp); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_BP,rackNr,subRackNr,relativeBoardNr); - updateFPGAproperties(scopeString,bpTemp,timestamp); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rackNr,subRackNr,relativeBoardNr,0); - updateFPGAproperties(scopeString,ap0Temp,timestamp); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rackNr,subRackNr,relativeBoardNr,1); - updateFPGAproperties(scopeString,ap1Temp,timestamp); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rackNr,subRackNr,relativeBoardNr,2); - updateFPGAproperties(scopeString,ap2Temp,timestamp); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rackNr,subRackNr,relativeBoardNr,3); - updateFPGAproperties(scopeString,ap3Temp,timestamp); - - uint32 ethFrames = boardStatus(boardNr).eth.nof_frames; - uint32 ethErrors = boardStatus(boardNr).eth.nof_errors; - uint8 ethLastError = boardStatus(boardNr).eth.last_error; - uint8 ethFfi0 = boardStatus(boardNr).eth.ffi0; - uint8 ethFfi1 = boardStatus(boardNr).eth.ffi1; - uint8 ethFfi2 = boardStatus(boardNr).eth.ffi2; - LOG_DEBUG(formatString("UpdStatus:ETH frames:%d:errors:%d:last_error:%d:ffi0:%d:ffi1:%d:ffi2:%d",ethFrames,ethErrors,ethLastError,ethFfi0,ethFfi1,ethFfi2)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_ETH,rackNr,subRackNr,relativeBoardNr); - updateETHproperties(scopeString,ethFrames,ethErrors,ethLastError,ethFfi0,ethFfi1,ethFfi2,timestamp); - - uint32 mepSeqnr = boardStatus(boardNr).mep.seqnr; - uint8 mepError = boardStatus(boardNr).mep.error; - uint8 mepFfi0 = boardStatus(boardNr).mep.ffi0; - LOG_DEBUG(formatString("UpdStatus:MEP seqnr:%d:error:%d:ffi:%d",mepSeqnr,mepError,mepFfi0)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_MEPStatus,rackNr,subRackNr,relativeBoardNr); - updateMEPStatusProperties(scopeString,mepSeqnr,mepError,mepFfi0,timestamp); - - uint32 syncSample_offset = boardStatus(boardNr).ap0_sync.sample_offset; - uint32 syncSync_count = boardStatus(boardNr).ap0_sync.sync_count; - uint32 syncSlice_count = boardStatus(boardNr).ap0_sync.slice_count; - LOG_DEBUG(formatString("SyncStatus ap0:sample_offset:%d:sync_count:%d:slice_count:%d",syncSample_offset,syncSync_count,syncSlice_count)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_SYNCStatus,rackNr,subRackNr,relativeBoardNr,0); - updateSYNCStatusProperties(scopeString,syncSample_offset,syncSync_count,syncSlice_count,timestamp); - - syncSample_offset = boardStatus(boardNr).ap1_sync.sample_offset; - syncSync_count = boardStatus(boardNr).ap1_sync.sync_count; - syncSlice_count = boardStatus(boardNr).ap1_sync.slice_count; - LOG_DEBUG(formatString("SyncStatus ap1:sample_offset:%d:sync_count:%d:slice_count:%d",syncSample_offset,syncSync_count,syncSlice_count)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_SYNCStatus,rackNr,subRackNr,relativeBoardNr,1); - updateSYNCStatusProperties(scopeString,syncSample_offset,syncSync_count,syncSlice_count,timestamp); - - syncSample_offset = boardStatus(boardNr).ap2_sync.sample_offset; - syncSync_count = boardStatus(boardNr).ap2_sync.sync_count; - syncSlice_count = boardStatus(boardNr).ap2_sync.slice_count; - LOG_DEBUG(formatString("SyncStatus ap2:sample_offset:%d:sync_count:%d:slice_count:%d",syncSample_offset,syncSync_count,syncSlice_count)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_SYNCStatus,rackNr,subRackNr,relativeBoardNr,2); - updateSYNCStatusProperties(scopeString,syncSample_offset,syncSync_count,syncSlice_count,timestamp); - - syncSample_offset = boardStatus(boardNr).ap3_sync.sample_offset; - syncSync_count = boardStatus(boardNr).ap3_sync.sync_count; - syncSlice_count = boardStatus(boardNr).ap3_sync.slice_count; - LOG_DEBUG(formatString("SyncStatus ap3:sample_offset:%d:sync_count:%d:slice_count:%d",syncSample_offset,syncSync_count,syncSlice_count)); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_SYNCStatus,rackNr,subRackNr,relativeBoardNr,3); - updateSYNCStatusProperties(scopeString,syncSample_offset,syncSync_count,syncSlice_count,timestamp); - - int apNr=0; - uint8 boardRCUstatusStatusX = boardStatus(boardNr).blp0_rcu.pllx; - uint8 boardRCUstatusStatusY = boardStatus(boardNr).blp0_rcu.plly; - uint32 boardRCUstatusNofOverflowX = boardStatus(boardNr).blp0_rcu.nof_overflowx; - uint32 boardRCUstatusNofOverflowY = boardStatus(boardNr).blp0_rcu.nof_overflowy; - LOG_DEBUG(formatString("BoardRCUStatus ap0:statusX:%d:statusY:%d:nofOverflowX:%d:nofOverflowY:%d",boardRCUstatusStatusX,boardRCUstatusStatusY,boardRCUstatusNofOverflowX,boardRCUstatusNofOverflowY)); - int rcuNr=0; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusX,boardRCUstatusNofOverflowX,timestamp); - rcuNr++; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusY,boardRCUstatusNofOverflowY,timestamp); - - apNr++; - boardRCUstatusStatusX = boardStatus(boardNr).blp1_rcu.pllx; - boardRCUstatusStatusY = boardStatus(boardNr).blp1_rcu.plly; - boardRCUstatusNofOverflowX = boardStatus(boardNr).blp1_rcu.nof_overflowx; - boardRCUstatusNofOverflowY = boardStatus(boardNr).blp1_rcu.nof_overflowy; - LOG_DEBUG(formatString("BoardRCUStatus ap0:statusX:%d:statusY:%d:nofOverflowX:%d:nofOverflowY:%d",boardRCUstatusStatusX,boardRCUstatusStatusY,boardRCUstatusNofOverflowX,boardRCUstatusNofOverflowY)); - rcuNr=0; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusX,boardRCUstatusNofOverflowX,timestamp); - rcuNr++; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusY,boardRCUstatusNofOverflowY,timestamp); - - apNr++; - boardRCUstatusStatusX = boardStatus(boardNr).blp2_rcu.pllx; - boardRCUstatusStatusY = boardStatus(boardNr).blp2_rcu.plly; - boardRCUstatusNofOverflowX = boardStatus(boardNr).blp2_rcu.nof_overflowx; - boardRCUstatusNofOverflowY = boardStatus(boardNr).blp2_rcu.nof_overflowy; - LOG_DEBUG(formatString("BoardRCUStatus ap0:statusX:%d:statusY:%d:nofOverflowX:%d:nofOverflowY:%d",boardRCUstatusStatusX,boardRCUstatusStatusY,boardRCUstatusNofOverflowX,boardRCUstatusNofOverflowY)); - rcuNr=0; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusX,boardRCUstatusNofOverflowX,timestamp); - rcuNr++; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusY,boardRCUstatusNofOverflowY,timestamp); - - apNr++; - boardRCUstatusStatusX = boardStatus(boardNr).blp3_rcu.pllx; - boardRCUstatusStatusY = boardStatus(boardNr).blp3_rcu.plly; - boardRCUstatusNofOverflowX = boardStatus(boardNr).blp3_rcu.nof_overflowx; - boardRCUstatusNofOverflowY = boardStatus(boardNr).blp3_rcu.nof_overflowy; - LOG_DEBUG(formatString("BoardRCUStatus ap0:statusX:%d:statusY:%d:nofOverflowX:%d:nofOverflowY:%d",boardRCUstatusStatusX,boardRCUstatusStatusY,boardRCUstatusNofOverflowX,boardRCUstatusNofOverflowY)); - rcuNr=0; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusX,boardRCUstatusNofOverflowX,timestamp); - rcuNr++; - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackNr,subRackNr,relativeBoardNr,apNr,rcuNr); - updateBoardRCUproperties(scopeString,boardRCUstatusStatusY,boardRCUstatusNofOverflowY,timestamp); - } - } - - return status; -} - -GCFEvent::TResult RegisterAccessTask::handleUpdStats(GCFEvent& e, GCFPortInterface& /*port*/) -{ - LOG_DEBUG_STR("handleUpdStats:" << evtstr(e)); - - GCFEvent::TResult status = GCFEvent::HANDLED; - { - RSPUpdstatsEvent updStatsEvent(e); - - time_t curTime=(time_t)updStatsEvent.timestamp.sec(); - LOG_DEBUG(formatString("UpdStats:time:%s:status:%d:handle:%d", - ctime(&curTime), - updStatsEvent.status, - updStatsEvent.handle)); - - _addStatistics(updStatsEvent.stats(), updStatsEvent.handle); - } - return status; -} - -GCFEvent::TResult RegisterAccessTask::handleUpdXcStats(GCFEvent& e, GCFPortInterface& /*port*/) -{ - LOG_DEBUG_STR("handleUpdXcStats:" << evtstr(e)); - - GCFEvent::TResult status = GCFEvent::HANDLED; - { - RSPUpdxcstatsEvent updXcStatsEvent(e); - - time_t curTime=(time_t)updXcStatsEvent.timestamp.sec(); - LOG_DEBUG(formatString("UpdXcStats:time:%s:status:%d:handle:%d", - ctime(&curTime), - updXcStatsEvent.status, - updXcStatsEvent.handle)); - - _addXcStatistics(updXcStatsEvent.stats(), updXcStatsEvent.handle); - } - return status; -} - -void RegisterAccessTask::updateBoardProperties(string scope, - uint8 voltage_1_2, - uint8 voltage_2_5, - uint8 voltage_3_3, - double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - double v12 = static_cast<double>(voltage_1_2) * (2.5/192.0); - GCFPVDouble pvDouble12(v12); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_VOLTAGE12),pvDouble12,timestamp); - - double v25 = static_cast<double>(voltage_2_5) * (3.3/192.0); - GCFPVDouble pvDouble25(v25); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_VOLTAGE25),pvDouble25,timestamp); - - double v33 = static_cast<double>(voltage_3_3) * (5.0/192.0); - GCFPVDouble pvDouble33(v33); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_VOLTAGE33),pvDouble33, timestamp); - } -} - -void RegisterAccessTask::updateETHproperties(string scope, - uint32 frames, - uint32 errors, - uint8 lastError, - uint8 ffi0, - uint8 ffi1, - uint8 ffi2, - double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - // layout eth status: - // 31......24 23.....16 15........8 7........0 - // #RX[15..8] #RX[7..0] #Err[15..8] #Err[7..0] - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - GCFPVUnsigned pvTemp(frames); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FRAMESRECEIVED),pvTemp, timestamp); - - pvTemp.setValue(errors); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FRAMESERROR),pvTemp, timestamp); - - pvTemp.setValue(lastError); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_LASTERROR),pvTemp, timestamp); - - pvTemp.setValue(ffi0); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FFI0),pvTemp, timestamp); - - pvTemp.setValue(ffi1); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FFI1),pvTemp, timestamp); - - pvTemp.setValue(ffi2); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FFI2),pvTemp, timestamp); - } -} - -/** - * update MEP status properties - */ -void RegisterAccessTask::updateMEPStatusProperties(string scope,uint32 seqnr, - uint8 error, - uint8 ffi0, - double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - GCFPVUnsigned pvTemp(seqnr); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_SEQNR),pvTemp, timestamp); - - pvTemp.setValue(error); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_ERROR),pvTemp, timestamp); - - pvTemp.setValue(ffi0); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FFI0),pvTemp, timestamp); - } -} - -void RegisterAccessTask::updateSYNCStatusProperties(string scope,uint32 sample_count, - uint32 sync_count, - uint32 error_count, - double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - GCFPVUnsigned pvTemp(sample_count); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_SAMPLECOUNT),pvTemp, timestamp); - - pvTemp.setValue(sync_count); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_SYNCCOUNT),pvTemp, timestamp); - - pvTemp.setValue(error_count); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_ERRORCOUNT),pvTemp, timestamp); - } -} - -void RegisterAccessTask::updateFPGAboardProperties(string scope, double /*timestamp*/) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } -} - -void RegisterAccessTask::updateFPGAproperties(string scope, uint8 temp, - double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - GCFPVDouble pvDouble(static_cast<double>(temp)); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_TEMPERATURE),pvDouble, timestamp); - } -} - -void RegisterAccessTask::updateBoardRCUproperties(string scope,uint8 ffi0, - uint8 ffi1, - double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - GCFPVUnsigned pvUns(ffi0); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FFI0),pvUns, timestamp); - pvUns.setValue(ffi1); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FFI1),pvUns, timestamp); - } -} - -void RegisterAccessTask::updateRCUproperties(string scope,uint8 status, double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - // layout rcu status (for both statusX and statusY): - // 7 6 5 4 3 2 1 0 - // VDDVCCEN VHENABLE VLENABLE FILSEL1 FILSEL0 BANDSEL HBAENABLE LBAENABLE - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - unsigned int tempStatus = (status >> 7 ) & 0x01; - GCFPVBool pvBoolVddVccEn(tempStatus); - if(pvBoolVddVccEn.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_VDDVCCEN)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_VDDVCCEN),pvBoolVddVccEn, timestamp); - } - - tempStatus = (status >> 6) & 0x01; - GCFPVBool pvBoolVhEnable(tempStatus); - if(pvBoolVhEnable.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_VHENABLE)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_VHENABLE),pvBoolVhEnable, timestamp); - } - - tempStatus = (status >> 5) & 0x01; - GCFPVBool pvBoolVlEnable(tempStatus); - if(pvBoolVlEnable.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_VLENABLE)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_VLENABLE),pvBoolVlEnable, timestamp); - } - - tempStatus = (status >> 4) & 0x01; - GCFPVBool pvBoolFilSel1(tempStatus); - if(pvBoolFilSel1.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_FILSEL1)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FILSEL1),pvBoolFilSel1, timestamp); - } - - tempStatus = (status >> 3) & 0x01; - GCFPVBool pvBoolFilSel0(tempStatus); - if(pvBoolFilSel0.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_FILSEL0)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_FILSEL0),pvBoolFilSel0, timestamp); - } - - tempStatus = (status >> 2) & 0x01; - GCFPVBool pvBoolBandSel(tempStatus); - if(pvBoolBandSel.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_BANDSEL)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_BANDSEL),pvBoolBandSel, timestamp); - } - - tempStatus = (status >> 1) & 0x01; - GCFPVBool pvBoolHBAEnable(tempStatus); - if(pvBoolHBAEnable.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_HBAENABLE)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_HBAENABLE),pvBoolHBAEnable, timestamp); - } - - tempStatus = (status >> 0) & 0x01; - GCFPVBool pvBoolLBAEnable(tempStatus); - if(pvBoolLBAEnable.getValue() != boost::shared_ptr<GCFPVBool>(static_cast<GCFPVBool*>(it->second->getOldValue(PROPNAME_LBAENABLE)))->getValue()) { - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_LBAENABLE),pvBoolLBAEnable, timestamp); - } - } -} - -void RegisterAccessTask::updateBoardRCUproperties(string scope,uint8 /*status*/, uint32 nof_overflow, double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - LOG_WARN("ignoring status field in BoardRCUStatus"); - GCFPVUnsigned pvUns(nof_overflow); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_NOFOVERFLOW),pvUns, timestamp); - } -} - -void RegisterAccessTask::updateVersion(string scope, string version, double timestamp) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - string datapoint,datapointElement; - _splitScope(scope,datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - GCFPVString pvString(version); - it->second->setValueTimed(_getElementPrefix(datapointElement)+string(PROPNAME_VERSION),pvString,timestamp); - } -} - -void RegisterAccessTask::handleMaintenance(string propName, const GCFPValue& value) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - GCFPVBool pvBool; - pvBool.copy(value); - bool maintenanceFlag(pvBool.getValue()); - - // strip last part of the property name to get the resource name. - int pos=propName.find_last_of("_."); - string resource = propName.substr(0,pos); - m_physicalModel.inMaintenance(maintenanceFlag,resource); -} - -void RegisterAccessTask::handleCommand(string propName, const GCFPValue& value) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - TMyPropertySetMap::iterator propsetIt = getPropertySetFromScope(propName); - if(propsetIt == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",propName.c_str())); - } - else { - GCFPVString pvString; - pvString.copy(value); - string command(pvString.getValue()); - - // strip last part of the property name to get the resource name. - int pos=propName.find_last_of("_."); - string resource = propName.substr(0,pos); - string result("Command not supported"); - TCommandResultCode resultCode(COMMAND_RESULT_ERROR); - - if(commandGetID == command.substr(0,commandGetID.length())) { - // determine the property - if(resource.find("HFA") != string::npos) { - //TODO int rcuNr = getRCUHardwareNr(resource); - //TODO RSPTestGetHBAIDEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.rcu = rcuNr; - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(resource.find("RCU") != string::npos) { - //TODO int rcuNr = getRCUHardwareNr(resource); - //TODO RSPTestGetRCUIDEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.rcu = rcuNr; - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(resource.find("Board") != string::npos) { - //TODO RSPTestGetRSPIDEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(resource.find("SubRack") != string::npos) { - //TODO RSPTestGetTDSIDEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(resource.find("TBB") != string::npos) { - //TODO RSPTestGetTBBIDEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(resource.find("PIC") != string::npos) { - //TODO RSPTestGetGPSIDEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else { - resultCode = COMMAND_RESULT_ERROR; - result="Command not supported for the selected resource"; - } - } - else if(commandTestRegisterReadWrite == command.substr(0,commandTestRegisterReadWrite.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestPPS == command.substr(0,commandTestPPS.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReadSattelitePositions == command.substr(0,commandReadSattelitePositions.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReadTimeConstant == command.substr(0,commandReadTimeConstant.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReadConfiguration == command.substr(0,commandReadConfiguration.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReadStatistics == command.substr(0,commandReadStatistics.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReadPPSlockStatus == command.substr(0,commandReadPPSlockStatus.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReadPLLlockStatus == command.substr(0,commandReadPLLlockStatus.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReadCurrent == command.substr(0,commandReadCurrent.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestRSPlinkSpeed == command.substr(0,commandTestRSPlinkSpeed.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestRCUlinkSpeed == command.substr(0,commandTestRCUlinkSpeed.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestSerdesSpeed == command.substr(0,commandTestSerdesSpeed.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestTBBlinkSpeed == command.substr(0,commandTestTBBlinkSpeed.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestBoundaryScan == command.substr(0,commandTestBoundaryScan.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestWaveform == command.substr(0,commandTestWaveform.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestTransient == command.substr(0,commandTestTransient.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestClock == command.substr(0,commandTestClock.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestFPGAlinkSpeed == command.substr(0,commandTestFPGAlinkSpeed.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestEthernetLoopBack == command.substr(0,commandTestEthernetLoopBack.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestSerdesLoopBack == command.substr(0,commandTestSerdesLoopBack.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestFPGAmemoryRandom == command.substr(0,commandTestFPGAmemoryRandom.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestFPGAmemory == command.substr(0,commandTestFPGAmemory.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestDataReception == command.substr(0,commandTestDataReception.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandTestRoundTripSpeed == command.substr(0,commandTestRoundTripSpeed.length())) { - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(commandReset == command.substr(0,commandReset.length())) { - // determine the property - if(resource.find("RCU") != string::npos) { - //TODO int rcuNr = getRCUHardwareNr(resource); - //TODO RSPResetRCUEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.rcu = rcuNr; - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(resource.find("Board") != string::npos) { - //TODO int rcuNr = getRCUHardwareNr(resource); - //TODO int rackRelativeNr,subRackRelativeNr,boardRelativeNr,apRelativeNr,rcuRelativeNr; - //TODO getRCURelativeNumbers(rcuNr,rackRelativeNr,subRackRelativeNr,boardRelativeNr,apRelativeNr,rcuRelativeNr); - //TODO RSPResetRSPEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.rack = rackRelativeNr; - //TODO commandEvent.subrack = subRackRelativeNr; - //TODO commandEvent.board = boardRelativeNr; - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else if(resource.find("TBB") != string::npos) { - //TODO RSPResetTBBEvent commandEvent; - //TODO commandEvent.timestamp.setNow(); - //TODO commandEvent.handle = m_commandHandle; - m_pendingCommands[m_commandHandle++] = propName; - //TODO m_RSPclient.send(commandEvent); - //TODO resultCode = COMMAND_RESULT_EXECUTING; - //TODO result="Executing..."; - LOG_FATAL("TODO: send operational test event messages to RSP Driver"); - resultCode = COMMAND_RESULT_ERROR; - result="Not implemented"; - } - else { - resultCode = COMMAND_RESULT_ERROR; - result="Command not supported for the selected resource"; - } - } - - // set the result property. - propsetIt->second->setValue(string(PROPNAME_RESULT_CODE),GCFPVInteger(resultCode)); - propsetIt->second->setValue(string(PROPNAME_RESULT),GCFPVString(result)); - } -} - -GCFEvent::TResult RegisterAccessTask::handleCommandResult(GCFEvent& /*e*/) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - GCFEvent::TResult status = GCFEvent::HANDLED; - -/*TODO - RSPCommandresultEvent commandResultEvent(e); - - double timestamp = double(commandResultEvent.timestamp); - time_t curTime=(time_t)timestamp; - LOG_DEBUG(formatString("CommandResult:time:%s:status:%d:value:%s:handle:%d", - ctime(&curTime), - commandResultEvent.status, - commandResultEvent.value.c_str(), - commandResultEvent.handle)); - - map<uint32,string>::iterator it=m_pendingCommands.find(commandResultEvent.handle); - if(it != m_pendingCommands.end()) - { - TMyPropertySetMap::iterator propsetIt = getPropertySetFromScope(it->second); - if(propsetIt == m_myPropertySetMap.end()) - { - LOG_FATAL(formatString("PropertySet not found: %s. Unable to write command result property",it->second.c_str())); - } - else - { - // set the result property. - propsetIt->second->setValueTimed(string(PROPNAME_RESULT_CODE),GCFPVInteger(commandResultEvent.status),timestamp); - propsetIt->second->setValueTimed(string(PROPNAME_RESULT),GCFPVString(commandResultEvent.value),timestamp); - } - m_pendingCommands.erase(it); - } - else - { - LOG_ERROR(formatString("Command handle %d not found. Unable to write command result property",commandResultEvent.handle)); - } -*/ - return status; -} - -void RegisterAccessTask::handleRCUSettings(string propName, const int bitnr, const GCFPValue& value) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - boost::shared_ptr<GCFPVBool> pvLBAEnable; - boost::shared_ptr<GCFPVBool> pvHBAEnable; - boost::shared_ptr<GCFPVBool> pvBandSel; - boost::shared_ptr<GCFPVBool> pvFilSel0; - boost::shared_ptr<GCFPVBool> pvFilSel1; - boost::shared_ptr<GCFPVBool> pvVLEnable; - boost::shared_ptr<GCFPVBool> pvVHEnable; - boost::shared_ptr<GCFPVBool> pvVddVccEn; - - TMyPropertySetMap::iterator propsetIt = getPropertySetFromScope(propName); - if(propsetIt != m_myPropertySetMap.end()) { - // get old register values - pvLBAEnable.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_LBAENABLE))); // bit 0 - pvHBAEnable.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_HBAENABLE))); // bit 1 - pvBandSel.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_BANDSEL))); // bit 2 - pvFilSel0.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_FILSEL0))); // bit 3 - pvFilSel1.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_FILSEL1))); // bit 4 - pvVLEnable.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_VLENABLE))); // bit 5 - pvVHEnable.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_VHENABLE))); // bit 6 - pvVddVccEn.reset(static_cast<GCFPVBool*>(propsetIt->second->getValue(PROPNAME_VDDVCCEN))); // bit 7 - - // modify the new value - switch(bitnr) { - case BIT_LBAENABLE: - pvLBAEnable->copy(value); - break; - case BIT_HBAENABLE: - pvHBAEnable->copy(value); - break; - case BIT_BANDSEL: - pvBandSel->copy(value); - break; - case BIT_FILSEL0: - pvFilSel0->copy(value); - break; - case BIT_FILSEL1: - pvFilSel1->copy(value); - break; - case BIT_VLENABLE: - pvVLEnable->copy(value); - break; - case BIT_VHENABLE: - pvVHEnable->copy(value); - break; - case BIT_VDDVCCEN: - pvVddVccEn->copy(value); - break; - default: - break; - } - - int rcucontrol = 0; - if(pvLBAEnable->getValue()) - rcucontrol |= 0x01; - if(pvHBAEnable->getValue()) - rcucontrol |= 0x02; - if(pvBandSel->getValue()) - rcucontrol |= 0x04; - if(pvFilSel0->getValue()) - rcucontrol |= 0x08; - if(pvFilSel1->getValue()) - rcucontrol |= 0x10; - if(pvVLEnable->getValue()) - rcucontrol |= 0x20; - if(pvVHEnable->getValue()) - rcucontrol |= 0x40; - if(pvVddVccEn->getValue()) - rcucontrol |= 0x80; - - int rcu = getRCUHardwareNr(propName); - if(rcu>=0) { - RSPSetrcuEvent setrcu; - setrcu.timestamp = RTC::Timestamp(0,0); - setrcu.rcumask = 0; - setrcu.rcumask.set(rcu); - - setrcu.settings().resize(1); - /* setrcu.settings()(0).value = rcucontrol; - * - * m_RSPclient.send(setrcu); - */ - LOG_FATAL("TODO: RCU Settings"); - } - else { - LOG_FATAL(formatString("rcu for property %s not found in local administration",propName.c_str())); - } - } - else { - LOG_FATAL(formatString("property %s not found in local administration",propName.c_str())); - } -} - -void RegisterAccessTask::getBoardRelativeNumbers(int boardNr,int& rackNr,int& subRackNr,int& relativeBoardNr) -{ - rackNr = boardNr / (m_n_subracks_per_rack*m_n_boards_per_subrack); - subRackNr = (boardNr / m_n_boards_per_subrack) % m_n_subracks_per_rack; - relativeBoardNr = boardNr; -} - -void RegisterAccessTask::getRCURelativeNumbers(int rcuNr,int& rackRelativeNr,int& subRackRelativeNr,int& boardRelativeNr,int& apRelativeNr,int& rcuRelativeNr) -{ - rackRelativeNr = rcuNr / (m_n_rcus_per_ap*m_n_aps_per_board*m_n_boards_per_subrack*m_n_subracks_per_rack); - subRackRelativeNr = ( rcuNr / (m_n_rcus_per_ap*m_n_aps_per_board*m_n_boards_per_subrack) ) % m_n_subracks_per_rack; - boardRelativeNr = ( rcuNr / (m_n_rcus_per_ap*m_n_aps_per_board) ) % m_n_boards_per_subrack; - apRelativeNr = ( rcuNr / (m_n_rcus_per_ap) ) % m_n_aps_per_board; - rcuRelativeNr = rcuNr; -} - -int RegisterAccessTask::getRCUHardwareNr(const string& property) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - int rcu=-1; - // strip property and systemname, propertyset name remains - int posBegin=property.find_first_of(":")+1; - int posEnd=property.find_last_of("."); - string propertySetName = property.substr(posBegin,posEnd-posBegin); - - bool rcuFound=false; - map<string,int>::iterator it = m_propertySet2RCUMap.begin(); - while(!rcuFound && it != m_propertySet2RCUMap.end()) { - if(propertySetName == it->first) { - rcuFound=true; - rcu = it->second; - } - else { - ++it; - } - } - return rcu; -} - -RegisterAccessTask::TMyPropertySetMap::iterator RegisterAccessTask::getPropertySetFromScope(const string& property) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - // strip property and systemname, propertyset name remains - int posBegin=property.find_first_of(":")+1; - int posEnd=property.find_last_of("."); - string propertySetName = property.substr(posBegin,posEnd-posBegin); - - bool rcuFound=false; - TMyPropertySetMap::iterator it = m_myPropertySetMap.begin(); - while(!rcuFound && it != m_myPropertySetMap.end()) { - if(propertySetName == it->first) { - rcuFound=true; - } - else { - ++it; - } - } - return it; - -} - - -void RegisterAccessTask::_addStatistics(TStatistics& statistics, uint32 statsHandle) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - if(statsHandle == m_subStatsHandleSubbandPower) { - if(m_integrationTime == 0) { - _writeStatistics(statistics, statsHandle); - } - else { - if(m_integratingStatisticsSubband.size() == 0) { - m_integratingStatisticsSubband.resize(statistics.shape()); - m_integratingStatisticsSubband = 0; - } - - m_integratingStatisticsSubband += statistics; - m_numStatisticsSubband++; - - stringstream statisticsStream; - statisticsStream << m_integratingStatisticsSubband(blitz::Range(0,2),blitz::Range(0,2)); - LOG_DEBUG(formatString("subband: n_stats:%d; statistics:%s",m_numStatisticsSubband, statisticsStream.str().c_str())); - } - } - else if(statsHandle == m_subStatsHandleBeamletPower) { - if(m_integrationTime == 0) { - _writeStatistics(statistics, statsHandle); - } - else { - if(m_integratingStatisticsBeamlet.size() == 0) { - m_integratingStatisticsBeamlet.resize(statistics.shape()); - m_integratingStatisticsBeamlet = 0; - } - - m_integratingStatisticsBeamlet += statistics; - m_numStatisticsBeamlet++; - - stringstream statisticsStream; - statisticsStream << m_integratingStatisticsBeamlet(blitz::Range(0,2),blitz::Range(0,2)); - LOG_DEBUG(formatString("beamlet: n_stats:%d; statistics:%s",m_numStatisticsBeamlet, statisticsStream.str().c_str())); - } - } -} - -void RegisterAccessTask::_integrateStatistics() -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - TStatistics statisticsSubband; - TStatistics statisticsBeamlet; - TXcStatistics xcstatistics; - - if(m_numStatisticsSubband != 0) { - statisticsSubband.resize(m_integratingStatisticsSubband.shape()); - statisticsSubband = 0; - - switch(m_integrationMethod) { - case 0: // average - default: - statisticsSubband = m_integratingStatisticsSubband/static_cast<double>(m_numStatisticsSubband); - break; - // case 1: // NYI - // break; - } - - stringstream statisticsStream; - statisticsStream << statisticsSubband(blitz::Range(0,2),blitz::Range(0,2)); - LOG_DEBUG(formatString("subband integrated: n_stats:%d; statistics:%s",m_numStatisticsSubband, statisticsStream.str().c_str())); - - m_integratingStatisticsSubband = 0; - m_numStatisticsSubband=0; - - _writeStatistics(statisticsSubband, m_subStatsHandleSubbandPower); - } - if(m_numStatisticsBeamlet != 0) { - statisticsBeamlet.resize(m_integratingStatisticsBeamlet.shape()); - statisticsBeamlet = 0; - - switch(m_integrationMethod) { - case 0: // average - default: - statisticsBeamlet = m_integratingStatisticsBeamlet/static_cast<double>(m_numStatisticsBeamlet); - break; - // case 1: // NYI - // break; - } - - stringstream statisticsStream; - statisticsStream << statisticsSubband(blitz::Range(0,2),blitz::Range(0,2)); - LOG_DEBUG(formatString("beamlet integrated: n_stats:%d; statistics:%s",m_numStatisticsBeamlet, statisticsStream.str().c_str())); - - m_integratingStatisticsBeamlet.free(); - m_numStatisticsBeamlet=0; - _writeStatistics(statisticsBeamlet, m_subStatsHandleBeamletPower); - } - if(m_numXcStatistics != 0) { - xcstatistics.resize(m_integratingXcStatistics.shape()); - xcstatistics = 0; - - switch(m_integrationMethod) { - case 0: // average - default: - xcstatistics = m_integratingXcStatistics/static_cast<double>(m_numXcStatistics); - break; - // case 1: // NYI - // break; - } - - // log the first elements - stringstream statisticsStream; - statisticsStream << xcstatistics(blitz::Range(0,2),blitz::Range(0,2),blitz::Range(0,2),blitz::Range(0,2)); - LOG_DEBUG(formatString("subband integrated: n_stats:%d; statistics:%s",m_numXcStatistics, statisticsStream.str().c_str())); - - m_integratingXcStatistics = 0; - m_numXcStatistics=0; - - _writeXcStatistics(xcstatistics, m_subXcStatsHandle); - } -} - -void RegisterAccessTask::_writeStatistics(TStatistics& statistics, uint32 statsHandle) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - int maxRCUs = statistics.ubound(blitz::firstDim) - statistics.lbound(blitz::firstDim) + 1; - int maxSubbands = statistics.ubound(blitz::secondDim) - statistics.lbound(blitz::secondDim) + 1; - LOG_DEBUG(formatString("maxRCUs:%d maxSubbands:%d",maxRCUs,maxSubbands)); - - if(m_centralized_stats) { - LOG_DEBUG("Writing statistics to a dynamic array of doubles"); - // build a vector of doubles that will be stored in one datapoint - GCFPValueArray valuePointerVector; - - // first elements indicate the length of the array - valuePointerVector.push_back(new GCFPVDouble(maxRCUs)); - valuePointerVector.push_back(new GCFPVDouble(maxSubbands)); - - // then for each rcu, the statistics of the beamlets or subbands - int rcu,subband; - for(rcu=statistics.lbound(blitz::firstDim);rcu<=statistics.ubound(blitz::firstDim);rcu++) { - for(subband=statistics.lbound(blitz::secondDim);subband<=statistics.ubound(blitz::secondDim);subband++) { - double stat = statistics(rcu,subband); - valuePointerVector.push_back(new GCFPVDouble(stat)); - } - } - - // convert the vector of unsigned values to a dynamic array - GCFPVDynArr dynamicArray(LPT_DOUBLE,valuePointerVector); - - // set the property - TMyPropertySetMap::iterator propSetIt=m_myPropertySetMap.find(string(SCOPE_PIC)); - if(propSetIt != m_myPropertySetMap.end()) { - if(statsHandle == m_subStatsHandleSubbandPower) { - propSetIt->second->setValue(string(PROPNAME_STATISTICSSUBBANDPOWER),dynamicArray); - } - else if(statsHandle == m_subStatsHandleBeamletPower) { - propSetIt->second->setValue(string(PROPNAME_STATISTICSBEAMLETPOWER),dynamicArray); - } - } - - // cleanup - GCFPValueArray::iterator it=valuePointerVector.begin(); - while(it!=valuePointerVector.end()) { - delete *it; - valuePointerVector.erase(it); - it=valuePointerVector.begin(); - } - } - else { - LOG_DEBUG("Writing statistics to one string"); - // statistics will be stored as a string in an element of each rcu - // then for each rcu, the statistics of the beamlets or subbands - int rcu,subband; - for(rcu=statistics.lbound(blitz::firstDim);rcu<=statistics.ubound(blitz::firstDim);rcu++) { - LOG_DEBUG(formatString("rcu:%d",rcu)); - - stringstream statisticsStream; - statisticsStream.setf(ios_base::fixed); - for(subband=statistics.lbound(blitz::secondDim);subband<=statistics.ubound(blitz::secondDim);subband++) { - double stat = statistics(rcu,subband); - statisticsStream << subband << " "; - statisticsStream << stat << endl; - } - LOG_DEBUG(formatString("first part of statistics:%s",statisticsStream.str().substr(0,30).c_str())); - - GCFPVString statisticsString(statisticsStream.str()); - // set the property - char scopeString[300]; - int rackRelativeNr,subRackRelativeNr,boardRelativeNr,apRelativeNr,rcuRelativeNr; - getRCURelativeNumbers(rcu,rackRelativeNr,subRackRelativeNr,boardRelativeNr,apRelativeNr,rcuRelativeNr); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rackRelativeNr,subRackRelativeNr,boardRelativeNr,apRelativeNr,rcuRelativeNr); - string datapoint,datapointElement; - _splitScope(string(scopeString),datapoint,datapointElement); - TMyPropertySetMap::iterator propSetIt=m_myPropertySetMap.find(datapoint); - if(propSetIt != m_myPropertySetMap.end()) { - if(statsHandle == m_subStatsHandleSubbandPower) { - TGCFResult res = propSetIt->second->setValue(_getElementPrefix(datapointElement)+string(PROPNAME_STATISTICSSUBBANDPOWER),statisticsString); - LOG_DEBUG(formatString("Writing subband statistics to %s returned %d",propSetIt->second->getScope().c_str(),res)); - } - else if(statsHandle == m_subStatsHandleBeamletPower) { - TGCFResult res = propSetIt->second->setValue(_getElementPrefix(datapointElement)+string(PROPNAME_STATISTICSBEAMLETPOWER),statisticsString); - LOG_DEBUG(formatString("Writing beamlet statistics to %s returned %d",propSetIt->second->getScope().c_str(),res)); - } - } - } - } -} - -void RegisterAccessTask::_addXcStatistics(TXcStatistics& statistics, uint32 statsHandle) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - if(statsHandle == m_subXcStatsHandle) { - if(m_integrationTime == 0) { - _writeXcStatistics(statistics, statsHandle); - } - else { - if(m_integratingXcStatistics.size() == 0) { - m_integratingXcStatistics.resize(statistics.shape()); - m_integratingXcStatistics = 0; - } - - m_integratingXcStatistics += statistics; - m_numXcStatistics++; - - // log the first elements - stringstream statisticsStream; - statisticsStream << m_integratingXcStatistics(blitz::Range(0,2),blitz::Range(0,2),blitz::Range(0,2),blitz::Range(0,2)); - LOG_DEBUG(formatString("Crosslet: n_stats:%d; statistics:%s",m_numXcStatistics, statisticsStream.str().c_str())); - } - } -} - -void RegisterAccessTask::_writeXcStatistics(TXcStatistics& statistics, uint32 statsHandle) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - int dim1 = statistics.ubound(blitz::firstDim) - statistics.lbound(blitz::firstDim) + 1; - int dim2 = statistics.ubound(blitz::secondDim) - statistics.lbound(blitz::secondDim) + 1; - int dim3 = statistics.ubound(blitz::thirdDim) - statistics.lbound(blitz::thirdDim) + 1; - int dim4 = statistics.ubound(blitz::fourthDim) - statistics.lbound(blitz::fourthDim) + 1; - LOG_DEBUG(formatString("dimensions: %d x %d x %d x %d",dim1,dim2,dim3,dim4)); - - if(!m_centralized_stats) { - LOG_FATAL("NOT Writing XC statistics to one string because the string would be far too big"); - } - - LOG_DEBUG("Writing statistics to a dynamic array of doubles"); - // build a vector of doubles that will be stored in one datapoint - GCFPValueArray valuePointerVector; - - // first elements indicate the dimensions - valuePointerVector.push_back(new GCFPVDouble(dim1)); - valuePointerVector.push_back(new GCFPVDouble(dim2)); - valuePointerVector.push_back(new GCFPVDouble(dim3)); - valuePointerVector.push_back(new GCFPVDouble(dim4)); - - // then add all stats - for(dim1=statistics.lbound(blitz::firstDim);dim1<=statistics.ubound(blitz::firstDim);dim1++) { - for(dim2=statistics.lbound(blitz::firstDim);dim2<=statistics.ubound(blitz::firstDim);dim2++) { - for(dim3=statistics.lbound(blitz::firstDim);dim3<=statistics.ubound(blitz::firstDim);dim3++) { - for(dim4=statistics.lbound(blitz::firstDim);dim4<=statistics.ubound(blitz::firstDim);dim4++) { - complex<double> stat = statistics(dim1,dim2,dim3,dim4); - valuePointerVector.push_back(new GCFPVDouble(stat.real())); - valuePointerVector.push_back(new GCFPVDouble(stat.imag())); - } - } - } - } - - // convert the vector of unsigned values to a dynamic array - GCFPVDynArr dynamicArray(LPT_DOUBLE,valuePointerVector); - - // set the property - TMyPropertySetMap::iterator propSetIt=m_myPropertySetMap.find(string(SCOPE_PIC)); - if(propSetIt != m_myPropertySetMap.end()) { - if(statsHandle == m_subXcStatsHandle) { - propSetIt->second->setValue(string(PROPNAME_XCSTATISTICS),dynamicArray); - } - } - - // cleanup - GCFPValueArray::iterator it=valuePointerVector.begin(); - while(it!=valuePointerVector.end()) { - delete *it; - valuePointerVector.erase(it); - it=valuePointerVector.begin(); - } -} - -void RegisterAccessTask::_refreshFunctionality() -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - int rack, subrack, board, ap, rcu; - char scopeString[300]; - - int racksDefect(0); - for(rack=0;rack<m_n_racks;rack++) { - int subracksDefect(0); - for(subrack=0;subrack<m_n_subracks_per_rack;subrack++) { - int boardsDefect(0); - for(board=0;board<m_n_boards_per_subrack;board++) { - int apsDefect(0); - int ethDefect(0); - int bpDefect(0); - for(ap=0;ap<m_n_aps_per_board;ap++) { - int rcusDefect(0); - for(rcu=0;rcu<m_n_rcus_per_ap;rcu++) { - int lfasDefect(0); - int hfasDefect(0); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_LFA,rack,subrack,board,ap,rcu); - lfasDefect+=_isDefect(scopeString); - _setFunctionality(scopeString, (lfasDefect == 0)); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA,rack,subrack,board,ap,rcu); - hfasDefect+=_isDefect(scopeString); - _setFunctionality(scopeString, (hfasDefect == 0)); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rack,subrack,board,ap,rcu); - int isDefect = _isDefect(scopeString); - - if(isDefect==1 || (lfasDefect>0&&hfasDefect>0)) { - rcusDefect++; - _setFunctionalityRCU(rack,subrack,board,ap,rcu, false); - } - else { - _setFunctionality(scopeString, true); - } - } - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rack,subrack,board,ap); - int isDefect = _isDefect(scopeString); - - if(isDefect==1 || rcusDefect >= m_n_rcus_per_ap) { - apsDefect++; - _setFunctionalityAP(rack,subrack,board,ap, false); - } - else { - _setFunctionality(scopeString, true); - } - } - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_BP,rack,subrack,board); - bpDefect+=_isDefect(scopeString); - _setFunctionality(scopeString, (bpDefect == 0)); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_ETH,rack,subrack,board); - ethDefect+=_isDefect(scopeString); - _setFunctionality(scopeString, (ethDefect == 0)); - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN,rack,subrack,board); - int isDefect = _isDefect(scopeString); - - if(isDefect==1 || bpDefect>0 || ethDefect>0 || apsDefect >= m_n_aps_per_board) { - boardsDefect++; - _setFunctionalityBoard(rack,subrack,board,false); - } - else { - _setFunctionality(scopeString, true); - } - } - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN,rack,subrack); - int isDefect = _isDefect(scopeString); - - if(isDefect==1 || boardsDefect >= m_n_boards_per_subrack) { - subracksDefect++; - _setFunctionalitySubRack(rack,subrack,false); - } - else { - _setFunctionality(scopeString, true); - } - } - sprintf(scopeString,SCOPE_PIC_RackN,rack); - int isDefect = _isDefect(scopeString); - - if(isDefect==1 || subracksDefect >= m_n_subracks_per_rack) { - racksDefect++; - _setFunctionalityRack(rack,false); - } - else { - _setFunctionality(scopeString, true); - } - } - sprintf(scopeString,SCOPE_PIC); - int isDefect = _isDefect(scopeString); - - if(isDefect==1 || racksDefect >= m_n_racks) { - _setFunctionalityStation(false); - } - else { - _setFunctionality(scopeString, true); - } -} - -int RegisterAccessTask::_isDefect(char* scopeString) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,getName().c_str()); - - int isDefect(1); - string datapoint,datapointElement; - _splitScope(string(scopeString),datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - boost::shared_ptr<GCFPVInteger> pvStatus(static_cast<GCFPVInteger*>(it->second->getValue(_getElementPrefix(datapointElement)+string(PROPNAME_STATUS)))); - if(!pvStatus) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - if(pvStatus->getValue()==-3/*APLCommon::RS_DEFECT*/) { - isDefect=1; - } - else { - isDefect=0; - } - } - } - return isDefect; -} - -void RegisterAccessTask::_setFunctionality(char* scopeString, bool functional) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,formatString("%s - %s=%s",getName().c_str(),scopeString,(functional?"true":"false")).c_str()); - - string datapoint,datapointElement; - _splitScope(string(scopeString),datapoint,datapointElement); - TMyPropertySetMap::iterator it=m_myPropertySetMap.find(datapoint); - if(it == m_myPropertySetMap.end()) { - LOG_FATAL(formatString("PropertySet not found: %s",datapoint.c_str())); - } - else { - GCFPVBool pvBool(functional); - it->second->setValue(_getElementPrefix(datapointElement)+string(PROPNAME_FUNCTIONALITY),pvBool); - } -} - -void RegisterAccessTask::_setFunctionalityRCU(int rack,int subrack,int board,int ap,int rcu, bool functional) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,formatString("%s - %d,%d,%d,%d,%d,%s",getName().c_str(),rack,subrack,board,ap,rcu,(functional?"true":"false")).c_str()); - - char scopeString[300]; - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,rack,subrack,board,ap,rcu); - _setFunctionality(scopeString, functional); - // also set functionality of underlying resources to false - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_LFA,rack,subrack,board,ap,rcu); - _setFunctionality(scopeString, functional); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_HFA,rack,subrack,board,ap,rcu); - _setFunctionality(scopeString, functional); -} - -void RegisterAccessTask::_setFunctionalityAP(int rack,int subrack,int board,int ap,bool functional) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,formatString("%s - %d,%d,%d,%d,%s",getName().c_str(),rack,subrack,board,ap,(functional?"true":"false")).c_str()); - - char scopeString[300]; - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_APN,rack,subrack,board,ap); - _setFunctionality(scopeString, functional); - // also set functionality of underlying resources to false - for(int r=0;r<m_n_rcus_per_ap;r++) { - _setFunctionalityRCU(rack,subrack,board,ap,r, false); - } -} - -void RegisterAccessTask::_setFunctionalityBoard(int rack,int subrack,int board,bool functional) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,formatString("%s - %d,%d,%d,%s",getName().c_str(),rack,subrack,board,(functional?"true":"false")).c_str()); - - char scopeString[300]; - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN,rack,subrack,board); - _setFunctionality(scopeString, functional); - // also set functionality of underlying resources to false - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_ETH,rack,subrack,board); - _setFunctionality(scopeString, functional); - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN_BoardN_BP,rack,subrack,board); - _setFunctionality(scopeString, functional); - for(int a=0;a<m_n_aps_per_board;a++) { - _setFunctionalityAP(rack,subrack,board,a,false); - } -} - -void RegisterAccessTask::_setFunctionalitySubRack(int rack,int subrack,bool functional) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,formatString("%s - %d,%d,%s",getName().c_str(),rack,subrack,(functional?"true":"false")).c_str()); - - char scopeString[300]; - - sprintf(scopeString,SCOPE_PIC_RackN_SubRackN,rack,subrack); - _setFunctionality(scopeString, functional); - // also set functionality of underlying resources to false - for(int b=0;b<m_n_boards_per_subrack;b++) { - _setFunctionalityBoard(rack,subrack,b,false); - } -} - -void RegisterAccessTask::_setFunctionalityRack(int rack,bool functional) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,formatString("%s - %d,%s",getName().c_str(),rack,(functional?"true":"false")).c_str()); - - char scopeString[300]; - - sprintf(scopeString,SCOPE_PIC_RackN,rack); - _setFunctionality(scopeString, functional); - // also set functionality of underlying resources to false - for(int s=0;s<m_n_subracks_per_rack;s++) { - _setFunctionalitySubRack(rack,s,false); - } -} - -void RegisterAccessTask::_setFunctionalityStation(bool functional) -{ - LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW,formatString("%s - %s",getName().c_str(),(functional?"true":"false")).c_str()); - - char scopeString[300]; - - sprintf(scopeString,SCOPE_PIC); - _setFunctionality(scopeString, functional); - // also set functionality of underlying resources to false - for(int r=0;r<m_n_racks;r++) { - _setFunctionalityRack(r,false); - } -} - -void RegisterAccessTask::_splitScope(const string& scope,string& datapoint,string& datapointElement) -{ - string::size_type splitPoint = scope.find('.'); - datapoint = scope; - datapointElement = ""; - - if(splitPoint != string::npos) { - datapoint = scope.substr(0,splitPoint); - datapointElement = scope.substr(splitPoint+1); - } -} - -string RegisterAccessTask::_getElementPrefix(const string& datapointElement) -{ - string elPrefix = ""; - if(datapointElement.length() > 0) { - elPrefix = datapointElement + string("."); - } - return elPrefix; -} - -} // namespace ARA - - -} // namespace LOFAR - diff --git a/MAC/APL/PIC/_RegisterAccess/src/ARARegisterAccessTask.h b/MAC/APL/PIC/_RegisterAccess/src/ARARegisterAccessTask.h deleted file mode 100644 index 38f7802ee18e5333c22db0617bce8bf7d4f1709e..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/ARARegisterAccessTask.h +++ /dev/null @@ -1,280 +0,0 @@ -//# ARARegisterAccessTask.h: class definition for the Beam Server 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$ - -#ifndef ARAREGISTERACCESSTASK_H_ -#define ARAREGISTERACCESSTASK_H_ - -#include <GCF/TM/GCF_Control.h> -#include <GCF/PAL/GCF_MyPropertySet.h> -#include <Common/LofarTypes.h> -#include <boost/shared_ptr.hpp> -#include <map> -#include <complex> -#include <blitz/array.h> - -#include "ARAAnswer.h" -#include "ARAPhysicalModel.h" - - -namespace LOFAR -{ - -namespace ARA -{ - class RegisterAccessTask : public GCF::TM::GCFTask - { - public: - /** - * The constructor of the RegisterAccessTask task. - * @param name The name of the task. The name is used for looking - * up connection establishment information using the GTMNameService and - * GTMTopologyService classes. - */ - RegisterAccessTask(string name); - virtual ~RegisterAccessTask(); - - // state methods - - /** - * @return true if ready to transition to the connected - * state. - */ - bool isConnected(); - - /** - * The initial state. This state is used to connect to the RSPdriver - * When they are connected a transition to the connnected state is made. - */ - GCF::TM::GCFEvent::TResult initial_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - /** - * The connected state. In this state the version and configuration of the - * RSPdriver is requested and the propertysets are created. - */ - GCF::TM::GCFEvent::TResult connected_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - /** - * The enablingPropsets state. In this state the propertysets are enabled - */ - GCF::TM::GCFEvent::TResult enablingMyPropsets_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - /** - * The getVersion state. In this state the version info is requested from the RSPdriver - */ - GCF::TM::GCFEvent::TResult getVersion_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - /** - * The subscribing states. In each state a SubStats message is sent - */ - GCF::TM::GCFEvent::TResult subscribingStatus_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - GCF::TM::GCFEvent::TResult subscribingStatsSubbandPower_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - GCF::TM::GCFEvent::TResult subscribingStatsBeamletPower_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - GCF::TM::GCFEvent::TResult subscribingXcStats_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - /** - * The operational state. In this state the task can receives - * status and statistics updates from the rsp driver - */ - GCF::TM::GCFEvent::TResult operational_state(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface &p); - - private: - // action methods - /** - * Handle the update status event - */ - GCF::TM::GCFEvent::TResult handleUpdStatus(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& port); - /** - * Handle the update stats event - */ - GCF::TM::GCFEvent::TResult handleUpdStats(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& port); - /** - * Handle the update XcStats event - */ - GCF::TM::GCFEvent::TResult handleUpdXcStats(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& port); - - /** - * Handle a change of the Maintenance status field - */ - void handleMaintenance(string propName, const GCF::Common::GCFPValue& value); - - /** - * Handle a change of the Command field - */ - void handleCommand(string propName, const GCF::Common::GCFPValue& value); - /** - * Handle reception of a command result message - */ - GCF::TM::GCFEvent::TResult handleCommandResult(GCF::TM::GCFEvent& e); - - /** - * Handle a change of one of the RCU settings fields - */ - void handleRCUSettings(string propName, const int bitnr, const GCF::Common::GCFPValue& value); - - private: - // internal types - // gcf 3.1: needs specific apc's for every resource - // in gcf4.0, only the top level apc has to be loaded, and links to other - // apc's are in the apc's themselves - typedef map<string,boost::shared_ptr<GCF::PAL::GCFMyPropertySet> > TMyPropertySetMap; - - /** - * create propertyset object, add it to the map - */ - void addMyPropertySet( - const char* scope, - const char* type, - GCF::Common::TPSCategory category, - const GCF::Common::TPropertyConfig propconfig[], - GCF::PAL::GCFMyPropertySet::TDefaultUse defaultUse = GCF::PAL::GCFMyPropertySet::USE_MY_DEFAULTS); - - void updateBoardProperties(string scope, - uint8 voltage_1_2, - uint8 voltage_2_5, - uint8 voltage_3_3, - double timestamp); - /** - * update eth properties based on status bits - */ - void updateETHproperties(string scope,uint32 frames, - uint32 errors, - uint8 lastError, - uint8 ffi0, - uint8 ffi1, - uint8 ffi2, - double timestamp); - /** - * update MEP status properties - */ - void updateMEPStatusProperties(string scope,uint32 seqnr, - uint8 error, - uint8 ffi0, - double timestamp); - /** - * update SYNC status properties - */ - void updateSYNCStatusProperties(string scope,uint32 sample_count, - uint32 sync_count, - uint32 error_count, - double timestamp); - /** - * update fpga board properties based on status bits - */ - void updateFPGAboardProperties(string scope,double timestamp); - /** - * update fpga properties based on status bits - */ - void updateFPGAproperties(string scope, uint8 temp, - double timestamp); - /** - * update rcu board properties - */ - void updateBoardRCUproperties(string scope,uint8 ffi0, - uint8 ffi1, - double timestamp); - /** - * update rcu properties based on status bits - */ - void updateBoardRCUproperties(string scope,uint8 status, - uint32 nof_overflow, - double timestamp); - void updateRCUproperties(string scope,uint8 status,double timestamp); - /** - * update version string - */ - void updateVersion(string scope, string version, double timestamp); - - private: - typedef blitz::Array<double, 2> TStatistics; - typedef blitz::Array<std::complex<double>, 4> TXcStatistics; - - void getBoardRelativeNumbers(int boardNr,int& rackNr,int& subRackNr,int& relativeBoardNr); - void getRCURelativeNumbers(int rcuNr,int& rackRelativeNr,int& subRackRelativeNr,int& boardRelativeNr,int& apRelativeNr,int& rcuRelativeNr); - int getRCUHardwareNr(const string& property); - TMyPropertySetMap::iterator getPropertySetFromScope(const string& property); - void _addStatistics(TStatistics& statistics, uint32 statsHandle); - void _integrateStatistics(); - void _writeStatistics(TStatistics& statistics, uint32 statsHandle); - void _addXcStatistics(TXcStatistics& statistics, uint32 statsHandle); - void _writeXcStatistics(TXcStatistics& statistics, uint32 statsHandle); - void _refreshFunctionality(); - int _isDefect(char* scopeString); - void _setFunctionality(char* scopeString, bool functional); - void _setFunctionalityRCU(int rack,int subrack,int board,int ap,int rcu, bool functional); - void _setFunctionalityAP(int rack,int subrack,int board,int ap,bool functional); - void _setFunctionalityBoard(int rack,int subrack,int board,bool functional); - void _setFunctionalitySubRack(int rack,int subrack,bool functional); - void _setFunctionalityRack(int rack,bool functional); - void _setFunctionalityStation(bool functional); - void _splitScope(const string& scope,string& datapoint,string& datapointElement); - string _getElementPrefix(const string& datapointElement); - - // member variables - ARAAnswer m_answer; - - TMyPropertySetMap m_myPropertySetMap; - - bool m_myPropsLoaded; - unsigned long m_myPropsLoadCounter; - - // ports - static string m_RSPserverName; - GCF::TM::GCFPort m_RSPclient; - ARAPhysicalModel m_physicalModel; - - map<string,int> m_propertySet2RCUMap; - - // subscriptions - uint32 m_subStatusHandle; - uint32 m_subStatsHandleSubbandPower; - uint32 m_subStatsHandleBeamletPower; - uint32 m_subXcStatsHandle; - - int m_n_racks; - int m_n_subracks_per_rack; - int m_n_boards_per_subrack; - int m_n_aps_per_board; - int m_n_rcus_per_ap; - int m_n_rcus; - int m_n_rspboards; - int m_status_update_interval; - int m_stats_update_interval; - bool m_centralized_stats; - - int32 m_integrationTime; - int32 m_integrationMethod; - TStatistics m_integratingStatisticsSubband; - int32 m_numStatisticsSubband; - TStatistics m_integratingStatisticsBeamlet; - int32 m_numStatisticsBeamlet; - TXcStatistics m_integratingXcStatistics; - int32 m_numXcStatistics; - unsigned long m_integrationTimerID; - - uint32 m_commandHandle; - map<uint32,string> m_pendingCommands; - - GCFTimerPort* itsTimerPort; - - ALLOC_TRACER_CONTEXT; - }; -}; - -} // namespace LOFAR - - -#endif /* ARAREGISTERACCESSTASK_H_ */ diff --git a/MAC/APL/PIC/_RegisterAccess/src/Makefile.am b/MAC/APL/PIC/_RegisterAccess/src/Makefile.am deleted file mode 100644 index 00e343d205be5d36e4ab2b37c91b3989bcc831ab..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -bin_PROGRAMS = RegisterAccess - -RegisterAccess_CPPFLAGS= \ - -Wno-deprecated \ - -fmessage-length=0 \ - -fdiagnostics-show-location=once - -RegisterAccess_SOURCES = \ - $(DOCHDRS) \ - ARAMain.cc \ - ARAAnswer.cc \ - ARAPhysicalModel.cc \ - ARARegisterAccessTask.cc - -NOINSTHDRS = \ - ARAAnswer.h \ - ARAConstants.h \ - ARAPhysicalModel.h \ - ARAPropertyDefines.h \ - ARARegisterAccessTask.h - -INSTHDRS = - -pkginclude_HEADERS = $(NOINSTHDRS) $(INSTHDRS) - -DOCHDRS = $(pkginclude_HEADERS) $(BUILT_SOURCES) - -include_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= \ - RegisterAccess.conf \ - RegisterAccess.log_prop - -%.log_prop: %.log_prop.in - cp $< $@ - -%.conf: %.conf.in - cp $< $@ - -include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.conf.in b/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.conf.in deleted file mode 100644 index 50e7cc52e9c5641f52dcb3a8aa90003444089d27..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.conf.in +++ /dev/null @@ -1,15 +0,0 @@ -mac.ns.ARATestDriver.RSPserver.type=TCP -mac.ns.RSPDriver.acceptor.type=TCP -mac.ns.RSPDriver.acceptor_v3.type=TCP - -#mac.top.ARA.RSPserver.remoteservice=ARATestDriver:RSPserver -#mac.top.ARA.RSPserver.remoteservice=RSPDriver:acceptor -mac.top.ARA.RSPserver.remoteservice=RSPDriver:acceptor_v3 - -mac.apl.ara.N_RACKS=1 -mac.apl.ara.N_SUBRACKS_PER_RACK=1 -mac.apl.ara.N_BOARDS_PER_SUBRACK=1 -mac.apl.ara.N_APS_PER_BOARD=4 -mac.apl.ara.N_RCUS_PER_AP=2 -mac.apl.ara.STATUS_UPDATE_INTERVAL=30 -mac.apl.ara.STATISTICS_UPDATE_INTERVAL=30 diff --git a/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.conf.local.in b/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.conf.local.in deleted file mode 100644 index ec6afd84b688c85f262ca297bfe5d4bde6af6faa..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.conf.local.in +++ /dev/null @@ -1,16 +0,0 @@ -mac.ns.ARATestDriver.RSPserver.type=TCP -mac.ns.RSPDriver.acceptor.type=TCP -mac.ns.RSPDriver.acceptor_v2.type=TCP - -mac.top.ARA.RSPserver.remoteservice=ARATestDriver:RSPserver -#mac.top.ARA.RSPserver.remoteservice=RSPDriver:acceptor -#mac.top.ARA.RSPserver.remoteservice=RSPDriver:acceptor_v2 - -mac.apl.ara.N_RACKS=1 -mac.apl.ara.N_SUBRACKS_PER_RACK=1 -mac.apl.ara.N_BOARDS_PER_SUBRACK=1 -mac.apl.ara.N_APS_PER_BOARD=4 -mac.apl.ara.N_RCUS_PER_AP=2 -mac.apl.ara.STATUS_UPDATE_INTERVAL=10000 -mac.apl.ara.STATISTICS_UPDATE_INTERVAL=10000 -mac.apl.ara.STATISTICS_CENTRALIZED=0 diff --git a/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.log_prop.in b/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.log_prop.in deleted file mode 100644 index 0dbec46cfecff728132631cf239e2cab58c5b6e9..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/src/RegisterAccess.log_prop.in +++ /dev/null @@ -1,20 +0,0 @@ -# add your custom loggers and appenders here -# - -log4cplus.rootLogger=INFO, STDOUT -log4cplus.additivity.ASTRON=FALSE - -log4cplus.appender.STDOUT=log4cplus::ConsoleAppender -log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout -log4cplus.appender.STDOUT.layout.ConversionPattern=%x %D{%d-%m-%y %H:%M:%S} %-5p %c{9} - %m [%.25l]%n -log4cplus.appender.STDOUT.logToStdErr=true - -log4cplus.appender.FILE=log4cplus::RollingFileAppender -log4cplus.appender.FILE.File=../log/RegisterAccesslog.log -log4cplus.appender.FILE.MaxFileSize=5MB -log4cplus.appender.FILE.MaxBackupIndex=5 -log4cplus.appender.FILE.layout=log4cplus::PatternLayout -log4cplus.appender.FILE.layout.ConversionPattern=%x %D{%d-%m-%y %H:%M:%S} %-5p %c{3} - %m [%.25l]%n - -log4cplus.additivity.MAC=FALSE -log4cplus.logger.MAC=TRACE, STDOUT, FILE diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.cc deleted file mode 100644 index 5d397162fdeb550deaafdaf25d45b29f2a1f740d..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.cc +++ /dev/null @@ -1,65 +0,0 @@ -//# ARATestAnswer.cc: Implementation of the ARATestAnswer object -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -#include "ARATestAnswer.h" -#include <GCF/TM/GCF_Task.h> - -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; - -namespace LOFAR -{ - -namespace ARA -{ - -ARATestAnswer::ARATestAnswer() : - m_dummyPort(), - m_task(0) -{ -} - -ARATestAnswer::~ARATestAnswer() -{ -} - -void ARATestAnswer::setTask(GCFTask* pTask) -{ - m_task=pTask; -} - -void ARATestAnswer::handleAnswer(GCFEvent& answer) -{ - if(m_task!=0) - m_task->dispatch(answer,m_dummyPort); -} - -} // namespace ARA - - -} // namespace LOFAR - diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.h b/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.h deleted file mode 100644 index ad7c0f932d6ca5c438e3a0141957121b8c225f7a..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.h +++ /dev/null @@ -1,56 +0,0 @@ -//# ARATestAnswer.h -//# -//# 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$ - -#ifndef ARATESTANSWER_H -#define ARATESTANSWER_H - -#include <GCF/PAL/GCF_Answer.h> -#include <GCF/TM/GCF_Port.h> - -namespace LOFAR -{ -class GCF::TM::GCFEvent; -class GCF::TM::GCFTask; - - -namespace ARA -{ - class ARATestAnswer : public GCF::PAL::GCFAnswer - { - public: - ARATestAnswer(); - ~ARATestAnswer(); - - void setTask(GCF::TM::GCFTask* t); - void handleAnswer(GCF::TM::GCFEvent& answer); - - private: - GCF::TM::GCFPort m_dummyPort; - GCF::TM::GCFTask* m_task; - }; - -}; - - -} // namespace LOFAR - -#endif diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestDriverTask.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATestDriverTask.cc deleted file mode 100644 index 61c8b50c47c3ad1b8734cc3450f899139f6503a7..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/ARATestDriverTask.cc +++ /dev/null @@ -1,1322 +0,0 @@ -//# ARATestDriverTask.cc: Implementation of the -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> -#include <Common/LofarLocators.h> - -#include <APL/RSP_Protocol/RSP_Protocol.ph> -#include <APL/RSP_Protocol/MEPHeader.h> - -#include "../src/ARAConstants.h" -#include "../src/ARAPropertyDefines.h" -#include "APL/APLCommon/APL_Defines.h" -#include "ARATestDriverTask.h" - -#include <stdio.h> -#include <blitz/array.h> -#include <Common/lofar_sstream.h> -#include <time.h> - -#include <APS/ParameterSet.h> -#include <GCF/PAL/GCF_PVSSInfo.h> - -using namespace LOFAR::ACC::APS; -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; -using namespace LOFAR::EPA_Protocol; -using namespace std; - -namespace LOFAR -{ - -namespace ARA -{ - -string ARATestDriverTask::m_taskName("ARATestDriver"); - -ARATestDriverTask::ARATestDriverTask() : - GCFTask((State)&ARATestDriverTask::initial, m_taskName), - m_answer(), - m_RSPserver(), - m_childPorts(), - m_propMap(), - m_systemStatus(), - m_stats(), - m_xcstats(), - m_substatusPeriod(0.0), - m_substatsPeriod(0.0), - m_subxcstatsPeriod(0.0), - m_updStatusTimerId(0), - m_updStatsTimerId(0), - m_updxcStatsTimerId(0), - m_updStatsHandleSP(0), - m_updStatsHandleSM(0), - m_updStatsHandleBP(0), - m_updStatsHandleBM(0), - m_updxcStatsHandle(0), - n_racks(1), - n_subracks_per_rack(1), - n_boards_per_subrack(1), - n_aps_per_board(1), - n_rcus_per_ap(1), - n_rcus(1), - n_pols(2), - m_schedule(""), - m_MACSchedulerPS("GSO_MACScheduler","TAplMacScheduler",&m_answer) -{ - registerProtocol(RSP_PROTOCOL, RSP_PROTOCOL_signalnames); - m_answer.setTask(this); - - try - { - ConfigLocator cl; - globalParameterSet()->adoptFile(cl.locate("RegisterAccess.conf")); - } - catch (Exception e) - { - LOG_ERROR_STR("Failed to load configuration files: " << e.text()); - exit(EXIT_FAILURE); - } - - n_racks = globalParameterSet()->getInt32(PARAM_N_RACKS); - n_subracks_per_rack = globalParameterSet()->getInt32(PARAM_N_SUBRACKS_PER_RACK); - n_boards_per_subrack = globalParameterSet()->getInt32(PARAM_N_BOARDS_PER_SUBRACK); - n_aps_per_board = globalParameterSet()->getInt32(PARAM_N_APS_PER_BOARD); - n_rcus_per_ap = globalParameterSet()->getInt32(PARAM_N_RCUS_PER_AP); - n_rcus = n_rcus_per_ap* - n_aps_per_board* - n_boards_per_subrack* - n_subracks_per_rack* - n_racks; - - m_systemStatus.board().resize(n_boards_per_subrack); - - EPA_Protocol::BoardStatus boardStatus; - memset(&boardStatus,0,sizeof(boardStatus)); - m_systemStatus.board()(blitz::Range::all()) = boardStatus; - - EPA_Protocol::RCUStatus rcuStatus; - memset(&rcuStatus,0,sizeof(rcuStatus)); - - m_stats().resize(n_rcus,MEPHeader::N_BEAMLETS); - m_xcstats().resize(n_pols,n_pols,n_racks*n_subracks_per_rack*n_boards_per_subrack*n_aps_per_board,n_racks*n_subracks_per_rack*n_boards_per_subrack*n_aps_per_board); - - m_RSPserver.init(*this, "RSPserver", GCFPortInterface::MSPP, RSP_PROTOCOL); - -} - -ARATestDriverTask::~ARATestDriverTask() -{ -} - -void ARATestDriverTask::schedule(string schedule) -{ - m_schedule=schedule; -} - -void ARATestDriverTask::addPropertySet(string scope) -{ - char scopeString[300]; - int rack; - int subrack; - int board; - int ap; - int rcu; - - if(scope == string(SCOPE_PIC)) - { - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scope.c_str(),TYPE_LCU_PIC,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Station[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Station[i].propName); - i++; - } - m_propMap[scope]=propSetPtr; - } - else if(scope == string(SCOPE_PIC_RackN)) - { - for(rack=0;rack<n_racks;rack++) - { - sprintf(scopeString,scope.c_str(),rack); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Rack,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Rack[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Rack[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - sprintf(scopeString,scope.c_str(),rack,subrack); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_SubRack,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_SubRack[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_SubRack[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Board,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Board[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Board[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_ETH)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Ethernet,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Ethernet[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Ethernet[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_BP)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_FPGA,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_FPGA[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_FPGA[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_APN)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - for(ap=0;ap<n_aps_per_board;ap++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board,ap); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_FPGA,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_FPGA[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_FPGA[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - for(ap=0;ap<n_aps_per_board;ap++) - { - for(rcu=0;rcu<n_rcus_per_ap;rcu++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board,ap,rcu); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_RCU,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_RCU[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_RCU[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_ADCStatistics)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - for(ap=0;ap<n_aps_per_board;ap++) - { - for(rcu=0;rcu<n_rcus_per_ap;rcu++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board,ap,rcu); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_ADCStatistics,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_ADCStatistics[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_ADCStatistics[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - } - } - else if(scope == string(SCOPE_PIC_Maintenance)) - { - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scope.c_str(),TYPE_LCU_PIC_Maintenance,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Maintenance[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Maintenance[i].propName); - i++; - } - m_propMap[scope]=propSetPtr; - } - else if(scope == string(SCOPE_PIC_RackN_Maintenance)) - { - for(rack=0;rack<n_racks;rack++) - { - sprintf(scopeString,scope.c_str(),rack); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Maintenance,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Maintenance[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Maintenance[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_Maintenance)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - sprintf(scopeString,scope.c_str(),rack,subrack); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Maintenance,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Maintenance[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Maintenance[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_Maintenance)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Maintenance,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Maintenance[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Maintenance[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_Maintenance)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - for(ap=0;ap<n_aps_per_board;ap++) - { - for(rcu=0;rcu<n_rcus_per_ap;rcu++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board,ap,rcu); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Maintenance,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Maintenance[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Maintenance[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } - } - } - else if(scope == string(SCOPE_PIC_RackN_Alert)) - { - for(rack=0;rack<n_racks;rack++) - { - sprintf(scopeString,scope.c_str(),rack); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Alert,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Alert[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Alert[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_Alert)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - sprintf(scopeString,scope.c_str(),rack,subrack); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Alert,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Alert[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Alert[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - else if(scope == string(SCOPE_PIC_RackN_SubRackN_BoardN_Alert)) - { - for(rack=0;rack<n_racks;rack++) - { - for(subrack=0;subrack<n_subracks_per_rack;subrack++) - { - for(board=0;board<n_boards_per_subrack;board++) - { - sprintf(scopeString,scope.c_str(),rack,subrack,board); - boost::shared_ptr<GCFExtPropertySet> propSetPtr(new GCFExtPropertySet(scopeString,TYPE_LCU_PIC_Alert,&m_answer)); - propSetPtr->load(); - unsigned int i=0; - while(PROPS_Alert[i].propName!=0) - { - propSetPtr->subscribeProp(PROPS_Alert[i].propName); - i++; - } - m_propMap[scopeString]=propSetPtr; - } - } - } - } -} - -void ARATestDriverTask::updateETHstatus(string& propName,const GCFPValue* pvalue) -{ - LOG_INFO(formatString("updateETHstatus %s", propName.c_str())); - - GCFPVUnsigned pvUnsigned; - pvUnsigned.copy(*pvalue); - - vector<int> hardwareIndexes; - getHardwareIndexes(propName.c_str(),SCOPE_PIC_RackN_SubRackN_BoardN_ETH,hardwareIndexes); - -// int rack = hardwareIndexes[0]; -// int subrack = hardwareIndexes[1]; - int board = hardwareIndexes[2]; - - EPA_Protocol::ETHStatus ethStatus = m_systemStatus.board()(board-1).eth; - - // layout eth status: - // 31......24 23.....16 15........8 7........0 - // #RX[15..8] #RX[7..0] #Err[15..8] #Err[7..0] - if(propName.find(string(PROPNAME_STATUS),0) != string::npos) - { - // nothing to be done here - } - else if(propName.find(string(PROPNAME_FRAMESRECEIVED),0) != string::npos) - { - if(ethStatus.nof_frames != pvUnsigned.getValue()) - { - m_systemStatus.board()(board-1).eth.nof_frames = pvUnsigned.getValue(); - } - } - else if(propName.find(string(PROPNAME_FRAMESERROR),0) != string::npos) - { - if(ethStatus.nof_errors != pvUnsigned.getValue()) - { - m_systemStatus.board()(board-1).eth.nof_errors = pvUnsigned.getValue(); - } - } - else if(propName.find(string(PROPNAME_LASTERROR),0) != string::npos) - { - if(ethStatus.last_error != pvUnsigned.getValue()) - { - m_systemStatus.board()(board-1).eth.last_error = pvUnsigned.getValue(); - } - } - else if(propName.find(string(PROPNAME_FFI0),0) != string::npos) - { - if(ethStatus.ffi0 != pvUnsigned.getValue()) - { - m_systemStatus.board()(board-1).eth.ffi0 = pvUnsigned.getValue(); - } - } - else if(propName.find(string(PROPNAME_FFI1),0) != string::npos) - { - if(ethStatus.ffi1 != pvUnsigned.getValue()) - { - m_systemStatus.board()(board-1).eth.ffi1 = pvUnsigned.getValue(); - } - } - else if(propName.find(string(PROPNAME_FFI2),0) != string::npos) - { - if(ethStatus.ffi2 != pvUnsigned.getValue()) - { - m_systemStatus.board()(board-1).eth.ffi2 = pvUnsigned.getValue(); - } - } -} - -void ARATestDriverTask::updateAPstatus(string& propName,const GCFPValue* pvalue) -{ - LOG_INFO(formatString("updateAPstatus %s", propName.c_str())); - - int testI(0); - GCFPVUnsigned pvUnsigned; - GCFPVDouble pvDouble; - pvUnsigned.copy(*pvalue); - pvDouble.copy(*pvalue); - - LOG_INFO(formatString("updateAPstatus hier?? %d", ++testI)); - - vector<int> hardwareIndexes; - getHardwareIndexes(propName.c_str(),SCOPE_PIC_RackN_SubRackN_BoardN_APN,hardwareIndexes); - - int rack = hardwareIndexes[0]; - int subrack = hardwareIndexes[1]; - int board = hardwareIndexes[2]; - int ap = hardwareIndexes[3]; - - LOG_INFO(formatString("updateAPstatus hier?? %d (rack=%d,subrack=%d,board=%d,ap=%d)", ++testI,rack,subrack,board,ap)); - - // layout fpga status: - // 15..9 8 7........0 - // ----- alive temperature - if(propName.find(string(PROPNAME_STATUS),0) != string::npos) - { - // nothing to be done here - } - else if(propName.find(string(PROPNAME_TEMPERATURE),0) != string::npos) - { - if(ap==1) - m_systemStatus.board()(board-1).rsp.ap0_temp = (uint8)(pvDouble.getValue()*100); - else if(ap==2) - m_systemStatus.board()(board-1).rsp.ap1_temp = (uint8)(pvDouble.getValue()*100); - else if(ap==3) - m_systemStatus.board()(board-1).rsp.ap2_temp = (uint8)(pvDouble.getValue()*100); - else - m_systemStatus.board()(board-1).rsp.ap3_temp = (uint8)(pvDouble.getValue()*100); - } - if(propName.find(string(PROPNAME_VERSION),0) != string::npos) - { - // nothing to be done here - } -} - -void ARATestDriverTask::updateBPstatus(string& propName,const GCFPValue* pvalue) -{ - LOG_INFO(formatString("updateBPstatus %s", propName.c_str())); - - GCFPVUnsigned pvUnsigned; - GCFPVDouble pvDouble; - pvUnsigned.copy(*pvalue); - pvDouble.copy(*pvalue); - - vector<int> hardwareIndexes; - getHardwareIndexes(propName.c_str(),SCOPE_PIC_RackN_SubRackN_BoardN_BP,hardwareIndexes); - -// int rack = hardwareIndexes[0]; -// int subrack = hardwareIndexes[1]; - int board = hardwareIndexes[2]; - - // layout fpga status: - // 15..9 8 7........0 - // ----- alive temperature - if(propName.find(string(PROPNAME_STATUS),0) != string::npos) - { - // nothing to be done here - } - else if(propName.find(string(PROPNAME_TEMPERATURE),0) != string::npos) - { - m_systemStatus.board()(board-1).rsp.bp_temp = (uint8)(pvDouble.getValue()*100); - } - if(propName.find(string(PROPNAME_VERSION),0) != string::npos) - { - // nothing to be done here - } -} - -void ARATestDriverTask::updateRCUstatus(string& propName,const GCFPValue* /*pvalue*/) -{ - LOG_INFO(formatString("updateRCUstatus %s", propName.c_str())); - -/* - GCFPVBool pvBool; - GCFPVUnsigned pvUnsigned; - pvBool.copy(*pvalue); - pvUnsigned.copy(*pvalue); - - vector<int> hardwareIndexes; - getHardwareIndexes(propName.c_str(),SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN,hardwareIndexes); - -// int rack = hardwareIndexes[0]; -// int subrack = hardwareIndexes[1]; - int board = hardwareIndexes[2]; - int ap = hardwareIndexes[3]; - int rcu = hardwareIndexes[4]; - int rcuNumber = rcu + n_rcus_per_ap*(ap-1) + n_rcus_per_ap*n_aps_per_board*(board-1); - - uint8 rcuStatus; - - rcuStatus = m_systemStatus.rcu()(rcuNumber-1).status; - - // layout rcu status (for both statusX and statusY): - // 7 6 5 4 3 2 1 0 - // VDDVCCEN VHENABLE VLENABLE FILSEL1 FILSEL0 BANDSEL HBAENABLE LBAENABLE - if(propName.find(string(PROPNAME_VDDVCCEN),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0x7f; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<7); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } - else if(propName.find(string(PROPNAME_VHENABLE),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0xbf; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<6); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } - else if(propName.find(string(PROPNAME_VLENABLE),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0xdf; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<5); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } - else if(propName.find(string(PROPNAME_FILSEL1),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0xef; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<4); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } - else if(propName.find(string(PROPNAME_FILSEL0),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0xf7; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<3); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } - else if(propName.find(string(PROPNAME_BANDSEL),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0xfb; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<2); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } - else if(propName.find(string(PROPNAME_HBAENABLE),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0xd; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<1); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } - else if(propName.find(string(PROPNAME_LBAENABLE),0) != string::npos) - { - uint8 tempStatus = rcuStatus & 0xfe; // reset bits - tempStatus = tempStatus | ((uint8 )(pvBool.getValue())<<0); - if(rcuStatus != tempStatus) - { - m_systemStatus.rcu()(rcuNumber-1).status = tempStatus; - } - } -*/ -} - -void ARATestDriverTask::sendToAll(GCFEvent& event) -{ - vector<boost::shared_ptr<GCF::TM::GCFTCPPort> >::iterator it=m_childPorts.begin(); - while(it!=m_childPorts.end()) - { - (*it)->send(event); - ++it; - } -} - -void ARATestDriverTask::updateSystemStatus() -{ - // send new status to RA application - RSPUpdstatusEvent updStatusEvent; - updStatusEvent.timestamp.setNow(600.0); - updStatusEvent.status=SUCCESS; - updStatusEvent.handle=1; // ignore - updStatusEvent.sysstatus.board().reference(m_systemStatus.board().copy()); - - sendToAll(updStatusEvent); -} - -void ARATestDriverTask::updateStats() -{ - // send new stats to RA application - RSPUpdstatsEvent updStatsEvent; - updStatsEvent.timestamp.setNow(600.0); - updStatsEvent.status=SUCCESS; - - int rcu; - int subband; - for(rcu=0;rcu<n_rcus;rcu++) - { - for(subband=0;subband<MEPHeader::N_BEAMLETS;subband++) - { - double noise=(double)(rand()%1000)/500.0; - if(subband==rcu*10) - m_stats()(rcu,subband) = 4000+noise*500.0; - else - m_stats()(rcu,subband) = noise; - } - } - - updStatsEvent.stats().reference(m_stats().copy()); - - if(m_updStatsHandleSP != 0) - { - updStatsEvent.handle=m_updStatsHandleSP; - sendToAll(updStatsEvent); - } - if(m_updStatsHandleSM != 0) - { - updStatsEvent.handle=m_updStatsHandleSM; - sendToAll(updStatsEvent); - } - if(m_updStatsHandleBP != 0) - { - updStatsEvent.handle=m_updStatsHandleBP; - sendToAll(updStatsEvent); - } - if(m_updStatsHandleBM != 0) - { - updStatsEvent.handle=m_updStatsHandleBM; - sendToAll(updStatsEvent); - } -} - -void ARATestDriverTask::updatexcStats() -{ - // send new stats to RA application - RSPUpdxcstatsEvent updxcStatsEvent; - updxcStatsEvent.timestamp.setNow(600.0); - updxcStatsEvent.status=SUCCESS; - - int pol0; - int pol1; - int ap0; - int ap1; - for(pol0=0;pol0<n_pols;pol0++) - { - for(pol1=0;pol1<n_pols;pol1++) - { - for(ap0=0;ap0<n_racks*n_subracks_per_rack*n_boards_per_subrack*n_aps_per_board;ap0++) - { - for(ap1=0;ap1<n_racks*n_subracks_per_rack*n_boards_per_subrack*n_aps_per_board;ap1++) - { - complex<double> noise((double)(rand()%1000)/500.0,(double)(rand()%1000)/500.0); - complex<double> noisepeak(4000.0+noise.real()*500.0,4000.0+noise.imag()*500.0); - if(ap1%3==0) - m_xcstats()(pol0,pol1,ap0,ap1) = noisepeak; - else - m_xcstats()(pol0,pol1,ap0,ap1) = noise; - } - } - } - } - - updxcStatsEvent.stats().reference(m_xcstats().copy()); - - if(m_updxcStatsHandle != 0) - { - updxcStatsEvent.handle=m_updxcStatsHandle; - sendToAll(updxcStatsEvent); - } -} - -bool ARATestDriverTask::isEnabled() -{ - return (m_RSPserver.isConnected()); -} - -GCFEvent::TResult ARATestDriverTask::initial(GCFEvent& event, GCFPortInterface& port) -{ - LOG_DEBUG(formatString("ARATestDriverTask(%s)::initial (%s)",getName().c_str(),evtstr(event))); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - if(m_schedule!="") - m_MACSchedulerPS.load(); - else - { - // fill APCs map - addPropertySet(SCOPE_PIC); - addPropertySet(SCOPE_PIC_Maintenance); - addPropertySet(SCOPE_PIC_RackN); - addPropertySet(SCOPE_PIC_RackN_Alert); - addPropertySet(SCOPE_PIC_RackN_Maintenance); - addPropertySet(SCOPE_PIC_RackN_SubRackN); - addPropertySet(SCOPE_PIC_RackN_SubRackN_Maintenance); - addPropertySet(SCOPE_PIC_RackN_SubRackN_Alert); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_Maintenance); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_Alert); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_ETH); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_BP); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_APN); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_ADCStatistics); - addPropertySet(SCOPE_PIC_RackN_SubRackN_BoardN_APN_RCUN_Maintenance); - } - break; - - case F_ENTRY: - if(m_schedule=="") - { - m_RSPserver.open(); - } - break; - - case F_EXTPS_LOADED: - if(m_schedule!="") - { - GCFPVString command(string("SCHEDULE ") + m_schedule); - m_MACSchedulerPS.setValue("command",command); - } - break; - - case F_VSETRESP: - if(m_schedule!="") - { - stop(); - } - break; - - case F_ACCEPT_REQ: - { - boost::shared_ptr<GCFTCPPort> server(new GCFTCPPort); - server->init(*this, "RSPserver", GCFPortInterface::SPP, RSP_PROTOCOL); - m_RSPserver.accept(*(server.get())); - m_childPorts.push_back(server); - break; - } - - case F_CONNECTED: - { - LOG_DEBUG(formatString("port '%s' connected", port.getName().c_str())); - break; - } - - case F_DISCONNECTED: - { - port.close(); - break; - } - - case F_CLOSED: - { - LOG_WARN(formatString("port '%s' disconnected, retry in 3 seconds...", port.getName().c_str())); - break; - } - - case F_EXIT: - { - // cancel timers - m_RSPserver.cancelAllTimers(); - break; - } - - case F_TIMER: - { - GCFTimerEvent& timerEvent=static_cast<GCFTimerEvent&>(event); - - if(timerEvent.id == (unsigned long)m_updStatusTimerId) - { - // send updstatus message; - updateSystemStatus(); - - m_updStatusTimerId = port.setTimer(m_substatusPeriod); - } - else if(timerEvent.id == (unsigned long)m_updStatsTimerId) - { - // send updstats message; - updateStats(); - - m_updStatsTimerId = port.setTimer(m_substatsPeriod); - } - else if(timerEvent.id == (unsigned long)m_updxcStatsTimerId) - { - // send updxcstats message; - updatexcStats(); - - m_updxcStatsTimerId = port.setTimer(m_subxcstatsPeriod); - } - break; - } - - case RSP_GETSTATUS: - { - RSPGetstatusackEvent ack; - - ack.timestamp.setNow(); - ack.status = SUCCESS; - - ack.sysstatus.board().resize(1); - - BoardStatus boardinit; - - memset(&boardinit, 0, sizeof(BoardStatus)); - - ack.sysstatus.board() = boardinit; - - port.send(ack); - break; - } - case RSP_GETRCU: - { - RSPGetrcuackEvent ack; - - ack.timestamp.setNow(); - ack.status = SUCCESS; - - ack.settings().resize(8); - - port.send(ack); - break; - } - case RSP_GETSTATS: - { - RSPGetstatsackEvent ack; - - ack.timestamp.setNow(); - ack.status = SUCCESS; - ack.stats().resize(1, 8, 512); - - port.send(ack); - break; - } - case RSP_SUBSTATUS: - { - LOG_INFO("RSP_SUBSTATUS received"); - RSPSubstatusEvent substatus(event); - - m_substatusPeriod = (double)substatus.period; - m_updStatusTimerId = port.setTimer(m_substatusPeriod); - - RSPSubstatusackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - ack.handle = (int)&ack; - port.send(ack); - break; - } - - case RSP_UNSUBSTATUS: - { - LOG_INFO("RSP_UNSUBSTATUS received"); - RSPUnsubstatusEvent unsubstatus(event); - - m_substatusPeriod = 0.0; - m_updStatusTimerId = 0; - - RSPUnsubstatusackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - ack.handle = (int)&ack; - port.send(ack); - break; - } - - case RSP_SUBSTATS: - { - LOG_INFO("RSP_SUBSTATS received"); - RSPSubstatsEvent substats(event); - - RSPSubstatsackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - if(substats.type == RSP_Protocol::Statistics::SUBBAND_POWER) - { - m_updStatsHandleSP = 11; - ack.handle = m_updStatsHandleSP; - } - else if(substats.type == RSP_Protocol::Statistics::BEAMLET_POWER) - { - m_updStatsHandleBP = 21; - ack.handle = m_updStatsHandleBP; - } - else - { - ack.status = FAILURE; - ack.handle = 0; - } - m_substatsPeriod = (double)substats.period; - m_updStatsTimerId = port.setTimer(m_substatsPeriod); - - port.send(ack); - break; - } - - case RSP_UNSUBSTATS: - { - LOG_INFO("RSP_UNSUBSTATS received"); - RSPUnsubstatsEvent unsubstats(event); - - m_substatsPeriod = 0.0; - m_updStatsTimerId = 0; - - RSPUnsubstatsackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - ack.handle = (int)&ack; - port.send(ack); - break; - } - - case RSP_SUBXCSTATS: - { - LOG_INFO("RSP_SUBXCSTATS received"); - RSPSubxcstatsEvent subxcstats(event); - - RSPSubxcstatsackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - - m_updxcStatsHandle = 31; - ack.handle = m_updxcStatsHandle; - - m_subxcstatsPeriod = (double)subxcstats.period; - m_updxcStatsTimerId = port.setTimer(m_subxcstatsPeriod); - - port.send(ack); - break; - } - - case RSP_UNSUBXCSTATS: - { - LOG_INFO("RSP_UNSUBXCSTATS received"); - RSPUnsubxcstatsEvent unsubxcstats(event); - - m_subxcstatsPeriod = 0.0; - m_updxcStatsTimerId = 0; - - RSPUnsubxcstatsackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - ack.handle = (int)&ack; - port.send(ack); - break; - } - - case RSP_GETVERSION: - { - LOG_INFO("RSP_GETVERSION received"); - RSPGetversionEvent getversion(event); - - RSP_Protocol::Versions versions; - versions.bp().resize(n_racks*n_subracks_per_rack*n_boards_per_subrack); - versions.ap().resize(n_racks*n_subracks_per_rack*n_boards_per_subrack*n_aps_per_board); - for(int board=0;board<n_racks*n_subracks_per_rack*n_boards_per_subrack;board++) - { - versions.bp()(board).fpga_min = (board+1)*8; - versions.bp()(board).fpga_maj = (board+1)*8; - LOG_INFO(formatString("bp[%d].version = 0x%x",board,versions.bp()(board))); - for(int ap=0;ap<MEPHeader::N_AP; ap++) - { - versions.ap()(board * MEPHeader::N_AP + ap).fpga_min = ((board+1)<<4)+ap; - versions.ap()(board * MEPHeader::N_AP + ap).fpga_maj = ((board+1)<<4)+ap; - LOG_INFO(formatString("ap[%d][%d].version = 0x%x",board,ap,versions.ap()(board * MEPHeader::N_AP + ap))); - } - } - - RSPGetversionackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - ack.versions.bp().reference(versions.bp().copy()); - ack.versions.ap().reference(versions.ap().copy()); - - port.send(ack); - break; - } - - case RSP_GETCONFIG: - { - RSPGetconfigackEvent ack; - ack.n_rcus=n_rcus; - ack.n_rspboards=n_boards_per_subrack*n_subracks_per_rack*n_racks; - ack.max_rspboards=1; - port.send(ack); - break; - } - -/* - case RSP_SETCLOCKS: - { - RSPSetclocksackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - port.send(ack); - break; - } -*/ - - case RSP_SETRCU: - { - LOG_INFO("RSP_SETRCU received"); - - RSPSetrcuackEvent ack; - ack.timestamp.setNow(600.0); - ack.status = SUCCESS; - - port.send(ack); - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - GCFPVUnsigned pvUnsigned; - GCFPVDouble pvDouble; - GCFPVBool pvBool; - GCFPVString pvString; - switch(pPropAnswer->pValue->getType()) - { - case LPT_BOOL: - pvBool.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("property changed: %s=%d", pPropAnswer->pPropName, pvBool.getValue())); - break; - case LPT_UNSIGNED: - pvUnsigned.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("property changed: %s=%d", pPropAnswer->pPropName, pvUnsigned.getValue())); - break; - case LPT_DOUBLE: - pvDouble.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("property changed: %s=%f", pPropAnswer->pPropName, pvDouble.getValue())); - break; - case LPT_STRING: - pvString.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("property changed: %s=%s", pPropAnswer->pPropName, pvString.getValue().c_str())); - break; - case NO_LPT: - case LPT_CHAR: - case LPT_INTEGER: - case LPT_BIT32: - case LPT_BLOB: - case LPT_REF: - case LPT_DATETIME: - case LPT_DYNARR: - case LPT_DYNBOOL: - case LPT_DYNCHAR: - case LPT_DYNUNSIGNED: - case LPT_DYNINTEGER: - case LPT_DYNBIT32: - case LPT_DYNBLOB: - case LPT_DYNREF: - case LPT_DYNDOUBLE: - case LPT_DYNDATETIME: - case LPT_DYNSTRING: - default: - break; - } - // for now, we are only interested in changes of the BP status, AP status, - // ETH status or RCU status; - string propName(pPropAnswer->pPropName); - - if(propName.find(string("_Maintenance"),0) == string::npos) - { - if(propName.find(string("_ETH"),0) != string::npos) - { - updateETHstatus(propName,pPropAnswer->pValue); - } - else if(propName.find(string("_BP"),0) != string::npos) - { - updateBPstatus(propName,pPropAnswer->pValue); - } - else if(propName.find(string("_RCU"),0) != string::npos) - { - updateRCUstatus(propName,pPropAnswer->pValue); - } - else if(propName.find(string("_AP"),0) != string::npos) - { - updateAPstatus(propName,pPropAnswer->pValue); - } - } - break; - } - - default: - LOG_DEBUG(formatString("ARATestDriverTask(%s)::initial, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -GCFEvent::TResult ARATestDriverTask::enabled(GCFEvent& event, GCFPortInterface& port) -{ - LOG_DEBUG(formatString("ARATestDriverTask(%s)::enabled (%s)",getName().c_str(),evtstr(event))); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - break; - } - - case F_EXIT: - { - break; - } - - default: - LOG_DEBUG(formatString("ARATestDriverTask(%s)::enabled, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -void ARATestDriverTask::getHardwareIndexes(const string& propName,const string& scope, vector<int>& hardwareIndexes) -{ - hardwareIndexes.clear(); - const int numIndexes=10; - int indexes[numIndexes]; - - string scanScope = GCFPVSSInfo::getLocalSystemName() + string(":")+scope; - sscanf(propName.c_str(),scanScope.c_str(),&indexes[0],&indexes[1],&indexes[2],&indexes[3],&indexes[4],&indexes[5],&indexes[6],&indexes[7],&indexes[8],&indexes[9]); - for(int i=0;i<numIndexes;i++) - { - hardwareIndexes.push_back(indexes[i]); - } -} - -} // namespace ARA - - -} // namespace LOFAR - diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestDriverTask.h b/MAC/APL/PIC/_RegisterAccess/test/ARATestDriverTask.h deleted file mode 100644 index a5fc8790614dcd0f6695c16591d27dabff717a53..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/ARATestDriverTask.h +++ /dev/null @@ -1,123 +0,0 @@ -//# ARATestDriverTask.h: Automatic test of the RegisterAccess application -//# -//# 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$ - -#ifndef ARATestDriverTask_H -#define ARATestDriverTask_H - -//# Includes -//# Common Includes - -//# GCF Includes -#include <GCF/TM/GCF_Task.h> -#include <GCF/TM/GCF_TCPPort.h> -#include <GCF/PAL/GCF_ExtPropertySet.h> -#include <GCF/GCF_PValue.h> -#include <GCF/GCF_PVUnsigned.h> -#include <GCF/GCF_PVString.h> -#include <GCF/GCF_PVBool.h> -#include <GCF/GCF_PVDouble.h> -#include <boost/shared_ptr.hpp> -#include <map> - -#include "ARATestAnswer.h" - - -namespace LOFAR -{ - -// forward declaration -class GCF::TM::GCFEvent; - -namespace ARA -{ - class ARATestDriverTask : public GCF::TM::GCFTask - { - public: - ARATestDriverTask(); - virtual ~ARATestDriverTask(); - - void schedule(string schedule); - - protected: - // protected copy constructor - ARATestDriverTask(const ARATestDriverTask&); - // protected assignment operator - ARATestDriverTask& operator=(const ARATestDriverTask&); - - private: - typedef map<string,boost::shared_ptr<GCF::PAL::GCFExtPropertySet> > TPropertyMap; - - void addPropertySet(string scope); - void updateETHstatus(string& propName,const GCF::Common::GCFPValue* pvalue); - void updateAPstatus(string& propName,const GCF::Common::GCFPValue* pvalue); - void updateBPstatus(string& propName,const GCF::Common::GCFPValue* pvalue); - void updateRCUstatus(string& propName,const GCF::Common::GCFPValue* pvalue); - void updateSystemStatus(); - void updateStats(); - void updatexcStats(); - bool isEnabled(); - GCF::TM::GCFEvent::TResult initial(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult enabled(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - void getHardwareIndexes(const string& propName,const string& scope, vector<int>& hardwareIndexes); - void sendToAll(GCF::TM::GCFEvent& event); - - - static string m_taskName; - static string m_RATestServerName; - - ARATestAnswer m_answer; - GCF::TM::GCFTCPPort m_RSPserver; - vector<boost::shared_ptr<GCF::TM::GCFTCPPort> > m_childPorts; - TPropertyMap m_propMap; - - RSP_Protocol::SystemStatus m_systemStatus; - RSP_Protocol::Statistics m_stats; - RSP_Protocol::XCStatistics m_xcstats; - - double m_substatusPeriod; - double m_substatsPeriod; - double m_subxcstatsPeriod; - long m_updStatusTimerId; - long m_updStatsTimerId; - long m_updxcStatsTimerId; - uint32 m_updStatsHandleSP; - uint32 m_updStatsHandleSM; - uint32 m_updStatsHandleBP; - uint32 m_updStatsHandleBM; - uint32 m_updxcStatsHandle; - int n_racks; - int n_subracks_per_rack; - int n_boards_per_subrack; - int n_aps_per_board; - int n_rcus_per_ap; - int n_rcus; - int n_pols; - - string m_schedule; - GCF::PAL::GCFExtPropertySet m_MACSchedulerPS; - }; -}; - - -} // namespace LOFAR - -#endif diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestMain.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATestMain.cc deleted file mode 100644 index 2ae31d4d0066de46dc0d2ab32b7970705e8a2841..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/ARATestMain.cc +++ /dev/null @@ -1,94 +0,0 @@ -//# ARATestMain.cc: Main entry for the Register Access test -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -#include <APL/RSP_Protocol/RSP_Protocol.ph> - -#undef PACKAGE -#undef VERSION -#include <GCF/CmdLine.h> -#include <GCF/TM/GCF_Task.h> -#include "ARATestTask.h" -#include "ARATestDriverTask.h" -#include <boost/shared_ptr.hpp> -#include <Suite/suite.h> - -using namespace std; - -using namespace LOFAR; -using namespace ARA; -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; - -int main(int argc, char* argv[]) -{ - int retval=-1; - - { - GCFTask::init(argc, argv); - - LOG_INFO(formatString("Program %s has started", argv[0])); - - CCmdLine cmdLine; - - bool noTest=false; - bool schedule=false; - // parse argc,argv - if (cmdLine.SplitLine(argc, argv) > 0) - { - noTest = cmdLine.HasSwitch("-notest"); - schedule = cmdLine.HasSwitch("-schedule"); - } - - // create test driver task. - if(noTest) - { - ARATestDriverTask testDriverTask; - testDriverTask.start(); // make initial transition - GCFTask::run(); //is also called by the ARATest class - } - else if(schedule) - { - ARATestDriverTask testDriverTask; - testDriverTask.schedule(cmdLine.GetSafeArgument("-schedule", 0, "VI1.ps")); - testDriverTask.start(); // make initial transition - GCFTask::run(); //is also called by the ARATest class - } - else - { - Suite s("MAC.APL.PIC RegisterAccess Test",&std::cout); - - boost::shared_ptr<ARATestTask> araTest(new ARATestTask); - s.addTest(araTest.get()); - s.run(); - retval=s.report(); - s.free(); - } - } - return retval; -} - - diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.cc deleted file mode 100644 index 9c227c0dcfd5bca72666ce12966759c8eb44e18f..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.cc +++ /dev/null @@ -1,931 +0,0 @@ -//# ARATestTask.cc: Implementation of the Virtual Telescope test -//# -//# 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$ -#undef PACKAGE -#undef VERSION -#include <lofar_config.h> -#include <Common/LofarLogger.h> - -#include <math.h> -#include <GCF/GCF_PValue.h> -#include <GCF/GCF_PVUnsigned.h> -#include <GCF/GCF_PVString.h> -#include <GCF/GCF_PVDouble.h> -#include "APL/APLCommon/APL_Defines.h" -#include "ARATestTask.h" -#include "../src/ARAPropertyDefines.h" - -#include <APL/RSP_Protocol/RSP_Protocol.ph> - -#include <stdio.h> - -#include <bitset> -#include <time.h> - -const char SCOPE_PAC_LDS[] = "PAC_LogicalDeviceScheduler"; -const char SCOPE_PIC_Rack0_SubRack0_Board0_AP0[] = "PIC_Rack0_SubRack0_Board0_AP"; -const char SCOPE_PIC_Rack0_SubRack0_Board0_AP0_RCU0_Maintenance[] = "PIC_Rack0_SubRack0_Board0_AP0_RCU0_Maintenance"; -const char SCOPE_PIC_Rack0_SubRack0_Board0_Alert[] = "PIC_Rack0_SubRack0_Board0_Alert"; - -#define NEXT_TEST(_test_, _descr_) \ - { \ - setCurSubTest(#_test_, _descr_); \ - TRAN(ARATestTask::test##_test_); \ - } - -#define FINISH \ - { \ - reportSubTest(); \ - TRAN(ARATestTask::finished); \ - } - -#define ABORT_TESTS \ - { \ - cout << "TESTS ABORTED due to an ERROR or terminated" << endl; \ - FINISH; \ - } - -#define FAIL_AND_ABORT(_txt_) \ - { \ - FAIL(_txt_); \ - ABORT_TESTS; \ - } - -#define TESTC_ABORT_ON_FAIL(cond) \ - if (!TESTC(cond)) \ - { \ - ABORT_TESTS; \ - break; \ - } - -#define TESTC_DESCR_ABORT_ON_FAIL(cond, _descr_) \ - if (!TESTC_DESCR(cond, _descr_)) \ - { \ - ABORT_TESTS; \ - break; \ - } - -using namespace LOFAR::GCF::Common; -using namespace LOFAR::GCF::TM; -using namespace LOFAR::GCF::PAL; -using namespace std; - -namespace LOFAR -{ - -namespace ARA -{ - -string ARATestTask::m_taskName("ARATest"); - -ARATestTask::ARATestTask() : - GCFTask((State)&ARATestTask::initial, m_taskName), - Test("RegisterAccessTest"), - m_answer(), - m_RSPserver(), - m_test_passCounter(0), - m_propsetLoadedCounter(0), - m_extPropSetAP0(SCOPE_PIC_Rack0_SubRack0_Board0_AP0,TYPE_LCU_PIC_FPGA,&m_answer), - m_extPropSetAP0RCUmaintenance(SCOPE_PIC_Rack0_SubRack0_Board0_AP0_RCU0_Maintenance,TYPE_LCU_PIC_Maintenance,&m_answer), - m_extPropSetBoardAlert(SCOPE_PIC_Rack0_SubRack0_Board0_Alert,TYPE_LCU_PIC_Alert,&m_answer), - m_extPropSetStationMaintenance(SCOPE_PIC_Maintenance,TYPE_LCU_PIC_Maintenance,&m_answer), - m_extPropSetLDS(SCOPE_PAC_LDS,TYPE_LCU_PAC_LogicalDeviceScheduler,&m_answer) -{ - registerProtocol(RSP_PROTOCOL, RSP_PROTOCOL_signalnames); - m_answer.setTask(this); - - m_RSPserver.init(*this, "RSPserver", GCFPortInterface::SPP, RSP_PROTOCOL); -} - -ARATestTask::~ARATestTask() -{ -} - -void ARATestTask::run() -{ - start(); // make initial transition - GCFTask::run(); -} - -bool ARATestTask::isEnabled() -{ - return (m_RSPserver.isConnected()); -} - -GCFEvent::TResult ARATestTask::initial(GCFEvent& event, GCFPortInterface& port) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::initial (%s)",getName().c_str(),evtstr(event))); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - m_extPropSetAP0.load(); - m_extPropSetAP0RCUmaintenance.load(); - m_extPropSetBoardAlert.load(); - m_extPropSetStationMaintenance.load(); - m_extPropSetLDS.load(); - break; - - case F_EXTPS_LOADED: - m_propsetLoadedCounter++; - if(m_propsetLoadedCounter==5) - { - if (!m_RSPserver.isConnected()) - { - m_RSPserver.open(); - } - } - break; - - case F_CONNECTED: - { - LOG_DEBUG(formatString("port '%s' connected", port.getName().c_str())); - if (isEnabled()) - { - NEXT_TEST(1,"Monitor FPGA registers. Goal: load secondary properties"); - } - break; - } - - case F_DISCONNECTED: - { - port.setTimer((long)3); // try again in 3 seconds - LOG_WARN(formatString("port '%s' disconnected, retry in 3 seconds...", port.getName().c_str())); - port.close(); - break; - } - - case F_TIMER: - { - LOG_INFO(formatString("port '%s' retry of open...", port.getName().c_str())); - port.open(); - break; - } - - case F_EXIT: - { - // cancel timers - m_RSPserver.cancelAllTimers(); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::initial, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -/* - * Test case 1: Monitor FPGA registers. Goal: load secondary properties - */ -GCFEvent::TResult ARATestTask::test1(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test1 (%s)",getName().c_str(),evtstr(event))); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.1.1: Monitor FPGA registers. Goal: load secondary properties"); - if(!TESTC(GCF_NO_ERROR==m_extPropSetAP0.requestValue(PROPNAME_STATUS))); - { - NEXT_TEST(2,"put 1 antenna in maintenance"); - } - break; - } - - case F_VGETRESP: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - TESTC(strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_AP0)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0); - // display the value: - GCFPVUnsigned status; - status.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,status.getValue())); - - NEXT_TEST(2,"put 1 antenna in maintenance"); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test1, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -/* - * Test case 2: put 1 antenna in maintenance - */ -GCFEvent::TResult ARATestTask::test2(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test2 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.2.1: put 1 antenna in maintenance"); - m_extPropSetAP0RCUmaintenance.subscribeProp(PROPNAME_STATUS); - GCFPVUnsigned inMaintenance(1); - if(!TESTC(GCF_NO_ERROR==m_extPropSetAP0RCUmaintenance.setValue(PROPNAME_STATUS,inMaintenance))) - { - NEXT_TEST(3,"put station in maintenance"); - } - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - GCFPVUnsigned inMaintenance; - inMaintenance.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,inMaintenance.getValue())); - TESTC( - strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_AP0_RCU0_Maintenance)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && - inMaintenance.getValue()!=0 ); - // display the value: - NEXT_TEST(3,"put station in maintenance"); - break; - } - - case F_EXIT: - { - m_extPropSetAP0RCUmaintenance.unsubscribeProp(PROPNAME_STATUS); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test2, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -/* - * Test case 3: put station in maintenance - */ -GCFEvent::TResult ARATestTask::test3(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test3 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.2.2: put station in maintenance"); - m_extPropSetStationMaintenance.subscribeProp(PROPNAME_STATUS); - GCFPVUnsigned inMaintenance(1); - if(!TESTC(GCF_NO_ERROR==m_extPropSetStationMaintenance.setValue(PROPNAME_STATUS,inMaintenance))) - { - NEXT_TEST(4,"put station out of maintenance"); - } - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - GCFPVUnsigned inMaintenance; - inMaintenance.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,inMaintenance.getValue())); - TESTC( - strstr(pPropAnswer->pPropName,SCOPE_PIC_Maintenance)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && - inMaintenance.getValue()!=0 ); - // display the value: - - NEXT_TEST(4,"put station out of maintenance"); - break; - } - - case F_EXIT: - { - m_extPropSetStationMaintenance.unsubscribeProp(PROPNAME_STATUS); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test3, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -/* - * Test case 4: put station out of maintenance - */ -GCFEvent::TResult ARATestTask::test4(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test4 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.2.3: put station out of maintenance"); - m_extPropSetStationMaintenance.subscribeProp(PROPNAME_STATUS); - GCFPVUnsigned inMaintenance(0); - if(!TESTC(GCF_NO_ERROR==m_extPropSetStationMaintenance.setValue(PROPNAME_STATUS,inMaintenance))) - { - NEXT_TEST(5,"put antenna out of maintenance"); - } - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - GCFPVUnsigned inMaintenance; - inMaintenance.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,inMaintenance.getValue())); - TESTC( - strstr(pPropAnswer->pPropName,SCOPE_PIC_Maintenance)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && - inMaintenance.getValue()==0 ); - - // check maintenance status of antenna - if(!TESTC(GCF_NO_ERROR==m_extPropSetAP0RCUmaintenance.requestValue(PROPNAME_STATUS))) - { - NEXT_TEST(5,"put antenna out of maintenance"); - } - break; - } - - case F_VGETRESP: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - GCFPVUnsigned inMaintenance; - inMaintenance.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,inMaintenance.getValue())); - TESTC( - strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_AP0_RCU0_Maintenance)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && - inMaintenance.getValue()!=0 ); - NEXT_TEST(5,"put antenna out of maintenance"); - break; - } - - case F_EXIT: - { - m_extPropSetStationMaintenance.unsubscribeProp(PROPNAME_STATUS); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test4, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -/* - * Test case 5: put antenna out of maintenance - */ -GCFEvent::TResult ARATestTask::test5(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test5 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.2.4: put antenna out of maintenance"); - m_extPropSetAP0RCUmaintenance.subscribeProp(PROPNAME_STATUS); - GCFPVUnsigned inMaintenance(0); - if(!TESTC(GCF_NO_ERROR==m_extPropSetAP0RCUmaintenance.setValue(PROPNAME_STATUS,inMaintenance))) - { - NEXT_TEST(6,"schedule maintenance of 1 antenna"); - } - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - GCFPVUnsigned inMaintenance; - inMaintenance.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,inMaintenance.getValue())); - TESTC( - strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_AP0_RCU0_Maintenance)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && - inMaintenance.getValue()==0 ); - NEXT_TEST(6,"schedule maintenance of 1 antenna"); - break; - } - - case F_EXIT: - { - m_extPropSetAP0RCUmaintenance.unsubscribeProp(PROPNAME_STATUS); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test5, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -/* - * Test case 6: schedule maintenance of 1 antenna - */ -GCFEvent::TResult ARATestTask::test6(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test6 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.2.5: schedule maintenance of 1 antenna"); - - m_extPropSetAP0RCUmaintenance.subscribeProp(PROPNAME_STATUS); - m_test_passCounter=0; - // MAINTENANCE <scheduleid>,<resource>,<starttime>,<stoptime> - string cmd("MAINTENANCE 1,"); - string resource(string("PIC_Rack0_SubRack0_Board0_AP0_RCU0")+string(",")); - - // create time 10 seconds from now - time_t timeNow = time(0); - struct tm* utcTimeStruct = gmtime(&timeNow); - time_t utcTime = mktime(utcTimeStruct); - time_t startTime = utcTime + 10; // UTC + 10 seconds - time_t stopTime = startTime + 10; // starttime + 10 seconds - char timesString[100]; - sprintf(timesString,"%d,%d",(int)startTime,(int)stopTime); - - string times(timesString); - GCFPVString command(cmd+resource+times); - - if(!TESTC(GCF_NO_ERROR==m_extPropSetLDS.setValue("command",command))) - { - NEXT_TEST(7,"schedule maintenance of entire station"); - } - else - { - printf("the resource will be put in maintenance in 10 seconds... Please wait\n"); - } - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - if(strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_AP0_RCU0_Maintenance)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0) - { - GCFPVUnsigned inMaintenance; - inMaintenance.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,inMaintenance.getValue())); - if(m_test_passCounter==0) // first pass: in maintenance - { - { - if(!TESTC(inMaintenance.getValue()!=0)) - { - NEXT_TEST(7,"schedule maintenance of entire station"); - } - else - { - printf("the resource will be put out of maintenance in 10 seconds... Please wait\n"); - } - } - m_test_passCounter++; - } - else if(m_test_passCounter==1) // second pass: out of maintenance - { - TESTC(inMaintenance.getValue()==0); - NEXT_TEST(7,"schedule maintenance of entire station"); - } - } - break; - } - - case F_EXIT: - { - m_extPropSetAP0RCUmaintenance.unsubscribeProp(PROPNAME_STATUS); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test6, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - return status; -} - -/* - * Test case 7: schedule maintenance of entire station - */ -GCFEvent::TResult ARATestTask::test7(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test7 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.2.6: schedule maintenance of entire station"); - - m_extPropSetStationMaintenance.subscribeProp(PROPNAME_STATUS); - m_test_passCounter=0; - // MAINTENANCE <scheduleid>,<resource>,<starttime>,<stoptime> - string cmd("MAINTENANCE 2,"); - string resource(string("PIC")+string(",")); - // create time 10 seconds from now - time_t timeNow = time(0); - struct tm* utcTimeStruct = gmtime(&timeNow); - time_t utcTime = mktime(utcTimeStruct); - time_t startTime = utcTime + 10; // UTC + 10 seconds - time_t stopTime = startTime + 10; // starttime + 10 seconds - char timesString[100]; - sprintf(timesString,"%d,%d",(int)startTime,(int)stopTime); - - string times(timesString); - GCFPVString command(cmd+resource+times); - - if(!TESTC(GCF_NO_ERROR==m_extPropSetLDS.setValue("command",command))) - { - NEXT_TEST(8,"simulate board defect"); - } - else - { - printf("the resource will be put in maintenance in 10 seconds... Please wait\n"); - } - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - if(strstr(pPropAnswer->pPropName,SCOPE_PIC_Maintenance)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0) - { - GCFPVUnsigned inMaintenance; - inMaintenance.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,inMaintenance.getValue())); - if(m_test_passCounter==0) // first pass: in maintenance - { - { - if(!TESTC(inMaintenance.getValue()!=0)) - { - NEXT_TEST(8,"simulate board defect"); - } - else - { - printf("the resource will be put out of maintenance in 10 seconds... Please wait\n"); - } - } - m_test_passCounter++; - } - else if(m_test_passCounter==1) // second pass: out of maintenance - { - TESTC(inMaintenance.getValue()==0); - NEXT_TEST(8,"simulate board defect"); - } - } - break; - } - - case F_EXIT: - { - m_extPropSetStationMaintenance.unsubscribeProp(PROPNAME_STATUS); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test7, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - return status; -} - -/* - * Test case 8: simulate board defect - */ -GCFEvent::TResult ARATestTask::test8(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test8 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.3.1: simulate board defect"); - m_extPropSetBoardAlert.subscribeProp(PROPNAME_STATUS); - - // send write register message to RA test port - RSPUpdstatusEvent updStatusEvent; - struct timeval timeValNow; - time(&timeValNow.tv_sec); - timeValNow.tv_usec=0; - updStatusEvent.timestamp.set(timeValNow); - updStatusEvent.status=1; - updStatusEvent.handle=1; - - EPA_Protocol::BoardStatus boardStatus; - memset(&boardStatus,0,sizeof(boardStatus)); - boardStatus.rsp.ap0_temp = 2850; - boardStatus.rsp.ap1_temp = 2902; - boardStatus.rsp.ap2_temp = 2953; - boardStatus.rsp.ap3_temp = 3005; - - m_RSPserver.send(updStatusEvent); - - // now wait for the alert status to change - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - if(strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_Alert)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0) - { - // check alert status - GCFPVUnsigned status; - status.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,status.getValue())); - TESTC(status.getValue()!=0); - NEXT_TEST(9,"simulate board defect fixed"); - } - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test8, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - -/* - * Test case 9: simulate board defect fixed - */ -GCFEvent::TResult ARATestTask::test9(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test9 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.3.2: simulate board defect fixed"); - // test8 already subscribed us to the alert status property - - // send write register message to RA test port - RSPUpdstatusEvent updStatusEvent; - struct timeval timeValNow; - time(&timeValNow.tv_sec); - timeValNow.tv_usec=0; - updStatusEvent.timestamp.set(timeValNow); - updStatusEvent.status=0; - updStatusEvent.handle=1; - - EPA_Protocol::BoardStatus boardStatus; - memset(&boardStatus,0,sizeof(boardStatus)); - boardStatus.rsp.ap0_temp = 28; - boardStatus.rsp.ap1_temp = 29; - boardStatus.rsp.ap2_temp = 30; - boardStatus.rsp.ap3_temp = 31; - - m_RSPserver.send(updStatusEvent); - - // now wait for the alert status to change - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - if(strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_Alert)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0) - { - // check alert status - GCFPVUnsigned status; - status.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,status.getValue())); - TESTC(status.getValue()==0); - NEXT_TEST(10,"put all rcu's in overflow"); - } - break; - } - - case F_EXIT: - { - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test9, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - - -/* - * Test case 10: put all rcu's in overflow - */ -GCFEvent::TResult ARATestTask::test10(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::test10 (%d)",getName().c_str(),event.signal)); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - { - LOG_INFO("3.2.3.1a: simulate all rcu's overflow"); - - // send write register message to RA test port - RSPUpdstatusEvent updStatusEvent; - struct timeval timeValNow; - time(&timeValNow.tv_sec); - timeValNow.tv_usec=0; - updStatusEvent.timestamp.set(timeValNow); - updStatusEvent.status=0; - updStatusEvent.handle=1; - - EPA_Protocol::BoardStatus boardStatus; - memset(&boardStatus,0,sizeof(boardStatus)); - boardStatus.rsp.ap0_temp = 28; - boardStatus.rsp.ap1_temp = 29; - boardStatus.rsp.ap2_temp = 30; - boardStatus.rsp.ap3_temp = 31; - - m_RSPserver.send(updStatusEvent); - - // now wait for the alert status to change - break; - } - - case F_VCHANGEMSG: - { - // check which property changed - GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event); - assert(pPropAnswer); - if(strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack0_SubRack0_Board0_Alert)!=0 && - strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0) - { - // check alert status - GCFPVUnsigned status; - status.copy(*pPropAnswer->pValue); - LOG_INFO(formatString("Value of '%s': %d",pPropAnswer->pPropName,status.getValue())); - TESTC(status.getValue()!=0); - FINISH - } - break; - } - - case F_EXIT: - { - m_extPropSetBoardAlert.unsubscribeProp(PROPNAME_STATUS); - break; - } - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::test10, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - - - -/* - * End of all tests - */ -GCFEvent::TResult ARATestTask::finished(GCFEvent& event, GCFPortInterface& /*p*/) -{ - LOG_DEBUG(formatString("ARATestTask(%s)::finished (%s)",getName().c_str(),evtstr(event))); - GCFEvent::TResult status = GCFEvent::HANDLED; - - switch (event.signal) - { - case F_INIT: - break; - - case F_ENTRY: - GCFTask::stop(); - break; - - default: - LOG_DEBUG(formatString("ARATestTask(%s)::finished, default",getName().c_str())); - status = GCFEvent::NOT_HANDLED; - break; - } - - return status; -} - - -} // namespace ARA - - -} // namespace LOFAR - diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.h b/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.h deleted file mode 100644 index bfb9d75cbcf2e6899646745c2a4ea13c7ab7a985..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.h +++ /dev/null @@ -1,95 +0,0 @@ -//# ARATestTask.h: Automatic test of the RegisterAccess application -//# -//# 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$ - -#ifndef ARATestTask_H -#define ARATestTask_H - -//# Includes -//# Common Includes - -//# GCF Includes -#include <GCF/TM/GCF_Task.h> -#include <GCF/PAL/GCF_ExtPropertySet.h> -#include <boost/shared_ptr.hpp> -#include <Suite/test.h> - -#include "ARATestAnswer.h" - -namespace LOFAR -{ - -// forward declaration -class GCF::TM::GCFEvent; - -namespace ARA -{ - class ARATestTask : public GCF::TM::GCFTask, public Test - { - public: - ARATestTask(); - virtual ~ARATestTask(); - void run(); - - protected: - // protected copy constructor - ARATestTask(const ARATestTask&); - // protected assignment operator - ARATestTask& operator=(const ARATestTask&); - - private: - bool isEnabled(); - GCF::TM::GCFEvent::TResult initial(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test1(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test2(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test3(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test4(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test5(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test6(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test7(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test8(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test9(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult test10(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - GCF::TM::GCFEvent::TResult finished(GCF::TM::GCFEvent& e, GCF::TM::GCFPortInterface& p); - - - static string m_taskName; - static string m_RATestServerName; - - ARATestAnswer m_answer; - GCF::TM::GCFPort m_RSPserver; - - int m_test_passCounter; - int m_propsetLoadedCounter; - - GCF::PAL::GCFExtPropertySet m_extPropSetAP0; - GCF::PAL::GCFExtPropertySet m_extPropSetAP0RCUmaintenance; - GCF::PAL::GCFExtPropertySet m_extPropSetBoardAlert; - GCF::PAL::GCFExtPropertySet m_extPropSetStationMaintenance; - GCF::PAL::GCFExtPropertySet m_extPropSetLDS; - - }; -}; - -} // namespace LOFAR - - -#endif diff --git a/MAC/APL/PIC/_RegisterAccess/test/Makefile.am b/MAC/APL/PIC/_RegisterAccess/test/Makefile.am deleted file mode 100644 index 2b9e05ed257b1d0f49b822ca2c46693b5285bef6..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -bin_PROGRAMS = aratest - -TESTS = #aratest - -aratest_CPPFLAGS= \ - -I$(top_srcdir)/../GCF/GCFCommon/src \ - -I$(top_srcdir)/PIC/RegisterAccess/src \ - -Wno-deprecated \ - -fmessage-length=0 \ - -fdiagnostics-show-location=once - -aratest_SOURCES = \ - ARATestAnswer.cc \ - ARATestTask.cc \ - ARATestDriverTask.cc \ - ARATestMain.cc - -NOINSTHDRS = \ - ARATestAnswer.h \ - ARATestTask.h \ - ARATestDriverTask.h - -INSTHDRS = - -pkginclude_HEADERS = $(NOINSTHDRS) $(INSTHDRS) - -DOCHDRS = $(pkginclude_HEADERS) - -include_HEADERS = - -BUILT_SOURCES = \ - aratest.conf \ - aratest.log_prop - -EXTRA_DIST = $(BUILT_SOURCES) $(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= \ - aratest.conf \ - aratest.log_prop - -%.log_prop: %.log_prop.in - cp $< $@ - -%.conf: %.conf.in - cp $< $@ - -include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/PIC/_RegisterAccess/test/aratest.conf.in b/MAC/APL/PIC/_RegisterAccess/test/aratest.conf.in deleted file mode 100644 index f11d76d38b3fa8f8146ee037a17b12be6ee6d22f..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/aratest.conf.in +++ /dev/null @@ -1,11 +0,0 @@ -mac.ns.ARATest.RSPserver.type=TCP -mac.ns.ARATestDriver.RSPserver.type=TCP -mac.ns.RSP.acceptor.type=TCP - -mac.apl.ara.N_RACKS=6 -mac.apl.ara.N_SUBRACKS_PER_RACK=4 -mac.apl.ara.N_BOARDS_PER_SUBRACK=1 -mac.apl.ara.N_APS_PER_BOARD=4 -mac.apl.ara.N_RCUS_PER_AP=2 -mac.apl.ara.STATUS_UPDATE_INTERVAL=10 -mac.apl.ara.STATISTICS_UPDATE_INTERVAL=10 diff --git a/MAC/APL/PIC/_RegisterAccess/test/aratest.log_prop.in b/MAC/APL/PIC/_RegisterAccess/test/aratest.log_prop.in deleted file mode 100644 index 8e977832df59075e75d402c419129c6075b3a7c4..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/aratest.log_prop.in +++ /dev/null @@ -1,21 +0,0 @@ -# add your custom loggers and appenders here -# - -log4cplus.rootLogger=INFO, STDOUT -log4cplus.additivity.ASTRON=FALSE - -log4cplus.appender.STDOUT=log4cplus::ConsoleAppender -log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout -log4cplus.appender.STDOUT.layout.ConversionPattern=%x %D{%d-%m-%y %H:%M:%S} %-5p %c{9} - %m [%.25l]%n -log4cplus.appender.STDOUT.logToStdErr=true - -log4cplus.appender.FILE=log4cplus::RollingFileAppender -log4cplus.appender.FILE.File=../log/aratest.log -log4cplus.appender.FILE.MaxFileSize=5MB -log4cplus.appender.FILE.MaxBackupIndex=5 -log4cplus.appender.FILE.layout=log4cplus::PatternLayout -log4cplus.appender.FILE.layout.ConversionPattern=%x %D{%d-%m-%y %H:%M:%S} %-5p %c{3} - %m [%.25l]%n - -log4cplus.additivity.MAC=FALSE -log4cplus.logger.MAC=TRACE, STDOUT, FILE - diff --git a/MAC/APL/PIC/_RegisterAccess/test/aratest_report.txt b/MAC/APL/PIC/_RegisterAccess/test/aratest_report.txt deleted file mode 100644 index 778c7e2394d70b6394c2a00f8763a8338f050dc4..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/_RegisterAccess/test/aratest_report.txt +++ /dev/null @@ -1,52 +0,0 @@ -Test report aratest 29-09-2004 11:25 - -Start (sub)test RegisterAccessTest.1: Monitor FPGA registers. Goal: load secondary properties -Test: (GCF_NO_ERROR==m_extPropSetAP1.requestValue(PROPNAME_STATUS)) => succeed [ARATestTask.cc:216] -Finish (sub)test RegisterAccessTest.1 Passed: 1 Failed: 0 -Start (sub)test RegisterAccessTest.2: put 1 antenna in maintenance -Test: (GCF_NO_ERROR==m_extPropSetAP1RCUmaintenance.setValue(PROPNAME_STATUS,inMaintenance)) => succeed [ARATestTask.cc:266] -Test: (strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack1_SubRack1_Board1_AP1_RCU1_Maintenance)!=0 && strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && inMaintenance.getValue()!=0) => succeed [ARATestTask.cc:284] -Finish (sub)test RegisterAccessTest.2 Passed: 2 Failed: 0 -Start (sub)test RegisterAccessTest.3: put station in maintenance -Test: (GCF_NO_ERROR==m_extPropSetStationMaintenance.setValue(PROPNAME_STATUS,inMaintenance)) => succeed [ARATestTask.cc:323] -Test: (strstr(pPropAnswer->pPropName,SCOPE_PIC_Maintenance)!=0 && strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && inMaintenance.getValue()!=0) => succeed [ARATestTask.cc:341] -Finish (sub)test RegisterAccessTest.3 Passed: 2 Failed: 0 -Start (sub)test RegisterAccessTest.4: put station out of maintenance -Test: (GCF_NO_ERROR==m_extPropSetStationMaintenance.setValue(PROPNAME_STATUS,inMaintenance)) => succeed [ARATestTask.cc:381] -Test: (strstr(pPropAnswer->pPropName,SCOPE_PIC_Maintenance)!=0 && strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && inMaintenance.getValue()==0) => succeed [ARATestTask.cc:399] -Test: (GCF_NO_ERROR==m_extPropSetAP1RCUmaintenance.requestValue(PROPNAME_STATUS)) => succeed [ARATestTask.cc:402] -Test: (strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack1_SubRack1_Board1_AP1_RCU1_Maintenance)!=0 && strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && inMaintenance.getValue()!=0) => succeed [ARATestTask.cc:420] -Finish (sub)test RegisterAccessTest.4 Passed: 4 Failed: 0 -Start (sub)test RegisterAccessTest.5: put antenna out of maintenance -Test: (GCF_NO_ERROR==m_extPropSetAP1RCUmaintenance.setValue(PROPNAME_STATUS,inMaintenance)) => succeed [ARATestTask.cc:458] -Test: (strstr(pPropAnswer->pPropName,SCOPE_PIC_Rack1_SubRack1_Board1_AP1_RCU1_Maintenance)!=0 && strstr(pPropAnswer->pPropName,PROPNAME_STATUS)!=0 && inMaintenance.getValue()==0) => succeed [ARATestTask.cc:476] -Finish (sub)test RegisterAccessTest.5 Passed: 2 Failed: 0 -Start (sub)test RegisterAccessTest.6: schedule maintenance of 1 antenna -Test: (GCF_NO_ERROR==m_extPropSetLDS.setValue("command",command)) => succeed [ARATestTask.cc:531] -the resource will be put in maintenance in 10 seconds... Please wait -Test: (inMaintenance.getValue()!=0) => succeed [ARATestTask.cc:556] -the resource will be put out of maintenance in 10 seconds... Please wait -Test: (inMaintenance.getValue()==0) => succeed [ARATestTask.cc:569] -Finish (sub)test RegisterAccessTest.6 Passed: 3 Failed: 0 -Start (sub)test RegisterAccessTest.7: schedule maintenance of entire station -Test: (GCF_NO_ERROR==m_extPropSetLDS.setValue("command",command)) => succeed [ARATestTask.cc:624] -the resource will be put in maintenance in 10 seconds... Please wait -Test: (inMaintenance.getValue()!=0) => succeed [ARATestTask.cc:649] -the resource will be put out of maintenance in 10 seconds... Please wait -Test: (inMaintenance.getValue()==0) => succeed [ARATestTask.cc:662] -Finish (sub)test RegisterAccessTest.7 Passed: 3 Failed: 0 -Start (sub)test RegisterAccessTest.8: simulate board defect -Test: (status.getValue()!=0) => succeed [ARATestTask.cc:744] -Finish (sub)test RegisterAccessTest.8 Passed: 1 Failed: 0 -Start (sub)test RegisterAccessTest.9: simulate board defect fixed -Test: (status.getValue()==0) => succeed [ARATestTask.cc:820] -Finish (sub)test RegisterAccessTest.9 Passed: 1 Failed: 0 -Start (sub)test RegisterAccessTest.10: put all rcu's in overflow -Test: (status.getValue()!=0) => succeed [ARATestTask.cc:906] -Finish (sub)test RegisterAccessTest.10 Passed: 1 Failed: 0 -Test suite "MAC.APL.PIC RegisterAccess Test" -======================================= -Test summary "RegisterAccessTest": - Passed: 20 Failed: 0 -Failures: -=======================================