当前位置:网站首页>Zero basic learning canoe panel (17) -- panel CAPL function
Zero basic learning canoe panel (17) -- panel CAPL function
2022-07-25 21:18:00 【Ant soldier】
- I am a Ant soldier , Focus on the field of on-board diagnosis , Especially good at CANoe Tool use
- Looking for organizations , Answer questions and solve doubts , Fishing and chatting , Blog source code , Click to add 【 Love each other and family 】
- Zero base learning CANoe Panel Summary of design catalogue , Click the jump
Preface
Panel The attribute of is basically defined at the time of creation ; CANoe Built in a few CAPL Function, Allow us to CAPL Dynamic changes at runtime Panel Properties of control , For example, open a panel , Disable a control , Change the color of the control .
Demonstrate hardware and software environment
Windows11 x64;CANoe 11 SP2 x64
Catalog

Open and close Panel
- Here's the picture , In this series of courses , I demonstrated how many Panel , And are Closed Windows,CANoe No one is opened in the environment Panel

1️⃣ adopt openPanel and closePanel Can open / Close a Panel
- In some test scenarios , Test to a certain step , It has to be Panel Input conditions , You can call up Panel
- Panel Your name must have been Added Get into CANoe In the environment , Fill in directly Panel The name is ok
on key 'b'
{
openPanel("PanelCAPL_Fucntions");
}
on key 'c'
{
closePanel("PanelCAPL_Fucntions");
}
2️⃣ Press the button ‘b’ Just call it up PanelCAPL_Fucntions Control 
Set up Panel Control visibility
- SetControlVisibility You can set Panel Control visibility , It can be used to hide some controls

Hide a control
- Hide one Button Control
on key 'd'
{
SetControlVisibility("PanelCAPL_Fucntions","Button",0);
}

Hide all controls
- As long as the second parameter is specified as “”, You can hide all controls
on key 'd'
{
SetControlVisibility("PanelCAPL_Fucntions","",0);
}

Hide all Panel All controls of
- The parameters of the first and second are empty , Then hide all open Panel All controls of
on key 'd'
{
SetControlVisibility("","",0);
}
Hide all Panel Specified control of
- The first is empty , The second parameter is not empty , as follows , Then hide all open Panel All names in are Button Control for
on key 'd'
{
SetControlVisibility("","Button",0);
}

Set up Panel maneuverability
- enableControl Function can set whether the control allows operations
- The third parameter is zero 0, Do not operate ;1, operational
- When the first parameter and the second parameter are empty , Same as the above description , It works on all .

on key 'e'
{
enableControl("PanelCAPL_Fucntions","Button",0);
}

Control color and background color
There are mainly 4 A function SetControlForeColor ;SetControlBackColor ;SetControlColors ;SetDefaultControlColors
Here is the color of the control , Not the color of the control description label
The third color passes MakeRGB(255,0,0) function To calculate the .
You can get RGB Three values , This can be done in the following way , Or the color value table on the network


Control font color (SetControlForeColor )
- The function prototype :
void SetControlForeColor(char[] panel, char[] control, long color);
on key 'f'
{
SetControlForeColor("PanelCAPL_Fucntions", "Button", MakeRGB(252,64,17));
}
- Press down ’f’ key , notice button It is set to red .

Control background color (SetControlBackColor )
- The function prototype :
void SetControlBackColor (char[] panel, char[] control, long color); - Be careful , This Button The control of Button Style Property should be set to Not Standard type
- For any control , If the background color is Panel Edior Not optional , be CAPL Function cannot be set , therefore , If your settings are unsuccessful , Check carefully .
on key 'g'
{
SetControlBackColor("PanelCAPL_Fucntions", "Button", MakeRGB(48,242,41));// green
}
- Press down ’f’ Key sum ’g’ key , notice button It is set to red , The background color is also set to green .

Control font color and background color (SetControlColors )
- The function prototype :
void SetControlColors(char[] panel, char[] control, long backcolor, long textcolor); - It is the function set of the above two functions , You can set the font color and background color at the same time
- Set black paper and white characters below
on key 'h'
{
SetControlColors("PanelCAPL_Fucntions", "Button", MakeRGB(0,0,0),MakeRGB(255,255,255));
}
- Press down ’h key ,

Control default color (SetDefaultControlColors )
The function prototype :
void SetDefaultControlColors(char[] panel, char[] control);Restore the default color of the control .

summary


- Have the most simple life , The furthest dream , Even if it's freezing tomorrow , Lu Yao's horse died !
- If this blog is helpful to you , please “ give the thumbs-up ” “ Comment on ”“ Collection ” One key, three links Oh ! It's not easy to code words , Everyone's support is my driving force to stick to it .
边栏推荐
- IEC61131 address representation
- 一道golang中defer和函数结合的面试题
- cts测试步骤(卡西欧cts200测试)
- My heart's broken! After being cheated by 30000, a 16-year-old girl was unconvinced and cheated by 50000
- JMeter distributed pressure measurement
- Apple estimates that iPhone will give up the Chinese market, and the Chinese industrial chain needs to consider living a hard life
- CV image flipping, emgucv image rotation "recommended collection"
- 一道golang中关于接口和实现的面试题
- Autojs learning - file depth search
- Fusing and degrading Sentinel
猜你喜欢

Record the transfer of domain names from Alibaba cloud service providers to Huawei cloud

Leetcode-114: expand binary tree into linked list

Canvas 填充渐变

Airtest解决“自动装包”过程中需要输入密码的问题(同适用于随机弹框处理)

Airtest solves the problem that a password needs to be entered in the process of "automatic packaging" (the same applies to random bullet frame processing)

IEC61131 address representation

Trusted and controllable way of Tencent cloud database

The international summit osdi included Taobao system papers for the first time, and end cloud collaborative intelligence was recommended by the keynote speech of the conference

matlab----EEGLab查看脑电信号

Leetcode-6131: the shortest dice sequence impossible to get
随机推荐
I live far away. Is there a good way to open an account? Is it safe to open a stock account by mobile phone?
【网络教程】IPtables官方教程--学习笔记2
Differences between seaslog and monolog log systems, installation steps of seaslog [easy to understand]
Remote - actual combat
Trusted and controllable way of Tencent cloud database
When facing complex problems, systematic thinking helps you understand the essence of the problem
My heart's broken! After being cheated by 30000, a 16-year-old girl was unconvinced and cheated by 50000
零基础学习CANoe Panel(17)—— Panel CAPL Function
Based on pexels image material API, sort out the material resource library
数据库sql语句练习题「建议收藏」
Leetcode-6126: designing a food scoring system
[FAQ] access the HMS core push service, and the server sends messages. Cause analysis and solutions of common error codes
ES6---4个强大运算符(??、??=、?.、?:)
Golang language quickly get started to comprehensive practical notes (go language, beego framework, high concurrency chat room, crawler)
Experience sharing of system architecture designers preparing for the exam: from point to surface
MPI learning notes (II): two implementation methods of matrix multiplication
yuv422转rgb(422sp转420p)
Leetcode-6129: number of all 0 subarrays
Canvas 填充渐变
npm 模块 移除_【已解决】npm卸载模块后该模块并没有从package.json中去掉[通俗易懂]
