
#include "g346_b9b10.h"

#include "ads_manager.h"

#include "g346_common.h"

using namespace grifo_icd;

GrifoMsg_B09B10::GrifoMsg_B09B10():
    dTtPx("B10_Timetag_PX"),
    dTtAc("B09_Timetag_AC"),
    dAcNavAz("B09_NavAz"),
    dAcNavEl("B09_NavEl"),
    dAcBodyAz("B09_BodyAz"),
    dAcBodyEl("B09_BodyEl")
{
  Ads1553MsgQ* b9=Ads1553Manager::instance().getMsgObj("B9");
  Ads1553MsgQ* b10=Ads1553Manager::instance().getMsgObj("B10");

  GRIFO_ADS_MAP(dTtPx, "B10_Timetag_PX", msg_b10_t, tt_low, relative_timetag_t, *b10);

  GRIFO_ADS_MAP(dTtAc, "B09_Timetag_AC", msg_b09_t, tt_low, relative_timetag_t, *b9);

  GRIFO_ADS_MAP(dAcNavAz, "B09_NavAz", msg_b09_t, nav_az, semicircle_t, *b9);
  GRIFO_ADS_MAP(dAcNavEl, "B09_NavEl", msg_b09_t, nav_el, semicircle_t, *b9);
  GRIFO_ADS_MAP(dAcBodyAz, "B09_BodyAz", msg_b09_t, body_az, semicircle_t, *b9);
  GRIFO_ADS_MAP(dAcBodyEl, "B09_BodyEl", msg_b09_t, body_el, semicircle_t, *b9);


  static char b9wnames[32][128];
  for(int i=0; i<32; ++i)
  {
      strcpy(b9wnames[i], QString("B9W%1").arg(i).toLatin1().constData());
      AdsLogicData& d=*new AdsLogicData(b9wnames[i]);
      d.attachToMsg(b9, i);
  }
}
