Skip to content

openenergysolutions/openfmb.eaprotobufexporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenFMB Protobuf Exporter

Overview

The OpenFMB Protobuf Exporter is an Enterprise Architect* Add-In to export OpenFMB UML modules or packages as Protocol Buffer definition (.proto) files.

NOTE:
Enterprise Architect is a commercial tool that needs appropriate licensing so that the OpenFMB Protobuf Exporter add-in can be installed.

Installation

  1. Download the installer from the release below:

    https://github.com/openenergysolutions/openfmb.eaprotobufexporter/releases/download/v1.0.0/setup.exe

  2. Double click on Setup.exe to start the installer

    image

  3. Press Next to continue

    image

  4. Accept the default program installation directory or select another directory in which to install the DLL

    image

  5. Press Install to begin installation and press Finish when it is done

    image

  6. If you accept the default directories during installation you will see the following directory structures:

    image

Running the OpenFMB Protobuf Exporter Add-In

  1. Start Enterprise Architect and load OpenFMB UML model

    image

  2. On "Project Browser" window, right click on "OpenFMB", select "Specialize", "OpenFMB Protobuf Exporter", then click on "Export to proto files..." to launch to add-in tool

    image

  3. The OpenFMB Protobuf Exporter will build a Tree View containing the model information with check boxes next to the Tree Nodes that are specific to the generation of the Protobuf files in the left pane and processing information in the right pane. Since it is used by the other modules, the Common is always checked.

    image

    image

    By default, all the modules are checked. Uncheck the modules that you do not want to be generated.

  4. Click on Export Protobuf button to start exporting

  5. When the generation process completes with no errors, the “Save Protobuf” button will be enabled. Clicking the “Save Protobuf” button will bring up a “Browse For Folder” window to allow the user to browse to the directory where the Protobuf files will be saved. When the save process completes, the right pane will display the Protobuf files saved with their absolute paths and the message “Save complete…”

    image

    The save process will create the Protobuf directory structure if it does not exist. If the directory structure does exist, then the save process will overwrite the existing files. The Protobuf directory structure under the user selected directory is openfmb/.

  6. Errors during exporting protobuf

    If an error is encountered during processing, the following will be displayed after all error messages: An error was encountered while generating the proto3 files. The saving of the proto3 files has not been disabled. Please correct the error(s) listed and regenerate the proto3 files.

    At this point the user has the following options:

    • Reselect the nodes that do not have errors and generate the Protobuf information. This option will not export a full set of Protobuf files.
    • Close the Tree View window, fix the errors, and re-export the Protobuf information

Cloning

Clone the repository

git clone https://github.com/openenergysolutions/openfmb.eaprotobufexporter.git

Building

The OpenFMB Protobuf Export is written in C# Winform. Microsoft Visual Studio is needed to build the tool. The output is the EAProtobufExporter.dll that can be manually installed in Manual Installation section below.

Manual Installation

Manually installing the OpenFMB Protobuf Exporter can be done by following these steps:

  1. Copy the EAProtobufExporter.dll to the desired directory (i.e. “C:\Program Files\OpenFMB\bin”)

  2. Register the DLL by running the Assembly Registration Tool

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "C:\Program Files\OpenFMB\bin\EAProtobufExporter.dll" /codebase
  3. Create a new entry in the registry by running regedit. This will allow Enterprise Architect to recognize the presence of the OpenFMB Protobuf Exporter Add-In. Add the new key value “EAAddIns” or "EAAddIns64" under the appropriate location:

    • For single users: “HKEY_CURRENT_USER\Software\Sparx Systems”
    • For multiple users: “HKEY_LOCAL_MACHINE\Software\Sparx Systems”

    NOTE: For Enterprise Architect 64-bit (version 16 or later), the registry key is EAAddIns64. For older version, the registry key is EAAddIns

  4. Under the “EAAddIns” or "EAAddIns64" key, add a new key value using the project name “EAProtobufExporter” of the OpenFMB Protobuf Exporter Add-In

  5. Under the “EAProtobufExporter” key, modify the default value by entering the "project-name.class-name" of the OpenFMB Protobuf Exporter Add-In “EAProtobufExporter.Main”

Contributing

Contributing to the OpenFMB Protobuf Export tool requires signing a CLA, please email [email protected] and request it.

Other OpenFMB Tools

For more information about OpenFMB and its toolset, visit OpenFMB Adapter Toolset document site.

About

Creates Protocol Buffer .proto files from OpenFMB UML project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages