Changeset 19 in svn


Ignore:
Timestamp:
Mar 25, 2015 3:42:26 PM (11 years ago)
Author:
megakiss
Message:
 
Location:
trunk/zasc/app_c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zasc/app_c/DST_CommonAPI.c

    r17 r19  
    2727DS_U8 DST_MinRF() 
    2828{ 
    29         //return 0; 
    30         return DST_EEPROM_GetMinRF(); 
     29        return 0; 
     30        //return DST_EEPROM_GetMinRF(); 
    3131} 
    3232 
     
    3434DS_U8 DST_MaxRF() 
    3535{ 
    36         //return RF_COUNT - DST_MinRF() - 1; // RF 85¹ø Index 83 
    37         return DST_EEPROM_GetMaxRF(); 
     36        return RF_COUNT - DST_MinRF() - 1; // RF 85¹ø Index 83 
     37        //return DST_EEPROM_GetMaxRF(); 
    3838} 
    3939 
  • trunk/zasc/app_c/DST_EEPROM.c

    r17 r19  
    3333        {"VI", 0, 1, 0}, 
    3434        {"PreferredConn", 0, 1, 0}, 
    35         {"MinRF", 0, RF_COUNT-1-4, 0}, // ÃÖ¼Ò °øÁ߯Ä5°³ 
    36         {"MaxRF", 1, RF_COUNT-1, RF_COUNT-1} 
     35        {"MinRF", -1, RF_COUNT-1, -1},  
     36        {"MaxRF", -1, RF_COUNT-1, -1} 
    3737}; 
    3838// unsigned aspect_4x3o_4x3i:2; // 0~2 
  • trunk/zasc/app_c/DST_WinFrequencySetting.c

    r18 r19  
    9393        { 
    9494                this->RegisterAllKey(this); 
     95                // background 
    9596                this->DrawImage(this, 0, 0, newcon2_gui_banner_4line_back, false); 
    9697         
    97          
    9898                int nLineHeight = (this->rect.h) / 6; 
    99                  
     99                // title 
    100100                this->setFontStyle(this, 18, 0xFFC8C8C8, ALIGN_MIDDLE, ALIGN_CENTER); 
    101101                this->DrawText(this, 0, 0, this->rect.w, nLineHeight*2, (char*)"Frequency Setting", &(this->font)); 
    102                  
     102                // display max 
     103                if (nPos == 0) 
     104                { 
     105                        this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
     106                } 
     107                else 
     108                { 
     109                        this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
     110                } 
     111                int num = DST_EEPROM_GetMinRF(); 
    103112                char strText[256]; 
    104                 int num = DST_EEPROM_GetMinRF(); 
    105                 int rf = DST_GetFrequencyNumberbyIndex(num); 
    106                 int freq = DST_GetMHzFrequencybyIndex(num); 
     113                if (num > 0) 
     114                { 
     115                        int rf = DST_GetFrequencyNumberbyIndex(num); 
     116                        int freq = DST_GetMHzFrequencybyIndex(num); 
     117                        sprintf(strText, "< Min : %d ( %dMHz ) >", rf, freq); 
     118                } 
     119                else 
     120                { 
     121                        sprintf(strText, "< Min : OFF >"); 
     122                } 
     123                this->DrawText(this, 0, nLineHeight * 2, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
     124                // display min 
    107125                if (nPos == 0) 
    108126                { 
     127                        this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
     128                } 
     129                else 
     130                { 
    109131                        this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
    110                         sprintf(strText, "< Min : %d ( %dMHz ) >", rf, freq); 
    111                 } 
    112                 else 
    113                 { 
    114                         this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    115                         sprintf(strText, "Min : %d ( %dMHz )", rf, freq); 
    116                 } 
    117                 this->DrawText(this, 0, nLineHeight * 2, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
    118                  
     132                } 
    119133                num = DST_EEPROM_GetMaxRF(); 
    120                 rf = DST_GetFrequencyNumberbyIndex(num); 
    121                 freq = DST_GetMHzFrequencybyIndex(num); 
    122                 if (nPos == 0) 
    123                 { 
    124                         this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    125                         sprintf(strText, "Max : %d ( %dMHz )", rf, freq); 
    126                 } 
    127                 else 
    128                 { 
    129                         this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
     134                if (num > 0) 
     135                { 
     136                        int rf = DST_GetFrequencyNumberbyIndex(num); 
     137                        int freq = DST_GetMHzFrequencybyIndex(num); 
    130138                        sprintf(strText, "< Max : %d ( %dMHz ) >", rf, freq); 
    131139                } 
    132                  
     140                else 
     141                { 
     142                        sprintf(strText, "< Max : OFF >"); 
     143                } 
    133144                this->DrawText(this, 0, nLineHeight * 3, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
    134                  
     145                // descriptor 
    135146                this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
    136147                this->DrawText(this, 0, nLineHeight * 5, this->rect.w, nLineHeight, (char*)"Channel/Volume : Next", &(this->font)); 
     
    141152        void IncreaseMaxRF() 
    142153        { 
     154                if (DST_EEPROM_GetMaxRF() >= DST_MaxRF())  
     155                { 
     156                        DST_EEPROM_SetMaxRF(DST_MaxRF()); 
     157                        return; 
     158                } 
    143159                DST_EEPROM_SetMaxRF(DST_EEPROM_GetMaxRF() + 1); 
    144160        } 
    145161        void DecreaseMinRF() 
    146162        { 
     163                if (DST_EEPROM_GetMinRF() < DST_MinRF())  
     164                { 
     165                        DST_EEPROM_SetMinRF(-1); 
     166                        return; 
     167                } 
    147168                DST_EEPROM_SetMinRF(DST_EEPROM_GetMinRF() - 1); 
    148169        } 
    149170        void IncreaseMinRF() 
    150171        { 
     172                if (DST_EEPROM_GetMinRF() >= DST_MinRF())  
     173                { 
     174                        DST_EEPROM_SetMinRF(DST_MinRF()); 
     175                        return; 
     176                } 
    151177                DST_EEPROM_SetMinRF(DST_EEPROM_GetMinRF() + 1); 
    152                 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4) 
    153                 { 
    154                         IncreaseMaxRF(); 
    155                 } 
    156                 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4) 
    157                 { 
    158                         DST_EEPROM_SetMinRF(DST_EEPROM_GetMaxRF()-4); 
    159                 } 
    160178        } 
    161179        void DecreaseMaxRF() 
    162180        { 
     181                if (DST_EEPROM_GetMaxRF() < DST_MaxRF())  
     182                { 
     183                        DST_EEPROM_SetMaxRF(-1); 
     184                        return; 
     185                } 
    163186                DST_EEPROM_SetMaxRF(DST_EEPROM_GetMaxRF() - 1); 
    164                 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4) 
    165                 { 
    166                         DecreaseMinRF(); 
    167                 } 
    168                 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4) 
    169                 { 
    170                         DST_EEPROM_SetMaxRF(DST_EEPROM_GetMinRF()+4); 
    171                 } 
    172187        } 
    173188        void CFrequncySettingWin_KeyInput(CWindow *this, DS_U8 key, bool bRepeat) 
Note: See TracChangeset for help on using the changeset viewer.