/** \file
 *
 *  Contains the DerivationModule class implementation.
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#include "DerivationModule.h"

#include "DepthRateCalculator.h"
#include "DepthRateCalculatorIF.h"
#include "PitchRateCalculator.h"
#include "PitchRateCalculatorIF.h"
#include "SpeedCalculator.h"
#include "SpeedCalculatorIF.h"
#include "TempGradientCalculator.h"
#include "TempGradientCalculatorIF.h"
#include "VerticalHomogeneityIndexCalculator.h"
#include "VerticalHomogeneityIndexCalculatorIF.h"
#include "YawRateCalculator.h"
#include "YawRateCalculatorIF.h"
#include "ElevatorOffsetCalculator.h"
#include "ElevatorOffsetCalculatorIF.h"
#include "ShortestDistanceToPolygonSidesCalculator.h"
#include "ShortestDistanceToPolygonSidesCalculatorIF.h"

DerivationModule::DerivationModule()
    : Module( "Derivation",
              "Contains the base derivation components" )
{}

void DerivationModule::loadComponents( Logger& logger )
{
    if( loadAtStartup( DepthRateCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DepthRateCalculator( this ) );
    }
    if( loadAtStartup( PitchRateCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new PitchRateCalculator( this ) );
    }
    if( loadAtStartup( SpeedCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new SpeedCalculator( this ) );
    }
    if( loadAtStartup( TempGradientCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new TempGradientCalculator( this ) );
    }
    if( loadAtStartup( VerticalHomogeneityIndexCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new VerticalHomogeneityIndexCalculator( this ) );
    }
    if( loadAtStartup( YawRateCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new YawRateCalculator( this ) );
    }
    if( loadAtStartup( ElevatorOffsetCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new ElevatorOffsetCalculator( this ) );
    }
    if( loadAtStartup( ShortestDistanceToPolygonSidesCalculatorIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new ShortestDistanceToPolygonSidesCalculator( this ) );
    }
}

DerivationModule::~DerivationModule()
{}
