Source
throw( AipsError ( "Unsupported quack mode: " + quackmode + ". Supported modes: beg,endb,end,tail (following AIPS convention)" ) );
//# FlagAgentQuack.cc: This file contains the implementation of the FlagAgentQuack class.
//#
//# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
//# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
//# Copyright (C) European Southern Observatory, 2011, All rights reserved.
//#
//# This library is free software; you can redistribute it and/or
//# modify it under the terms of the GNU Lesser General Public
//# License as published by the Free software Foundation; either
//# version 2.1 of the License, or (at your option) any later version.
//#
//# This library 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
//# Lesser General Public License for more details.
//#
//# You should have received a copy of the GNU Lesser General Public
//# License along with this library; if not, write to the Free Software
//# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
//# MA 02111-1307 USA
//# $Id: $
using namespace casacore;
namespace casa { //# NAMESPACE CASA - BEGIN
FlagAgentQuack::FlagAgentQuack(FlagDataHandler *dh, Record config, Bool writePrivateFlagCube, Bool flag):
FlagAgentBase(dh,config,ROWS,writePrivateFlagCube,flag)
{
setAgentParameters(config);
// Request loading antenna pointing map to FlagDataHandler
flagDataHandler_p->setScanStartStopMap(true);
if (quackincrement_p) flagDataHandler_p->setScanStartStopFlaggedMap(true);
}
FlagAgentQuack::~FlagAgentQuack()
{
// Compiler automagically calls FlagAgentBase::~FlagAgentBase()
}
void
FlagAgentQuack::setAgentParameters(Record config)
{
logger_p->origin(LogOrigin(agentName_p,__FUNCTION__,WHERE));
int exists;
exists = config.fieldNumber ("quackinterval");
if (exists >= 0)
{
if( config.type(exists) != TpDouble && config.type(exists) != TpFloat && config.type(exists) != TpInt )
{
throw( AipsError ( "Parameter 'quackinterval' must be of type 'double'" ) );
}
quackinterval_p = config.asDouble("quackinterval");
if (quackinterval_p <= 0)
{
throw( AipsError ( "Parameter 'quackinterval' must be greater than zero." ) );
}
}