Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Run As command will search for a KiCo launch config for the project. If there is such a config, the selected file is only added to the list of model files that should be compiled. If there is none, a launch config is created by using the main file and environment the project has been created with. If the main file and environment information could not be found, dialogs will query it from the user.

A main file typically contains the entry point of the program on the target environment. Its wrapper code initializes and runs the model and sets inputs and outputs to the physical components of the target device. The main file of the launch config is used to set several file path variables, which can be used in several fields of the configuration, notably the shell commands to be executed, and wrapper code input. To use a variable, the syntax is ${variable_name}. The variables that are set are

...

  • compiled_main_name : The file name, including its file extension (e.g. MyModel.sctjava)
  • compiled_main_path : The project relative path (e.g. kieler-gen/MyModel.sctjava)
  • compiled_main_loc : The absolute file system path (e.g. /home/me/workspace/MyProject/kieler-gen/MyModel.sctjava)
  • compiled_main_name_no_ext : The file name without its file extension (e.g. MyModel)

...

On the Execute tab, a list of shell commands can be added. They are typically used to further compile the KiCo and wrapper code output and afterwards deploy the result to the target platform. The commands are executed sequentially in order as they appear in the list, after the KiCo compilation and wrapper code generation finished successfully. If a command fails (returns a non-zero exit code), following commands will not be excuted. The name of commands have to be unique and must not contain a comma. 

The standard streams of executed shell commands (stdin, stderr, stdout), as well as errors from the KiCo compilation and wrapper code generation, are printed to the Console View.

...

  1. a unique name, which may not contain a comma
  2. an associated project wizard
  3. information for a default main file for the project
  4. information for a the path of the default model file for the project
  5. information for a default wrapper code snippet directoryabout folders and files that should be imported at project setup
  6. default values for the KiCo compilation

Besides the name, all of these are optional, but can improve the workflow.

The associated project wizard is run as part of the Prom project wizard and takes care of the actual project creation.

A main file typically contains the entry point of the program on the target environment. Its wrapper code initializes and runs the model and sets inputs and outputs to the physical components of the target device. To ease the project setup and because wrapper code for a specific target platform is often similar, it is possible to define default content for the main file. Therefore the field main file origin can contain an absolute file path to a file with the default contents of a newly created main file for this environment. Furthermore, predefined wrapper code snippets can be injected as part of a project launch, which is described below.

The snippets origin is used to initialize the wrapper code snippet directory of a newly created project.

The other fields are default settings for KiCo launch configurations.

Image Removed

Paths for initial content

The path of the main file origin accept an absolute file path as well as an URL with the platform protocol of Eclipse. An URL for the field Afterwards the model file is created and finally other folders and files are imported.

The default values for the KiCo compilation are used to compile model files in the project.

Image Added

Paths for imported resources

To import a resource (folder or file), its project relative path has to be specified. The resource will be created at this location in the project.

Furthermore, it is possible to specify initial content for these resources. This is done in the field origin. Without an origin specifed, an empty resource will be created.

To specify intial content for a file, the origin has to be an absolute file path or an URL with the platform scheme of Eclipse. Such an URL has the form plaftorm:/plugin/a.plugin.name/folder/in/the/plugin/file.txt

The snippets origin works analog. It accepts Specifying intial content for a folder is analog. Its origin has to be an absolute directory path as well as or an URL with the platform protocol which points to a directory. An URL for the field has the in the form plaftorm:/plugin/a.plugin.name/folder/in/the/plugin

...

Prom provides project wizards, which can create and initialize a project with a model file, a main file and wrapper code snippetsand imported resources. The wizards for different model file types (e.g. SCChart project vs Esterel project) differ only in the initial content for the model file. Other initial content is choosen from the environment, which is selected on the first page of a Prom wizard. The project creation itself is done by another wizard, that is started from within the Prom wizard.

If the snippets directory of an environment is a project relative path, the contents from the snippets origin will be copied to this location in the newly created project. If it is an absolute path, it is not copied to the project. Keeping snippets in a single, project indepentent folder, makes it easier to maintain them. For example it is possible to set an absolute path to a directory outside any project as directory for wrapper code snippets. This directory can then be easily maintained using a version control system. Furthermore, if an issue occurs, it has to be addressed only once, because the snippets are not copied to every new project.

For example to create a project to develop Minstorms running leJOS, one can choose the SCCharts project wizard. In this wizard, one can choose the Mindstorms NXJ environment and define what will be initialized in the project (model file, main file, snippetsinitial resources). Now, when pressing the finish button, the related project wizard from the leJOS plugin will be started. When it finishes, the newly created project is initialized with an initial a model file , main file and wrapper code snippetsand the defined resources.

Prom Project WizardImage RemovedImage Added

...

Wrapper Code Generation

...

${outputs} will be replaced with code to read outputs of the model. (<@output>...</@output> of a snippet definition). Reading outputs of the model should occur in the tick loop, after the tick function call.

${releases} will be replaced with code to free allocated resources. (<@release>...</@release> of a snippet definition). Releasing resources should occur after the tick loop at the end of the program.

Wrapper Code Template File Structure

To ease the modification of the template file, one can open it with the text editor the final code will be for. This will enable syntax highlighting and code completion for the langauge, but it will not show any errors. You can open the file for example with the Java Editor of Eclipse using Right Click > Open With > Other > Java Editor

...