#ifndef _LAPBOXMICRO_H
#define _LAPBOXMICRO_H

#define __STDC__

#include <mbariTypes.h>
#include "lapBox.h"

#include "MicroInterface.h"

#ifdef UNIX
# include "DataManager.h"
# include "LapBoxUiDm.h"
#else

typedef enum 
{
  LapBoxButtonOff, LapBoxButtonOn, LapBoxButtonError

} LapBoxButtonState;


#endif
extern "C" 
{
#ifdef UNIX
#else
# include "vxWorks.h"
# include "msgQLib.h"
# include "semLib.h"
# include "taskLib.h"
# include "lstLib.h"
# include "datamgr.h"
# include "sio32.h"
# include "sio32Server.h"
# include "sio32Client.h"
# include "microCmd.h"
# include "microcmd.h"
# include "applic.h"
# include "lapbox.h"
#endif
};

typedef enum
{	
  ENABLE_BUTTON,
  PORT_LIGHT_BUTTON,
  PORT_CAMERA_BUTTON,
  STBD_LIGHT_BUTTON,
  STBD_CAMERA_BUTTON,
  PANORAMIC_BUTTON,
  MEMORY_BUTTON,
  SENSITIVITY_BUTTON,
  PORT_CAMERA_SELECT_BUTTON,
  STBD_CAMERA_SELECT_BUTTON,
  AUTO_IRIS_BUTTON,
  FOCUS_CAPTURE,

  NO_BUTTON
    
} LapBoxButton;

/* Micro Interface for lapbox */  
class LapBoxMicro : public MicroInterface
{
  public:

  LapBoxMicro(const char *name, Nat16 serialChanNo);
  ~LapBoxMicro();

  MBool readEvent(LapBoxButton *button);

  int readData(Int16 *pan, Int16 *tilt, 
	       Int16 *zoom, Int16 *focus, Int16 *iris);

  int writeSettings(LapBoxButton button, LapBoxButtonState state,
		    MBool flash);

  protected:

#ifdef UNIX   
  DM_Group _dmGroup;
  DWord _groupItem;
  DWord _portLightBit;
  DWord _portCameraBit;
  DWord _stbdLightBit;
  DWord _stbdCameraBit;
  DWord _panoramicBit;
  DWord _enableBit;
  DWord _portCameraSelectBit;
  DWord _stbdCameraSelectBit;
  DWord _autoIrisBit;

  SEM_ID   _dmUpdateSem;   
   
  LapBoxUiEvents   *_events;
  LapBoxUiData     *_data;
  LapBoxUiSettings *_settings;
#endif

};

#endif





