Application Note

 

 

AltiaÒ Design 2.3

Human Interface Design Software

Creating Custom Altia Runtime Applications

This Application Note describes the steps necessary for creating a custom Altia Runtime application.

 

Files Required for a Custom Runtime

Several files supplied with the standard Altia Design installation must be part of the custom runtime. The following files from the Altia bin directory must be included:

altiart.out - The Altia Runtime executable

fonts.ali - The font name alias file which translates generic font specifications into

platform specific font specifications.

In this application note, it is assumed that the custom runtime will be assembled in its own working directory. The files listed above should be copied to the working directory.

If your design uses the sound capabilities provided by Altia Design, you will need to include the sound files for the sounds you use and the soundit sound playing program. All standard sound files and soundit are located in the Altia sound directory. Copy the sound files you use and the soundit program to the same directory containing the other runtime files; or, you can copy the files into a sub-directory named sound.

The other runtime files must be supplied by the developer. They would include the actual design file (e.g., demo.dsn), the associated runtime configuration file (e.g., demo.rtm), an application program to control the design (e.g., demo.out) if appropriate, and possibly a script to simplify runtime startup. With Altia Design 2.3, no code word is required to execute Altia Runtime. If you have purchased Altia Design 2.3 development software or you have received new software while under a software support agreement, you are automatically licensed to create an unlimited number of runtime applications for distribution to customers or colleagues.

Executing a Custom Runtime

In order for a complete design to execute, altiart.out must be executed and passed the design file name using the option pair -file DESIGN_FILE (e.g., altiart.out -file demo.dsn). If the design includes an application program (e.g., demo.out), the application program must also be executed. A single line shell script can accomplish this all very easily. Taking the approach used by the standard Altia demos, you might create a script named go that contains the line:

./altiart.out -file demo.dsn -exec demo.out

If you look at one of the go scripts for a standard Altia demo, it is much more complicated only because it tries to determine its appropriate working directory and change directory to the working directory before executing any Altia programs. You can use one of these go scripts as a starting point if you like the enhanced functionality.

If your custom runtime has no application program, then don't include the -exec demo.out arguments.

If you do have an application program, the -exec... option is handy because altiart.out will not execute the program until the specified design file is completely loaded. Another approach is to have the application program start altiart.out with the appropriate design file. This is accomplished very easily with the AtStartInterface() function supplied with the Altia Design C/C++ application programming interface (API) library. For example, an application program can start altiart.out and load the design file demo.dsn by adding the following C source lines near the beginning of the main(int argc, char **argv) function:

if (AtStartInterface("demo.dsn", 0L, 0, argc, argv) < 0)

exit(1);

Upon successful return from AtStartInterface(), the application is ready to execute as always. If AtOpenConnection() is already being used, then simply replace it with a call to AtStartInterface() and make the necessary parameter changes (note: both of these functions are documented in Section II of the Altia Design Reference Manual). Using this approach, it is only necessary for the end-user to execute the application program - a startup script as described earlier is not required. As a final note, AtStartInterface() uses the following search algorithm to locate altiart.out: if the ALTIAHOME environment variable is set, it looks for altiart.out in $ALTIAHOME/bin; if it isn't found or ALTIAHOME isn't set, it searches for altiart.out in the directories specified by the PATH environment variable; if the PATH search fails, it looks for /usr/altia/bin/altiart.out as a last resort.

Packaging a Custom Runtime Application

After assembling the necessary files in a working directory, it is easy to just tar the files onto a floppy or some tape media using a command similar to:

tar cvf /dev/rfd0 altiart.out fonts.ali demo.dsn demo.rtm demo.out go

The end-user can tar the files off onto their own hard disk using a command like tar xvf /dev/rfd0 and then run the application. If you attempt to tar the files onto a floppy and they won't fit, you can first create a local tar file, compress it, and tar the compressed file onto a floppy. Here is an example of the necessary commands:

volcheck (for Solaris only)

tar cvf demo.tar altiart.out fonts.ali demo.dsn demo.rtm demo.out go

compress demo.tar

tar cvf /dev/rfd0 demo.tar.Z (On Solaris: tar cvf /vol/dev/aliases/floppy0 demo.tar.Z)

eject /dev/rfd0 (On Solaris: eject /vol/dev/aliases/floppy0)

The end-user can copy the files from the floppy with the commands:

volcheck (for Solaris only)

tar xvf /dev/rfd0 (On Solaris: tar xvf /vol/dev/aliases/floppy0)

zcat demo.tar.Z | tar xvf -

eject /dev/rfd0 (On Solaris: eject /vol/dev/aliases/floppy0)

To email a runtime application, use commands like the following to create a uuencoded compressed tar archive:

tar cvf demo.tar altiart.out fonts.ali demo.dsn demo.rtm demo.out go

compress demo.tar

uuencode demo.tar.Z demo.tar.Z >demo.uu

The resulting demo.uu file is an ASCII encoded file containing the compressed tar archive and can be attached to any email. A receiver of this email needs to save the email to a file, such as demo.uu, and execute the following commands from a shell to unpack the email:

uudecode demo.uu

zcat demo.tar.Z | tar xvf -