//!;;Rpy::+
//!;;Rpy::ModelElement: idd_softsc
//!;;Rpy::
//!;;Rpy::Component: IDDComponent 
//!;;Rpy::Configuration: IDDConfig
//!;;Rpy::Project: IDD
//!;;Rpy::
//!;;Rpy::FilePath: idd_softsc.h
//!;;Rpy::Tag: $Tag
//!;;Rpy::
//!;;Rpy::Copyright: Leonardocompany - COMPANY RESTRICTED
//!;;Rpy::
//!;;Rpy::Generated by Rhapsody: 7.5.3 
//!;;Rpy::-


#ifndef idd_softsc_H
#define idd_softsc_H

//## dependency rtg_compiler
#include <rtg_compiler.h>
//## dependency stdint
#include <stdint.h>
namespace idd_softsc
{
    //## package idd_softsc
    
    
    //## type sc_image_sample_t
    typedef unsigned char sc_image_sample_t;
    
    //## type sc_polar_sample_t
    typedef unsigned char sc_polar_sample_t;
    
    //#[ type sc_image_descriptor_t
    struct sc_image_descriptor_t
    {
        uint32_t valid_bpp;	//0=invalid, 1=8bits per pixel, 2=16bits per pixel, >2: invalid
        uint32_t clear;
    
        uint32_t dx;
        uint32_t dy;
        uint32_t ox;
        uint32_t oy;
        uint32_t rows;
        uint32_t stride;
        
       	uint32_t spare[8];
    };
    
    //#]
    
    //#[ type sc_mode_t
    enum sc_mode_t CPP_ENUM_BASE(int)
    {
        sc_disable=0, sc_test=1, sc_polar, sc_image, sc_oscilloscope
    };
    //#]
    
    //#[ type sc_cmd_t
    struct sc_cmd_t
    {
        uint32_t mode;
    
        enum sc_mode_t { sc_disable=0, sc_test=1, sc_polar, sc_image, sc_oscilloscope};
        uint32_t sc_mode;
    
        uint32_t rbins;
        float rbin_meters;
    
        //Antenna
        uint32_t bar_number;
    
        float scan_center;
        float azimuth;
        float elevation;
    
        int32_t ant_direction;
        uint32_t ant_progress;
        float az_limit_left;
        float az_limit_right;
    
        float range_scale;
    
        float platform_azimuth;
        float vx;
        float vy;
    
        float ant_u;
        float ant_v;
    
        int bar_progress;
        int frame_progress;
        
        enum palet_t { palet_auto, palet_dbs, palet_rbm, palet_wa, palet_ta, palet_grayscale};
        uint32_t palet_type;
                            
        unsigned int image_counter;
        float image_cit;
        
        unsigned int batch;
        
        uint32_t spare__[2];
    
        sc_image_descriptor_t image_descriptor;
    }
    ;
    //#]
    
    //#[ type sc_sweep_samples_t
    struct sc_sweep_samples_t
    {
        enum { sweep_max_rbins=4096};
        unsigned int valid;
        float azimuth;
        unsigned int samples;
        unsigned int spare[2];
    
        uint8_t data[sweep_max_rbins];
    };
    
    //#]
    
    // Meaning of row and columns depend on the mode:
    // - polar: rows= number of sweep, columns= number of sample per sweep - signal size = rows*columns
    // - image: rows= cross range dimension, columns=range - again signal size =rows*columns
    //## type sc_signal_description_t
    struct sc_signal_description_t
    {
        int rows;		//## attribute rows
        int columns;		//## attribute columns
        float max_level;		//## attribute max_level
    };
    
    // The signal data type is a variant type. Its real contents depend on the mode. Also the real size depend on ravious parameters. This structure defines only a base "placeholder".
    // The responsability of reinterpret the data and dimension is to the consumer
    //#[ type sc_signal_data_t
    struct sc_signal_data_t
    {
    
      const void* rawData() const { return &data_placeholder[0];}
      
      const sc_polar_sample_t* polarData() const { return reinterpret_cast<const sc_polar_sample_t*>(&data_placeholder[0]);}
      const sc_image_sample_t* imageData() const { return reinterpret_cast<const sc_image_sample_t*>(&data_placeholder[0]);}
      
    private:
        unsigned int data_placeholder[1];
    }
    ;
    //#]
    
    //#[ type sc_sweep_radials_t
    struct sc_sweep_radials_t
    {
        enum {max_radials=32};
        unsigned int valid_radials;
        sc_sweep_samples_t sweep[max_radials];
    };
    //#]
    
    //#[ type sc_geo_info_t
    struct sc_geo_info_t
    {
    	int valid;
    	float latitude;
    	float longitude;
    	float true_heading;
    	
    	float image_resolution; 
    	
    	uint32_t spare[8];
    };
    //#]
    
    //#[ type sc_data_t
    struct sc_data_t
    {
        enum {msg_enable_marker=0x12345678, msg_max=2, msg_max_len=32};
        sc_cmd_t header;
        unsigned int msg_enable_;
        char info_msg_[msg_max][msg_max_len];
        sc_geo_info_t geo_info;
        uint32_t spare[128];
        
        uint32_t align_reserved[256/sizeof(uint32_t)];  //WARNING: reserved from radial cache line alignment!!!
        
        sc_sweep_radials_t radials; //Note: this could also be an image, depending on the sc_mode
    };
    //#]
}

#endif
//;;Rpy:: end


