AVEVA OMI Software Developer Kit
Using the AppConfig SDK

The general workflow for using the AppConfig SDK to create an application editor is:

  1. In Visual Studio, create a new Windows Desktop project and select the WPF User Control Library.
  2. Add the reference assembly, ArchestrA.Client.AppConfig, to the project.
  3. Implement IEditorConfig and create the App Editor class. This is needed to be able to launch the editor. IEditorConfig is used to:
    • Initialize the App Editor.
    • Load and save app configuration data.
    • Load and save preference data.
    • Initialize activity.
      IEditorConfig
      Copy Code
          /// <summary>
          /// IEditorConfig must be implemented by the app developer. This interface is used to initialize, save , load, and creating an activity (tab) in
          /// the app editor.
          /// IEditorConfig is responsible for implementing the logic of saving and loading app data.
          /// IEditorConfig is also responsible for creating tabs/activities and giving them to IEditorBase.
          /// </summary>
          public interface IEditorConfig
          {
              /// <summary>
              /// InitializeEditor method will initialize App Editor with IEditor, which hosts the editor.
              /// By reflection, the AVEVA internal framework finds IEditorConfig and calls InitializeEditor by passing IEditorBase.
              /// IEditorBase is a container, or actual editor.
              /// </summary>
              /// <param name="editor">IEditor hosts this App Editor</param>
              void InitializeEditor(IEditorBase editor);
              /// <summary>
              ///  Save method will return the data which App Editor needs to save in the database.
              ///  Save method will be called by the AVEVA internal framework whenever the user clicks save.
              ///  Dictionary key will be the file name at time of deployment of the app.
              ///  Every file will hold the value.
              ///  At runtime, the app will read the configuration data from the deployed file.
              /// </summary>
              /// <returns> Save method returns dictionary key as string which may be the file name and data in byte array</returns>
              Dictionary<string, byte[]> Save();
              /// <summary>
              /// Load method called by the AVEVA framework when load happens.
              /// </summary>
              /// <param name="appData">Returns dictionary which was saved in the database</param>
              void Load(Dictionary<string, byte[]> appData);
              /// <summary>
              /// App developer will create all activity and return to framework.
              /// </summary>
              /// <returns>returns IEditorActivity array </returns>
             
              IEnumerable<IEditorActivity> GetActivities();      
          }
  4. Create an App Activity class, derived from the EditorActivityViewModelBase. Use this class to implement all front end logic. You will also use this class to create an activity tab in the editor. For more information, see EditorActivityViewModelBase Class.
  5. Link the App Activity class with a class derived from the base View class (WPF user control).
  6. Compile your code and build the app editor DLL assembly.
  7. Create a folder and move the app DLL, app editor DLL, any dependent DLLs, and the appmanifest.xml file into it.
  8. From the System Platform IDE (ArchestrA IDE), use the ArchestrA App option from the Galaxy > Import menu to select the folder that contains your app and import the app into the IDE.
  9. After importing the app, open it from the Graphic Toolbox and configure the app with the editor you created.

 

See Also