/************************************************************************/
/* Copyright 1998 MBARI							*/
/************************************************************************/
#ifndef _VBMOTORSWITCH_H
#define _VBMOTORSWITCH_H

#include "DmGuiObject.h"
#include "DynamicButton.h"

#define Indeterminate -999

/*
CLASS 
VbMotorSwitch

DESCRIPTION
Turn VB motor on and off

AUTHOR
Tom O'Reilly
*/
class VbMotorSwitch : public DmGuiObject
{
  public:
  VbMotorSwitch(const char *name, Widget parent);
  ~VbMotorSwitch();
  
  virtual const char *className()
  {
    return "VbMotorSwitch";
  }
  
  virtual void updateGui(DM_Item handle = 0);
  
  protected:
  DynamicButton *_button;
  DmEnumObject *_dmRunState;

  // Items for motor power and enabled
  DmEnumObject *_dmPowerStatus;
  DmEnumObject *_dmEnabled;
  
  Boolean _running;

  ///////////////////////////////////////////////////////////////////
  // Toggle motor on/off
  void toggleState();
  
  private:
  static void buttonCallback(Widget w, 
			     XtPointer clientData, XtPointer callData);
  
  
};


#endif
