#ifndef _PILOTTRAYDM_H
#define _PILOTTRAYDM_H

#define __STDC__

#include "mbariTypes.h"
#include "pilotTray.h"
#include "DataManager.h"
#include "PilotTrayUiDm.h"

extern "C"
{
#ifdef UNIX
#else
# include "vxWorks.h"
# include "msgQLib.h"
# include "semLib.h"
# include "taskLib.h"
# include "lstLib.h"
# include "datamgr.h"
#endif
};

typedef enum
{
  PORT_LIGHT_BUTTON,
  PORT_CAMERA_BUTTON,
  STBD_LIGHT_BUTTON,
  STBD_CAMERA_BUTTON,
  PORT_CAMERA_SELECT_BUTTON,
  STBD_CAMERA_SELECT_BUTTON,

  NO_BUTTON

} PilotTrayButton;

/* Micro Interface for Pilot Tray*/
class PilotTrayMicro : public ErrorHandler
{
  public:

  PilotTrayMicro(const char *name);
  ~PilotTrayMicro();

  MBool readEvent(PilotTrayButton *button);

  int readData(Int16 *pan, Int16 *tilt,
               Int16 *zoom, Int16 *focus);

  int startConsumeData();

  int writeSettings(PilotTrayButton button, MBool state,
                    MBool flash);

  int startProvideSettings();

  protected:

  DM_Group _dmGroup;
  DWord _groupItem;
  DWord _portLightBit;
  DWord _portCameraBit;
  DWord _stbdLightBit;
  DWord _stbdCameraBit;
  DWord _portCameraSelectBit;
  DWord _stbdCameraSelectBit;

  SEM_ID   _dmUpdateSem;

  PilotTrayUiEvents   *_events;
  PilotTrayUiData     *_data;
  PilotTrayUiSettings *_settings;
};

#endif





