source: svn/zasc/app_c/DST_WinRFUpdate.c

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

File size: 4.9 KB
Line 
1#include "DST_WinManager.h"
2#include "DST_OSDImage.h"
3#include "DST_CommonAPI.h"
4#include "DST_UserInterface.h"
5#include "DST_DataStrings.h"
6#include "DST_Updates.h"
7
8void JST_RFUpdate(DS_U8 RF);
9
10#if 0
11____CRFUpdateWin___()
12#endif
13
14//class CRFUpdateWin : public CWindow
15//{
16        static int CRFUpdateWin_nReceivePos;
17        static int CRFUpdateWin_nWritePos;
18        static int CRFUpdateWin_nCategory;
19        static char CRFUpdateWin_strVersion[8];
20//public:
21//      CRFUpdateWin(SWinEventMsg event):CWindow(event)
22        void CRFUpdateWin_Constructor(CWindow *this, SWinEventMsg event)
23        {
24                this->SetWinName(this,  "RFUpdate");
25                DST_g_RFUpdateState = 0;
26                this->RegisterAllKey(this);
27                this->rect.w = DST_GetScreenWidth();
28                this->rect.h = DST_GetScreenHeight();
29                this->rect.x = 0;
30                this->rect.y = 0;
31                this->SetTimeOut(this, 0);
32//              JST_RFUpdate(10);
33                CRFUpdateWin_nReceivePos = 0;
34                CRFUpdateWin_nWritePos = 0;
35                CRFUpdateWin_nCategory = 0;
36                CRFUpdateWin_strVersion[0] = 0;
37        }
38
39        void CRFUpdateWin_Destructor(CWindow *this)
40        {
41                JST_Stop();     
42        }
43       
44//      virtual void OnMessage(SWinEventMsg event)
45        void CRFUpdateWin_OnMessage(CWindow *this, SWinEventMsg event)
46        {
47                switch (event.cmd)
48                {
49                        case WM_RF_UPDATE:
50                                switch(event.data32[0])
51                                {
52                                        case DATA_RECEIVING: // DATA RECEIVING
53                                                memcpy(CRFUpdateWin_strVersion, &event.data32[2], 8);
54                                                CRFUpdateWin_nReceivePos = event.data32[1];
55                                                CRFUpdateWin_nWritePos = 0;
56                                                DST_g_RFUpdateState = 0;
57                                                break;
58                                        case DATA_RECEIVING_COMPLETE: // DATA RECEIVING COMPLETE
59                                                CRFUpdateWin_nReceivePos = 100;
60                                                CRFUpdateWin_nWritePos = 0;
61                                                DST_g_RFUpdateState = 0;
62                                                break;
63                                        case FLASH_WRITING: // FLASH WRITING
64                                                CRFUpdateWin_nReceivePos = 100;
65                                                CRFUpdateWin_nWritePos = event.data32[1];
66                                                CRFUpdateWin_nCategory = event.data32[2];
67                                                DST_g_RFUpdateState = 0;
68                                                break;
69                                        case FLASH_WRITING_COMPLETE: // FLASH WRITING COMPLETE
70                                                CRFUpdateWin_nReceivePos = 100;
71                                                CRFUpdateWin_nWritePos = 100;
72                                                DST_g_RFUpdateState = 1;
73                                                break;
74                                        case FLASH_WRITING_FAIL: // FLASH WRITING FAIL
75                                                CRFUpdateWin_nReceivePos = 100;
76                                                CRFUpdateWin_nWritePos = 100;
77                                                DST_g_RFUpdateState = 2;
78                                                break;                                         
79                                        case 100: // Different model
80                                                DST_g_RFUpdateState = 2;
81                                                break;
82                                        case 101: // Same Version
83                                                memcpy(CRFUpdateWin_strVersion, &event.data32[2], 8);
84                                                DST_Printf("strVersion = %s\n", CRFUpdateWin_strVersion);
85                                                CRFUpdateWin_nReceivePos = 100;
86                                                CRFUpdateWin_nWritePos = 100;
87                                                DST_g_RFUpdateState = 1;
88                                                break;
89                                        default: break;
90                                }
91                                this->Show(this);
92                                break;
93                        default: break;
94                }
95        }
96
97//      virtual void Show()
98        void CRFUpdateWin_Show(CWindow *this)
99        {
100                char strText[64];
101                this->DrawBox32(this, 0,0,this->rect.w, this->rect.h, CONV32_16(0xFF808080));
102               
103                this->setFontStyle(this, 30, 0xFFFFFFF, ALIGN_MIDDLE,ALIGN_CENTER);
104                this->DrawText(this, 0,   60, this->rect.w, 60, "RF Update", &(this->font));
105               
106                sprintf(strText, "Data Receiving : %s", CRFUpdateWin_strVersion);
107                this->setFontStyle(this, 25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
108                this->DrawText(this, 0, 150, this->rect.w, 40, strText, &(this->font));
109               
110                this->DrawBox32(this, 60-1, 200    ,    600+2, 50, CONV32_16(0xFFFFFFFF));
111                this->DrawBox32(this, 60, 200 + 1, CRFUpdateWin_nReceivePos * 6, 48, CONV32_16(0xFF00FF00));
112                 
113                sprintf(strText, "%d%%", CRFUpdateWin_nReceivePos);
114                this->setFontStyle(this, 25, 0xFF000000, ALIGN_MIDDLE,ALIGN_CENTER);
115                this->DrawText(this, 0, 200, this->rect.w, 50, strText, &(this->font));
116               
117                this->setFontStyle(this, 25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
118                this->DrawText(this, 0, 300, this->rect.w, 40, "Flash Writing:", &(this->font));
119               
120                this->DrawBox32(this, 60-1, 350    ,    600+2, 50, CONV32_16(0xFFFFFFFF));
121                this->DrawBox32(this, 60, 350 + 1, CRFUpdateWin_nWritePos * 6, 48, CONV32_16(0xFF00FF00));
122               
123//              strText[5];
124                sprintf(strText, "%d%%", CRFUpdateWin_nWritePos);
125                this->setFontStyle(this, 25, 0xFF000000, ALIGN_MIDDLE,ALIGN_CENTER);
126                this->DrawText(this, 0, 350, this->rect.w, 50, strText, &(this->font));
127
128                this->setFontStyle(this, 25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
129                switch(CRFUpdateWin_nCategory)
130                {
131                        case UPDATE_BOOTLOADER: this->DrawText(this, 0, 400, this->rect.w, 40, "Bootloader", &(this->font));break;
132                        case UPDATE_APPLICATION0: this->DrawText(this, 0, 400, this->rect.w, 40, "Application 0", &(this->font));break;
133                        case UPDATE_APPLICATION1: this->DrawText(this, 0, 400, this->rect.w, 40, "Application 1", &(this->font));break;
134                        default: break;
135                }
136        }
137//};
138
139void DST_CreateRFUpdateWindow(SWinEventMsg event)
140{
141        if (DST_GetWin(WIN_RF_UPDATE)) return;
142       
143        DST_RemoveAllWindowExceptBasicWin();
144
145        CWindow*pWin = NewCWindow(event);
146        pWin->Destructor        = CRFUpdateWin_Destructor;
147        pWin->OnMessage         = CRFUpdateWin_OnMessage;
148        pWin->Show                      = CRFUpdateWin_Show;
149        // »ý¼ºÀÚ È£Ãâ
150        CRFUpdateWin_Constructor(pWin, event);
151        // À©µµ¿ì ¸Þ´ÏÀú¿¡ µî·Ï
152        DST_AddWin((WinID)(event.data[0]), pWin);       
153}
Note: See TracBrowser for help on using the repository browser.