Versions Compared

Key

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

...

KiCo launch configurations work per project basis, thus every project has to create its own launch config. This is done automatically when performing Right Click > Run As > KiCo Compilationon a model file. (Screenshot)

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 which 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.

...

Note: The variables are created in the first KiCo launch. So if you want to select them in a variable selection dialog of Eclipse, you must have started at least one KiCo launch configuration. (Screenshot of selection dialog)

Variable Selection Dialog of EclipseImage Added

The values of the launch config can also be (re)set to an environment. This will revert the fields for the compilation target, wrapper code generation and command execution.

...

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.

Launch Configuration TabsImage Added

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. (Screenshot)

Console ViewImage Added

Launch Groups

The list of shell commands are a simple mechanism to further compile and deploy code via command line tools. However, there are cases in which command line tools are not available or reasonable to use, for example because a different Eclipse launch configuration does a better job.

In this case it is desirable that the KiCo launch config only compiles the model and another Eclipse launch config does the rest. This can be achieved via launch groups. They let you define a launch configuration, which starts other launch configurations sequentially. To illustrate this, another use-case for launch groups is that you have a Client-Server application and wants to start the client right after the server for debugging. Then you can create a launch config for the server and a launch config for the client. Afterwards you create a launch group with aforesaid configurations. (Screenshot)

Launch GroupsImage Added

Launch groups are a part of the C/C++ Development Tools (CDT), although they provide a general mechanism that could be a part of any Eclipse IDE. The CDT is available in the Eclipse Marketplace (Help > Eclipse Marketplace)

...

The other fields are default settings for KiCo launch configurations.

Environments Preference PageImage Added

Paths for initial content

...

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, snippets). 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 model file, main file and wrapper code snippets. (Screenshot)

Prom Project WizardImage Added

...

Wrapper Code Generation

...

Therefore one can write wrapper code snippets for a target device. These can then be injected to a template file as part of a KiCo launch. What snippets are injected is defined using annotations on inputs and outputs directly in the model file.

(Image showing the three components (annotated model file, wrapper code snippets, wrapper code template) and the result of wrapper code injection)Image Added

In the template file one can use special placeholders.

...

${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.(Image showing the structure of a template file with the placeholders and the tick loop)

Image Added

FreeMarker

The wrapper code injection is done using the open source template engine FreeMarker. A wrapper code snippet is basically a Macro definition of FreeMarker. The Macro is called when the corresponding annotation is found in the model file. The file extension of FreeMarker templates is .ftl.

...