/************************** Copyright (c) **********************************
|
** FUZHOU FUGUANG ELECTRONICS Co.,LTD.
|
** ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
|
** http://www.fuguang.com
|
**
|
**-------------- File Info -------------------------------------------------
|
** File name: MainMenu.c
|
** Last modified Date: 2008-11-16
|
** Last Version: 1.0
|
** Descriptions: Display the main menu after after the logo
|
**
|
**--------------------------------------------------------------------------
|
** Created by: mxpopstar
|
** Created date: 2008-11-16
|
** Version: 1.0
|
** Descriptions: The original version
|
**
|
**--------------------------------------------------------------------------
|
** Modified by: mxpopstar
|
** Modified date: 2008-11-20
|
** Version:
|
** Descriptions: Display the main menu after after the logo
|
**
|
***************************************************************************/
|
//
|
#include "MainMenu.h"
|
#include "Define.h"
|
#include "FileManage.h"
|
#include "WorkingPage.h"
|
#include "TFT_Driver.h"
|
#include "Buzzer_Driver.h"
|
#include "AD7843_Driver.h"
|
#include "DS1302_Driver.h"
|
#include "SingleVol.h"
|
#include "ChargePage.h"
|
#include "AboutPage.h"
|
#include "SYSSetPage.h"
|
#include "SelectForm.h"
|
#include "NRF905_Driver.h"
|
#include "MessageBox.h"
|
|
extern FBO_Data GB_FBO_Data;
|
extern SYS_State GB_SYS_State;
|
extern unsigned int GB_TestingParm[13];
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
#if(MashineType == FBO48CT)
|
const prog_uchar MenuCaption[1][11] =
|
{
|
#if(MashineCurr == 300)
|
"FBO-4830CT"
|
#else
|
"FBO-4815CT"
|
#endif
|
};
|
#else
|
const prog_uchar MenuCaption[12] =
|
{
|
#if(BCTVTYPE == 6)
|
"BCT-60/120"
|
#else
|
"BCT-300/120"
|
#endif
|
};
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ####################################
|
//
|
|
#if(SoftLanguage==CN)
|
const prog_uchar MenuMCZeroText[1][7] =
|
{
|
{70, 71, 36, 63, 188, 0, 137},//µ¥ÌåÊýÁ¿Îª0!
|
};
|
//
|
|
const prog_uchar MenuVersionText[1][4] =
|
{
|
{31, 5, 181, 4}// V5.4
|
};
|
//
|
|
const prog_uchar MenuText[6][4] =
|
{
|
{ 0, 2, 3, 4},//"·Åµç²âÊÔ"
|
{ 1, 2, 35, 3},//"³äµç¼à²â"
|
{17, 6, 7, 8},//"Êý¾Ý¹ÜÀí"
|
{ 9, 5, 10, 11},//"ϵͳÉèÖÃ"
|
{12, 13, 14, 15},//"²é¿´µ¥Ìå"
|
{16, 17, 18, 19},//"²ÎÊýÔ¤ÖÃ"
|
};
|
const prog_uchar MenuButton[3][2] =
|
{
|
{50, 51},//Ñ¡Ôñ
|
{45, 46},//È·¶¨
|
{101,101},//
|
};
|
|
#else
|
const prog_uchar MenuMCZeroText[1][22] =
|
{
|
{103,74,71,13,61,74,0,89,71,64,72,64,73,78,74,61,0,16,1},
|
//"Battery Count is 0!",19
|
};
|
//
|
|
const prog_uchar MenuVersionText[10] =
|
{
|
"V2.0A"//"V6.4"//½â¾öµ¥ÌåÅäÖÃ//2017-5-18ÐÞ¸Ä ½«°æ±¾Éý¼¶ÎªV2.0A£¨¶¨ÖƱíÒªÇó£©
|
};
|
//
|
const prog_uchar MenuText[6][14] = //RU¡£
|
{
|
{109,59,67,76,91,63}, //"·Åµç²âÊÔ"6
|
{100,59,76,91,63}, //"³äµç¼à²â"5
|
{96,59,73,73,87,64}, //"Êý¾Ý¹ÜÀí"6
|
{106,59,77,78,76,74,69,70,59}, //"ϵͳÉèÖÃ"9
|
{108,76,74,77,72,74,78,76}, //"²é¿´µ¥Ìå"8
|
{108,76,64,63,79,77,78,59,73,74,61,70,68},//"²ÎÊýÔ¤ÖÃ"13
|
};
|
const prog_uchar MenuButton[3][8] =
|
{
|
{94,87,60,74,76}, //Ñ¡Ôñ5
|
{94,61,74,63}, //È·¶¨4
|
" " //
|
};
|
#endif
|
//
|
|
static unsigned char MenuItemIndex = MenuItem0;
|
|
unsigned char DSPMainMenu(void)
|
{
|
DisableCustomInput();
|
GB_SYS_State.CurrentPage = DSPMainMenu;
|
GB_SYS_State.GetInput = GetMenuSelected;
|
DisableMonomerVolGether();
|
DSPMainMenuText(MenuItemIndex);
|
DrawButtonH48(2, MenuButton[0], 5, 16, 8, 149, 400, gray1, white);//Ñ¡Ôñ
|
DrawButtonH48(2, MenuButton[1], 4, 16, 18, 399, 400, gray1, white);//È·¶¨
|
return 0;
|
}
|
//
|
|
void DSPMainMenuText(unsigned char select)
|
{
|
unsigned char fcolor,bcolor;
|
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
#if(ProductionType == Production_STD)
|
#if(MashineType == FBO48CT)
|
DSP16x24Str(MenuCaption[0], 10, 16, 24, 24, blue, yellow);//FBO-4815CT
|
DrawLine(24, 50, 20, 0, blue, white, linebold, 2);
|
DSP24x24Str(MenuVersionText[0], 5, 12, 208, 30, blue, red);//V-3.1
|
#else
|
DSP24x24Str(MenuCaption, 11, 16, 24, 24, blue, yellow);//IDCE-4815CT
|
DrawLine(24, 50, 22, 0, blue, white, linebold, 2);
|
DSP24x24StrS(MenuVersionText, 5, 16, 224, 30, blue, red);//V-3.1
|
#endif
|
#else
|
DSP24x24Str(MenuVersionText[0], 5, 12, 24, 30, blue, red);//V-3.1
|
#endif
|
//###################### Çë×¢ÒâÔ¤±àÒëÇø ################################
|
|
if(select == MenuItem0) {fcolor = white; bcolor = green5;}
|
else{fcolor = white; bcolor = gray1;}
|
DrawButtonH48(4, MenuButton[2], 0, 30, 23, 72, 92, bcolor, fcolor);//5¸ö°´Å¥
|
#if(SoftLanguage == CN)
|
DSP32x32Str(MenuText[0], 4, 48, 80, 100, bcolor, white); //·Åµç²âÊÔ
|
#else
|
DSP16x24Str(MenuText[0], 6, 14, 120, 104, bcolor, white);
|
#endif
|
|
if(select == MenuItem1) {fcolor = white; bcolor = green5;}
|
else{fcolor = white; bcolor = gray1;}
|
DrawButtonH48(4, MenuButton[2], 0, 30, 23, 368, 92, bcolor, fcolor);//5¸ö°´Å¥
|
#if(SoftLanguage == CN)
|
DSP32x32Str(MenuText[1], 4, 48, 376, 100, bcolor, white); //³äµç²âÊÔ
|
#else
|
DSP16x24Str(MenuText[1], 5, 14, 425, 104, bcolor, white);
|
#endif
|
|
if(select == MenuItem2) {fcolor = white; bcolor = green5;}
|
else{fcolor = white; bcolor = gray1;}
|
DrawButtonH48(4, MenuButton[2], 0, 30, 23, 72, 192, bcolor, fcolor);//5¸ö°´Å¥
|
#if(SoftLanguage == CN)
|
DSP32x32Str(MenuText[2], 4, 48, 80, 200, bcolor, white); //Êý¾Ý¹ÜÀí
|
#else
|
DSP16x24Str(MenuText[2], 6, 14, 120, 204, bcolor, white);
|
#endif
|
|
if(select == MenuItem3) {fcolor = white; bcolor = green5;}
|
else{fcolor = white; bcolor = gray1;}
|
DrawButtonH48(4, MenuButton[2], 0, 30, 23, 368, 192, bcolor, fcolor);//5¸ö°´Å¥
|
#if(SoftLanguage == CN)
|
DSP32x32Str(MenuText[3], 4, 48, 376, 200, bcolor, white);//²ÎÊýÉèÖÃ
|
#else
|
DSP16x24Str(MenuText[3], 9, 14, 400, 204, bcolor, white);
|
#endif
|
|
if(select == MenuItem4) {fcolor = white; bcolor = green5;}
|
else{fcolor = white; bcolor = gray1;}
|
DrawButtonH48(4, MenuButton[2], 0, 30, 23, 72, 292, bcolor, fcolor);//5¸ö°´Å¥
|
#if(SoftLanguage == CN)
|
DSP32x32Str(MenuText[4], 4, 48, 80, 300, bcolor, white);//²é¿´µ¥Ìå
|
#else
|
DSP16x24Str(MenuText[4], 8, 14, 110, 304, bcolor, white);
|
#endif
|
|
if(select == MenuItem5) {fcolor = white; bcolor = green5;}
|
else{fcolor = white; bcolor = gray1;}
|
DrawButtonH48(4, MenuButton[2], 0, 30, 23, 368, 292, bcolor, fcolor);//5¸ö°´Å¥
|
#if(SoftLanguage == CN)
|
DSP32x32Str(MenuText[5], 4, 48, 376, 300, bcolor, white);//¹ØÓÚ±¾»ú
|
#else
|
DSP16x24Str(MenuText[5], 13, 14, 375, 304, bcolor, white);
|
#endif
|
}
|
//
|
|
void GetMenuSelected(void)
|
{
|
static unsigned char lastkey = ButtonNull;
|
static unsigned char getlastkeycount = 0;
|
unsigned char touched_item;
|
|
touched_item = GetTouchLocal();
|
if(touched_item == ButtonNull)//Èç¹û°´¼üΪ¿ÕÔòÖ±½Ó·µ»Ø;
|
{
|
getlastkeycount = 0;
|
lastkey = ButtonNull;
|
return;
|
}
|
//------------------ ´¦Àí°´¼ü --------------------
|
if(touched_item == Button1) //Ñ¡Ôñ
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
MenuItemIndex++;
|
if(MenuItemIndex > MenuItem5)
|
{
|
MenuItemIndex = MenuItem0;
|
}
|
DSPMainMenuText(MenuItemIndex);
|
_delay_ms(100);
|
return;
|
}
|
else if(touched_item == Button3) //È·¶¨
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
touched_item = MenuItemIndex;
|
RespondMenuKeyboard(&MenuItemIndex, touched_item);
|
return;
|
}
|
|
if((touched_item==lastkey) && (getlastkeycount<10))
|
{
|
getlastkeycount++;
|
}
|
lastkey = touched_item;
|
if(getlastkeycount > 0)
|
{
|
return;
|
}
|
if((touched_item>=MenuItem0) && (touched_item<=MenuItem5))
|
{
|
if(GetButtonIsBeep(0) == BeepIsWork)
|
BuzzerBeep(100);
|
RespondMenuKeyboard(&MenuItemIndex, touched_item);
|
_delay_ms(50);
|
}
|
}
|
//
|
|
void RespondMenuKeyboard(unsigned char *index, const unsigned char touchitem)
|
{
|
switch(touchitem)
|
{
|
//------------------ ´¦Àí°´¼ü --------------------
|
case MenuItem0://·Åµç²âÊÔ
|
if(*index == MenuItem0)
|
{
|
//############# Çë×¢ÒâÔ¤±àÒëÇø #################
|
#if(MashineType == FBO48CT)
|
BackColorCH();
|
DSPSelectForm();
|
#else
|
GB_TestingParm[0] = 0;
|
GB_TestingParm[1] = 0;
|
BackColorCH();
|
DSPWorkingPage();
|
#endif
|
//############# Çë×¢ÒâÔ¤±àÒëÇø #################
|
return;
|
}
|
break;
|
case MenuItem1://³äµç¼à²â
|
if(*index == MenuItem1)
|
{
|
BackColorCH();
|
DSPChargePage();
|
return;
|
}
|
break;
|
case MenuItem2://Êý¾Ý¹ÜÀí
|
if(*index == MenuItem2)
|
{
|
BackColorCH();
|
DSPFileManagePage();
|
return;
|
}
|
break;
|
case MenuItem3://ϵͳÉèÖÃ
|
if(*index == MenuItem3)
|
{
|
BackColorCH();
|
DSPSYSSetPage();
|
return;
|
}
|
break;
|
case MenuItem4://²é¿´µ¥Ìå
|
if(*index == MenuItem4)
|
{
|
if(GB_FBO_Data.BattSum == 0)
|
{
|
DSPMessageBox(MenuMCZeroText[0], 19, MB_OK, BeepNull);
|
return;
|
}
|
BackColorCH();
|
DSPSingleVolData();
|
return;
|
}
|
break;
|
case MenuItem5://¹ØÓÚ±¾»ú
|
if(MenuItemIndex == MenuItem5)
|
{
|
BackColorCH();
|
DSPAboutPage();
|
return;
|
}
|
break;
|
}
|
|
MenuItemIndex = touchitem;
|
DSPMainMenuText(MenuItemIndex);
|
}
|
//
|
|
/*********************** END OF FILE (MainMenu.c)**************************/
|