Welcome! Log In Create A New Profile

Advanced

draw taskobjects on control screen only

Posted by bts 
bts
draw taskobjects on control screen only
August 21, 2020 04:11PM
Hi Jaewon,

Is there a way to display taskobjects or shapes on the control screen only? I only know of the ability to display text, not taskobjects/shapes.
bts
Re: draw taskobjects on control screen only
August 22, 2020 04:52PM
After looking through the ML calibration files, I think I found the answer: mgladdcircle, mgladdbox, mgladdbitmap, etc. Specifying the device as '2' seems to only display them on the control screen, as desired. Please let me know if this is the most efficient way to do this, or if there is a better way to do it, when you have the time. Thanks a lot!
Re: draw taskobjects on control screen only
August 23, 2020 10:11AM
MonkeyLogic Graphics Library (MGL), as well as NIMH DAQ Toolbox, is the backbone of NIMH ML and certainly able to present graphic objects on only one screen or both, by changing the device (or screen) number. However, NIMH ML is hard-coded to use both screens, so there is no way to present "TaskObjects" on the control screen only. It is up to you to call MGL functions directly to add your own "shapes", but NIMH ML will not track/record those shapes.

See the following manual page for more information about MGL.
https://monkeylogic.nimh.nih.gov/docs_MonkeyLogicGraphicsLibrary.html
bts
Re: draw taskobjects on control screen only
August 23, 2020 12:21PM
Great, that's all I needed, thanks Jaewon.
bts
Re: draw taskobjects on control screen only
August 23, 2020 03:13PM
Followup question: is there a way to use MGL to create multiple shapes at once? For example, if I want to create a 9x5 grid of circles, do I need to call mgladdcircle 45 times and specify all 45 positions using mglsetorigin? Or can I shorten the code for that somehow?
bts
Re: draw taskobjects on control screen only
August 23, 2020 05:03PM
Using a for loop did the trick. Thanks again!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.