/MEng/System/CQC/Runtime/EventClass Information:| ClassPath: | MEng.System.CQC.Runtime.Event | | Parent ClassPath: | MEng.Object | | Copyable: | Yes | | Final: | Yes |
MEng.System.CQC.Runtime.Event allows you to manipulate CQC events. These are sent by drivers (and possibly other sources) to indicate that changers or some sort of activity has occurred. Some CQC programs can be configured to watch for and react to these events. Normally you would not use this class, however if you write an event handler macro as part of a triggered event action, you will receive the event object as an instance of this class and can use this class to examine the contents of the event. You might also build up an event to send out from one of your macros. Events are in a hierarchical block format, as described in the Event System Reference technical document. So any given block or value can be indicated using a path-like syntax, such as /Block1/SubBlock2/Value3, which would reference a value named Value3 which is one of the values in SubBlock2 which is one of the blocks under Block1. So the parameters below that indicate a parent block (or scope) or that indicate a value, are strings of this type. Nested Types:
Enum=EvObjErrors
AccessErr : "";
ConvertErr : "";
ParseErr : "";
EndEnum;This enumerated type defines the exceptions thrown by this class. They have no text because they just get assigned the underlying C++ exception text.
Constructors:
Constructor();
Constructor([In] MEng.String ToParse); The default constructor just creates an empty object for later setup. The second one takes a formatted event object and parses it into this object. If the text is not valid, it will generate a ParseErr exception.
Final, Const Methods:
Format([Out] MEng.String ToFill); Formats the contents of this event object out to the passed string in the standard block format. So you can use Parse() to bring in a text formatted event, manipulate it, and then format it back out again.
IsFldChangeEv() Returns MEng.Boolean;
IsUserActionEv() Returns MEng.Boolean; These methods are helpers that check an event to see if it is one of the extremely common types of events that are often send and received.
ValueExists([In] MEng.String ToCheck) Returns MEng.Boolean; Checks to see if the passed path exists and, if so, that it refers to a value, not a block.
Final, Non-Const Methods:
AddBlock([In] MEng.String Parent, [In] MEng.String Name); Adds a new block with the indicated name, under the indicated parent block.
AddValue([In] MEng.String Parent, [In] MEng.String Name, [In] MEng.String Value); Adds a new value, with the indicated name and value, to the indicated parent block.
AsBool([In] MEng.String Path) Returns MEng.Boolean;
AsCard4([In] MEng.String Path) Returns MEng.Card4;
AsCard8([In] MEng.String Path) Returns MEng.Card8;
AsFloat([In] MEng.String Path) Returns MEng.Float8;
AsInt([In] MEng.String Path) Returns MEng.Int4;
AsString([In] MEng.String Path) Returns MEng.String; These methods are helpers that will find the value indicated by the passed path, and attempt to convert it to the indicated data type and return the result. So, if you now that /Foo/Bar/Test is an unsigned value, you can easily get that value as a Card4 value, for instance, by using AsCard4("/Foo/Bar/Test").
Parse([In] MEng.String Text); This method will parse a text representation of an event, creating the hierarchical structure which you can then manipulate using the methods of this class. So you can use this method to bring in a text formatted event, manipulate it, and then format it back out again using Format.
Reset(); This method will clear out this object, leaving you with an empty hierarchy, i.e. just a "/" root scope.
|