This tutorial describes the procedure of creating a integration solution using the GIL framework.
Java JDK 6 | Is the Java development toolkit necessary for building solutions around GIL | Download |
NetBeans 6.8 or 6.9.1 | NetBeans is not necessary for GIL development. However this tutorial is intended to be as easy as possible and NetBeans is a great tool to make the process easier. | Download |
<add key="processModelAdapter" value="gil.io.example.ExamplePMAdapter" /> <add key="externalSystemAdapter" value="gil.io.example.ExampleESAdapter" />
! This is an example signal exchange list. To work properly with the example adapters in the gil.io.example ! package this example SEL may only contain Float32 values. !---------------------------------- Mandatory attributes -------------------------------------|---- Custom attributes ----| Type DataType Length Direction PMID ESID Description ESMin ESMax PMMin PMMax Analog Float32 1 ToPM pm0 es1 "Example signal 0" 0 20 100 500 Analog Float32 3 ToPM pmA1 esA1 "An array example" -- -- -- -- Analog Float32 1 ToES pm2 es2 "Example signal 2" 0 10000 0 100 Analog Float32 4 ToES pmA2 esA2 "An array example" 0 10000 0 100
The entry point for your integration solution is the Main.java file created when you created the project.
In NetBeans, open the Main.java file and alter the content to look like this (except the package declaration that may be different depending on the naming of your project):
package demointegration; import gil.GIL; public class Main { public static void main(String[] args) throws Exception { GIL.instance().start(9980); System.out.println("Hit Enter to quit..."); System.in.read(); GIL.instance().stop(); } }
GIL.instance().start(9980) Requests the singleton GIL instance and starts the GIL runtime, having the built in web server listening on port 9980.
This is pretty much what have to be done in the simplest GIL application.
Build your application: In NetBeans right click your project in the project browser and select Build (or just hit F11). Right click your project once again and select Run (or just hit F6).
When the application is started you will see debug printouts in the Output window. If it is not visible, select Output | Output from the Window menu.
In the output window you will see the "fake" values transferred between the example adapters for the process model and the external system. The example adapter for the process model also generates simulator commands:
To end the application hit Enter in the Output window.
When you application is running, direct you web-browser to http://localhost:9980/index.html. The GIL web interface is presented. From here you can control and monitor GIL.