InteractiveControls package contains classes that allow modifying interactively the value of model variables. Each class includes a definition of an input real variable (var) and a boolean variable (event). The value of the event variable is true at those time instants at which the interactive control is manipulated by the virtual-lab user. Otherwise, the event variable is false The interactive model variable can be linked to the var variable by writing the corresponding equation.
Name | Description |
---|---|
![]() | Creates a slider |
![]() | Creates a set of sliders |
![]() | Allows editing a numeric value |
![]() | Creates a radio-button |
![]() | Creates a 1 action button |
![]() | Creates a 2 actions button |
Creates a slider.
Type | Name | Default | Description |
---|---|---|---|
positioninLayout | position | "CENTER" | Position inside its container |
String | stringFormat | "0.00" | Format of the text displayed by the component |
String | tickFormat | "0.00" | Format of the text displayed with the ticks |
Integer | tickNumber | 9 | Number of ticks |
Real | minimum | 0 | Minimum value of the variable linked to the component |
Real | maximum | 1 | Maximum value of the variable linked to the component |
Real | factor | 1 | Scale factor |
booleanValue | enable | "true" | True if the component is enabled |
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components |
ChildL | cLLeft | Connector of non drawable components |
model Slider "Creates a slider" extends src.ViewElements.InteractiveControls.Slider; end Slider;
Creates a set of sliders.
Type | Name | Default | Description |
---|---|---|---|
Integer | N | 2 | Number of sliders |
String | stringFormat[N] | Format of the text displayed by the component | |
String | tickFormat | "0.00" | Format of the text displayed with the ticks |
Integer | tickNumber[N] | 9*ones(N) | Number of ticks |
Real | minimum[N] | zeros(N) | Minimum value of the variable linked to the component |
Real | maximum[N] | ones(N) | Maximum value of the variable linked to the component |
Real | factor[N] | ones(N) | Scale factor |
booleanValue | enable | "true" | True if the component is enabled |
Type | Name | Description |
---|---|---|
ParentL | parentL | Connector of drawables |
ChildL | childL | Connector of drawables |
model SliderSet "Creates a set of sliders" extends src.ViewElements.InteractiveControls.SliderSet; end SliderSet;
Creates an element that allows editing a numeric value.
Type | Name | Default | Description |
---|---|---|---|
positioninLayout | position | "CENTER" | Position inside its container |
String | stringFormat | "0.00" | Format of the displayed number |
booleanValue | enable | "true" | 1: enabled, 0: disabled |
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components |
ChildL | cLLeft | Connector of non drawable components |
model NumberField "Allows editing a numeric value" extends src.ViewElements.InteractiveControls.NumberField; end NumberField;
Creates a radio-button. The var variable of this element can have the value 0 or 1.
Type | Name | Default | Description |
---|---|---|---|
positioninLayout | position | "CENTER" | Position inside its container |
booleanValue | buttonValue | "true" | Initial value |
String | text | "radioButton" | Text displayed by the element |
String | buttonGroup | "buttonGroup" | The radio-button belongs to this group |
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components |
ChildL | cLLeft | Connector of non drawable components |
model RadioButton "Creates a radio-button" extends src.ViewElements.InteractiveControls.RadioButton; end RadioButton;
Creates a button. The var variable is equal to one when the button is pressed and it is equal to zero otherwise. This variable can be used as a condition in a when clause. This way, the when clause is executed whenever the virtual-lab user presses the button.
Type | Name | Default | Description |
---|---|---|---|
positioninLayout | position | "CENTER" | Position inside its container |
booleanValue | selected | "false" | Whether the button is selected or not |
String | label | "info" | Text displayed by the button |
alignmentType | alignment | "0.00" | Text alignment |
String | image | "" | Path of the image of the button |
Color | bgcolor[4] | {192,192,192,255} | Background color |
String | tooltip | "" | Tooltip |
Color | lettercolor[4] | {0,0,0,255} | String color |
fontType | typeFont | "Times New Roman" | Type of font |
fontStyle | styleFont | "Plain" | Style of font |
Integer | sizeFont | 20 | Size of font |
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components |
ChildL | cLLeft | Connector of non drawable components |
model Button1Action "Creates a 1 action button" extends src.ViewElements.InteractiveControls.Button1Action; end Button1Action;
This class creates a button. The var variable changes alternatively from zero to one and from one to zero whenever the button is pressed. By programming the corresponding when clauses, it is possible to associate two different actions to this button: an action is triggered when var changes from zero to one, and the other action is triggered when var changes from one to zero.
Type | Name | Default | Description |
---|---|---|---|
positioninLayout | position | "CENTER" | Position inside its container |
booleanValue | selected | "false" | Whether the button is selected or not |
String | label | "info" | Text displayed by the button |
alignmentType | alignment | "0.00" | Text alignment |
String | image | "" | Path of the image of the button |
Color | bgcolor[4] | {192,192,192,255} | Background color |
String | tooltip | "" | Tooltip |
Color | lettercolor[4] | {0,0,0,255} | String color |
fontType | typeFont | "Times New Roman" | Type of font |
fontStyle | styleFont | "Plain" | Style of font |
Integer | sizeFont | 20 | Size of font |
Type | Name | Description |
---|---|---|
ParentL | pLLeft | Connector of non drawable components |
ChildL | cLLeft | Connector of non drawable components |
model Button2Actions "Creates a 2 actions button" extends src.ViewElements.InteractiveControls.Button2Actions; end Button2Actions;