Psyclone
SDK for Cygwin (under Windows)
What
is the Psyclone SDK?
The
Psyclone SDK is the Software Development Kit for creating
internal Psyclone modules.
All
internal modules have to be fully specified in the psySpec configuration
file including in which third-party libraries to find their central
crank function which is run as an internal process inside Psyclone.
The specification includes information about which Whiteboards
to subscribe to, which additional messages to retrieve when woken
up by a trigger message, which parameters the crank function will
be given and where to post the output.
The
Psyclone SDK will enable you to create these crank functions which
are run by the internal modules. A crank function is very simply
a normal C function is an external library (a dll in Windows terms
or shared object in UNIX terms) which is called from within the
Psyclone executable and executed as if it resided inside. It is
passed a Messenger object with which it can communicate with the
internal module about new wakeup messages being received
from a Whiteboard because of a subscription as well as sending
any output message, if any. The Messenger object is also used
for information about the module's parameters and even binary
streams - more information about this can be found in the Psyclone
Manual.
How do
I unpack the SDK?
Cygwin for Windows is almost identical
with most flavours of UNIX, such as Linux and BSD.
The Psyclone SDK is downloaded
inside a tar archive. Before you can use it you need to unpack
it and the supporting files. To do so you need to be in the directory
where you downloaded the Psyclone SDK to. In here you enter
the following command on the command line
tar xvfz psyclonesdk[version]ncl.cygwin.tgz
where version is the Psyclone SDK version,
such as 0.5.0.0. This will create a directory with the name
psyclonesdk[version]ncl.cygwin
inside which you will find the
SDK files and examples.
How do I
run the SDK?
To
compile the examples you merely enter the following command on
the command line
make
This will compile and build the
library file
cm.dll
To
include crank functions as part of an external library when running
Psyclone you will need to create a psySpec and define a module
using the specific crank function as a crank. For example, to
define a module which uses the crank function testCrank located
inside the example library called cm, you would specify the module
like this
<module
name="MyModule">
<description>This
module is
my first module</description>
<parameter
name="maxcount"
type="Integer"
value="100"/>
<parameter
name="anotherparam"
type="double"
value="0.01"/>
<parameter
name="astringparam"
type="String"
value="Hello"/>
<spec>
<context
name="Psyclone.System.Ready">
<phase
id="1">
<triggers
from="WB1">
<trigger
after="100"
type="Psyclone.System.Ready"/>
<trigger
type="Test.Message.Type"/>
</triggers>
<cranks>
<crank
name="cm::testCrank"
/>
</cranks>
<posts>
<post
to="WB1"
type="Other.Message.Type"
/>
</posts>
</phase>
</context>
</spec>
</module>
For
more information on this, see the Psyclone Manual (psycloneManual.html).