Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions bin/rock-directory-pages
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PAGES_DIR = File.join(base_dir, 'rock', 'pages', 'package_directory')
ENV['VIZKIT_NO_GUI'] = '1'

require 'autoproj'
require 'autoproj/cmdline'
require 'autoproj/cli/inspection_tool'
require 'rock/package_directory'
require 'optparse'

Expand Down Expand Up @@ -36,9 +36,9 @@ if !output_dir
exit 1
end

Autoproj.silent do
Autoproj::CmdLine.initialize_and_load([])
end
#Autoproj.silent do
# Autoproj::CLI::InspectionTool.initialize_and_load([])
#end
require 'orocos'
Orocos.load

Expand All @@ -52,7 +52,7 @@ package_directory.render_autoproj_osdeps
package_directory.render_orogen_types
package_directory.render_orogen_tasks

initial_flavor = YAML.load(File.read(File.join("autoproj", "config.yml")))['ROCK_FLAVOR']
initial_flavor = YAML.load(File.read(File.join(".autoproj", "config.yml")))['ROCK_FLAVOR']

ret_code = 0
begin
Expand Down
95 changes: 50 additions & 45 deletions lib/rock/package_directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -325,35 +325,38 @@ def prepare
end
end.compact

@orogen_types = loader.available_types.keys.sort.map do |type_name|
begin
PackageDirectory.debug "loading typekit for #{type_name}"
typekit = loader.typekit_for(type_name, false)
rescue Interrupt; raise
rescue Exception => e
PackageDirectory.warn "cannot load typekit for #{type_name}: #{e.message}"
next
end

begin
type = loader.resolve_type(type_name)
rescue Typelib::NotFound => e
PackageDirectory.warn "Could not load typekit for #{type_name}, but it was supposed to be defined in #{typekit.name}"
PackageDirectory.warn " #{e.message}"
next
#raise e #TODO add this see bug https://rock.opendfki.de/ticket/443#ticket
end
if loader.available_types != nil
@orogen_types = loader.available_types.keys.sort.map do |type_name|
begin
PackageDirectory.debug "loading typekit for #{type_name}"
typekit = loader.typekit_for(type_name, false)
rescue Interrupt; raise
rescue Exception => e
PackageDirectory.warn "cannot load typekit for #{type_name}: #{e.message}"
next
end

begin
type = loader.resolve_type(type_name)
rescue Typelib::NotFound => e
PackageDirectory.warn "Could not load typekit for #{type_name}, but it was supposed to be defined in #{typekit.name}"
PackageDirectory.warn " #{e.message}"
next
#raise e #TODO add this see bug https://rock.opendfki.de/ticket/443#ticket
end

if loader.m_type?(type) && (loader.opaque_type_for(type) != type)
PackageDirectory.debug "ignoring #{type_name}: is an m-type"
next
elsif !(type <= Typelib::ArrayType)
type
else
PackageDirectory.debug "ignoring #{type.name}: is an array"
nil
end
end.compact.to_set
end

if loader.m_type?(type) && (loader.opaque_type_for(type) != type)
PackageDirectory.debug "ignoring #{type_name}: is an m-type"
next
elsif !(type <= Typelib::ArrayType)
type
else
PackageDirectory.debug "ignoring #{type.name}: is an array"
nil
end
end.compact.to_set

@orogen_type_vizkit = Hash.new { |h, k| h[k] = Array.new }
@orogen_type_vizkit3d = Hash.new { |h, k| h[k] = Array.new }
Expand Down Expand Up @@ -489,23 +492,25 @@ def typename_to_path(type, ext = "page")
end

def render_orogen_types
orogen_types = self.orogen_types.sort_by(&:name)
write_index(orogen_types,
File.join('types', 'index.page'), 'orogen_type_list.page',
:title => 'oroGen Types Index',
:routed_title => 'oroGen Types',
:sort_info => SORT_INFO_OROGEN_TYPES_INDEX)

orogen_types.each_with_index do |object, index|
names = typename_split(object)
path = names.map { |p| p.gsub(/[\/<>]/, '_') }
path[-1] += ".page"
prepare_sections(orogen_types, index + SORT_INFO_OROGEN_TYPES,
'types', '/', names, path[0..-2], 'orogen_type_list.page')

index = SORT_INFO_OROGEN_TYPES + index
fragment = MetaRuby::GUI::HTML::Page.to_html_body(object, OroGen::HTML::Type)
write(File.join('types', *path), 'object_page.page', binding)
if self.orogen_types != nil
orogen_types = self.orogen_types.sort_by(&:name)
write_index(orogen_types,
File.join('types', 'index.page'), 'orogen_type_list.page',
:title => 'oroGen Types Index',
:routed_title => 'oroGen Types',
:sort_info => SORT_INFO_OROGEN_TYPES_INDEX)

orogen_types.each_with_index do |object, index|
names = typename_split(object)
path = names.map { |p| p.gsub(/[\/<>]/, '_') }
path[-1] += ".page"
prepare_sections(orogen_types, index + SORT_INFO_OROGEN_TYPES,
'types', '/', names, path[0..-2], 'orogen_type_list.page')

index = SORT_INFO_OROGEN_TYPES + index
fragment = MetaRuby::GUI::HTML::Page.to_html_body(object, OroGen::HTML::Type)
write(File.join('types', *path), 'object_page.page', binding)
end
end
end
end
Expand Down