/** \file
 *
 *  Specifies the interface details for the LBLNavigation component in the
 *  EstimationModule.
 *
 *  LBLNavigation.h should only be included by LBLNavigation.cpp
 *  Other classes should include LBLNavigationIF.h
 *
 *  Copyright (c) 2020 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef LBLNAVIGATIONIF_H_
#define LBLNAVIGATIONIF_H_

/**
 *  Specifies the interface details for the LBLNavigation component in the
 *  EstimationModule.
 *
 *  LBLNavigation.h should only be included by LBLNavigation.cpp
 *  Other classes should include LBLNavigationIF.h
 *
 *  \ingroup modules_estimation
 */
namespace LBLNavigationIF
{
/// Static const for component name
/// (Can be used by other components)
static const Str NAME( "LBLNavigation" );

// Include common ConfigURIs -- must be in namespace and follow definition of NAME
#include "component/HasLoadAtStartupIF.h"

// configuration parameters
static const ConfigURI VERBOSITY( NAME, "verbosity", "Logging verbosity, 0=minimal, 1=more, etc.", Units::ENUM );
static const ConfigURI SPEED_OF_SOUND( NAME, "speedOfSound", "Speed of sound in seawater if not available from a CTD", Units::METER_PER_SECOND );
static const ConfigURI NAVIGATION_ERROR( NAME, "navigationError", "Estimate of error in navigation", Units::DEGREE );
static const ConfigURI BASELINE_LOCKOUT( NAME, "baselineLockout", "Ignore pings when we are within this distance from the baseline", Units::METER );
static const ConfigURI ADVANCE_PING( NAME, "advancePing", "Fraction of dead-reckoned movement to apply to previous ping locations (0 to 1)", Units::RATIO );
static const ConfigURI ADVANCE_POSITION( NAME, "advancePosition", "Fraction of change in location due to LBL fix to apply (0 to 1)", Units::RATIO );
static const ConfigURI MAX_POSITION_CHANGE( NAME, "maxPositionChange", "Maximumu change in location due to LBL fix", Units::METER );
static const ConfigURI MAX_SPEED_WRT_TRANSPONDER( NAME, "maxSpeedWrtTransponder", "Maximum allowable speed between vehicle and transponder", Units::METER_PER_SECOND );
static const ConfigURI PING_FILTER_SIZE( NAME, "pingFilterSize", "Size of median filter used with maxSpeedWrtTransponder (odd # 3 to 11)", Units::COUNT );
static const ConfigURI MAX_PING_AGE_IN_FILTER( NAME, "maxPingAgeInFilter", "Pings older than this age will be removed from maxSpeedWrtTransponder filter", Units::SECOND );
static const ConfigURI MAX_PING_AGE( NAME, "maxPingAge", "Pings older than this age will be ignored in position estimation", Units::SECOND );
static const ConfigURI FIX_FILTER_SIZE( NAME, "fixFilterSize", "Size of postional filter used calm noisy fixes (1 to 20)", Units::COUNT );
static const ConfigURI FIX_HALF_LIFE_IN_FILTER( NAME, "fixHalfLifeInFilter", "Fixes effect on the filter will be halved in this time", Units::SECOND );

/// Minimum value for PING_FILTER_SIZE
static const int MIN_PING_FILTER_SIZE = 3;

/// Maximum value for PING_FILTER_SIZE
static const int MAX_PING_FILTER_SIZE = 11;

/// Minimum value for FIX_FILTER_SIZE
static const int MIN_FIX_FILTER_SIZE = 1;

/// Maximum value for FIX_FILTER_SIZE
static const int MAX_FIX_FILTER_SIZE = 20;

/// Maximum number of Transponders (below)
static const int NUM_PINGS = 4;

// component-level slate inputs.
static const BlobURI PING1_POSITION( NAME, "ping1Position", "Positions are in North, East, Depth (Radian, Radian, Meter)", Units::NONE, BLOB_FLOAT64LE, 3 );
static const BlobURI PING2_POSITION( NAME, "ping2Position", "Positions are in North, East, Depth (Radian, Radian, Meter)", Units::NONE, BLOB_FLOAT64LE, 3 );
static const BlobURI PING3_POSITION( NAME, "ping3Position", "Positions are in North, East, Depth (Radian, Radian, Meter)", Units::NONE, BLOB_FLOAT64LE, 3 );
static const BlobURI PING4_POSITION( NAME, "ping4Position", "Positions are in North, East, Depth (Radian, Radian, Meter)", Units::NONE, BLOB_FLOAT64LE, 3 );

static const BlobURI* PING_POSITIONS[LBLNavigationIF::NUM_PINGS] =
{
    &LBLNavigationIF::PING1_POSITION,
    &LBLNavigationIF::PING2_POSITION,
    &LBLNavigationIF::PING3_POSITION,
    &LBLNavigationIF::PING4_POSITION
};

static const DataURI PING1_TIME_OF_FLIGHT( NAME, "ping1TOF", "Time of flight from transponder 1", Units::SECOND );
static const DataURI PING2_TIME_OF_FLIGHT( NAME, "ping2TOF", "Time of flight from transponder 2", Units::SECOND );
static const DataURI PING3_TIME_OF_FLIGHT( NAME, "ping3TOF", "Time of flight from transponder 3", Units::SECOND );
static const DataURI PING4_TIME_OF_FLIGHT( NAME, "ping4TOF", "Time of flight from transponder 4", Units::SECOND );

static const DataURI* PING_TIME_OF_FLIGHTS[LBLNavigationIF::NUM_PINGS] =
{
    &LBLNavigationIF::PING1_TIME_OF_FLIGHT,
    &LBLNavigationIF::PING2_TIME_OF_FLIGHT,
    &LBLNavigationIF::PING3_TIME_OF_FLIGHT,
    &LBLNavigationIF::PING4_TIME_OF_FLIGHT
};

}

#endif /*LBLNAVIGATIONIF_H_*/
