whycyhl
2022-05-05 683c912f9ac1935a7b109fb402bb276dba450f6b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/************************** Copyright (c) **********************************
**                 FUZHOU FUGUANG ELECTRONICS Co.,LTD.
**                        ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
**                       http://www.fuguang.com
**
**-------------- File Info -------------------------------------------------
** File name:            SelectForm.c
** Last modified Date:  2008-11-16
** Last Version:        1.0
** Descriptions:        SelectForm functions
**
**--------------------------------------------------------------------------
** 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:        SelectForm functions
**
***************************************************************************/
//
#include "SelectForm.h"
#include "Define.h"
#include "AD7843_Driver.h"
#include "MainMenu.h"
#include "Buzzer_Driver.h"
#include <avr/pgmspace.h> 
#include "WorkingPage.h"
#include "ChargePage.h"
#include "SYSSetPage.h"
#include "TFT_Driver.h"
 
extern SYS_State GB_SYS_State;
extern unsigned int GB_TestingParm[13];
 
#if(SoftLanguage == CN)
const prog_uchar SelFCaption[2][4] =
{    
    {54, 56, 73, 74}, //·Åµçģʽ
    {101,101,101,101},// 
};
//
const prog_uchar SelFText[2][4] = 
{
    {25, 26, 0, 2},//ÔÚÏ߷ŵç
    {34, 26, 0, 2},//ÀëÏ߷ŵç
};
//
#else
const prog_uchar SelFCaption[2][12] =
{    
    
    "WorkMode",//·Åµçģʽ
    "   ",// 
};
//
const prog_uchar SelFText[2][10] = 
{
    "Online",//ÔÚÏ߷ŵç
    "Offline",//ÀëÏ߷ŵç
};
//
#endif
//
 
 
unsigned char DSPSelectForm(void)
{    
    DisableCustomInput();
    GB_SYS_State.CurrentPage = DSPSelectForm;
    GB_SYS_State.GetInput = GetSelectFormButtonDown;
    
    DSP24x24Str(SelFCaption[0], 4, 24, 24, 16, blue, yellow); //·Åµçģʽ
    #if(SoftLanguage == CN)
    DrawLine(24, 42, 12, 0,    blue, white, linebold, 2);
    #else
    DrawLine(24, 42, 13, 0,    blue, white, linebold, 2);
    #endif
    
    
    DrawButtonH48(4, SelFCaption[1], 2, 30, 23, 72, 192, gray1, gray2);    
    #if(SoftLanguage == CN)
        DSP32x32Str(SelFText[0], 4, 48, 80, 200, gray1, white);  //ÔÚÏ߷ŵç
    #else
        DSP24x24Str(SelFText[0], 4, 48, 130, 204, gray1, white);  //ÔÚÏ߷ŵç 
    #endif    
    
    DrawButtonH48(4, SelFCaption[1], 2, 30, 23, 368, 192, gray1, gray2);    
    #if(SoftLanguage == CN)
        DSP32x32Str(SelFText[1], 4, 48, 376, 200, gray1, white); //ÀëÏ߷ŵç
    #else
        DSP24x24Str(SelFText[1], 4, 48, 420, 204, gray1, white); //ÀëÏ߷ŵç
    #endif    
    
    return 0;
}
//
 
void GetSelectFormButtonDown(void)
{
    unsigned char touched_item;    
    
    touched_item = GetTouchLocal();
    
    if((touched_item==MenuItem2) || (touched_item==Button1))//ÔÚÏ߷ŵç
    {
        if(GetButtonIsBeep(0) == BeepIsWork)
            BuzzerBeep(100);        
        GB_TestingParm[0] = 0;
        GB_TestingParm[1] = 0;
        GB_SYS_State.CurrentPage = DSPMainMenu;
        BackColorCH();
        DSPWorkingPage();        
    }
    else if((touched_item==MenuItem3) || (touched_item==Button3))//ÀëÏ߷ŵç
    {    
        if(GetButtonIsBeep(0) == BeepIsWork)
            BuzzerBeep(100);
        GB_TestingParm[0] = 1;    
        GB_TestingParm[1] = 1;
        GB_SYS_State.CurrentPage = DSPMainMenu;        
        BackColorCH();
        DSPWorkingPage();        
    }
}
//