<< 点击显示目录 >> 主页 mappView帮助助手 > mappView入门简单Wiki > 描述 |
这些是不同事件绑定的示例。
OPC 变量更改时选择列表框的第一个条目
<!-- Select first entry in list box item after init />-->
<EventBinding id="Recorder_1.CMD.Init_0">
<Source xsi:type="opcUa.Event" refId="::AsGlobalPV:Recorder_1.CMD.Init" event="ValueChanged" />
<EventHandler condition="NOT newValue" >
<Action>
<Target xsi:type="widgets.brease.ListBox.Action" contentRefId="contentRecorder" widgetRefId="lstRecNames" >
<Method xsi:type="widgets.brease.ListBox.Action.SetSelectedIndex" index="0" />
</Target>
</Action>
</EventHandler>
</EventBinding>
单击按钮时,读取客户端 ID,将客户端 ID 写入 OPC 变量,设置 OPC 布尔变量,使用排序
<!-- Command refresh recipe list />-->
<EventBinding id="Recorder_1.btnRecRefresh.Click">
<Source contentRefId="contentRecorder" widgetRefId="btnRecRefresh" xsi:type="widgets.brease.Button.Event" event="Click" />
<!-- Read session id />-->
<Operand name="slotId" datatype="ANY_INT">
<ReadTarget xsi:type="session.VariableAction.Read" refId="::SYSTEM:clientInfo.slotId" >
<Method xsi:type="session.VariableAction.GetValue" />
</ReadTarget>
</Operand>
<EventHandler>
<Sequence>
<!-- Set slot ID />-->
<Step order="1">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::AsGlobalPV:Recorder_1.PAR.VisuSlotID" >
<Method xsi:type="opcUa.NodeAction.SetValueNumber" value="=slotId" />
</Target>
</Action>
</Step>
<!-- Set command />-->
<Step order="2">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::AsGlobalPV:Recorder_1.CMD.Init" >
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</Step>
</Sequence>
</EventHandler>
</EventBinding>
选择列表框的第一个条目
<!-- Select first entry in list when page is loaded />-->
<EventBinding>
<Source xsi:type="clientSystem.Event" event="ContentLoaded" />
<EventHandler>
<Action>
<Target xsi:type="widgets.brease.ListBox.Action" contentRefId="contentRecorder" widgetRefId="lstRecNames" >
<Method xsi:type="widgets.brease.ListBox.Action.SetSelectedIndex" index="0" />
</Target>
</Action>
</EventHandler>
</EventBinding>