source: svn/trunk/zasc/app_c/DST_WinFactory.c @ 17

Last change on this file since 17 was 17, checked in by megakiss, 11 years ago

주파수 설정 메뉴 추가
진입방법 : 상하좌우상상

File size: 7.5 KB
Line 
1#include "DST_Window.h"
2#include "DST_WinManager.h"
3#include "DST_CommonAPI.h"
4#include "DST_UserInterface.h"
5#include "DST_DataStrings.h"
6#include "DST_ISDBT_ChannelTask.h"
7#include "DST_DB.h"
8#include "DST_ChannelTune.h"
9#include "DST_SignalMonitor.h"
10
11
12
13#if 0
14____CFactoryWin___()
15#endif
16void DST_Tune(DS_U8 RF, DS_U16 program_number);
17
18char *DST_GetBoardVersion(void);
19char* DST_GetAppShortVersion();
20void JST_RFUpdate(DS_U8 RF);
21
22
23
24//class CFactoryWin : public CWindow
25//{
26//private:
27        static DS_U16 CFactoryWin_Pos;
28        static DS_U16 CFactoryWin_Top;
29        static DS_U16 CFactoryWin_Select;
30        static DS_U16 CFactoryWin_ListNum;
31        static DS_U16 CFactoryWin_ItemNum;
32        static int CFactoryWin_signal;
33        static bool CFactoryWin_nPWR_pressed;
34        static bool CFactoryWin_nCHUP_pressed;
35        static bool CFactoryWin_nCHDN_Pressed;
36        static int CFactoryWin_nRF[2];
37        static int CFactoryWin_chUp;
38       
39//public:
40void CFactoryWin_InitValues();
41
42//      CFactoryWin(SWinEventMsg event):CWindow(event)
43        void CFactoryWin_Constructor(CWindow *this, SWinEventMsg event)
44        {
45                this->SetWinName(this,  "Factory");
46                DST_g_bFactoryMode = true;
47                CFactoryWin_InitValues();
48
49                this->setFontStyle(this, 22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_LEFT);
50                this->rect.w = 576;
51                this->rect.h = 384;
52                this->rect.x = (DST_GetScreenWidth() - this->rect.w) / 2;
53                this->rect.y = (DST_GetScreenHeight() - this->rect.h) / 2;
54
55                this->SetTimeOut(this, 0);
56
57
58                // ÃÖ´ë º¼·ýÀ¸·Î
59                DST_UI_SetMute(false);
60                DST_UI_SetVolume(50);
61                this->SetTimeOut(this, 0);
62                // °øÀåÃʱâÈ­
63                DST_EEPROM_SetMinRF(0); // DST_EEPROM_SetNeedReset¿¡¼­ ÃʱâÈ­ ÇÏÁö ¾Ê±â¶§¹®¿¡ °­Á¦·Î ±âº»°ªÀ» ½áÁØ´Ù.
64                DST_EEPROM_SetMaxRF(0); // DST_EEPROM_SetNeedReset¿¡¼­ ÃʱâÈ­ ÇÏÁö ¾Ê±â¶§¹®¿¡ °­Á¦·Î ±âº»°ªÀ» ½áÁØ´Ù.
65                DST_EEPROM_SetNeedReset(1);
66                DST_DB_Sync();
67                // ä³Î Æ©´×
68               
69                DST_Tune(CFactoryWin_nRF[CFactoryWin_chUp], 0); // ä³Î4¹ø
70                this->SetTimer(this, 1, 500);
71        }
72
73        void CFactoryWin_Destructor(CWindow *this)
74        {
75       
76        }
77       
78        void CFactoryWin_InitValues()
79        {               
80                CFactoryWin_nPWR_pressed = false;
81                CFactoryWin_nCHUP_pressed = false;
82                CFactoryWin_nCHDN_Pressed = false;
83                CFactoryWin_signal      = DST_GetSignalStrength();
84                CFactoryWin_Pos = 0;
85                CFactoryWin_Top = 0;
86                CFactoryWin_Select = 0;
87                CFactoryWin_ListNum = 3;
88                CFactoryWin_ItemNum = 3;
89                if (CFactoryWin_ItemNum < CFactoryWin_ListNum) CFactoryWin_ListNum = CFactoryWin_ItemNum;
90
91                CFactoryWin_nRF[0] = DST_GetIndexByRFNumber(4);
92                CFactoryWin_nRF[1] = DST_GetIndexByRFNumber(48);
93                CFactoryWin_chUp = 0;
94        }
95
96//      virtual void OnTimer(char nID)
97        void CFactoryWin_OnTimer(CWindow *this, char nID)
98        {
99               
100//              DST_Tune(Select+14, 1, 1);
101                switch (nID)
102                {
103                        case 1:
104                                this->Show(this);
105                                break;
106                        case 2:
107                                this->KillTimer(this,2);
108                                CFactoryWin_nCHUP_pressed = false;
109                                CFactoryWin_nCHDN_Pressed = false;
110                                CFactoryWin_nPWR_pressed = false;                               
111                                this->Show(this);
112                                break;
113                        case 3:
114                                this->KillTimer(this,3);
115                                CFactoryWin_nCHUP_pressed = false;
116                                CFactoryWin_nCHDN_Pressed = false;
117                                CFactoryWin_nPWR_pressed = false;       
118                                this->Show(this);
119                                break;
120                        case 4:
121                                this->KillTimer(this,4);                               
122                                CFactoryWin_nCHUP_pressed = false;
123                                CFactoryWin_nCHDN_Pressed = false;
124                                CFactoryWin_nPWR_pressed = false;       
125                                this->Show(this);
126                                break;
127                        default:
128                                break;
129        }
130        }
131
132//      virtual void Show()
133        void CFactoryWin_Show(CWindow *this)
134        {
135                DS_U8 RF = 0;
136                int i = 0;
137                char strText[10][256];
138               
139                DST_GetAVState(&RF , 0, 0);
140               
141                this->RegisterAllKey(this); // ¸ðµç Ű µî·Ï
142                this->DrawBox32(this, 0, 0, this->rect.w, this->rect.h, CONV32_16(0x00000000));
143               
144                this->setFontStyle(this, 22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_LEFT);
145                for( i=0;i<10;i++)
146                {
147                        memset(strText[i], 0, 256);
148                }
149                sprintf(strText[0], " S/W version : %s", DST_GetAppShortVersion() );
150                this->DrawText(this, 2, 2, this->rect.w, 30, strText[0], &(this->font));
151
152                sprintf(strText[1], " H/W version : %s", DST_GetBoardVersion());
153                this->DrawText(this, 2, 32, this->rect.w, 30, strText[1], &(this->font));
154
155                sprintf(strText[2], " FrontEnd : Broadcom" );
156                this->DrawText(this, 2, 62, this->rect.w, 30, strText[2], &(this->font));
157
158                CFactoryWin_signal      = DST_GetSignalStrength();
159                sprintf(strText[3], " Signal Strength : %d ", CFactoryWin_signal);
160                this->FontSetColor(this, CONV32_16((CFactoryWin_signal > 28 && DST_g_Lock == 1) ? 0xFF00FF00 : 0xFFFF0000));
161                this->DrawText(this, 2, 92, this->rect.w, 30, strText[3], &(this->font));
162               
163                this->setFontStyle(this, 22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_LEFT);
164
165                sprintf(strText[4], " RF : %d", DST_GetFrequencyNumberbyIndex(RF));
166                this->DrawText(this, 2, 122, this->rect.w, 30, strText[4], &(this->font));
167               
168                sprintf(strText[5], " Front Key Test :  ");
169                this->DrawText(this, 2, 152, this->rect.w, 30, strText[5], &(this->font));
170               
171                this->setFontStyle(this, 22, 0xFF000000, ALIGN_MIDDLE, ALIGN_CENTER);
172               
173                sprintf(strText[6], "UP");
174                this->DrawBox32(this, 69, 192, 100, 40, CONV32_16(CFactoryWin_nCHUP_pressed ? 0xFFFF0000 : 0xFFFFFFFF));
175                this->DrawText(this, 69, 192, 100, 40, strText[6], &(this->font));
176               
177
178                sprintf(strText[7], "DOWN");
179                this->DrawBox32(this, 238, 192, 100, 40, CONV32_16(CFactoryWin_nCHDN_Pressed ? 0xFFFF0000 : 0xFFFFFFFF));
180                this->DrawText(this, 238, 192, 100, 40, strText[7], &(this->font));
181
182                sprintf(strText[8], "POWER");
183                this->DrawBox32(this, 407, 192, 100, 40, CONV32_16(CFactoryWin_nPWR_pressed ? 0xFFFF0000 : 0xFFFFFFFF));
184                this->DrawText(this, 407, 192, 100, 40, strText[8], &(this->font));
185               
186
187               
188                this->setFontStyle(this, 22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_LEFT);
189                sprintf(strText[9], " 1.CH_UP  7.RF UPDATE  " );
190                this->DrawText(this, 2, 344, this->rect.w, 30, strText[9], &(this->font));
191        }
192
193       
194//      virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
195        void CFactoryWin_KeyInput(CWindow *this, DS_U8 key, bool bRepeat)
196        {
197                switch(key)
198                {
199                        case VK_FAC_CANCEL:
200                        case VK_1:
201                        case VK_FAC_1:
202                                DST_g_bUseAirFreq = true;
203
204                                CFactoryWin_chUp = (CFactoryWin_chUp+1)%2;
205                                DST_UI_ChannelTune(CFactoryWin_nRF[CFactoryWin_chUp], 0);
206                                this->SetTimer(this, 2, 300);
207                                break;
208                        case VK_FAC_7:
209                        case VK_7:
210                                DST_g_bUseAirFreq = true;
211                                JST_RFUpdate(DST_GetIndexByRFNumber(18)); // RF 18¹øÀÌ RF ¾÷µ¥ÀÌÆ® Á֯ļöÀÓ
212                                DST_Printf("Enter RF Update Mode\n");
213                                DST_CreateWin(WIN_RF_UPDATE, 0, 0, 0, 0, 0); // RF ¾÷µ¥ÀÌÆ® ¸ðµå ÁøÀÔ
214                                break;
215                        case VK_KEY_UP:
216                                CFactoryWin_nCHUP_pressed = true;
217                                CFactoryWin_nCHDN_Pressed = false;
218                                CFactoryWin_nPWR_pressed = false;
219                                this->Show(this);
220                                this->SetTimer(this, 2, 100);
221                                break;
222                        case VK_KEY_DN:
223                                CFactoryWin_nCHUP_pressed = false;
224                                CFactoryWin_nCHDN_Pressed = true;
225                                CFactoryWin_nPWR_pressed = false;
226                                this->Show(this);
227                                this->SetTimer(this, 3, 100);
228                                break;
229                        case VK_KEY_PWR:
230                                CFactoryWin_nCHUP_pressed = false;
231                                CFactoryWin_nCHDN_Pressed = false;
232                                CFactoryWin_nPWR_pressed = true;
233                                this->Show(this);
234                                this->SetTimer(this, 4, 100);
235                                break;
236                }
237//              Close(); °øÀå¸ðµå¿¡¼­´Â OSD ¾È ´ÝÈ÷°Ô ÇÔ
238        }
239//};
240
241void DST_CreateFactoryWin(SWinEventMsg event)
242{
243        DST_RemoveAllWindowExceptBasicWin();
244        CWindow*pWin = NewCWindow(event);
245        pWin->Destructor        = CFactoryWin_Destructor;
246        pWin->KeyInput          = CFactoryWin_KeyInput;
247        pWin->OnTimer           = CFactoryWin_OnTimer;
248        pWin->Show                      = CFactoryWin_Show;
249        // »ý¼ºÀÚ È£Ãâ
250        CFactoryWin_Constructor(pWin, event);
251        // À©µµ¿ì ¸Þ´ÏÀú¿¡ µî·Ï
252        DST_AddWin((WinID)(event.data[0]), pWin);
253
254}
255
Note: See TracBrowser for help on using the repository browser.