Concurrent Modules for Octave
GNU Octave is a
high-level language for numerical computation with a syntax
very similar to Mathworks' Matlab. The
interaction between Octave's plots and the interpreter are
currently very limited and there is no possibility to create
graphical widget that could be used to create user-friendly
interfaces. Octave being expandable, there exist several
packages (provide links) that improve this situation.While
most of the graphics related projects for Octave target an
improved plotting capability, few provide the creation of
GUIs. One prerequesite to support the creation and the use
of graphical widgets is to make Octave handle user triggered
Concurrent Modules for Octave, or CMO for short, is a GPL'ed project that aims to provide a framework to develope external modules that will:
ArchitectureCMO consist of three main parts:
Initialization and events pollingWhen initialized, CMO adds a private hook function to the input loop (currently only if readline library is used). The hook function is called every 1/100s and polls for events. Whenever events are pending, it executes the user defined callback associated with the event. In case where the event check occured while Octave is already executing a callback, then depending of the interruptibility propriety of this running callback, the current event callback is called or not. If not, it will be discarded or kept for later handling, depending on the discardability propriety of the event.
Sending commands and receiving resultsOctave interpreter can request the module to execute some module-specific commands. These commands depend on the implementation of the module. But independently on the module implementation, Octave stores the command type and its argument in a slot, then it notifies the module by writing in an anonymous socket, and then it blocks waiting for a response from this same socket. Meanwhile, the module receives the signal on its socket, retrieves the command type and its argument and executes it. The execution code depends on the module implementation. The commands are identified by a simple integer. The first few integers are not to be used by the module implementator, because they are used to do specific functions: enabling/disabling events and exiting the module. The user-types are to be handled by a specific function implemented by the module.
Events and callbacksEvents are currently identified by the triplet
ExamplesThe source code contains a test module
APIA Doxygen documentation with source is provided in the following package: cmo-0.0.1-doxygen.tar.gz. Untar and use any browser to read the index.html file therein.
StatusAfter a proof of concept, CMO is evolving to a usable project. Current stage is debugging the code. Subsequent step is to provide an Octave GUI Module based on it. This may result in implementing a new Octave data type taylored for CMO and representing abstract objects.
DownloadA preliminary package useful only for developers is to be downloaded from this cmo-0.0.1.tar.gz, it is distributed under the GPL v2 or later licence.
Last modified: Mon Feb 2 07:32:29 CET 2004