The simulator generator allows to generate a simulator for a CommaSuite model. It can be generated for a single interface and for a component. If the used interfaces contain triggers with parameters, replies and notifications with variables or any (*) value then one or more 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 {
		// For components user "for component" instead
	    Simulator_ICamera for interface ICamera
	    {
            // Input parameters for the interface (only required when the interface has commands/signals with input parameters and replies/notifications with variables or any (*) expression)
	        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 .bat/.sh 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.

Limitations: