[Rock-dev] gui/vizkit (master) will be updated on Monday

Alexander Duda Alexander.Duda at dfki.de
Mon Mar 11 20:33:53 CET 2013


Vizkit master was updated. If you have any trouble please report it to 
the mailing list.

The documentation should be updated by tomorrow:
http://rock-robotics.org/master/documentation/graphical_user_interface/200_simple_gui.html

Greets Alex

Example from the Doc:

# loading library
require 'vizkit'

# initialize Orocos layer
Orocos.initialize

# load GUI created with the Qt Designer
widget = Vizkit.load "simple_gui.ui"
widget.show

# connect the widget with the task "simple_task"
widget.connect_to_task "simple_task" do |task|

     # connect the output port text_message with the text box slot setText
     text_box.connect PORT(:text_message), SLOT("setText(QString)")

     # generate a new sample each time the button is clicked
     # and show a message box if there is a connection error
     g = lambda{"it is #{Time.new.to_s}"}
     c = lambda{|msg| Qt::MessageBox.warning(widget,"ComErr",msg) if msg 
!= "OK"}
     button.connect SIGNAL(:clicked), PORT(:input),:getter => 
g,:callback => c

     # disable the GUI until the task is reachable
     task.on_reachable {widget.setEnabled(true)}
     task.on_unreachable {widget.setEnabled(false)}
end

#run qt main loop
Vizkit.exec



On 03/06/2013 04:30 PM, Alexander Duda wrote:
> Hi,
>
> all GUIs being part of gui/vizkit will be updated to use Orocos::Async 
> API next Monday morning. By then there will be also some documentation 
> available on rock-robotics.org.
>
> Main features of Orocos::Async:
>     * event driven design 
> (on_data,on_reachable,on_unreachable,on_error ...)
>     * asynchronous inspection of remote tasks
>     * asynchronous polling ports
>     * auto reconnect
>     * sharing port connections across all data consumer of the same 
> ruby process
>
> This update is upward compatible to all higher level calls like:
>      Vizkit.display
>      Vizkit.connect_port_to
>      task.port.connect_to widget
>
> Nevertheless, all GUIs using the following underlying classes have to 
> be updated to Orocos::Async API:
>     Vizkit::TreeModeler
>     Vizkit::ReaderWriterProxy
>     Vizkit::ReaderProxy
>     Vizkit::WriterProxy
>     Vizkit::PortProxy
>     Vizkit::TaskProxy
>
> Old:
>     task = TaskProxy.new("my_task")
>     task.port("frame").connect_to widget
> New:
>     task = Orocos::Async.proxy("my_task")
>     task.port("frame", :type => 
> Type::Base::Sample::Frame::Frame).connect_to widget
> Or:
>     task = Orocos::Async.proxy("my_task")
>     port =  task.port("frame")
>     port.wait # block until the port is connected and the type was 
> discovered
>     port.connect_to widget
> Or:
>    widget.connect_to_task "my_task" do |task|
>        connect PORT("frame"),SLOT(:data)
>    end
>
> Greets
> Alex
>


-- 
Dipl.-Ing. Alexander Duda
Unterwasserrobotik

DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-456620
Fax:   +49 (0)421 178-454150
E-Mail: alexander.duda at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.:    DE 148646973
Steuernummer:  19/673/0060/3



More information about the Rock-dev mailing list