Download

package SendACDS;
use strict;
use English;
use Carp;
use vars
  qw(@ISA $VERSION $name $author $date $version @instList $numberOfStreams);
@ISA = qw(Module);
use ModuleResources;

# Declare identity, version, author, date, etc.
$name=__PACKAGE__;
$VERSION='2.05';
$version = $VERSION;
$author='Dean Hinshaw,Richard West,Duncan John Fyfe, Jose V Perea';
$date='2020-11-27';

#
# ChangeLog
# =========
#
# Version 2.05 - 2020-11-27 (JVP)
# ------------
#
# + Perl-5.24.3 -> 5.30.1 upgrade side effect:
#   Use of inherited AUTOLOAD for non-method SendACDS::compress*() functions is no longer allowed.
#   Fixed with specific calls: ModuleResources::compress*()
#
# Version 2.04 - 2016-07-28 (JVP)
# ------------
#
# + Ignore module if observation is processed in the target reference frame ( SSO: --sso_object ) ==> No send to ACDS
#
# Version 2.03 - 2006-07-05 (DJF)
# ------------
#
# + Changed numberOfStreams to use standerdized function.
#
# Version 2.02 - 2006-03-27 (DJF)
# ------------
#
# Compress all FIT files before the break point.
#
# Version 2.01 - 2005-09-30 (DJF)
# ------------
#
# + Module now just sets a flag to indicate the state of processing
#   at a break point.  If it returns ingored processing can continue
#   otherwise we break. The ACDS transfer is now managed by an external agent.
#
# Version 2.00 - 2005-09-30 (DJF)
# ------------
#
# + Add explicit perl module headers.  Previously these were supplied
#   at compile time.  This will make debugging and extending the modules
#   through additional perl libraries easier.
#
# + Modified to make use of new DTS regime on linux cluster.
#   An external task now packages and sends the data.
#   This Module only initialtes that process.
# 
#
# Version 1.07 - 2005-09-30 (RGW)
# ------------
#
# + Adjust trigger conditions as ImageMerge is now instrument=epic
#   not instrument=all
#
# Version 1.06 - 2001-05-03 (DH)
# ------------
#
# + Ignore this module, rather than returning an
#   error, if no epic source list is found.
#
# Version 1.05 - 2001-03-16 (DH)
# ------------
#
# + Print out version number in performAction() for
#   tracking purposes.
#
# Version 1.04 - 2001-01-09 (DH)
# ------------
#
# + Add ignore option to evaluateRules.
#
# Version 1.03 - 2000-12-14 (DH)
# ------------
#
# + First production version.
#

# Declare list of instruments this module is interested in
@instList=qw(all);

# Number of streams
sub numberOfStreams
{
        return 1;
}

# Rules method
sub evaluateRules {

    # Ignore module if observation is processed in the target reference frame ( SSO: --sso_object ) ==> No send to ACDS
    #
    my $sso_object = $ENV{PCMS_SSO_OBJECT};
    if ( $sso_object ){
        info("Observation is processed in the target reference frame ( SSO: --sso_object ). Ignoring SendACDS module.");
        return ignore();
    }

    return ignore() if ignored(module => 'SrcMerge',
			       instrument => 'all',
			       stream => 1);

    return unless complete(module => 'SrcMerge',
			   instrument => 'all',
			   stream => 1)
           and complete(module => 'ImageMerge',
			instrument => 'epic',
			stream => 1);
    start();
}

# Action method
sub performAction {
    info("Module version number: $version");


#	Reduce network traffic, compress all FIT files before break point
	ModuleResources::compressOdf();
	ModuleResources::compressIntermediates();
	ModuleResources::compressProducts();

		
    return success();
}

1;