void test_dessin_saisie_message_chiffre(){
	LCD_BMP((uint16_t *)Saisie_message_chiffre_GUI);
#ifdef DEBUG_ON
	display_char_pressed(3);
	allumerled();
#endif
	delay(100);
}
void dessin_saisie_message_chiffre(){
	LCD_BMP((uint16_t *)Saisie_message_chiffre_GUI);
	char string_Q[] = "Q";
	char string_U[] = "U";
	char string_I[] = "I";
	char string_T[] = "T";
	char string_TT[] = "T";
	char string_E[] = "E";
	char string_R[] = "R";
	LCD_SetFont(&Font12x12);
	LCD_DisplayStringLine(LINE(4), COLUMN(1)+4, (uint8_t *)string_Q, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(6), COLUMN(1)+4, (uint8_t *)string_U, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(8), COLUMN(1)+6, (uint8_t *)string_I, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(10), COLUMN(1)+4, (uint8_t *)string_T, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(12), COLUMN(1)+4, (uint8_t *)string_TT, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(14), COLUMN(1)+4, (uint8_t *)string_E, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(16), COLUMN(1)+4, (uint8_t *)string_R, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	delay(100);
}
Ejemplo n.º 3
0
static void _cbDialog(WM_MESSAGE * pMsg)
{
  WM_HWIN hItem;

  switch (pMsg->MsgId)
  {
  case WM_PAINT:
  {
//	  taskENTER_CRITICAL();
//	  AB0805_getDateTime24(0, &month, &day, &hours, &minutes, &seconds);
//	  weekday=AB0805_getDayOfWeek();
//	  LCD_BMP("0:dzien.bmp");
//	  taskEXIT_CRITICAL();
		  taskENTER_CRITICAL();
		  AB0805_getDateTime24(0, &month, &day, &hours, &minutes, &seconds);
		  weekday=AB0805_getDayOfWeek();
		  LCD_BMP("0:dzien.bmp");
		taskEXIT_CRITICAL();
	  break;
  }
  case WM_INIT_DIALOG:
  {
	  taskENTER_CRITICAL();
	  if(AB0805_getMinutes()==AB0805_getMinutes_Alarm() &&  AB0805_getHours24()==AB0805_getHours24_Alarm())
	  {
		  while(!GUI_PID_IsPressed() && sec2<4000)
		  {
			  LED_ON;
			  delay(500);
			  LED_OFF;
			  delay(300);
			  IWDG_ReloadCounter();
		  }
	  }
	  taskEXIT_CRITICAL();
	  jed=1;

    hItem = pMsg->hWin;
    WINDOW_SetBkColor(hItem, GUI_TRANSPARENT);

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
//    TEXT_SetFont(hItem, &GUI_FontStencil118);
    TEXT_SetFont(hItem, &GUI_FontSolidEdgeStencil118);
    TEXT_SetText(hItem, "");

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
    TEXT_SetText(hItem, "");
    TEXT_SetFont(hItem, &GUI_FontSolidEdgeStencil118);

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_2);
    TEXT_SetText(hItem, ":");
    TEXT_SetFont(hItem, &GUI_FontSolidEdgeStencil118);

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_3);
    TEXT_SetFont(hItem, GUI_FONT_24B_ASCII);
    TEXT_SetText(hItem, "");

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_5);    // seconds
    TEXT_SetFont(hItem, GUI_FONT_20_ASCII);
    TEXT_SetText(hItem, "");

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_4);
    TEXT_SetFont(hItem, GUI_FONT_24B_ASCII);
    TEXT_SetText(hItem, "");

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_7);
    TEXT_SetFont(hItem, GUI_FONT_24B_ASCII);
    TEXT_SetText(hItem, "");

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_5);
    TEXT_SetFont(hItem, GUI_FONT_24B_ASCII);
    TEXT_SetText(hItem, "");

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_6);
    TEXT_SetFont(hItem, GUI_FONT_24B_ASCII);
    TEXT_SetText(hItem, "");

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_8);
    TEXT_SetFont(hItem, GUI_FONT_24B_ASCII);
    TEXT_SetText(hItem, "");


    u8 dzien;
    char number[2];

	  taskENTER_CRITICAL();
	  AB0805_getDateTime24(0, &month, &day, &hours, &minutes, &seconds);
	  weekday=AB0805_getDayOfWeek();
	  taskEXIT_CRITICAL();

	WM_HWIN minute = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
	sprintf(number,"%0.2d",minutes);
	TEXT_SetText(minute,number);
	TEXT_SetTextColor(minute,col_gui);
//	TEXT_SetTextColor(minute,GUI_WHITE);
	WM_HWIN hour = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
	sprintf(number,"%0.2d",hours);
	TEXT_SetText(hour,number);
	TEXT_SetTextColor(hour,col_gui);
//	TEXT_SetTextColor(hour,GUI_WHITE);

	hour = WM_GetDialogItem(pMsg->hWin, ID_TEXT_5);
	TEXT_SetText(hour,seconds);
	TEXT_SetTextColor(hour,col_gui);

    break;
  }
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
Ejemplo n.º 4
0
static void _cbDummy(WM_MESSAGE * pMsg) {
  WM_HWIN hItem;
  FIL fsrc;
  RTC_DateTypeDef datea;

  switch (pMsg->MsgId)
  {
  case WM_INIT_DIALOG:

	  taskENTER_CRITICAL();
	  weekday=AB0805_getDayOfWeek();
	  taskEXIT_CRITICAL();

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
    TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    TEXT_SetFont(hItem, GUI_FONT_32B_ASCII);
    TEXT_SetText(hItem, "");
    switch(weekday)
	{
		case 1:
		{
			TEXT_SetText(hItem,"Monday");
			break;
		}
		case 2:
		{
			TEXT_SetText(hItem,"Tuesday");
			break;
		}
		case 3:
		{
			TEXT_SetText(hItem,"Wednesday");
			break;
		}
		case 4:
		{
			TEXT_SetText(hItem,"Thursday");
			break;
		}
		case 5:
		{
			TEXT_SetText(hItem,"Friday");
			break;
		}
		case 6:
		{
			TEXT_SetText(hItem,"Saturday");
			break;
		}
		case 7:
		{
			TEXT_SetText(hItem,"Sunday");
			break;
		}
	}
    //
    // Initialization of 'plan'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
    TEXT_SetFont(hItem, GUI_FONT_24B_ASCII);
//    TEXT_SetText(hItem, "");

    taskENTER_CRITICAL();

	switch(weekday)
			{
				case 1:
				{
					f_open(&fsrc,"0:plan/pon.txt",FA_OPEN_EXISTING|FA_READ);
					break;
				}
				case 2:
				{
					f_open(&fsrc,"0:plan/wt.txt",FA_OPEN_EXISTING|FA_READ);
					break;
				}
				case 3:
				{
					f_open(&fsrc,"0:plan/sr.txt",FA_OPEN_EXISTING|FA_READ);
					break;
				}
				case 4:
				{
					f_open(&fsrc,"0:plan/czw.txt",FA_OPEN_EXISTING|FA_READ);
					break;
				}
				case 5:
				{
					f_open(&fsrc,"0:plan/pt.txt",FA_OPEN_EXISTING|FA_READ);
					break;
				}
				case 6:
				{
					f_open(&fsrc,"0:plan/so.txt",FA_OPEN_EXISTING|FA_READ);
					break;
				}
				case 7:
				{
					f_open(&fsrc,"0:plan/nie.txt",FA_OPEN_EXISTING|FA_READ);
					break;
				}
			}
//	f_open(&fsrc,"0:plan/pon.txt",FA_OPEN_EXISTING|FA_READ);
//	u8 aucc[f_size(&fsrc)];
	f_read(&fsrc,auc,f_size(&fsrc),&kk);
	TEXT_SetText(hItem, auc);
	taskEXIT_CRITICAL();

    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_2);
    TEXT_SetFont(hItem, GUI_FONT_20B_ASCII);
    TEXT_SetText(hItem, "");
    //
    // Initialization of 'do'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_3);
    TEXT_SetFont(hItem, GUI_FONT_20B_ASCII);
    TEXT_SetText(hItem, "");
    //
    // Initialization of 'OD'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_4);
    TEXT_SetFont(hItem, GUI_FONT_20B_ASCII);
    //
    // Initialization of 'DO'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_5);
    TEXT_SetFont(hItem, GUI_FONT_20B_ASCII);
    // USER START (Optionally insert additional code for further widget initialization)
    // USER END
    break;
  case WM_PAINT:
  {
	  taskENTER_CRITICAL();
	  AB0805_getDateTime24(0, &month, &day, &hours, &minutes, &seconds);
	  weekday=AB0805_getDayOfWeek();
	  LCD_BMP("0:dzien.bmp");
	taskEXIT_CRITICAL();
	  break;
  }
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}