Introduction | Your first interface | Building a model | Advanced features | Resources

3.3 Adding actions

As well as variables that have update actions associated with them, you can also include actions that will perform some operation on one or more of the variables directly from the interface.

The Ohm's Law model has two actions - one to set resistance to its maximum and one to set it to its minimum. In this step you will learn how to specify model actions using the Model Wizard.

For each action that you want to add, you need to add an action name that will be seen by the Interface Builder, and a method name that is how the same action is referred to in code. (If the action is going to preform file handling you can select the file action box - this is not the case with Ohm's Law, so you can just leave it unselected.)

To add the first of our two actions, the action name is 'High Resistance' and the method 'setRHi'. When these are added, the Model Wizard will look like this:

Clicking on Add will add the action.

Add the actions for High Resistance and Low Resistance (method name 'setRLo') to the model.

That's your actions added. The next two screens of the Wizard Builder are not of interest to us at the moment (they cover thread support for time-varying variables and inclusion of custom objects - you can get information on these in the JeLSIM online help).

In the final step you shall see how to complete and compile your code and load your model into the Interface Builder.