指示灯-led

描述

LED指示灯,父对象为ui,无子对象


事件

  • userevent: 当订阅了某自定义事件,通过service.ctl.emitEvent(name, value)广播时触发, 事件函数定义: onUserEvent(name,value),参数name为事件名,value为数据

属性

名称 功能说明 脚本例子
geometryLocked 区域锁定,锁定后控件的位置及大小不能修改
x x坐标 (只读属性) var x = ui.form-name.led-name.x; 获取对象的x坐标
y y坐标 (只读属性) var y = ui.form-name.led-name.y; 获取对象的y坐标
width 宽 (只读属性) var width = ui.form-name.led-name.width; 获取对象的宽
height 高 (只读属性) var height = ui.form-name.led-name.width; 获取对象的高
enabled 使能:如果选中,对象处于激活状态,否则处于“禁止”状态,对所有触摸操作无反应。 ui.form-name.led-name.enabled=0 禁止对象
visible 可见:如果选中,对象可见,否则隐藏 ui.form-name.led-name.visible=0 隐藏对象
verbose 事件通知:当触发条件满足时,ExpOS主动向串口发送事件消息。仅当选择串口通讯协议为script mode时适用。 ui.form-name.led-name.verbose=1 设置对象触发的事件有效时向串口发送事件消息
borderColor 边界颜色,颜色定义参看 控件对象 ui.form-name.led-name.borderColor='#0000ff' 设置LED灯边界为蓝色
onColor 开启时LED颜色,颜色定义参看 控件对象 ui.form-name.led-name.onColor='#ff0000' 开启时LED为红色
offColor 关闭时LED颜色,颜色定义参看 控件对象 ui.form-name.led-name.offColor='#000000' 关闭时led为黑色
blinkInterval 闪烁间隔,单位:ms ui.form-name.led-name.blinkInterval=500 设置LED闪烁间隔500ms
state LED的状态:0-Off,1-On,2-Blink ui.form-name.led-name.state=2 设置LED为闪烁状态

方法

名称 功能说明 脚本例子
move(x,y) 移动对象:将对象移动到(x,y)坐标位置,坐标系的原点在屏幕的左上角。 ui.form-name.led-name.move(10,10) 移动对象到坐标(10,10)
resize(width, height) 设置对象宽和高 ui.form-name.led-name.resize(30,20) 设置对象宽30像素,高20像素

results matching ""

    No results matching ""