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

#include "SensorModule.h"

#include "AHRS_M2.h"
#include "AHRS_M2IF.h"
#include "AMEcho.h"
#include "AMEchoIF.h"
#include "AcousticModem_Benthos_ATM900.h"
#include "AcousticModem_Benthos_ATM900IF.h"
#include "BackseatComponent.h"
#include "BackseatComponentIF.h"
#include "BioacousticsDataBridge.h"
#include "BioacousticsDataBridgeIF.h"
#include "BPC1.h"
#include "BPC1IF.h"
#include "CalibrateAHRS_M2.h"
#include "CalibrateAHRS_M2IF.h"
#include "DAT.h"
#include "DATIF.h"
#include "DUSBL_Hydroid.h"
#include "DUSBL_HydroidIF.h"
#include "DVL_micro.h"
#include "DVL_microIF.h"
#include "DataOverHttps.h"
#include "DataOverHttpsIF.h"
#include "DDM.h"
#include "DDMIF.h"
#include "Depth_Keller.h"
#include "Depth_KellerIF.h"
#include "DepthKeller33X.h"
#include "DepthKeller33XIF.h"
#include "DropWeight.h"
#include "DropWeightIF.h"
#include "GobyModem.h"
#include "GobyModemIF.h"
#include "Micromodem.h"
#include "MicromodemIF.h"
#include "MultiRay.h"
#include "MultiRayIF.h"
#include "NAL9602.h"
#include "NAL9602IF.h"
#include "NanoDVR.h"
#include "NanoDVRIF.h"
#include "Onboard.h"
#include "OnboardIF.h"
#include "Phins_Multibeam.h"
#include "Phins_MultibeamIF.h"
#include "Power24vConverter.h"
#include "Power24vConverterIF.h"
#include "PowerOnly.h"
#include "PowerOnlyIF.h"
#include "PNI_TCM.h"
#include "PNI_TCMIF.h"
#include "RDI_Pathfinder.h"
#include "RDI_PathfinderIF.h"
#include "RDI_PathfinderUp.h"
#include "RDI_PathfinderUpIF.h"
#include "Rowe_600.h"
#include "Rowe_600IF.h"
#include "Radio_Surface.h"
#include "Radio_SurfaceIF.h"
#include "SCPI.h"
#include "SCPIIF.h"
#include "SendDirect.h"
#include "SendDirectIF.h"
#include "Sonardyne_Nano.h"
#include "Sonardyne_NanoIF.h"
#include "Waterlinked.h"
#include "WaterlinkedIF.h"

#include "logger/LcmUniversalReporter.h"

SensorModule::SensorModule()
    : Module( "Sensor",
              "Contains the sensor components" )
{}

void SensorModule::loadComponents( Logger& logger )
{
    if( loadAtStartup( AHRS_M2IF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new AHRS_M2( this ) );
        registerBehaviorCreator( CalibrateAHRS_M2IF::NAME, &CalibrateAHRS_M2::CreateBehavior );
    }
    if( loadAtStartup( AcousticModem_Benthos_ATM900IF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new AcousticModem_Benthos_ATM900( this ) );
    }
    if( loadAtStartup( BackseatComponentIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new BackseatComponent( this ) );
        LcmUniversalReporter* universalReporter = new LcmUniversalReporter();
        registerComponent( universalReporter );
    }
    if( loadAtStartup( BioacousticsDataBridgeIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new BioacousticsDataBridge( this ) );
    }
    if( loadAtStartup( BPC1IF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new BPC1( this ) );
    }
    if( loadAtStartup( DataOverHttpsIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DataOverHttps( this ) );
    }
    if( loadAtStartup( DDMIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DDM( this ) );
    }
    if( loadAtStartup( Depth_KellerIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Depth_Keller( this ) );
    }
    if( loadAtStartup( DepthKeller33XIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DepthKeller33X( this ) );
    }
    if( loadAtStartup( DropWeightIF::LOAD_AT_STARTUP, logger, true ) )
    {
        registerComponent( new DropWeight( this ) );
    }
    if( loadAtStartup( DUSBL_HydroidIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DUSBL_Hydroid( this ) );
    }
    if( loadAtStartup( DVL_microIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DVL_micro( this ) );
    }
    if( loadAtStartup( GobyModemIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new GobyModem( this ) );
    }
    if( loadAtStartup( MicromodemIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Micromodem( this ) );
    }
    if( loadAtStartup( MultiRayIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new MultiRay( this ) );
    }
    if( loadAtStartup( NAL9602IF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new NAL9602( this ) );
    }
    if( loadAtStartup( NanoDVRIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new NanoDVR( this ) );
    }
    if( loadAtStartup( OnboardIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Onboard( this ) );
    }
    if( loadAtStartup( Phins_MultibeamIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Phins_Multibeam( this ) );
    }
    if( loadAtStartup( PowerOnlyIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new PowerOnly( this ) );
    }
    if( loadAtStartup( Power24vConverterIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Power24vConverter( this ) );
    }
    if( loadAtStartup( PNI_TCMIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new PNI_TCM( this ) );
    }
    if( loadAtStartup( Radio_SurfaceIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Radio_Surface( this ) );
    }
    if( loadAtStartup( RDI_PathfinderIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new RDI_Pathfinder( this ) );
    }
    if( loadAtStartup( RDI_PathfinderUpIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new RDI_PathfinderUp( this ) );
    }
    if( loadAtStartup( Rowe_600IF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Rowe_600( this ) );
    }
    registerBehaviorCreator( SendDirectIF::NAME, &SendDirect::CreateBehavior );
    if( loadAtStartup( SCPIIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new SCPI( this ) );
    }
    if( loadAtStartup( Sonardyne_NanoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Sonardyne_Nano( this ) );
    }
    if( loadAtStartup( AMEchoIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new AMEcho( this ) );
    }
    if( loadAtStartup( DATIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new DAT( this ) );
    }
    if( loadAtStartup( WaterlinkedIF::LOAD_AT_STARTUP, logger ) )
    {
        registerComponent( new Waterlinked( this ) );
    }
}

SensorModule::~SensorModule()
{}
