文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 互联网 > AlarmWorX64 Viewer - Using Custom Events
侵权投诉

AlarmWorX64 Viewer - Using Custom Events

AlarmWorX64 Viewer – Using Custom

Events

July 2012

Description: Guide to use custom events in AlarmWorX64 Viewer.

OS Requirement: Windows Server 2003 x64, Server 2008 x64, Server 2008 R2 x64, Windows Vista x64, Windows 7 x64

General Requirement: Installation of GENESIS64 and a basic understanding of GraphWorX64 Scripting.

{

MessageBox.Show("Custom event has been fired!"); }

Introduction

The AlarmWorX64 Viewer provides a comprehensive set of features, which are generally capable of covering all of your alarms visualization needs. If there is any advanced operation you would like to perform that is not directly available as a native feature, then you can take advantage of the so-called “Custom Events” which may be fired from the AlarmWorX64 Viewer to let you perform any custom action you would like.

In this Application Note we will see how easy and fast is to enable and configure such option.

We can now test our example therefore we switch the display to runtime mode. The custom event can be fired from a few different places: from the ribbon bar, from the AlarmWorX64 Viewer Runtime Toolbar or from its context menu.

Enabling Custom Events

To enable Custom Events, select your AlarmWorX64 Viewer control inside GraphWorX64 and open the Property Grid. Look for the property called AllowCustomEvents inside the Common group. By default it is set to False, change the value to True, to enable it.

We still need to create the handler function which will be executed when the custom event is fired. To create it, click on the Events button from the AlarmWorX64 Viewer Property Grid.

Figure 2 – Firing the custom event

Picking anyone of these 3 commands will fire our handler function.

Figure 1 – The Events button

Figure 3 – The message we show from the event handler

From the events list which will be shown, locate the CustomEvent event in the Misc group. Double-click on it, the Script Editor automatically creates a handler function for this event, with the appropriate method signature.

The Script Editor will show up. You can now fill the generated script function with your own application-specific code. In our example we just want to show a message to inform the user that the event has been correctly fired. Our function will look like this:

function AlarmWorX64Viewer1_CustomEvent(sender : System.Object, e : System.EventArgs)

Copyright 2012 ICONICS, Inc.

Page 1 of 1

Now, you only need to change the content of the handler with your own logic. Some possible operations you may perform from there include (but are not limited to):

Load another display

Show/hide some content in the display Write to some process point Update a database

Launch an external application

See Scripting Help files documentation, other Application notes or the GenDemo Learning Center for more details about

AlarmWorX64 Viewer - Using Custom Events

AlarmWorX64 Viewer - Using Custom Events

AlarmWorX64 Viewer - Using Custom Events

AlarmWorX64 Viewer - Using Custom Events

AlarmWorX64 Viewer - Using Custom Events

AlarmWorX64 Viewer - Using Custom Events

scripting in GraphWorX64.

AlarmWorX64 Viewer - Using Custom Events

第1页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email