2019-01-09:

修正LCD面板控件像素网格状态设定不正确的问题。
更新模拟器逻辑结构和模拟器操作接口。
增加模拟程序主入口,模仿Main主入口函数。
修改了一些全局变量的使用方法。
订正了一些注释的描述错误。
模拟环境正式更名为SimpleGUI Virtual SDK。
This commit is contained in:
Polarix 2019-01-09 20:33:11 +08:00
parent a3c5d90348
commit eb25574628
55 changed files with 2094 additions and 1270 deletions

View File

@ -8,7 +8,7 @@
#include "HMI_Engine.h"
#ifdef _SIMPLE_GUI_VIRTUAL_ENVIRONMENT_SIMULATOR_
#include "DemoResource_UTF8.h"
#include "VirtualDeviceInterface.h"
#include "SDKInterface.h"
#else
#include "DemoResource_GB2312.h"
#endif

View File

@ -2,7 +2,6 @@
/** Copyright. **/
/** FileName: DemoProc.c **/
/** Author: Polarix **/
/** Version: 1.0.0.0 **/
/** Description: User operation interface. **/
/*************************************************************************/
//=======================================================================//
@ -11,7 +10,7 @@
#include "DemoProc.h"
#ifdef _SIMPLE_GUI_VIRTUAL_ENVIRONMENT_SIMULATOR_
#include "VirtualDeviceInterface.h"
#include "SDKInterface.h"
#else
#include "OLED.h"
#include "DemoActions.h"
@ -51,10 +50,10 @@ void InitializeEngine(void)
SGUI_Common_MemorySet(&g_stDemoEngine, 0x00, sizeof(HMI_ENGINE_OBJECT));
#ifdef _SIMPLE_GUI_VIRTUAL_ENVIRONMENT_SIMULATOR_
/* Initialize interface object. */
g_stDeviceInterface.stActions.fnSetPixel = VDIF_SetPixel;
g_stDeviceInterface.stActions.fnGetPixel = VDIF_GetPixel;
g_stDeviceInterface.stActions.fnClearScreen = VDIF_ClearDisplay;
g_stDeviceInterface.stActions.fnRefreshScreen = VDIF_RefreshDisplay;
g_stDeviceInterface.stActions.fnSetPixel = SGUI_SDK_SetPixel;
g_stDeviceInterface.stActions.fnGetPixel = SGUI_SDK_GetPixel;
g_stDeviceInterface.stActions.fnClearScreen = SGUI_SDK_ClearDisplay;
g_stDeviceInterface.stActions.fnRefreshScreen = SGUI_SDK_RefreshDisplay;
#else
g_stDeviceInterface.stActions.fnSetPixel = OLED_SetPixel;
g_stDeviceInterface.stActions.fnGetPixel = OLED_GetPixel;

View File

@ -131,8 +131,10 @@ HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVENT_TYP
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
HMI_ENGINE_RESULT eProcessResult;
SGUI_UINT16* parrKeyValue;
HMI_ENGINE_RESULT eProcessResult;
SGUI_UINT16 uiKeyCode;
SGUI_UINT16 uiKeyValue;
SGUI_UINT16 uiOptionCode;
/*----------------------------------*/
/* Initialize */
@ -144,87 +146,86 @@ HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVENT_TYP
/*----------------------------------*/
if(eEvent == HMI_ENGINE_EVENT_ACTION)
{
if(NULL != pstEvent)
{
parrKeyValue = (SGUI_UINT16*)pstEvent->Data;
if(NULL != parrKeyValue)
if(HMI_ENGINE_ACTION_KEY_PRESS == pstEvent->Action)
{
uiKeyCode = *((SGUI_UINT16*)pstEvent->Data);
uiKeyValue = KEY_CODE_VALUE(uiKeyCode);
uiOptionCode = KEY_CODE_OPT(uiKeyCode);
switch(uiKeyValue)
{
switch(*(parrKeyValue+1))
case KEY_VALUE_ENTER:
{
case KEY_VALUE_ENTER:
eProcessResult = HMI_RET_CONFIRM;
break;
}
case KEY_VALUE_ESC:
{
eProcessResult = HMI_RET_CANCEL;
break;
}
case KEY_VALUE_UP:
{
SGUI_List_SelectUpItem(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_DOWN:
{
SGUI_List_SelectDownItem(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_RIGHT:
{
if((uiOptionCode & KEY_OPTION_SHIFT) != 0)
{
eProcessResult = HMI_RET_CONFIRM;
break;
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value-1);
}
case KEY_VALUE_ESC:
else
{
eProcessResult = HMI_RET_CANCEL;
break;
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value+1, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value);
}
case KEY_VALUE_UP:
break;
}
case KEY_VALUE_LEFT:
{
if((uiOptionCode & KEY_OPTION_SHIFT) != 0)
{
SGUI_List_SelectUpItem(pstIFObj, &s_stDemoListObject);
break;
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value+1);
}
case KEY_VALUE_DOWN:
else
{
SGUI_List_SelectDownItem(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_RIGHT:
{
if((*(parrKeyValue+0) & KEY_OPTION_SHIFT) != 0)
{
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value-1);
}
else
{
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value+1, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value);
}
break;
}
case KEY_VALUE_LEFT:
{
if((*(parrKeyValue+0) & KEY_OPTION_SHIFT) != 0)
{
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value+1);
}
else
{
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value-1, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value);
}
break;
SGUI_List_SetListItemValue(pstIFObj, &s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Valid.Value-1, SGUI_List_GetListItemPtr(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex)->Decimal.Value);
}
break;
}
#ifdef _SIMPLE_GUI_ENABLE_DYNAMIC_MEMORY_
case KEY_VALUE_F8:
{
SGUI_List_RemoveItem(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_F9: // Insert to head.
{
SGUI_List_InsertItem(&s_stDemoListObject, &s_arrstAppendListItems[0], 0);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_F10: // Insert to intermediate.
{
SGUI_List_InsertItem(&s_stDemoListObject, &s_arrstAppendListItems[1], 5);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_F11: // Insert to end.
{
SGUI_List_InsertItem(&s_stDemoListObject, &s_arrstAppendListItems[2], s_stDemoListObject.Data.Count);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_F8:
{
SGUI_List_RemoveItem(&s_stDemoListObject, s_stDemoListObject.ControlVariable.SelectIndex);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_F9: // Insert to head.
{
SGUI_List_InsertItem(&s_stDemoListObject, &s_arrstAppendListItems[0], 0);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_F10: // Insert to intermediate.
{
SGUI_List_InsertItem(&s_stDemoListObject, &s_arrstAppendListItems[1], 5);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
case KEY_VALUE_F11: // Insert to end.
{
SGUI_List_InsertItem(&s_stDemoListObject, &s_arrstAppendListItems[2], s_stDemoListObject.Data.Count);
SGUI_List_Refresh(pstIFObj, &s_stDemoListObject);
break;
}
#endif
default:
{
break;
}
default:
{
break;
}
}
}

View File

@ -83,8 +83,8 @@ HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVEN
/* Variable Declaration */
/*----------------------------------*/
HMI_ENGINE_RESULT eProcessResult;
SGUI_UINT16* parrKeyValue;
SGUI_TIME* pstRTCTime;
SGUI_TIME stRTCTime;
SGUI_UINT16 uiKeyValue;
/*----------------------------------*/
/* Initialize */
@ -96,12 +96,12 @@ HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVEN
/*----------------------------------*/
if(NULL != pstEvent)
{
if(eEventType == HMI_ENGINE_EVENT_ACTION)
if(HMI_ENGINE_EVENT_ACTION == eEventType)
{
parrKeyValue = (SGUI_UINT16*)pstEvent->Data;
if(NULL != parrKeyValue)
if(HMI_ENGINE_ACTION_KEY_PRESS == pstEvent->Action)
{
switch(*(parrKeyValue+1))
uiKeyValue = KEY_CODE_VALUE(*((SGUI_UINT16*)pstEvent->Data));
switch(uiKeyValue)
{
case KEY_VALUE_ENTER:
case KEY_VALUE_ESC:
@ -111,20 +111,16 @@ HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVEN
}
}
}
}
else if(eEventType == HMI_ENGINE_EVENT_DATA)
{
if(HMI_ENGINE_ACTION_ON_TIMER_RTC == pstEvent->Action)
{
pstRTCTime = (SGUI_TIME*)pstEvent->Data;
if(NULL != pstRTCTime)
{
sprintf(s_szRTCNoticeText, DEMO_RTC_NOTICE_TEXT_FMT,
pstRTCTime->Year, pstRTCTime->Month, pstRTCTime->Day,
pstRTCTime->Hour, pstRTCTime->Minute, pstRTCTime->Second);
SGUI_Notice_Refresh(pstIFObj, s_szRTCNoticeText, 0, SGUI_ICON_INFORMATION);
eProcessResult = HMI_RET_NOACTION;
}
SGUI_Common_GetNowTime(&stRTCTime);
sprintf(s_szRTCNoticeText, DEMO_RTC_NOTICE_TEXT_FMT,
stRTCTime.Year, stRTCTime.Month, stRTCTime.Day,
stRTCTime.Hour, stRTCTime.Minute, stRTCTime.Second);
SGUI_Notice_Refresh(pstIFObj, s_szRTCNoticeText, 0, SGUI_ICON_INFORMATION);
eProcessResult = HMI_RET_NOACTION;
}
}
}

View File

@ -69,7 +69,8 @@ HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVEN
/*----------------------------------*/
HMI_ENGINE_RESULT eProcessResult;
SGUI_INT iNewValue;
SGUI_UINT16* parrKeyValue;
SGUI_UINT16 uiKeyCode;
SGUI_UINT16 uiKeyValue;
/*----------------------------------*/
/* Initialize */
@ -81,35 +82,34 @@ HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVEN
/*----------------------------------*/
if(HMI_ENGINE_EVENT_ACTION == eEventType)
{
if(NULL != pstEvent)
switch(pstEvent->Action)
{
switch(pstEvent->Action)
case HMI_ENGINE_ACTION_KEY_PRESS:
{
case HMI_ENGINE_ACTION_KEY_PRESS:
uiKeyCode = *((SGUI_UINT16*)pstEvent->Data);
uiKeyValue = KEY_CODE_VALUE(uiKeyCode);
if(KEY_VALUE_ESC == uiKeyValue)
{
parrKeyValue = (SGUI_UINT16*)pstEvent->Data;
if(KEY_VALUE_ESC == *(parrKeyValue+1))
{
eProcessResult = HMI_RET_CANCEL;
}
else
{
eProcessResult = HMI_RET_NOACTION;
}
break;
eProcessResult = HMI_RET_CANCEL;
}
case HMI_ENGINE_ACTION_ON_TIMER:
else
{
iNewValue = *((SGUI_INT*)pstEvent->Data);
SGUI_RealtimeGraph_AppendValue(&s_stRealtimeGraph, iNewValue);
HMI_DemoRealGraph_RefreshScreen(pstIFObj, NULL);
break;
eProcessResult = HMI_RET_NOACTION;
}
default:
{
eProcessResult = HMI_RET_NOACTION;
break;
}
break;
}
case HMI_ENGINE_ACTION_ON_TIMER:
{
iNewValue = *((SGUI_INT*)pstEvent->Data);
SGUI_RealtimeGraph_AppendValue(&s_stRealtimeGraph, iNewValue);
HMI_DemoRealGraph_RefreshScreen(pstIFObj, NULL);
break;
}
default:
{
eProcessResult = HMI_RET_NOACTION;
break;
}
}
}

View File

@ -132,8 +132,9 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
HMI_ENGINE_RESULT eProcessResult;
SGUI_UINT16* parrKeyValue;
HMI_ENGINE_RESULT eProcessResult;
SGUI_UINT16 uiKeyCode;
SGUI_UINT16 uiKeyValue;
/*----------------------------------*/
/* Initialize */
@ -145,43 +146,42 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_
/*----------------------------------*/
if(HMI_ENGINE_EVENT_ACTION == eEventType)
{
if(NULL != pstEvent)
switch(pstEvent->Action)
{
switch(pstEvent->Action)
case HMI_ENGINE_ACTION_KEY_PRESS:
{
case HMI_ENGINE_ACTION_KEY_PRESS:
uiKeyCode = *((SGUI_UINT16*)pstEvent->Data);
uiKeyValue = KEY_CODE_VALUE(uiKeyCode);
if(KEY_VALUE_SPACE == uiKeyValue)
{
parrKeyValue = (SGUI_UINT16*)pstEvent->Data;
if(KEY_VALUE_SPACE == *(parrKeyValue+1))
{
eProcessResult = HMI_RET_FOLLOWUP;
}
else
{
eProcessResult = HMI_RET_NOACTION;
}
break;
eProcessResult = HMI_RET_FOLLOWUP;
}
case HMI_ENGINE_ACTION_ON_TIMER:
{
//SGUI_Frame_DrawFullScreenFrame(&s_stTextFrame);
SGUI_Text_DrawMultipleLinesText(pstIFObj, s_szDemoText, SGUI_FONT_SIZE_H12, &s_stTextDisplayArea, s_iTextOffset, SGUI_DRAW_NORMAL);
if(s_iTextOffset + s_iTextHeight == 0)
{
s_iTextOffset = HMI_TEXT_DEMO_FRAME_TEXT_HEIGHT;
}
else
{
s_iTextOffset--;
}
eProcessResult = HMI_RET_NOACTION;
break;
else
{
eProcessResult = HMI_RET_NOACTION;
}
default:
{
eProcessResult = HMI_RET_NOACTION;
break;
}
break;
}
case HMI_ENGINE_ACTION_ON_TIMER:
{
//SGUI_Frame_DrawFullScreenFrame(pstIFObj, &s_stTextFrame);
SGUI_Text_DrawMultipleLinesText(pstIFObj, s_szDemoText, SGUI_FONT_SIZE_H12, &s_stTextDisplayArea, s_iTextOffset, SGUI_DRAW_NORMAL);
if(s_iTextOffset + s_iTextHeight == 0)
{
s_iTextOffset = HMI_TEXT_DEMO_FRAME_TEXT_HEIGHT;
}
else
{
s_iTextOffset--;
}
eProcessResult = HMI_RET_NOACTION;
break;
}
default:
{
eProcessResult = HMI_RET_NOACTION;
break;
}
}
}

View File

@ -84,7 +84,8 @@ HMI_ENGINE_RESULT HMI_DemoTextNotice_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVE
/* Variable Declaration */
/*----------------------------------*/
HMI_ENGINE_RESULT eProcessResult;
SGUI_UINT16* parrKeyValue;
SGUI_UINT16 uiKeyCode;
SGUI_UINT16 uiKeyValue;
/*----------------------------------*/
/* Initialize */
@ -96,19 +97,17 @@ HMI_ENGINE_RESULT HMI_DemoTextNotice_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EVE
/*----------------------------------*/
if(eEventType == HMI_ENGINE_EVENT_ACTION)
{
if(NULL != pstEvent)
if(HMI_ENGINE_ACTION_KEY_PRESS == pstEvent->Action)
{
parrKeyValue = (SGUI_UINT16*)pstEvent->Data;
if(NULL != parrKeyValue)
uiKeyCode = *((SGUI_UINT16*)pstEvent->Data);
uiKeyValue = KEY_CODE_VALUE(uiKeyCode);
switch(uiKeyValue)
{
switch(*(parrKeyValue+1))
case KEY_VALUE_ENTER:
case KEY_VALUE_ESC:
{
case KEY_VALUE_ENTER:
case KEY_VALUE_ESC:
{
eProcessResult = HMI_RET_CANCEL;
break;
}
eProcessResult = HMI_RET_CANCEL;
break;
}
}
}

View File

@ -117,7 +117,8 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EV
/* Variable Declaration */
/*----------------------------------*/
HMI_ENGINE_RESULT eProcessResult;
SGUI_UINT16* parrKeyValue;
SGUI_UINT16 uiKeyCode;
SGUI_UINT16 uiKeyValue;
/*----------------------------------*/
/* Initialize */
@ -129,33 +130,25 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EV
/*----------------------------------*/
if(s_uiAutoConfirmTimer > 0)
{
if(NULL != pstEvent)
{
if(eEventType == HMI_ENGINE_EVENT_ACTION)
{
if(eEventType == HMI_ENGINE_EVENT_ACTION)
{
if(HMI_ENGINE_ACTION_KEY_PRESS == pstEvent->Action)
{
uiKeyCode = *((SGUI_UINT16*)pstEvent->Data);
uiKeyValue = KEY_CODE_VALUE(uiKeyCode);
if(HMI_ENGINE_ACTION_KEY_PRESS == pstEvent->Action)
{
parrKeyValue = (SGUI_UINT16*)pstEvent->Data;
if(NULL != parrKeyValue)
{
if(KEY_VALUE_SPACE == *(parrKeyValue+1))
{
// Stop count down when press space.
s_uiAutoConfirmTimer = 0;
}
}
}
}
else if(eEventType == HMI_ENGINE_EVENT_DATA)
{
if(HMI_ENGINE_ACTION_ON_TIMER_RTC == pstEvent->Action)
{
//Count down five seconds
s_uiAutoConfirmTimer--;
}
}
}
if(KEY_VALUE_SPACE == uiKeyValue)
{
// Stop count down when press space.
s_uiAutoConfirmTimer = 0;
}
}
if(HMI_ENGINE_ACTION_ON_TIMER_RTC == pstEvent->Action)
{
//Count down five seconds
s_uiAutoConfirmTimer--;
}
}
// Redraw screen if time out.
if(0 == s_uiAutoConfirmTimer)
@ -169,108 +162,107 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_IF_OBJ* pstIFObj, HMI_EV
{
if(HMI_ENGINE_ACTION_KEY_PRESS == pstEvent->Action)
{
parrKeyValue = (SGUI_UINT16*)pstEvent->Data;
if(NULL != parrKeyValue)
{
switch(*(parrKeyValue+1))
{
case KEY_VALUE_TAB:
{
s_uiFocusedFlag = ((s_uiFocusedFlag+1)%2);
if(0 == s_uiFocusedFlag)
{
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_NORMAL);
}
else
{
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_NORMAL);
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE);
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_ESC:
{
eProcessResult = HMI_RET_CANCEL;
break;
}
case KEY_VALUE_LEFT:
{
if(1 == s_uiFocusedFlag)
{
if(s_stTextVariableBox.FocusIndex > 0)
{
s_stTextVariableBox.FocusIndex--;
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
}
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_UP:
{
if(1 == s_uiFocusedFlag)
{
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_PREV);
}
else
{
s_stNumberVariableBox.Value++;
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_RIGHT:
{
if(1 == s_uiFocusedFlag)
{
if(s_stTextVariableBox.FocusIndex < (s_stTextVariableBox.MaxTextLength-1))
{
s_stTextVariableBox.FocusIndex++;
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
}
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_DOWN:
{
if(1 == s_uiFocusedFlag)
{
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NEXT);
}
else
{
s_stNumberVariableBox.Value--;
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_ENTER:
{
if(1 == s_uiFocusedFlag)
{
s_szFrameTitle = s_stTextVariableBox.Value;
HMI_DemoVariableBox_DrawFrame(pstIFObj, (SGUI_SZSTR)s_szFrameTitle);
// Draw number box
SGUI_Basic_DrawRectangle(pstIFObj, VARIABLE_BOX_POSX, VARIABLE_BOX_NUMBER_POSY, VARIABLE_BOX_WIDTH+4, g_stFontSize[s_stNumberVariableBox.FontSize].Height+6, SGUI_COLOR_FRGCLR, SGUI_COLOR_BKGCLR);
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_NORMAL);
// Draw text box
SGUI_Basic_DrawRectangle(pstIFObj, VARIABLE_BOX_POSX, VARIABLE_BOX_TEXT_POSY, VARIABLE_BOX_WIDTH+4, g_stFontSize[s_stTextVariableBox.FontSize].Height+6, SGUI_COLOR_FRGCLR, SGUI_COLOR_BKGCLR);
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE);
}
break;
}
default:
{
eProcessResult = HMI_RET_NOACTION;
break;
}
}
}
uiKeyCode = *((SGUI_UINT16*)pstEvent->Data);
uiKeyValue = KEY_CODE_VALUE(uiKeyCode);
switch(uiKeyValue)
{
case KEY_VALUE_TAB:
{
s_uiFocusedFlag = ((s_uiFocusedFlag+1)%2);
if(0 == s_uiFocusedFlag)
{
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_NORMAL);
}
else
{
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_NORMAL);
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE);
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_ESC:
{
eProcessResult = HMI_RET_CANCEL;
break;
}
case KEY_VALUE_LEFT:
{
if(1 == s_uiFocusedFlag)
{
if(s_stTextVariableBox.FocusIndex > 0)
{
s_stTextVariableBox.FocusIndex--;
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
}
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_UP:
{
if(1 == s_uiFocusedFlag)
{
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_PREV);
}
else
{
s_stNumberVariableBox.Value++;
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_RIGHT:
{
if(1 == s_uiFocusedFlag)
{
if(s_stTextVariableBox.FocusIndex < (s_stTextVariableBox.MaxTextLength-1))
{
s_stTextVariableBox.FocusIndex++;
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
}
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_DOWN:
{
if(1 == s_uiFocusedFlag)
{
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NEXT);
}
else
{
s_stNumberVariableBox.Value--;
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
}
eProcessResult = HMI_RET_NOACTION;
break;
}
case KEY_VALUE_ENTER:
{
if(1 == s_uiFocusedFlag)
{
s_szFrameTitle = s_stTextVariableBox.Value;
HMI_DemoVariableBox_DrawFrame(pstIFObj, (SGUI_SZSTR)s_szFrameTitle);
// Draw number box
SGUI_Basic_DrawRectangle(pstIFObj, VARIABLE_BOX_POSX, VARIABLE_BOX_NUMBER_POSY, VARIABLE_BOX_WIDTH+4, g_stFontSize[s_stNumberVariableBox.FontSize].Height+6, SGUI_COLOR_FRGCLR, SGUI_COLOR_BKGCLR);
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_NORMAL);
// Draw text box
SGUI_Basic_DrawRectangle(pstIFObj, VARIABLE_BOX_POSX, VARIABLE_BOX_TEXT_POSY, VARIABLE_BOX_WIDTH+4, g_stFontSize[s_stTextVariableBox.FontSize].Height+6, SGUI_COLOR_FRGCLR, SGUI_COLOR_BKGCLR);
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE);
}
break;
}
default:
{
eProcessResult = HMI_RET_NOACTION;
break;
}
}
}
}
@ -284,6 +276,7 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_PostProcess(SGUI_IF_OBJ* pstIFObj, SGUI_IN
s_uiAutoConfirmTimer = 5;
HMI_GoBack(NULL);
}
return HMI_RET_NORMAL;
}

View File

@ -1,30 +0,0 @@
/***************************************************************
* Name: LCDSimulatorMain.h
* Purpose: Defines Application Frame
* Author: ()
* Created: 2017-02-25
* Copyright: ()
* License:
**************************************************************/
#ifndef __INCLUDE_CLASS_APPLICATION_H__
#define __INCLUDE_CLASS_APPLICATION_H__
#include <wx\dialog.h>
#include <wx\app.h>
#include "LCDFrame.h"
class Application : public wxApp
{
private:
LCDFrame* m_pclsMainFrame;
private:
bool OnInit(void);
int OnExit(void);
};
#endif //__INCLUDE_CLASS_APPLICATION_H__

View File

@ -1,47 +0,0 @@
#include "Application.h"
#include "Common.h"
IMPLEMENT_APP(Application);
bool Application::OnInit(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
bool bReturn;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bReturn = true;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Register image media handle.
wxInitAllImageHandlers();
// Read virtual device parameter.
SetDefaultParameterData(&g_stParameters);
// Create main frame instance.
LCDFrame::Initialize((wxFrame*)NULL);
m_pclsMainFrame = LCDFrame::GetInstance();
if(NULL != m_pclsMainFrame)
{
SetTopWindow(m_pclsMainFrame);
m_pclsMainFrame->Show();
}
else
{
// Create instance failed.
bReturn = false;
}
return bReturn;
}
int Application::OnExit()
{
return 0;
}

View File

@ -1,46 +0,0 @@
#ifndef __INCLUDE_COMMON_H__
#define __INCLUDE_COMMON_H__
#include <stddef.h>
#include <stdint.h>
#define _TRANS_TEXT(STR) _(STR)
#define LCD_COLOR_OBJ_PIX (0xFF168363)
#define LCD_COLOR_OBJ_BKG (0xFF00F0D7)
#define LCD_COLOR_OBJ_EDGE (0xFF383834)
#define LCD_COLOR_OBJ_GRID (0xFF383834)
#define LCD_DEFAULT_CONFIG_FILE ("Config.xml")
#define PARAM_DEFAULT_PIXEL_NUM_H (128)
#define PARAM_DEFAULT_PIXEL_NUM_V (64)
#define PARAM_DEFAULT_PIXEL_SIZE (3)
#define PARAM_DEFAULT_EDGE_WIDTH (5)
#define PARAM_DEFAULT_GRID_ENABLE (true)
#define PARAM_DEFAULT_GRID_DISABLE (false)
typedef union
{
uint8_t Channel[4];
uint32_t RGBA;
}LCDRGBAColor;
typedef struct
{
size_t HorizontalPixelNumber;
size_t VerticalPixelNumber;
size_t PixelSize;
size_t EdgeWidth;
bool EnableGrid;
LCDRGBAColor EdgeColor;
LCDRGBAColor PanelColor;
LCDRGBAColor PixelColor;
LCDRGBAColor GridColor;
}PixelPanelParameter;
extern PixelPanelParameter g_stParameters;
void SetDefaultParameterData(PixelPanelParameter* pstParameter);
#endif // __INCLUDE_LCD_COMMON_H__

View File

@ -1,23 +0,0 @@
#include "Common.h"
PixelPanelParameter g_stParameters;
void SetDefaultParameterData(PixelPanelParameter* pstParameter)
{
if(NULL != pstParameter)
{
// Appearance
pstParameter->HorizontalPixelNumber = PARAM_DEFAULT_PIXEL_NUM_H;
pstParameter->VerticalPixelNumber = PARAM_DEFAULT_PIXEL_NUM_V;
pstParameter->PixelSize = PARAM_DEFAULT_PIXEL_SIZE;
pstParameter->EdgeWidth = PARAM_DEFAULT_EDGE_WIDTH;
pstParameter->EnableGrid = PARAM_DEFAULT_GRID_DISABLE;
// ScreenColor
pstParameter->PanelColor.RGBA = LCD_COLOR_OBJ_BKG;
pstParameter->PixelColor.RGBA = LCD_COLOR_OBJ_PIX;
pstParameter->EdgeColor.RGBA = LCD_COLOR_OBJ_EDGE;
pstParameter->GridColor.RGBA = LCD_COLOR_OBJ_GRID;
}
}

View File

@ -1,107 +0,0 @@
#ifndef __INCLUDE_CLASS_LCD_FRAME_H__
#define __INCLUDE_CLASS_LCD_FRAME_H__
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <wx/frame.h>
#include <wx/panel.h>
#include <wx/colour.h>
#include <wx/string.h>
#include <wx/statusbr.h>
#include <wx/toolbar.h>
#include <wx/clipbrd.h>
#include <wx/filefn.h>
#include <wx/timer.h>
#include "wxLCD.h"
//=======================================================================//
//= User Macro definition. =//
//=======================================================================//
#define FRAME_TITLE (_T("SimpleGUI Simulator"))
#define wxID_MAIN 1000
#define wxID_TOOLBAR 2000
#define wxID_TOOLBAR_QUICKSHOTS 2100
#define wxID_TOOLBAR_COPY 2101
#define wxID_TOOLBAR_SCREENSHOTS_FOLDER 2102
#define wxID_TOOLBAR_ABOUT 2103
#define wxID_TOOLBAR_EXIT 2104
#define wxID_STATUSBAR 3000
#define wxID_PANEL 4000
#define WXID_MILLISECOND_TIMER 5001
#define WXID_RTC_TIMER 5002
#define SCREENSHOTS_FOLDER_T "ScreenShots"
#define SCREENSHOTS_FILE_NAME_T "LCD_%04u%02u%02u_%02u%02u-%u.bmp"
#define SCREENSHOTS_FILE_FULLNAME_T wxString::Format("%s\\%s", SCREENSHOTS_FOLDER_T, SCREENSHOTS_FILE_NAME_T)
#define N_YEAR wxDateTime::Now().GetYear()
#define N_MONTH wxDateTime::Now().GetMonth()
#define N_DAY wxDateTime::Now().GetDay()
#define N_HOUR wxDateTime::Now().GetHour()
#define N_MINUTE wxDateTime::Now().GetMinute()
#define SCREENSHOTS_FOLDER _T(SCREENSHOTS_FOLDER_T)
#define SCREENSHOTS_FILE_NAME(IDX) wxString::Format(SCREENSHOTS_FILE_NAME_T, N_YEAR, N_MONTH, N_DAY, N_HOUR, N_MINUTE, IDX)
#define SCREENSHOTS_FILE_FULLNAME(IDX) wxString::Format(SCREENSHOTS_FILE_FULLNAME_T, N_YEAR, N_MONTH, N_DAY, N_HOUR, N_MINUTE, IDX)
//=======================================================================//
//= Class declare. =//
//=======================================================================//
class LCDFrame : public wxFrame
{
private:
// Controlers
wxStatusBar* m_pclsCtrlStatusBar;
wxToolBar* m_pclsCtrlToolBar;
wxLCD* m_pclsCtrlPaintPanel;
wxTimer* m_pclsMilliSecondTimer;
wxTimer* m_pclsRTCTimer;
static LCDFrame* m_pclsInstance;
// Members.
void _setStatusText(const wxString& strString);
void _wxEvent_OnUpdateUI(wxUpdateUIEvent& clsEventObject) {OnUpdateUI(clsEventObject);}
void _wxEvent_OnSetFocus(wxFocusEvent& clsEventObject) {SetFocus();}
void _wxEvent_OnClose(wxCloseEvent& clsEventObject) {OnClose();}
void _wxEvent_OnKeyDown(wxKeyEvent& clsEventObject) {OnKeyDown(clsEventObject);}
void _wxEvent_OnPaint(wxPaintEvent& clsEventObject) {OnPaint(clsEventObject);clsEventObject.Skip();}
void _wxEvent_OnScreenshots(wxCommandEvent& clsEventObject) {Screenshots();}
void _wxEvent_OnToolCopy(wxCommandEvent& clsEventObject) {Copy();}
void _wxEvent_OnOpenScreenshotsFolder(wxCommandEvent &clsEventObject){OpenScreenshotsFolder();}
void _wxEvent_OnAbout(wxCommandEvent& clsEventObject) {;}
void _wxEvent_OnExit(wxCommandEvent& clsEventObject) {OnClose();}
void _wxEvent_OnTimerEvent(wxTimerEvent& event) {OnTimerEvent(event);}
void _wxEvent_OnRTCUpdate(wxTimerEvent& event) {OnRTCUpdate(event);}
void _createToolbar(void);
void _initializeTimer(void);
void _startTimer(int32_t iMilliSecondTimerInterval);
protected:
virtual void OnUpdateUI(wxUpdateUIEvent& clsEventObject);
virtual void OnClose(void);
virtual void OnKeyDown(wxKeyEvent& clsEventObject);
virtual void OnPaint(wxPaintEvent &clsEventObject);
virtual void Screenshots(void);
virtual void Copy(void);
virtual void OpenScreenshotsFolder(void);
virtual void OnTimerEvent(wxTimerEvent& event);
virtual void OnRTCUpdate(wxTimerEvent& event);
public:
LCDFrame( wxWindow* pclsParent,
wxWindowID iID = wxID_MAIN,
const wxString& strTitle = FRAME_TITLE);
~LCDFrame();
static void Initialize( wxWindow* pclsParent,
wxWindowID iID = wxID_MAIN,
const wxString& strTitle = FRAME_TITLE);
static LCDFrame* GetInstance(void);
void SetLCDPixel(uint32_t uiPosX, uint32_t uiPosY, uint32_t uiPixelValue);
uint32_t GetLCDPixel(uint32_t uiPosX, uint32_t uiPosY);
void RefreshLCD(void);
void ClearLCD(void);
DECLARE_EVENT_TABLE();
};
#endif //__INCLUDE_CLASS_LCD_FRAME_H__

View File

@ -1,24 +0,0 @@
#ifndef __INCLUDE_USER_ACTION_INTERFACE__
#define __INCLUDE_USER_ACTION_INTERFACE__
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <stdint.h>
#include <stdbool.h>
//=======================================================================//
//= Public function declaration. =//
//=======================================================================//
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void UAIF_OnInitialize(void);
void UAIF_OnKeyPress(bool bShift, bool bCtrl, bool bAlt, uint16_t uiKeyCode);
void UAIF_OnTimerEventProcess(void);
void UAIF_OnRTCUpdateEventProcess(uint16_t uiYear, uint16_t uiMonth, uint16_t uiDay, uint16_t uiHour, uint16_t uiMinute, uint16_t uiSecond);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // __INCLUDE_USER_ACTION_INTERFACE__

View File

@ -1,123 +0,0 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: VirtualDeviceInterface.c **/
/** Author: Polarix **/
/** Version: 1.0.0.0 **/
/** Description: Virtual device operation interface. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include "UserActionInterface.h"
#include "VirtualDeviceInterface.h"
#include "DemoProc.h"
#include <stdlib.h>
//=======================================================================//
//= Function define. =//
//=======================================================================//
void UAIF_OnInitialize(void)
{
InitializeEngine();
}
/*************************************************************************/
/** Function Name: USR_ACT_OnKeyPress **/
/** Purpose: Recive and process key press event. **/
/** Resources: None. **/
/** Params: **/
/** @ bShift: Shift key is pressed. **/
/** @ bCtrl: Ctrl key is pressed. **/
/** @ bAlt: Alt key is pressed. **/
/** @ uiKeyCode: Key code. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void UAIF_OnKeyPress(bool bShift, bool bCtrl, bool bAlt, uint16_t uiKeyCode)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
SGUI_UINT16 arruiPressedKey[HMI_EVENT_KEY_VALUE_LENGTH_MAX];
HMI_EVENT stEvent;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
arruiPressedKey[0] = KEY_OPTION_NONE;
stEvent.Action = HMI_ENGINE_ACTION_KEY_PRESS;
if(true == bShift)
{
arruiPressedKey[0] |= KEY_OPTION_SHIFT;
}
if(true == bCtrl)
{
arruiPressedKey[0] |= KEY_OPTION_CTRL;
}
if(true == bAlt)
{
arruiPressedKey[0] |= KEY_OPTION_ALT;
}
arruiPressedKey[1] = uiKeyCode;
stEvent.Data = (SGUI_BYTE*)arruiPressedKey;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Call demo process.
EventProcess(HMI_ENGINE_EVENT_ACTION, &stEvent);
VDIF_RefreshDisplay();
}
void UAIF_OnTimerEventProcess(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
HMI_EVENT stEvent;
SGUI_INT iRandomNumber;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
stEvent.Action = HMI_ENGINE_ACTION_ON_TIMER;
stEvent.Data = NULL;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
iRandomNumber = rand();
iRandomNumber = (iRandomNumber % 200)-100;
stEvent.Data = (SGUI_BYTE*)(&iRandomNumber);
// Post timer event.
EventProcess(HMI_ENGINE_EVENT_ACTION, &stEvent);
VDIF_RefreshDisplay();
}
void UAIF_OnRTCUpdateEventProcess(uint16_t uiYear, uint16_t uiMonth, uint16_t uiDay, uint16_t uiHour, uint16_t uiMinute, uint16_t uiSecond)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
SGUI_TIME stRTCTime;
HMI_EVENT stEvent;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
stRTCTime.Year = uiYear;
stRTCTime.Month = uiMonth;
stRTCTime.Day = uiDay;
stRTCTime.Hour = uiHour;
stRTCTime.Minute = uiMinute;
stRTCTime.Second = uiSecond;
stEvent.Action = HMI_ENGINE_ACTION_ON_TIMER_RTC;
stEvent.Data = (SGUI_BYTE*)(&stRTCTime);
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Post RTC update message to a screen.
EventProcess(HMI_ENGINE_EVENT_DATA, &stEvent);
VDIF_RefreshDisplay();
}

View File

@ -1,141 +0,0 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: VirtualDeviceInterface.c **/
/** Author: Polarix **/
/** Version: 1.0.0.0 **/
/** Description: Virtual device operation interface. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include "VirtualDeviceInterface.h"
#include "LCDFrame.h"
//=======================================================================//
//= Function define. =//
//=======================================================================//
/*************************************************************************/
/** Function Name: VDIF_SetPixel **/
/** Purpose: Set virtual device pixel register data. **/
/** Params: **/
/** @ iPosX[in]: Pixel x-coordinate on display panel. **/
/** @ iPosY[in]: Pixel y-coordinate on display panel. **/
/** @ iPixelValue[out]: Pixel value, 0 for clear, 1 for set. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void VDIF_SetPixel(int iPosX, int iPosY, int iPixelValue)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
pclsMainFrameObjectPtr->SetLCDPixel(iPosX, iPosY, iPixelValue);
}
}
/*************************************************************************/
/** Function Name: VDIF_GetPixel **/
/** Purpose: Get a pixel value form virtual device register. **/
/** Params: **/
/** @ iPosX[in]: Pixel x-coordinate on display panel. **/
/** @ iPosY[in]: Pixel y-coordinate on display panel. **/
/** Return: Pixel state, 0 for cleared, 1 for set. **/
/** Notice: None. **/
/*************************************************************************/
int VDIF_GetPixel(int iPosX, int iPosY)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
int iPixelValue;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
iPixelValue = pclsMainFrameObjectPtr->GetLCDPixel(iPosX, iPosY);
}
else
{
iPixelValue = 0;
}
return iPixelValue;
}
/*************************************************************************/
/** Function Name: VDIF_RefreshDisplay. **/
/** Purpose: Refresh virtual device display. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void VDIF_RefreshDisplay(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
pclsMainFrameObjectPtr->RefreshLCD();
}
}
/*************************************************************************/
/** Function Name: VDIF_ClearDisplay. **/
/** Purpose: Clear screen display. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void VDIF_ClearDisplay(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
pclsMainFrameObjectPtr->ClearLCD();
pclsMainFrameObjectPtr->RefreshLCD();
}
}

View File

@ -0,0 +1,45 @@
/***************************************************************
* Name: LCDSimulatorMain.h
* Purpose: Defines Application Frame
* Author: ()
* Created: 2017-02-25
* Copyright: ()
* License:
**************************************************************/
#ifndef __INCLUDE_CLASS_APPLICATION_H__
#define __INCLUDE_CLASS_APPLICATION_H__
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <wx\dialog.h>
#include <wx\app.h>
#include "LCDFrame.h"
enum
{
APP_PROC_NORMAL = 0,
APP_PROC_FAILURE = -1,
APP_PROC_ABNORMAL = -2,
};
//=======================================================================//
//= Class declare. =//
//=======================================================================//
class Application : public wxApp
{
private:
LCDFrame* m_pclsMainFrame;
protected:
virtual void OnKeyDown(wxKeyEvent& clsEvent);
public:
bool OnInit(void);
int OnRun(void);
int OnExit(void);
};
#endif //__INCLUDE_CLASS_APPLICATION_H__

View File

@ -0,0 +1,88 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: Application.cpp **/
/** Author: Polarix **/
/** Description: Custom event class member define. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include "Application.h"
#include "Common.h"
//=======================================================================//
//= Class member function define. =//
//=======================================================================//
IMPLEMENT_APP(Application);
bool Application::OnInit(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
bool bReturn;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bReturn = true;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Register image media handle.
wxInitAllImageHandlers();
// Read virtual device parameter.
SetDefaultParameterData(&g_stParameters);
// Create main frame instance.
m_pclsMainFrame = LCDFrame::GetInstance();
if(NULL != m_pclsMainFrame)
{
SetTopWindow(m_pclsMainFrame);
m_pclsMainFrame->Show();
}
else
{
// Create instance failed.
bReturn = false;
}
return bReturn;
}
int Application::OnRun(void)
{
int iStartRet;
if(false == m_pclsMainFrame->StartDummyMain())
{
iStartRet = APP_PROC_FAILURE;
}
else
{
// Base run.
iStartRet = wxApp::OnRun();
}
return iStartRet;
}
int Application::OnExit()
{
int iTerminateRet;
iTerminateRet = wxApp::OnExit();
return iTerminateRet;
}
void Application::OnKeyDown(wxKeyEvent& clsEvent)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
clsEvent.ResumePropagation(1);
clsEvent.Skip();
}

View File

@ -0,0 +1,48 @@
#ifndef __INCLUDE_COMMON_H__
#define __INCLUDE_COMMON_H__
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <stddef.h>
#include <stdint.h>
//=======================================================================//
//= User Macro definition. =//
//=======================================================================//
#define _TRANS_TEXT(STR) _(STR)
#define LCD_COLOR_OBJ_PIX (0xFF168363)
#define LCD_COLOR_OBJ_BKG (0xFF00F0D7)
#define LCD_COLOR_OBJ_GRID (0xFF383834)
#define PARAM_DEFAULT_PIXEL_NUM_H (128)
#define PARAM_DEFAULT_PIXEL_NUM_V (64)
#define PARAM_DEFAULT_PIXEL_SIZE (1)
#define PARAM_DEFAULT_GRID_ENABLE (true)
#define PARAM_DEFAULT_GRID_DISABLE (false)
//=======================================================================//
//= Data type declaration. =//
//=======================================================================//
typedef struct
{
size_t HorizontalPixelNumber;
size_t VerticalPixelNumber;
size_t PixelSize;
bool EnableGrid;
unsigned int PanelColor;
unsigned int PixelColor;
unsigned int GridColor;
}PixelPanelParameter;
//=======================================================================//
//= Global variable declaration. =//
//=======================================================================//
extern PixelPanelParameter g_stParameters;
//=======================================================================//
//= Public function declaration. =//
//=======================================================================//
void SetDefaultParameterData(PixelPanelParameter* pstParameter);
#endif // __INCLUDE_LCD_COMMON_H__

View File

@ -0,0 +1,30 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: Common.cpp **/
/** Author: Polarix **/
/** Description: Common data and functions define. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include "Common.h"
PixelPanelParameter g_stParameters;
void SetDefaultParameterData(PixelPanelParameter* pstParameter)
{
if(NULL != pstParameter)
{
// Appearance
pstParameter->HorizontalPixelNumber = PARAM_DEFAULT_PIXEL_NUM_H;
pstParameter->VerticalPixelNumber = PARAM_DEFAULT_PIXEL_NUM_V;
pstParameter->PixelSize = PARAM_DEFAULT_PIXEL_SIZE;
pstParameter->EnableGrid = PARAM_DEFAULT_GRID_ENABLE;
// ScreenColor
pstParameter->PanelColor = LCD_COLOR_OBJ_BKG;
pstParameter->PixelColor = LCD_COLOR_OBJ_PIX;
pstParameter->GridColor = LCD_COLOR_OBJ_GRID;
}
}

View File

@ -35,12 +35,11 @@ class wxLCDBase
int m_iPixelSize;
bool m_bGridVisible;
unsigned int** m_ppuiDisplayBuffer;
wxCriticalSection m_clsDisplayBufferCS;
void (wxLCDBase::*m_pfDrawPoint)(wxDC& clsDCObject, int iPosX, int iPosY, int iPixelSize);
bool m_bIsOK;
int m_iLockLevel;
private:
bool _initialize(void);
void _getBestSize(wxSize& clsBestSize) const;
inline void _drawPointSinglePixel(wxDC& clsDCObject, int iPosX, int iPosY, int iPixelSize);
@ -54,13 +53,14 @@ class wxLCDBase
void _freeDisplayBuffer(unsigned int** ppuiDisplayBuffer);
unsigned int** _createNewDisplayBuffer(int iHorizontalPixelNumber, int iVerticalPixelNumber);
void _cleanDisplayBuffer(void);
void _enterPaintCriticalSection(void) {m_clsDisplayBufferCS.Enter();}
void _leavePaintCriticalSection(void) {m_clsDisplayBufferCS.Leave();}
protected:
// Event callback function.
virtual void OnPaint(wxPaintEvent &clsEvent);
virtual void OnEraseBackGround(wxEraseEvent &clsEvent) {/* Do nothing. */}
virtual void OnKeyDown(wxKeyEvent& clsEvent);
virtual wxSize DoGetBestClientSize(void) const;
public:

View File

@ -1,10 +1,21 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: wxLCD.cpp **/
/** Author: Polarix **/
/** Description: LCD display panel in wxWidgets frame. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include "wxLCD.h"
//=======================================================================//
//= Function define. =//
//=======================================================================//
wxLCD::wxLCD(wxWindow *pclsParent, wxWindowID iWinID, const wxPoint& clsPosition, const wxSize& clsSizeInPixel):
wxLCDBase(pclsParent, iWinID, clsPosition, clsSizeInPixel)
{
m_clsPixelLColour.Set(0x00FFFFFF);
m_clsPixelLColour.Set(0x00000000);
m_clsPixelHColour.Set(0x00000000);
}
@ -86,9 +97,8 @@ void wxLCD::SetParameter(PixelPanelParameter* pstPanelParameter)
SetGridVisibled(pstPanelParameter->EnableGrid);
SetPixelNumber(pstPanelParameter->HorizontalPixelNumber, pstPanelParameter->VerticalPixelNumber);
SetPixelColour(wxColor(pstPanelParameter->PixelColor.RGBA), false);
SetPanelColour(wxColor(pstPanelParameter->PanelColor.RGBA), false);
SetGridColor(wxColor(pstPanelParameter->GridColor.RGBA));
SetPixelColour(wxColor(pstPanelParameter->PixelColor), false);
SetPanelColour(wxColor(pstPanelParameter->PanelColor), false);
SetGridColor(wxColor(pstPanelParameter->GridColor));
}
CleanScreen();
}

View File

@ -1,3 +1,9 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: wxLCDBase.cpp **/
/** Author: Polarix **/
/** Description: LCD display panel in wxWidgets frame. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
@ -43,6 +49,7 @@ m_clsCDC(this)
// Initialize paint buffer and function pointer.
m_ppuiDisplayBuffer = nullptr;
m_pfDrawPoint = nullptr;
m_iLockLevel = 0;
// Process initialize.
m_bIsOK = _initialize();
}
@ -124,6 +131,8 @@ void wxLCDBase::SetPixelNumber(int iHorizontalPixelNumber, int iVerticalPixelNum
ppuiNewDisplayBuffer = _createNewDisplayBuffer(iHorizontalPixelNumber, iVerticalPixelNumber);
if(NULL != ppuiNewDisplayBuffer)
{
_enterPaintCriticalSection();
iCopiedRowNumber = m_clsSizeInPixel.GetHeight()<iVerticalPixelNumber?m_clsSizeInPixel.GetHeight():iVerticalPixelNumber;
iCopiedColumnNumber = m_clsSizeInPixel.GetWidth()<iHorizontalPixelNumber?m_clsSizeInPixel.GetWidth():iHorizontalPixelNumber;
// Copy old buffer content to new buffer;
@ -135,6 +144,8 @@ void wxLCDBase::SetPixelNumber(int iHorizontalPixelNumber, int iVerticalPixelNum
_freeDisplayBuffer(m_ppuiDisplayBuffer);
m_ppuiDisplayBuffer = ppuiNewDisplayBuffer;
m_clsSizeInPixel.Set(iHorizontalPixelNumber, iVerticalPixelNumber);
_leavePaintCriticalSection();
}
}
}
@ -163,6 +174,7 @@ void wxLCDBase::SetPixelSize(int iPixelSize)
// Save the pixel size value.
m_iPixelSize = iPixelSize;
_enterPaintCriticalSection();
// If pixel size is 0, the pixel drawing function will set to invalid.
if(0 == m_iPixelSize)
{
@ -185,6 +197,7 @@ void wxLCDBase::SetPixelSize(int iPixelSize)
m_pfDrawPoint = &_drawPointMultiplePixel;
}
}
_leavePaintCriticalSection();
}
void wxLCDBase::SetGridVisibled(bool bGridVisible, bool bRefreshNow)
@ -193,17 +206,26 @@ void wxLCDBase::SetGridVisibled(bool bGridVisible, bool bRefreshNow)
/* Process */
/*----------------------------------*/
// Save the grid visible value set.
m_bGridVisible = bGridVisible;
if(m_iPixelSize < WX_LCD_PIX_SIZE_MIN_WITH_GRID)
{
m_bGridVisible = false;
}
else
{
if(true == m_bGridVisible)
m_bGridVisible = bGridVisible;
}
_enterPaintCriticalSection();
if(true == m_bGridVisible)
{
// Pixel unit size must large then WX_LCD_PIX_SIZE_MIN_WITH_GRID.
m_pfDrawPoint = &_drawPointMultiplePixelWithGrid;
}
else
{
if(1 == m_iPixelSize)
{
m_pfDrawPoint = &_drawPointMultiplePixelWithGrid;
m_pfDrawPoint = &_drawPointSinglePixel;
}
else
{
@ -214,6 +236,7 @@ void wxLCDBase::SetGridVisibled(bool bGridVisible, bool bRefreshNow)
{
RefreshDisplay();
}
_leavePaintCriticalSection();
}
bool wxLCDBase::GetGridVisibled(void) const
@ -249,7 +272,22 @@ void wxLCDBase::_cleanDisplayBuffer(void)
}
RefreshDisplay();
}
/*
void wxLCDBase::_enterPaintCriticalSection(void)
{
m_clsDisplayBufferCS.Enter();
m_iLockLevel++
}
void wxLCDBase::_leavePaintCriticalSection(void)
{
m_iLockLevel--;
if(0 == m_iLockLevel)
{
m_clsDisplayBufferCS.Leave();
}
}
*/
void wxLCDBase::SetDisplayBuffer(wxColour& clsPanelColour)
{
/*----------------------------------*/
@ -257,6 +295,8 @@ void wxLCDBase::SetDisplayBuffer(wxColour& clsPanelColour)
/*----------------------------------*/
if((NULL != m_pfDrawPoint) && (m_iPixelSize > 0))
{
_enterPaintCriticalSection();
// Cleanup display and set display buffer .
for(int iIdxV=0; iIdxV<m_clsSizeInPixel.GetHeight(); iIdxV++)
{
@ -265,6 +305,8 @@ void wxLCDBase::SetDisplayBuffer(wxColour& clsPanelColour)
*(*(m_ppuiDisplayBuffer+iIdxV)+iIdxH) = clsPanelColour.GetRGBA();
}
}
_leavePaintCriticalSection();
}
}
@ -275,6 +317,8 @@ void wxLCDBase::ReplaceColour(const wxColour& clsOldColour, const wxColour& clsN
/*----------------------------------*/
if((NULL != m_pfDrawPoint) && (m_iPixelSize > 0))
{
_enterPaintCriticalSection();
// Cleanup display and set display buffer .
for(int iIdxV=0; iIdxV<m_clsSizeInPixel.GetHeight(); iIdxV++)
{
@ -286,6 +330,8 @@ void wxLCDBase::ReplaceColour(const wxColour& clsOldColour, const wxColour& clsN
}
}
}
_leavePaintCriticalSection();
}
}
@ -369,6 +415,8 @@ void wxLCDBase::SetPixelUnitColor(int iPosX, int iPosY, const wxColor& clsColor,
/*----------------------------------*/
if((iPosX < m_clsSizeInPixel.GetWidth()) && (iPosY < m_clsSizeInPixel.GetHeight()))
{
_enterPaintCriticalSection();
if(nullptr != m_ppuiDisplayBuffer)
{
*(*(m_ppuiDisplayBuffer+iPosY)+iPosX) = clsColor.GetRGBA();
@ -377,6 +425,8 @@ void wxLCDBase::SetPixelUnitColor(int iPosX, int iPosY, const wxColor& clsColor,
{
RefreshDisplay();
}
_leavePaintCriticalSection();
}
}
@ -401,10 +451,12 @@ unsigned int wxLCDBase::GetPixelUnitColor(int iPosX, int iPosY)
/*----------------------------------*/
if((iPosX < m_clsSizeInPixel.GetWidth()) && (iPosY < m_clsSizeInPixel.GetHeight()))
{
_enterPaintCriticalSection();
if(nullptr != m_ppuiDisplayBuffer)
{
uiReturnValue = *(*(m_ppuiDisplayBuffer+iPosY)+iPosX);
}
_leavePaintCriticalSection();
}
return uiReturnValue;
@ -427,6 +479,8 @@ void wxLCDBase::DrawPixel(int iPosX, int iPosY, wxColor& clsColor)
/*----------------------------------*/
if((iPosX < m_clsSizeInPixel.GetWidth()) && (iPosY < m_clsSizeInPixel.GetHeight()) && (m_iPixelSize != 0))
{
_enterPaintCriticalSection();
_setDCColor(clsColor);
_prepareDC(m_clsCDC);
if(nullptr != m_pfDrawPoint)
@ -439,6 +493,8 @@ void wxLCDBase::DrawPixel(int iPosX, int iPosY, wxColor& clsColor)
}
SetPixelUnitColor(iPosX, iPosY, clsColor);
_releaseDC(m_clsCDC);
_leavePaintCriticalSection();
}
}
@ -460,6 +516,7 @@ void wxLCDBase::RefreshDisplay(void)
/*----------------------------------*/
int iPaintSizeWidth, iPaintSizeHeight;
bool bGridVisible;
unsigned int uiColorRGBA;
/*----------------------------------*/
/* Initialize */
@ -474,6 +531,8 @@ void wxLCDBase::RefreshDisplay(void)
iPaintSizeWidth++;
iPaintSizeHeight++;
}
_enterPaintCriticalSection();
// Create buffer image and DC object.
wxBitmap clsBufferImage(iPaintSizeWidth, iPaintSizeHeight);
wxBufferedDC clsBufferedDC(&m_clsCDC, clsBufferImage);
@ -496,12 +555,15 @@ void wxLCDBase::RefreshDisplay(void)
{
for(int i_W=0; i_W<m_clsSizeInPixel.GetWidth(); i_W++)
{
_setDCColor(wxColor(*(*(m_ppuiDisplayBuffer+i_H)+i_W)));
uiColorRGBA = *(*(m_ppuiDisplayBuffer+i_H)+i_W);
_setDCColor(wxColor(uiColorRGBA));
_prepareDC(clsBufferedDC);
(this->*m_pfDrawPoint)(clsBufferedDC, i_W, i_H, m_iPixelSize);
}
}
}
_leavePaintCriticalSection();
}
/*************************************************************************/
@ -723,3 +785,5 @@ wxSize wxLCDBase::DoGetBestClientSize(void) const
return clsBestSize;
}

View File

@ -1,48 +1,48 @@
#ifndef __INCLUDE_DEMO_RESOURCE_UTF8_H__
#define __INCLUDE_DEMO_RESOURCE_UTF8_H__
/* Screen 1: Multiple lines text. */
/* Start screen scroll text. */
#define DEMO_START_NOTICE (\
#ifndef __INCLUDE_DEMO_RESOURCE_UTF8_H__
#define __INCLUDE_DEMO_RESOURCE_UTF8_H__
/* Screen 1: Multiple lines text. */
/* Start screen scroll text. */
#define DEMO_START_NOTICE (\
" 欢迎来到SimpleGUI演示工程本工程用于演示SimpleGUI各API的显示效果、\
使SimpleGUI演示工\
\n\
"\
)
/* Screen 2: List*/
/* Demo list title. */
#define DEMO_LIST_TITLE ("测试列表")
/* Enumed list item choice type. */
#define DEMO_LIST_ITEM_NOTICE_TEXT ("文字消息")
#define DEMO_LIST_ITEM_NOTICE_TIME ("系统时间")
#define DEMO_LIST_ITEM_ENUM_VALUE1 ("枚举项1")
#define DEMO_LIST_ITEM_ENUM_VALUE2 ("枚举项2")
#define DEMO_LIST_ITEM_ENUM_VALUE3 ("枚举项3")
/* List items data. Sign ListText List item type List value Decimal point Enumed text list */
/* init. min. max. init. min. max. */
"\
)
/* Screen 2: List*/
/* Demo list title. */
#define DEMO_LIST_TITLE ("测试列表")
/* Enumed list item choice type. */
#define DEMO_LIST_ITEM_NOTICE_TEXT ("文字消息")
#define DEMO_LIST_ITEM_NOTICE_TIME ("系统时间")
#define DEMO_LIST_ITEM_ENUM_VALUE1 ("枚举项1")
#define DEMO_LIST_ITEM_ENUM_VALUE2 ("枚举项2")
#define DEMO_LIST_ITEM_ENUM_VALUE3 ("枚举项3")
/* List items data. Sign ListText List item type List value Decimal point Enumed text list */
/* init. min. max. init. min. max. */
#define DEMO_LIST_ITEM_0 {0, "简单列表项", LIST_ITEM_NORMAL, {0, 0, 0 }, {0, 0, 0 }, NULL}
#define DEMO_LIST_ITEM_1 {1, "枚举类型列表项", LIST_ITEM_ENUM, {0, 0, 1 }, {0, 0, 0 }, s_arrszNoticeType}
#define DEMO_LIST_ITEM_2 {2, "数字列表项", LIST_ITEM_DIGIT, {0, -50, 50 }, {0, 0, 3 }, NULL}
#define DEMO_LIST_ITEM_3 {3, "带小数的数字列表项", LIST_ITEM_DIGIT, {1, -50, 50 }, {2, 0, 5 }, NULL}
#define DEMO_LIST_ITEM_4 {4, "超长文字的简单列表项", LIST_ITEM_NORMAL, {0, 0, 0 }, {0, 0, 0 }, NULL}
#define DEMO_LIST_ITEM_5 {5, "编辑框", LIST_ITEM_NORMAL, {0, 0, 0 }, {0, 0, 0 }, NULL}
#define DEMO_LIST_ITEM_6 {6, "实时曲线", LIST_ITEM_NORMAL, {0, 0, 0 }, {0, 0, 0 }, NULL}
#define DEMO_LIST_ITEM_6 {6, "实时曲线", LIST_ITEM_NORMAL, {0, 0, 0 }, {0, 0, 0 }, NULL}
#define DEMO_LIST_ITEM_7 {7, "测试项目1", LIST_ITEM_NORMAL, {0, 0, 0 }, {0, 0, 0 }, NULL}
#define DEMO_LIST_ITEM_8 {8, "测试项目2", LIST_ITEM_ENUM, {0, 0, 2 }, {0, 0, 0 }, s_arrszEnumedValue}
#define DEMO_LIST_ITEM_9 {9, "测试项目3", LIST_ITEM_DIGIT, {0, -50, 50 }, {0, 0, 3 }, NULL}
/* Screen 3: Text notice box. */
/* List notice text format. */
#define DEMO_LIST_NOTICE_TEXT_FMT ("选择列表项%u.")
/* Screen 4: RTC notice box. */
#define DEMO_RTC_NOTICE_TEXT_FMT ("系统时间\n%04u-%02u-%02u\n%02u:%02u:%02u")
/* Screen 5: Variable box. */
#define DEMO_VARIABLE_BOX_TITLE ("数值/文本编辑演示")
#define DEMO_VARIABLE_BOX_HELPER ("TAB键切换焦点编辑框。\n上下箭头调整数值。\n左右箭头调整焦点字符。\n按空格键继续。")
#endif // __INCLUDE_DEMO_RESOURCE_UTF8_H__
#define DEMO_LIST_ITEM_9 {9, "测试项目3", LIST_ITEM_DIGIT, {0, -50, 50 }, {0, 0, 3 }, NULL}
/* Screen 3: Text notice box. */
/* List notice text format. */
#define DEMO_LIST_NOTICE_TEXT_FMT ("选择列表项%u.")
/* Screen 4: RTC notice box. */
#define DEMO_RTC_NOTICE_TEXT_FMT ("系统时间\n%04u-%02u-%02u\n%02u:%02u:%02u")
/* Screen 5: Variable box. */
#define DEMO_VARIABLE_BOX_TITLE ("数值/文本编辑演示")
#define DEMO_VARIABLE_BOX_HELPER ("TAB键切换焦点编辑框。\n上下箭头调整数值。\n左右箭头调整焦点字符。\n按空格键继续。")
#endif // __INCLUDE_DEMO_RESOURCE_UTF8_H__

View File

@ -0,0 +1,86 @@
#ifndef _INCLUDED_CLASS_CUSTOM_EVENTS_H_
#define _INCLUDED_CLASS_CUSTOM_EVENTS_H_
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <wx/event.h>
#include <wx/string.h>
//=======================================================================//
//= Class declare. =//
//=======================================================================//
//-----------------------------------------------------------------------//
//= Event types declare. =//
//-----------------------------------------------------------------------//
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_SDK_INIT, evtID_SDK_INIT)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_RTC_SWITCH, evtID_FONT_STYLE)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_TIMER_SET, evtID_NAVI_BUTTON)
END_DECLARE_EVENT_TYPES()
#define EVT_SDK_INIT(fn) \
DECLARE_EVENT_TABLE_ENTRY(wxEVT_SDK_INIT, wxID_ANY, -1, (wxObjectEventFunction)(wxEventFunction)(InitEventFunc)&fn, (wxObject*)NULL),
#define EVT_SDK_RTC_EN(fn) \
DECLARE_EVENT_TABLE_ENTRY(wxEVT_RTC_SWITCH, wxID_ANY, -1, (wxObjectEventFunction)(wxEventFunction)(RTCSwitchEventFunc)&fn, (wxObject*)NULL),
#define EVT_SDK_TIMER_SET(fn) \
DECLARE_EVENT_TABLE_ENTRY(wxEVT_TIMER_SET, wxID_ANY, -1, (wxObjectEventFunction)(wxEventFunction)(TimerSwitchEventFunc)&fn, (wxObject*)NULL),
//-----------------------------------------------------------------------//
//= Initialize event class declare. =//
//-----------------------------------------------------------------------//
class InitEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(InitEvent)
public:
InitEvent(int iWinID = wxID_ANY, wxEventType iCommandType = wxEVT_SDK_INIT);
InitEvent(const InitEvent& clsEvent);
virtual wxEvent* Clone() const {return new InitEvent(*this);}
};
typedef void (wxEvtHandler::*InitEventFunc)(InitEvent&);
//-----------------------------------------------------------------------//
//= RTC status switch event class declare. =//
//-----------------------------------------------------------------------//
class RTCSwitchEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(RTCSwitchEvent)
private:
bool m_bRTCEnabled;
public:
RTCSwitchEvent(int iWinID = 0, wxEventType iCommandType = wxEVT_NULL);
RTCSwitchEvent(const RTCSwitchEvent& clsEvent);
virtual wxEvent* Clone() const {return new RTCSwitchEvent(*this);}
bool GetReqState(void) const {return m_bRTCEnabled;}
void SetReqState(const bool bEnabled) {m_bRTCEnabled = bEnabled;}
};
typedef void (wxEvtHandler::*RTCSwitchEventFunc)(RTCSwitchEvent&);
//-----------------------------------------------------------------------//
//= Timer status switch event class declare. =//
//-----------------------------------------------------------------------//
class TimerSetEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(TimerSetEvent)
private:
int m_iIntervalMs;
public:
TimerSetEvent(int iWinID = 0, wxEventType iCommandType = wxEVT_NULL);
TimerSetEvent(const TimerSetEvent& clsEvent);
virtual wxEvent* Clone() const {return new TimerSetEvent(*this);}
int GetInterval(void) const {return m_iIntervalMs;}
void SetInterval(const int iInterval) {m_iIntervalMs = iInterval;}
};
typedef void (wxEvtHandler::*TimerSwitchEventFunc)(TimerSetEvent&);
#endif // _INCLUDED_CLASS_CUSTOM_EVENTS_H_

View File

@ -0,0 +1,38 @@
#ifndef _INCLUDED_CLASS_FONT_STYLE_EVENT_H_
#define _INCLUDED_CLASS_FONT_STYLE_EVENT_H_
#include <wx/event.h>
class RTCSwitchEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(RTCSwitchEvent)
private:
bool m_bTurnOn;
public:
RTCSwitchEvent(int iWinid = 0, wxEventType iCommandType = wxEVT_NULL);
RTCSwitchEvent(const RTCSwitchEvent& clsEvent);
virtual wxEvent* Clone() const {return new RTCSwitchEvent(*this);}
bool IsBold(void) const {return m_bBold;}
void SetBlod(bool bBold) {m_bBold = bBold;}
bool IsTialic(void) const {return m_bTialic;}
void SetTialic(bool bTialic) {m_bTialic = bTialic;}
bool IsForceWidth(void) const {return m_bForceWidth;}
void SetForceWidth(bool bForceWidth) {m_bForceWidth = bForceWidth;}
int GetForcedWidthValue(void) const {return m_iForcedWidth;}
void SetForcedWidthValue(int iForcedWidth) {m_iForcedWidth = iForcedWidth;}
};
typedef void (wxEvtHandler::*RTCSwitchEventFunc)(RTCSwitchEvent&);
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_RTC_SWITCH, evtID_FONT_STYLE)
END_DECLARE_EVENT_TYPES()
#define EVT_FONT_STYLE(id, fn) \
DECLARE_EVENT_TABLE_ENTRY(wxEVT_RTC_SWITCH, id, -1, (wxObjectEventFunction)(wxEventFunction)(RTCSwitchEventFunc)&fn, (wxObject*)NULL),
#endif // _INCLUDED_CLASS_FONT_STYLE_EVENT_H_

View File

@ -0,0 +1,28 @@
#ifndef _INCLUDE_CLASS_NAVI_BUTTON_EVENT_H_
#define _INCLUDE_CLASS_NAVI_BUTTON_EVENT_H_
#include <wx/event.h>
class TimerSwitchEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(TimerSwitchEvent)
private:
//NAVI_DIRECTION m_eDirection;
public:
TimerSwitchEvent(int iWinid = 0, wxEventType iCommandType = wxEVT_NULL);
TimerSwitchEvent(const TimerSwitchEvent& clsEvent);
virtual wxEvent* Clone() const {return new TimerSwitchEvent(*this);}
};
typedef void (wxEvtHandler::*TimerSwitchEventFunc)(TimerSwitchEvent&);
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_TIMER_SWITCH, evtID_NAVI_BUTTON)
END_DECLARE_EVENT_TYPES()
#define EVT_NAVI_BTN(id, fn) \
DECLARE_EVENT_TABLE_ENTRY(wxEVT_TIMER_SWITCH, id, -1, (wxObjectEventFunction)(wxEventFunction)(TimerSwitchEventFunc)&fn, (wxObject*)NULL),
#endif // _INCLUDE_CLASS_NAVI_BUTTON_EVENT_H_

View File

@ -0,0 +1,70 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: CustomEvents.cpp **/
/** Author: Polarix **/
/** Description: Custom event class member define. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include "CustomEvents.h"
//=======================================================================//
//= Function define. =//
//=======================================================================//
//-----------------------------------------------------------------------//
//= Initialize event class define. =//
//-----------------------------------------------------------------------//
IMPLEMENT_DYNAMIC_CLASS(InitEvent, wxEvent)
DEFINE_LOCAL_EVENT_TYPE(wxEVT_SDK_INIT)
InitEvent::InitEvent(int iWinID, wxEventType iCommandType):
wxEvent(iWinID, iCommandType)
{
}
InitEvent::InitEvent(const InitEvent& clsEvent):
wxEvent(clsEvent)
{
}
//-----------------------------------------------------------------------//
//= RTC status switch event class define. =//
//-----------------------------------------------------------------------//
IMPLEMENT_DYNAMIC_CLASS(RTCSwitchEvent, wxEvent)
DEFINE_LOCAL_EVENT_TYPE(wxEVT_RTC_SWITCH)
RTCSwitchEvent::RTCSwitchEvent(int iWinID, wxEventType iCommandType):
wxEvent(iWinID, iCommandType)
{
m_bRTCEnabled = false;
}
RTCSwitchEvent::RTCSwitchEvent(const RTCSwitchEvent& clsEvent):
wxEvent(clsEvent)
{
SetReqState(clsEvent.GetReqState());
}
//-----------------------------------------------------------------------//
//= Timer status switch event class define. =//
//-----------------------------------------------------------------------//
IMPLEMENT_DYNAMIC_CLASS(TimerSetEvent, wxEvent)
DEFINE_LOCAL_EVENT_TYPE(wxEVT_TIMER_SET)
TimerSetEvent::TimerSetEvent(int iWinID, wxEventType iCommandType):
wxEvent(iWinID, iCommandType)
{
m_iIntervalMs = 0;
}
TimerSetEvent::TimerSetEvent(const TimerSetEvent& clsEvent):
wxEvent(clsEvent)
{
SetInterval(clsEvent.GetInterval());
}

View File

@ -0,0 +1,22 @@
#include "RTCSwitchEvent.h"
IMPLEMENT_DYNAMIC_CLASS(RTCSwitchEvent, wxEvent)
DEFINE_LOCAL_EVENT_TYPE(wxEVT_RTC_SWITCH)
RTCSwitchEvent::RTCSwitchEvent(int iWinid, wxEventType iCommandType):
wxEvent(iWinid, iCommandType)
{
m_bBold = false;
m_bTialic = false;
m_bForceWidth = false;
m_iForcedWidth = 4;
}
RTCSwitchEvent::RTCSwitchEvent(const RTCSwitchEvent& clsEvent):
wxEvent(clsEvent)
{
m_bBold = clsEvent.IsBold();
m_bTialic = clsEvent.IsTialic();
m_bForceWidth = clsEvent.IsForceWidth();
m_iForcedWidth = clsEvent.GetForcedWidthValue();
}

View File

@ -0,0 +1,17 @@
#include "TimerSwitchEvent.h"
IMPLEMENT_DYNAMIC_CLASS(TimerSwitchEvent, wxEvent)
DEFINE_LOCAL_EVENT_TYPE(wxEVT_TIMER_SWITCH)
TimerSwitchEvent::TimerSwitchEvent(int iWinid, wxEventType iCommandType):
wxEvent(iWinid, iCommandType)
{
//m_bIsExpand = false;
//m_eDirection = NAVI_DIRECTION_NO_OP;
}
TimerSwitchEvent::TimerSwitchEvent(const TimerSwitchEvent& clsEvent):
wxEvent(clsEvent)
{
}

View File

@ -0,0 +1,107 @@
#ifndef __INCLUDE_CLASS_LCD_FRAME_H__
#define __INCLUDE_CLASS_LCD_FRAME_H__
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <wx/frame.h>
#include <wx/panel.h>
#include <wx/colour.h>
#include <wx/string.h>
#include <wx/statusbr.h>
#include <wx/toolbar.h>
#include <wx/clipbrd.h>
#include <wx/filefn.h>
#include <wx/timer.h>
#include <wx/sizer.h>
#include "wxLCD.h"
#include "CustomEvents.h"
//=======================================================================//
//= User Macro definition. =//
//=======================================================================//
#define FRAME_TITLE (_T("SimpleGUI Simulator"))
#define wxID_MAIN 1000
#define wxID_TOOLBAR 2000
#define wxID_TOOLBAR_QUICKSHOTS 2100
#define wxID_TOOLBAR_COPY 2101
#define wxID_TOOLBAR_SCREENSHOTS_FOLDER 2102
#define wxID_TOOLBAR_ABOUT 2103
#define wxID_TOOLBAR_EXIT 2104
#define wxID_STATUSBAR 3000
#define wxID_PANEL 4000
#define WXID_MILLISECOND_TIMER 5001
#define WXID_RTC_TIMER 5002
#define SCREENSHOTS_FOLDER_T "ScreenShots"
#define SCREENSHOTS_FILE_NAME_T "LCD_%04u%02u%02u_%02u%02u-%u.bmp"
#define SCREENSHOTS_FILE_FULLNAME_T wxString::Format("%s\\%s", SCREENSHOTS_FOLDER_T, SCREENSHOTS_FILE_NAME_T)
#define N_YEAR wxDateTime::Now().GetYear()
#define N_MONTH wxDateTime::Now().GetMonth()
#define N_DAY wxDateTime::Now().GetDay()
#define N_HOUR wxDateTime::Now().GetHour()
#define N_MINUTE wxDateTime::Now().GetMinute()
#define SCREENSHOTS_FOLDER _T(SCREENSHOTS_FOLDER_T)
#define SCREENSHOTS_FILE_NAME(IDX) wxString::Format(SCREENSHOTS_FILE_NAME_T, N_YEAR, N_MONTH, N_DAY, N_HOUR, N_MINUTE, IDX)
#define SCREENSHOTS_FILE_FULLNAME(IDX) wxString::Format(SCREENSHOTS_FILE_FULLNAME_T, N_YEAR, N_MONTH, N_DAY, N_HOUR, N_MINUTE, IDX)
//=======================================================================//
//= Class declare. =//
//=======================================================================//
class LCDFrame
: public wxFrame
, public wxThreadHelper
{
DECLARE_EVENT_TABLE();
private:
// Controlers
wxStatusBar* m_pclsCtrlStatusBar;
wxToolBar* m_pclsCtrlToolBar;
wxLCD* m_pclsCtrlPaintPanel;
wxTimer* m_pclsMilliSecondTimer;
wxTimer* m_pclsRTCTimer;
static LCDFrame* m_pclsInstance;
// Members.
void _setStatusText(const wxString& strString);
void _wxEvent_OnClose(wxCloseEvent& clsEvent) {OnClose();}
void _wxEvent_OnKeyDown(wxKeyEvent& clsEvent) {OnKeyDown(clsEvent);}
void _wxEvent_OnPaint(wxPaintEvent& clsEvent) {OnPaint(clsEvent);clsEvent.Skip();}
void _wxEvent_OnScreenshots(wxCommandEvent& clsEvent) {Screenshots();}
void _wxEvent_OnToolCopy(wxCommandEvent& clsEvent) {Copy();}
void _wxEvent_OnOpenScreenshotsFolder(wxCommandEvent &clsEvent){OpenScreenshotsFolder();}
void _wxEvent_OnAbout(wxCommandEvent& clsEvent) {;}
void _wxEvent_OnExit(wxCommandEvent& clsEvent) {OnClose();}
void _createToolbar(void);
protected:
virtual void OnClose(void);
virtual void OnKeyDown(wxKeyEvent& clsEvent);
virtual void OnPaint(wxPaintEvent &clsEvent);
virtual void Screenshots(void);
virtual void Copy(void);
virtual void OpenScreenshotsFolder(void);
virtual void OnTimerEvent(wxTimerEvent& clsEvent);
virtual void OnRTCUpdate(wxTimerEvent& clsEvent);
virtual void OnSDKInitialize(InitEvent& clsEvent);
virtual void OnSDKTimerSet(TimerSetEvent& clsEvent);
virtual void OnRTCTimerEnabled(RTCSwitchEvent& clsEvent);
virtual wxThread::ExitCode Entry(void);
public:
LCDFrame( wxWindow* pclsParent,
wxWindowID iID = wxID_MAIN,
const wxString& strTitle = FRAME_TITLE);
~LCDFrame(void);
static LCDFrame* GetInstance(void);
void SetLCDPixel(uint32_t uiPosX, uint32_t uiPosY, uint32_t uiPixelValue);
uint32_t GetLCDPixel(uint32_t uiPosX, uint32_t uiPosY);
void RefreshLCD(void);
void ClearLCD(void);
bool StartDummyMain(void);
};
#endif //__INCLUDE_CLASS_LCD_FRAME_H__

View File

@ -2,79 +2,84 @@
/** Copyright. **/
/** FileName: LCDFrame.cpp **/
/** Author: Polarix **/
/** Version: 1.7.0.0 **/
/** Description: Main frame class define. **/
/*************************************************************************/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <wx\msgdlg.h>
//=======================================================================//
#include <wx/msgdlg.h>
#include <wx/app.h>
#include "LCDFrame.h"
#include "UserActionInterface.h"
#include "SDKInterface.h"
//=======================================================================//
//= User Macro definition. =//
//=======================================================================//
#define DUMMY_MAIN_START_DELAY_MS (500)
//=======================================================================//
//= Static class member define. =//
//=======================================================================//
LCDFrame* LCDFrame::m_pclsInstance = NULL;
//=======================================================================//
LCDFrame* LCDFrame::m_pclsInstance = NULL;
//=======================================================================//
//= Event table. =//
//=======================================================================//
BEGIN_EVENT_TABLE(LCDFrame,wxFrame)
EVT_UPDATE_UI(wxID_MAIN, LCDFrame::_wxEvent_OnUpdateUI)
EVT_SET_FOCUS(LCDFrame::_wxEvent_OnSetFocus)
EVT_CLOSE(LCDFrame::_wxEvent_OnClose)
EVT_SET_FOCUS(LCDFrame::_wxEvent_OnSetFocus)
EVT_KEY_DOWN(LCDFrame::_wxEvent_OnKeyDown)
EVT_PAINT(LCDFrame::_wxEvent_OnPaint)
EVT_TOOL(wxID_TOOLBAR_QUICKSHOTS, LCDFrame::_wxEvent_OnScreenshots)
EVT_TOOL(wxID_TOOLBAR_COPY, LCDFrame::_wxEvent_OnToolCopy)
EVT_TOOL(wxID_TOOLBAR_SCREENSHOTS_FOLDER, LCDFrame::_wxEvent_OnOpenScreenshotsFolder)
EVT_TOOL(wxID_TOOLBAR_EXIT, LCDFrame::_wxEvent_OnExit)
EVT_TIMER(WXID_MILLISECOND_TIMER, LCDFrame::_wxEvent_OnTimerEvent)
EVT_TIMER(WXID_RTC_TIMER , LCDFrame::_wxEvent_OnRTCUpdate)
BEGIN_EVENT_TABLE(LCDFrame,wxFrame)
EVT_CLOSE (LCDFrame::_wxEvent_OnClose)
EVT_KEY_DOWN (LCDFrame::_wxEvent_OnKeyDown)
EVT_PAINT (LCDFrame::_wxEvent_OnPaint)
EVT_TOOL (wxID_TOOLBAR_QUICKSHOTS, LCDFrame::_wxEvent_OnScreenshots)
EVT_TOOL (wxID_TOOLBAR_COPY, LCDFrame::_wxEvent_OnToolCopy)
EVT_TOOL (wxID_TOOLBAR_SCREENSHOTS_FOLDER, LCDFrame::_wxEvent_OnOpenScreenshotsFolder)
EVT_TOOL (wxID_TOOLBAR_EXIT, LCDFrame::_wxEvent_OnExit)
EVT_TIMER (WXID_MILLISECOND_TIMER, LCDFrame::OnTimerEvent)
EVT_TIMER (WXID_RTC_TIMER, LCDFrame::OnRTCUpdate)
EVT_SDK_INIT (LCDFrame::OnSDKInitialize)
EVT_SDK_TIMER_SET (LCDFrame::OnSDKTimerSet)
EVT_SDK_RTC_EN (LCDFrame::OnRTCTimerEnabled)
END_EVENT_TABLE()
//=======================================================================//
//= Function define. =//
//=======================================================================//
//=======================================================================//
/*************************************************************************/
/** Function Name: LCDFrame **/
/** Purpose: Constructor of main frame object. **/
/** Params: **/
/** @ pclsParent[in]: Parent object pointer. **/
/** @ pclsParent[in]: Parent object pointer. **/
/** @ iID[in]: Frame object ID. **/
/** @ strTitle[in]: Frame window title. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
LCDFrame::LCDFrame(wxWindow* pclsParent, wxWindowID iID, const wxString& strTitle) :
wxFrame(pclsParent, iID, strTitle, wxDefaultPosition, wxDefaultSize, wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
LCDFrame::LCDFrame(wxWindow* pclsParent, wxWindowID iID, const wxString& strTitle)
: wxFrame(pclsParent, iID, strTitle, wxDefaultPosition, wxDefaultSize, wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
, wxThreadHelper(wxTHREAD_JOINABLE)
{
SetEvtHandlerEnabled(false);
SetSizeHints( wxDefaultSize, wxDefaultSize );
// Set frame icon.
SetIcon(wxIcon(_T("ID_ICON_MAIN"), wxBITMAP_TYPE_ICO_RESOURCE));
// Create tools bar and tool button.
_createToolbar();
// Create status bar.
m_pclsCtrlStatusBar = CreateStatusBar(1, wxST_SIZEGRIP, wxID_STATUSBAR);
_createToolbar();
// Create status bar.
m_pclsCtrlStatusBar = CreateStatusBar(1, wxST_SIZEGRIP, wxID_STATUSBAR);
// Create LCD screen panel.
m_pclsCtrlPaintPanel = new wxLCD(this, wxID_PANEL);
m_pclsCtrlPaintPanel->SetParameter(&g_stParameters);
SetClientSize(m_pclsCtrlPaintPanel->GetBestSize());
m_pclsCtrlPaintPanel = new wxLCD(this, wxID_PANEL);
// Set frame object position on monitor.
Centre( wxBOTH );
// Update frame object UI.
UpdateWindowUI();
Centre( wxBOTH );
// Update frame object UI.
UpdateWindowUI();
// Set status bar text.
_setStatusText(_TRANS_TEXT("Preparing..."));
if(false == wxDirExists(SCREENSHOTS_FOLDER))
{
wxMkdir(SCREENSHOTS_FOLDER);
}
this->SetFocus();
}
}
/*************************************************************************/
/** Function Name: ~LCDFrame **/
/** Purpose: Destructor of main frame object. **/
@ -83,15 +88,15 @@ wxFrame(pclsParent, iID, strTitle, wxDefaultPosition, wxDefaultSize, wxSYSTEM_ME
/** Notice: None. **/
/*************************************************************************/
LCDFrame::~LCDFrame()
{
/*----------------------------------*/
/* Process */
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
delete m_pclsCtrlStatusBar;
delete m_pclsCtrlToolBar;
delete m_pclsCtrlToolBar;
delete m_pclsCtrlPaintPanel;
}
/*************************************************************************/
/** Function Name: _setStatusText **/
/** Purpose: Set frame status bar text. **/
@ -101,142 +106,119 @@ LCDFrame::~LCDFrame()
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::_setStatusText(const wxString& strString)
{
/*----------------------------------*/
/* Process */
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
m_pclsCtrlStatusBar->SetStatusText(strString, 0);
}
}
/*************************************************************************/
/** Function Name: _createToolbar **/
/** Purpose: Create main frame tool bar. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::_createToolbar(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
wxToolBar* pclsNewToolBar;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsNewToolBar = NULL;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Create tools bar.
pclsNewToolBar = CreateToolBar(wxTB_HORIZONTAL, wxID_TOOLBAR);
if(NULL != pclsNewToolBar)
{
// Screen shot button.
pclsNewToolBar->AddTool(wxID_TOOLBAR_QUICKSHOTS, _TRANS_TEXT("Quick Shot"),
wxBitmap(_T("ID_TOOL_QUICKSHOTS"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_QUICKSHOTS"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Quick Shot"),
_TRANS_TEXT("Quick save screen shot to file."));
pclsNewToolBar->AddTool(wxID_TOOLBAR_COPY, _TRANS_TEXT("Copy Screen Image"),
wxBitmap(_T("ID_TOOL_COPYSCREENSHOT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_COPYSCREENSHOT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Copy Screen Image"),
_TRANS_TEXT("Copy screenshots picture to clipboard."));
pclsNewToolBar->AddTool(wxID_TOOLBAR_SCREENSHOTS_FOLDER, _TRANS_TEXT("Open Screenshots Folder"),
wxBitmap(_T("ID_TOOL_OPENSCREENSHOTSFOLDER"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_OPENSCREENSHOTSFOLDER"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Open Screenshots Folder"),
/*************************************************************************/
void LCDFrame::_createToolbar(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
wxToolBar* pclsNewToolBar;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsNewToolBar = NULL;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Create tools bar.
pclsNewToolBar = CreateToolBar(wxTB_HORIZONTAL, wxID_TOOLBAR);
if(NULL != pclsNewToolBar)
{
// Screen shot button.
pclsNewToolBar->AddTool(wxID_TOOLBAR_QUICKSHOTS, _TRANS_TEXT("Quick Shot"),
wxBitmap(_T("ID_TOOL_QUICKSHOTS"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_QUICKSHOTS"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Quick Shot"),
_TRANS_TEXT("Quick save screen shot to file."));
pclsNewToolBar->AddTool(wxID_TOOLBAR_COPY, _TRANS_TEXT("Copy Screen Image"),
wxBitmap(_T("ID_TOOL_COPYSCREENSHOT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_COPYSCREENSHOT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Copy Screen Image"),
_TRANS_TEXT("Copy screenshots picture to clipboard."));
pclsNewToolBar->AddTool(wxID_TOOLBAR_SCREENSHOTS_FOLDER, _TRANS_TEXT("Open Screenshots Folder"),
wxBitmap(_T("ID_TOOL_OPENSCREENSHOTSFOLDER"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_OPENSCREENSHOTSFOLDER"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Open Screenshots Folder"),
_TRANS_TEXT("Open screenshots saved folder."));
// Add a separator.
pclsNewToolBar->AddSeparator();
pclsNewToolBar->AddTool(wxID_TOOLBAR_EXIT, _TRANS_TEXT("Exit"),
wxBitmap(_T("ID_TOOL_EXIT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_EXIT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Exit(Alt+F4)"),
_TRANS_TEXT("Exit."));
pclsNewToolBar->Realize();
pclsNewToolBar->AddTool(wxID_TOOLBAR_EXIT, _TRANS_TEXT("Exit"),
wxBitmap(_T("ID_TOOL_EXIT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxBitmap(_T("ID_TOOL_EXIT"), wxBITMAP_TYPE_PNG_RESOURCE),
wxITEM_NORMAL,
_TRANS_TEXT("Exit(Alt+F4)"),
_TRANS_TEXT("Exit."));
pclsNewToolBar->Realize();
}
m_pclsCtrlToolBar = pclsNewToolBar;
}
/*************************************************************************/
/** Function Name: _initializeTimer **/
/** Purpose: Create and initialize interrupt timer and RTC timer.**/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::_initializeTimer(void)
{
m_pclsMilliSecondTimer = new wxTimer(this, WXID_MILLISECOND_TIMER);
m_pclsRTCTimer = new wxTimer(this, WXID_RTC_TIMER);
m_pclsCtrlToolBar = pclsNewToolBar;
}
/*************************************************************************/
/** Function Name: _startTimer **/
/** Purpose: Create and initialize interrupt timer and RTC timer.**/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::_startTimer(int32_t iMilliSecondTimerInterval)
{
if(NULL != m_pclsMilliSecondTimer)
{
if(0 < iMilliSecondTimerInterval)
{
m_pclsMilliSecondTimer->Start(iMilliSecondTimerInterval);
}
}
if(NULL != m_pclsRTCTimer)
{
m_pclsRTCTimer->Start(1000);
}
}
/*************************************************************************/
/** Function Name: OnKeyDown **/
/** Purpose: Key press event process. **/
/** Params: **/
/** @ clsEventObject[in]: Event data object. **/
/** @ clsEvent[in]: Event data object. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::OnKeyDown(wxKeyEvent& clsEventObject)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
int iKeyCode;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
iKeyCode = clsEventObject.GetKeyCode();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
//wxMessageBox(wxString::Format("Key value: %d.", iKeyCode));
UAIF_OnKeyPress(clsEventObject.ShiftDown(), clsEventObject.ControlDown(), clsEventObject.AltDown(), iKeyCode);
clsEventObject.Skip();
void LCDFrame::OnKeyDown(wxKeyEvent& clsEvent)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
unsigned int uiKeyCode;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
uiKeyCode = clsEvent.GetKeyCode();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Union option key value to key code.
if(true == clsEvent.ShiftDown())
{
uiKeyCode |= KEY_OPTION_SHIFT;
}
if(true == clsEvent.AltDown())
{
uiKeyCode |= KEY_OPTION_ALT;
}
if(true == clsEvent.ControlDown())
{
uiKeyCode |= KEY_OPTION_CTRL;
}
// Set key code and sync flag.
SGUI_SDK_SyncKeyEventData(uiKeyCode);
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_KEY_EVENT, true);
clsEvent.Skip();
}
/*************************************************************************/
/** Function Name: Copy **/
/** Purpose: Copy screen image to clipboard. **/
@ -245,27 +227,27 @@ void LCDFrame::OnKeyDown(wxKeyEvent& clsEventObject)
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::Copy(void)
{
/*----------------------------------*/
/* Variable Declaration */
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
bool bResult;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
bool bResult;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
bResult = m_pclsCtrlPaintPanel->CopyScreenImageToClipBoard();
if(true == bResult)
{
_setStatusText(_T("Copied to clipboard."));
_setStatusText(_TRANS_TEXT("Copied to clipboard."));
}
else
{
_setStatusText(_T("Copy failed."));
}
_setStatusText(_TRANS_TEXT("Copy failed."));
}
}
/*************************************************************************/
/** Function Name: Screenshots **/
/** Purpose: Save now time screen image to a bit map file. **/
@ -274,70 +256,36 @@ void LCDFrame::Copy(void)
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::Screenshots(void)
{
/*----------------------------------*/
/* Variable Declaration */
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
uint32_t uiFileCounter;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
uiFileCounter = 1;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
uint32_t uiFileCounter;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
uiFileCounter = 1;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Check image file existed and
while(true == wxFileExists(SCREENSHOTS_FILE_FULLNAME(uiFileCounter)))
{
uiFileCounter++;
}
}
// Try to save image file.
if(true == m_pclsCtrlPaintPanel->SaveScreenImageToFile(SCREENSHOTS_FILE_FULLNAME(uiFileCounter)))
{
_setStatusText(wxString::Format("Save screen to %s.", SCREENSHOTS_FILE_NAME(uiFileCounter)));
_setStatusText(wxString::Format(_TRANS_TEXT("Save screen to %s."), SCREENSHOTS_FILE_NAME(uiFileCounter)));
}
else
{
_setStatusText(_T("Save screen failed."));
_setStatusText(_TRANS_TEXT("Save screen failed."));
}
}
/*************************************************************************/
/** Function Name: OnUpdateUI **/
/** Purpose: Update UI event process. **/
/** Params: **/
/** @ clsEventObject[in]: Event data object. **/
/** Return: None. **/
/** Notice: This function process used initialize pixel panel **/
/** display when UI is ready. **/
/*************************************************************************/
void LCDFrame::OnUpdateUI(wxUpdateUIEvent& clsEventObject)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
static bool bInitialized = false;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(false == bInitialized)
{
// Initialize display.
m_pclsCtrlPaintPanel->CleanScreen();
_setStatusText(_T("Initialzied."));
bInitialized = true;
_initializeTimer();
_startTimer(50);
UAIF_OnInitialize();
m_pclsCtrlPaintPanel->RefreshDisplay();
}
}
/*************************************************************************/
/** Function Name: OnPaint **/
/** Purpose: Paint or repaint UI event process. **/
@ -347,13 +295,13 @@ void LCDFrame::OnUpdateUI(wxUpdateUIEvent& clsEventObject)
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::OnPaint(wxPaintEvent &clsEventObject)
{
/*----------------------------------*/
/* Process */
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
m_pclsCtrlPaintPanel->RefreshDisplay();
}
/*************************************************************************/
/** Function Name: OpenScreenshotsFolder **/
/** Purpose: Open screen shots image file folder. **/
@ -362,151 +310,357 @@ void LCDFrame::OnPaint(wxPaintEvent &clsEventObject)
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::OpenScreenshotsFolder(void)
{
/*----------------------------------*/
/* Process */
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
wxExecute(wxString::Format(_T("explorer %s\\%s"), wxGetCwd(), _T(SCREENSHOTS_FOLDER_T)));
}
wxExecute(wxString::Format(_TRANS_TEXT("explorer %s\\%s"), wxGetCwd(), _T(SCREENSHOTS_FOLDER_T)));
}
/*************************************************************************/
/** Function Name: OnClose **/
/** Purpose: Called when frame close and object destroyed. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::OnClose(void)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != m_pclsMilliSecondTimer)
{
m_pclsMilliSecondTimer->Stop();
delete m_pclsMilliSecondTimer;
}
if(NULL != m_pclsRTCTimer)
{
m_pclsRTCTimer->Stop();
delete m_pclsRTCTimer;
}
Destroy();
/*************************************************************************/
void LCDFrame::OnClose(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
wxThread* pclsThread;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != m_pclsMilliSecondTimer)
{
m_pclsMilliSecondTimer->Stop();
delete m_pclsMilliSecondTimer;
}
if(NULL != m_pclsRTCTimer)
{
m_pclsRTCTimer->Stop();
delete m_pclsRTCTimer;
}
// Stop thread helper.
pclsThread = GetThread();
if(NULL != pclsThread)
{
pclsThread->Kill();
if(true == pclsThread->IsRunning())
{
pclsThread->Wait(wxTHREAD_WAIT_DEFAULT);
}
}
Destroy();
}
/*************************************************************************/
/** Function Name: RefreshLCD **/
/** Purpose: Refresh screen display by pixel color data. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::RefreshLCD(void)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
m_pclsCtrlPaintPanel->RefreshDisplay();
}
/*************************************************************************/
void LCDFrame::RefreshLCD(void)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
m_pclsCtrlPaintPanel->RefreshDisplay();
}
/*************************************************************************/
/** Function Name: ClearLCD **/
/** Purpose: Clear screen display. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::ClearLCD(void)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
m_pclsCtrlPaintPanel->CleanScreen();
}
/*************************************************************************/
/** Function Name: Initialize **/
/** Purpose: Create a main frame object. **/
/** Params: **/
/** @ pclsParent[in]: Parent object pointer. **/
/** @ iID[in]: Frame object ID. **/
/** @ strTitle[in]: Frame window title. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void LCDFrame::Initialize(wxWindow* pclsParent, wxWindowID iID, const wxString& strTitle)
{
m_pclsInstance = new LCDFrame(pclsParent, iID, strTitle);
}
void LCDFrame::ClearLCD(void)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
m_pclsCtrlPaintPanel->CleanScreen();
}
/*************************************************************************/
/** Function Name: OnThreadEnd **/
/** Function Name: GetInstance **/
/** Purpose: Thread end event process. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
LCDFrame* LCDFrame::GetInstance(void)
{
return m_pclsInstance;
}
/*************************************************************************/
LCDFrame* LCDFrame::GetInstance(void)
{
if(NULL == m_pclsInstance)
{
m_pclsInstance = new LCDFrame(NULL, wxID_MAIN, FRAME_TITLE);
}
return m_pclsInstance;
}
/*************************************************************************/
/** Function Name: SetLCDPixel **/
/** Purpose: Set a pixel value. **/
/** Params: **/
/** @ uiPosX[in]: X-Coordinate of pixel. **/
/** @ uiPosX[in]: X-Coordinate of pixel. **/
/** @ uiPosY[in]: Y-Coordinate of pixel. **/
/** @ strTitle[in]: Pixel value, 0 for clear, 1 for set. **/
/** Return: None. **/
/** Notice: This function only change the pixel register, To **/
/** update the screen display, need to call RefreshLCD **/
/** Notice: This function only change the pixel register, To **/
/** update the screen display, need to call RefreshLCD **/
/** function or Or use the DrawPixel function directly. **/
/*************************************************************************/
void LCDFrame::SetLCDPixel(uint32_t uiPosX, uint32_t uiPosY, uint32_t uiPixelValue)
{
m_pclsCtrlPaintPanel->SetPixel(uiPosX, uiPosY, uiPixelValue);
}
uint32_t LCDFrame::GetLCDPixel(uint32_t uiPosX, uint32_t uiPosY)
{
uint32_t uiPixelValue;
uiPixelValue = (uint32_t)m_pclsCtrlPaintPanel->GetPixel(uiPosX, uiPosY);
return uiPixelValue;
}
void LCDFrame::OnTimerEvent(wxTimerEvent& event)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
static bool bInitialized = false;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(false == bInitialized)
{
// Initialize HMI engine.
bInitialized = true;
UAIF_OnInitialize();
m_pclsCtrlPaintPanel->RefreshDisplay();
}
else
{
UAIF_OnTimerEventProcess();
}
}
void LCDFrame::OnRTCUpdate(wxTimerEvent& event)
{
wxDateTime clsTime = wxDateTime::Now();
UAIF_OnRTCUpdateEventProcess( clsTime.GetYear(),
clsTime.GetMonth()+1,
clsTime.GetDay(),
clsTime.GetHour(),
clsTime.GetMinute(),
clsTime.GetSecond());
}
/*************************************************************************/
void LCDFrame::SetLCDPixel(uint32_t uiPosX, uint32_t uiPosY, uint32_t uiPixelValue)
{
m_pclsCtrlPaintPanel->SetPixel(uiPosX, uiPosY, uiPixelValue);
}
/*************************************************************************/
/** Function Name: GetLCDPixel **/
/** Purpose: Get a pixel value. **/
/** Params: **/
/** @ uiPosX[in]: X-Coordinate of pixel. **/
/** @ uiPosY[in]: Y-Coordinate of pixel. **/
/** Return: None. **/
/** Notice: The value is got form the display buffer. **/
/*************************************************************************/
uint32_t LCDFrame::GetLCDPixel(uint32_t uiPosX, uint32_t uiPosY)
{
uint32_t uiPixelValue;
uiPixelValue = (uint32_t)m_pclsCtrlPaintPanel->GetPixel(uiPosX, uiPosY);
return uiPixelValue;
}
/*************************************************************************/
/** Function Name: OnTimerEvent **/
/** Purpose: Dummy heart-bear timer event process. **/
/** Params: **/
/** @ clsEvent[in]: Event data object. **/
/** Return: None. **/
/** Notice: Target for drive dummy actions. **/
/*************************************************************************/
void LCDFrame::OnTimerEvent(wxTimerEvent& event)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_TIM_EVENT, true);
}
/*************************************************************************/
/** Function Name: OnRTCUpdate **/
/** Purpose: RTC timer event process. **/
/** Params: **/
/** @ clsEvent[in]: Event data object. **/
/** Return: None. **/
/** Notice: Target per-second for get now time. **/
/*************************************************************************/
void LCDFrame::OnRTCUpdate(wxTimerEvent& event)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_RTC_EVENT, true);
}
/*************************************************************************/
/** Function Name: OnSDKInitialize **/
/** Purpose: Frame show event process. **/
/** Params: **/
/** @ clsEvent[in]: Event data object. **/
/** Return: None. **/
/** Notice: Do environment initialize process when main window **/
/** show up. **/
/*************************************************************************/
void LCDFrame::OnSDKInitialize(InitEvent& clsEvent)
{
// Initialize LCD panel display.
{
// Set LCD panel parameter.
m_pclsCtrlPaintPanel->SetParameter(&g_stParameters);
// Resize frame.
SetClientSize(m_pclsCtrlPaintPanel->GetBestSize());
// Clear display panel.
m_pclsCtrlPaintPanel->CleanScreen();
}
Layout();
// Create timer objects.
m_pclsMilliSecondTimer = new wxTimer(this, WXID_MILLISECOND_TIMER);
m_pclsRTCTimer = new wxTimer(this, WXID_RTC_TIMER);
// Set event process flag.
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_INIT, true);
// Set status bar text.
_setStatusText(_TRANS_TEXT("Initialized."));
clsEvent.Skip();
}
void LCDFrame::OnSDKTimerSet(TimerSetEvent& clsEvent)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
int iTimerInterval;
bool bReturn;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bReturn = true;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
iTimerInterval = clsEvent.GetInterval();
if(NULL != m_pclsMilliSecondTimer)
{
if(iTimerInterval > 0)
{
// Timer started.
bReturn = m_pclsMilliSecondTimer->Start(iTimerInterval);
}
else
{
m_pclsMilliSecondTimer->Stop();
}
// Set event process flag when timer start successfully or stopped.
if(true == bReturn)
{
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_TIM_SET, true);
}
}
}
void LCDFrame::OnRTCTimerEnabled(RTCSwitchEvent& clsEvent)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
bool bRTCEnabled;
bool bReturn;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bReturn = true;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bRTCEnabled = clsEvent.GetReqState();
if(NULL != m_pclsRTCTimer)
{
if(false == bRTCEnabled)
{
m_pclsRTCTimer->Stop();
}
else
{
bReturn = m_pclsRTCTimer->Start(1000);
}
// Set event process flag when timer start successfully or stopped.
if(true == bReturn)
{
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_RTC_EN, true);
}
}
}
/*************************************************************************/
/** Function Name: Entry **/
/** Purpose: Thread helper main process. **/
/** Params: None. **/
/** Return: wxThread::ExitCode type, 0 for normal, others for **/
/** failed. **/
/** Notice: This is joinable thread body process, dummy main **/
/** process function will be called here. **/
/*************************************************************************/
wxThread::ExitCode LCDFrame::Entry(void)
{
wxThread::ExitCode lExitCode;
wxThread* pclsThread;
bool bExit;
pclsThread = GetThread();
if(NULL != pclsThread)
{
bExit = false;
// Wait for frame UI update done.
wxMilliSleep(DUMMY_MAIN_START_DELAY_MS);
// Enable event receive.
SetEvtHandlerEnabled(true);
// Start dummy main process.
while(false == bExit)
{
bExit = pclsThread->TestDestroy();
lExitCode = (wxThread::ExitCode)SGUI_SDK_DummyMainProc();
}
}
lExitCode = 0;
return lExitCode;
}
/*************************************************************************/
/** Function Name: StartDummyMain **/
/** Purpose: Create and start dummy main thread. **/
/** Params: None. **/
/** Return: true: start successfully. **/
/** false: create or start thread failed. **/
/** Notice: This is joinable thread body process, dummy main **/
/** None. **/
/*************************************************************************/
bool LCDFrame::StartDummyMain(void)
{
bool bReturn;
wxThread* pclsThread;
wxThreadError eThreadError;
bReturn = true;
do
{
// Create thread;
eThreadError = CreateThread(wxTHREAD_JOINABLE);
if(wxTHREAD_NO_ERROR != eThreadError)
{
bReturn = false;
break;
}
// Start thread.
pclsThread = GetThread();
if(NULL != pclsThread)
{
eThreadError = pclsThread->Run();
if(wxTHREAD_NO_ERROR != eThreadError)
{
bReturn = false;
break;
}
}
else
{
bReturn = false;
break;
}
}while(0);
return bReturn;
}

View File

@ -1,15 +1,16 @@
#ifndef __INCLUDE_VIRTUAL_DEVICE_INTERFACE_H__
#define __INCLUDE_VIRTUAL_DEVICE_INTERFACE_H__
#ifndef __INCLUDE_SDK_INTERFACE__
#define __INCLUDE_SDK_INTERFACE__
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <stdint.h>
#include <Common.h>
//=======================================================================//
#include <stdint.h>
#include <stdbool.h>
//=======================================================================//
//= User definition. =//
//=======================================================================//
// Key value definition.
#define KEY_VALUE_NONE (0x0000)
#define KEY_VALUE_TAB (0x0009)
#define KEY_VALUE_ENTER (0x000D)
#define KEY_VALUE_ESC (0x001B)
@ -32,29 +33,50 @@
#define KEY_VALUE_F12 (0x015F)
#define KEY_VALUE_ENTER_PAD (0x0172)
// User option flag value define
#define KEY_OPTION_NONE (0x0000)
#define KEY_OPTION_CTRL (0x0001)
#define KEY_OPTION_ALT (0x0002)
#define KEY_OPTION_SHIFT (0x0004)
#define KEY_OPTION_CTRL (0x1000)
#define KEY_OPTION_ALT (0x2000)
#define KEY_OPTION_SHIFT (0x4000)
#define KEY_CODE_VALUE(CODE) (CODE & 0x0FFF)
#define KEY_CODE_OPT(CODE) (CODE & 0xF000)
//=======================================================================//
//= Data type definition. =//
//=======================================================================//
typedef enum
{
ENV_FLAG_IDX_SDK_INIT = 0,
ENV_FLAG_IDX_SDK_RTC_EN,
ENV_FLAG_IDX_SDK_RTC_EVENT,
ENV_FLAG_IDX_SDK_TIM_SET,
ENV_FLAG_IDX_SDK_TIM_EVENT,
ENV_FLAG_IDX_SDK_KEY_EVENT,
ENV_FLAG_IDX_MAX,
} ENV_FLAG_INDEX;
#define KEY_PRESS_EVENT_VALUE_MAX (4)
//=======================================================================//
//= Public function declaration. =//
//=======================================================================//
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void VDIF_SetPixel(int uiPosX, int uiPosY, int uiPixelValue);
int VDIF_GetPixel(int uiPosX, int uiPosY);
void VDIF_RefreshDisplay(void);
void VDIF_ClearDisplay(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // __INCLUDE_VIRTUAL_DEVICE_INTERFACE_H__
//=======================================================================//
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_INDEX eIndex, bool bValue);
void SGUI_SDK_SyncKeyEventData(unsigned int uiKeyCode);
bool SGUI_SDK_GetEventSyncFlag(ENV_FLAG_INDEX eIndex);
bool SGUI_SDK_Initialize(void);
bool SGUI_SDK_ConfigHearBeatTimer(unsigned int uiIntervalMs);
bool SGUI_SDK_EnableRTCInterrupt(bool bEnabled);
int SGUI_SDK_DummyMainProc(void);
void SGUI_SDK_KeyPressInterruptEvent(unsigned int uiKeyCode);
void SGUI_SDK_HeartBeatTimerTagEvent(void);
void SGUI_SDK_RTCInterruptTagEvent(void);
void SGUI_SDK_SetPixel(int uiPosX, int uiPosY, int uiPixelValue);
int SGUI_SDK_GetPixel(int uiPosX, int uiPosY);
void SGUI_SDK_RefreshDisplay(void);
void SGUI_SDK_ClearDisplay(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // __INCLUDE_USER_ACTION_INTERFACE__

View File

@ -0,0 +1,554 @@
/*************************************************************************/
/** Copyright. **/
/** FileName: SDKInterface.cpp **/
/** Author: Polarix **/
/** Description: SDK swap interface function defines. **/
/*************************************************************************/
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include <wx/msgdlg.h>
#include "SDKInterface.h"
#include "LCDFrame.h"
#include "DemoProc.h"
//=======================================================================//
//= User definition. =//
//=======================================================================//
//#define SDK_THREAD_LOCK() wxCriticalSectionLocker clsCSLock(s_clsEventSyncCS)
#define EventSyncLock() {s_clsEventSyncCS.Enter();}
#define EventSyncUnlock() {s_clsEventSyncCS.Leave();}
#define SDK_DEFAULT_HEART_BEAT_INTERVAL_MS (50)
#define SDK_EVENT_SYNC_TIMEOUT_MS (500)
//=======================================================================//
//= Static function declaration. =//
//=======================================================================//
static void SGUI_SDK_PrepareSDK(void);
static bool SGUI_SDK_SyncMainFrameEvent(wxEvent& clsEvent, ENV_FLAG_INDEX eSyncFlag, int iTimeOutMs);
//=======================================================================//
//= Data type definition. =//
//=======================================================================//
static bool s_barrEventFlag[ENV_FLAG_IDX_MAX];
static unsigned int s_uiKeyCode;
static wxCriticalSection s_clsEventSyncCS;
//=======================================================================//
//= Function define. =//
//=======================================================================//
/*************************************************************************/
/** Function Name: USR_ACT_OnKeyPress **/
/** Purpose: Recive and process key press event. **/
/** Resources: None. **/
/** Params: **/
/** @ uiKeyCode: Key code. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void SGUI_SDK_KeyPressInterruptEvent(unsigned int uiKeyCode)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
SGUI_UINT16 uiEventKeyCode;
HMI_EVENT stEvent;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
uiEventKeyCode = uiKeyCode;
stEvent.Action = HMI_ENGINE_ACTION_KEY_PRESS;
stEvent.Data = (SGUI_BYTE*)&uiEventKeyCode;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Call demo process.
EventProcess(HMI_ENGINE_EVENT_ACTION, &stEvent);
SGUI_SDK_RefreshDisplay();
}
void SGUI_SDK_HeartBeatTimerTagEvent(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
HMI_EVENT stEvent;
SGUI_INT iRandomNumber;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
stEvent.Action = HMI_ENGINE_ACTION_ON_TIMER;
stEvent.Data = NULL;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
iRandomNumber = rand();
iRandomNumber = (iRandomNumber % 200)-100;
stEvent.Data = (SGUI_BYTE*)(&iRandomNumber);
// Post timer event.
EventProcess(HMI_ENGINE_EVENT_ACTION, &stEvent);
SGUI_SDK_RefreshDisplay();
}
void SGUI_SDK_RTCInterruptTagEvent(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
HMI_EVENT stEvent;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
stEvent.Action = HMI_ENGINE_ACTION_ON_TIMER_RTC;
stEvent.Data = NULL;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Post RTC update message to a screen.
EventProcess(HMI_ENGINE_EVENT_ACTION, &stEvent);
SGUI_SDK_RefreshDisplay();
}
/*************************************************************************/
/** Function Name: VDIF_SetPixel **/
/** Purpose: Set virtual device pixel register data. **/
/** Params: **/
/** @ iPosX[in]: Pixel x-coordinate on display panel. **/
/** @ iPosY[in]: Pixel y-coordinate on display panel. **/
/** @ iPixelValue[out]: Pixel value, 0 for clear, 1 for set. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void SGUI_SDK_SetPixel(int iPosX, int iPosY, int iPixelValue)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
pclsMainFrameObjectPtr->SetLCDPixel(iPosX, iPosY, iPixelValue);
}
}
/*************************************************************************/
/** Function Name: VDIF_GetPixel **/
/** Purpose: Get a pixel value form virtual device register. **/
/** Params: **/
/** @ iPosX[in]: Pixel x-coordinate on display panel. **/
/** @ iPosY[in]: Pixel y-coordinate on display panel. **/
/** Return: Pixel state, 0 for cleared, 1 for set. **/
/** Notice: None. **/
/*************************************************************************/
int SGUI_SDK_GetPixel(int iPosX, int iPosY)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
int iPixelValue;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
iPixelValue = pclsMainFrameObjectPtr->GetLCDPixel(iPosX, iPosY);
}
else
{
iPixelValue = 0;
}
return iPixelValue;
}
/*************************************************************************/
/** Function Name: VDIF_RefreshDisplay. **/
/** Purpose: Refresh virtual device display. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void SGUI_SDK_RefreshDisplay(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
pclsMainFrameObjectPtr->RefreshLCD();
}
}
/*************************************************************************/
/** Function Name: VDIF_ClearDisplay. **/
/** Purpose: Clear screen display. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: None. **/
/*************************************************************************/
void SGUI_SDK_ClearDisplay(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
/*----------------------------------*/
/* Process */
/*----------------------------------*/
if(NULL != pclsMainFrameObjectPtr)
{
pclsMainFrameObjectPtr->ClearLCD();
pclsMainFrameObjectPtr->RefreshLCD();
}
}
void EnterCriticalSection(void)
{
s_clsEventSyncCS.Enter();
}
void LeaveCriticalSection(void)
{
s_clsEventSyncCS.Leave();
}
bool SGUI_SDK_SyncMainFrameEvent(wxEvent& clsEvent, ENV_FLAG_INDEX eSyncFlag, int iTimeOutMs)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
LCDFrame* pclsMainFrameObjectPtr;
TimerSetEvent clsEventObject;
bool bReturn;
int iWaitTimeMs;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
pclsMainFrameObjectPtr = LCDFrame::GetInstance();
bReturn = false;
iWaitTimeMs = iTimeOutMs;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
do
{
if(NULL == pclsMainFrameObjectPtr)
{
// No main frame instance.
break;
}
// Set window ID.
clsEvent.SetId(pclsMainFrameObjectPtr->GetId());
// Post event.
SGUI_SDK_SetEvnetSyncFlag(eSyncFlag, false);
wxPostEvent(pclsMainFrameObjectPtr, clsEvent);
// Wait for sync
if(iWaitTimeMs < 1)
{
// No wait, return immediately.
bReturn = true;
SGUI_SDK_SetEvnetSyncFlag(eSyncFlag, true);
break;
}
else
{
while(iWaitTimeMs--)
{
if(true == SGUI_SDK_GetEventSyncFlag(eSyncFlag))
{
// Sync done
bReturn = true;
break;
}
wxMilliSleep(1);
}
}
}
while(0);
return bReturn;
}
void SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_INDEX eIndex, bool bValue)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
EventSyncLock();
s_barrEventFlag[eIndex] = bValue;
EventSyncUnlock();
}
/*************************************************************************/
/** Function Name: SetKeyEventData. **/
/** Purpose: Set key code value when key press event targets. **/
/** Params: **/
/** @ uiKeyCode[in]: Key code. **/
/** Return: None. **/
/** Notice: This function used to save and keep pressed key **/
/** code value, must be called before SetEvnetFlag. **/
/*************************************************************************/
void SGUI_SDK_SyncKeyEventData(unsigned int uiKeyCode)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
EventSyncLock();
s_uiKeyCode = uiKeyCode;
EventSyncUnlock();
}
/*************************************************************************/
/** Function Name: GetEventFlag. **/
/** Purpose: Post SDK heart-beat timer set event to main frame. **/
/** Params: **/
/** @ uiIntervalMs[in]: Timer interval in ms, 0 to stop timer. **/
/** Return: **/
/** @ true: Post message and wait sync successfully. **/
/** @ false: Post message failed or wait for sync timeout. **/
/** Notice: This function will start a timer for demo process, **/
/** like screen auto scroll animation or dummy data **/
/** input. **/
/*************************************************************************/
bool SGUI_SDK_GetEventSyncFlag(ENV_FLAG_INDEX eIndex)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
bool bReturn;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
EventSyncLock();
bReturn = s_barrEventFlag[eIndex];
EventSyncUnlock();
return bReturn;
}
/*************************************************************************/
/** Function Name: SetSDKHeartBeatTimer. **/
/** Purpose: Post SDK heart-beat timer set event to main frame. **/
/** Params: **/
/** @ uiIntervalMs[in]: Timer interval in ms, 0 to stop timer. **/
/** Return: **/
/** @ true: Post message and wait sync successfully. **/
/** @ false: Post message failed or wait for sync timeout. **/
/** Notice: This function will start a timer for demo process, **/
/** like screen auto scroll animation or dummy data **/
/** input, the recommended setting is 20(ms) or more. **/
/*************************************************************************/
bool SGUI_SDK_ConfigHearBeatTimer(unsigned int uiIntervalMs)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
TimerSetEvent clsEventObject;
bool bReturn;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bReturn = false;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Prepare event object.
clsEventObject.SetEventType(wxEVT_TIMER_SET);
clsEventObject.SetInterval(uiIntervalMs);
// Post event.
bReturn = SGUI_SDK_SyncMainFrameEvent(clsEventObject, ENV_FLAG_IDX_SDK_TIM_SET, SDK_EVENT_SYNC_TIMEOUT_MS);
return bReturn;
}
/*************************************************************************/
/** Function Name: SetRTCTimer. **/
/** Purpose: Post RTC timer set event to main frame. **/
/** Params: **/
/** @ bEnabled[in]: RTC timer enable. **/
/** Return: **/
/** @ true: Post message and wait sync successfully. **/
/** @ false: Post message failed or wait for sync timeout. **/
/** Notice: This function will start RTC for demo process, like **/
/** screen auto scroll animation or dummy data input. **/
/*************************************************************************/
bool SGUI_SDK_EnableRTCInterrupt(bool bEnabled)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
RTCSwitchEvent clsEventObject;
bool bReturn;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bReturn = false;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Prepare event object.
clsEventObject.SetEventType(wxEVT_RTC_SWITCH);
clsEventObject.SetReqState(bEnabled);
// Post event.
bReturn = SGUI_SDK_SyncMainFrameEvent(clsEventObject, ENV_FLAG_IDX_SDK_RTC_EN, SDK_EVENT_SYNC_TIMEOUT_MS);
return bReturn;
}
/*************************************************************************/
/** Function Name: PrepareSDK. **/
/** Purpose: Initialize global variable of SDK. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: This function must only called when dummy main **/
/** starting. **/
/*************************************************************************/
void SGUI_SDK_PrepareSDK(void)
{
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Initialize event sync flag
for(unsigned int i=0; i<ENV_FLAG_IDX_MAX; i++)
{
s_barrEventFlag[i] = false;
}
// Initialize key coed variable.
s_uiKeyCode = KEY_VALUE_NONE;
}
/*************************************************************************/
/** Function Name: InitializeSDK. **/
/** Purpose: Post initialize event and wait for event sync. **/
/** Params: None. **/
/** Return: None. **/
/** Notice: Post event to main frame for initialize SDK. **/
/*************************************************************************/
bool SGUI_SDK_Initialize(void)
{
/*----------------------------------*/
/* Variable Declaration */
/*----------------------------------*/
InitEvent clsEventObject;
bool bReturn;
/*----------------------------------*/
/* Initialize */
/*----------------------------------*/
bReturn = false;
/*----------------------------------*/
/* Process */
/*----------------------------------*/
// Prepare event object.
clsEventObject.SetEventType(wxEVT_SDK_INIT);
bReturn = SGUI_SDK_SyncMainFrameEvent(clsEventObject, ENV_FLAG_IDX_SDK_INIT, SDK_EVENT_SYNC_TIMEOUT_MS);
return bReturn;
}
/*************************************************************************/
/** Function Name: SGUI_SDK_DummyMainProc **/
/** Purpose: Main process start interface. **/
/** Params: None. **/
/** Return: return code, 0 for no error. **/
/** Notice: This function simulates the main entry function of **/
/** the target platform, it will called by main frame **/
/** thread helper process. **/
/*************************************************************************/
int SGUI_SDK_DummyMainProc(void)
{
bool bRet;
// Initialize SDK.
SGUI_SDK_PrepareSDK();
// Initialize main frame.
bRet = SGUI_SDK_Initialize();
if(false == bRet)
{
wxMessageBox("Initialize error.");
}
// Start heart-beat timer.
SGUI_SDK_ConfigHearBeatTimer(SDK_DEFAULT_HEART_BEAT_INTERVAL_MS);
// Start RTC timer.
SGUI_SDK_EnableRTCInterrupt(true);
// Initialize Engine.
InitializeEngine();
while(1)
{
// Check and process heart-beat timer event.
if(true == SGUI_SDK_GetEventSyncFlag(ENV_FLAG_IDX_SDK_TIM_EVENT))
{
SGUI_SDK_HeartBeatTimerTagEvent();
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_TIM_EVENT, false);
}
// Check and process key press event.
if(true == SGUI_SDK_GetEventSyncFlag(ENV_FLAG_IDX_SDK_KEY_EVENT))
{
SGUI_SDK_KeyPressInterruptEvent(s_uiKeyCode);
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_KEY_EVENT, false);
}
// Check and process RTC event.
if(true == SGUI_SDK_GetEventSyncFlag(ENV_FLAG_IDX_SDK_RTC_EVENT))
{
SGUI_SDK_RTCInterruptTagEvent();
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_RTC_EVENT, false);
}
}
return 0;
}

View File

@ -14,8 +14,6 @@
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-Og" />
<Add option="-g" />
<Add directory="$(#wx)/lib/gcc_dll/mswu" />
</Compiler>
<ResourceCompiler>
@ -36,8 +34,6 @@
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-Og" />
<Add option="-g" />
<Add directory="$(#wx)/lib/gcc_dll/mswu" />
</Compiler>
<ResourceCompiler>
@ -54,6 +50,7 @@
<Compiler>
<Add option="-Wall" />
<Add option="-std=c++11" />
<Add option="-g" />
<Add option="-pipe" />
<Add option="-mthreads" />
<Add option="-D__GNUWIN32__" />
@ -71,7 +68,9 @@
<Add directory="../../Frame/inc" />
<Add directory="../../Interface/inc" />
<Add directory="../../Controls/inc" />
<Add directory="../../Threads/inc" />
<Add directory="../../Demo/inc" />
<Add directory="../../Events/inc" />
<Add directory="../../../GUI/inc" />
<Add directory="../../../HMI/inc" />
<Add directory="../../../DemoProc/inc" />
@ -80,6 +79,7 @@
<Add directory="$(#wx)/include" />
</ResourceCompiler>
<Linker>
<Add option="-O3" />
<Add option="-mthreads" />
</Linker>
<Unit filename="../../../DemoProc/inc/DemoProc.h" />
@ -166,18 +166,12 @@
<Unit filename="../../Controls/src/wxLCD.cpp" />
<Unit filename="../../Controls/src/wxLCDBase.cpp" />
<Unit filename="../../Demo/inc/DemoResource_UTF8.h" />
<Unit filename="../../Events/inc/CustomEvents.h" />
<Unit filename="../../Events/src/CustomEvents.cpp" />
<Unit filename="../../Frame/inc/LCDFrame.h" />
<Unit filename="../../Frame/src/LCDFrame.cpp" />
<Unit filename="../../Interface/inc/UserActionInterface.h" />
<Unit filename="../../Interface/inc/VirtualDeviceInterface.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="../../Interface/src/UserActionInterface.cpp">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../Interface/src/VirtualDeviceInterface.cpp">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../Interface/inc/SDKInterface.h" />
<Unit filename="../../Interface/src/SDKInterface.cpp" />
<Unit filename="../../Library/inc/iconv.h" />
<Unit filename="../../Resource/Resource.rc">
<Option compilerVar="WINDRES" />

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

View File

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

View File

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 530 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 667 B

View File

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 390 B

View File

Before

Width:  |  Height:  |  Size: 626 B

After

Width:  |  Height:  |  Size: 626 B

View File

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 475 B

View File

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 907 B

View File

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 584 B

View File

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 499 B