GUI Develop - HenriquesLab/NanoJ-Fluidics GitHub Wiki

Developing NanoJ-Fluidics

If you would like to contribute to NanoJ-Fluidics, we provide here instructions on how to download the source and compile it.

Environment

The project was written entirely in Java and was built around the Micro-Manager core library. We used IntelliJ IDEA (which we just call IntelliJ) to write and compile the project and as such we provide a complete set of IntelliJ project files to enable developers to download the project and compile with no (or minimal) setup required. If you choose to use IntelliJ, all you have to do is:

  1. Clone the repository from the Github repository into a directory on your file system.
  2. When starting IntelliJ, choose the option to Open an existing project.
  3. Choose the directory where you cloned the project into.

That should be all that is required to compile and run the code. The source includes the few external libraries that are required and the file structure was designed to OS agnostic (tested on Windows 7, 10 and Mac OSX).

Compiling and running in IntelliJ IDEA

To compile and create the Jar files, you simply start the build process by pressing the button highlighted by the red box on the image below. You can start the code as a stand-alone application from IntelliJ by pressing the button highlighted in blue (it will also compile and create new jars when you do so). The advantage of starting the application from IntelliJ is that all error output is printed directly on IntelliJ's log window, which helps debugging a lot. build

Dependencies for other environments

If you choose to compile the project using another environment, you will need to add a few dependencies.

Micro-Manager

We use Micro-Manager's CMMCore object to perform serial communication. We provide copies of all relevant files under the "Libraries" folder. If you wish to have a different copy to work with, you can download and compile Micro-Manager yourself. However, it is a large project and it is easiest to simply install micro-manager and either link to the installation, or copy the relevant files.

You will need two of Micro-Manager's jar files:

  • MMCoreJ.jar
  • MMJ_.jar

You will also need a few native library files. Which ones you need will depend on your operating system.

On Windows:

  • MMCoreJ_wrap.dll
  • mmgr_dal_SerialManager.dll

On UNIX environments:

  • libmmgr_dal_SerialManager
  • libMMCoreJ_wrap.jnilib

Additional dependencies

In addition, we use the below repositories, available through maven:

If you would like to run the application as an ImageJ plugin, you will also need to have ImageJ as a dependency. It is also available through maven:

Developing Pump Plugins

If you would like to control pumps other than the Lego pumps and still use our GUI, you can. NanoJ-Fluidics uses a plugin system to enable anyone to extend the capabilities of the software to control any type of pump. All you need to do is to extend the nanoj.pumpControl.java.pumps.Pump abstract class and implement nanoj.pumpControl.java.pumps.PumpInterface. The process is as follows:

  1. Create a new module that has the NanoJ-Fluidics code a a dependency.
  2. Write a new class that extends Pump and implements the methods in PumpInterface.
  3. In the JAR file, you have to provide the following a manifest with the below structure:
+--META-INF
|  +--services
|  |  +--nanoj.pumpControl.java.pumps.Pump <- contents of this file are your Pump classes
|  +--MANIFEST.MF

Aside from a standard manifest file, you'll have to provide a service provider identification file. This is a file that lists all classes that extend the Pump class. The file itself is named after the nanoj.pumpControl.java.pumps.Pump class and is placed in a subfolder called service. You can look at the pumpControl modules in our source code to see example projects.