Xcode sample projects/Read me, April 2006
Preliminary note
Overview
Smile 3.1.x installs two template projects and one Satimage includes folder into /Library/Application Support/Apple/Developer Tools/Project Templates/Satimage Sample Projects/. Furthermore, an Xcode sample projects folder containing four sample projects is provided in the /Applications/Smile/ folder. All of those sample projects require the Satimage includes folder.
When creating a new project (menu File > New Project in Xcode), you can choose the Satimage Sample Projects/SampleOsax template. The files relative to the project will be copied into your new project, and the new project will use the shared Satimage includes folder.
- SampleOsax demonstrates how to make an existing computational code into a scriptable application or into a computational scripting addition ('osax') that you can later control or use from Smile - or from any AppleScript script.
- SampleApp demonstrates how to make an existing computational code into a scriptable application so that you can control it, and so that it can interact automatically with Smile.
Four additionnal sample projects are also provided with the installer, in the /Applications/Smile/ folder. They are named SampleOsax, SampleApp, SampleAppFortran77 and ThreadedApp.
- SampleOsax is a copy of the template project. It demonstrates how to make an existing computational code into a computational scripting addition ('osax') that you can later control or use from Smile - or from any AppleScript script. The code in SampleOsax shows how to use the "array of real" and "matrix" structures (the packed array structures used in Smile.)
- SampleApp demonstrates how to make an existing computational code into a scriptable application so that you can control it, and so that it can interact automatically with Smile.
- SampleAppFortran77 demonstrates how to make an existing computational code written in FORTRAN into a scriptable application so that you can control it, and so that it can interact automatically with Smile.
- ThreadedApp demonstrates how to have your computational code run in its own thread, how to halt then resume its execution, and how to perform any required testing in-between.
Where needed each of the sample source files includes comments which explain what you have to do in order to customize the sample for your purposes.
You can find more information about scripting definitions:
- in the "man" page for sdef, type "man sdef" in a terminal window,
- in the scripting definition (DTD), /System/Library/DTDs/sdef.dtd,
- in the developer samples, /Developer/Examples/Scripting Definitions.
Contents
Satimage includes
You should not have to bring changes to the files in that folder.
- AEDescUtils.cpp and AEDescUtils.h: utilities to handle the translation between the C types and AppleScript.
- Osax.cpp and Osax.h: a library which implements an osax skeleton (for an osax project only).
- main.cp: the source file for the debugging application target of the osax project (for an osax project only).
- SmileOSL.cp and SmileOSL.h: a library which implements a simple model of object specifier resolution (for an application project only).
SampleOsax
- SampleOsax.xcode: the project for Xcode. SampleOsax.xcode defines two targets: one target builds an osax, the other builds an application. That application can be used for debugging purposes if your goal is to make an osax. This is because a given code will be debugged more easily as an application than as an osax.
- SampleOsax.cp: the core source for the sample osax.
- SampleOsax.sdef: the XML source file for the dictionary of the sample osax.
- mandelbrot.cpp and mandelbrot.h: computational code for the sample osax.
- SampleOsax script: an AppleScript script that tests the sample osax.
Once built you must copy the osax into one of the /Library/ScriptingAdditions/ folders (preferably, user or local). Then you can execute SampleOsax script. SampleOsax script displays a fractal set in a graphic window where you can zoom in.
- Mandelbrot: the resulting graphic window saved as a bundle. You can directly use it to display and explore the fractal set.
SampleApp
- SampleApp.xcode: the project for Xcode.
- Heat.cp and Heat.h: the computational code for the sample application (computes heat transport).
- SampleApp.sdef: the XML source file for the dictionary of the sample application.
- main.cp: the part of the code of the sample application which implements scriptability.
- SampleApp script: an AppleScript script that tests the sample application. SampleApp script must run in Smile. SampleApp script interacts with SampleApp in order to display the evolution of the temperature field with time.
SampleAppFortran77
- SampleApp.xcode: the project for Xcode.
- Heatf.f, Heat.cpp and Heat.h: the computational code for the sample application (computes heat transport).
- SampleApp.sdef: the XML source file for the dictionary of the sample application.
- main.cp: the part of the code of the sample application which implements scriptability.
- SampleApp script: an AppleScript script that tests the sample application. SampleApp script must run in Smile. SampleApp script interacts with SampleApp in order to display the evolution of the temperature field with time.
ThreadedApp
- ThreadedApp.xcode: the project for Xcode.
- ThreadedApp.sdef: the XML source file for the dictionary of the sample application.
- main.cp: the part of the code of the sample application which implements threading and scriptability.
- compute.cpp and compute.h: the computational part.
- ThreadedApp script: an AppleScript script that demonstrates how to use the feature.
Disclaimer
In no event will Satimage-software be liable for any consequences of the use or of the lack of use of this software.
Satimage-software - 1 avenue des Prés - F-94260 Fresnes - France