The simulator generator allows to generate a simulator for a CommaSuite model. It can be generated for a single interface and for a component where it generates a simulator for the provided interfaces. For interfaces with input parameters, a parameters file is required.

The user interface of the generated simulator makes it possible to walk through the various states of the CommaSuite model.

To enable simulator generation add the following to the .prj file, e.g. using content assist (ctrl + space):

import "Camera.interface"

Project Camera {

	Generate Simulator {
	    Simulator_ICamera for interface ICamera
	    {
            // Input parameters for the interface (only required when interface commands/signals have in parameters)
	        params: "ICamera.params"
	    }
	}
}

To generate the simulator, run the .prj (right click on the .prj file → Run AsRun generators). To also execute it select Generate and execute simulator instead. Alternatively the simulator can be started by executing the generated .jar in the src-gen/simulator folder.

Once the simulator started you will see a window like below:

image

The client and server section allow to execute actions:

Notice that the executed actions are added to the log and sequence (visualisation) section. The controls section allows to i.a. log the current variable values and step back to previous states. The save button in the top left allows to save the log and sequence (plantuml text) to a file.