Is it possible to support 2 front panel projects in the same platform?

#1

My product uses the same base electronics and software configuration, but can support two different front panel configurations, with different size displays, and one is a touch panel while the other is not.

Is it possible to build 1 platform with 2 different front panel projects and then choose which UI to initialize at runtime?

Thanks,
Mike

#2

Hello @mcranston,

you can have multiple front panels in your platform.
To do so, you need to add all of your front panel files (.fp files) in your {platform}-fp project.
Then you can define your default front panel by adding the property fpFile.name=yourDefautlFrontPanel.fp in the file frontpanel.properties of your {platform}-configuration project. Now you need to build your platform to save the modifications.
To switch between the different front panels, you have to go in Run Configurations -> JRE and add in the VM argument section -Dfrontpanel.file=yourOtherFrontPanel.fp .

You can’t choose which UI to initialize at runtime but you can add a check directly in your Java application to define your UI initialization.
In your case, as your displays have different sizes, you can use the methods getWidth() and getHeight() of ej.microui.display.Display to retrieve the informations of the size of the display, defined by your front panel, and initialize the UI accordingly.

We do believe that it would be better to create two platforms, one for each front panel, as you won’t need to change the JRE arguments each time you’ll want to switch board.

Regards,
Florian for MicroEJ.