Module: Roby::GUI::TaskDisplayConfiguration

Included in:
RelationsCanvas
Defined in:
lib/roby/gui/task_display_configuration.rb

Instance Method Summary collapse

Instance Method Details

#filter_prefixes(string) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/roby/gui/task_display_configuration.rb', line 26

def filter_prefixes(string)
    # @prefixes_removal is computed in RelationsCanvas#update
    for prefix in @prefixes_removal
        string = string.gsub(prefix, "")
    end
    if string =~ /^::/
        string = string[2..-1]
    end
    string
end

#filtered_out_label?(label) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/roby/gui/task_display_configuration.rb', line 22

def filtered_out_label?(label)
    !hidden_labels.empty? && hidden_labels.any? { |match| label.include?(match) }
end

#update_prefixes_removalObject

Compute the prefixes to remove from in filter_prefixes: enable only the ones that are flagged, and sort them by prefix length



16
17
18
19
20
# File 'lib/roby/gui/task_display_configuration.rb', line 16

def update_prefixes_removal
    @prefixes_removal = removed_prefixes.to_a
        .sort_by(&:length)
        .reverse
end