beautypg.com

Chapter 8, Tools menu functions, Overview – Ocean Optics SpectraSuite User Manual

Page 116: Custom libraries

background image

000-30000-020-02- 201110

104

Chapter 8

Tools Menu Functions

Overview

The tools menu provides the functionality to access the update center, select NetBeans settings for
SpectraSuite modules, accept user-created plug-ins, and control the SpectraSuite parameters.

Custom Libraries

SpectraSuite provides the capability of creating a button in the SpectraSuite GUI that, when pressed, calls
an external function of your choosing. It is possible to call a C function from a DLL, .so, or .jnilib file
(that is, under Windows, Linux, or MacOSX), or a Java function from a .jar file (on any platform). The
function will take a single integer value that you specify when linking to the function.

In addition to calling user functions, these events will be capable of changing the spectrometer state, e.g.
GPIO settings. To make a button that calls external code, it is necessary to identify the function (Tools |
Custom Libraries | Add New External Library
), then map a button to it (Tools | Custom Libraries |
Configure External Library
).

See the following rules before using this feature:

 Libraries must be written either C or Java

 Java libraries are expected to be packaged in a .jar file and the function to be invoked is expected to

be in a public method of class (the method does not need to be static)

 C libraries must be compiled into a dynamic library (dll on Windows, so on Linux, dylib on Mac

OS)

 C libraries must be compiled with a C compiler (such as gcc) and may not be compiled with a C++

compiler (such as Microsoft Visual Studio’s C++ Compiler)

 If using a C library, you must know the name of the function you want to invoke within SpectraSuite

 Any C function used is expected to have a return type of void

Java methods may have any return type, but at this time there is no way to gather the method’s return data
within SpectraSuite.