Exemple #1
0
void UserGUI_Admin_Show(void)
{
	GUI_SetDisplay(LCD_BOTH);
	GUI_Clear(GUI_COLOR_BACKGROUND);
	GUI_DisplayRAW(368, 10, theblast);
	GUI_Text(20, 35, "Bordfodbold", Arial34R, GUI_COLOR_TEXT, GUI_COLOR_BACKGROUND);

	GUI_Text(20, 110, "Admin Menu", Arial34R, GUI_COLOR_TEXT, GUI_COLOR_BACKGROUND);

	GUI_Rectangle(21, 161, 459, 216, GUI_COLOR_BUTTON, 1);
	GUI_Rectangle(21, 161, 459, 216, GUI_COLOR_BORDER, 0);
	GUI_Rectangle(20, 160, 460, 215, GUI_COLOR_BORDER, 0);
	GUI_Text_Center(21, 165, 459, 215, "Tving Standard-mode", Arial28R, GUI_COLOR_TEXT, GUI_COLOR_BUTTON);

	GUI_Rectangle(21, 241, 459, 296, GUI_COLOR_BUTTON, 1);
	GUI_Rectangle(21, 241, 459, 296, GUI_COLOR_BORDER, 0);
	GUI_Rectangle(20, 240, 460, 295, GUI_COLOR_BORDER, 0);
	GUI_Text_Center(21, 245, 459, 245, "Frigiv bold", Arial28R, GUI_COLOR_TEXT, GUI_COLOR_BUTTON);

	GUI_Rectangle(21, 320, 459, 376, GUI_COLOR_BUTTON, 1);
	GUI_Rectangle(21, 321, 459, 376, GUI_COLOR_BORDER, 0);
	GUI_Rectangle(20, 320, 460, 375, GUI_COLOR_BORDER, 0);
	GUI_Text_Center(21, 325, 459, 325, "Reboot", Arial28R, GUI_COLOR_TEXT, GUI_COLOR_BUTTON);

	GUI_DisplayRAW(40, 520, tkj_logo); // Display TKJ Electronics logo

	GUI_Rectangle(21, 711, 459, 766, GUI_COLOR_BUTTON, 1);
	GUI_Rectangle(21, 711, 459, 766, GUI_COLOR_BORDER, 0);
	GUI_Rectangle(20, 710, 460, 765, GUI_COLOR_BORDER, 0);
	GUI_Text_Center(21, 715, 459, 715, "Tilbage", Arial28R, GUI_COLOR_TEXT, GUI_COLOR_BUTTON);
}
void TIM5_IRQHandler(void) {
  tim_roll.PWM_Input_Handler();
#ifdef _DEBUG_WITH_LCD
  uint8_t tmp2[80];
  float_to_string(tim_roll.DutyCycle,tmp2);
  uint8_t tmp1[80] = "roll:";
  GUI_Text(0,6*LCD_LINE_SPACE,tmp1,White,Blue);
  GUI_Text(0,7*LCD_LINE_SPACE,tmp2,White,Blue);
#endif
}  
void TIM3_IRQHandler(void) {
  tim_pitch.PWM_Input_Handler();
#ifdef _DEBUG_WITH_LCD
  uint8_t tmp2[80];
  float_to_string(tim_pitch.DutyCycle,tmp2);
  uint8_t tmp1[80] = "pitch:";
  GUI_Text(0,2*LCD_LINE_SPACE,tmp1,White,Blue);
  GUI_Text(0,3*LCD_LINE_SPACE,tmp2,White,Blue);
#endif
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Sheet_SelChange(TObject *Sender)
{
    //Delete button
    if (GUI_Text(Sheet_Sel->Text)==Prefs->DefaultNames[Sheet])
        Sheet_Delete->Enabled=false;
    else
        Sheet_Delete->Enabled=true;

    //Save choice
    Prefs->Config(_T("Sheet"))=GUI_Text(Sheet_Sel->Text);
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Custom_SelChange(TObject *Sender)
{
    //Delete button
    if (GUI_Text(Custom_Sel->Text)==Prefs->DefaultNames[Custom])
        Custom_Delete->Enabled=false;
    else
        Custom_Delete->Enabled=true;

    //Save choice
    Prefs->Config(_T("Custom"))=GUI_Text(Custom_Sel->Text);
}
// 接收机PWM占空比通过4个20mS中断读取
void TIM2_IRQHandler(void) {
  tim_throttle.PWM_Input_Handler();
#ifdef _DEBUG_WITH_LCD
  uint8_t tmp2[80];
  uint8_t tmp3[80];
  float_to_string(tim_throttle.DutyCycle,tmp2);
  float_to_string(receiver.stick_throttle_.convert_duty_,tmp3);
  uint8_t tmp1[80] = "throttle:";
  GUI_Text(0,0,tmp1,White,Blue);
  GUI_Text(0,LCD_LINE_SPACE,tmp2,White,Blue);
  GUI_Text(0,2*LCD_LINE_SPACE,tmp3  ,White,Blue);
#endif
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Language_SelChange(TObject *Sender)
{
    //Delete button
    if (GUI_Text(Language_Sel->Text)==Prefs->DefaultNames[Language])
        Language_Delete->Enabled=false;
    else
        Language_Delete->Enabled=true;
}
Exemple #8
0
int main(void)
{
   /* USART1 config */
	USART1_Config();

	SysTick_Init();
	LCD_Init();										/* LCD ��ʼ��*/		
  sd_fs_init();
  Sd_fs_test();
	
// 	/*��ʾͼ��*/
//     Lcd_show_bmp(0, 0,"/pic3.bmp");   
//     Lcd_show_bmp( 40,200,"/pic2.bmp");
//     Lcd_show_bmp( 100,100,"/pic1.bmp");	
//  
//     /*������ʾ*/
//     LCD_Str_O(20, 10, "lCD_DEMO",0); 	  
//     LCD_Str_CH(20,30,"��Ī��̳Ұ��ר��",0,0xffff);	  
//     LCD_Str_CH_O(20,50,"��Ī��̳Ұ��ר��",0);
//     LCD_Num_6x12_O(20, 70, 65535, BLACK);
//     LCD_Str_6x12_O(20, 90,"LOVE STM32", BLACK);	   

//     /*������ʾ*/     
//     LCD_Str_O_P(300, 10, "Runing", 0);	
//     LCD_Str_CH_P(280,10,"��Ī��̳Ұ��ר����ӭ��",0xff,0xffff);		   
//     LCD_Str_CH_O_P(260,10,"��Ī��̳Ұ��ר��",0);
//     LCD_Str_6x12_O_P(240, 10,"LOVE STM32", 0);    
//     LCD_Str_ENCH_O_P(220,10,"��ӭʹ��Ұ��stm32������",0);
//     
// 	/*��ͼ*/
//     LCD_Str_CH(20,150,"���ڽ�ͼ",0,0xffff);
//  	Screen_shot(0, 0, 240,320 , "/myScreen");
//     LCD_Str_CH(20,150,"��ͼ���",0,0xffff);
//     
//  
//  LCD_test();

//	lcd_PutChar(50,30,'A',BLACK,WHITE);


GUI_Text(20,30,"AAAAAAAAAAAAA",sizeof("AAAAAAAAAAAAA"),0,0xffff);
LCD_Char_CH(200,100,"��",0,0xffff);
LCD_Str_CH(100,200,"�Ǻǣ���ͤǿ����ţ��",0,BLUE);	 

LCD_Str_O(50,60,str2,BLACK,BLUE);

  while (1)
  {
//  LCD_test();
	}
	
}
void __fastcall TPreferences_SheetF::OKClick(TObject *Sender)
{
    //Set count
    EditedSheet(__T("ColumnsCount"))=Ztring::ToZtring(Columns_Count);

    //Set lines
    for (int Pos=0; Pos<Columns_Count; Pos++)
    {
        Ztring Z1=__T("Column");
        Z1+=Ztring::ToZtring(Pos);
        EditedSheet(Z1, 1)=GUI_Text(Column_Kind[Pos]->Text);
        EditedSheet(Z1, 2)=GUI_Text(Column_Pos[Pos]->Text);
        EditedSheet(Z1, 3)=GUI_Text(Column_Parameter[Pos]->Text);
        EditedSheet(Z1, 4)=GUI_Text(Column_Size[Pos]->Text);
    }

    //Delete extra lines no more needed
    for (int Pos=SHEETF_COLUMNS-1; Pos>=Columns_Count; Pos--)
    {
        Ztring Z1=__T("Column");
        Z1+=Ztring::ToZtring(Pos);
        int I1=EditedSheet.Find(Z1);
        if (I1!=-1)
            EditedSheet.erase(&EditedSheet(I1));
    }

    //TODO: Purge blank lines, but why is there blank lines?
    while (EditedSheet.Find(__T(""))!=-1)
    {
        int I1=EditedSheet.Find(__T(""));
        EditedSheet.erase(&EditedSheet(I1));
    }

    //Save file
    EditedSheet.Save();
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::General_Language_SelChange(TObject *Sender)
{
    //Config
    size_t Language_Pos=Prefs->FilesList[Language_List].Find(GUI_Text(General_Language_Sel->Text)); //Special case : Languages, should show the name of language in the local version
    if (Language_Pos==(size_t)-1)
        return;
    Prefs->Config(Prefs->FolderNames(Language))=Prefs->FilesList[Language](Language_Pos); //ComboBox_SelChange(General_Language_Sel, Language);
    Prefs->Load(Language, Prefs->FilesList[Language](Language_Pos)); //ComboBox_SelChange(General_Language_Sel, Language);

    Language_Sel->ItemIndex=General_Language_Sel->ItemIndex;

    //Translation of Preferences
    GUI_Configure();

    //Translation of Main GUI
    MainF->Translate();
}
Exemple #11
0
/*******************************************************************************
* Function Name  : TouchPanel_Calibrate
* Description    : 
* Input          : None
* Output         : None
* Return         : None
* Attention		 : None
*******************************************************************************/
void TouchPanel_Calibrate(void)
{
  uint8_t i;
  Coordinate * Ptr;

  for(i=0;i<3;i++)
  {
   LCD_Clear(Black);
   GUI_Text(44,10,"Touch crosshair to calibrate",0xffff,Black);
   delay_ms(300);
   DrawCross(DisplaySample[i].x,DisplaySample[i].y);
   do
   {
     Ptr=Read_Ads7846();
   }
   while( Ptr == (void*)0 );
   ScreenSample[i].x= Ptr->x; ScreenSample[i].y= Ptr->y;
  }
  setCalibrationMatrix( &DisplaySample[0],&ScreenSample[0],&matrix );
  LCD_Clear(Black);
} 
Exemple #12
0
/*******************************************************************************
* Function Name  : TouchPanel_Calibrate
* Description    : 校准触摸屏
* Input          : None
* Output         : None
* Return         : None
* Attention		 : None
*******************************************************************************/
void TouchPanel_Calibrate(void)
{
  uint8_t i;
  Coordinate * Ptr;

  for(i=0;i<3;i++)
  {
   LCD_Clear(White);
   GUI_Text(10,10,"Touch crosshair to calibrate",Black,White);   
   DelayUS(1000 * 500);
   DrawCross(DisplaySample[i].x,DisplaySample[i].y);
   do
   {
   Ptr = Read_Ads7846();
   }
   while( Ptr == (void*)0 );
   ScreenSample[i].x = Ptr->x; ScreenSample[i].y = Ptr->y;
  }
  setCalibrationMatrix( &DisplaySample[0],&ScreenSample[0],&matrix ) ;  /* 送入值得到参数 */	   
  LCD_Clear(White);
} 
Exemple #13
0
/*******************************************************************************
* Function Name  : TouchPanel_Calibrate
* Description    : У׼´¥ÃþÆÁ
* Input          : None
* Output         : None
* Return         : None
* Attention		 : None
*******************************************************************************/
void TouchPanel_Calibrate(void)
{
  uint8_t i;
  Coordinate * Ptr;
  for(i=0;i<3;i++)
  {
   LCD_Clear(BLACK);
   //LCD_SetTextColor(BLUE);
   //LCD_SetBackColor(BLACK);
   //LCD_StringLine(10,10,"Touch crosshair to calibrate");
   GUI_Text(10, 10, "Touch crosshair to calibrate",BLUE,BLACK);
   Delay(0xFFFFFF);
   DrawCross(DisplaySample[i].x,DisplaySample[i].y);
   do
   {
   Ptr=Read_Ads7846();
   }
   while( Ptr == (void*)0 );
   ScreenSample[i].x= Ptr->x; ScreenSample[i].y= Ptr->y;
  }
  setCalibrationMatrix( &DisplaySample[0],&ScreenSample[0],&matrix ) ;  /* ËÍÈëÖµµÃµ½²ÎÊý */	
  LCD_Clear(BLACK);
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Sheet_DeleteClick(TObject *Sender)
{
    Prefs->Remove(Sheet, GUI_Text(Sheet_Sel->Text));
    ComboBox_Update(Sheet_Sel, Sheet);
}
void __fastcall TPreferences_SheetF::ColumnsCountChange(TObject *Sender)
{
    EditedSheet(__T("ColumnsCount"))=GUI_Text(ColumnsCount->Text);
    Columns_Adapt();
}
//---------------------------------------------------------------------------
void __fastcall TPreferences_LanguageF::GrilleKeyUp(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
    EditedLanguage(GUI_Text(Grille->Cells[0][Grille->Row]))=GUI_Text(Grille->Cells[2][Grille->Row]);
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::ComboBox_SelChange(TTntComboBox *CB, List_t List)
{
    Prefs->Config(Prefs->FolderNames(List))=GUI_Text(CB->Text);
    Prefs->Load(List, GUI_Text(CB->Text));
}
Exemple #18
0
int main(void)
{
   /* USART1 config */
	USART1_Config();
// 	Key3_GPIO_Config();
	SysTick_Init();
	
	key_led_init();	
	LCD_Init();										/* LCD 初始化*/		
  sd_fs_init();
  Sd_fs_test();
	
// 	/*显示图像*/
//     Lcd_show_bmp(0, 0,"/pic3.bmp");   
//     Lcd_show_bmp( 40,200,"/pic2.bmp");
//     Lcd_show_bmp( 100,100,"/pic1.bmp");	
//  
//     /*横屏显示*/
//     LCD_Str_O(20, 10, "lCD_DEMO",0); 	  
//     LCD_Str_CH(20,30,"阿莫论坛野火专区",0,0xffff);	  
//     LCD_Str_CH_O(20,50,"阿莫论坛野火专区",0);
//     LCD_Num_6x12_O(20, 70, 65535, BLACK);
//     LCD_Str_6x12_O(20, 90,"LOVE STM32", BLACK);	   

//     /*竖屏显示*/     
//     LCD_Str_O_P(300, 10, "Runing", 0);	
//     LCD_Str_CH_P(280,10,"阿莫论坛野火专区欢迎你",0xff,0xffff);		   
//     LCD_Str_CH_O_P(260,10,"阿莫论坛野火专区",0);
//     LCD_Str_6x12_O_P(240, 10,"LOVE STM32", 0);    
//     LCD_Str_ENCH_O_P(220,10,"欢迎使用野火stm32开发板",0);
//     
// 	/*截图*/
//     LCD_Str_CH(20,150,"正在截图",0,0xffff);
//  	Screen_shot(0, 0, 240,320 , "/myScreen");
//     LCD_Str_CH(20,150,"截图完成",0,0xffff);
//     
//  
//  LCD_test();

//	lcd_PutChar(50,30,'A',BLACK,WHITE);


GUI_Text(20,30,"AAAAAAAAAAAAA ",sizeof("AAAAAAAAAAAAA "),0,0xffff);
LCD_Char_CH(200,100,"好",0,0xffff);
LCD_Str_CH(100,200,"呵呵,褚亭强你真牛逼",0,SILVER);	 

Screen_shot(0, 0, 400,240 , "/myScreen");

LCD_Str_O(50,60,str2,BLACK,TEAL);


Lcd_show_bmp(0,0,"/pic3.bmp",1);  	                     // 显示MicroSD卡里面的MYPIC1.bmp文件,图片分辨率1024*768

//LCD_WriteRAM_Prepare();

LCD_Str_O(50,80,str3,BLACK,SILVER);

//  ltk_list_file();
Lcd_show_bmp(0,0,"/1.bmp",1);  	                     // 显示MicroSD卡里面的MYPIC1.bmp文件,图片分辨率1024*768
Lcd_show_bmp(0,0,"/2.bmp",1);  	                     // 显示MicroSD卡里面的MYPIC1.bmp文件,图片分辨率1024*768
  while (1)
  {

 
			pic_display();

	}
	
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Custom_DeleteClick(TObject *Sender)
{
    Prefs->Remove(Custom, GUI_Text(Custom_Sel->Text));
    ComboBox_Update(Custom_Sel, Custom);
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Language_DeleteClick(TObject *Sender)
{
    Prefs->Remove(Language, GUI_Text(Language_Sel->Text));
    ComboBox_Update(General_Language_Sel, Language);
    ComboBox_Update(Language_Sel, Language);
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Language_EditClick(TObject *Sender)
{
    TPreferences_LanguageF *L=new TPreferences_LanguageF(NULL);
    L->Run(GUI_Text(Language_Sel->Text));
    delete L;
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Custom_EditClick(TObject *Sender)
{
    TPreferences_CustomF *C=new TPreferences_CustomF(NULL);
    C->Run(GUI_Text(Custom_Sel->Text));
    delete C;
}
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Sheet_EditClick(TObject *Sender)
{
    TPreferences_SheetF *C=new TPreferences_SheetF(NULL);
    C->Run(GUI_Text(Sheet_Sel->Text));
    delete C;
}