source: svn/trunk/zasc/app/DST_WinEngineerMenu.cpp @ 2

Last change on this file since 2 was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 7.9 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#ifndef DSTAR
12#include "DHL_OSAL.h"
13#include "DHL_OSAL_Priv.h"
14#endif
15
16
17#if 0
18____CEngineerMenuWin___()
19#endif
20
21char* DST_GetAppShortVersion();
22const char *DST_GetVendorInfo(void);
23const char *DST_GetModelName(void);
24
25class CEngineerMenuWin : public CWindow
26{
27private:
28       
29public:
30        CEngineerMenuWin(SWinEventMsg event):CWindow(event)
31        {
32                setFontStyle(22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_LEFT);
33                rect.w = 576;
34                rect.h = 384;
35                rect.x = (DST_GetScreenWidth() - rect.w) / 2;
36                rect.y = (DST_GetScreenHeight() - rect.h) / 2;
37
38                SetTimeOut(0);
39
40                SetTimer(1, 1000);
41        }
42
43        virtual void OnTimer(char nID)
44        {
45                Show();
46        }
47
48        DS_U16* GetString(int nPos)
49        {
50                switch (nPos)
51                {
52                        case 1: return pz_Age_Rating_None[OSD_Lang];
53                        case 2: return pz_Age_Rating_12[OSD_Lang];
54                        case 3: return pz_Age_Rating_15[OSD_Lang];
55                        case 4:  return pz_Age_Rating_19[OSD_Lang];
56                        default: break;
57                }
58                return 0;
59        }       
60       
61        virtual void Show(WinID id)
62        {
63                switch(id)
64                {
65                        case WIN_EWS:
66                        //case WIN_CHANNEL_BANNER:
67                        case WIN_DEBUG_SQL:
68                        case WIN_DEBUG_SQL_SUB:
69                        case WIN_DIRECT_TUNE:
70                        case WIN_VOLUME:
71                        case WIN_VOLUME_MUTE:
72                        case WIN_SIGNAL_METER:
73                        case WIN_CLOSED_CAPTION_HOT:
74                        case WIN_AUDIO_HOT:
75                        case WIN_DISPLAY_MODE_HOT:
76                        case WIN_FACTORY_RESET:
77                        case WIN_FACTORY_RESET_ASK:
78                        case WIN_INFOR_BANNER:
79                        case WIN_POWER_DOWN_CAUTION:
80                        case WIN_MAIN_MENU:
81                        case WIN_SUB_MENU_2DEPTH:
82                        case WIN_SUB_MENU_3DEPTH:
83                        case WIN_SUB_MENU_4DEPTH:
84                        case WIN_AUTO_SEARCH:
85                        case WIN_MANUAL_SEARCH:
86                        case WIN_CHANNEL_LIST:
87                        case WIN_PROGRAM_GUIDE:
88                        case WIN_PASSWD_CHANGE:
89                        case WIN_PASSWD_CHECK:
90                        case WIN_PASSWD_CONFIRM:
91                        case WIN_AGE_RATING:
92                                Close();
93                                break;
94                        default:
95                                break;
96                }
97        }
98
99        virtual void Show()
100        {
101                RegisterKey(VK_CANCEL, true);
102                RegisterKey(VK_PREV, true);
103                RegisterKey(VK_PREV_MENU, true);
104                RegisterKey(VK_1, true);
105                RegisterKey(VK_2, true);
106                RegisterKey(VK_3, true);
107                RegisterKey(VK_4, true);
108                RegisterKey(VK_5, true);
109                RegisterKey(VK_6, true);
110                RegisterKey(VK_7, true);
111                RegisterKey(VK_8, true);
112                RegisterKey(VK_9, true);
113                RegisterKey(VK_0, true);
114               
115                DrawBox32(0, 0, rect.w, rect.h, CONV32_16(0xAA262626));
116                setFontStyle(15, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_LEFT);
117                //((CT_AV_START)
118                DS_U8 RF = 0;
119                DS_U16 SourceID = 0;
120//              DS_U8 tuneMode = 0;
121//              DS_U8 state = 0;
122
123                //(CT_AV_INFO)
124                DS_U32 PCR = 0;
125                DS_U32 vPid = 0;
126                DS_U32 aPid = 0;
127                DS_U32 vType = 0;
128                DS_U32 aType = 0;
129
130                //(CT_SIGNAL_INFO)
131                bool bLock = 0;
132                int ss = 0;
133                DS_U32 ber_a = 0;
134                DS_U32 ber_b = 0;
135
136                //(CT_VIDEO_RESOLUTION)
137                DS_U16 vWidth = 0;
138                DS_U16 vHeight = 0;
139                DS_U16 fps = 0;
140                bool bInterlace = false;
141                bool bWide = false;
142
143                //(CT_SIGNAL)
144                bool vAlive = false;
145                bool aAlive = false;
146
147                //MEMORY
148                DS_U32 total_size = 0;
149                DS_U32 free_size = 0;
150                DS_U32 largest_free_size = 0;
151
152#ifndef DSTAR
153
154                //DHL_OS_HEAP_STATUS status;
155                //DHL_OS_GetHeapStatus(&status);
156                //total_size = status.total_size;
157                //free_size = status.free_size;
158                //largest_free_size = status.largest_free_size;
159#endif
160               
161                DST_GetAVState(&RF, 0, &SourceID);
162                DST_GetAVInfo(&PCR, &vPid, &aPid, &vType, &aType);
163                DST_GetSignalInfo(&bLock, &ss, &ber_a, &ber_b);
164                DST_GetVideoSize(&vWidth, &vHeight, &fps, &bInterlace, &bWide);
165                DST_GetAVAliveInfo(&vAlive, &aAlive);
166
167
168                char strText[9][256];
169                for(int i=0;i<9;i++)
170                {
171                        memset(strText[i], 0, 256);
172                }
173
174                DrawText(2, 2, rect.w, 20, (char*)"**** STATUS ****", &font);   
175
176                sprintf(strText[0], "S/W Version: %s %s, Compile Time : %s %s ",DST_GetModelName(), DST_GetAppShortVersion(),  __DATE__, __TIME__);
177                DrawText(2, 22, rect.w, 20, strText[0], &font);
178
179                sprintf(strText[1], "FrontEnd: %s, strength [%d]", bLock?(char*)"lock":(char*)"unlock", ss);
180                DrawText(2, 42, rect.w, 20, strText[1], &font);
181
182                char chNum[20];
183                DS_U32 chName[21];
184                int num = 0;
185                if (DST_DB_GetCurrentChannelInfo(chNum, chName, &num) == false) sprintf(chNum, "%d ", num); // RF ¹øÈ£         
186
187                DS_U32 tmpStr[256] = {0,};
188                sprintf(strText[2], "Tuning: %s, [", chNum);
189                str232(tmpStr,strText[2]);
190                strcpy32(&tmpStr[strlen32(tmpStr)],chName);
191                sprintf(strText[2], "], pva [0x%2X/0x%2X/0x%2X]", (unsigned int)PCR, (unsigned int)vPid, (unsigned int)aPid);
192                str232(&tmpStr[strlen32(tmpStr)],strText[2]);
193                DrawText32(2, 62, rect.w, 20, tmpStr, &font);
194
195                sprintf(strText[3], "               video alive [%s], audio alive [%s]", vAlive?(char *)"true":(char *)"false", aAlive?(char *)"true":(char *)"false");
196                DrawText(2, 82, rect.w, 20, strText[3], &font);
197               
198
199                DS_U16 avStr[256] = {0,};
200               
201                char strFPS[10] = "N/A";
202                switch (fps)
203                {
204                        case 1: strcpy(strFPS, "23.976"); break;
205                        case 2: strcpy(strFPS, "24"); break;
206                        case 3: strcpy(strFPS, "25"); break;
207                        case 4: strcpy(strFPS, "29.97"); break;
208                        case 5: strcpy(strFPS, "30"); break;
209                        case 6: strcpy(strFPS, "50"); break;
210                        case 7: strcpy(strFPS, "59.94"); break;
211                        case 8: strcpy(strFPS, "60"); break;
212                }
213               
214                if(vWidth==0)
215                        sprintf(strText[4], "AV: source( %dx%d %s %sHz %s ), output 480i, audio: ", (int)vWidth, (int)vHeight, (char *)"(null)", strFPS, (char *)"(null)");
216                else
217                        sprintf(strText[4], "AV: source( %dx%d %s %sHz %s ), output 480i, audio: ", (int)vWidth, (int)vHeight, bInterlace?(char*)"i":(char*)"p", strFPS, bWide?(char*)"wide":(char*)"normal");
218                str2uni(avStr,strText[4]);
219                strcpy16(&avStr[strlen16(avStr)], DST_UI_GetMTS()==0?pz_MTS_Main[OSD_Lang]:pz_MTS_Sub[OSD_Lang]);
220                DrawTextUni(2, 102, rect.w, 20, avStr, &font);
221
222                char vTypeStr[20] = {0,};
223                char aTypeStr[20] = {0,};
224                switch (vType) // ABNT NBR 15602-3:2007 Table 5 ? Strem_type
225                {
226                        case 0x01: sprintf(vTypeStr,(char *)"MPEG1"); break;
227                        case 0x02: sprintf(vTypeStr,(char *)"MPEG2"); break;
228                        case 0x1B: sprintf(vTypeStr,(char *)"AVC(H.264)"); break;
229                };
230                switch (aType) // ABNT NBR 15602-3:2007 Table 5 ? Strem_type
231                {
232                        case 0x03: sprintf(aTypeStr,(char *)"MPEG1"); break;
233                        case 0x04: sprintf(aTypeStr,(char *)"MPEG2"); break;
234                        case 0x0F: sprintf(aTypeStr,(char *)"AAC(ADTS)"); break;
235                        case 0x11: sprintf(aTypeStr,(char *)"AAC(LATM)"); break;
236                };
237
238                sprintf(strText[5], "AV format: video %s[0x%2X], audio %s[0x%2X]", vTypeStr, (unsigned int)vType, aTypeStr, (unsigned int)aType);
239                DrawText(2, 122, rect.w, 20, strText[5], &font);       
240
241
242                sprintf(strText[6], "Memory: Heap Total: %dBytes, Free: %dBytes, LFree: %dBytes",(int)total_size,(int)free_size,(int)largest_free_size);
243                DrawText(2, 142, rect.w, 20, strText[6], &font);       
244                DS_U32 sec = DST_OS_GetTickCount()/DST_OS_GetTicksPerSecond();
245                DS_U32 min = sec / 60;
246                DS_U32 hour = min / 60;
247                sec = sec % 60;
248                min = min % 60;
249                sprintf(strText[7], "Running time: %02d:%02d:%02d",(int)hour, (int)min, (int)sec);
250                DrawText(2, 162, rect.w, 20, strText[7], &font);       
251
252               
253                DrawText(2, 222, rect.w, 20, (char*)"**** commands ****", &font);       
254                DrawText(2, 242, rect.w, 20, (char*)"1. show SQL database", &font);     
255               
256                DrawText(2, 362, rect.w, 20, (char*)"[0..9] Select ", &font);   
257
258
259        }
260
261
262        virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
263        {
264                switch(key)
265                {
266                        case VK_1:
267                                DST_Printf("Enter DB SQL Menu\n");
268                                DST_CreateWin(WIN_DEBUG_SQL); // ¿£Áö´Ï¾î ¸ðµå ÁøÀÔ
269                                break;
270                        case VK_2:
271                        case VK_3:
272                        case VK_4:
273                        case VK_5:
274                        case VK_6:
275                        case VK_7:
276                        case VK_8:
277                        case VK_9:
278                        case VK_0:
279                                break;
280                        case VK_CANCEL:
281                        case VK_PREV:
282                        case VK_PREV_MENU:
283                        default:
284                                Close();
285                                break;
286                }
287        }
288
289};
290
291void DST_CreateEngineerMenuWin(SWinEventMsg event)
292{
293        DST_RemoveAllWindowExceptBasicWin();
294        DST_AddWin((WinID)(event.data[0]), new CEngineerMenuWin(event));
295}
296
297
Note: See TracBrowser for help on using the repository browser.