#ifndef G346_A1A2_H_
#define G346_A1A2_H_

#include "ads_data.h"

class McsG346AltBlock: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(altitude_block_t)

public:
  enum altitude_block_t { BOTTOM, TOP, NORMAL};

  McsG346AltBlock(const char* const name=0): AdsLogicData(name) {}
};

class McsG346RangeScale: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(range_scale_t)

public:
  //enum range_scale_t { NM160, NM80, NM60, NM40, NM20, NM10, NM_NV6, NM_NV7, NM_NV8, NM_NV9, NM_NV10, NM_NV11, NM_NV12, NM_NV13, NM_NV14, NM_NV15};
  enum range_scale_t { NM80, NM40, NM20, NM10};

  McsG346RangeScale(const char* const name=0): AdsLogicData(name) {}
};

class McsG346VelocityScale: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(velocity_scale_t)

public:
  enum velocity_scale_t { KTS2400, KTS1200 };

  McsG346VelocityScale(const char* const name=0): AdsLogicData(name) {}
};

class McsG346VelocityScaleTB: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(velocity_scale_tb_t)

public:
  enum velocity_scale_tb_t { VS_NA0, VS_NA1, KTS2400, KTS1200};

  McsG346VelocityScaleTB(const char* const name=0): AdsLogicData(name) {}
};

class McsG346RwsSub: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(rwssub_t)

public:
  enum rwssub_t { NAM, ASM};

  McsG346RwsSub(const char* const name=0): AdsLogicData(name) {}
};

class McsG346GmSub: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(gmsub_t)

public:
  enum gmsub_t { RBM, DBS};

  McsG346GmSub(const char* const name=0): AdsLogicData(name) {}
};

class McsG346AcmSub: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(acmsub_t)

public:
  enum acmsub_t {   BORESIGHT,
                    NARROW,
                    HUD,
                    WIDE,
                    VERTICAL,
                    SLEWABLE,
                    ACM_NV_6,
                    ACM_NV_7};


  McsG346AcmSub(const char* const name=0): AdsLogicData(name) {}
};

class McsG346Bars: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(bars_t)

public:
  enum bars_t { _1BARS, _2BARS, _3BARS, _4BARS};
  //enum bars_t { _1BARS, _2BARS, _SPARE, _4BARS};
  McsG346Bars(const char* const name=0): AdsLogicData(name) {}

};

class McsG346Width: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(scan_width_t)

public:
      enum scan_width_t
      {
        W60,
        W30,
        W25,
        W15
      };

  McsG346Width(const char* const name=0): AdsLogicData(name) {}

};

class McsG346WidthTB: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(scan_width_tb_t)

public:
      enum scan_width_tb_t {
        W60,
        W55,
        W50,
        W45,
        W40,
        W35,
        W30,
        W25,
        W20,
        W15,
        W10,
        W05,
        W0,
        W_NV13,
        W_NV14,
        W_NV15
      };

  McsG346WidthTB(const char* const name=0): AdsLogicData(name) {}

};

class McsG346Mode: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(rdr_modes_t)

public:
      enum rdr_modes_t
      {
        RWS=0,
        VS,
        ACM,
        TWS,
        MODE_4,
        GM,
        SEA_LOW,
        SEA_HIGH,
        GMTI,
        BCN,
        AGR,
        TA,
        WA,
        TS,
        MODE_14,
        RDR_DLY
      };

  McsG346Mode(const char* const name=0): AdsLogicData(name) {}

};

class McsG346Lockon: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(des_control_t)

public:
      enum des_control_t
      {
          LOCK_ON,
          LOCK_DTT,
          HPT_BUG,
          REJECT,
          LOCK_STT,
          TRK_LBL,
          EXEC_SAR,
          NOT_VALID
      };

  McsG346Lockon(const char* const name=0): AdsLogicData(name) {}

};

class McsG346LockStatus: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(des_sts_t)

public:
      enum des_sts_t
      {
          STT,
          DTT,
          SAM,
          TWS_HPT, /*with_HPT,*/
          AGR_LOCK, /*Lock_On,*/
          ACQ, /*UISITION_in_Progress,*/
          SAR,
          NOT_VALID
};

McsG346LockStatus(const char* const name=0): AdsLogicData(name) {}

};

class McsG346Expand: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(expand_t)

public:
      enum expand_t
      {
        NORMAL=0,
        EXPAND,
        EXP_NV2,
        EXP_NV3
      };

  McsG346Expand(const char* const name=0): AdsLogicData(name) {}
};

class McsG346SarAcq: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(sar_acq_t)

public:
      enum sar_acq_t
      {
        SAR_CRS=0,
        SAR_SPOI
      };

  McsG346SarAcq(const char* const name=0): AdsLogicData(name) {}
};

class McsG346Waveform: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(waveform_t)

public:
      enum waveform_t
      {
        SPARE=0,
        INTER_1,
        INTER_2,
        INTER_3
      };

  McsG346Waveform(const char* const name=0): AdsLogicData(name) {}
};

class McsG346FreqAgility: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(freqagility_t)

public:
      enum freqagility_t
      {
        FIXED=0,
        RANDOM,
        ADAPTIVE,
        SPARE
      };

  McsG346FreqAgility(const char* const name=0): AdsLogicData(name) {}
};

class McsG346PrfLookup: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(prfTookup_t)

public:
      enum prfTookup_t
      {
        LPRF=0,
        MPRF
      };

  McsG346PrfLookup(const char* const name=0): AdsLogicData(name) {}
};

class McsG346LprfThreshold: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(lprfThreshold_t)

public:
      enum lprfThreshold_t
      {
        LOW=0,
        HIGH
      };

  McsG346LprfThreshold(const char* const name=0): AdsLogicData(name) {}
};

class McsG346GndTgtRejRadVel: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(groundtargetrejectedradialvelocity_t)

public:
      enum groundtargetrejectedradialvelocity_t
      {
        LOW=0,
        HIGH
      };

  McsG346GndTgtRejRadVel(const char* const name=0): AdsLogicData(name) {}
};

class McsG346MinDetGndTgtRadVel: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(MinDetGndTgtRadVel_t)

public:
      enum MinDetGndTgtRadVel_t
      {
        LOW=0,
        HIGH
      };

  McsG346MinDetGndTgtRadVel(const char* const name=0): AdsLogicData(name) {}
};

class McsG346FreqGroupSel: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(freqgroupsel_t)

public:
      enum freqgroupsel_t
      {
        OPT_1=0,
        OPT_2
      };

  McsG346FreqGroupSel(const char* const name=0): AdsLogicData(name) {}
};

class McsG346PowerUpStopFunctSel: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(PowerUpStopFunctSel_t)

public:
      enum PowerUpStopFunctSel_t
      {
        NORMAL=0,
        STOP
      };

  McsG346PowerUpStopFunctSel(const char* const name=0): AdsLogicData(name) {}
};

class McsG346SpotFuncSel: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(spot_func_sel_t)

public:
      enum spot_func_sel_t
      {
        NORMAL=0,
        SPOT
      };

  McsG346SpotFuncSel(const char* const name=0): AdsLogicData(name) {}
};

class McsG346ZoomCommand: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(spot_func_sel_t)

public:
      enum spot_func_sel_t
      {
        NOT_ACTIVE=0,
        ZOOM_IN,
        ZOOM_OUT,
        SPARE_ZOOM
      };

  McsG346ZoomCommand(const char* const name=0): AdsLogicData(name) {}
};

class McsG346SarMapOrientation: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(sar_map_orientation_t)

public:
      enum sar_map_orientation_t
      {
        AC_NOSE=0,
        SC_RANGE,
        NOT_USED_1,
        NOT_USED_2
      };

  McsG346SarMapOrientation(const char* const name=0): AdsLogicData(name) {}
};


class McsParamID: public AdsLogicData
{
  Q_OBJECT
  Q_ENUMS(paramid_t)

public:
    enum paramid_t
    {

        ANT_YAW=1,
        ANT_PITCH,
        ANT_ROLL,
        ANT_X,
        ANT_Y,
        ANT_Z,

        CAT_A=11,
        CAT_B,
        CAT_C,

        WF_CMD=21,

        CUT_OFF_VEL=31,

        RNG_THS_AWS=41,

        TEST_1=51,
        TEST_2,
        TEST_3,
        TEST_4,

        WHITE_LEV=61,
        BLACK_LEV,
        PRECOMP_LEV,

        MORC=71,

        PPOS=81
     };

    McsParamID(const char* const name=0): AdsLogicData(name) {}
};

class GrifoMsg_A1B6
{
public:

  GrifoMsg_A1B6();
  void startProtection();

  static void b6_rdr_status_async_message_routine(Ads1553MsgQ* msg);
  static void b6_rdr_status_sync_message_routine(const void* data);
  static void b8_bite_async_message_routine(Ads1553MsgQ* msg);

  void sendRawParamater(int id, unsigned int value);

  AdsLogicData dIfGain;
  AdsLogicData dIfGainTB;

  AdsLogicData dRadarFail;
  AdsLogicData dAntennaFail;
  AdsLogicData dPpsFail;
  AdsLogicData dLcuFail;
  AdsLogicData dRepFail;
  AdsLogicData dAesaFail;

  AdsLogicData dRepOvertemp;
  AdsLogicData dPpsOvertemp;
  AdsLogicData dAntOvertemp;
  AdsLogicData dLcuOvertemp;

  AdsLogicData dTimeMark;
  AdsDataActionCycle actTimeMark;

public:
  enum { num_of_groups=5};

  AdsLogicData dTgtHistory;
  McsG346AltBlock dAltBlock;

  AdsLogicData dTgtHistoryTB;
  McsG346AltBlock dAltBlockTB;

  AdsLogicData dParamId;
  AdsLogicData dParamValue;
  AdsLogicData dParamEnable;
  AdsLogicData dParamTxRx;

  AdsLogicData dParamIdTB;
  AdsLogicData dParamValueTB;
  AdsLogicData dParamEnableTB;
  AdsLogicData dParamTxRxTB;

  AdsDataActionSetReset actParamTransf;

  AdsLogicData dSymbInt;
  AdsLogicData dSymbIntTB;
  AdsLogicData dChSel;
  AdsLogicData dChSelTb;
  AdsLogicData dChGrp[num_of_groups];
  AdsLogicData dChGrpTB[num_of_groups];

  AdsLogicData dAzCentreTB;
  AdsLogicData dElCentreTB;

  AdsLogicData dCrsTbX;
  AdsLogicData dCrsTbY;

  AdsLogicData dCrsTbRange;
  AdsLogicData dCrsTbAzimuth;

  AdsLogicData dCrsTbLat;
  AdsLogicData dCrsTbLon;

  AdsLogicData dBeaconDelayTB;
  AdsLogicData dBeaconCodeTB;

  McsG346FreqAgility dFreqAgility;
  McsG346FreqAgility dFreqAgilityTb;

  McsG346PrfLookup dPrfLookup;
  McsG346PrfLookup dPrfLookupTb;
  McsG346LprfThreshold dLprfThreshold;
  McsG346LprfThreshold dLprfThresholdTb;

  McsG346GndTgtRejRadVel dGndTgtRejRadVel;
  McsG346MinDetGndTgtRadVel dMinDetGndTgtRadVel;

  AdsLogicData dAleBlanking;

  AdsLogicData dMovingTargetGain;
  AdsLogicData dMovingTargetGainTb;

  McsG346FreqGroupSel dFreqGroupSel;
  McsG346FreqGroupSel dFreqGroupSelTb;

  AdsLogicData dAcIndentifier;

  McsG346Waveform dWaveform;
  McsG346Waveform dWaveformTb;

  McsParamID dCodedParamId;

  AdsLogicData dSarEnableStatus;
};

class ExpectedTransitionCheck;
class TransitionCheck;

class GrifoMsg_A2B7
{
public:

  GrifoMsg_A2B7();
  void startProtection();

  static void b7_rdr_status_async_message_routine(Ads1553MsgQ* msg);

  AdsDataActionCycle actSTBY;

  AdsDataActionCycle actExpand;

  AdsDataActionSet actRWS;
  AdsDataActionSet2 actRWS_NAM;
  AdsDataActionSet2 actRWS_ASM;

  AdsDataActionSet actTWS;
  AdsDataActionSet actTS;
  AdsDataActionSet actVS;
  AdsDataActionSet2 actRBM;
  AdsDataActionSet2 actDBS;

  AdsDataActionSet actACM;
  AdsDataActionCycle actACMCycle;
  AdsDataActionSetAndCycle actACM_Plus;

  AdsDataActionSet actSEA1;
  AdsDataActionSet actSEA2;
  AdsDataActionSet actGMTI;
  AdsDataActionSet actAGR;
  AdsDataActionSet actTA;
  AdsDataActionSet actWA;
  AdsDataActionSet actETET;

  AdsDataActionSetAndCycle actBCN_Plus;

  AdsDataActionSet2 act10NM;
  AdsDataActionSet2 act20NM;
  AdsDataActionSet act40NM;
  AdsDataActionSet act80NM;

  AdsDataActionSet act15D;
  AdsDataActionSet act30D;
  AdsDataActionSet act60D;

  AdsDataActionSet actB1;
  AdsDataActionSet actB2;
  AdsDataActionSet actB4;

  AdsDataActionCycle actModeCycle;
  AdsDataActionCycle actWidthCycle;
  AdsDataActionCycle actBarsCycle;
  AdsDataActionCycle actScaleCycle;

  AdsDataActionSetReset actLockon;
  AdsDataActionSetReset actReject;
  AdsDataActionSetReset actLockonStt;
  AdsDataActionSetReset actLockonDtt;
  AdsDataActionSetReset actLockonSAR;
  AdsDataActionSetReset actHptBug;
  AdsDataActionSetReset actTrkLbl;

  AdsDataActionSetReset actZoomIn;
  AdsDataActionSetReset actZoomOut;

  AdsDataAction* actSmartLockonBegin;
  AdsDataAction* actSmartLockonEnd;

public:
  AdsLogicData dStby;
  AdsLogicData dSilence;
  AdsLogicData dSpot;
  AdsLogicData dFreeze;
  AdsLogicData dIBit;
  McsG346Mode dMode;
  McsG346Lockon dLockon;
  McsG346LockStatus dLockSts;
  McsG346RangeScale dRangeScale;
  McsG346VelocityScale dVelocityScale;
  McsG346RwsSub dRwsSub;
  McsG346GmSub dGmSub;
  McsG346AcmSub  dAcmSub;
  McsG346Bars dBars;
  McsG346Width dWidth;

  McsG346Mode dModeTB;
  AdsLogicData dRadiation;
  AdsLogicData dStbyTB;

  AdsLogicData dFreezeTB;
  AdsLogicData dIBitTB;
  McsG346WidthTB dWidthTB;
  McsG346Bars dBarsTB;
  McsG346RangeScale dRangeScaleTB;
  McsG346VelocityScaleTB dVelocityScaleTB;
  McsG346RwsSub dRwsSubTB;
  McsG346GmSub dGmSubTB;
  McsG346AcmSub  dAcmSubTB;

  AdsLogicData dSarCrsFeasibility;
  AdsLogicData dSarSpoiFeasibility;

  AdsLogicData dEmergency;
  AdsLogicData dEmergencyTB;

  McsG346Expand  dExpand;
  McsG346Expand  dExpandTB;

  AdsLogicData dTransition;
  AdsLogicData dLastAcqFail;
  AdsLogicData dDegradedPerformanceStatus;

  McsG346SarAcq dSarAcqTB;
  McsG346SarAcq dSarAcq;

  McsG346PowerUpStopFunctSel dPowerUpStopFunctSel;

  AdsLogicData dSpotFuncSel; //McsG346SpotFuncSel dSpotFuncSel;
  AdsLogicData dSpotFuncSelTB; //McsG346SpotFuncSel dSpotFuncSel;

  AdsLogicData dBeaconDelay;
  AdsLogicData dBeaconCode;

  McsG346ZoomCommand dZoomCommand;
  McsG346ZoomCommand dZoomCommandTB;

  McsG346SarMapOrientation dSarMapOrientation;
  McsG346SarMapOrientation dSarMapOrientationTB;

  ExpectedTransitionCheck& chkExpTrans;
  TransitionCheck& chkTransition;

};

#endif /*G346_A1A2_H_*/
