/***************************************************************************
                     FILE INFORMATION HEADER                              
                     -----------------------                                 

    a.  PROJECT NAME:       GRIFO_S7  P2813         
    b.  ITEM TYPE:		header
    c.  ITEM NAME:              base_types.h
    d.  ITEM REFERENCE:          
    e.  CURRENT VERSION:        1.1
    f.  DATE:                   3/6/97
    g.  SOURCE FILE LOCATION:   /sparc-2/library/sr3b_end/dati/common/cmn_dt/s.base_types.h
    h.  'C' RELEASE:            2.11
    i.  ITEM DESCRIPTION:       It contains commonly used base data types.
    j.  DOCUMENTATION REFERENCES:     
    k.  PROGRAMMER NAME(S):     B.Bontempi
				S.R.Curtis 
    l.  COPYRIGHT:              FIAR    
    m.  REVISION HISTORY:       07-11-01 - Baseline copied from 3B.86 R3K Metis radar version 
                                12jun07 - S7-2.00 - Added new types for HR-mode management
 ***************************************************************************/

#ifndef base_types_defined
//## attribute ::types_reverse::TopLevel.base_types_defined
const RhpString base_types_defined;

//## dependency cmn_lsb
#include "cmn_lsb.h"
/* Grifo-e */
//#define false 0
//#define true 1
/* Grifo-e */

// **** Machine dependent datatype attributes. ****
//## attribute ::types_reverse::TopLevel.MIN_SIGNED_INT
const RhpString MIN_SIGNED_INT((-2147483647));

//## attribute ::types_reverse::TopLevel.MAX_SIGNED_INT
const RhpString MAX_SIGNED_INT(2147483647);

//## attribute ::types_reverse::TopLevel.MIN_SIGNED_SHORT
const RhpString MIN_SIGNED_SHORT((-32768));

//## attribute ::types_reverse::TopLevel.MAX_SIGNED_SHORT
const RhpString MAX_SIGNED_SHORT(32767);

//## attribute ::types_reverse::TopLevel.MIN_UNSIGNED_SHORT
const RhpString MIN_UNSIGNED_SHORT(0);

//## attribute ::types_reverse::TopLevel.MAX_UNSIGNED_SHORT
const RhpString MAX_UNSIGNED_SHORT(65535);

namespace legacy
{
    // **** Common Base Datatypes  ****
    //## type no_data_t
    typedef int no_data_t;
    
    //## type int_metres_t
    typedef int int_metres_t;
    
    //## type metres_t
    typedef float metres_t;
    
    // m**2 
    //## type metres2_t
    typedef float metres2_t;
    
    //## type metres_per_sec_t
    typedef float metres_per_sec_t;
    
    //## type metres_per_sec2_t
    typedef float metres_per_sec2_t;
    
    //## type metres_per_sec3_t
    typedef float metres_per_sec3_t;
    
    // (m/s)**2 
    //## type metres2_per_sec2_t
    typedef float metres2_per_sec2_t;
    
    //## type decibel_t
    typedef float decibel_t;
    
    //## type radians_t
    typedef float radians_t;
    
    //## type radians2_t
    typedef float radians2_t;
    
    //## type radians_per_sec_t
    typedef float radians_per_sec_t;
    
    //## type radians_per_sec2_t
    typedef float radians_per_sec2_t;
    
    //## type timetag_t
    typedef int timetag_t;
    
    //## type seconds_t
    typedef float seconds_t;
    
    //## type micro_seconds_t
    typedef float micro_seconds_t;
    
    //## type hertz_t
    typedef float hertz_t;
    
    //## type mega_hertz_t
    typedef float mega_hertz_t;
    
    //## type mach_no_t
    typedef float mach_no_t;
    
    // Grifo-e 
    // typedef enum { false, true } boolean;
    //## type boolean
    typedef unsigned int boolean;
}

//typedef int boolean;
/* Grifo-e */

//## attribute ::types_reverse::TopLevel.BOOLEAN_MIN
const RhpString BOOLEAN_MIN(false);

//## attribute ::types_reverse::TopLevel.BOOLEAN_MAX
const RhpString BOOLEAN_MAX(true);

namespace legacy
{
    //#[ type off_on_t
    typedef enum { off, on }  off_on_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.OFF_ON_T_MIN
const RhpString OFF_ON_T_MIN(off);

//## attribute ::types_reverse::TopLevel.OFF_ON_T_MAX
const RhpString OFF_ON_T_MAX(on);

namespace legacy
{
    //#[ type active_t
    typedef enum{ not_active, active }  active_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.ACTIVE_T_MIN
const RhpString ACTIVE_T_MIN(not_active);

//## attribute ::types_reverse::TopLevel.ACTIVE_T_MAX
const RhpString ACTIVE_T_MAX(active);

namespace legacy
{
    //#[ type validity_t
    typedef enum { not_valid, valid }  validity_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.VALIDITY_T_MIN
const RhpString VALIDITY_T_MIN(not_valid);

//## attribute ::types_reverse::TopLevel.VALIDITY_T_MAX
const RhpString VALIDITY_T_MAX(valid);

namespace legacy
{
    //#[ type low_high_t
    typedef enum { low, high }  low_high_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.LOW_HIGH_T_MIN
const RhpString LOW_HIGH_T_MIN(low);

//## attribute ::types_reverse::TopLevel.LOW_HIGH_T_MAX
const RhpString LOW_HIGH_T_MAX(high);

namespace legacy
{
    //#[ type fail_t
    typedef enum { not_fail, fail }  fail_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.FAIL_T_MIN
const RhpString FAIL_T_MIN(not_fail);

//## attribute ::types_reverse::TopLevel.FAIL_T_MAX
const RhpString FAIL_T_MAX(fail);

namespace legacy
{
    // Grifo-e 
    //#[ type left_right_t
    typedef enum { left, right }  left_right_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.LEFT_RIGHT_T_MIN
const RhpString LEFT_RIGHT_T_MIN(left);

//## attribute ::types_reverse::TopLevel.LEFT_RIGHT_T_MAX
const RhpString LEFT_RIGHT_T_MAX(right);

namespace legacy
{
    //#[ type dis_en_t
    typedef enum { disable, enable }  dis_en_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.DIS_EN_T_MIN
const RhpString DIS_EN_T_MIN(disable);

//## attribute ::types_reverse::TopLevel.DIS_EN_T_MAX
const RhpString DIS_EN_T_MAX(enable);

namespace legacy
{
    //#[ type progress_t
    typedef enum { completed, in_progress, completed_on_timeout }  progress_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.PROGRESS_T_MIN
const RhpString PROGRESS_T_MIN(completed);

//## attribute ::types_reverse::TopLevel.PROGRESS_T_MAX
const RhpString PROGRESS_T_MAX(completed_on_timeout);

namespace legacy
{
    //#[ type accuracy_t
    typedef enum { level_0, level_1, level_2, level_3 }  accuracy_t;
    //#]
}

//## attribute ::types_reverse::TopLevel.ACCURACY_T_MIN
const RhpString ACCURACY_T_MIN(level_0);

//## attribute ::types_reverse::TopLevel.ACCURACY_T_MAX
const RhpString ACCURACY_T_MAX(level_3);

// **** Macro Used to define Array Ranges in declarations. *
//#[ type ARRAY_RANGE
#define ARRAY_RANGE( first, last ) ( (last) - (first) + 1 )
//#]

namespace legacy
{
    //## type _az_el_t_
    struct _az_el_t_
    {
        radians_t azimuth;		//## attribute azimuth
        radians_t elevation;		//## attribute elevation
    };
    
    // **** Common Vector types. ****
    //## type az_el_t
    typedef _az_el_t_ az_el_t;
    
    //## type _vector_t_
    struct _vector_t_
    {
        float x;		//## attribute x
        float y;		//## attribute y
        float z;		//## attribute z
    };
    
    // The following are cartesian vectors which are structually
    // equivalent to allow generic functions for them 
    //## type vector_t
    typedef _vector_t_ vector_t;
    
    //## type _cartesian_position_vector_t_
    struct _cartesian_position_vector_t_
    {
        metres_t x;		//## attribute x
        metres_t y;		//## attribute y
        metres_t z;		//## attribute z
    };
    
    //## type cartesian_position_vector_t
    typedef _cartesian_position_vector_t_ cartesian_position_vector_t;
    
    //## type _cartesian_velocity_vector_t_
    struct _cartesian_velocity_vector_t_
    {
        metres_per_sec_t x;		//## attribute x
        metres_per_sec_t y;		//## attribute y
        metres_per_sec_t z;		//## attribute z
    };
    
    //## type cartesian_velocity_vector_t
    typedef _cartesian_velocity_vector_t_ cartesian_velocity_vector_t;
    
    //## type _cartesian_accel_vector_t_
    struct _cartesian_accel_vector_t_
    {
        metres_per_sec2_t x;		//## attribute x
        metres_per_sec2_t y;		//## attribute y
        metres_per_sec2_t z;		//## attribute z
    };
    
    //## type cartesian_accel_vector_t
    typedef _cartesian_accel_vector_t_ cartesian_accel_vector_t;
    
    //## type _angular_position_vector_t_
    struct _angular_position_vector_t_
    {
        radians_t roll;		//## attribute roll
        radians_t pitch;		//## attribute pitch
        radians_t platform_azimuth;		//## attribute platform_azimuth
    };
    
    // The following are angular vectors which are structually
    // equivalent to allow generic functions for them 
    //## type angular_position_vector_t
    typedef _angular_position_vector_t_ angular_position_vector_t;
    
    //## type _angular_rate_vector_t_
    struct _angular_rate_vector_t_
    {
        radians_per_sec_t roll_rate;		//## attribute roll_rate
        radians_per_sec_t pitch_rate;		//## attribute pitch_rate
        radians_per_sec_t yaw_rate;		//## attribute yaw_rate
    };
    
    //## type angular_rate_vector_t
    typedef _angular_rate_vector_t_ angular_rate_vector_t;
    
    //## type _angular_accel_vector_t_
    struct _angular_accel_vector_t_
    {
        radians_per_sec2_t roll_accel;		//## attribute roll_accel
        radians_per_sec2_t pitch_accel;		//## attribute pitch_accel
        radians_per_sec2_t yaw_accel;		//## attribute yaw_accel
    };
    
    //## type angular_accel_vector_t
    typedef _angular_accel_vector_t_ angular_accel_vector_t;
    
    //## type _pedestal_alignment_vector_t_
    struct _pedestal_alignment_vector_t_
    {
        radians_t psi;		//## attribute psi
        radians_t theta;		//## attribute theta
        radians_t phi;		//## attribute phi
    };
    
    //## type pedestal_alignment_vector_t
    typedef _pedestal_alignment_vector_t_ pedestal_alignment_vector_t;
    
    //## type _antenna_vector_t_
    struct _antenna_vector_t_
    {
        radians_t azimuth;		//## attribute azimuth
        radians_t elevation;		//## attribute elevation
    };
    
    // simple antenna pointing vector 
    //## type antenna_vector_t
    typedef _antenna_vector_t_ antenna_vector_t;
    
    //## type _polar_vector_t_
    struct _polar_vector_t_
    {
        radians_t azimuth;		//## attribute azimuth
        radians_t elevation;		//## attribute elevation
        metres_t range;		//## attribute range
    };
    
    // This is an euler pointing vector 
    //## type polar_vector_t
    typedef _polar_vector_t_ polar_vector_t;
    
    //## type filter_vector_t
    typedef float filter_vector_t[3];
}

#endif
