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

#include "ServoModule.h"

#include "BuoyancyServo.h"
#include "BuoyancyServoIF.h"
#include "ElevatorServo.h"
#include "ElevatorServoIF.h"
#include "DockingServo.h"
#include "DockingServoIF.h"
#include "DockingStepper.h"
#include "DockingStepperIF.h"
#include "MassServo.h"
#include "MassServoIF.h"
#include "RudderServo.h"
#include "RudderServoIF.h"
#include "ThrusterServo.h"
#include "ThrusterServoIF.h"
#include "ThrusterHE.h"
#include "ThrusterHEIF.h"

ContorllerModule::ContorllerModule()
    : Module( "Servo",
              "This is the module containing motor controllers" )
{}

void ContorllerModule::loadComponents( Logger& logger )
{
    if( loadAtStartup( BuoyancyServoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new BuoyancyServo( this ) );
    }
    if( loadAtStartup( ElevatorServoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new ElevatorServo( this ) );
    }
    if( loadAtStartup( DockingServoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DockingServo( this ) );
    }
    if( loadAtStartup( DockingStepperIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DockingStepper( this ) );
    }
    if( loadAtStartup( MassServoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new MassServo( this ) );
    }
    if( loadAtStartup( RudderServoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new RudderServo( this ) );
    }
    if( loadAtStartup( ThrusterServoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new ThrusterServo( this ) );
    }
    if( loadAtStartup( ThrusterHEIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new ThrusterHE( this ) );
    }
}

ContorllerModule::~ContorllerModule()
{
}
