Class: Syskit::GUI::ModelBrowser

Inherits:
MetaRuby::GUI::ModelBrowser
  • Object
show all
Defined in:
lib/syskit/gui/model_browser.rb

Defined Under Namespace

Classes: OroGenResolver, RobyTaskModelResolver, TypelibResolver, View

Constant Summary collapse

AVAILABLE_VIEWS =
[
    View.new(Syskit::RubyTaskContext, ModelViews::RubyTaskContext, 'Ruby Task Contexts', 2),
    View.new(Syskit::TaskContext, ModelViews::TaskContext, 'Task Contexts', 1, OroGenResolver.new),
    View.new(Syskit::Composition, ModelViews::Composition, 'Compositions', 1),
    View.new(Syskit::DataService, ModelViews::DataService, 'Data Services', 0),
    View.new(Syskit::Actions::Profile, ModelViews::Profile, 'Profiles', 0),
    View.new(Roby::Actions::Interface, Roby::GUI::ModelViews::ActionInterface, 'Action Interfaces', 0),
    View.new(Roby::Task, Roby::GUI::ModelViews::Task, 'Roby Tasks', 0, RobyTaskModelResolver.new),
    View.new(Typelib::Type, ModelViews::Type, 'Types', 0, TypelibResolver.new)
]

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ ModelBrowser

Returns a new instance of ModelBrowser



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/syskit/gui/model_browser.rb', line 78

def initialize(parent = nil)
    super(parent, exception_view: Roby::GUI::ExceptionView.new)
    self.page = Page.new(@model_selector, display.page)

    if ENV['SYSKIT_GUI_DEBUG_HTML']
        display.page.settings.setAttribute(Qt::WebSettings::DeveloperExtrasEnabled, true)
        @inspector = Qt::WebInspector.new
        @inspector.page = display.page
        @inspector.show
    end

    page.load_javascript File.expand_path("composer_buttons.js", File.dirname(__FILE__))
    AVAILABLE_VIEWS.each do |view|
        resolver = view.resolver ||
            MetaRuby::GUI::ModelHierarchy::Resolver.new(view.root_model)
        register_type(view.root_model, view.renderer, view.name,
            view.priority, categories: [view.name],
            resolver: resolver)
    end
    update_model_selector
end

Instance Method Details

#registered_exceptionsObject



100
101
102
# File 'lib/syskit/gui/model_browser.rb', line 100

def registered_exceptions
    super + Roby.app.registered_exceptions
end