Page 1 of 1

How to send messages to the console?

Posted: Fri May 31, 2013 4:30 pm
by ammaia
I would like to know if it is possible to send messages to the INF console at the bottom of the OpenVibe screen designer.

Lets use a simple scenario connecting the 2 modules: "Clock stimulator" and "Run Command"

"Clock stimulator" defined as:

Code: Select all

Intervalstimulation interval (in sec): 10.00000
Stimluation: OVTK_StimulationId_Label_01
"Run Command" defined as:

Code: Select all

Stimulation 1: OVTK_StimulationId_Label_01
Command 1: START notepad
So, each 10 seconds it opens the application notepad.

What I want to do is also to send a message each 10 seconds to the console at the botton of the screen. For example: "Opening notepad..."


Regards
Pedro

Re: How to send messages to the console?

Posted: Mon Jun 10, 2013 11:10 am
by jlegeny
Hello Pedro,

an easy way to display arbitrary messages would be to use the Lua stimulator box.

Add an input to it via right click menu and use it with a simple script such as this:

Code: Select all

function initialize(box)
end

function uninitialize(box)
end

function process(box)
	while true do
		if (box:get_stimulation_count(1)) then
			box:log("Info", "test")
			box:remove_stimulation(1, 1)
		end
		box:sleep()
	end
end
This program will display a message "test" every time it receives a stimulation. For more info look at the lua box documentation here:
http://openvibe.inria.fr/documentation/ ... lator.html

Cheers
Jozef