1、工模GUI如下图:

  注意两个API接口,_APP_Update_Layer()/UpdateNodeFunctionContent()

  这两个接口一个是刷新ListView,另一个刷新ListView对应的TextBox值,后面简称ListView为工模的“键”,对应的TextBox为对应的“值”,即工模为键-值对的组合。

  

  1) 刷新ListView以及TextBox值

static   GUIResult_e _APP_Update_Layer(int NodeId)
{
GUIResult_e dRet = GUI_SUCCESS;
int i=;
int ChildId = FactoryNode[NodeId].childID; if(ChildId==)
return dRet; // 检查ListView页面节点数
int NextId = FactoryNode[ChildId].nextID;
int count = ;
while( (NextId!=) && (count<FM_ITEMS_PER_PAGE) )
{
count ++;
NextId = FactoryNode[NextId].nextID;
} // 释放键内存
Fee_LeftSide_List(); // 开辟内存,存储ListView键
StringList_of_LeftSide = (UINT8 **)malloc( sizeof(UINT8 *) * (FM_ITEMS_PER_PAGE+) ); // Added 1 for End symbol
for (i=; i<=FM_ITEMS_PER_PAGE ; i++)
{
StringList_of_LeftSide[i] = (UINT8 *)malloc(sizeof(UINT8) * (MAX_TEXT_LENGTH+));
memcpy((void *)StringList_of_LeftSide[i], (void *)&string_last, sizeof(string_last));
} // 清空ListView键
GUI_FUNC_CALL( GEL_SetParam(g_fmFactorySetting_data, PARAM_STATIC_STRING, pEmptyStrings ) ); // 拷贝页面节点字串,对ListView键赋值
NextId = ChildId;
for(i=; i<count; i++)
{
snprintf((char *)StringList_of_LeftSide[i], MAX_TEXT_LENGTH, "%s", FactoryNode[NextId].szItem);
NextId = FactoryNode[NextId].nextID;
}
// 清空TextBox值
for(i=; i<FM_ITEMS_PER_PAGE; i++)
{
HWND Item_Handle;
dRet = GEL_GetHandle(pWindowControl, nItemStart+i, &Item_Handle);
dRet = GEL_SetParam(Item_Handle, PARAM_STATIC_STRING,String_null);
}
//刷新ListView键
GUI_FUNC_CALL( GEL_SetParam(g_fmFactorySetting_data, PARAM_DYNAMIC_STRING, (void *)StringList_of_LeftSide) );
GUI_FUNC_CALL( GEL_SetParam(g_fmFactorySetting_data, PARAM_SETNORMAL, ) );
//临时刷新TextBox为"-->",具体值由"UpdateNodeFunctionContent"刷新
for(i=; i<=FM_ITEMS_PER_PAGE; i++)
{
HWND FocusItem_Handle;
dRet = GEL_GetHandle(pWindowControl, nItemStart+i, &FocusItem_Handle);
if(i<count)
dRet = GEL_SetParam(FocusItem_Handle, PARAM_STATIC_STRING, StringRightArrow);
else
dRet = GEL_SetParam(FocusItem_Handle, PARAM_STATIC_STRING,String_null); GUI_FUNC_CALL( GEL_SetParam(FocusItem_Handle, PARAM_SETNORMAL, NULL) );
if (i<count)
GUI_FUNC_CALL( GEL_SetParam(g_fmFactorySetting_data, PARAM_ITEM_ENABLE, &i) ); }
//获取页面节点数
Current_Node_Count = count;
UpdateNodeFunctionContent(ChildId,,);//刷新TextBox值
return dRet;
}

  2)刷新菜单的Focus/Disable/Item滚动状态

static INT32 _APP_GUIOBJ_FM_FactorySetting_UpdateMenu(void)
{
GUIResult_e dRet = GUI_SUCCESS;
INT32 i32Index = ;
UINT32 NodeId = ID_ROOT;
HWND hItem;
HWND hFocusItem;
State_e nState = NORMAL_STATE;
APP_Source_Type_t eSourceType = APP_SOURCE_MAX;
AL_ServiceDetail_t stServInfo;
AL_RecHandle_t hProgHdl;
UINT32 u32ColorSystem = ; APP_GUIOBJ_Source_GetCurrSource(&eSourceType);
//清除所有Item聚焦
for(i32Index=nItemStart; i32Index<=nItemEnd; i32Index++)
{
dRet = GEL_GetHandle(pWindowControl,i32Index, &hItem); // Get state
GUI_FUNC_CALL( GEL_GetParam(hItem, PARAM_STATE,&nState) ); if(nState == FOCUS_STATE)
{
GUI_FUNC_CALL(GEL_SetAnimEnable(hItem, FALSE));
GUI_FUNC_CALL( GEL_SetParam(hItem, PARAM_SETNORMAL, NULL));
}
}
//设置特定Item的Disable状态
if(nowNodeHeadId == ID_FM_Funct_Backlight)
{
for(i32Index=;(int)i32Index<Current_Node_Count;i32Index++)
{
NodeId = FactoryNode[nowNodeHeadId].childID + i32Index;
if(NodeId == ID_FM_Function_BlackLight_CURRENT
|| NodeId == ID_FM_Function_BlackLight_DUTY_VALUE)
{
dRet = GEL_SetParam(g_fmFactorySetting_data,PARAM_ITEM_DISABLE, (void*)&i32Index);
dRet = GEL_GetHandle(pWindowControl, i32Index+nItemStart, &hItem);
dRet = GEL_SetParam(hItem,PARAM_SETDISABLED, NULL);
}
else if(NodeId == ID_FM_Function_BlackLight_DUTY)
{
if(( <= u16preBacklightValue) && ( >= u16preBacklightValue))
{
dRet = GEL_SetParam(g_fmFactorySetting_data,PARAM_ITEM_DISABLE, (void*)&i32Index);
dRet = GEL_GetHandle(pWindowControl, i32Index+nItemStart, &hItem);
dRet = GEL_SetParam(hItem,PARAM_SETDISABLED, NULL);
}
else
{
dRet = GEL_SetParam(g_fmFactorySetting_data,PARAM_ITEM_ENABLE, (void*)&i32Index);
dRet = GEL_GetHandle(pWindowControl, i32Index+nItemStart, &hItem);
dRet = GEL_SetParam(hItem,PARAM_SETNORMAL, NULL);
}
}
else
{
dRet = GEL_SetParam(g_fmFactorySetting_data,PARAM_ITEM_ENABLE, (void*)&i32Index);
dRet = GEL_GetHandle(pWindowControl, i32Index+nItemStart, &hItem);
dRet = GEL_SetParam(hItem,PARAM_SETNORMAL, NULL);
}
}
} // 设置Item的聚焦及滚动
dRet = GEL_GetParam(g_fmFactorySetting_data, PARAM_CURRENT_INDEX, &i32Index);
dRet = GEL_SetParam(g_fmFactorySetting_data, PARAM_SETFOCUSED, NULL);
i32Index +=nItemStart;
dRet = GEL_GetHandle(pWindowControl, i32Index, &hFocusItem);
dRet = GEL_SetParam(hFocusItem, PARAM_SETFOCUSED, NULL); GUI_FUNC_CALL(GEL_SetAnimEnable(hFocusItem, FALSE));
APP_GuiMgr_RegionBufferControl(&hFocusItem, ); //设置滚动Item
GUI_FUNC_CALL(GEL_SetAnimEnable(hFocusItem, TRUE)); GUI_FUNC_CALL( GEL_ShowMenu(pWindow) );
GUI_FUNC_CALL(GEL_UpdateOSD()); return (UINT32)dRet;
}

  3)菜单联动显示

    即,当前聚焦的Item发生变化时,其它Item会联动变化,例如:工模调整背光百分比是,当前电流/占空比/PWM寄存器的值是应该跟随变化的

  调用API:    UpdateNodeFunctionContent(ID_FM_Function_BlackLight_Backlight, , )

  背灯例子:

void Factory_BackLight(BOOL bSet, BOOL path, FUNCTION_DATA *pValue, BOOL bDefault)
{
FUNCTION_DATA * FuncData = (FUNCTION_DATA *)pValue;
Backlight_t BacklightSetting;
BacklightSetting.Backlight_total_Stage = ;
static char dutyBuff[];
INT16 u16Pwm = ;
UINT32 mapValue= ;
if (bSet)
{
//调整Backlight(OSD)的值
u16Pwm= AL_FLASH_GetBackLight();
if (gbIsFMRightKey == TRUE)
{
u16Pwm = (++u16Pwm>=)?:u16Pwm; }
else if (gbIsFMLeftKey == TRUE)
{
u16Pwm = (--u16Pwm<=)?:u16Pwm;
}
AL_FLASH_SetBackLight(u16Pwm);
BacklightSetting.OSD_backlight_index = u16Pwm;
//设置Backlight
Cmd_SetLcdBackLight(BacklightSetting);
mapValue = CONFIG_DEFAULT_PWM_REG_MAX - (CONFIG_DEFAULT_PWM_REG_MAX - CONFIG_DEFAULT_PWM_REG_MIN)*BacklightSetting.OSD_backlight_index / BacklightSetting.Backlight_total_Stage;
sprintf(dutyBuff,"%d - reg[%d]",u16Pwm,mapValue);
//Backlight 显示
Update_TypeVersion_Node(dutyBuff, FuncData->nItem);
MID_TVFE_GetCurrDutyPWM((short unsigned int *)&(u16DutyPWM));
//联动Item Duty/Current/Duty Value 跟随变化,刷新包含Backlight后面的各个节点
UpdateNodeFunctionContent(ID_FM_Function_BlackLight_Backlight, , );
}
else
{
mapValue = CONFIG_DEFAULT_PWM_REG_MAX - (CONFIG_DEFAULT_PWM_REG_MAX - CONFIG_DEFAULT_PWM_REG_MIN)*AL_FLASH_GetBackLight() / BacklightSetting.Backlight_total_Stage;
sprintf(dutyBuff,"%d - reg[%d]",(INT32)AL_FLASH_GetBackLight(),mapValue);
Update_TypeVersion_Node((char * ) dutyBuff, FuncData->nItem);
}
}

  接口介绍:

static GUIResult_e UpdateNodeFunctionContent(int NodeId,UINT32 u32CurrentIndex,UINT32 dEventID)
{
GUIResult_e dRet = GUI_SUCCESS ;
NODE_FUNCTION * pFunc;
FUNCTION_DATA FuncData;
HWND FocusItem_Handle;
dRet = GEL_GetHandle(pWindowControl, u32CurrentIndex+nItemStart, &FocusItem_Handle);
UINT32 tmp=u32CurrentIndex; gbIsFMRightKey = (UI_EVENT_RIGHT == dEventID) ? TRUE : FALSE;
gbIsFMLeftKey = (UI_EVENT_LEFT == dEventID) ? TRUE : FALSE; //迭代需要刷新的TextBox节点
for(u32CurrentIndex=; (int)u32CurrentIndex< Current_Node_Count; u32CurrentIndex++)
{
if(dEventID!=)
u32CurrentIndex = tmp;
dRet = GEL_GetHandle(pWindowControl, u32CurrentIndex+nItemStart, &FocusItem_Handle); UINT32 nCurrNodeId = NodeId+ u32CurrentIndex;//nowNodeHeadId + u32CurrentIndex ;
nowNodeId = nCurrNodeId;
pFunc = FactoryNode[nCurrNodeId].pThis; //如果节点有回调,通过回调获取节点的值
if(pFunc != NULL)
{
if(pFunc->type == MENU_CTRL_TYPE_SLIDER)
{
if (pFunc->MenuSettingFun)
(pFunc->MenuSettingFun)(FALSE, , (FUNCTION_DATA*)&FuncData, FALSE); }
else if(pFunc->type == MENU_CTRL_TYPE_RADIOBUTTON)
{
FACT_RADIOBTN *pRad;
if (pFunc->leaves)
{
FuncData.nItem = ;
FuncData.value = ;
if (pFunc->MenuSettingFun)
{
(pFunc->MenuSettingFun)(FALSE,, (FUNCTION_DATA*)&FuncData, FALSE);
}
}
}
else if(pFunc->type == MENU_CTRL_TYPE_PUSHBUTTON )
{
if (pFunc->MenuSettingFun)
{
if( dEventID==UI_EVENT_RIGHT|| dEventID==UI_EVENT_ENTER )
(*pFunc->MenuSettingFun)(TRUE, , &FuncData, FALSE);//注意形参TRUE,为设置节点的值
else
(*pFunc->MenuSettingFun)(FALSE, , &FuncData, FALSE);//注意形参FALSE,为获取
}
}
else if( MENU_CTRL_TYPE_VERSION == pFunc->type )
{
FuncData.nItem = u32CurrentIndex;
if (pFunc->MenuSettingFun)
{
if( dEventID==UI_EVENT_RIGHT|| dEventID==UI_EVENT_ENTER)
(pFunc->MenuSettingFun)(TRUE,/* MAIN*/ , &FuncData, FALSE);
else
(pFunc->MenuSettingFun)(FALSE,/* MAIN*/ , &FuncData, FALSE);
} }
else if(MENU_CTRL_TYPE_GROUPSTATICSTRINGS == pFunc->type)
{
if (pFunc->MenuSettingFun)
{
(pFunc->MenuSettingFun)(FALSE,/* MAIN*/ , &FuncData, FALSE); // Get Value from UMF
}
}
else if(MENU_CTRL_TYPE_DAYNAMICSTRING == pFunc->type)
{
FuncData.nItem = u32CurrentIndex;
if (pFunc->MenuSettingFun)
{
if((dEventID == UI_EVENT_RIGHT) || (dEventID == UI_EVENT_LEFT))
{
(pFunc->MenuSettingFun)(TRUE, , &FuncData, FALSE);
}
else
{
(pFunc->MenuSettingFun)(FALSE, , &FuncData, FALSE);
}
} }
}
else
{
if(UI_EVENT_RIGHT == dEventID)
{
dRet = Enter_Behavior();
}
else
{
GUI_FUNC_CALL(GEL_SendMsg(FocusItem_Handle, WM_PAINT, ));
}
} if(dEventID!=)
break;
}
return dRet;
}

RDA 工模的更多相关文章

  1. RDA PQ工具使用 (Adi Analysis)

    PQ工具“ColorAdjustTool.exe”,请注意芯片的选择: RDA512C选择533 RDA8501选择331 RDA8503选择131  工模菜单 COLOR LUT: R/G/B/Y/ ...

  2. 遇到Audio/Speech相关问题,如何抓取log

      [DESCRIPTION] 遇到Audio/Speech相关问题时,经常需要抓取相关log信息,总结抓取方法如下 [SOLUTION] 1.    通话声音相关的问题: Case 1: 通话中某一 ...

  3. MTK平台-抓取蓝牙log

    一.MTKLOG抓取 .在拔号键盘输入暗码 *#*##*#* 进入工模EngineerMode .在 Log and Debugging -> MTKLogger 点击开始 .MTKLog存储路 ...

  4. PCB 布线,直角线,差分线,蛇形线

    1.直角线 直角走线的一般标准是PCB布线中要尽量避免的情况,也几乎成为衡量布线好坏的标准之一. 直角走线对信号的影响主要体系那在下面三个方面 1.保教可以等效为传输线是哪个的容性负载,减缓上升时间. ...

  5. Python DB

    #!/usr/bin/python #_*_ coding:utf-8 _*_ import MySQLdb import time import threading import random fr ...

  6. mtk 的conferrence call建立流程

    (重点看main_log与) 抓mtk log: 1.*#*#82533284#*#*      进入抓log UI 2.*#*#825364#*#*      进入工程模式 3.进入"Lo ...

  7. 最全的NB-IoT芯片厂商、模组厂商信息

    NB-IoT作为LPWAN(低功耗广域网)的新兴技术,因为具有低功耗.低成本.广覆盖.海量节点等优势,并且在授权频段可以与2G.3G无缝连接而被运营商所青睐且接受.特别是到了2017年,据统计全球有5 ...

  8. 【转】工控老鬼】西门子S7200入门&精通【1】S7200硬件大全

    转载地址:http://blog.sina.com.cn/s/blog_669692a601016i5f.html     工控老鬼提醒以下的信息和资料可能不全或者不准确,如有疑问可以查阅西门子中国网 ...

  9. PCB模擬設計接地的指導原則

    接地無疑是系統設計中最為棘手的問題之一.盡管它的概念相對比較簡單,實施起來卻很復雜,遺憾的是,它沒有一個簡明扼要可以用詳細步驟描述的方法來保證取得良好效果,但如果在某些細節上處理不當,可能會導致令人頭 ...

随机推荐

  1. SSH配置—Linux下实现免密码登录

    首先,假设我们有两台服务器,服务器名称分别是 master 和 slave1,我们现在需要做的就是在服务器 master 上面登录 服务器 slave1 不需要输入密码就可以登录成功,如下图所示. 下 ...

  2. android listVIew实现button按钮监听程序

    1.重写simpleAdapter 方法@Override public HashMap<String,String> getItem(int position) { // TODO Au ...

  3. POJ 3169_Layout

    大早上水一发=.= 题意: n头牛按编号顺序站成一列,给定n头牛之间的位置关系,求出第n头牛和第一头牛之间的最大距离. 分析: 差分约束系统,这题不等式关系还是挺好找的.注意因为按照顺序排列,所以有d ...

  4. Validate Binary Search Tree(DFS)

    Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as ...

  5. 【编程大系】Java资源汇总

    1.学习资料: 1)Spring Boot 那些事:https://www.w3cschool.cn/springboot/ 对应的 gitHub代码: https://github.com/Jeff ...

  6. 洛谷 P1566 加等式

    P1566 加等式 题目描述 对于一个整数集合,我们定义“加等式”如下:集合中的某一个元素可以表示成集合内其他元素之和.如集合{1,2,3}中就有一个加等式:3=1+2,而且3=1+2 和3=2+1是 ...

  7. MongoDB C#驱动

    烟波钓徒 MongoDB C#驱动 http://www.mongodb.org/display/DOCS/CSharp+Driver+Tutorial 笔记 首先下载驱动.驱动有两个文件 Mongo ...

  8. Linux学习系列之MySQL备份

    MySQL排除表备份 #!/bin/bash #created by 90root #date: 20160809 date_y=$(date +%Y) date_m=$(date +%m) time ...

  9. 003 rip

    r0#config t Enter configuration commands, one per line.  End with CNTL/Z. r0(config)#router rip r0(c ...

  10. C# .NET using ManagementObjectSearcher提示缺少引用怎么办

    在下图中,即使引用了System.Management还是会出现报错   其实只要添加这条引用就可以了