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

#include "ControlModule.h"

#include "VerticalControl.h"
#include "VerticalControlIF.h"
#include "HorizontalControl.h"
#include "HorizontalControlIF.h"
#include "LoopControl.h"
#include "LoopControlIF.h"
#include "SpeedControl.h"
#include "SpeedControlIF.h"

ControlModule::ControlModule()
    : Module( "Control",
              "Contains the Control components, such as Depth, Heading, and Speed Control" )
{}

void ControlModule::loadComponents( Logger& logger )
{
    if( loadAtStartup( VerticalControlIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new VerticalControl( this ) );
    }
    if( loadAtStartup( HorizontalControlIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new HorizontalControl( this ) );
    }
    if( loadAtStartup( SpeedControlIF::LOAD_AT_STARTUP, logger ) )
    {
        // Note: SpeedControl after VerticalControl
        // Note: SpeedControl before LoopControl
        registerComponent( new SpeedControl( this ) );
    }
    if( loadAtStartup( LoopControlIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new LoopControl( this ) );
    }
}

ControlModule::~ControlModule()
{
}
