Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

4.2 Step 2: Creating the .Net assemblies

Before you can start creating your new projects you need to download the SDK and setup your development environment. Please follow the instruction given here: What should OpenMI 1.4.0.0 developers install

The next step is to create the wrapper classes (Figure 8). For this stage, make sure that the OpenMI Software Development Kit is installed on your PC.


Fig 8. C# wrapping classes
 

Load the .NET development environment. You should create one assembly for your wrapper classes and it is strongly recommended that you also create one assembly for the corresponding test classes.

You should can use the following naming conventions for your wrapper assembly:

Assembly name: MyOrganisation.OpenMI.MyModel.Wrapper
Assembly DLL name: MyOrganisation.OpenMI.MyModel.Wrapper.DLLdll
Namespace: MyOrganisation.OpenMI.MyModel.Wrapper
Class names: MyModelEngineWrapper, MyModelEngineDotNetAccess, MyModelEngineDLLAccess, MyModelLinkableComponent

...

Assembly name: MyOrganisation.OpenMITestOpenMI.MyModel.Wrapper.UnitTest
Assembly DLL name: MyOrganisation.OpenMITestOpenMI.MyModel.Wrapper.UnitTest.DLL
Namespace: MyOrganisation.OpenMI.MyModel.Wraper.UnitTest

Class names: MyModelEngineWrapperTest, MyModelEngineDotNetAccessTest, MyModelEngineDLLAccessTest, MyModelLinkableComponentTest

Now install the NUnit test software (see Chapter 6)

To the wrapper assembly, add the following references:

Org.OpenMI.Standard
Org Oatc.OpenMI.Sdk.Backbone
Org Oatc.OpenMI.UtilitiesSdk.Wrapper

To the test assembly, add the following references:
Org. OpenMI.Standard
Org Oatc.OpenMI.Sdk.Backbone
Org Oatc.OpenMI.UtilitiesSdk.Wrapper
NUnit.framework
MyOrganisation.OpenMI.MyModel.Wrapper

Note that if you have changed the namespace names for the SDK, the references above will be different.

After creating the assemblies and the classes, you can start working on the first class,
MyEngineDLLAccess. Details are given in the next section.