📄 uidraw.c
字号:
#include "Common.h"
#include "Global.h"
#include "ICControl.h"
#include "System.h"
#include "Timer0.h"
#include "TWICreg.h"
//#include "OSD1_Define.h"
#include "OSD1CSL.h"
//#include "OSD2_Define.h"
#include "OSD2CSL.h"
#include "E_OSDString.H"
#include "IconJigsaw.h"
#include "UIDraw.h"
#include "Keypad.h"
//#define _Myson8957_
#include "Myson8957.h"
void Show_Menu1_ColorAdj(uCHAR ItemNow)
{
//Draw OSD1
ItemNow=1;
OSD2InItClearMenu(MENU1);
OSD1ShowLine(iMenuNoOK_E,5,5,0,0,1);
OSD1Enable();
OSD1Menu1Enable();
//Draw OSD2
}
void Show_Menu1_ItemAdjNum(uCHAR ItemNow)
{
ItemNow=1;
}
void Show_Source()
{
EX0 = 0; // Disable Externel Interrup 0
switch(EepPublic.cSource)
{
case 0:
OSD1ShowLine(iCVBS_1_E,1,2,0,0,1);
break;
case 1:
OSD1ShowLine(iTV_1_E,1,2,0,0,1);
break;
}
OSD1Enable();
OSD1Menu1Enable();
Timer0Start();
EX0 = 1; // Enable Externel Interrup 0
}
#define CALSTRX 10
#define CALSTRY 1
code uCHAR *NumArry[10]={Icon0,Icon1,Icon2,Icon3,Icon4,Icon5,Icon6,Icon7,Icon8,Icon9};
void Show_CalculateNum(unsigned long Number)
{
int i,j,k;
for(j=0;j<10;j++)
OSD2Show4BPIcon(IconUP,CALSTRX+2+j,CALSTRY,0,0,0,1);
if(Number<10)
j=1;
else if(Number<100)
j=2;
else if(Number<1000)
j=3;
else if(Number<10000)
j=4;
else if(Number<100000)
j=5;
else if(Number<1000000)
j=6;
else if(Number<10000000)
j=7;
else if(Number<100000000)
j=8;
else
j=9;
for(i=0; i<j; i++)
{
k=Number%10;
Number /= 10;
OSD2Show4BPIcon(NumArry[k],CALSTRX+11-i,CALSTRY+2,0,0,0,1);
}
}
void Show_Calculate()
{
uCHAR j;
EX0 = 0; // Disable Externel Interrup 0
/*
ClosePanel(0, 0x80, 0x80);
OSD1ClearLine(5,5,0,1);
OSD1Disable();
OSD2Show4BPIcon(IconLeftUp,CALSTRX,CALSTRY,0,0,0,1);
OSD2Show4BPIcon(IconLeftUp,CALSTRX,CALSTRY+4,0,0,0,1);
for(j=0;j<10;j++)
OSD2Show4BPIcon(IconUP,CALSTRX+2+j,CALSTRY,0,0,0,1);
// OSD2Show4BPIcon(Icon0,CALSTRX+2+j-1,CALSTRY+2,0,0,0,1);
Show_CalculateNum(0);
OSD2Show4BPIcon(IconRightUP,CALSTRX+2+j,CALSTRY,0,0,0,1);
OSD2Show4BPIcon(IconBT7,CALSTRX,CALSTRY+3,0,0,1,1);
OSD2Show4BPIcon(IconBT8,CALSTRX+3,CALSTRY+3,0,0,0,1);
OSD2Show4BPIcon(IconBT9,CALSTRX+6,CALSTRY+3,0,0,0,1);
OSD2Show4BPIcon(IconBTdivd,CALSTRX+9,CALSTRY+3,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+3,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+4,0,0,0,1);
OSD2Show4BPIcon(IconBT4,CALSTRX,CALSTRY+5,0,0,0,1);
OSD2Show4BPIcon(IconBT5,CALSTRX+3,CALSTRY+5,0,0,0,1);
OSD2Show4BPIcon(IconBT6,CALSTRX+6,CALSTRY+5,0,0,0,1);
OSD2Show4BPIcon(IconBTmul,CALSTRX+9,CALSTRY+5,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+5,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+6,0,0,0,1);
OSD2Show4BPIcon(IconBT1,CALSTRX,CALSTRY+7,0,0,0,1);
OSD2Show4BPIcon(IconBT2,CALSTRX+3,CALSTRY+7,0,0,0,1);
OSD2Show4BPIcon(IconBT3,CALSTRX+6,CALSTRY+7,0,0,0,1);
OSD2Show4BPIcon(IconBTsub,CALSTRX+9,CALSTRY+7,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+7,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+8,0,0,0,1);
OSD2Show4BPIcon(IconBT0,CALSTRX,CALSTRY+9,0,0,0,1);
OSD2Show4BPIcon(IconBTdot,CALSTRX+3,CALSTRY+9,0,0,0,1);
OSD2Show4BPIcon(IconBTans,CALSTRX+6,CALSTRY+9,0,0,0,1);
OSD2Show4BPIcon(IconBTadd,CALSTRX+9,CALSTRY+9,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+9,0,0,0,1);
OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+10,0,0,0,1);
OSD2Show4BPIcon(IconLeftDown,CALSTRX,CALSTRY+11,0,0,0,1);
for(j=0;j<11;j++)
OSD2Show4BPIcon(IconDown,CALSTRX+1+j,CALSTRY+11,0,0,0,1);
OSD2Show4BPIcon(IconRightDown,CALSTRX+1+j,CALSTRY+11,0,0,0,1);
*/
OSD2Enable(); //Menu not ready yet
OSD2Menu1Enable();
/* hu test */
OSD2Show4BPIcon(BoxLeftUp,0,0,0,0,0,1);
OSD2Show4BPIcon(BoxRightUp,38,0,0,0,0,1);
OSD2Show4BPIcon(BoxLeftLow,0,12,0,0,0,1);
OSD2Show4BPIcon(BoxRightLow,38,12,0,0,0,1);
for(j=1;j<38;j++) // upper line
OSD2Show4BPIcon(BoxLine,j,0,0,0,0,1);
for(j=1;j<38;j++) // lower line
OSD2Show4BPIcon(BoxLine,j,12,0,0,0,1);
for(j=1;j<38;j++) // Middle line
OSD2Show4BPIcon(BoxLine,j,9,0,0,0,1);
for(j=1;j<12;j++)
{ // Double side line
OSD2Show4BPIcon(BoxStraight,0,j,0,0,0,1);
OSD2Show4BPIcon(BoxStraight,38,j,0,0,0,1);
}
//Exercise/Sport DATA Display Area
//Group1
OSD2Show4BPIcon(IconBT1,2,10,0,0,0,1);
OSD2Show4BPIcon(IconBT2,5,10,0,0,0,1);
OSD2Show4BPIcon(IconBT3,8,10,0,0,0,1);
//Group2
OSD2Show4BPIcon(IconBT4,11,10,0,0,0,1);
OSD2Show4BPIcon(IconBT5,14,10,0,0,0,1);
OSD2Show4BPIcon(IconBT6,17,10,0,0,0,1);
//Group3
OSD2Show4BPIcon(IconBT0,20,10,0,0,0,1);
OSD2Show4BPIcon(IconBT2,23,10,0,0,0,1);
OSD2Show4BPIcon(IconBT3,26,10,0,0,0,1);
//Group4
OSD2Show4BPIcon(IconBT7,29,10,0,0,0,1);
OSD2Show4BPIcon(IconBT8,32,10,0,0,0,1);
OSD2Show4BPIcon(IconBT9,35,10,0,0,0,1);
EX0 = 1;
}
void CalculaterDraw()
{
/* //disable tempoary
switch(m_cCurreKey)
{
case REMOTE_KEY_NUM0:
OSD2Show4BPIcon(IconBT0,CALSTRX,CALSTRY+9,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT0,CALSTRX,CALSTRY+9,0,0,0,1);
break;
case REMOTE_KEY_NUM1:
OSD2Show4BPIcon(IconBT1,CALSTRX,CALSTRY+7,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT1,CALSTRX,CALSTRY+7,0,0,0,1);
break;
case REMOTE_KEY_NUM2:
OSD2Show4BPIcon(IconBT2,CALSTRX+3,CALSTRY+7,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT2,CALSTRX+3,CALSTRY+7,0,0,0,1);
break;
case REMOTE_KEY_NUM3:
OSD2Show4BPIcon(IconBT3,CALSTRX+6,CALSTRY+7,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT3,CALSTRX+6,CALSTRY+7,0,0,0,1);
break;
case REMOTE_KEY_NUM4:
OSD2Show4BPIcon(IconBT4,CALSTRX,CALSTRY+5,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT4,CALSTRX,CALSTRY+5,0,0,0,1);
break;
case REMOTE_KEY_NUM5:
OSD2Show4BPIcon(IconBT5,CALSTRX+3,CALSTRY+5,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT5,CALSTRX+3,CALSTRY+5,0,0,0,1);
break;
case REMOTE_KEY_NUM6:
OSD2Show4BPIcon(IconBT6,CALSTRX+6,CALSTRY+5,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT6,CALSTRX+6,CALSTRY+5,0,0,0,1);
break;
case REMOTE_KEY_NUM7:
OSD2Show4BPIcon(IconBT7,CALSTRX,CALSTRY+3,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT7,CALSTRX,CALSTRY+3,0,0,0,1);
break;
case REMOTE_KEY_NUM8:
OSD2Show4BPIcon(IconBT8,CALSTRX+3,CALSTRY+3,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT8,CALSTRX+3,CALSTRY+3,0,0,0,1);
break;
case REMOTE_KEY_NUM9:
OSD2Show4BPIcon(IconBT9,CALSTRX+6,CALSTRY+3,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBT9,CALSTRX+6,CALSTRY+3,0,0,0,1);
break;
case REMOTE_KEY_CH_INC: // divid /
OSD2Show4BPIcon(IconBTdivd,CALSTRX+9,CALSTRY+3,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBTdivd,CALSTRX+9,CALSTRY+3,0,0,0,1);
break;
case REMOTE_KEY_CH_DEC: // mul *
OSD2Show4BPIcon(IconBTmul,CALSTRX+9,CALSTRY+5,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBTmul,CALSTRX+9,CALSTRY+5,0,0,0,1);
break;
case REMOTE_KEY_VO_INC: // sub -
OSD2Show4BPIcon(IconBTsub,CALSTRX+9,CALSTRY+7,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBTsub,CALSTRX+9,CALSTRY+7,0,0,0,1);
break;
case REMOTE_KEY_VO_DEC: // add +
OSD2Show4BPIcon(IconBTadd,CALSTRX+9,CALSTRY+9,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBTadd,CALSTRX+9,CALSTRY+9,0,0,0,1);
break;
case REMOTE_KEY_MUTE: // ans =
OSD2Show4BPIcon(IconBTans,CALSTRX+6,CALSTRY+9,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBTans,CALSTRX+6,CALSTRY+9,0,0,0,1);
break;
case REMOTE_KEY_RIGHT: // dot .
OSD2Show4BPIcon(IconBTdot,CALSTRX+3,CALSTRY+9,0,0,4,1);
twdDelay(1500);
OSD2Show4BPIcon(IconBTdot,CALSTRX+3,CALSTRY+9,0,0,0,1);
break;
case REMOTE_KEY_RETURN:
OSD2Disable();
break;
}
m_cCurreKey=0;
*/
}
void font_draw_string(char *string, unsigned char x, unsigned char y)
{
/* write string */
OSD1ShowLine(string,x,y,0,0,1); /* no blink, no scale, menu 1 */
/* enable menu */
OSD1Enable();
OSD1Menu1Enable();
}
void font_put_u4(unsigned char c, unsigned char x, unsigned char y)
{
unsigned char string[2];
c &= 0x0f;
if (c>=10){
string[0] = 'a' + c -10;
}else
string[0] = '0' + c;
string[1] = 0xfe; /* end of line */
OSD1ShowLine(string,x,y,0,0,1); /* no blink, no scale, menu 1 */
}
void font_draw_hex_number(unsigned char number, unsigned char x, unsigned char y)
{
/* write string */
font_put_u4(number>>4, x, y);
font_put_u4(number, x+1, y);
/* enable menu */
OSD1Enable();
OSD1Menu1Enable();
}
void font_draw_dec_number(unsigned char number, unsigned char x, unsigned char y)
{
unsigned char string[4];
/* write string */
string[0] = number/100+'0';
number %= 100;
string[1] = number/10+'0';
string[2] = number%10+'0';
string[3] = 0xfe; /* end of line */
OSD1ShowLine(string,x,y,0,0,1); /* no blink, no scale, menu 1 */
/* enable menu */
OSD1Enable();
OSD1Menu1Enable();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -