Sunday, 27 February 2011

j661: creating a simple User Application

As you may already know, the ARINC 661 standard is defined around an architecture where:

  • An ARINC 661 Server (also called ARINC 661 Kernel), which is a part of the Cockpit Display System (CDS) is initialized with a set a ARINC 661 Definition Files, and is responsible for the the User Interface

  • System Applications (called user Applications or UA in the standard) handle the logic, and are able to communicate to the Server to change widget parameters that were created at initialization. From the other side, the Server send to the User Application user events on widgets (such as clicks on buttons, change of text fields, etc...)

The ARINC 661 standard makes the UI definition very simple, but there is still the burden of developing the User Application part. The j661 project already provides a generic API which simplifies greatly the User Application / ARINC 661 Server communication, but you still need to develop the User Application code itself.

The Embedded Client framework provided in the project further simplifies this process, at least for prototyping User Applications. This framework is built under the following architecture:

The Embedded Client is a generic User Application with, contrary to the Client provided in the j661 project, has a minimal Graphical user interface, and is much more configurable.

The Embedded Client has the following features:

  • It is possible to start only a User Application, without any associated Server. Note that in this case the arincServer.jar and all associated libraries don't need to be provided

  • It is possible to start a User Application, and it's associated Server, sharing the same configuration properties

  • It is possible to add any list of Scripts to the User Application, to code the logic. Note that as it is the case for an ARINC 661 library embedded in a Java application, the scripts will use the Client java API

  • It is possible to add a list of DataProviders to the User Application, and wire the datas returned by the DataProviders to ARINC 661 parameters

A DataProvider is a source of data that can be plugged to an Embedded Client. To the DataProvider is attached an XML configuration file which defined the correspondence between the datas and the ARINC 661 properties. This way, it is possible to define the communication from the System Datas to the Client (User Application) by only defining a XML configuration file. No more code to write, you only need to wire the system datas to the ARINC 661 properties.

An example of this is provided in the j661 project: The FGPlayback contrib allows to read a FlightGear playback scenario by only defining an XML configuration file wiring the FlightGear variables to the ARINC 661 properties. For example:

<dataProvider provider="FGPlayback">
<context name="testLayer" layerID="1" appliID="1" />
<input context="testLayer" widgetID="1" paramID="A661_STRING"
<data name="latitude-deg" />
<input context="testLayer" widgetID="5" paramID="A661_STRING"
<data name="longitude-deg" />
<input context="testLayer" widgetID="3" paramID="A661_ROTATION_ANGLE"
<data name="heading-deg" />
<input context="testLayer" widgetID="10" paramID="A661_ROTATION_ANGLE"
<data name="roll-deg" />

Saturday, 12 February 2011

Eclipse, you are bloated

I'm using Netbeans for my day-today java projects, and I really have difficulties when I have to use Eclipse, but I often think that part of it is due to me being new to Eclipse rather than Eclipse itself. However, I also often find that there are real problems with Eclipse, and that my problems are not just coming from my own perception.

Some days ago, I had to install Google Web Toolkit, which is basically an Eclipse Plug-in allowing to generate some complex Javascript code using Java source code . The Java source compilation does not compile Java binary code, but Javascript code, and you can also use a very well done UI designer to create your UI by drag-and-drop rather than having to use complex Javascript libraries.

But this post is not about GWT, on which I have nothing bad to say, but about Eclipse itself, because GWT is an Eclipse plug-in.

First installing Eclipse itself (I used the last Helios version) take ages, in fact it takes so much time (and often it is freezed during the process) that you often think that there may be a problem. And I'm just talking about the first Eclipse internal configuration after you had unzipped the file containing the Eclipse file structure (what, no proper installer?).

Second installing plug ins is really awkward. You have to know the exact URL of the files to be able to download them (from Eclipse), and you HAVE to do it in Eclipse itself. And the UI to choose them is really poorly designed (it seems that you can't put a load of different URLs and download them all at once, you have to download the:m one by one). As for Microsoft software, it also seems that you have to restart Eclipse a lot of times in the process.

Another problem is that if you have to use Eclipse with it's plug-in on a PC not connected to internet, it's really difficult to do so. Basically you have to download it on the spot (something which is not always possible). Which is really awkward considering that there is no proper installer for the core Eclipse itself.

I also have to mention the fact that Eclipse is generally slow (that is, if you succeeded in the previous steps).

I really don't know how Eclipse can be so successful, where it has so much major shortcomings. I have to say that none of these problems exist in Netbeans: finding and downloading plugin-ins is really simple, you can do this by internet or using local files, installing Netbeans is REALLY shorter, and it's generally much more responsive. You can even copy an entire Netbeans directory with it's plugins, and it's working with really minor changes in the configuration (in fact, only one, the path of the JDK).