mirror of
https://gitee.com/Polarix/simplegui.git
synced 2025-06-17 13:37:52 +00:00
2019-03-06:
订正和优化了HMI模型的相关处理。 重新编写了SimpleGUI的说明文档(包括HMI部分)。 修正了一些注释的错误。
This commit is contained in:
parent
78517175e9
commit
0612068b1e
@ -20,7 +20,7 @@
|
|||||||
// HMI action type
|
// HMI action type
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
EVENT_ID_UNKNOW = 0,
|
EVENT_ID_UNKNOW = 0,
|
||||||
// User defined action type.
|
// User defined action type.
|
||||||
EVENT_ID_KEY_PRESS,
|
EVENT_ID_KEY_PRESS,
|
||||||
EVENT_ID_TIMER,
|
EVENT_ID_TIMER,
|
||||||
@ -29,6 +29,21 @@ typedef enum
|
|||||||
EVENT_ID_MAX
|
EVENT_ID_MAX
|
||||||
}EVENT_ID;
|
}EVENT_ID;
|
||||||
|
|
||||||
|
// HMI event type.
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
EVENT_TYPE_ANY = 0,
|
||||||
|
EVENT_TYPE_ACTION,
|
||||||
|
EVENT_TYPE_DATA,
|
||||||
|
}EVENT_TYPE;
|
||||||
|
|
||||||
|
enum DEMO_PROC_ACTION_ID
|
||||||
|
{
|
||||||
|
HMI_DEMO_PROC_NO_ACT = 0,
|
||||||
|
HMI_DEMO_PROC_CONFIRM = 1,
|
||||||
|
HMI_DEMO_PROC_CANCEL = 2,
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
SGUI_UINT16 uiKeyValue;
|
SGUI_UINT16 uiKeyValue;
|
||||||
@ -55,7 +70,9 @@ HMI_EVENT_TYPE_DECLARE(DATA_EVENT, DUMMY_DATA_EVENT_DATA);
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Public variable declaration. =//
|
//= Public variable declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
/* HMI engine object. */
|
||||||
extern HMI_ENGINE_OBJECT g_stDemoEngine;
|
extern HMI_ENGINE_OBJECT g_stDemoEngine;
|
||||||
|
/* Screen display objects. */
|
||||||
extern HMI_SCREEN_OBJECT g_stHMIDemo_ScrollingText;
|
extern HMI_SCREEN_OBJECT g_stHMIDemo_ScrollingText;
|
||||||
extern HMI_SCREEN_OBJECT g_stHMIDemo_List;
|
extern HMI_SCREEN_OBJECT g_stHMIDemo_List;
|
||||||
extern HMI_SCREEN_OBJECT g_stHMIDemo_TextNotice;
|
extern HMI_SCREEN_OBJECT g_stHMIDemo_TextNotice;
|
||||||
@ -70,7 +87,6 @@ extern "C"
|
|||||||
{
|
{
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
HMI_ENGINE_RESULT InitializeEngine(void);
|
HMI_ENGINE_RESULT InitializeEngine(void);
|
||||||
HMI_ENGINE_RESULT EventProcess(const HMI_EVENT_BASE* pstEvent);
|
|
||||||
int DemoMainProcess(void);
|
int DemoMainProcess(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -20,8 +20,17 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
HMI_ENGINE_OBJECT g_stDemoEngine;
|
|
||||||
SGUI_SCR_DEV g_stDeviceInterface;
|
SGUI_SCR_DEV g_stDeviceInterface;
|
||||||
|
HMI_SCREEN_OBJECT* g_arrpstScreenObjs[] =
|
||||||
|
{
|
||||||
|
&g_stHMIDemo_ScrollingText,
|
||||||
|
&g_stHMIDemo_List,
|
||||||
|
&g_stHMIDemo_TextNotice,
|
||||||
|
&g_stHMIDemo_RTCNotice,
|
||||||
|
&g_stHMIDemo_VariableBox,
|
||||||
|
&g_stHMI_DemoRealtimeGraph,
|
||||||
|
};
|
||||||
|
HMI_ENGINE_OBJECT g_stDemoEngine;
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static function declare. =//
|
//= Static function declare. =//
|
||||||
@ -48,6 +57,7 @@ HMI_ENGINE_RESULT InitializeEngine(void)
|
|||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
|
int iIndex;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
@ -79,81 +89,49 @@ HMI_ENGINE_RESULT InitializeEngine(void)
|
|||||||
g_stDeviceInterface.stActions.fnClearScreen = OLED_ClearDisplay;
|
g_stDeviceInterface.stActions.fnClearScreen = OLED_ClearDisplay;
|
||||||
g_stDeviceInterface.stActions.fnRefreshScreen = OLED_RefreshScreen;
|
g_stDeviceInterface.stActions.fnRefreshScreen = OLED_RefreshScreen;
|
||||||
#endif
|
#endif
|
||||||
g_stDemoEngine.Interface = &g_stDeviceInterface;
|
|
||||||
|
|
||||||
/* Configure HMI engine. */
|
do
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_PrepareEngine(&g_stDemoEngine);
|
/* Prepare HMI engine object. */
|
||||||
}
|
g_stDemoEngine.ScreenCount = sizeof(g_arrpstScreenObjs)/sizeof(*g_arrpstScreenObjs);
|
||||||
|
g_stDemoEngine.ScreenObjPtr = g_arrpstScreenObjs;
|
||||||
|
g_stDemoEngine.Interface = &g_stDeviceInterface;
|
||||||
|
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
/* Initialize all screen object. */
|
||||||
{
|
if(NULL != g_stDemoEngine.ScreenObjPtr)
|
||||||
eProcessResult = HMI_AddScreen(&g_stDemoEngine, &g_stHMIDemo_ScrollingText, SGUI_TRUE);
|
{
|
||||||
}
|
for(iIndex=0; iIndex<g_stDemoEngine.ScreenCount; iIndex++)
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
{
|
||||||
{
|
if( (NULL != g_stDemoEngine.ScreenObjPtr[iIndex])
|
||||||
eProcessResult = HMI_AddScreen(&g_stDemoEngine, &g_stHMIDemo_List, SGUI_TRUE);
|
&& (NULL != g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions)
|
||||||
}
|
&& (g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions->Initialize)
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
)
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_AddScreen(&g_stDemoEngine, &g_stHMIDemo_TextNotice, SGUI_TRUE);
|
g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions->Initialize(&g_stDeviceInterface);
|
||||||
}
|
g_stDemoEngine.ScreenObjPtr[iIndex]->pstPrevious = NULL;
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
}
|
||||||
{
|
}
|
||||||
eProcessResult = HMI_AddScreen(&g_stDemoEngine, &g_stHMIDemo_RTCNotice, SGUI_TRUE);
|
}
|
||||||
}
|
else
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
{
|
||||||
{
|
|
||||||
eProcessResult = HMI_AddScreen(&g_stDemoEngine, &g_stHMIDemo_VariableBox, SGUI_TRUE);
|
|
||||||
}
|
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
|
||||||
{
|
|
||||||
eProcessResult = HMI_AddScreen(&g_stDemoEngine, &g_stHMI_DemoRealtimeGraph, SGUI_TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
}
|
||||||
{
|
/* Active engine object. */
|
||||||
eProcessResult = HMI_ActiveEngine(&g_stDemoEngine, HMI_SCREEN_ID_DEMO_SCROLLING_TEXT);
|
eProcessResult = HMI_ActiveEngine(&g_stDemoEngine, HMI_SCREEN_ID_DEMO_SCROLLING_TEXT);
|
||||||
}
|
if(HMI_PROCESS_FAILED(eProcessResult))
|
||||||
|
{
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
/* Active engine failed. */
|
||||||
{
|
break;
|
||||||
|
}
|
||||||
|
/* Start engine process. */
|
||||||
eProcessResult = HMI_StartEngine(NULL);
|
eProcessResult = HMI_StartEngine(NULL);
|
||||||
}
|
if(HMI_PROCESS_FAILED(eProcessResult))
|
||||||
|
{
|
||||||
|
/* Start engine failed. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}while(0);
|
||||||
|
|
||||||
return eProcessResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/** Function Name: EventProcess **/
|
|
||||||
/** Purpose: Process posted event. **/
|
|
||||||
/** Parameters: **/
|
|
||||||
/** @ pstEvent[in]: HMI event data. **/
|
|
||||||
/** Return: HMI_ENGINE_RESULT. **/
|
|
||||||
/** Notice: This function must be called when initialize. **/
|
|
||||||
/*****************************************************************************/
|
|
||||||
HMI_ENGINE_RESULT EventProcess(const HMI_EVENT_BASE* pstEvent)
|
|
||||||
{
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Variable Declaration */
|
|
||||||
/*----------------------------------*/
|
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Initialize */
|
|
||||||
/*----------------------------------*/
|
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Process */
|
|
||||||
/*----------------------------------*/
|
|
||||||
|
|
||||||
eProcessResult = HMI_ProcessEvent(pstEvent);
|
|
||||||
if(HMI_PROCESS_SUCCESSFUL(eProcessResult))
|
|
||||||
{
|
|
||||||
HMI_PostProcess(eProcessResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
return eProcessResult;
|
return eProcessResult;
|
||||||
}
|
}
|
||||||
@ -209,11 +187,11 @@ void KeyPressEventProc(void)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
stEvent.Head.eType = HMI_ENGINE_EVENT_ACTION;
|
stEvent.Head.iType = EVENT_TYPE_ACTION;
|
||||||
stEvent.Head.iID = EVENT_ID_KEY_PRESS;
|
stEvent.Head.iID = EVENT_ID_KEY_PRESS;
|
||||||
stEvent.Data.uiKeyValue = SGUI_SDK_GetKeyEventData();
|
stEvent.Data.uiKeyValue = SGUI_SDK_GetKeyEventData();
|
||||||
// Post key press event.
|
// Post key press event.
|
||||||
EventProcess((HMI_EVENT_BASE*)(&stEvent));
|
HMI_ProcessEvent((HMI_EVENT_BASE*)(&stEvent));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysTickTimerEventProc(void)
|
void SysTickTimerEventProc(void)
|
||||||
@ -231,11 +209,11 @@ void SysTickTimerEventProc(void)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
stEvent.Head.eType = HMI_ENGINE_EVENT_DATA;
|
stEvent.Head.iType = EVENT_TYPE_DATA;
|
||||||
stEvent.Head.iID = EVENT_ID_TIMER;
|
stEvent.Head.iID = EVENT_ID_TIMER;
|
||||||
stEvent.Data.iValue = (rand() % 200)-100;
|
stEvent.Data.iValue = (rand() % 200)-100;
|
||||||
// Post timer event.
|
// Post timer event.
|
||||||
EventProcess((HMI_EVENT_BASE*)&stEvent);
|
HMI_ProcessEvent((HMI_EVENT_BASE*)&stEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -254,9 +232,9 @@ void RTCEventProc(void)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
stEvent.Head.eType = HMI_ENGINE_EVENT_DATA;
|
stEvent.Head.iType = EVENT_TYPE_DATA;
|
||||||
stEvent.Head.iID = EVENT_ID_RTC;
|
stEvent.Head.iID = EVENT_ID_RTC;
|
||||||
// Post RTC update message to a screen.
|
// Post RTC update message to a screen.
|
||||||
EventProcess((HMI_EVENT_BASE*)&stEvent);
|
HMI_ProcessEvent((HMI_EVENT_BASE*)&stEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
static HMI_ENGINE_RESULT HMI_DemoList_Initialize(SGUI_SCR_DEV* pstIFObj);
|
static HMI_ENGINE_RESULT HMI_DemoList_Initialize(SGUI_SCR_DEV* pstIFObj);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoList_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoList_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoList_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoList_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent);
|
static HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoList_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult);
|
static HMI_ENGINE_RESULT HMI_DemoList_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
@ -130,7 +130,7 @@ HMI_ENGINE_RESULT HMI_DemoList_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void*
|
|||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent)
|
HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
@ -139,18 +139,20 @@ HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EV
|
|||||||
SGUI_UINT16 uiKeyCode;
|
SGUI_UINT16 uiKeyCode;
|
||||||
SGUI_UINT16 uiKeyValue;
|
SGUI_UINT16 uiKeyValue;
|
||||||
SGUI_UINT16 uiOptionCode;
|
SGUI_UINT16 uiOptionCode;
|
||||||
KEY_PRESS_EVENT* pstKeyEvent;
|
KEY_PRESS_EVENT* pstKeyEvent;
|
||||||
|
SGUI_INT iProcessAction;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
pstKeyEvent = (KEY_PRESS_EVENT*)pstEvent;
|
pstKeyEvent = (KEY_PRESS_EVENT*)pstEvent;
|
||||||
|
iProcessAction = HMI_DEMO_PROC_NO_ACT;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(pstEvent->eType == HMI_ENGINE_EVENT_ACTION)
|
if(pstEvent->iType == EVENT_TYPE_ACTION)
|
||||||
{
|
{
|
||||||
// Check event is valid.
|
// Check event is valid.
|
||||||
if(SGUI_FALSE == HMI_EVENT_SIZE_CHK(*pstKeyEvent, KEY_PRESS_EVENT))
|
if(SGUI_FALSE == HMI_EVENT_SIZE_CHK(*pstKeyEvent, KEY_PRESS_EVENT))
|
||||||
@ -167,12 +169,12 @@ HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EV
|
|||||||
{
|
{
|
||||||
case KEY_VALUE_ENTER:
|
case KEY_VALUE_ENTER:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_CONFIRM;
|
iProcessAction = HMI_DEMO_PROC_CONFIRM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_ESC:
|
case KEY_VALUE_ESC:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_CANCEL;
|
iProcessAction = HMI_DEMO_PROC_CANCEL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_UP:
|
case KEY_VALUE_UP:
|
||||||
@ -242,19 +244,24 @@ HMI_ENGINE_RESULT HMI_DemoList_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(NULL != piActionID)
|
||||||
|
{
|
||||||
|
*piActionID = iProcessAction;
|
||||||
|
}
|
||||||
|
|
||||||
return eProcessResult;
|
return eProcessResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoList_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult)
|
HMI_ENGINE_RESULT HMI_DemoList_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID)
|
||||||
{
|
{
|
||||||
uint32_t uiSelectListIndex;
|
uint32_t uiSelectListIndex;
|
||||||
SGUI_List_ITEM* pstSelectedItem;
|
SGUI_List_ITEM* pstSelectedItem;
|
||||||
int32_t iListItemParameterValue;
|
int32_t iListItemParameterValue;
|
||||||
|
|
||||||
if(HMI_RET_CONFIRM == iActionResult)
|
if(HMI_DEMO_PROC_CONFIRM == iActionID)
|
||||||
{
|
{
|
||||||
uiSelectListIndex = s_stDemoListObject.ControlVariable.SelectIndex;
|
uiSelectListIndex = s_stDemoListObject.ControlVariable.SelectIndex;
|
||||||
switch(SGUI_List_GetListItemPtr(&s_stDemoListObject, uiSelectListIndex)->Sign)
|
switch(SGUI_List_GetListItemPtr(&s_stDemoListObject, uiSelectListIndex)->ItemID)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
@ -264,36 +271,37 @@ HMI_ENGINE_RESULT HMI_DemoList_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iAct
|
|||||||
if(0 == iListItemParameterValue)
|
if(0 == iListItemParameterValue)
|
||||||
{
|
{
|
||||||
sprintf(s_szNoticeTextBuffer, DEMO_LIST_NOTICE_TEXT_FMT, uiSelectListIndex);
|
sprintf(s_szNoticeTextBuffer, DEMO_LIST_NOTICE_TEXT_FMT, uiSelectListIndex);
|
||||||
HMI_Goto(HMI_SCREEN_ID_DEMO_TEXT_NOTICE, s_szNoticeTextBuffer);
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_TEXT_NOTICE, s_szNoticeTextBuffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HMI_Goto(HMI_SCREEN_ID_DEMO_RTC_NOTICE, NULL);
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_RTC_NOTICE, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
HMI_Goto(HMI_SCREEN_ID_DEMO_VARIABLE_BOX, NULL);
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_VARIABLE_BOX, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
HMI_Goto(HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH, NULL);
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
sprintf(s_szNoticeTextBuffer, DEMO_LIST_NOTICE_TEXT_FMT, uiSelectListIndex);
|
sprintf(s_szNoticeTextBuffer, DEMO_LIST_NOTICE_TEXT_FMT, uiSelectListIndex);
|
||||||
HMI_Goto(HMI_SCREEN_ID_DEMO_TEXT_NOTICE, s_szNoticeTextBuffer);
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_TEXT_NOTICE, s_szNoticeTextBuffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(HMI_RET_CANCEL == iActionResult)
|
else if(HMI_DEMO_PROC_CANCEL == iActionID)
|
||||||
{
|
{
|
||||||
HMI_GoBack(NULL);
|
HMI_GoBack(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,17 +21,16 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static function declaration. =//
|
//= Static function declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_Initialize(SGUI_SCR_DEV* pstIFObj);
|
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent);
|
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult);
|
static HMI_ENGINE_RESULT HMI_DemoRTCNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
static char s_szRTCNoticeText[NOTICE_RTC_BUFFER_SIZE+1] = {0x00};
|
static char s_szRTCNoticeText[NOTICE_RTC_BUFFER_SIZE+1] = {0x00};
|
||||||
HMI_SCREEN_ACTION s_stDemoRTCNoticeActions = { HMI_DemoRTCNotice_Initialize,
|
HMI_SCREEN_ACTION s_stDemoRTCNoticeActions = { NULL,
|
||||||
HMI_DemoRTCNotice_Prepare,
|
HMI_DemoRTCNotice_Prepare,
|
||||||
HMI_DemoRTCNotice_RefreshScreen,
|
HMI_DemoRTCNotice_RefreshScreen,
|
||||||
HMI_DemoRTCNotice_ProcessEvent,
|
HMI_DemoRTCNotice_ProcessEvent,
|
||||||
@ -47,15 +46,10 @@ HMI_SCREEN_OBJECT g_stHMIDemo_RTCNotice = { HMI_SCREEN_ID_DEMO_RTC_NOTIC
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Function define. =//
|
//= Function define. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
HMI_ENGINE_RESULT HMI_DemoRTCNotice_Initialize(SGUI_SCR_DEV* pstIFObj)
|
|
||||||
{
|
|
||||||
SGUI_SystemIF_MemorySet(s_szRTCNoticeText, 0x00, sizeof(SGUI_CHAR)*(NOTICE_RTC_BUFFER_SIZE+1));
|
|
||||||
return HMI_RET_NORMAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoRTCNotice_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters)
|
HMI_ENGINE_RESULT HMI_DemoRTCNotice_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters)
|
||||||
{
|
{
|
||||||
SGUI_SDK_EnableRTCInterrupt(true);
|
SGUI_SDK_EnableRTCInterrupt(true);
|
||||||
|
SGUI_SystemIF_MemorySet(s_szRTCNoticeText, 0x00, sizeof(SGUI_CHAR)*(NOTICE_RTC_BUFFER_SIZE+1));
|
||||||
HMI_DemoRTCNotice_RefreshScreen(pstIFObj, NULL);
|
HMI_DemoRTCNotice_RefreshScreen(pstIFObj, NULL);
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
@ -78,7 +72,7 @@ HMI_ENGINE_RESULT HMI_DemoRTCNotice_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent)
|
HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
@ -86,19 +80,21 @@ HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const H
|
|||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
SGUI_TIME stRTCTime;
|
SGUI_TIME stRTCTime;
|
||||||
SGUI_UINT16 uiKeyValue;
|
SGUI_UINT16 uiKeyValue;
|
||||||
KEY_PRESS_EVENT* pstKeyEvent;
|
KEY_PRESS_EVENT* pstKeyEvent;
|
||||||
|
SGUI_INT iProcessAction;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
|
iProcessAction = HMI_DEMO_PROC_NO_ACT;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(NULL != pstEvent)
|
if(NULL != pstEvent)
|
||||||
{
|
{
|
||||||
if(HMI_ENGINE_EVENT_ACTION == pstEvent->eType)
|
if(EVENT_TYPE_ACTION == pstEvent->iType)
|
||||||
{
|
{
|
||||||
if(EVENT_ID_KEY_PRESS == pstEvent->iID)
|
if(EVENT_ID_KEY_PRESS == pstEvent->iID)
|
||||||
{
|
{
|
||||||
@ -109,13 +105,13 @@ HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const H
|
|||||||
case KEY_VALUE_ENTER:
|
case KEY_VALUE_ENTER:
|
||||||
case KEY_VALUE_ESC:
|
case KEY_VALUE_ESC:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_CANCEL;
|
iProcessAction = HMI_DEMO_PROC_CANCEL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(HMI_ENGINE_EVENT_DATA == pstEvent->eType)
|
else if(EVENT_TYPE_DATA == pstEvent->iType)
|
||||||
{
|
{
|
||||||
if(EVENT_ID_RTC == pstEvent->iID)
|
if(EVENT_ID_RTC == pstEvent->iID)
|
||||||
{
|
{
|
||||||
@ -124,26 +120,28 @@ HMI_ENGINE_RESULT HMI_DemoRTCNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const H
|
|||||||
stRTCTime.Year, stRTCTime.Month, stRTCTime.Day,
|
stRTCTime.Year, stRTCTime.Month, stRTCTime.Day,
|
||||||
stRTCTime.Hour, stRTCTime.Minute, stRTCTime.Second);
|
stRTCTime.Hour, stRTCTime.Minute, stRTCTime.Second);
|
||||||
SGUI_Notice_Refresh(pstIFObj, s_szRTCNoticeText, 0, SGUI_ICON_INFORMATION);
|
SGUI_Notice_Refresh(pstIFObj, s_szRTCNoticeText, 0, SGUI_ICON_INFORMATION);
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
if(NULL != piActionID)
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
*piActionID = iProcessAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
return eProcessResult;
|
return eProcessResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoRTCNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult)
|
HMI_ENGINE_RESULT HMI_DemoRTCNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID)
|
||||||
{
|
{
|
||||||
if(HMI_RET_CANCEL == iActionResult)
|
if(HMI_PROCESS_SUCCESSFUL(eProcResult))
|
||||||
{
|
{
|
||||||
SGUI_SDK_EnableRTCInterrupt(false);
|
if(HMI_DEMO_PROC_CANCEL == iActionID)
|
||||||
HMI_GoBack(NULL);
|
{
|
||||||
|
SGUI_SDK_EnableRTCInterrupt(false);
|
||||||
|
HMI_GoBack(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,25 +18,25 @@
|
|||||||
static HMI_ENGINE_RESULT HMI_DemoRealGraph_Initialize(SGUI_SCR_DEV* pstIFObj);
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_Initialize(SGUI_SCR_DEV* pstIFObj);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRealGraph_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRealGraph_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent);
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoRealGraph_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult);
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
SGUI_RTGRAPH_CONTROL s_stRealtimeGraphControl = {50, -50, SGUI_TRUE, 3, 0};
|
SGUI_RTGRAPH_CONTROL s_stRealtimeGraphControl = {50, -50, SGUI_TRUE, 3, 0};
|
||||||
SGUI_RTGRAPH_DATA s_stRealtimeGraphData = {{1, 9, 126, 46}, {0}, {0}, {0}, 0, 0};
|
SGUI_RTGRAPH_DATA s_stRealtimeGraphData = {{1, 9, 126, 46}, {0}, {0}, {0}, 0, 0};
|
||||||
SGUI_RTGRAPH s_stRealtimeGraph = {&s_stRealtimeGraphData, &s_stRealtimeGraphControl};
|
SGUI_RTGRAPH s_stRealtimeGraph = {&s_stRealtimeGraphData, &s_stRealtimeGraphControl};
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Global variable declaration. =//
|
//= Global variable declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
HMI_SCREEN_ACTION s_stDemoRealtimeGraphActions = { HMI_DemoRealGraph_Initialize,
|
static HMI_SCREEN_ACTION s_stDemoRealtimeGraphActions = { HMI_DemoRealGraph_Initialize,
|
||||||
HMI_DemoRealGraph_Prepare,
|
HMI_DemoRealGraph_Prepare,
|
||||||
HMI_DemoRealGraph_RefreshScreen,
|
HMI_DemoRealGraph_RefreshScreen,
|
||||||
HMI_DemoRealGraph_ProcessEvent,
|
HMI_DemoRealGraph_ProcessEvent,
|
||||||
HMI_DemoRealGraph_PostProcess,
|
HMI_DemoRealGraph_PostProcess,
|
||||||
};
|
};
|
||||||
HMI_SCREEN_OBJECT g_stHMI_DemoRealtimeGraph = { HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH,
|
HMI_SCREEN_OBJECT g_stHMI_DemoRealtimeGraph = { HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH,
|
||||||
&s_stDemoRealtimeGraphActions
|
&s_stDemoRealtimeGraphActions
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ HMI_ENGINE_RESULT HMI_DemoRealGraph_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent)
|
HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
@ -103,11 +103,13 @@ HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const H
|
|||||||
SGUI_UINT16 uiKeyValue;
|
SGUI_UINT16 uiKeyValue;
|
||||||
KEY_PRESS_EVENT* pstKeyEvent;
|
KEY_PRESS_EVENT* pstKeyEvent;
|
||||||
DATA_EVENT* pstDataEvent;
|
DATA_EVENT* pstDataEvent;
|
||||||
|
SGUI_INT iProcessAction;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
|
iProcessAction = HMI_DEMO_PROC_NO_ACT;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
@ -129,11 +131,7 @@ HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const H
|
|||||||
|
|
||||||
if(KEY_VALUE_ESC == uiKeyValue)
|
if(KEY_VALUE_ESC == uiKeyValue)
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_CANCEL;
|
iProcessAction = HMI_DEMO_PROC_CANCEL;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -156,25 +154,34 @@ HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const H
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
/* No process. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(NULL != piActionID)
|
||||||
|
{
|
||||||
|
*piActionID = iProcessAction;
|
||||||
|
}
|
||||||
|
|
||||||
return eProcessResult;
|
return eProcessResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoRealGraph_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult)
|
HMI_ENGINE_RESULT HMI_DemoRealGraph_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(HMI_RET_CANCEL == iActionResult)
|
if(HMI_PROCESS_SUCCESSFUL(eProcResult))
|
||||||
{
|
{
|
||||||
// Stop heart-beat timer.
|
if(HMI_DEMO_PROC_CANCEL == iActionID)
|
||||||
SGUI_SDK_ConfigHearBeatTimer(0);
|
{
|
||||||
// Go back to last screen.
|
// Stop heart-beat timer.
|
||||||
HMI_GoBack(NULL);
|
SGUI_SDK_ConfigHearBeatTimer(0);
|
||||||
|
// Go back to last screen.
|
||||||
|
HMI_GoBack(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "DemoProc.h"
|
#include "DemoProc.h"
|
||||||
#include "SGUI_Text.h"
|
#include "SGUI_Text.h"
|
||||||
#include "SGUI_Frame.h"
|
|
||||||
#include "HMI_Engine.h"
|
#include "HMI_Engine.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
@ -34,8 +33,9 @@
|
|||||||
static HMI_ENGINE_RESULT HMI_DemoScrollingText_Initialize(SGUI_SCR_DEV* Interface);
|
static HMI_ENGINE_RESULT HMI_DemoScrollingText_Initialize(SGUI_SCR_DEV* Interface);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoScrollingText_Prepare(SGUI_SCR_DEV* Interface, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoScrollingText_Prepare(SGUI_SCR_DEV* Interface, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoScrollingText_RefreshScreen(SGUI_SCR_DEV* Interface, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoScrollingText_RefreshScreen(SGUI_SCR_DEV* Interface, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_SCR_DEV* Interface, const HMI_EVENT_BASE* pstEvent);
|
static HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_SCR_DEV* Interface, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoScrollingText_PostProcess(SGUI_SCR_DEV* Interface, SGUI_INT iActionResult);
|
static HMI_ENGINE_RESULT HMI_DemoScrollingText_PostProcess(SGUI_SCR_DEV* Interface, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
|
static void HMI_DemoScrollingText_DrawFrame(SGUI_SCR_DEV* Interface);
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
@ -47,9 +47,6 @@ static int32_t s_iTextOffset;
|
|||||||
static SGUI_INT s_iTextHeight;
|
static SGUI_INT s_iTextHeight;
|
||||||
static SGUI_RECT_AREA s_stTextDisplayArea;
|
static SGUI_RECT_AREA s_stTextDisplayArea;
|
||||||
|
|
||||||
static SGUI_BOX_FRAME_STRUCT s_stTextFrame = { {HMI_TEXT_DEMO_FRAME_EDGE_LAYERS, SGUI_FONT_SIZE_H12},
|
|
||||||
{NULL}
|
|
||||||
};
|
|
||||||
static HMI_SCREEN_ACTION s_stDemoScrollingTextActions = {
|
static HMI_SCREEN_ACTION s_stDemoScrollingTextActions = {
|
||||||
HMI_DemoScrollingText_Initialize,
|
HMI_DemoScrollingText_Initialize,
|
||||||
HMI_DemoScrollingText_Prepare,
|
HMI_DemoScrollingText_Prepare,
|
||||||
@ -98,7 +95,7 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_Initialize(SGUI_SCR_DEV* Interface)
|
|||||||
HMI_ENGINE_RESULT HMI_DemoScrollingText_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters)
|
HMI_ENGINE_RESULT HMI_DemoScrollingText_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters)
|
||||||
{
|
{
|
||||||
// Paint frame edge.
|
// Paint frame edge.
|
||||||
SGUI_Frame_DrawFullScreenFrame(pstIFObj, &s_stTextFrame);
|
HMI_DemoScrollingText_DrawFrame(pstIFObj);
|
||||||
// Start dummy heart-beat timer.
|
// Start dummy heart-beat timer.
|
||||||
SGUI_SDK_ConfigHearBeatTimer(SDK_DEFAULT_HEART_BEAT_INTERVAL_MS);
|
SGUI_SDK_ConfigHearBeatTimer(SDK_DEFAULT_HEART_BEAT_INTERVAL_MS);
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
@ -114,7 +111,7 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_Prepare(SGUI_SCR_DEV* pstIFObj, const vo
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
HMI_ENGINE_RESULT HMI_DemoScrollingText_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters)
|
HMI_ENGINE_RESULT HMI_DemoScrollingText_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters)
|
||||||
{
|
{
|
||||||
SGUI_Frame_DrawFullScreenFrame(pstIFObj, &s_stTextFrame);
|
HMI_DemoScrollingText_DrawFrame(pstIFObj);
|
||||||
SGUI_Text_DrawMultipleLinesText(pstIFObj, s_szDemoText, SGUI_FONT_SIZE_H12, &s_stTextDisplayArea, s_iTextOffset, SGUI_DRAW_NORMAL);
|
SGUI_Text_DrawMultipleLinesText(pstIFObj, s_szDemoText, SGUI_FONT_SIZE_H12, &s_stTextDisplayArea, s_iTextOffset, SGUI_DRAW_NORMAL);
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
@ -130,19 +127,21 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_RefreshScreen(SGUI_SCR_DEV* pstIFObj, co
|
|||||||
/** Limitation: Parameter pointer is a void type, convert to the **/
|
/** Limitation: Parameter pointer is a void type, convert to the **/
|
||||||
/** appropriate type before use. **/
|
/** appropriate type before use. **/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent)
|
HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
SGUI_UINT16 uiKeyValue;
|
SGUI_UINT16 uiKeyValue;
|
||||||
KEY_PRESS_EVENT* pstKeyEvent;
|
KEY_PRESS_EVENT* pstKeyEvent;
|
||||||
|
SGUI_INT iProcessAction;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
|
iProcessAction = HMI_DEMO_PROC_NO_ACT;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
@ -156,17 +155,12 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_SCR_DEV* pstIFObj, con
|
|||||||
|
|
||||||
if(KEY_VALUE_SPACE == uiKeyValue)
|
if(KEY_VALUE_SPACE == uiKeyValue)
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_FOLLOWUP;
|
iProcessAction = HMI_DEMO_PROC_CONFIRM;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EVENT_ID_TIMER:
|
case EVENT_ID_TIMER:
|
||||||
{
|
{
|
||||||
//SGUI_Frame_DrawFullScreenFrame(pstIFObj, &s_stTextFrame);
|
|
||||||
SGUI_Text_DrawMultipleLinesText(pstIFObj, s_szDemoText, SGUI_FONT_SIZE_H12, &s_stTextDisplayArea, s_iTextOffset, SGUI_DRAW_NORMAL);
|
SGUI_Text_DrawMultipleLinesText(pstIFObj, s_szDemoText, SGUI_FONT_SIZE_H12, &s_stTextDisplayArea, s_iTextOffset, SGUI_DRAW_NORMAL);
|
||||||
if(s_iTextOffset + s_iTextHeight == 0)
|
if(s_iTextOffset + s_iTextHeight == 0)
|
||||||
{
|
{
|
||||||
@ -176,15 +170,19 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_SCR_DEV* pstIFObj, con
|
|||||||
{
|
{
|
||||||
s_iTextOffset--;
|
s_iTextOffset--;
|
||||||
}
|
}
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
/* No process. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(NULL != piActionID)
|
||||||
|
{
|
||||||
|
*piActionID = iProcessAction;
|
||||||
|
}
|
||||||
|
|
||||||
return eProcessResult;
|
return eProcessResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,18 +191,39 @@ HMI_ENGINE_RESULT HMI_DemoScrollingText_ProcessEvent(SGUI_SCR_DEV* pstIFObj, con
|
|||||||
/** Purpose: Do something after user action or update screen. **/
|
/** Purpose: Do something after user action or update screen. **/
|
||||||
/** Resources: List data structure and bind data if existed. **/
|
/** Resources: List data structure and bind data if existed. **/
|
||||||
/** Parameters: **/
|
/** Parameters: **/
|
||||||
/** @iActionResult[in]: User action or system action process result. **/
|
/** @ iActionResult[in]: User action or system action process result. **/
|
||||||
/** Return: Post process result. **/
|
/** Return: Post process result. **/
|
||||||
/** Limitation: None. **/
|
/** Limitation: None. **/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
HMI_ENGINE_RESULT HMI_DemoScrollingText_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult)
|
HMI_ENGINE_RESULT HMI_DemoScrollingText_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID)
|
||||||
{
|
{
|
||||||
if(HMI_RET_FOLLOWUP == iActionResult)
|
if(HMI_PROCESS_SUCCESSFUL(eProcResult))
|
||||||
{
|
{
|
||||||
// Stop heart-beat timer.
|
if(HMI_DEMO_PROC_CONFIRM == iActionID)
|
||||||
SGUI_SDK_ConfigHearBeatTimer(0);
|
{
|
||||||
// Go to main list.
|
// Stop heart-beat timer.
|
||||||
HMI_Goto(HMI_SCREEN_ID_DEMO_LIST, NULL);
|
SGUI_SDK_ConfigHearBeatTimer(0);
|
||||||
|
// Go to main list.
|
||||||
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_LIST, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/** Function Name: HMI_DemoScrollingText_DrawFrame **/
|
||||||
|
/** Purpose: Draw frame edge for scroll text screen. **/
|
||||||
|
/** Parameters: **/
|
||||||
|
/** @ Interface[in]: Device driver object. **/
|
||||||
|
/** Return: None. **/
|
||||||
|
/** Limitation: None. **/
|
||||||
|
/*****************************************************************************/
|
||||||
|
void HMI_DemoScrollingText_DrawFrame(SGUI_SCR_DEV* Interface)
|
||||||
|
{
|
||||||
|
if(NULL != Interface)
|
||||||
|
{
|
||||||
|
SGUI_Basic_DrawRectangle(Interface, 0, 0, RECT_WIDTH(Interface->stSize), RECT_HEIGHT(Interface->stSize), SGUI_COLOR_FRGCLR, SGUI_COLOR_BKGCLR);
|
||||||
|
SGUI_Basic_DrawRectangle(Interface, 2, 2, RECT_WIDTH(Interface->stSize)-4, RECT_HEIGHT(Interface->stSize)-4, SGUI_COLOR_FRGCLR, SGUI_COLOR_TRANS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
static HMI_ENGINE_RESULT HMI_DemoTextNotice_Initialize(SGUI_SCR_DEV* pstIFObj);
|
static HMI_ENGINE_RESULT HMI_DemoTextNotice_Initialize(SGUI_SCR_DEV* pstIFObj);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoTextNotice_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoTextNotice_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoTextNotice_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoTextNotice_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoTextNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent);
|
static HMI_ENGINE_RESULT HMI_DemoTextNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoTextNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult);
|
static HMI_ENGINE_RESULT HMI_DemoTextNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
@ -78,24 +78,26 @@ HMI_ENGINE_RESULT HMI_DemoTextNotice_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoTextNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent)
|
HMI_ENGINE_RESULT HMI_DemoTextNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
SGUI_UINT16 uiKeyValue;
|
SGUI_UINT16 uiKeyValue;
|
||||||
KEY_PRESS_EVENT* pstKeyEvent;
|
KEY_PRESS_EVENT* pstKeyEvent;
|
||||||
|
SGUI_INT iProcessAction;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
|
iProcessAction = HMI_DEMO_PROC_NO_ACT;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(HMI_ENGINE_EVENT_ACTION == pstEvent->eType)
|
if(EVENT_TYPE_ACTION == pstEvent->iType)
|
||||||
{
|
{
|
||||||
if(EVENT_ID_KEY_PRESS == pstEvent->iID)
|
if(EVENT_ID_KEY_PRESS == pstEvent->iID)
|
||||||
{
|
{
|
||||||
@ -107,24 +109,31 @@ HMI_ENGINE_RESULT HMI_DemoTextNotice_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
case KEY_VALUE_ENTER:
|
case KEY_VALUE_ENTER:
|
||||||
case KEY_VALUE_ESC:
|
case KEY_VALUE_ESC:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_CANCEL;
|
iProcessAction = HMI_DEMO_PROC_CANCEL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(NULL != piActionID)
|
||||||
|
{
|
||||||
|
*piActionID = iProcessAction;
|
||||||
|
}
|
||||||
|
|
||||||
return eProcessResult;
|
return eProcessResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoTextNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult)
|
HMI_ENGINE_RESULT HMI_DemoTextNotice_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(HMI_RET_CANCEL == iActionResult)
|
if(HMI_PROCESS_SUCCESSFUL(eProcResult))
|
||||||
{
|
{
|
||||||
HMI_GoBack(NULL);
|
if(HMI_DEMO_PROC_CANCEL == iActionID)
|
||||||
|
{
|
||||||
|
HMI_GoBack(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "DemoProc.h"
|
#include "DemoProc.h"
|
||||||
#include "SGUI_Frame.h"
|
|
||||||
#include "SGUI_Notice.h"
|
#include "SGUI_Notice.h"
|
||||||
#include "SGUI_VariableBox.h"
|
#include "SGUI_VariableBox.h"
|
||||||
|
|
||||||
@ -28,8 +27,8 @@
|
|||||||
static HMI_ENGINE_RESULT HMI_DemoVariableBox_Initialize(SGUI_SCR_DEV* pstIFObj);
|
static HMI_ENGINE_RESULT HMI_DemoVariableBox_Initialize(SGUI_SCR_DEV* pstIFObj);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoVariableBox_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoVariableBox_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoVariableBox_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
static HMI_ENGINE_RESULT HMI_DemoVariableBox_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent);
|
static HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
static HMI_ENGINE_RESULT HMI_DemoVariableBox_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult);
|
static HMI_ENGINE_RESULT HMI_DemoVariableBox_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
static void HMI_DemoVariableBox_DrawFrame(SGUI_SCR_DEV* pstIFObj, SGUI_SZSTR szTitle);
|
static void HMI_DemoVariableBox_DrawFrame(SGUI_SCR_DEV* pstIFObj, SGUI_SZSTR szTitle);
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
@ -113,26 +112,28 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_RefreshScreen(SGUI_SCR_DEV* pstIFObj, cons
|
|||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent)
|
HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
SGUI_UINT16 uiKeyValue;
|
SGUI_UINT16 uiKeyValue;
|
||||||
KEY_PRESS_EVENT* pstKeyEvent;
|
KEY_PRESS_EVENT* pstKeyEvent;
|
||||||
|
SGUI_INT iProcessAction;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
|
iProcessAction = HMI_DEMO_PROC_NO_ACT;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(s_uiAutoConfirmTimer > 0)
|
if(s_uiAutoConfirmTimer > 0)
|
||||||
{
|
{
|
||||||
if(HMI_ENGINE_EVENT_ACTION == pstEvent->eType)
|
if(EVENT_TYPE_ACTION == pstEvent->iType)
|
||||||
{
|
{
|
||||||
if(EVENT_ID_KEY_PRESS == pstEvent->iID)
|
if(EVENT_ID_KEY_PRESS == pstEvent->iID)
|
||||||
{
|
{
|
||||||
@ -146,7 +147,7 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(HMI_ENGINE_EVENT_DATA == pstEvent->eType)
|
else if(EVENT_TYPE_DATA == pstEvent->iType)
|
||||||
{
|
{
|
||||||
if(EVENT_ID_RTC == pstEvent->iID)
|
if(EVENT_ID_RTC == pstEvent->iID)
|
||||||
{
|
{
|
||||||
@ -161,8 +162,6 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
eProcessResult = HMI_DemoVariableBox_RefreshScreen(pstIFObj, NULL);
|
eProcessResult = HMI_DemoVariableBox_RefreshScreen(pstIFObj, NULL);
|
||||||
SGUI_SDK_EnableRTCInterrupt(false);
|
SGUI_SDK_EnableRTCInterrupt(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -186,12 +185,11 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_NORMAL);
|
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_NORMAL);
|
||||||
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE);
|
SGUI_TextVariableBox_Refresh(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE);
|
||||||
}
|
}
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_ESC:
|
case KEY_VALUE_ESC:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_CANCEL;
|
iProcessAction = HMI_DEMO_PROC_CANCEL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_LEFT:
|
case KEY_VALUE_LEFT:
|
||||||
@ -204,7 +202,6 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
|
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_UP:
|
case KEY_VALUE_UP:
|
||||||
@ -218,7 +215,6 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
s_stNumberVariableBox.Value++;
|
s_stNumberVariableBox.Value++;
|
||||||
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
|
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
|
||||||
}
|
}
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_RIGHT:
|
case KEY_VALUE_RIGHT:
|
||||||
@ -231,7 +227,6 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
|
SGUI_TextVariableBox_ChangeCharacter(pstIFObj, &s_stTextVariableBox, SGUI_DRAW_REVERSE, GUI_TEXT_ASCII, SGUI_TXT_VARBOX_OPT_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_DOWN:
|
case KEY_VALUE_DOWN:
|
||||||
@ -245,7 +240,6 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
s_stNumberVariableBox.Value--;
|
s_stNumberVariableBox.Value--;
|
||||||
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
|
SGUI_IntegerVariableBox_Refresh(pstIFObj, &s_stNumberVariableBox, SGUI_CENTER, SGUI_DRAW_REVERSE);
|
||||||
}
|
}
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case KEY_VALUE_ENTER:
|
case KEY_VALUE_ENTER:
|
||||||
@ -265,22 +259,30 @@ HMI_ENGINE_RESULT HMI_DemoVariableBox_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_NOACTION;
|
/* No process. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(NULL != piActionID)
|
||||||
|
{
|
||||||
|
*piActionID = iProcessAction;
|
||||||
|
}
|
||||||
|
|
||||||
return eProcessResult;
|
return eProcessResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMI_ENGINE_RESULT HMI_DemoVariableBox_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionResult)
|
HMI_ENGINE_RESULT HMI_DemoVariableBox_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID)
|
||||||
{
|
{
|
||||||
if(HMI_RET_CANCEL == iActionResult)
|
if(HMI_PROCESS_SUCCESSFUL(eProcResult))
|
||||||
{
|
{
|
||||||
s_uiAutoConfirmTimer = 5;
|
if(HMI_DEMO_PROC_CANCEL == iActionID)
|
||||||
HMI_GoBack(NULL);
|
{
|
||||||
|
s_uiAutoConfirmTimer = 5;
|
||||||
|
HMI_GoBack(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return HMI_RET_NORMAL;
|
return HMI_RET_NORMAL;
|
||||||
@ -291,18 +293,27 @@ void HMI_DemoVariableBox_DrawFrame(SGUI_SCR_DEV* pstIFObj, SGUI_SZSTR szTitle)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
SGUI_BOX_FRAME_STRUCT stFrameData;
|
SGUI_RECT_AREA stTextDisplayArea;
|
||||||
|
SGUI_RECT_AREA stTextDataArea;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
stFrameData.Parameter.EdgeLayers = 2;
|
stTextDisplayArea.PosX = 4;
|
||||||
stFrameData.Parameter.FontSize = SGUI_FONT_SIZE_H12;
|
stTextDisplayArea.PosY = 4;
|
||||||
stFrameData.Data.Title = szTitle;
|
stTextDisplayArea.Width = 120;
|
||||||
|
stTextDisplayArea.Height = 12;
|
||||||
|
stTextDataArea.PosX = 0;
|
||||||
|
stTextDataArea.PosY = 0;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
// Draw frame
|
if(NULL != pstIFObj)
|
||||||
SGUI_Frame_DrawFullScreenFrame(pstIFObj, &stFrameData);
|
{
|
||||||
|
SGUI_Basic_DrawRectangle(pstIFObj, 0, 0, RECT_WIDTH(pstIFObj->stSize), RECT_HEIGHT(pstIFObj->stSize), SGUI_COLOR_FRGCLR, SGUI_COLOR_BKGCLR);
|
||||||
|
SGUI_Basic_DrawRectangle(pstIFObj, 2, 2, RECT_WIDTH(pstIFObj->stSize)-4, RECT_HEIGHT(pstIFObj->stSize)-4, SGUI_COLOR_FRGCLR, SGUI_COLOR_TRANS);
|
||||||
|
SGUI_Basic_DrawLine(pstIFObj, 3, 17, 124, 17, SGUI_COLOR_FRGCLR);
|
||||||
|
SGUI_Text_DrawSingleLineText(pstIFObj, szTitle, SGUI_FONT_SIZE_H12, &stTextDisplayArea, &stTextDataArea, SGUI_DRAW_NORMAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
BIN
Documents/Files/Docs/Dependencies.xlsx
Normal file
BIN
Documents/Files/Docs/Dependencies.xlsx
Normal file
Binary file not shown.
Binary file not shown.
621
Documents/SimpleGUI user manual.md
Normal file
621
Documents/SimpleGUI user manual.md
Normal file
@ -0,0 +1,621 @@
|
|||||||
|
<h1 id="0">目录</h1>
|
||||||
|
|
||||||
|
* [1. 概述](#1)
|
||||||
|
* [2. GUI](#2)
|
||||||
|
* [3. HMI](#3)
|
||||||
|
* [4. 其他应用技巧](#4)
|
||||||
|
* [5. 使用限制](#5)
|
||||||
|
* [6. 联系开发者](#6)
|
||||||
|
-------
|
||||||
|
<h2 id="1">1. 概述</h2>
|
||||||
|
|
||||||
|
  本文将详细介绍SimpleGUI各个机能模块的组成、依赖关系与实现原理,方便用户根据自己的具体需求对SimpleGUI进行必要的修改、剪裁或二次开发。
|
||||||
|
  SimpleGUI分为GUI和HMI两部分,GUI部分负责显示和绘图控制,HMI则提供了一种构件和管理界面的逻辑关系的手段,方便开发者分离业务逻辑和画面显示,更有利于编写和维护。如果不需要,HMI可不使用。
|
||||||
|
|
||||||
|
<返回到[目录](#0)/[标题](#1)>
|
||||||
|
|
||||||
|
<h2 id="2">2. GUI</h2>
|
||||||
|
|
||||||
|
### 2.1. 基本数据类型
|
||||||
|
  为避免在因不同平台、不同编译器下对不同基本数据类型的定义不同导致的可能潜在的问题,SimpleGUI单独使用了一个名为SGUI_Typedef.h的文件,对SimpleGUI的数据类型进行了重新封装,以避免因为不同数据类型的表达范围、指针等问题导致难以调查的系统异常。
|
||||||
|
|
||||||
|
### 2.2. 设备驱动
|
||||||
|
  SimpleGUI对显示设备和资源的使用是通过SGUI_SCR_DEV(SimpleGUI Screen Device)结构体实例来实现的,结构体的定义为:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
//Screen display area size in pixel.
|
||||||
|
SGUI_AREA_SIZE stSize;
|
||||||
|
//Bitmap data buffer.
|
||||||
|
SGUI_BYTE arrBmpDataBuffer[SGUI_BMP_DATA_BUFFER_SIZE];
|
||||||
|
//Engine & device initialize function.
|
||||||
|
SGUI_FN_IF_INITIALIZE fnInitialize;
|
||||||
|
//Clear screen function.
|
||||||
|
SGUI_FN_IF_CLEAR fnClearScreen;
|
||||||
|
//Set pixel value function.
|
||||||
|
SGUI_FN_IF_SET_POINT fnSetPixel;
|
||||||
|
//Get pixel value function.
|
||||||
|
SGUI_FN_IF_GET_POINT fnGetPixel;
|
||||||
|
// Refresh screen display.
|
||||||
|
SGUI_FN_IF_REFRESH fnRefreshScreen;
|
||||||
|
}SGUI_SCR_DEV;
|
||||||
|
```
|
||||||
|
  此数据结构的定义位于SGUI_Typedef.h文件中,包含若干函数指针,用户需要声明一个此类型的结构体,然后按照结构体中函数指针的数据类型设计和实现相应功能的设备驱动函数,并将对应的函数指针注册到结构体实例,然后在调用SimpleGUI绘图函数时,将该结构体的指针作为参数传入函数(通常是参数表的第一个参数)。
|
||||||
|
  结构体各成员的功能描述如下:
|
||||||
|
|指针|函数功能|参数表|返回值|
|
||||||
|
|:--|:--|:--|:--|
|
||||||
|
|stSize|保存屏幕设备的现实尺寸,单位为像素。|-|-|
|
||||||
|
|arrBmpDataBuffer|字节数组,用于在位图绘制(包括文字绘制)时读取位图数据。|-|-|
|
||||||
|
|fnInitialize|设备初始化,通常由HMI部分调用。|void|SGUI_INT|
|
||||||
|
|fnClearScreen|清除屏幕显示,如果使用了显示缓存,同时清除缓存。|void|void|
|
||||||
|
|fnSetPixel|设定像素值,0为灭1为亮。|SGUI_INT, SGUI_INT, SGUI_INT|void|
|
||||||
|
|fnGetPixel|读取像素值,0为灭1为亮。|SGUI_INT, SGUI_INT|SGUI_INT|
|
||||||
|
|fnRefreshScreen|更新屏幕显示,通常指将显示缓存的数据同步到设备。|void|void|
|
||||||
|
|
||||||
|
  具体的数据类型定义请参考SGUI_Typedef.h文件的内容。
|
||||||
|
  在使用SimpleGUI之前,首先需要您实现您目标平台上对屏幕设备的操作函数。实现内容至少包括设备初始化、读像素和写像素三个接口。
|
||||||
|
  如果不考虑执行效率,以上三个函数实现后就,SimpleGUi就可以工作了,当然,如果想更有效的绘图,还需根据驱动程序的逻辑结构、缓存的数据结构、硬件特性等因素实现其他的接口函数,如清除屏幕、更新屏幕、水平线绘制、垂直线绘制等,如果使用了显示缓存,那么还有必要实现缓存同步函数,以实现将缓存内容同步到屏幕的功能。
|
||||||
|
  以下为演示例程中对该结构体实例的声明和使用。
|
||||||
|
```c++
|
||||||
|
SGUI_SCR_DEV g_stDeviceInterface;
|
||||||
|
|
||||||
|
SGUI_SystemIF_MemorySet(&g_stDeviceInterface, 0x00, sizeof(SGUI_SCR_DEV));
|
||||||
|
/* Initialize display size. */
|
||||||
|
g_stDeviceInterface.stSize.Width = 128;
|
||||||
|
g_stDeviceInterface.stSize.Height = 64;
|
||||||
|
/* Initialize interface object. */
|
||||||
|
g_stDeviceInterface.stActions.fnSetPixel = OLED_SetPixel;
|
||||||
|
g_stDeviceInterface.stActions.fnGetPixel = OLED_GetPixel;
|
||||||
|
g_stDeviceInterface.stActions.fnClearScreen = OLED_ClearDisplay;
|
||||||
|
g_stDeviceInterface.stActions.fnRefreshScreen = OLED_RefreshScreen;
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.3. 功能函数
|
||||||
|
|
||||||
|
  SimpleGUI的所有功能函数可以简单的划分为“平台接口”、“共通机能”、“基础绘图”和“控件”四部分。
|
||||||
|
####   平台接口
|
||||||
|
  此部分接口的实现位于SGUI_Interface.c文件中,封装或实现包括内存块复制(memcpy)、赋值(memset)、申请与释放(malloc/free)字符串的复制(strcpy/strncpy)、长度测量(strlen)以及时间(RTC时间)的获取、Flash(包括内部和外部)中数据的获取等依赖于系统平台的机能实现。
|
||||||
|
####   共通机能
|
||||||
|
  此部分接口的实现位于SGUI_Common.c文件中,封装或实现了包括数字与字符串之间的格式化转换、以及小数点的插入等。由于SimpleGUI中全程避免使用浮点数,所以小数点基本上都是通过格式化字符串得来,请悉知。
|
||||||
|
####   基础绘图
|
||||||
|
  此部分接口的实现位于SGUI_Basic.c文件中,封装或实现了点、线、圆形、矩形以及位图的绘制,以及区域反色、屏幕内容的更新(仅在使用显示缓存时有用)与清除等。
|
||||||
|
####   控件
|
||||||
|
  此部分也可被称为“组件”,实现于多个文件中,提供了多种方便使用的函数。
|
||||||
|
|
||||||
|
|文件名|功能概要|
|
||||||
|
|:--|:-- |
|
||||||
|
|SGUI_Text.c|提供封装好的文字绘制功能、包括单行、多行以及绘制文字前需要的部分预演算等。|
|
||||||
|
|SGUI_Frame.c|边框绘制功能,用于绘制屏幕边框,例如列表和实时曲线的窗口边框等。|
|
||||||
|
|SGUI_Notice.c|用于显示消息提示框,提示一些文字内容,可带图标,类似Windows中的MessageBox。|
|
||||||
|
|SGUI_ScrollBar.c|提供显示水平或垂直滚动条的功能。|
|
||||||
|
|SGUI_ProcessBar.c|提供进度条的显示功能,支持上、下、左、右四个生长方向。|
|
||||||
|
|SGUI_List|提供列表显示功能,可以显示一个列表,列表项目可以为枚举字符串型、整数型、小数型或不带参数的普通型。|
|
||||||
|
|SGUI_VariableBox.c|提供数值输入和字符串输入两种输入框接口。|
|
||||||
|
|SGUI_RealtimeGraph.c|提供封装好的实时曲线界面接口,可以在屏幕上根据用户输入的点数据绘制和现实一条实时曲线。|
|
||||||
|
|
||||||
|
  以上文件均提供同名的头文件(.h),可以直接包含和调用。
|
||||||
|
|
||||||
|
  所有的控件的实例在显示和操作中,均使用一个结构体进行数据和参数的保存,同时,所有的控件均提供画面更新接口(SGUI_XXX_Refresh函数),用以在任何需要的时候恢复控件在屏幕设备上的显示。此方法的设计意在在绝大多数情况下可以取代图层的概念。
|
||||||
|
|
||||||
|
### 2.4. 依赖关系
|
||||||
|
|
||||||
|
  SimpleGUI为了可以在一定程度上实现剪裁,将代码设计为前文描述的四部分,四部分从高到低,大体呈依赖关系,例如控件的实现依赖基础绘图、基础绘图的实现依赖共通机能、共通机能的实现一定程度上依赖平台接口。以最常用的列表为例,列表的实现、依赖Text、ScrollBar两个控件、Text中的文本绘制功能、以及基础绘图的区域反色功能。
|
||||||
|
  截至目前,SimpleGUI的所有功能模块之间的依赖关系请参照“Dependencies.xlsx”文件。在开发时可依照此文档对SimpleGUI进行适当剪裁以避免资源浪费。
|
||||||
|
|
||||||
|
<返回到[目录](#0)/[标题](#2)>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="3">3. HMI</h2>
|
||||||
|
|
||||||
|
### 3.1 HMI概述
|
||||||
|
  HMI模型作为SimpleGUI的附加组件存在,意在使用相对固定的数据格式及代码逻辑,帮助开发者方便的编写和完成便于维护和拓展的用户交互动作。
|
||||||
|
  HMI主要分为“画面”和“交互引擎”两部分,交互引擎负责外来事件、数据的组织与预处理、并调用用户预先准备好的屏幕绘制函数更新屏幕显示。而屏幕显示的操作,则交由画面部分完成。
|
||||||
|
|
||||||
|
### 3.2 画面
|
||||||
|
  HMI模型在在设计之初,虽然使用C语言的语法,但是使用了C++中“类”和“对象”的概念进行构建和管理,每一个画面都是一个对象,都具有画面动作,概念上类似于类的成员方法,包含“初始化”、“准备”、“事件处理”、“画面更新”、“后处理”五个部分,以下称为画面动作对象。
|
||||||
|
  画面动作对象的数据格式定义如下:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
// Screen action interface function pointer structure.
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
// Initialize screen data and parameter.
|
||||||
|
HMI_ENGINE_RESULT (*Initialize) (SGUI_SCR_DEV* Interface);
|
||||||
|
// Do some thing before current screen display.
|
||||||
|
HMI_ENGINE_RESULT (*Prepare) (SGUI_SCR_DEV* Interface, const void* pstParameters);
|
||||||
|
// Repaint screen if needed.
|
||||||
|
HMI_ENGINE_RESULT (*Repaint) (SGUI_SCR_DEV* Interface, const void* pstParameters);
|
||||||
|
// Process event.
|
||||||
|
HMI_ENGINE_RESULT (*ProcessEvent) (SGUI_SCR_DEV* Interface, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
|
// Post process.
|
||||||
|
HMI_ENGINE_RESULT (*PostProcess) (SGUI_SCR_DEV* Interface, SGUI_INT iActionID);
|
||||||
|
}HMI_SCREEN_ACTION;
|
||||||
|
```
|
||||||
|
|
||||||
|
  各个成员的功能说明如下:
|
||||||
|
|
||||||
|
|变量名|功能概要|
|
||||||
|
|:--|:-- |
|
||||||
|
|Initialize|函数指针,指向画面的初始化函数。|
|
||||||
|
|Prepare|函数指针,指向画面对象的准备函数,通常用于画面显示前或事件处理前的一些预处理。|
|
||||||
|
|Repaint|函数指针,指向画面更新函数,意在必要时更新画面显示。|
|
||||||
|
|ProcessEvent|函数指针,指向画面的事件处理函数,用户的操作或设备、外部中断的信息在有必要更新显示时,通过此函数通知到画面并做相应处理。|
|
||||||
|
|PostProcess|函数指针,消息处理后的后续处理,例如需要变更到其他画面显示、返回等。|
|
||||||
|
|
||||||
|
  而在一个系统中,不可能只有一个画面,所以画面对象除了包含画面动作对象外,还包含前指针以及画面ID的记录。画面对象数据格式的定义如下:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
// Screen data structure.
|
||||||
|
typedef struct _T_HMI_SCREEN_OBJECT_
|
||||||
|
{
|
||||||
|
SGUI_INT iScreenID;
|
||||||
|
HMI_SCREEN_ACTION* pstActions;
|
||||||
|
struct _T_HMI_SCREEN_OBJECT_* pstPrevious;
|
||||||
|
}HMI_SCREEN_OBJECT;
|
||||||
|
```
|
||||||
|
|
||||||
|
  各个成员的功能说明如下:
|
||||||
|
|
||||||
|
|变量名|功能概要|
|
||||||
|
|:--|:-- |
|
||||||
|
|iScreenID|画面ID,每一个画面应该有一个专用的、不重复的ID用于索引对象本身。|
|
||||||
|
|pstActions|画面动作对象指针,指向画面动作处理函数对象。|
|
||||||
|
|pstPrevious|前画面指针,默认情况下为NULL,当画面显示时,此指针将被修改为指向前一个画面的对象。|
|
||||||
|
|
||||||
|
  此结构体才是用来操作“画面”的对象,所有的画面对象都以此格式声明和定义,使画面数据的操作、事件的响应统一化,进而方便画面的管理与扩充。在设计画面时,为了代码维护方便,推荐每个画面对应的处理都实现在单独的文件中,这样一来,每一个文件就被抽象成了一个“画面对象”,类似C++中类的实例。
|
||||||
|
  接下来以实时曲线为例,简要说明一下画面的组织与构成。具体逻辑可以参照DemoProc文件夹下的src/RealtimeGraph.c文件。为讲解方便,讲解代码与演示工程的实例有所出入,请悉知。
|
||||||
|
|
||||||
|
  在RealtimeGraph.c文件中,对Action对象的声明和定义如下:
|
||||||
|
```c++
|
||||||
|
static HMI_SCREEN_ACTION s_stDemoRealtimeGraphActions = {
|
||||||
|
HMI_DemoRealGraph_Initialize,
|
||||||
|
HMI_DemoRealGraph_Prepare,
|
||||||
|
HMI_DemoRealGraph_RefreshScreen,
|
||||||
|
HMI_DemoRealGraph_ProcessEvent,
|
||||||
|
HMI_DemoRealGraph_PostProcess,
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
  对应的五个函数的原型声明如下:
|
||||||
|
```c++
|
||||||
|
static HMI_DemoRealGraph_Initialize(SGUI_SCR_DEV* pstIFObj);
|
||||||
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_Prepare(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_RefreshScreen(SGUI_SCR_DEV* pstIFObj, const void* pstParameters);
|
||||||
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
|
static HMI_ENGINE_RESULT HMI_DemoRealGraph_PostProcess(SGUI_SCR_DEV* pstIFObj, SGUI_INT iActionID);
|
||||||
|
```
|
||||||
|
|
||||||
|
   有了上述的函数和结构体对象定义,接下来,就可以定义画面对象了:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
HMI_SCREEN_OBJECT g_stHMI_DemoRealtimeGraph = {
|
||||||
|
HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH,
|
||||||
|
&s_stDemoRealtimeGraphActions
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
  HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH为实时曲线画面对象的唯一ID,此对象需要全局引用,故此,在DemoProc.hw文件中,做了全局声明:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
extern HMI_SCREEN_OBJECT g_stHMI_DemoRealtimeGraph;
|
||||||
|
```
|
||||||
|
|
||||||
|
  此时,就可以对这个画面对象进行操作了,例如在系统启动,对该画面对象进行初始化时,就可以这样进行操作:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
g_stHMI_DemoRealtimeGraph.pstActions->Initialize(&g_stDeviceInterface);
|
||||||
|
```
|
||||||
|
|
||||||
|
  同理,需要显示前准备或者画面更新时也可以这样操作:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
g_stHMI_DemoRealtimeGraph.pstActions->Prepare(&g_stDeviceInterface, pstData);
|
||||||
|
g_stHMI_DemoRealtimeGraph.pstActions->Repaint(&g_stDeviceInterface, NULL);
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.3 事件
|
||||||
|
|
||||||
|
  SimpleGUI的HMI模型中,画面对外部的响应是以一种被称为“事件”的处理方式进行的。画面对事件的响应,是通过画面动作对象的ProcessEvent指针指向的函数进行处理与响应的。每一个事件都含有一个事件头,事件头中包含了事件的Type、ID和Size三种信息,Type和ID均由用户自由定义,并在事件的发送和画面对象的事件处理过程中使用。HMI模型不参与Type与ID的定义、修改与判断。
|
||||||
|
  事件头的数据结构定义如下。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
HMI_EVENT_TYPE eType;
|
||||||
|
SGUI_INT iID;
|
||||||
|
SGUI_INT iSize;
|
||||||
|
}HMI_EVENT_BASE;
|
||||||
|
```
|
||||||
|
|
||||||
|
  HMI模型的事件分为两种,一种是通用事件,这种事件只有一个头部,包含着Type和ID信息,通常用来通知一些周期性事件,例如定时器、闹钟、固定的按键等等。
|
||||||
|
  通用事件的数据结构定义如下。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
HMI_EVENT_BASE Head;
|
||||||
|
}HMI_GENERAL_EVENT;
|
||||||
|
```
|
||||||
|
|
||||||
|
  另外一种叫做自定义事件,自定义事件除了普通的事件头信息外,还可以夹带一些用户自定义的数据,为了达成这种设计目的而不消耗过多内存,HMI提供了一下宏定义方便用户声明自定义的事件类型。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
#define HMI_EVENT_TYPE_DECLARE(NAME, DATA) \
|
||||||
|
typedef struct \
|
||||||
|
{ \
|
||||||
|
HMI_EVENT_BASE Head; \
|
||||||
|
DATA Data; \
|
||||||
|
}NAME;
|
||||||
|
```
|
||||||
|
|
||||||
|
  其中NAME为新的事件类型名,DATA为新事件需要夹带的数据结构定义。
|
||||||
|
  这样的好处就是,可以使用类似于C++中“继承”的概念。在画面对象的消息处理中,所有事件均可以先以事件头(HMI_EVENT_BASE)的格式进行解析,在正确的识别Type和ID后,再使用强制类型转换,对用户自定义的数据类型进行读取。
|
||||||
|
  接下来依然以实时曲线为例,简要说明事件的使用方法。曲线数据来自一个定时器的周期性触发,每触发一次,都产生一个随机数(在VirtualSDK中),然后将这个数字作为数据发送到实时曲线画面对象。详细处理请参照DemoProc文件夹下的DemoProc.c和src/在RealtimeGraph.c文件。为讲解方便,讲解代码与演示工程的实例有所出入,请悉知。
|
||||||
|
|
||||||
|
  实时曲线数据事件类型定义如下:
|
||||||
|
```c++
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
SGUI_INT iValue;
|
||||||
|
}DUMMY_DATA_EVENT_DATA;
|
||||||
|
|
||||||
|
HMI_EVENT_TYPE_DECLARE(DATA_EVENT, DUMMY_DATA_EVENT_DATA);
|
||||||
|
```
|
||||||
|
  定时器触发的处理如下:
|
||||||
|
```c++
|
||||||
|
DATA_EVENT stEvent;
|
||||||
|
SGUI_INT iAction;
|
||||||
|
HMI_EVENT_INIT(stEvent);
|
||||||
|
|
||||||
|
stEvent.Head.eType = HMI_ENGINE_EVENT_DATA;
|
||||||
|
stEvent.Head.iID = EVENT_ID_TIMER;
|
||||||
|
stEvent.Data.iValue = (rand() % 200)-100;
|
||||||
|
|
||||||
|
g_stHMI_DemoRealtimeGraph.pstActions->ProcessEvent(&g_stDeviceInterface, (HMI_EVENT_BASE*)&stEvent, &iAction);
|
||||||
|
|
||||||
|
g_stDeviceInterface->fnRefreshScreen();
|
||||||
|
```
|
||||||
|
  在实时曲线的画面对象中,事件处理如下:
|
||||||
|
```c++
|
||||||
|
HMI_ENGINE_RESULT HMI_DemoRealGraph_ProcessEvent(SGUI_SCR_DEV* pstIFObj, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID)
|
||||||
|
{
|
||||||
|
DATA_EVENT* pstDataEvent;
|
||||||
|
|
||||||
|
if((EVENT_ID_TIMER == pstEvent->iID) && (HMI_ENGINE_EVENT_DATA == pstEvent->eType))
|
||||||
|
{
|
||||||
|
pstDataEvent = (DATA_EVENT*)pstEvent;
|
||||||
|
SGUI_RealtimeGraph_AppendValue(pstIFObj, &s_stRealtimeGraph, pstDataEvent->Data.iValue);
|
||||||
|
HMI_DemoRealGraph_RefreshScreen(pstIFObj, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
  这样,就完成了画面对于特定事件的响应,响应内容可以是用户操作、也可以是传感器或设备数据的更新。
|
||||||
|
|
||||||
|
### 3.4 HMI引擎
|
||||||
|
|
||||||
|
  在一个系统中往往有多个画面,尤其是一些控制系统,通常会包含一些列表之类。
|
||||||
|
以列表为例,按照通常的逻辑,系统中的列表需要这样处理:
|
||||||
|
```
|
||||||
|
选择操作()
|
||||||
|
{
|
||||||
|
选择项目 = 显示列表();
|
||||||
|
switch(选择项目)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
...
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
...
|
||||||
|
break;
|
||||||
|
...
|
||||||
|
default:
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
  这看起来没什么问题,但是如果存在多级列表呢?
|
||||||
|
```
|
||||||
|
选择操作()
|
||||||
|
{
|
||||||
|
选择项目 = 显示列表();
|
||||||
|
switch(选择项目)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
显示二级列表1();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
显示二级列表2();
|
||||||
|
break;
|
||||||
|
...
|
||||||
|
default:
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
  这看起来也没有什么问题,但是仔细想一下,一个列表选择完成后,如果选择操作不结束,那么这个函数永远都在运行中,如果是多级列表,那么未完成操作的函数都将驻留内存,这对内存资源,尤其是栈资源是一种极大的消耗。
|
||||||
|
  解决多级画面内存开销大、方便多画面管理、尽可能隔离画面显示业务与数据处理业务,解决这三大问题才是SimpleGUI的HMI模型存在的真正意义。
|
||||||
|
  以下HMI模型的设计逻辑:
|
||||||
|
|
||||||
|
* 同一时刻,活动在内存中的画面对象只有一个。
|
||||||
|
* 所有画面的逻辑级别一致,不存在层级区别。
|
||||||
|
* 事件的投送不区别画面逻辑,统一发送给当前画面,是否予以响应由画面对象的事件处理函数决定。
|
||||||
|
|
||||||
|
  由于HMI模型中大量使用函数指针进行操作,理解起来可能会比较晦涩,但是如果充分理解以上三点,HMI模型的处理将会变得非常简单。
|
||||||
|
  接下来将简要剖析VirtualSDK中的演示程序中对HMI模型的使用,以此讲解HMI模型的使用方法。
|
||||||
|
  首先是HMI引擎的类型声明:
|
||||||
|
```c++
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
HMI_SCREEN_OBJECT** ScreenObjPtr;
|
||||||
|
SGUI_INT ScreenCount;
|
||||||
|
HMI_SCREEN_OBJECT* CurrentScreenObject;
|
||||||
|
SGUI_SCR_DEV* Interface;
|
||||||
|
}HMI_ENGINE_OBJECT;
|
||||||
|
```
|
||||||
|
|
||||||
|
  由上可知,一个HMI模型中包含以下四部分:
|
||||||
|
|
||||||
|
* 画面对象列表。
|
||||||
|
* 画面对象总数。
|
||||||
|
* 当前活动画面对象指针。
|
||||||
|
* 设备驱动对象指针。
|
||||||
|
|
||||||
|
  然后是DemoProc.c文件中对HMI引擎实例的声明,由于HMI引擎中也包含其他数据结构,所以所有HMI对象相关的声明都在这里:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
SGUI_SCR_DEV g_stDeviceInterface;
|
||||||
|
HMI_SCREEN_OBJECT* g_arrpstScreenObjs[] =
|
||||||
|
{
|
||||||
|
&g_stHMIDemo_ScrollingText,
|
||||||
|
&g_stHMIDemo_List,
|
||||||
|
&g_stHMIDemo_TextNotice,
|
||||||
|
&g_stHMIDemo_RTCNotice,
|
||||||
|
&g_stHMIDemo_VariableBox,
|
||||||
|
&g_stHMI_DemoRealtimeGraph,
|
||||||
|
};
|
||||||
|
HMI_ENGINE_OBJECT g_stDemoEngine;
|
||||||
|
```
|
||||||
|
|
||||||
|
  接下来是DemoProc.c文件中的DemoMainProcess函数,该函数用于模拟在目标平台上的main函数,是演示历程的起点。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
int DemoMainProcess(void)
|
||||||
|
{
|
||||||
|
// Initialize Engine.
|
||||||
|
InitializeEngine();
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
// Check and process heart-beat timer event.
|
||||||
|
if(true == SGUI_SDK_GetEventSyncFlag(ENV_FLAG_IDX_SDK_TIM_EVENT))
|
||||||
|
{
|
||||||
|
SysTickTimerEventProc();
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
KeyPressEventProc();
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
RTCEventProc();
|
||||||
|
SGUI_SDK_SetEvnetSyncFlag(ENV_FLAG_IDX_SDK_RTC_EVENT, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
  然后进入InitializeEngine函数,此函数用于HMI引擎对象的初始化。之前声明的HMI引擎实例和相关的其他实例都将在这里初始化。首先是设备驱动对象:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
SGUI_SystemIF_MemorySet(&g_stDeviceInterface, 0x00, sizeof(SGUI_SCR_DEV));
|
||||||
|
/* Initialize display size. */
|
||||||
|
g_stDeviceInterface.stSize.Width = 128;
|
||||||
|
g_stDeviceInterface.stSize.Height = 64;
|
||||||
|
/* Initialize interface object. */
|
||||||
|
g_stDeviceInterface.fnSetPixel = SGUI_SDK_SetPixel;
|
||||||
|
g_stDeviceInterface.fnGetPixel = SGUI_SDK_GetPixel;
|
||||||
|
g_stDeviceInterface.fnClearScreen = SGUI_SDK_ClearDisplay;
|
||||||
|
g_stDeviceInterface.fnRefreshScreen = SGUI_SDK_RefreshDisplay;
|
||||||
|
```
|
||||||
|
|
||||||
|
  接下来是画面对象:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
SGUI_SystemIF_MemorySet(&g_stDemoEngine, 0x00, sizeof(HMI_ENGINE_OBJECT));
|
||||||
|
/* Prepare HMI engine object. */
|
||||||
|
g_stDemoEngine.ScreenCount = sizeof(g_arrpstScreenObjs)/sizeof(*g_arrpstScreenObjs);
|
||||||
|
g_stDemoEngine.ScreenObjPtr = g_arrpstScreenObjs;
|
||||||
|
g_stDemoEngine.Interface = &g_stDeviceInterface;
|
||||||
|
```
|
||||||
|
|
||||||
|
  至此,HMI模型实例的相关初始化都已经完成,接下来,需要对所有的画面对象进行初始化,初始化方法区别于各个画面业务的不同有所不同,但都可以通过画面动作对象中的Initialize函数指针调用:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
for(iIndex=0; iIndex<g_stDemoEngine.ScreenCount; iIndex++)
|
||||||
|
{
|
||||||
|
if( (NULL != g_stDemoEngine.ScreenObjPtr[iIndex])
|
||||||
|
&& (NULL != g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions)
|
||||||
|
&& (g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions->Initialize)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
g_stDemoEngine.ScreenObjPtr[iIndex]->pstActions->Initialize(&g_stDeviceInterface);
|
||||||
|
g_stDemoEngine.ScreenObjPtr[iIndex]->pstPrevious = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
  这里有一个细节需要注意,每一个画面的pstPrevious成员都需要初始化为NULL。在画面业务处理中,此指针指向业务逻辑中当前画面的前一画面。如果此指针不为空,那么将不能切换至该画面(不可重入)。
|
||||||
|
  这样设计是因为,如果画面迁移顺序为A->B->C->B->D->E,那么根据SimpleGUI的设计特性,每一个画面都有专门的对象记录相关数据,那么第二次进入B画面时,B画面的数据就会被修改,而返回上一画面时,数据也只能保留最后一次修改的数据。所以,在HMI中要求,只要业务逻辑不同,就不能使用同一个画面对象,即使这两个对象的显示效果完全一致。
|
||||||
|
  在HMI引擎和所有画面对象都初始化完成后,就可以调用HMI_ActiveEngine函数登录并激活HMI引擎对象。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
/* Active engine object. */
|
||||||
|
eProcessResult = HMI_ActiveEngine(&g_stDemoEngine, HMI_SCREEN_ID_DEMO_SCROLLING_TEXT);
|
||||||
|
```
|
||||||
|
|
||||||
|
  激活时,可以通过参数指定哪一个画面为起始画面,如果指定的画面找不到,那么HMI将会以画面对象列表中的第一个画面对象为起始画面,同时,HMI引擎对象的CurrentScreenObject指针将会被设定,指向起始画面。
|
||||||
|
  以上所有动作都完成后,调用HMI_StartEngine函数开始显示起始画面,如果画面显示时需要其他数据作为参量,可以通过参数将参量数据的指针传递至画面对象。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
/* Start engine process. */
|
||||||
|
eProcessResult = HMI_StartEngine(NULL);
|
||||||
|
```
|
||||||
|
|
||||||
|
  至此,如果设备驱动程序正常,屏幕上将会显示第一个画面了。
|
||||||
|
  由于之前HMI引擎的CurrentScreenObject成员已经在HMI_ActiveEngine函数中被设定,此后,所有的消息处理都将无视画面实例,直接操作这个指针成员。例程中的列表演示为例,假设我们当前正在列表画面中,这时键盘上的回车键按下,程序将会进入到KeyPressEventProc函数中。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
void KeyPressEventProc(void)
|
||||||
|
{
|
||||||
|
KEY_PRESS_EVENT stEvent;
|
||||||
|
HMI_EVENT_INIT(stEvent);
|
||||||
|
|
||||||
|
stEvent.Head.iType = EVENT_TYPE_ACTION;
|
||||||
|
stEvent.Head.iID = EVENT_ID_KEY_PRESS;
|
||||||
|
stEvent.Data.uiKeyValue = SGUI_SDK_GetKeyEventData();
|
||||||
|
HMI_ProcessEvent((HMI_EVENT_BASE*)(&stEvent));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
  此函数将调用HMI_ProcessEvent函数,将按键事件传递到CurrentScreenObject指针指向的画面实例中。
|
||||||
|
|
||||||
|
```c++
|
||||||
|
HMI_ENGINE_RESULT HMI_ProcessEvent(const HMI_EVENT_BASE* pstEvent)
|
||||||
|
{
|
||||||
|
......
|
||||||
|
eProcessResult = pstCurrentScreen->pstActions->ProcessEvent(g_pstActivedEngineObject->Interface, pstEvent, &iActionID);
|
||||||
|
......
|
||||||
|
eProcessResult = pstCurrentScreen->pstActions->PostProcess(g_pstActivedEngineObject->Interface, eProcessResult, iActionID);
|
||||||
|
......
|
||||||
|
if( (NULL != g_pstActivedEngineObject->Interface) &&
|
||||||
|
(NULL != g_pstActivedEngineObject->Interface->fnRefreshScreen))
|
||||||
|
{
|
||||||
|
g_pstActivedEngineObject->Interface->fnRefreshScreen();
|
||||||
|
}
|
||||||
|
......
|
||||||
|
return eProcessResult;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
  上述代码只保留了关键部分,详细请参考HMI_Engine.c文件中HMI_ProcessEvent函数的实现。
|
||||||
|
  由上述代码段可见,事件实例以指针的形式传递到了CurrentScreenObject指针指向的画面实例中,在事件处理函数ProcessEvent执行完毕后,又调用了PostProcess函数进行“后处理”,然后调用设备实例的fnRefreshScreen函数更新画面显示(更新画面显示的操作通常在显示设备使用显示缓存的情况下才需要实现并调用)。具体的事件响应处理,请参照前文针对事件的讲解,参考DemoProc文件夹中的src/List.c文件中事件处理函数HMI_DemoList_ProcessEventh的实现。
|
||||||
|
  在事件处理完成后,HMI引擎同时调用了PostProcess指针,执行了画面的“后处理函数”。所谓“后处理”,就是根据事件的响应结果,执行一些h后续需要的处理,如画面切换、数据更新等等。
|
||||||
|
  下面是事件处理和后处理函数的原型声明:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
HMI_ENGINE_RESULT (*ProcessEvent)(SGUI_SCR_DEV* Interface, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
|
|
||||||
|
HMI_ENGINE_RESULT (*PostProcess)(SGUI_SCR_DEV* Interface, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
|
```
|
||||||
|
|
||||||
|
  后处理函数的第一个参数为显示设备对象,不做过多解释。第二个参数eProcResult为事件处理函数的执行结果,如果没有发生异常,通常为HMI_RET_NORMAL, 第三个参数iActionID为用户自由使用的参数,来源为事件处理函数的最后一个出口参数piActionID,用来传递一些事件处理函数产生的结果。
|
||||||
|
  以列表的演示代码为例,HMI_DemoList_PostProcessh函数的处理如下:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
HMI_ENGINE_RESULT HMI_DemoList_PostProcess(SGUI_SCR_DEV* pstIFObj, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID)
|
||||||
|
{
|
||||||
|
......
|
||||||
|
if(HMI_DEMO_PROC_CONFIRM == iActionID)
|
||||||
|
{
|
||||||
|
uiSelectListIndex = s_stDemoListObject.ControlVariable.SelectIndex;
|
||||||
|
switch(SGUI_List_GetListItemPtr(&s_stDemoListObject, uiSelectListIndex)->ItemID)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
// Show notice.
|
||||||
|
pstSelectedItem = SGUI_List_GetListItemPtr(&s_stDemoListObject, uiSelectListIndex);
|
||||||
|
iListItemParameterValue = pstSelectedItem->Valid.Value;
|
||||||
|
if(0 == iListItemParameterValue)
|
||||||
|
{
|
||||||
|
sprintf(s_szNoticeTextBuffer, DEMO_LIST_NOTICE_TEXT_FMT, uiSelectListIndex);
|
||||||
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_TEXT_NOTICE, s_szNoticeTextBuffer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_RTC_NOTICE, NULL);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_VARIABLE_BOX, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
{
|
||||||
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
sprintf(s_szNoticeTextBuffer, DEMO_LIST_NOTICE_TEXT_FMT, uiSelectListIndex);
|
||||||
|
HMI_SwitchScreen(HMI_SCREEN_ID_DEMO_TEXT_NOTICE, s_szNoticeTextBuffer);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(HMI_DEMO_PROC_CANCEL == iActionID)
|
||||||
|
{
|
||||||
|
HMI_GoBack(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return HMI_RET_NORMAL;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
  由上可以看出,列表演示程序的后处理中,根据用户选择的列表项的不同,会调用HMI引擎的HMI_SwitchScreen函数切换到相应的画面显示,或调用HMI_GoBack函数返回之前的画面。
|
||||||
|
  HMI_SwitchScreen函数的主要实现如下:
|
||||||
|
```c++
|
||||||
|
HMI_ENGINE_RESULT HMI_SwitchScreen(SGUI_INT iDestScreenID, const void* pstParameters)
|
||||||
|
{
|
||||||
|
......
|
||||||
|
pstDestScreen = HMI_GetScreenObjectInEngine(g_pstActivedEngineObject, iDestScreenID);
|
||||||
|
......
|
||||||
|
pstDestScreen->pstPrevious = g_pstActivedEngineObject->CurrentScreenObject;
|
||||||
|
......
|
||||||
|
g_pstActivedEngineObject->CurrentScreenObject = pstDestScreen;
|
||||||
|
......
|
||||||
|
eProcessResult = pstDestScreen->pstActions->Prepare(g_pstActivedEngineObject->Interface, pstParameters);
|
||||||
|
......
|
||||||
|
return eProcessResult;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
  HMI_SwitchScreen函数将根据用户指定的ID,查找相应的画面对象,将找到的画面对象的前画面指针指向当前画面,并将HMI实例的CurrentScreenObject指向新的画面实例,然后调用新实例的Prepare函数完成画面准备与切换,HMI_GoBack函数原理类似,不同点在于画面实例的指针来自于当前画面的pstPrevious成员而非通过ID查找新实例。
|
||||||
|
  以上就是HMI引擎的工作原理,SimpleGUI的HMI引擎的特点就是画面的所有操作无需等待,运行后立即退出,不长期占用栈空间,对内存栈资源的开销相对较小。同时可以便捷的通过HMI引擎对画面和功能进行扩充,可维护性较强。
|
||||||
|
  其他详细的函数处理与实现,请参考源代码。
|
||||||
|
|
||||||
|
<返回到[目录](#0)/[标题](#3)>
|
||||||
|
|
||||||
|
<h2 id="4">4. 其他应用技巧</h2>
|
||||||
|
|
||||||
|
### 4.1 HMI引擎切换
|
||||||
|
  在使用SimpleGUI的HMI引擎时,如果有必要在系统中依据不同的条件进入不同的交互系统时,可以创建多个HMI对象,并使用HMI_ActiveEngineh函数激活对应的HMI对象。
|
||||||
|
  本质上,HMI引擎在HMI_Engine.c文件中声明了一个指向HMI_ENGINE_OBJECT类型实例的内部指针变量,指向的HMI引擎对象就是当前被激活的HMI引擎,通过HMI_ActiveEngine函数可以将这个指针重新设定并调用新指定HMI引擎中当前活动画面的Prepare方法。进行切换后的初次显示。
|
||||||
|
|
||||||
|
### 4.2 多显示设备
|
||||||
|
  如果系统中需要支持多个显示屏时,可以针对不同的显示屏定义多个设备驱动对象。在需要切换不同的显示设备进行相应控制时,可以使用HMI引擎提供的HMI_SetDeviceObject函数为当前活动的HMI引擎设定新的设备驱动对象,从而实现在多屏环境下的区别控制。
|
||||||
|
|
||||||
|
<返回到[目录](#0)/[标题](#4)>
|
||||||
|
|
||||||
|
<h2 id="5">5. 使用限制</h2>
|
||||||
|
|
||||||
|
  SimpleGUI的GUI部分和HMI部分目前均没有进行线程安全设计,在使用中强烈建议将SimpleGUi的额画面处理放在同一个线程中进行,避免多线程或在中断函数中调用GUI或HMI接口函数,除非在设计期间您可以严格保证使用SimpleGUI处理部分的绝对线程安全。
|
||||||
|
|
||||||
|
|
||||||
|
<返回到[目录](#0)/[标题](#5)>
|
||||||
|
|
||||||
|
<h2 id="6">6. 联系开发者</h2>
|
||||||
|
|
||||||
|
  首先,感谢您对SimpleGUI的赏识与支持。
|
||||||
|
  虽然最早仅仅作为一套GUI接口库使用,但我最终希望SimpleGUI能够为您提供一套完整的单色屏GUI及交互设计解决方案,如果您有新的需求、提议亦或想法,欢迎在以下地址留言,或加入[QQ交流群799501887](https://jq.qq.com/?_wv=1027&k=5ahGPvK)留言交流。
|
||||||
|
>SimpleGUI@开源中国:https://www.oschina.net/p/simplegui
|
||||||
|
>SimpleGUI@码云:https://gitee.com/Polarix/simplegui
|
||||||
|
|
||||||
|
  本人并不是全职的开源开发者,依然有工作及家庭的琐碎事务要处理,所以对于大家的需求和疑问反馈的可能并不及时,多有怠慢,敬请谅解。
|
||||||
|
  最后,再次感谢您的支持。
|
@ -1,86 +0,0 @@
|
|||||||
SimpleGUI 结构介绍
|
|
||||||
---
|
|
||||||
## 1. 概述
|
|
||||||
|
|
||||||
  本文将详细介绍SimpleGUI各个机能模块的组成与依赖关系,方便用户根据自己的具体需求对SimpleGUI进行必要的剪裁,以实现资源消耗的最小化。
|
|
||||||
  SimpleGUI分为GUI和HMI两部分,GUI部分负责显示和绘图控制,HMI则提供了一种构件和管理界面的逻辑关系的手段,方便开发者分离业务逻辑和画面显示,更有利于编写和维护。如果不需要,HMI可不使用。
|
|
||||||
|
|
||||||
## 2. GUI部分
|
|
||||||
|
|
||||||
### 2.1. 基本数据类型
|
|
||||||
  为避免在因不同平台、不同编译器下对不同基本数据类型的定义不同导致的可能潜在的问题,SimpleGUI单独使用了一个名为SGUI_Typedef.h的文件,对SimpleGUI的数据类型进行了重新封装,以避免因为不同数据类型的表达范围、指针等问题导致难以调查的系统异常。
|
|
||||||
|
|
||||||
### 2.2. 设备驱动
|
|
||||||
  在使用SimpleGUI之前,首先需要您实现您目标平台上对屏幕设备的操作函数。实现内容至少为:
|
|
||||||
|函数功能|参数表|返回值|
|
|
||||||
|:--|:--|:--|
|
|
||||||
|读取屏幕像素点|SGUI_INT iX, SGUI_INT iY|SGUI_INT|
|
|
||||||
|设定(写入)屏幕像素点|SGUI_INT iX, SGUI_INT iY, SGUI_INT iColor|void|
|
|
||||||
|
|
||||||
  如果不考虑执行效率,以上两个函数实现后就,SimpleGUi就可以工作了,当然,如果想更有效的绘图,还需根据驱动程序的逻辑结构、缓存的数据结构、硬件特性等因素实现其他的接口函数,如清除屏幕、更新屏幕、水平线绘制、垂直线绘制等。
|
|
||||||
|
|
||||||
  SimpleGUI对显示设备的操作是通过一个名为SGUI_SCR_DEV(SimpleGUI Screen Device)的结构体实例来实现的,结构体的定义为:
|
|
||||||
|
|
||||||
```c++
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
//Engine & device initialize function.
|
|
||||||
SGUI_ENGINE_ACTION_FN_INITIALIZE fnInitialize;
|
|
||||||
//Clear screen function.
|
|
||||||
SGUI_ENGINE_ACTION_FN_CLEAR fnClearScreen;
|
|
||||||
//Set pixel value function.
|
|
||||||
SGUI_ENGINE_ACTION_FN_SET_POINT fnSetPixel;
|
|
||||||
//Get pixel value function.
|
|
||||||
SGUI_ENGINE_ACTION_FN_GET_POINT fnGetPixel;
|
|
||||||
// Refresh screen display.
|
|
||||||
SGUI_ENGINE_ACTION_FN_REFRESH fnRefreshScreen;
|
|
||||||
}SGUI_SCR_DEV;
|
|
||||||
```
|
|
||||||
  此数据结构的定义位于SGUI_Typedef.h文件中,包含若干函数指针,用户需要声明一个此类型的结构体,然后按照结构体中函数指针的数据类型设计和实现相应功能的设备驱动函数,并将对应的函数指针注册到结构体实例,然后在调用SimpleGUI绘图函数时,将该结构体的指针作为参数传入函数(通常是参数表的第一个参数)。
|
|
||||||
|
|
||||||
  除前文描述的像素点读写函数外,SGUI_SCR_DEV结构体中的其他函数通常只有在需要实现显示缓存时才可能用到,描述如下:
|
|
||||||
|指针|函数功能|参数表|返回值|
|
|
||||||
|:--|:--|:--|:--|
|
|
||||||
|fnInitialize|设备初始化,通常由HMI部分调用。|void|SGUI_INT|
|
|
||||||
|fnClearScreen|清除屏幕显示,如果使用了显示缓存,同时清除缓存。|void|void|
|
|
||||||
|fnRefreshScreen|更新屏幕显示,通常指将显示缓存的数据同步到设备。|void|void|
|
|
||||||
|
|
||||||
|
|
||||||
  其他具体的数据类型定义请参考SGUI_Typedef.h文件的内容。
|
|
||||||
|
|
||||||
### 2.3. 逻辑结构
|
|
||||||
|
|
||||||
  SimpleGUI的所有接口有着明确的包含关系,可以简单的划分为“平台接口”、“共通机能”、“基础绘图”和“控件”四部分。
|
|
||||||
|
|
||||||
####   平台接口
|
|
||||||
  此部分接口的实现位于SGUI_Interface.c文件中,封装或实现包括内存块复制(memcpy)、赋值(memset)、申请与释放(malloc/free)字符串的复制(strcpy/strncpy)、长度测量(strlen)以及当前时间(RTC时间)的获取、Flash(包括内部和外部)中数据的获取等依赖于系统平台的机能实现。
|
|
||||||
####   共通机能
|
|
||||||
  此部分接口的实现位于SGUI_Common.c文件中,封装或实现了包括数字与字符串之间的格式化转换、以及小数点的插入等。由于SimpleGUI中全程避免使用浮点数,所以小数点基本上都是通过格式化字符串得来,请悉知。
|
|
||||||
####   基础绘图
|
|
||||||
  此部分接口的实现位于SGUI_Basic.c文件中,封装或实现了点、线、圆形、矩形以及位图的绘制,以及区域反色、屏幕内容的更新(仅在使用显示缓存时有用)与清除等。
|
|
||||||
####   控件
|
|
||||||
  此部分也可被称为“组件”,实现于多个文件中,提供了多种方便使用的接口组。
|
|
||||||
|
|
||||||
|文件名|功能概要|
|
|
||||||
|:--|:-- |
|
|
||||||
|SGUI_Text.c|提供封装好的文字绘制接口、包括单行、多行以及绘制文字前需要的部分预演算等。|
|
|
||||||
|SGUI_Frame.c|边框绘制接口,用于绘制屏幕边框,例如列表和实时曲线的窗口边框等。|
|
|
||||||
|SGUI_Notice.c|用于显示一个消息提示框,提示一些文字内容,可带图标,类似Windows中的MessageBox。|
|
|
||||||
|SGUI_ScrollBar.c|提供显示水平或垂直滚动条的接口。|
|
|
||||||
|SGUI_ProcessBar.c|提供进度条的显示接口,支持上、下、左、右四个生长方向。|
|
|
||||||
|SGUI_List|提供列表显示接口,可以显示一个列表,列表项目可以为枚举字符串型、整数型、小数型或不带参数的普通型。|
|
|
||||||
|SGUI_VariableBox.c|提供数值输入和字符串输入两种输入框接口。|
|
|
||||||
|SGUI_RealtimeGraph.c|提供封装好的实时曲线界面接口,可以在屏幕上根据用户输入的点数据绘制和现实一条实时曲线。|
|
|
||||||
|
|
||||||
  以上文件均提供同名的头文件(.h),可以直接包含和调用。
|
|
||||||
|
|
||||||
  所有的控件的实例在显示和操作中,均使用一个结构体进行数据和参数的保存,同时,所有的控件均提供画面更新接口(SGUI_XXX_Refresh函数),用以在任何需要的时候恢复控件在屏幕设备上的显示。此方法的设计意在在绝大多数情况下可以取代图层的概念。
|
|
||||||
|
|
||||||
### 2.4. 依赖关系
|
|
||||||
|
|
||||||
  SimpleGUI为了可以在一定程度上实现剪裁,将代码设计为前文描述的四部分,四部分从高到低,大体呈依赖关系,例如控件的实现依赖基础绘图、基础绘图的实现依赖共通机能、共通机能的实现一定程度上依赖平台接口。
|
|
||||||
  以最常用的列表为例,列表的实现、依赖Frame、ScrollBar两个控件、Text中的文本绘制功能、同时还依赖基础绘图的区域反色功能。
|
|
||||||
  
|
|
||||||
|
|
||||||
|
|
||||||
## 3. HMI模型
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 MiB |
@ -4,6 +4,7 @@
|
|||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
#include "SGUI_Common.h"
|
||||||
|
#include "SGUI_FlashData.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Data type definition. =//
|
//= Data type definition. =//
|
||||||
@ -39,6 +40,5 @@ void SGUI_Basic_DrawRectangle(SGUI_SCR_DEV* pstIFObj, SGUI_UINT uiStartX, SG
|
|||||||
void SGUI_Basic_DrawCircle(SGUI_SCR_DEV* pstIFObj, SGUI_UINT uiCx, SGUI_UINT uiCy, SGUI_UINT uiRadius, SGUI_COLOR eEdgeColor, SGUI_COLOR eFillColor);
|
void SGUI_Basic_DrawCircle(SGUI_SCR_DEV* pstIFObj, SGUI_UINT uiCx, SGUI_UINT uiCy, SGUI_UINT uiRadius, SGUI_COLOR eEdgeColor, SGUI_COLOR eFillColor);
|
||||||
void SGUI_Basic_ReverseBlockColor(SGUI_SCR_DEV* pstIFObj, SGUI_UINT uiStartX, SGUI_UINT uiStartY, SGUI_UINT uiWidth, SGUI_UINT uiHeight);
|
void SGUI_Basic_ReverseBlockColor(SGUI_SCR_DEV* pstIFObj, SGUI_UINT uiStartX, SGUI_UINT uiStartY, SGUI_UINT uiWidth, SGUI_UINT uiHeight);
|
||||||
void SGUI_Basic_DrawBitMap(SGUI_SCR_DEV* pstIFObj, SGUI_RECT_AREA* pstDisplayArea, SGUI_RECT_AREA* pstDataArea, SGUI_FLASH_DATA_SOURCE eDataSource, SGUI_ROM_ADDRESS adDataStartAddr, SGUI_DRAW_MODE eDrawMode);
|
void SGUI_Basic_DrawBitMap(SGUI_SCR_DEV* pstIFObj, SGUI_RECT_AREA* pstDisplayArea, SGUI_RECT_AREA* pstDataArea, SGUI_FLASH_DATA_SOURCE eDataSource, SGUI_ROM_ADDRESS adDataStartAddr, SGUI_DRAW_MODE eDrawMode);
|
||||||
void SGUI_Basic_RefreshDisplay(SGUI_SCR_DEV* pstIFObj);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -30,8 +30,8 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct _st_sgui_list_item_
|
typedef struct _st_sgui_list_item_
|
||||||
{
|
{
|
||||||
SGUI_SIZE Sign;
|
SGUI_SIZE ItemID;
|
||||||
SGUI_CSZSTR Text;
|
SGUI_CSZSTR Text;
|
||||||
SGUI_List_ITEM_TYPE Type;
|
SGUI_List_ITEM_TYPE Type;
|
||||||
SGUI_List_PARAMETER_VALUE Valid;
|
SGUI_List_PARAMETER_VALUE Valid;
|
||||||
SGUI_List_PARAMETER_VALUE Decimal;
|
SGUI_List_PARAMETER_VALUE Decimal;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
#include "SGUI_Common.h"
|
||||||
#include "SGUI_Basic.h"
|
#include "SGUI_Basic.h"
|
||||||
|
#include "SGUI_Text.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= User Macro definition. =//
|
//= User Macro definition. =//
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
#include "SGUI_Common.h"
|
||||||
|
#include "SGUI_Basic.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Data type definition. =//
|
//= Data type definition. =//
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
#include "SGUI_Basic.h"
|
||||||
#include "SGUI_Common.h"
|
#include "SGUI_Common.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
@ -34,6 +34,8 @@ typedef uint32_t SGUI_UINT32;
|
|||||||
|
|
||||||
typedef int SGUI_INT;
|
typedef int SGUI_INT;
|
||||||
typedef unsigned int SGUI_UINT;
|
typedef unsigned int SGUI_UINT;
|
||||||
|
typedef long SGUI_LONG;
|
||||||
|
typedef unsigned long SGUI_ULONG;
|
||||||
typedef unsigned char SGUI_BYTE;
|
typedef unsigned char SGUI_BYTE;
|
||||||
typedef const unsigned char SGUI_CBYTE;
|
typedef const unsigned char SGUI_CBYTE;
|
||||||
typedef size_t SGUI_SIZE;
|
typedef size_t SGUI_SIZE;
|
||||||
|
13
GUI/src/1.txt
Normal file
13
GUI/src/1.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
ドライブ F のボリューム ラベルは Work です
|
||||||
|
ボリューム シリアル番号は EEB2-19FB です
|
||||||
|
|
||||||
|
F:\Workspace\39_Developement\06-Gitee\SimpleGUI_Working\GUI\src のディレクトリ
|
||||||
|
|
||||||
|
[.] [..] 1.txt
|
||||||
|
Listfile.cmd SGUI_Basic.c SGUI_Common.c
|
||||||
|
SGUI_FlashData.c SGUI_Frame.c SGUI_Graph.c
|
||||||
|
SGUI_Interface.c SGUI_List.c SGUI_Notice.c
|
||||||
|
SGUI_ProcessBar.c SGUI_RealtimeGraph.c SGUI_ScrollBar.c
|
||||||
|
SGUI_Text.c SGUI_VariableBox.c
|
||||||
|
15 個のファイル 1,505,620 バイト
|
||||||
|
2 個のディレクトリ 84,545,929,216 バイトの空き領域
|
2
GUI/src/Listfile.cmd
Normal file
2
GUI/src/Listfile.cmd
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dir /w > 1.txt
|
||||||
|
pause
|
@ -10,7 +10,6 @@
|
|||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Basic.h"
|
#include "SGUI_Basic.h"
|
||||||
#include "SGUI_FlashData.h"
|
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= User Macro definition. =//
|
//= User Macro definition. =//
|
||||||
@ -155,7 +154,6 @@ void SGUI_Basic_ClearScreen(SGUI_SCR_DEV* pstIFObj)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SGUI_Basic_DrawRectangle(pstIFObj, 0, 0, RECT_WIDTH(pstIFObj->stSize), RECT_HEIGHT(pstIFObj->stSize), SGUI_COLOR_BKGCLR, SGUI_COLOR_BKGCLR);
|
SGUI_Basic_DrawRectangle(pstIFObj, 0, 0, RECT_WIDTH(pstIFObj->stSize), RECT_HEIGHT(pstIFObj->stSize), SGUI_COLOR_BKGCLR, SGUI_COLOR_BKGCLR);
|
||||||
SGUI_Basic_RefreshDisplay(pstIFObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -551,22 +549,3 @@ void SGUI_Basic_DrawBitMap(SGUI_SCR_DEV* pstIFObj, SGUI_RECT_AREA* pstDisplayAre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
/** Function Name: SGUI_Basic_RefreshDisplay **/
|
|
||||||
/** Purpose: Sync display buffer to screen. **/
|
|
||||||
/** Params: **/
|
|
||||||
/** @ pstIFObj[in]: SimpleGUI object pointer. **/
|
|
||||||
/** Return: None. **/
|
|
||||||
/** Notice: None. **/
|
|
||||||
/*************************************************************************/
|
|
||||||
void SGUI_Basic_RefreshDisplay(SGUI_SCR_DEV* pstIFObj)
|
|
||||||
{
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Process */
|
|
||||||
/*----------------------------------*/
|
|
||||||
if(NULL != pstIFObj)
|
|
||||||
{
|
|
||||||
pstIFObj->fnRefreshScreen();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -8,12 +8,7 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
|
||||||
#include "SGUI_Basic.h"
|
|
||||||
#include "SGUI_Text.h"
|
|
||||||
#include "SGUI_ScrollBar.h"
|
|
||||||
#include "SGUI_List.h"
|
#include "SGUI_List.h"
|
||||||
#include "SGUI_Frame.h"
|
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= User Macro definition. =//
|
//= User Macro definition. =//
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
|
||||||
#include "SGUI_Basic.h"
|
|
||||||
#include "SGUI_Text.h"
|
|
||||||
#include "SGUI_Notice.h"
|
#include "SGUI_Notice.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Basic.h"
|
|
||||||
#include "SGUI_ProcessBar.h"
|
#include "SGUI_ProcessBar.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
|
||||||
#include "SGUI_Text.h"
|
|
||||||
#include "SGUI_RealtimeGraph.h"
|
#include "SGUI_RealtimeGraph.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Basic.h"
|
|
||||||
#include "SGUI_ScrollBar.h"
|
#include "SGUI_ScrollBar.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
@ -9,9 +9,7 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
|
||||||
#include "SGUI_Text.h"
|
#include "SGUI_Text.h"
|
||||||
#include "SGUI_Basic.h"
|
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "SGUI_Common.h"
|
|
||||||
#include "SGUI_Basic.h"
|
|
||||||
#include "SGUI_Text.h"
|
|
||||||
#include "SGUI_VariableBox.h"
|
#include "SGUI_VariableBox.h"
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
// GoBack history size
|
// GoBack history size
|
||||||
#define HMI_SCREEN_HISTORY_MAX (20)
|
#define HMI_SCREEN_HISTORY_MAX (20)
|
||||||
#define HMI_SCREEN_LIST_MAX (20)
|
|
||||||
#define HMI_EVENT_KEY_VALUE_LENGTH_MAX (4)
|
#define HMI_EVENT_KEY_VALUE_LENGTH_MAX (4)
|
||||||
// Parameter post label.
|
// Parameter post label.
|
||||||
#define HMI_SCREEN_ID_ANY (-1) // This label means parameter will posted to every screen.
|
#define HMI_SCREEN_ID_ANY (-1) // This label means parameter will posted to every screen.
|
||||||
|
|
||||||
#define HMI_PROCESS_SUCCESSFUL(RESULT) (RESULT >= 0)
|
#define HMI_PROCESS_SUCCESSFUL(RESULT) (RESULT >= 0)
|
||||||
|
#define HMI_PROCESS_FAILED(RESULT) (!(HMI_PROCESS_SUCCESSFUL(RESULT)))
|
||||||
|
|
||||||
// Start screen definition
|
// Start screen definition
|
||||||
#define HMI_SCREEN_START (0)
|
#define HMI_SCREEN_START (0)
|
||||||
@ -32,7 +32,7 @@ typedef struct \
|
|||||||
{ \
|
{ \
|
||||||
HMI_EVENT_DATA_MEMSET(EVENT); \
|
HMI_EVENT_DATA_MEMSET(EVENT); \
|
||||||
EVENT.Head.iSize = sizeof(EVENT); \
|
EVENT.Head.iSize = sizeof(EVENT); \
|
||||||
EVENT.Head.eType = HMI_ENGINE_EVENT_ANY; \
|
EVENT.Head.iType = EVENT_TYPE_ANY; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HMI_EVENT_SIZE_CHK(EVENT, TYPE) (((EVENT).Head.iSize == sizeof(TYPE))?SGUI_TRUE:SGUI_FALSE)
|
#define HMI_EVENT_SIZE_CHK(EVENT, TYPE) (((EVENT).Head.iSize == sizeof(TYPE))?SGUI_TRUE:SGUI_FALSE)
|
||||||
@ -44,43 +44,23 @@ typedef struct \
|
|||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
// Abnormal.
|
// Abnormal.
|
||||||
HMI_RET_ERROR = -1,
|
HMI_RET_ERROR = -3,
|
||||||
HMI_RET_INVALID_DATA = -2,
|
HMI_RET_INVALID_DATA = -2,
|
||||||
HMI_RET_NO_SPACE = -3,
|
HMI_RET_ERROR_STATE = -1,
|
||||||
HMI_RET_MEMORY_ERR = -4,
|
|
||||||
HMI_RET_UNDEFINED_ACTION = -5,
|
|
||||||
HMI_RET_ERROR_STATE = -6,
|
|
||||||
// Normal.
|
// Normal.
|
||||||
HMI_RET_NORMAL = 0,
|
HMI_RET_ABNORMAL = 0,
|
||||||
HMI_RET_INITIALIZE,
|
HMI_RET_NORMAL = 1,
|
||||||
HMI_RET_CONFIRM,
|
|
||||||
HMI_RET_CANCEL,
|
|
||||||
HMI_RET_FOLLOWUP,
|
|
||||||
HMI_RET_FALLBACK,
|
|
||||||
HMI_RET_INPROCESSING,
|
|
||||||
HMI_RET_NOACTION,
|
|
||||||
}HMI_ENGINE_RESULT;
|
}HMI_ENGINE_RESULT;
|
||||||
|
|
||||||
// HMI engine state.
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
HMI_ENGINE_STATE_UNINIT = 0,
|
HMI_ENGINE_SCR_SWITCH = 0,// Switch screen and record to history.
|
||||||
HMI_ENGINE_STATE_READY,
|
HMI_ENGINE_SCR_POPUP, // Show up screen only.
|
||||||
HMI_ENGINE_STATE_INPROCESS,
|
}HMI_SCREEN_DISP_TYPE;
|
||||||
HMI_ENGINE_STATE_ERROR,
|
|
||||||
}HMI_ENGINE_STATE;
|
|
||||||
|
|
||||||
// HMI event type.
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
HMI_ENGINE_EVENT_ANY = 0,
|
|
||||||
HMI_ENGINE_EVENT_ACTION, // Turn to a new screen.
|
|
||||||
HMI_ENGINE_EVENT_DATA, // Refresh screen display.
|
|
||||||
}HMI_EVENT_TYPE;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
HMI_EVENT_TYPE eType;
|
SGUI_INT iType;
|
||||||
SGUI_INT iID;
|
SGUI_INT iID;
|
||||||
SGUI_INT iSize;
|
SGUI_INT iSize;
|
||||||
}HMI_EVENT_BASE;
|
}HMI_EVENT_BASE;
|
||||||
@ -93,45 +73,40 @@ typedef struct
|
|||||||
// Screen action interface function pointer structure.
|
// Screen action interface function pointer structure.
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
HMI_ENGINE_RESULT (*Initialize) (SGUI_SCR_DEV* Interface); // Initialize screen data and parameter.
|
// Initialize screen data and parameter.
|
||||||
HMI_ENGINE_RESULT (*Prepare) (SGUI_SCR_DEV* Interface, const void* pstParameters); // Do some thing before current screen display.
|
HMI_ENGINE_RESULT (*Initialize) (SGUI_SCR_DEV* Interface);
|
||||||
HMI_ENGINE_RESULT (*Repaint) (SGUI_SCR_DEV* Interface, const void* pstParameters); // Repaint screen if needed.
|
// Do some thing before current screen display.
|
||||||
HMI_ENGINE_RESULT (*ProcessEvent) (SGUI_SCR_DEV* Interface, const HMI_EVENT_BASE* pstEvent); // Process event.
|
HMI_ENGINE_RESULT (*Prepare) (SGUI_SCR_DEV* Interface, const void* pstParameters);
|
||||||
HMI_ENGINE_RESULT (*PostProcess) (SGUI_SCR_DEV* Interface, SGUI_INT iActionResult);
|
// Repaint screen if needed.
|
||||||
//void* (*InstanceData)(void); // Get current screen instance data pointer.
|
HMI_ENGINE_RESULT (*Repaint) (SGUI_SCR_DEV* Interface, const void* pstParameters);
|
||||||
|
// Process event.
|
||||||
|
HMI_ENGINE_RESULT (*ProcessEvent) (SGUI_SCR_DEV* Interface, const HMI_EVENT_BASE* pstEvent, SGUI_INT* piActionID);
|
||||||
|
// Post process.
|
||||||
|
HMI_ENGINE_RESULT (*PostProcess) (SGUI_SCR_DEV* Interface, HMI_ENGINE_RESULT eProcResult, SGUI_INT iActionID);
|
||||||
}HMI_SCREEN_ACTION;
|
}HMI_SCREEN_ACTION;
|
||||||
// Screen data structure.
|
// Screen data structure.
|
||||||
typedef struct
|
typedef struct _T_HMI_SCREEN_OBJECT_
|
||||||
{
|
{
|
||||||
SGUI_INT ScreenID;
|
SGUI_INT iScreenID;
|
||||||
HMI_SCREEN_ACTION* Actions;
|
HMI_SCREEN_ACTION* pstActions;
|
||||||
|
struct _T_HMI_SCREEN_OBJECT_* pstPrevious;
|
||||||
}HMI_SCREEN_OBJECT;
|
}HMI_SCREEN_OBJECT;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
SGUI_INT TopIndex;
|
HMI_SCREEN_OBJECT** ScreenObjPtr;
|
||||||
HMI_SCREEN_OBJECT* Item[HMI_SCREEN_HISTORY_MAX];
|
|
||||||
}HMI_HISTORY_STACK;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
HMI_SCREEN_OBJECT* Screen[HMI_SCREEN_LIST_MAX];
|
|
||||||
SGUI_INT ScreenCount;
|
SGUI_INT ScreenCount;
|
||||||
HMI_SCREEN_OBJECT* CurrentScreenObject;
|
HMI_SCREEN_OBJECT* CurrentScreenObject;
|
||||||
HMI_HISTORY_STACK History;
|
|
||||||
HMI_ENGINE_STATE State;
|
|
||||||
SGUI_SCR_DEV* Interface;
|
SGUI_SCR_DEV* Interface;
|
||||||
}HMI_ENGINE_OBJECT;
|
}HMI_ENGINE_OBJECT;
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Public function declaration. =//
|
//= Public function declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
HMI_ENGINE_RESULT HMI_PrepareEngine(HMI_ENGINE_OBJECT* pstHMIEngineObject);
|
|
||||||
HMI_ENGINE_RESULT HMI_AddScreen(HMI_ENGINE_OBJECT* pstHMIEngineObject, HMI_SCREEN_OBJECT* pstScreenObject, SGUI_BOOL bInitializeScreenObject);
|
|
||||||
HMI_ENGINE_RESULT HMI_ActiveEngine(HMI_ENGINE_OBJECT* pstHMIEngineObject, SGUI_INT iScreenID);
|
HMI_ENGINE_RESULT HMI_ActiveEngine(HMI_ENGINE_OBJECT* pstHMIEngineObject, SGUI_INT iScreenID);
|
||||||
HMI_ENGINE_RESULT HMI_StartEngine(const void* pstParameters);
|
HMI_ENGINE_RESULT HMI_StartEngine(const void* pstParameters);
|
||||||
HMI_ENGINE_RESULT HMI_ProcessEvent(const HMI_EVENT_BASE* pstEvent);
|
HMI_ENGINE_RESULT HMI_ProcessEvent(const HMI_EVENT_BASE* pstEvent);
|
||||||
HMI_ENGINE_RESULT HMI_PostProcess(SGUI_INT iActionResult);
|
HMI_ENGINE_RESULT HMI_SwitchScreen(SGUI_INT iDestScreenID, const void* pstParameters);
|
||||||
HMI_ENGINE_RESULT HMI_Goto(SGUI_INT iDestScreenID, const void* pstParameters);
|
|
||||||
HMI_ENGINE_RESULT HMI_GoBack(const void* pstParameters);
|
HMI_ENGINE_RESULT HMI_GoBack(const void* pstParameters);
|
||||||
|
HMI_ENGINE_RESULT HMI_SetDeviceObject(SGUI_SCR_DEV* pstDeviceObj);
|
||||||
#endif // __INCLUDE_HMI_ENGINE_H__
|
#endif // __INCLUDE_HMI_ENGINE_H__
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
//= Include files. =//
|
//= Include files. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
#include "HMI_Engine.h"
|
#include "HMI_Engine.h"
|
||||||
#include "SGUI_Common.h"
|
|
||||||
#include "SGUI_Basic.h"
|
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static variable declaration. =//
|
//= Static variable declaration. =//
|
||||||
@ -21,113 +19,11 @@ static HMI_ENGINE_OBJECT* g_pstActivedEngineObject;
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Static function declaration. =//
|
//= Static function declaration. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
static SGUI_INLINE HMI_SCREEN_OBJECT* HMI_GetScreenObjectInEngine(HMI_ENGINE_OBJECT* pstHMIEngineObject, SGUI_INT iScreenID);
|
static HMI_SCREEN_OBJECT* HMI_GetScreenObjectInEngine(HMI_ENGINE_OBJECT* pstHMIEngineObject, SGUI_INT iScreenID);
|
||||||
|
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Function define. =//
|
//= Function define. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
/*****************************************************************************/
|
|
||||||
/** Function Name: HMI_PrepareEngine. **/
|
|
||||||
/** Purpose: Initialize HMI engine object. **/
|
|
||||||
/** Params: **/
|
|
||||||
/** @pstHMIEngineObject[in]: Engine object pointer. **/
|
|
||||||
/** @pstScreenObject[in]: Screen object pointer. **/
|
|
||||||
/** Return: HMI_ENGINE_RESULT **/
|
|
||||||
/** @HMI_RET_NORMAL: Add success. **/
|
|
||||||
/** Notice: HMI engine object must prepared by this function before **/
|
|
||||||
/** used. **/
|
|
||||||
/*****************************************************************************/
|
|
||||||
HMI_ENGINE_RESULT HMI_PrepareEngine(HMI_ENGINE_OBJECT* pstHMIEngineObject)
|
|
||||||
{
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Variable Declaration */
|
|
||||||
/*----------------------------------*/
|
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Initialize */
|
|
||||||
/*----------------------------------*/
|
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Process */
|
|
||||||
/*----------------------------------*/
|
|
||||||
if(NULL != pstHMIEngineObject)
|
|
||||||
{
|
|
||||||
// Clean HMI engine object memory area.
|
|
||||||
// SGUI_Common_MemorySet(pstHMIEngineObject, 0x00, sizeof(HMI_ENGINE_OBJECT));
|
|
||||||
|
|
||||||
// Initialize engine object data,
|
|
||||||
pstHMIEngineObject->ScreenCount = 0;
|
|
||||||
pstHMIEngineObject->State = HMI_ENGINE_STATE_READY;
|
|
||||||
}
|
|
||||||
return eProcessResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/** Function Name: HMI_AddScreen **/
|
|
||||||
/** Purpose: Add a screen object to a existed HMI engine object. **/
|
|
||||||
/** Params: **/
|
|
||||||
/** @pstHMIEngineObject[in]: Engine object pointer. **/
|
|
||||||
/** @pstScreenObject[in]: Screen object pointer. **/
|
|
||||||
/** @bInitializeScreenObject[in]: Initialize or reinitialize screen object. **/
|
|
||||||
/** Return: HMI_ENGINE_RESULT **/
|
|
||||||
/** @HMI_RET_NORMAL: Add success. **/
|
|
||||||
/** @HMI_RET_NO_SPACE: No blank element in engine object for new screen. **/
|
|
||||||
/** Notice: The engine object only record pointer of the screen **/
|
|
||||||
/** object, so please keep the memory area is usable during **/
|
|
||||||
/** processing. **/
|
|
||||||
/*****************************************************************************/
|
|
||||||
HMI_ENGINE_RESULT HMI_AddScreen(HMI_ENGINE_OBJECT* pstHMIEngineObject, HMI_SCREEN_OBJECT* pstScreenObject, SGUI_BOOL bInitializeScreenObject)
|
|
||||||
{
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Variable Declaration */
|
|
||||||
/*----------------------------------*/
|
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
|
||||||
SGUI_INT iIndex;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Initialize */
|
|
||||||
/*----------------------------------*/
|
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
|
||||||
iIndex = 0;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Process */
|
|
||||||
/*----------------------------------*/
|
|
||||||
if((NULL != pstHMIEngineObject) && (NULL != pstScreenObject))
|
|
||||||
{
|
|
||||||
// Looking for the blank element in array.
|
|
||||||
while(iIndex < pstHMIEngineObject->ScreenCount)
|
|
||||||
{
|
|
||||||
if(NULL == pstHMIEngineObject->Screen)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iIndex++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(iIndex < HMI_SCREEN_LIST_MAX)
|
|
||||||
{
|
|
||||||
if(SGUI_TRUE == bInitializeScreenObject)
|
|
||||||
{
|
|
||||||
pstScreenObject->Actions->Initialize(pstHMIEngineObject->Interface);
|
|
||||||
}
|
|
||||||
// Add screen object pointer to engine.
|
|
||||||
pstHMIEngineObject->Screen[iIndex] = pstScreenObject;
|
|
||||||
pstHMIEngineObject->ScreenCount++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// No blank element in array, screen object add failed.
|
|
||||||
eProcessResult = HMI_RET_NO_SPACE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return eProcessResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/** Function Name: HMI_ActiveEngine **/
|
/** Function Name: HMI_ActiveEngine **/
|
||||||
/** Purpose: Set a HMI engine object to the activated state. **/
|
/** Purpose: Set a HMI engine object to the activated state. **/
|
||||||
@ -162,32 +58,28 @@ HMI_ENGINE_RESULT HMI_ActiveEngine(HMI_ENGINE_OBJECT* pstHMIEngineObject, SGUI_I
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if((NULL != g_pstActivedEngineObject) && (HMI_ENGINE_STATE_INPROCESS == g_pstActivedEngineObject->State))
|
if(NULL != pstHMIEngineObject)
|
||||||
{
|
{
|
||||||
// Current engine is already in processing, cannot active others.
|
if(HMI_SCREEN_ID_ANY != iScreenID)
|
||||||
eProcessResult = HMI_RET_ERROR_STATE;
|
{
|
||||||
|
pstScreenObject = HMI_GetScreenObjectInEngine(pstHMIEngineObject, iScreenID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pstScreenObject = pstHMIEngineObject->ScreenObjPtr[0];
|
||||||
|
}
|
||||||
|
if(NULL != pstScreenObject)
|
||||||
|
{
|
||||||
|
pstHMIEngineObject->CurrentScreenObject = pstScreenObject;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eProcessResult = HMI_RET_INVALID_DATA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(NULL != pstHMIEngineObject)
|
eProcessResult = HMI_RET_INVALID_DATA;
|
||||||
{
|
|
||||||
if(HMI_SCREEN_ID_ANY != iScreenID)
|
|
||||||
{
|
|
||||||
pstScreenObject = HMI_GetScreenObjectInEngine(pstHMIEngineObject, iScreenID);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pstScreenObject = pstHMIEngineObject->Screen[0];
|
|
||||||
}
|
|
||||||
if(NULL != pstScreenObject)
|
|
||||||
{
|
|
||||||
pstHMIEngineObject->CurrentScreenObject = pstScreenObject;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eProcessResult = HMI_RET_INVALID_DATA;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(HMI_RET_NORMAL == eProcessResult)
|
if(HMI_RET_NORMAL == eProcessResult)
|
||||||
@ -228,29 +120,18 @@ HMI_ENGINE_RESULT HMI_StartEngine(const void* pstParameters)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(NULL != g_pstActivedEngineObject)
|
if(NULL != g_pstActivedEngineObject)
|
||||||
{
|
{
|
||||||
if(HMI_ENGINE_STATE_READY != g_pstActivedEngineObject->State)
|
pstStartScreen = g_pstActivedEngineObject->CurrentScreenObject;
|
||||||
{
|
if(NULL != pstStartScreen)
|
||||||
// Engine not initialized.
|
{
|
||||||
eProcessResult = HMI_RET_ERROR_STATE;
|
if(NULL != pstStartScreen->pstActions)
|
||||||
}
|
{
|
||||||
else
|
if(NULL != pstStartScreen->pstActions->Prepare)
|
||||||
{
|
{
|
||||||
// Prepare and display screen.
|
eProcessResult = pstStartScreen->pstActions->Prepare(g_pstActivedEngineObject->Interface, pstParameters);
|
||||||
g_pstActivedEngineObject->State = HMI_ENGINE_STATE_INPROCESS;
|
g_pstActivedEngineObject->Interface->fnRefreshScreen();
|
||||||
pstStartScreen = g_pstActivedEngineObject->CurrentScreenObject;
|
}
|
||||||
if(NULL != pstStartScreen)
|
}
|
||||||
{
|
}
|
||||||
if(NULL != pstStartScreen->Actions)
|
|
||||||
{
|
|
||||||
if(NULL != pstStartScreen->Actions->Prepare)
|
|
||||||
{
|
|
||||||
pstStartScreen->Actions->Prepare(g_pstActivedEngineObject->Interface, pstParameters);
|
|
||||||
SGUI_Basic_RefreshDisplay(g_pstActivedEngineObject->Interface);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_pstActivedEngineObject->State = HMI_ENGINE_STATE_READY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -276,6 +157,7 @@ HMI_ENGINE_RESULT HMI_ProcessEvent(const HMI_EVENT_BASE* pstEvent)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
HMI_SCREEN_OBJECT* pstCurrentScreen;
|
HMI_SCREEN_OBJECT* pstCurrentScreen;
|
||||||
|
SGUI_INT iActionID;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
@ -288,33 +170,35 @@ HMI_ENGINE_RESULT HMI_ProcessEvent(const HMI_EVENT_BASE* pstEvent)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(NULL != g_pstActivedEngineObject)
|
if(NULL != g_pstActivedEngineObject)
|
||||||
{
|
{
|
||||||
if(HMI_ENGINE_STATE_READY != g_pstActivedEngineObject->State)
|
// Get current displayed screen object.
|
||||||
{
|
pstCurrentScreen = g_pstActivedEngineObject->CurrentScreenObject;
|
||||||
// Engine not initialized.
|
if( (NULL == pstCurrentScreen) ||
|
||||||
eProcessResult = HMI_RET_ERROR_STATE;
|
(NULL == pstCurrentScreen->pstActions) ||
|
||||||
}
|
(NULL == pstCurrentScreen->pstActions->ProcessEvent))
|
||||||
else
|
{
|
||||||
{
|
// Screen ID is invalid or screen object is invalid.
|
||||||
g_pstActivedEngineObject->State = HMI_ENGINE_STATE_INPROCESS;
|
eProcessResult = HMI_RET_INVALID_DATA;
|
||||||
pstCurrentScreen = g_pstActivedEngineObject->CurrentScreenObject;
|
|
||||||
if(NULL == pstCurrentScreen)
|
}
|
||||||
{
|
else
|
||||||
// Screen ID is invalid or screen object is not in this engine.
|
{
|
||||||
eProcessResult = HMI_RET_INVALID_DATA;
|
// Process event.
|
||||||
}
|
eProcessResult = pstCurrentScreen->pstActions->ProcessEvent(g_pstActivedEngineObject->Interface, pstEvent, &iActionID);
|
||||||
else
|
}
|
||||||
{
|
|
||||||
if(NULL != pstCurrentScreen->Actions)
|
// Run post process.
|
||||||
{
|
eProcessResult = pstCurrentScreen->pstActions->PostProcess(g_pstActivedEngineObject->Interface, eProcessResult, iActionID);
|
||||||
if(NULL != pstCurrentScreen->Actions->ProcessEvent)
|
/*
|
||||||
{
|
if(HMI_PROCESS_FAILED(eProcResult))
|
||||||
eProcessResult = pstCurrentScreen->Actions->ProcessEvent(g_pstActivedEngineObject->Interface, pstEvent);
|
{
|
||||||
SGUI_Basic_RefreshDisplay(g_pstActivedEngineObject->Interface);
|
// Post process return failed.
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
}
|
if( (NULL != g_pstActivedEngineObject->Interface) &&
|
||||||
g_pstActivedEngineObject->State = HMI_ENGINE_STATE_READY;
|
(NULL != g_pstActivedEngineObject->Interface->fnRefreshScreen))
|
||||||
}
|
{
|
||||||
|
g_pstActivedEngineObject->Interface->fnRefreshScreen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -326,22 +210,21 @@ HMI_ENGINE_RESULT HMI_ProcessEvent(const HMI_EVENT_BASE* pstEvent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/** Function Name: HMI_PostProcess **/
|
/** Function Name: HMI_SwitchScreen **/
|
||||||
/** Purpose: Process after event process. **/
|
/** Purpose: Turn to a screen with screen index. **/
|
||||||
/** Params: **/
|
/** Params: **/
|
||||||
/** @iActionResult[in]: Event post result. **/
|
/** @ iDestScreenID[in]: Screen ID witch will be going to. **/
|
||||||
|
/** @ pstParameters[in]: Screen prepare data pointer. **/
|
||||||
/** Return: HMI_ENGINE_RESULT. **/
|
/** Return: HMI_ENGINE_RESULT. **/
|
||||||
/** @HMI_RET_NORMAL: Post process finished normally. **/
|
/** Notice: Screen will only refresh when pstPreProcessData is NULL **/
|
||||||
/** @HMI_RET_INVALID_DATA: Screen object is error, post process function **/
|
|
||||||
/** might be unspecified. **/
|
|
||||||
/** Notice: None. **/
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
HMI_ENGINE_RESULT HMI_PostProcess(SGUI_INT iActionResult)
|
HMI_ENGINE_RESULT HMI_SwitchScreen(SGUI_INT iDestScreenID, const void* pstParameters)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
|
HMI_SCREEN_OBJECT* pstDestScreen;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
@ -353,85 +236,30 @@ HMI_ENGINE_RESULT HMI_PostProcess(SGUI_INT iActionResult)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(NULL != g_pstActivedEngineObject)
|
if(NULL != g_pstActivedEngineObject)
|
||||||
{
|
{
|
||||||
if( (NULL != g_pstActivedEngineObject) &&
|
pstDestScreen = HMI_GetScreenObjectInEngine(g_pstActivedEngineObject, iDestScreenID);
|
||||||
(NULL != g_pstActivedEngineObject->CurrentScreenObject) &&
|
if(NULL == pstDestScreen)
|
||||||
(NULL != g_pstActivedEngineObject->CurrentScreenObject->Actions) &&
|
|
||||||
(NULL != g_pstActivedEngineObject->CurrentScreenObject->Actions->PostProcess))
|
|
||||||
{
|
{
|
||||||
eProcessResult = g_pstActivedEngineObject->CurrentScreenObject->Actions->PostProcess(g_pstActivedEngineObject->Interface, iActionResult);
|
/* Not find screen object by ID. */
|
||||||
SGUI_Basic_RefreshDisplay(g_pstActivedEngineObject->Interface);
|
eProcessResult = HMI_RET_INVALID_DATA;
|
||||||
|
}
|
||||||
|
else if(NULL != pstDestScreen->pstPrevious)
|
||||||
|
{
|
||||||
|
/* Cannot reenter to a screen object. */
|
||||||
|
eProcessResult = HMI_RET_ERROR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_INVALID_DATA;
|
pstDestScreen->pstPrevious = g_pstActivedEngineObject->CurrentScreenObject;
|
||||||
|
g_pstActivedEngineObject->CurrentScreenObject = pstDestScreen;
|
||||||
|
if(NULL != pstDestScreen->pstActions)
|
||||||
|
{
|
||||||
|
if(NULL != pstDestScreen->pstActions->Prepare)
|
||||||
|
{
|
||||||
|
eProcessResult = pstDestScreen->pstActions->Prepare(g_pstActivedEngineObject->Interface, pstParameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return eProcessResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/** Function Name: HMI_Goto **/
|
|
||||||
/** Purpose: Turn to a screen with screen index. **/
|
|
||||||
/** Params: **/
|
|
||||||
/** @uiDestScreenID[in]: Screen ID witch will be going to. **/
|
|
||||||
/** @pstParameters[in]: Screen prepare data pointer. **/
|
|
||||||
/** Return: None. **/
|
|
||||||
/** Notice: Screen will only refresh when pstPreProcessData is NULL **/
|
|
||||||
/*****************************************************************************/
|
|
||||||
HMI_ENGINE_RESULT HMI_Goto(SGUI_INT iDestScreenID, const void* pstParameters)
|
|
||||||
{
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Variable Declaration */
|
|
||||||
/*----------------------------------*/
|
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
|
||||||
HMI_SCREEN_OBJECT* pstCurrentScreen;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Initialize */
|
|
||||||
/*----------------------------------*/
|
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
|
||||||
pstCurrentScreen = NULL;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
|
||||||
/* Process */
|
|
||||||
/*----------------------------------*/
|
|
||||||
if(NULL != g_pstActivedEngineObject)
|
|
||||||
{
|
|
||||||
if(HMI_ENGINE_STATE_READY != g_pstActivedEngineObject->State)
|
|
||||||
{
|
|
||||||
// Engine not initialized or in processing.
|
|
||||||
eProcessResult = HMI_RET_ERROR_STATE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_pstActivedEngineObject->State = HMI_ENGINE_STATE_INPROCESS;
|
|
||||||
pstCurrentScreen = g_pstActivedEngineObject->CurrentScreenObject;
|
|
||||||
if(NULL != pstCurrentScreen)
|
|
||||||
{
|
|
||||||
// Push current screen to history stack.
|
|
||||||
g_pstActivedEngineObject->History.Item[g_pstActivedEngineObject->History.TopIndex] = pstCurrentScreen;
|
|
||||||
g_pstActivedEngineObject->History.TopIndex++;
|
|
||||||
|
|
||||||
// Set next screen information in engine.
|
|
||||||
pstCurrentScreen = HMI_GetScreenObjectInEngine(g_pstActivedEngineObject, iDestScreenID);
|
|
||||||
if(NULL != pstCurrentScreen)
|
|
||||||
{
|
|
||||||
g_pstActivedEngineObject->CurrentScreenObject = pstCurrentScreen;
|
|
||||||
if(NULL != pstCurrentScreen->Actions)
|
|
||||||
{
|
|
||||||
if(NULL != pstCurrentScreen->Actions->Prepare)
|
|
||||||
{
|
|
||||||
eProcessResult = pstCurrentScreen->Actions->Prepare(g_pstActivedEngineObject->Interface, pstParameters);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eProcessResult = HMI_RET_INVALID_DATA;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_pstActivedEngineObject->State = HMI_ENGINE_STATE_READY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -447,8 +275,8 @@ HMI_ENGINE_RESULT HMI_Goto(SGUI_INT iDestScreenID, const void* pstParameters)
|
|||||||
/** Purpose: Go back to previous screen in actions history. **/
|
/** Purpose: Go back to previous screen in actions history. **/
|
||||||
/** Resources: Screen data structure and action process function. **/
|
/** Resources: Screen data structure and action process function. **/
|
||||||
/** Params: **/
|
/** Params: **/
|
||||||
/** @pstPreProcessData[in]: Update screen data. **/
|
/** @pstPreProcessData[in]: Update screen data. **/
|
||||||
/** Return: None. **/
|
/** Return: HMI_ENGINE_RESULT. **/
|
||||||
/** Notice: Screen will only refresh when pstPreProcessData is NULL **/
|
/** Notice: Screen will only refresh when pstPreProcessData is NULL **/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
HMI_ENGINE_RESULT HMI_GoBack(const void* pstParameters)
|
HMI_ENGINE_RESULT HMI_GoBack(const void* pstParameters)
|
||||||
@ -457,46 +285,36 @@ HMI_ENGINE_RESULT HMI_GoBack(const void* pstParameters)
|
|||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
HMI_ENGINE_RESULT eProcessResult;
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
HMI_SCREEN_OBJECT* pstCurrentScreen;
|
HMI_SCREEN_OBJECT* pstPreviousScreen;
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
eProcessResult = HMI_RET_NORMAL;
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
pstCurrentScreen = NULL;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(NULL != g_pstActivedEngineObject)
|
if(NULL != g_pstActivedEngineObject)
|
||||||
{
|
{
|
||||||
if(HMI_ENGINE_STATE_READY != g_pstActivedEngineObject->State)
|
pstPreviousScreen = g_pstActivedEngineObject->CurrentScreenObject->pstPrevious;
|
||||||
{
|
g_pstActivedEngineObject->CurrentScreenObject->pstPrevious = NULL;
|
||||||
// Engine not initialized or in processing.
|
|
||||||
eProcessResult = HMI_RET_ERROR_STATE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_pstActivedEngineObject->History.TopIndex--;
|
|
||||||
pstCurrentScreen = g_pstActivedEngineObject->History.Item[g_pstActivedEngineObject->History.TopIndex];
|
|
||||||
g_pstActivedEngineObject->History.Item[g_pstActivedEngineObject->History.TopIndex] = NULL;
|
|
||||||
|
|
||||||
if(NULL != pstCurrentScreen)
|
if(NULL != pstPreviousScreen)
|
||||||
{
|
{
|
||||||
g_pstActivedEngineObject->CurrentScreenObject = pstCurrentScreen;
|
g_pstActivedEngineObject->CurrentScreenObject = pstPreviousScreen;
|
||||||
if(NULL != pstCurrentScreen->Actions)
|
if(NULL != pstPreviousScreen->pstActions)
|
||||||
{
|
{
|
||||||
if(NULL != pstCurrentScreen->Actions->Prepare)
|
if(NULL != pstPreviousScreen->pstActions->Prepare)
|
||||||
{
|
{
|
||||||
eProcessResult = pstCurrentScreen->Actions->Prepare(g_pstActivedEngineObject->Interface, pstParameters);
|
eProcessResult = pstPreviousScreen->pstActions->Prepare(g_pstActivedEngineObject->Interface, pstParameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eProcessResult = HMI_RET_INVALID_DATA;
|
eProcessResult = HMI_RET_INVALID_DATA;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -541,9 +359,9 @@ HMI_SCREEN_OBJECT* HMI_GetScreenObjectInEngine(HMI_ENGINE_OBJECT* pstHMIEngineOb
|
|||||||
{
|
{
|
||||||
while(iIndex < pstHMIEngineObject->ScreenCount)
|
while(iIndex < pstHMIEngineObject->ScreenCount)
|
||||||
{
|
{
|
||||||
if(iScreenID == pstHMIEngineObject->Screen[iIndex]->ScreenID)
|
if(iScreenID == pstHMIEngineObject->ScreenObjPtr[iIndex]->iScreenID)
|
||||||
{
|
{
|
||||||
pstScreenObject = pstHMIEngineObject->Screen[iIndex];
|
pstScreenObject = pstHMIEngineObject->ScreenObjPtr[iIndex];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -555,3 +373,39 @@ HMI_SCREEN_OBJECT* HMI_GetScreenObjectInEngine(HMI_ENGINE_OBJECT* pstHMIEngineOb
|
|||||||
|
|
||||||
return pstScreenObject;
|
return pstScreenObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/** Function Name: HMI_SetDeviceObject. **/
|
||||||
|
/** Purpose: Set a new screen device interface object pointer to **/
|
||||||
|
/** actived HMI object. **/
|
||||||
|
/** Params: **/
|
||||||
|
/** @ pstDeviceObj[in]: New device driver interface object pointer. **/
|
||||||
|
/** Return: HMI_ENGINE_RESULT **/
|
||||||
|
/** Notice: None. **/
|
||||||
|
/*****************************************************************************/
|
||||||
|
HMI_ENGINE_RESULT HMI_SetDeviceObject(SGUI_SCR_DEV* pstDeviceObj)
|
||||||
|
{
|
||||||
|
/*----------------------------------*/
|
||||||
|
/* Variable Declaration */
|
||||||
|
/*----------------------------------*/
|
||||||
|
HMI_ENGINE_RESULT eProcessResult;
|
||||||
|
|
||||||
|
/*----------------------------------*/
|
||||||
|
/* Initialize */
|
||||||
|
/*----------------------------------*/
|
||||||
|
eProcessResult = HMI_RET_NORMAL;
|
||||||
|
|
||||||
|
/*----------------------------------*/
|
||||||
|
/* Process */
|
||||||
|
/*----------------------------------*/
|
||||||
|
if((NULL == pstDeviceObj) || (NULL == g_pstActivedEngineObject))
|
||||||
|
{
|
||||||
|
eProcessResult = HMI_RET_INVALID_DATA;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_pstActivedEngineObject->Interface = pstDeviceObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
return eProcessResult;
|
||||||
|
}
|
||||||
|
@ -118,8 +118,6 @@
|
|||||||
<Unit filename="../../../GUI/inc/SGUI_Basic.h" />
|
<Unit filename="../../../GUI/inc/SGUI_Basic.h" />
|
||||||
<Unit filename="../../../GUI/inc/SGUI_Common.h" />
|
<Unit filename="../../../GUI/inc/SGUI_Common.h" />
|
||||||
<Unit filename="../../../GUI/inc/SGUI_FlashData.h" />
|
<Unit filename="../../../GUI/inc/SGUI_FlashData.h" />
|
||||||
<Unit filename="../../../GUI/inc/SGUI_Frame.h" />
|
|
||||||
<Unit filename="../../../GUI/inc/SGUI_Graph.h" />
|
|
||||||
<Unit filename="../../../GUI/inc/SGUI_Interface.h" />
|
<Unit filename="../../../GUI/inc/SGUI_Interface.h" />
|
||||||
<Unit filename="../../../GUI/inc/SGUI_List.h" />
|
<Unit filename="../../../GUI/inc/SGUI_List.h" />
|
||||||
<Unit filename="../../../GUI/inc/SGUI_Notice.h" />
|
<Unit filename="../../../GUI/inc/SGUI_Notice.h" />
|
||||||
@ -138,12 +136,6 @@
|
|||||||
<Unit filename="../../../GUI/src/SGUI_FlashData.c">
|
<Unit filename="../../../GUI/src/SGUI_FlashData.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
<Unit filename="../../../GUI/src/SGUI_Frame.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../../GUI/src/SGUI_Graph.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../../GUI/src/SGUI_Interface.c">
|
<Unit filename="../../../GUI/src/SGUI_Interface.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
|
Loading…
Reference in New Issue
Block a user