#include <stdio.h>
#include <stdlib.h>
#include <Xm/Label.h>
#include <Xm/Form.h>
#include <Xm/RowColumn.h>
#include <Xm/ScrollBar.h>
#include <Xm/PushB.h>
#include <Vk/VkApp.h>
#include <Vk/VkSimpleWindow.h>
#include <Vk/VkOptionMenu.h>
#include "TiburonApp.h"
#include "MotorMicro.h"

#define dprintf if (debug) fprintf

class TestWindow: public VkSimpleWindow 
{
  public:

  TestWindow ( const char *name );
  
  ~TestWindow ();
  
  virtual const char* className()
  {
    return "TestWindow";
  }

  MicroGui *_motorGui;
  MotorMicro *_motorMicro;
};


TestWindow::~TestWindow ()
{
  delete _motorMicro;
  delete _motorGui;
}


TestWindow::TestWindow(const char *name) :
  VkSimpleWindow(name)
{
  char itemPrefix[MaxDmNameLen];
  strcpy(itemPrefix, "WESTERN_FLYER.MOTOR_TEST");

  _motorMicro = 
    new MotorMicro("motorMicro", itemPrefix);

  _motorGui = _motorMicro->gui(mainWindowWidget(), 500);
  _motorGui->show();

  addView(_motorGui->baseWidget());
}



void main ( int argc, char **argv )
{
  TiburonApp *app = new TiburonApp("MotorTest", &argc, argv);
	  
  TestWindow *window = new TestWindow("MotorTest");
	  
  window->show();
	  
  app->startTelemetryHandlers();
  
  app->run();
	  
}






