Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/vizkit/cplusplus_extensions/vizkit_widget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def push_transformer_configuration(data)
def listen_to_transformation_producer(trsf)
return if @connected_transformation_producers.has_key?(trsf.producer)

task, *port = trsf.producer.split('.')
task, bla, *port = trsf.producer.rpartition('.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What in your case is bla ?, is it not related to the hostname during replay?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not check replays ... but in the other tests bla is just "."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should:

  • rename bla to sep for separator
  • change *port to port
  • remove line 328.

Other than that the fix solves the problem 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Ruby idiom for "just ignore this value" is the underscore character

task, _, *port = trsf.producer.rpartition('.')

port = port.join(".")
Vizkit.debug "connecting producer task #{task}, port #{port} for #{trsf.from} => #{trsf.to}"
producer_name = task.gsub(/.*\//, '')
Expand Down
17 changes: 10 additions & 7 deletions lib/vizkit/widgets/task_inspector/task_inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ def self.create_widget(parent = nil)

#populate widget menu
Vizkit.default_loader.plugin_specs.keys.sort.each do |name|
# do not add qt base widgets
next if name[0] == "Q" && Qt.const_defined?(name[1..-1])
action = form.menuWidgets.addAction(name)
action.connect SIGNAL("triggered()") do
w = Vizkit.default_loader.create_plugin name
w.show if w.respond_to?(:show) || w.kind_of?(Qt::Widget)
begin
# do not add qt base widgets
next if name[0] == "Q" && Qt.const_defined?(name[1..-1])
action = form.menuWidgets.addAction(name)
action.connect SIGNAL("triggered()") do
w = Vizkit.default_loader.create_plugin name
w.show if w.respond_to?(:show) || w.kind_of?(Qt::Widget)
end
rescue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where exactly does the error occur in this block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using QwtThermo widget. But it's always searching for wtThermo widget and crashed when trying to add it

Vizkit.warn "#{name} widget could not been added"
end
end

form
end

Expand Down