Embedding ModbusPal without a GUI

Introduction

In version 1.6, ModbusPal has been redesigned so that several instances can coexist. The core of the application resides in the modbuspal.main.ModbusPalPane class, which is a subclass of javax.swing.JPanel.

But it is not necessary to display the panel in order to use it.

An application can create an instance of ModbusPalPane and call the appropriate methods in order to perform all the actions that the user would perform thanks to the graphical interface.

Additionally, ModbusPal offers an internal storage mechanism in order to identify the ModbusPalPane instances and to be able to retrieve them by their identifier.

API

ModbusPalGui.getInstance(key)
Create a new instance of ModbusPalPane, using key as its identifier, or return the existing ModbusPalPane that has already been created with this identifier.
ModbusPalPane#getProject()
Return the current ModbusPalProject that the ModbusPalPane is running.
ModbusPalPane#setProject(project)
Change the project that the ModbusPalPane is currently running.
ModbusPalPane#startAll()
Start the current link and all the automations.
ModbusPalPane#startAllAutomations()
Start all the automations in the project.
ModbusPalPane#startLink()
Start the current link, as defined in the project.
ModbusPalPane#stopAll()
Stop the current lnik and all the automations.
ModbusPalPane#stopAllAutomations()
Stop all the automations in the project.
ModbusPalPane#stopLink()
Stop the current link.

Please consult the Javadoc of ModbusPal in order to get more information on the methods of ModbusPalPane.