RDA 工模
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 工模的更多相关文章
- RDA PQ工具使用 (Adi Analysis)
PQ工具“ColorAdjustTool.exe”,请注意芯片的选择: RDA512C选择533 RDA8501选择331 RDA8503选择131 工模菜单 COLOR LUT: R/G/B/Y/ ...
- 遇到Audio/Speech相关问题,如何抓取log
[DESCRIPTION] 遇到Audio/Speech相关问题时,经常需要抓取相关log信息,总结抓取方法如下 [SOLUTION] 1. 通话声音相关的问题: Case 1: 通话中某一 ...
- MTK平台-抓取蓝牙log
一.MTKLOG抓取 .在拔号键盘输入暗码 *#*##*#* 进入工模EngineerMode .在 Log and Debugging -> MTKLogger 点击开始 .MTKLog存储路 ...
- PCB 布线,直角线,差分线,蛇形线
1.直角线 直角走线的一般标准是PCB布线中要尽量避免的情况,也几乎成为衡量布线好坏的标准之一. 直角走线对信号的影响主要体系那在下面三个方面 1.保教可以等效为传输线是哪个的容性负载,减缓上升时间. ...
- Python DB
#!/usr/bin/python #_*_ coding:utf-8 _*_ import MySQLdb import time import threading import random fr ...
- mtk 的conferrence call建立流程
(重点看main_log与) 抓mtk log: 1.*#*#82533284#*#* 进入抓log UI 2.*#*#825364#*#* 进入工程模式 3.进入"Lo ...
- 最全的NB-IoT芯片厂商、模组厂商信息
NB-IoT作为LPWAN(低功耗广域网)的新兴技术,因为具有低功耗.低成本.广覆盖.海量节点等优势,并且在授权频段可以与2G.3G无缝连接而被运营商所青睐且接受.特别是到了2017年,据统计全球有5 ...
- 【转】工控老鬼】西门子S7200入门&精通【1】S7200硬件大全
转载地址:http://blog.sina.com.cn/s/blog_669692a601016i5f.html 工控老鬼提醒以下的信息和资料可能不全或者不准确,如有疑问可以查阅西门子中国网 ...
- PCB模擬設計接地的指導原則
接地無疑是系統設計中最為棘手的問題之一.盡管它的概念相對比較簡單,實施起來卻很復雜,遺憾的是,它沒有一個簡明扼要可以用詳細步驟描述的方法來保證取得良好效果,但如果在某些細節上處理不當,可能會導致令人頭 ...
随机推荐
- ubuntu14.04 mysql-workbench Connecting to MySQL server ... Native table 'performance_schema'.'session_variables' has the wrong structure错误解决
使用的mysql版本: mysql Ver 14.14 Distrib 5.7.9, for Linux (x86_64) using EditLine wrapper 打开shell命令 1.输 ...
- Django-rest_framework中利用jwt登录验证时,自定义返回凭证和登录校验支持手机号
安装 pip install djangorestframework-jwt 在Django.settings中配置 REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATIO ...
- LeetCode(46)Permutations
题目 Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the fo ...
- 17-看图理解数据结构与算法系列(NoSQL存储-LSM树)
关于LSM树 LSM树,即日志结构合并树(Log-Structured Merge-Tree).其实它并不属于一个具体的数据结构,它更多是一种数据结构的设计思想.大多NoSQL数据库核心思想都是基于L ...
- Altium designer中生成gerbera文件
在Altium designer中生成gerbera文件的方法有很多,不同版本,差异行不太大,正如下边链接地址里博主在10版本下的方法,在6.0版本长也是这样 http://blog.sina.com ...
- Leetcode 172.阶乘后的零
阶乘后的零 给定一个整数 n,返回 n! 结果尾数中零的数量. 示例 1: 输入: 3 输出: 0 解释: 3! = 6, 尾数中没有零. 示例 2: 输入: 5 输出: 1 解释: 5! = 120 ...
- HASH的应用(负数下标用偏移量解决)
Input 每组测试数据有两行,第一行有两个数n,m(0<n,m<1000000),第二行包含n个处于区间[-500000,500000]的整数. Output 对每组测试数据按从大到小的 ...
- 7-14 电话聊天狂人(25 分)(Hash表基本操作)
7-14 电话聊天狂人(25 分) 给定大量手机用户通话记录,找出其中通话次数最多的聊天狂人. 输入格式: 输入首先给出正整数N(≤105),为通话记录条数.随后N行,每行给出一条通话记录.简单 ...
- 【转】Intellij IDEA 快捷键大全
IntelliJ Idea 常用快捷键列表 Ctrl+Shift + Enter,语句完成“!”,否定完成,输入表达式时按 “!”键Ctrl+E,最近的文件Ctrl+Shift+E,最近更改的文件Sh ...
- php的socket通信【转载】
对TCP/IP.UDP.Socket编程这些词你不会很陌生吧?随着网络技术的发展,这些词充斥着我们的耳朵.那么我想问: 1. 什么是TCP/IP.UDP?2. Soc ...