Interactive knob style dial Class-Object type
This class was developed by Seonghee Cho., shcho89@postech.ac.kr (2018-04-06)
This class was designed for make knob style dial on MATLAB GUI application. User can use their own image for dial. To use this class, axes object is required.
Copyright (c) 2018, Bio optics and acoustics lab, POSTECH
All rights reserved.
Last revision data 2018-04-06
How to use.
Syntax
knobdial()
knobdial(axeshandle)
knobdial('Property',Value)
knobdial(axeshandle, 'Property',Value)
h= knobdial(__)
Description
knobdial() creates a knob style dial in current axes.
knobdial(axeshandle) creates a knob style dial in axes defined by axeshandle.
knobdial('Property',Value) creates a knob style dial in current axes. By using this syntax, property of a knobdial object can be initialized.
knobdial(axeshandle, 'Property',Value) creates a knob style dial in axes defined by axeshandle. By using this syntax, property of a knobdial object can be initialized.
h= knobdial(__) creates a knob style dial with handle h.
Examples
Examples of using all variables are provided in example_cod.m and guiknob.m.
Property
knobdial have 15 properties.
1. value, 2. knobimg, 3. callback, 4. minangle, 5.maxangle, 6. tick, 7.tickcolor, 8.tickratio, 9.majorminortickratio, 10. majortickwidth, 11. minortickwidth, 12. majortick, 13.minortick, 14. discreate, 15. interactivity
1. value
'value' is a property that defines the angle of the knob in the dial. The default value is 0. The 'value' is determined between 0 and 1.
2. knobimg
You can use knobimg property to customize the dial using a custom image. This property needs the file name string. Only PNG image is allowed. The default value is 'Dialknob.png'.
3. callback
A custom function is required for the input. You can define the dial's response when you click the knob or rotate the knob. The required variables of the callback function are source and callbackdata. For example, you can write as follows.
function callback_example(src, callbackdata)
Contents what you want
End
‘src’ will be handle of knobdial object which is selected.
4-5. minangle and maxangle
minangle and maxangle determine the angular position of the knobdial. The angle is determined in units of 'Degree' between -180 and 180. The left angle of the dial is the minus angle area and the right side of the dial is the plus area. Origin is top of the circle. Default value for minangle is -120 and maxangle is 180.
6-13. 6. tick, 7.tickcolor, 8.tickratio, 9.majorminortickratio, 10. majortickwidth, 11. minortickwidth, 12. majortick, 13.minortick
These properties determine spec of tick of dial.
‘tick’ determines visibility of tick. Required input argument for ‘tick’ is ‘on’ or ‘off’. Default value is ‘on’.
‘tickcolor’ determines line color spec of tick. Default value is ‘black’.
‘tickratio’ determines radial ratio between knob icon and tick. Default value is 0.2
‘majorminortickratio’ determines radial ratio between major tick and minor tick. Default value is 0.5
‘majortickwidth’ and ‘minortickwidth’ determines line width spec of tick lines. Default value are 2 and 1 respectively.
‘majortick’ and ‘minortick’ determine number of tick of each object. Default value are 6 and 4 respectively.
14. discrete
If ‘discrete’ is ‘on’ dial only can rotate discretely along the tick. Required input for the property is ‘on’ or ‘off’. Default value is ‘off’.
15. interactivity
This property determine interactivity of a knobdial object. If you set ‘on’ for this property, dial will change its value every time when you or ratating the knob. If you set ‘off’, value will be update when your mouse button is up. You can check example of interactivity from figuredial.m. Default value for this property is ‘on’
Cita come
Seonghee Cho (2025). Interactive knob style dial Class-Object type (https://it.mathworks.com/matlabcentral/fileexchange/66769-interactive-knob-style-dial-class-object-type), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- MATLAB > Graphics > Graphics Objects > Interactive Control and Callbacks >
- Engineering > Mechanical Engineering > Acoustics, Noise and Vibration >
Tag
Riconoscimenti
Ispirato da: Interactive knob style slider Class-Object type
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
| Versione | Pubblicato | Note della release | |
|---|---|---|---|
| 1.0.0.0 | Bug fix in initializing mouse call back |
