Project

General

Profile

Feature #442

增加ehmi的获取当前svm页面在第几屏幕打开的值lua界面脚本

Added by yufeng wu almost 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Start date:
02/28/2020
Due date:
% Done:

100%

Estimated time:
Defect version:

Description

增加ehmi界面lua脚本
获取当前页面显示所在的显示屏号,1开始
例如返回,1,2,3

History

#1

Updated by yufeng wu almost 5 years ago

1-3屏分别对应一个专业变量,当一svm图被初始显示或推图显示在a#屏时,需要把a#屏对应专业变量置值!442当前是指,该svm页面加载时使用脚本获取在哪一屏显示
举例:当某张图被加载打开时,页面加载脚本运行
intScno = getsvmopenedscreen()---1-3
setvdataint(10*(intScno-1)+1, intScno)---intScno屏站号
setvdataint(10*(intScno-1)+2, intScno)---intScno屏专业号
setvdataint(10*(intScno-1)+3, intScno)---intScno屏页面号

#2

Updated by yufeng wu almost 5 years ago

getsvmopenedscreen()经测试OK
static int GetSvmOpenedScreen(lua_State *L)//WYF 20200121 {
CehmiView pView = GetGlobal(L)->GetParentWnd();
CehmiView *pViewTmp=NULL;
int j=0,i=0;
for(j=0;j<g_ehmiMainFrame->m_scrnNum;j++){
pViewTmp=NULL;
pViewTmp=g_ehmiMainFrame->GetehmiView(j);
if(pViewTmp == pView){
i=1;
break;
}
}
lua_pushinteger(L, j+1
(i));//0--未找到;1-3为屏幕号
return 1; /* 返回值的个数 */
}

#3

Updated by xiangyang li almost 5 years ago

  • Assignee set to zhixue wei

接口名改为 getscreenidx, 具体实现改为使用 CehmiView::m_screenId

#4

Updated by zhixue wei almost 5 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF