//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "Learn.h"
#include "Robot.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TLearnForm *LearnForm;
//---------------------------------------------------------------------------
__fastcall TLearnForm::TLearnForm(TComponent* Owner)
   : TForm(Owner)
{
   int index;

   switch( robot.GetRealTouchType() )
   {
      case NOTOUCH:
      case LSURFACETOUCH:
      case RSURFACETOUCH:
      case LFINALTOUCH:
      case RFINALTOUCH:
         index = 0;
         break;

      case LFACETTOUCH:
      case RFACETTOUCH:
         index = 1;
         break;

      case LONEPOINTTOUCH:
      case RONEPOINTTOUCH:
         index = 2;
         break;

      case LTWOPOINTTOUCH:
      case RTWOPOINTTOUCH:
         index = 3;
         break;

      case LJAMMINGTOUCH:
      case RJAMMINGTOUCH:
         index = 4;
         break;
   }
   LearnRadioGroup->ItemIndex = index;
}
//---------------------------------------------------------------------------
void __fastcall TLearnForm::ChooseButtonClick(TObject *Sender)
{
   switch( LearnRadioGroup->ItemIndex )
   {
      case 0:
         realSituation = NOTOUCHSITUATION;
         break;

      case 1:
         realSituation = FACETSITUATION;
         break;

      case 2:
         realSituation = ONEPOINTSITUATION;
         break;

      case 3:
         realSituation = TWOPOINTSITUATION;
         break;

      case 4:
         realSituation = JAMMINGSITUATION;
         break;
   }
   Close();   
}
//---------------------------------------------------------------------------
