#include "params.h"

void TextPushButton6OnClick(tWidget *pWidget)
{
   char *str = "Setting Successfully" ;
   g_sParameters.CalibrateNum[0] = -1120;
   g_sParameters.CalibrateNum[1] = 71104;
   g_sParameters.CalibrateNum[2] = -17439360;
   g_sParameters.CalibrateNum[3] = 67560;
   g_sParameters.CalibrateNum[4] = -912;
   g_sParameters.CalibrateNum[5] = -18515040;
   g_sParameters.CalibrateNum[6] = 156340;
   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 = 456 ;
   ParamSave();
}


void Timer10OnExecute(tWidget *pWidget)
{

  ParamInit();

  if(g_sParameters.tInitstatus == 456)
  {

   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] = -1120;
   g_sParameters.CalibrateNum[1] = 71104;
   g_sParameters.CalibrateNum[2] = -17439360;
   g_sParameters.CalibrateNum[3] = 67560;
   g_sParameters.CalibrateNum[4] = -912;
   g_sParameters.CalibrateNum[5] = -18515040;
   g_sParameters.CalibrateNum[6] = 156340;

   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 = 456 ;

    ParamSave();

  }
}
