Download Mc cBILE Version 1.3 User's Guide

Transcript
Section 7.3: Prescribing Motion by Sliders
slider-widget.addSlider
slider-widget.addSlider
(
(
real , title , min , max ) ;
angle , title , min , max ) ;
Here, \real" and \angle" are names of objects of type \MoReal" and \MoAngle" used as
input variables or parameters for previously dened kinetostatic transmission elements.
The numbers \min" and \max" are the minimum and maximum values allowed when
operating the sliders. For angles, these values are interpreted in degrees . The parameter
\title" is a character string to be displayed as the title of the slider.
When the user actuates the slider, the value of the scalar quantity attached to the slider is
updated and the \doMotion" function of the transmission element attached to the slider
widget \slider-widget" is invoked. Note that one can use any scalar quantity used within
kinetostatic transmission elements as the destination of sliders. Thus, slider widgets make
it possible to change parameters online during simulation.
In order for the slider widgets to be rendered on the screen, it is necessary to invoke the
\show()" member function explicitly for them. This should be done after the show()
function of the viewer object has been invoked.
An example of the use of slider widgets is shown in the program reproduced below. The
corresponding result on the screen is displayed in Fig. 7.3.
these sliders change system
parameters during simulation
"viewer" window
these sliders actuate
the system online
Figure 7.3: An example of the use of slider widgets
108
aa aa
M BILE 1.3 User's Guide