#include "params.h"

void TextPushButton6OnClick(tWidget *pWidget)
{
  char *str = "Setting Successfully" ;
  g_sParameters.CalibrateNum[0] = 79296;
  g_sParameters.CalibrateNum[1] = -960;
  g_sParameters.CalibrateNum[2] = -21705792;
  g_sParameters.CalibrateNum[3] = 128;
  g_sParameters.CalibrateNum[4] = -82816;
  g_sParameters.CalibrateNum[5] = 76551552;
  g_sParameters.CalibrateNum[6] = 178144;
  TouchScreenSetParam(g_sParameters.CalibrateNum[0], g_sParameters.CalibrateNum[1] ,
  g_sParameters.CalibrateNum[2] , g_sParameters.CalibrateNum[3] , g_sParameters.CalibrateNum[4] ,
  g_sParameters.CalibrateNum[5], g_sParameters.CalibrateNum[6]);
  PushButtonTextSet(&TextPushButton6 , str);
  WidgetPaint((tWidget*)&TextPushButton6);
  g_sParameters.tInitstatus = 789;
  ParamSave();
}

void Timer11OnExecute(tWidget *pWidget)
{
  ParamInit();

  if(g_sParameters.tInitstatus == 789)
  {

   TouchScreenSetParam(g_sParameters.CalibrateNum[0], g_sParameters.CalibrateNum[1] ,
   g_sParameters.CalibrateNum[2] , g_sParameters.CalibrateNum[3] , g_sParameters.CalibrateNum[4] ,
   g_sParameters.CalibrateNum[5], g_sParameters.CalibrateNum[6]);

  }
  else
  {

   g_sParameters.CalibrateNum[0] = 79296;
   g_sParameters.CalibrateNum[1] = -960;
   g_sParameters.CalibrateNum[2] = -21705792;
   g_sParameters.CalibrateNum[3] = 128;
   g_sParameters.CalibrateNum[4] = -82816;
   g_sParameters.CalibrateNum[5] = 76551552;
   g_sParameters.CalibrateNum[6] = 178144;
   TouchScreenSetParam(g_sParameters.CalibrateNum[0], g_sParameters.CalibrateNum[1] ,
   g_sParameters.CalibrateNum[2] , g_sParameters.CalibrateNum[3] , g_sParameters.CalibrateNum[4] ,
   g_sParameters.CalibrateNum[5], g_sParameters.CalibrateNum[6]);

   g_sParameters.tInitstatus = 789;

   ParamSave();
  }
}
void TextPushButton9OnClick(tWidget *pWidget)
{
  
}


