AVEVA OMI Software Developer Kit
Using the Graphic Control API

The general workflow for using the GraphicControl SDK is:

  1. Show the GraphicControl in an ArchestrA App. Create a reference to the ArchestrA.Client.ProcessControls assembly and namespace, and use the control as shown below:
    GraphicControl Reference
    Copy Code
    // Create a reference
    xmlns:controls="clr-namespace:ArchestrA.Client.ProcessControls;assembly=ArchestrA.Client.ProcessControls"
    // Use the control
    <controls:GraphicControl GraphicName="{Binding SymbolName}"}/>
  2. Retrieve the content from a navigation path, based on the selected filter options as shown in the example code. Refer to the navigation model assembly (ArchestrA.Client.Navigation.NavigationModel).

    ContentTypes is type IEnumerable<string>. For additional filter options, see the ContentTypes section in Navigation Hierarchy API.

    Retrieve Content
    Copy Code
    public static ArchestrA.Client.Navigation.ContentData[] GetContentInHierarchy(string navigationHierarchyPath,
    ArchestrA.Client.Navigation.FilterOptions filterOptions ContentData [] contentData = NavigationModel.GetContentInHierarchy
    (@"\\Home\Root1", FilterOptions = new FilterOptions()
    // Gets the content whose contenttype is faceplate while searching one level of the hierarchy.
    searchResult = navModel.GetContentInHierarchy(@"\\Home\Root1", new FilterOptions() { ContentName = "*",
    ContentTypes = new string [] { "faceplate" }, LevelsOfSearch = LevelsOfSearch.SearchesOneLevel, NavigationSearchMode = NavigationSearchMode.ChildrenAlone });
  3. Show the GraphicControl in the ArchstrA app. The GraphicControl is defined under the namespace ArchestrA.Client.ProcessControls, and the assembly that defines the APIs is ArcestrAClient.ProcessControls.DLL.
  4. Retrieve the content from the navigation path, based on the filter options you have set. The search content API is defined under the namespace ArchestrA.Client.Navigation. The assembly defined these APIs is ArchestrA.Client.Navigation.dll.

GraphicControl Properties

GraphicControl is a user control, wrapped around the AVEVA OMI visualization module. This provides an easy way to instantiate and display the OMI visualization module in any ArchestrA app. GraphicControl abstracts all of the logic for instantiating and rendering graphics in a XAML template, and exposes the following properties. You can bind these properties within the apps that you write to use their functionality.

  • GraphicName: [Required] The name of the graphic to be displayed in an app. You must provide a value for the GraphicName. The syntax for setting the GraphicName is ObjectName.SymbolName.
  • OwningObject: [Optional] This optional property sets the owning object of the graphic. If a value for OwningObject is not provided, the tagname of the object associated with the graphic is used. This property is not set for toolbox graphics without an owning object.
  • EnableContentInteraction: If true, this enables the content to be interactive. In a graphic, this property controls whether or not user-interaction animations are enabled. The default setting this property is true.
  • EnableParentNavigation: If true, clicking on content that does not include an interaction animation triggers a move to the navigation item linked to the content. The default setting for this property is true.
  • SetCustomPropertyValue: This property is used with the Graphic Repeater app to set override values for each set of custom properties used in the configured app. It has three parameters: 
    • name is the name of custom property to be modified. This parameter is of type string.
    • value is the new value to be set. This parameter is of type string, and can be an expression, reference, or constant. If the value is given in quotes ("), it is considered a constant.
    • isConstant is a Boolean that indicates whether the new value will be evaluated as a constant or as a reference. If true (1), the value is treated as a constant. If false (0), the value is treated as a reference. This parameter only applies when value is reference or or constant, and the custom property specifed by  the name  parameter is a string or time type. This parameter has no meaning if the custom property is an integer, float, Boolean, or double.

For information about using the GraphicControl properties in scripts to change references in a symbol or app, such as the Graphic Repeater app, see  Changing the Expression or Reference of a Custom Property at Run Time, in the AVEVA OMI help.

See Also