Class: Syskit::RobyApp::Configuration
- Defined in:
- lib/syskit/roby_app/configuration.rb
Overview
Syskit engine configuration interface
The main configuration instance is accessible as Syskit.conf or (if running in a Roby application) as Conf.syskit
Defined Under Namespace
Classes: AlreadyConnected, LocalOnlyConfiguration, ModelOnlyServer, ProcessServerConfig, UnknownProcessServer
Instance Attribute Summary collapse
-
#app ⇒ Roby::Application
readonly
The application that we are configuring.
-
#buffer_size_margin ⇒ Float
readonly
Margin added to computed buffer sizes.
-
#deployment_group ⇒ Models::DeploymentGroup
readonly
A global deployment group.
-
#logs ⇒ LoggingConfiguration
readonly
Data logging configuration.
-
#orocos ⇒ Object
readonly
Component configuration.
-
#prefix ⇒ String?
If set to a non-nil value, the deployment processes will be started with the given prefix.
-
#prefix_blacklist ⇒ Array<String,Regexp>
readonly
A set of regular expressions that should match the names of the deployments that should not be prefixed even if #prefix is set.
-
#process_servers ⇒ Hash<String,ProcessServerConfig>
readonly
The set of process servers registered so far.
-
#publish_white_list ⇒ Array<#===>
If set, it is the list of deployments that should be published on DNS-SD.
-
#sd_domain ⇒ String
If set, it is the service discovery domain in which the orocos processes should be published.
-
#sd_publish_list ⇒ Array<String,Regexp>
readonly
A set of regular expressions that should match the names of the deployments that should be published on DNS-SD if #sd_domain is set.
Instance Method Summary collapse
-
#clear ⇒ Object
Resets this Syskit configuration object.
- #clear_deployments ⇒ Object
-
#connect_to_orocos_process_server(name, host, port: Orocos::RemoteProcesses::DEFAULT_PORT, log_dir: nil, result_dir: nil, host_id: nil) ⇒ Orocos::ProcessClient, Orocos::Generation::Project
Call to declare a new process server and add to the set of servers that can be used by this plan manager.
- #create_subfield(name) ⇒ Object
-
#default_logging_buffer_size ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#default_logging_buffer_size=(size) ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#default_prefix(deployment_model) ⇒ String?
Returns the deployment prefix that should be used to start the given syskit deployment process.
-
#default_run_options(deployment_model) ⇒ String=>String
Returns the set of options that should be given to Process.spawn to start the given deployment model.
-
#default_sd_domain(deployment_model) ⇒ String?
Sets up mDNS support for the syskit deployment processes.
-
#define_default_process_managers=(value) ⇒ Object
Controls whether Syskit sets up its default process managers (localhost, ruby_tasks, unmanaged_tasks and ros), or leaves it to the app to set them up.
-
#define_default_process_managers? ⇒ Boolean
Controls whether Syskit sets up its default process managers (localhost, ruby_tasks, unmanaged_tasks and ros), or leaves it to the app to set them up.
-
#disable_conf_logging ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#disable_log_group(name) ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#disable_logging ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#disables_local_process_server=(flag) ⇒ Object
Controls whether Syskit auto-starts a process server locally.
-
#disables_local_process_server? ⇒ Boolean
Controls whether Syskit auto-starts a process server locally.
-
#each_process_server {|process_server| ... } ⇒ void
Enumerates all available process servers.
-
#each_process_server_config {|process_server| ... } ⇒ void
Enumerates the registration information for all known process servers.
-
#enable_conf_logging ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#enable_log_group(name) ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#enable_logging ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#exclude_from_log(object, subname = nil) ⇒ Object
Permanently exclude object from the logging system.
-
#export_types=(flag) ⇒ Object
Controls whether the orogen types should be exported as Ruby constants.
-
#export_types? ⇒ Boolean
Controls whether the orogen types should be exported as Ruby constants.
-
#has_process_server?(name) ⇒ Boolean
Tests whether there is a registered process server with that name.
-
#ignore_load_errors=(value) ⇒ Object
If true, files that raise an error will be ignored.
-
#ignore_load_errors? ⇒ Boolean
If true, files that raise an error will be ignored.
-
#ignore_missing_orogen_projects_during_load=(value) ⇒ Object
If true, files that raise an error during task library or type import will be ignored.
-
#ignore_missing_orogen_projects_during_load? ⇒ Boolean
If true, files that raise an error during task library or type import will be ignored.
-
#initialize(app) ⇒ Configuration
constructor
A new instance of Configuration.
-
#load_component_extensions=(value) ⇒ Object
If true, we will load the component-specific code in tasks/orocos/.
-
#load_component_extensions? ⇒ Boolean
If true, we will load the component-specific code in tasks/orocos/.
-
#local_only=(value) ⇒ Object
True if this application should not try to contact other machines/servers.
-
#local_only? ⇒ Boolean
True if this application should not try to contact other machines/servers.
-
#log_group(name, &block) ⇒ Object
deprecated
Deprecated.
access #logs for logging configuration
-
#only_load_models=(flag) ⇒ Object
In normal operations, the plugin initializes the CORBA layer, which takes some time.
- #only_load_models? ⇒ Boolean
-
#permanent_deployments=(value) ⇒ Object
If true (the default), deployments are markes as permanent, i.e.
-
#permanent_deployments? ⇒ Boolean
If true (the default), deployments are markes as permanent, i.e.
-
#prefixing? ⇒ Boolean
True if deployments are going to be started with a prefix.
-
#process_server(*args) ⇒ Object
deprecated
Deprecated.
use #connect_to_orocos_process_server instead
-
#process_server_config_for(name) ⇒ ProcessServerConfig
Returns the process server object named
name
. -
#process_server_for(name) ⇒ Object
Returns the process server object named
name
. -
#redirect_local_process_server=(value) ⇒ Object
If true, the output of the local process server will be saved in log_dir/local_process_server.txt.
-
#redirect_local_process_server? ⇒ Boolean
If true, the output of the local process server will be saved in log_dir/local_process_server.txt.
- #register_configured_deployment(configured_deployment) ⇒ Object
-
#register_process_server(name, client, log_dir = nil, host_id: name) ⇒ ProcessServerConfig
Make a process server available to syskit.
-
#reject_ambiguous_deployments=(value) ⇒ Object
If multiple deployments are available for a task, and this task is not a device driver, the resolution engine will randomly pick one if this flag is set to false.
-
#reject_ambiguous_deployments? ⇒ Boolean
If multiple deployments are available for a task, and this task is not a device driver, the resolution engine will randomly pick one if this flag is set to false.
-
#remove_process_server(name) ⇒ Object
Deregisters a process server.
-
#sim_process_server(name) ⇒ Object
deprecated
Deprecated.
use #sim_process_server_config_for instead for consistency with #process_server_config_for
-
#sim_process_server_config_for(name) ⇒ ProcessServerConfig
Ensures that a ruby process server is present with the given name.
- #use_deployment(*names, on: 'localhost', **run_options) ⇒ Object
- #use_deployments_from(*names, on: 'localhost', **run_options) ⇒ Object
-
#use_only_model_pack=(value) ⇒ Object
Controls whether models from the installed components should be used or not.
-
#use_only_model_pack? ⇒ Boolean
Controls whether models from the installed components should be used or not.
- #use_ruby_tasks(mappings, on: 'ruby_tasks', remote_task: false) ⇒ Object
- #use_unmanaged_task(mappings, on: 'unmanaged_tasks') ⇒ Object
Constructor Details
#initialize(app) ⇒ Configuration
Returns a new instance of Configuration
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/syskit/roby_app/configuration.rb', line 68 def initialize(app) super() @app = app @process_servers = Hash.new @load_component_extensions = true @redirect_local_process_server = true @reject_ambiguous_deployments = true @only_load_models = nil @disables_local_process_server = false @define_default_process_managers = true @local_only = false @permanent_deployments = true @prefix_blacklist = [] @sd_publish_list = [] @ignore_missing_orogen_projects_during_load = false @ignore_load_errors = false @buffer_size_margin = 0.1 @use_only_model_pack = false clear self.export_types = true end |
Instance Attribute Details
#app ⇒ Roby::Application (readonly)
The application that we are configuring
12 13 14 |
# File 'lib/syskit/roby_app/configuration.rb', line 12 def app @app end |
#buffer_size_margin ⇒ Float (readonly)
Margin added to computed buffer sizes
The final buffer size is computed_size * margin rounded upwards. The default is 10% (0.1)
296 297 298 |
# File 'lib/syskit/roby_app/configuration.rb', line 296 def buffer_size_margin @buffer_size_margin end |
#deployment_group ⇒ Models::DeploymentGroup (readonly)
A global deployment group
This exists for backward-compatibility reasons, to ease the transition to the deployment API, as opposed to the older name-based deployment management
57 58 59 |
# File 'lib/syskit/roby_app/configuration.rb', line 57 def deployment_group @deployment_group end |
#logs ⇒ LoggingConfiguration (readonly)
Data logging configuration
40 41 42 |
# File 'lib/syskit/roby_app/configuration.rb', line 40 def logs @logs end |
#orocos ⇒ Object (readonly)
Component configuration
This returns an OpenStruct object in which component-specific configuration can be stored. Each component will in TaskContext#configure look for a value named as its deployed task name and apply configuration stored there (if there is any)
48 49 50 |
# File 'lib/syskit/roby_app/configuration.rb', line 48 def orocos @orocos end |
#prefix ⇒ String?
If set to a non-nil value, the deployment processes will be started with the given prefix
It is set from the syskit.prefix configuration variable in app.yml
254 255 256 |
# File 'lib/syskit/roby_app/configuration.rb', line 254 def prefix @prefix end |
#prefix_blacklist ⇒ Array<String,Regexp> (readonly)
A set of regular expressions that should match the names of the deployments that should not be prefixed even if #prefix is set
It is set from the syskit.prefix_blacklist configuration variable in app.yml
265 266 267 |
# File 'lib/syskit/roby_app/configuration.rb', line 265 def prefix_blacklist @prefix_blacklist end |
#process_servers ⇒ Hash<String,ProcessServerConfig> (readonly)
The set of process servers registered so far
29 30 31 |
# File 'lib/syskit/roby_app/configuration.rb', line 29 def process_servers @process_servers end |
#publish_white_list ⇒ Array<#===>
If set, it is the list of deployments that should be published on DNS-SD. It has no effect if #sd_domain is not set.
279 280 281 |
# File 'lib/syskit/roby_app/configuration.rb', line 279 def publish_white_list @publish_white_list end |
#sd_domain ⇒ String
If set, it is the service discovery domain in which the orocos processes should be published
It is set from the syskit.sd_domain configuration variable in app.yml
273 274 275 |
# File 'lib/syskit/roby_app/configuration.rb', line 273 def sd_domain @sd_domain end |
#sd_publish_list ⇒ Array<String,Regexp> (readonly)
A set of regular expressions that should match the names of the deployments that should be published on DNS-SD if #sd_domain is set
It is set from the syskit.sd_publish_list configuration variable in app.yml
288 289 290 |
# File 'lib/syskit/roby_app/configuration.rb', line 288 def sd_publish_list @sd_publish_list end |
Instance Method Details
#clear ⇒ Object
Resets this Syskit configuration object
Note that it is called by #initialize
99 100 101 102 103 |
# File 'lib/syskit/roby_app/configuration.rb', line 99 def clear @deployment_group = Models::DeploymentGroup.new @logs = LoggingConfiguration.new @orocos = Roby::OpenStruct.new end |
#clear_deployments ⇒ Object
547 548 549 550 |
# File 'lib/syskit/roby_app/configuration.rb', line 547 def clear_deployments #Roby.warn_deprecated "conf.clear_deployments is deprecated, use the profile-level deployment API" @deployment_group = Models::DeploymentGroup.new end |
#connect_to_orocos_process_server(name, host, port: Orocos::RemoteProcesses::DEFAULT_PORT, log_dir: nil, result_dir: nil, host_id: nil) ⇒ Orocos::ProcessClient, Orocos::Generation::Project
Call to declare a new process server and add to the set of servers that can be used by this plan manager
If 'host' is set to localhost, it disables the automatic startup of the local process server (i.e. sets orocos_disables_local_process_server to true)
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/syskit/roby_app/configuration.rb', line 461 def connect_to_orocos_process_server( name, host, port: Orocos::RemoteProcesses::DEFAULT_PORT, log_dir: nil, result_dir: nil, host_id: nil) if log_dir || result_dir Syskit.warn "specifying log and/or result dir for remote process servers is deprecated. Use 'syskit process_server' instead of 'orocos_process_server' which will take the log dir information from the environment/configuration" end if only_load_models? || (app.simulation? && app.single?) client = ModelOnlyServer.new(app.default_loader) register_process_server(name, client, app.log_dir, host_id: host_id || 'syskit') return client elsif app.single? client = Orocos::RemoteProcesses::Client.new( 'localhost', port, root_loader: app.default_loader) register_process_server(name, client, app.log_dir, host_id: host_id || 'localhost') return client end if local_only? && host != 'localhost' raise LocalOnlyConfiguration, "in local only mode, one can only connect to process servers on 'localhost' (got #{host})" elsif process_servers[name] raise AlreadyConnected, "we are already connected to a process server called #{name}" end if host =~ /^(.*):(\d+)$/ host = $1 port = Integer($2) end if host == 'localhost' self.disables_local_process_server = true end client = Orocos::RemoteProcesses::Client.new( host, port, root_loader: app.default_loader) client.create_log_dir(log_dir, Roby.app.time_tag, Hash['parent' => Roby.app.]) register_process_server(name, client, log_dir, host_id: host_id || name) client end |
#create_subfield(name) ⇒ Object
92 93 94 |
# File 'lib/syskit/roby_app/configuration.rb', line 92 def create_subfield(name) Roby::OpenStruct.new(model, self, name) end |
#default_logging_buffer_size ⇒ Object
access #logs for logging configuration
124 125 126 127 |
# File 'lib/syskit/roby_app/configuration.rb', line 124 def default_logging_buffer_size Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.default_logging_buffer_size end |
#default_logging_buffer_size=(size) ⇒ Object
access #logs for logging configuration
130 131 132 133 |
# File 'lib/syskit/roby_app/configuration.rb', line 130 def default_logging_buffer_size=(size) Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.default_logging_buffer_size=size end |
#default_prefix(deployment_model) ⇒ String?
Returns the deployment prefix that should be used to start the given syskit deployment process
344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/syskit/roby_app/configuration.rb', line 344 def default_prefix(deployment_model) return if !prefix deployment_name = deployment_model.deployment_name exclude = prefix_blacklist.any? do |pattern| pattern === deployment_name end if !exclude "#{prefix}_" end end |
#default_run_options(deployment_model) ⇒ String=>String
Returns the set of options that should be given to Process.spawn to start the given deployment model
328 329 330 331 332 333 334 335 336 337 |
# File 'lib/syskit/roby_app/configuration.rb', line 328 def (deployment_model) result = Hash.new if prefix = default_prefix(deployment_model) result["prefix"] = prefix end if sd_domain = default_sd_domain(deployment_model) result["sd-domain"] = sd_domain end result end |
#default_sd_domain(deployment_model) ⇒ String?
Sets up mDNS support for the syskit deployment processes
360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/syskit/roby_app/configuration.rb', line 360 def default_sd_domain(deployment_model) return if !sd_domain deployment_name = deployment_model.name publish = publish_white_list.any? do |pattern| pattern === deployment_name end if publish sd_domain end end |
#define_default_process_managers=(value) ⇒ Object
Controls whether Syskit sets up its default process managers (localhost, ruby_tasks, unmanaged_tasks and ros), or leaves it to the app to set them up
This is internally used during tests
119 120 121 |
# File 'lib/syskit/roby_app/configuration.rb', line 119 def define_default_process_managers=(value) @define_default_process_managers = value end |
#define_default_process_managers? ⇒ Boolean
Controls whether Syskit sets up its default process managers (localhost, ruby_tasks, unmanaged_tasks and ros), or leaves it to the app to set them up
This is internally used during tests
112 113 114 |
# File 'lib/syskit/roby_app/configuration.rb', line 112 def define_default_process_managers? @define_default_process_managers end |
#disable_conf_logging ⇒ Object
access #logs for logging configuration
192 193 194 195 |
# File 'lib/syskit/roby_app/configuration.rb', line 192 def disable_conf_logging Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.disable_conf_logging end |
#disable_log_group(name) ⇒ Object
access #logs for logging configuration
165 166 167 168 |
# File 'lib/syskit/roby_app/configuration.rb', line 165 def disable_log_group(name) Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.disable_group(name) end |
#disable_logging ⇒ Object
access #logs for logging configuration
180 181 182 183 |
# File 'lib/syskit/roby_app/configuration.rb', line 180 def disable_logging Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.disable_port_logging end |
#disables_local_process_server=(flag) ⇒ Object
Controls whether Syskit auto-starts a process server locally
In normal operations, a local proces server called 'localhost' is automatically started on the local machine. If this predicate is set to true, with Syskit.conf.disables_local_process_server = true, this server won't be started.
Disable this when the local process server is managed by other means, or when the machine that runs the Syskit instance is not the machine that runs the components
The local process server won't be started if #define_default_process_managers? is explicitely set to false
244 245 246 |
# File 'lib/syskit/roby_app/configuration.rb', line 244 def disables_local_process_server=(flag) @disables_local_process_server = flag end |
#disables_local_process_server? ⇒ Boolean
Controls whether Syskit auto-starts a process server locally
In normal operations, a local proces server called 'localhost' is automatically started on the local machine. If this predicate is set to true, with Syskit.conf.disables_local_process_server = true, this server won't be started.
Disable this when the local process server is managed by other means, or when the machine that runs the Syskit instance is not the machine that runs the components
The local process server won't be started if #define_default_process_managers? is explicitely set to false
239 240 241 |
# File 'lib/syskit/roby_app/configuration.rb', line 239 def disables_local_process_server? @disables_local_process_server end |
#each_process_server {|process_server| ... } ⇒ void
This method returns an undefined value.
Enumerates all available process servers
419 420 421 422 423 424 |
# File 'lib/syskit/roby_app/configuration.rb', line 419 def each_process_server return enum_for(__method__) if !block_given? process_servers.each_value do |config| yield(config.client) end end |
#each_process_server_config {|process_server| ... } ⇒ void
This method returns an undefined value.
Enumerates the registration information for all known process servers
431 432 433 |
# File 'lib/syskit/roby_app/configuration.rb', line 431 def each_process_server_config(&block) process_servers.each_value(&block) end |
#enable_conf_logging ⇒ Object
access #logs for logging configuration
186 187 188 189 |
# File 'lib/syskit/roby_app/configuration.rb', line 186 def enable_conf_logging Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.enable_conf_logging end |
#enable_log_group(name) ⇒ Object
access #logs for logging configuration
159 160 161 162 |
# File 'lib/syskit/roby_app/configuration.rb', line 159 def enable_log_group(name) Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.enable_group(name) end |
#enable_logging ⇒ Object
access #logs for logging configuration
175 176 177 178 |
# File 'lib/syskit/roby_app/configuration.rb', line 175 def enable_logging Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.enable_port_logging end |
#exclude_from_log(object, subname = nil) ⇒ Object
Permanently exclude object from the logging system
object
can be
-
a deployment model, in which case no task in this deployment will be logged
-
a task model, in which case no port of any task of this type will be logged
-
a port model, in which case no such port will be logged (regardless of which task it is on)
-
a string. It can then either be a task name, a port name or a type name
154 155 156 |
# File 'lib/syskit/roby_app/configuration.rb', line 154 def exclude_from_log(object, subname = nil) main_group.add(object, subname) end |
#export_types=(flag) ⇒ Object
Controls whether the orogen types should be exported as Ruby constants
35 |
# File 'lib/syskit/roby_app/configuration.rb', line 35 attr_predicate :export_types?, true |
#export_types? ⇒ Boolean
Controls whether the orogen types should be exported as Ruby constants
35 |
# File 'lib/syskit/roby_app/configuration.rb', line 35 attr_predicate :export_types?, true |
#has_process_server?(name) ⇒ Boolean
Tests whether there is a registered process server with that name
373 374 375 |
# File 'lib/syskit/roby_app/configuration.rb', line 373 def has_process_server?(name) process_servers[name.to_str] end |
#ignore_load_errors=(value) ⇒ Object
If true, files that raise an error will be ignored. This is usually used on “root” bundles (e.g. the Rock bundle) to have the benefit of GUIs like browse even though some files have errors
26 |
# File 'lib/syskit/roby_app/configuration.rb', line 26 attr_predicate :ignore_load_errors, true |
#ignore_load_errors? ⇒ Boolean
If true, files that raise an error will be ignored. This is usually used on “root” bundles (e.g. the Rock bundle) to have the benefit of GUIs like browse even though some files have errors
26 |
# File 'lib/syskit/roby_app/configuration.rb', line 26 attr_predicate :ignore_load_errors, true |
#ignore_missing_orogen_projects_during_load=(value) ⇒ Object
If true, files that raise an error during task library or type import will be ignored. This is usually used on “root” bundles (e.g. the Rock bundle) to have the benefit of GUIs like system_model even though some typekits/task libraries are not present
21 |
# File 'lib/syskit/roby_app/configuration.rb', line 21 attr_predicate :ignore_missing_orogen_projects_during_load, true |
#ignore_missing_orogen_projects_during_load? ⇒ Boolean
If true, files that raise an error during task library or type import will be ignored. This is usually used on “root” bundles (e.g. the Rock bundle) to have the benefit of GUIs like system_model even though some typekits/task libraries are not present
21 |
# File 'lib/syskit/roby_app/configuration.rb', line 21 attr_predicate :ignore_missing_orogen_projects_during_load, true |
#load_component_extensions=(value) ⇒ Object
If true, we will load the component-specific code in tasks/orocos/. It is true by default
15 |
# File 'lib/syskit/roby_app/configuration.rb', line 15 attr_predicate :load_component_extensions, true |
#load_component_extensions? ⇒ Boolean
If true, we will load the component-specific code in tasks/orocos/. It is true by default
15 |
# File 'lib/syskit/roby_app/configuration.rb', line 15 attr_predicate :load_component_extensions, true |
#local_only=(value) ⇒ Object
True if this application should not try to contact other machines/servers
412 |
# File 'lib/syskit/roby_app/configuration.rb', line 412 attr_predicate :local_only?, true |
#local_only? ⇒ Boolean
True if this application should not try to contact other machines/servers
412 |
# File 'lib/syskit/roby_app/configuration.rb', line 412 attr_predicate :local_only?, true |
#log_group(name, &block) ⇒ Object
access #logs for logging configuration
136 137 138 139 140 141 |
# File 'lib/syskit/roby_app/configuration.rb', line 136 def log_group(name, &block) Roby.warn_deprecated "logging configuration has been moved to Syskit.conf.logs (of type LoggingConfiguration)" logs.create_group(name) do |group| group.instance_eval(&block) end end |
#only_load_models=(flag) ⇒ Object
In normal operations, the plugin initializes the CORBA layer, which takes some time.
In some tools, one only wants to manipulate models offline. In which case we don't need to waste time initializing the layer.
Set this value to true to avoid initializing the CORBA layer
214 215 216 |
# File 'lib/syskit/roby_app/configuration.rb', line 214 def only_load_models=(flag) @only_load_models = flag end |
#only_load_models? ⇒ Boolean
218 219 220 221 222 223 224 |
# File 'lib/syskit/roby_app/configuration.rb', line 218 def only_load_models? if @only_load_models.nil? app.modelling_only? else @only_load_models end end |
#permanent_deployments=(value) ⇒ Object
If true (the default), deployments are markes as permanent, i.e. won't be garbage-collected when the corresponding tasks are unused
205 |
# File 'lib/syskit/roby_app/configuration.rb', line 205 attr_predicate :permanent_deployments?, true |
#permanent_deployments? ⇒ Boolean
If true (the default), deployments are markes as permanent, i.e. won't be garbage-collected when the corresponding tasks are unused
205 |
# File 'lib/syskit/roby_app/configuration.rb', line 205 attr_predicate :permanent_deployments?, true |
#prefixing? ⇒ Boolean
True if deployments are going to be started with a prefix
257 |
# File 'lib/syskit/roby_app/configuration.rb', line 257 def prefixing?; !!prefix end |
#process_server(*args) ⇒ Object
use #connect_to_orocos_process_server instead
436 437 438 |
# File 'lib/syskit/roby_app/configuration.rb', line 436 def process_server(*args) connect_to_orocos_process_server(*args) end |
#process_server_config_for(name) ⇒ ProcessServerConfig
Returns the process server object named name
392 393 394 395 396 397 398 |
# File 'lib/syskit/roby_app/configuration.rb', line 392 def process_server_config_for(name) config = process_servers[name] if config then config else raise UnknownProcessServer, "there is no registered process server called #{name}" end end |
#process_server_for(name) ⇒ Object
Returns the process server object named name
406 407 408 |
# File 'lib/syskit/roby_app/configuration.rb', line 406 def process_server_for(name) process_server_config_for(name).client end |
#redirect_local_process_server=(value) ⇒ Object
If true, the output of the local process server will be saved in log_dir/local_process_server.txt
171 |
# File 'lib/syskit/roby_app/configuration.rb', line 171 attr_predicate :redirect_local_process_server?, true |
#redirect_local_process_server? ⇒ Boolean
If true, the output of the local process server will be saved in log_dir/local_process_server.txt
171 |
# File 'lib/syskit/roby_app/configuration.rb', line 171 attr_predicate :redirect_local_process_server?, true |
#register_configured_deployment(configured_deployment) ⇒ Object
573 574 575 |
# File 'lib/syskit/roby_app/configuration.rb', line 573 def register_configured_deployment(configured_deployment) deployment_group.register_configured_deployment(configured_deployment) end |
#register_process_server(name, client, log_dir = nil, host_id: name) ⇒ ProcessServerConfig
Make a process server available to syskit
519 520 521 522 523 524 525 526 527 |
# File 'lib/syskit/roby_app/configuration.rb', line 519 def register_process_server(name, client, log_dir = nil, host_id: name) if process_servers[name] raise ArgumentError, "there is already a process server registered as #{name}, call #remove_process_server first" end ps = ProcessServerConfig.new(name, client, log_dir, host_id) process_servers[name] = ps ps end |
#reject_ambiguous_deployments=(value) ⇒ Object
If multiple deployments are available for a task, and this task is not a device driver, the resolution engine will randomly pick one if this flag is set to false. If set to true (the default), it will generate an error
201 |
# File 'lib/syskit/roby_app/configuration.rb', line 201 attr_predicate :reject_ambiguous_deployments?, true |
#reject_ambiguous_deployments? ⇒ Boolean
If multiple deployments are available for a task, and this task is not a device driver, the resolution engine will randomly pick one if this flag is set to false. If set to true (the default), it will generate an error
201 |
# File 'lib/syskit/roby_app/configuration.rb', line 201 attr_predicate :reject_ambiguous_deployments?, true |
#remove_process_server(name) ⇒ Object
Deregisters a process server
534 535 536 537 538 539 540 541 542 543 544 545 |
# File 'lib/syskit/roby_app/configuration.rb', line 534 def remove_process_server(name) ps = process_servers.delete(name) if !ps raise ArgumentError, "there is no registered process server called #{name}" end app.default_loader.remove ps.client.loader if app.simulation? && process_servers["#{name}-sim"] remove_process_server("#{name}-sim") end ps end |
#sim_process_server(name) ⇒ Object
use #sim_process_server_config_for instead for consistency with #process_server_config_for
(see #sim_process_server_config_for)
302 303 304 |
# File 'lib/syskit/roby_app/configuration.rb', line 302 def sim_process_server(name) sim_process_server_config_for(name) end |
#sim_process_server_config_for(name) ⇒ ProcessServerConfig
Ensures that a ruby process server is present with the given name
It is used when running in simulation mode, to “fake” the task contexts
313 314 315 316 317 318 319 320 321 |
# File 'lib/syskit/roby_app/configuration.rb', line 313 def sim_process_server_config_for(name) sim_name = "#{name}-sim" unless process_servers[sim_name] mng = Orocos::RubyTasks::ProcessManager.new(app.default_loader, task_context_class: Orocos::RubyTasks::StubTaskContext) register_process_server(sim_name, mng, "") end process_server_config_for(sim_name) end |
#use_deployment(*names, on: 'localhost', **run_options) ⇒ Object
562 563 564 565 566 |
# File 'lib/syskit/roby_app/configuration.rb', line 562 def use_deployment(*names, on: 'localhost', **) deployment_group.use_deployment(*names, on: on, process_managers: self, loader: app.default_loader, **) end |
#use_deployments_from(*names, on: 'localhost', **run_options) ⇒ Object
568 569 570 571 |
# File 'lib/syskit/roby_app/configuration.rb', line 568 def use_deployments_from(*names, on: 'localhost', **) deployment_group.use_deployment(*names, on: on, process_managers: self, loader: app.default_loader, **) end |
#use_only_model_pack=(value) ⇒ Object
Controls whether models from the installed components should be used or not
32 |
# File 'lib/syskit/roby_app/configuration.rb', line 32 attr_predicate :use_only_model_pack?, true |
#use_only_model_pack? ⇒ Boolean
Controls whether models from the installed components should be used or not
32 |
# File 'lib/syskit/roby_app/configuration.rb', line 32 attr_predicate :use_only_model_pack?, true |
#use_ruby_tasks(mappings, on: 'ruby_tasks', remote_task: false) ⇒ Object
552 553 554 555 |
# File 'lib/syskit/roby_app/configuration.rb', line 552 def use_ruby_tasks(mappings, on: 'ruby_tasks', remote_task: false) deployment_group.use_ruby_tasks(mappings, on: on, remote_task: remote_task, process_managers: self) end |
#use_unmanaged_task(mappings, on: 'unmanaged_tasks') ⇒ Object
557 558 559 560 |
# File 'lib/syskit/roby_app/configuration.rb', line 557 def use_unmanaged_task(mappings, on: 'unmanaged_tasks') deployment_group.use_unmanaged_task(mappings, on: on, process_managers: self) end |