Creating Programs
How to use the program creation wizard.
Creating UUIDs
How to create UUIDs.
PACCreateModuleFiles. After compiling and installing PAC you should find the binary file in the bin sub-directory of your PACLib directory. The program expects a single parameter: the filename of a module configuration file. Such a file has a very simple structure.
Each line is ended with a linebreak and may only contain a single word. The first line gives the name of the module. Now groups of class definitions follow. Each class definition consists of a class name and a list of interface names. A class definition is ended with an empty line. The names of the classes and interfaces must be given without the leading C or I as described in the conventions section. They are added automatically.
For example, suppose you want to create a module with the name MyModule which contains the classes Camera and BMPFile. The class Camera implements the interfaces ImageSource and CameraAccess and the class BMPFile implements the interfaces ImageSource and FileAccess, then the module configuration file looks like this:
MyModule Camera ImageSource CameraAccess BMPFile ImageSource FileAccess
PACCreateModuleFiles creates a subdirectory in its execution path with the module name. In this path you find the following files:
SETUP
BUILD make will be sufficient. However, the first time you compile the module make sure you call BUILD. Don't forget to set the environment variable PAC_HOME to your PACLib directory before calling BUILD.
configure.in
Makefile.am
Doxyfile doxygen Doxyfile in your module directory, doxygen creates a subdirectory doc which contains the module's documentation. By the way, doxygen is installed under /home/paclib/bin (only for Solaris).
source doc which contains the main doxygen documentation file. Edit this file to change the main documentation page of your module.
The source code created by PACCreateModuleFiles is documented. Please read this documentation thoroughly to get some idea of how all this works.
You should create new modules in the main PACLib path. The following steps give an example of what you should typically do to create a new module.
/home/chp/PACLib.
module.config.
bin/PACCreateModuleFiles module.config
SETUP and then BUILD to compile the module. The module is automatically installed in the lib subdirectory of PAC_HOME.
PACCreateProgramFiles. This program expects two parameter: the name of the program that is to be created and its type. It then creates a subdirectory in its execution path with the name of the program. Again you will find a SETUP and a BUILD script and the standard doxygen files. The program source can be found in the source subdirectory. It contains many comments which should help you to understand how modules are used. Use the programs created in this way as templates for your own work. Note that the BUILD script installs the binary in the bin subdirectory of PAC_HOME. The command line syntax is as follows:
PACCreateProgramFiles -name [Name] -type [plain | pacapp]
If you choose type pacapp you get a program skeleton based on the CPACApplication class. This should be your preferred choice if you want to work with images.
You have to set PAC_HOME appropriately before executing PACCreateProgramFiles.
PACCreateModuleFiles creates the necessary UUIDs for the interfaces that you specify. If you want to add new interfaces later on, you only want to create a UUID, not a whole new module.
This can be achieved with the program PACCreateUUID. The program expects a single parameter which is the name of the interface without the leading I. The appropriate source code is then created and written to the standard output. Simply copy and paste the output into your interface declaration header file.
For example, the output of PACCreateUUID TestClass looks like this:
#if !defined( _PAC_IFC_ITESTCLASS_0FC759AF_5184_45CB_BB3AD848755D4DDE_DEFINED_ )
#define _PAC_IFC_ITESTCLASS_0FC759AF_5184_45CB_BB3AD848755D4DDE_DEFINED_
/// To implement the UID { 0fc759af-5184-45cb-bb3ad848755d4dde } write:
PAC_IMPLEMENT_UID(ITestClass,
0x0f, 0xc7, 0x59, 0xaf,
0x51, 0x84,
0x45, 0xcb,
0xbb, 0x3a, 0xd8, 0x48,
0x75, 0x5d, 0x4d, 0xde);
// Insert your interface declaration here.
#endif
|
Perception-Action Components Library - PACLib developed by the Cognitive Systems Group |