Class: Syskit::Robot::DeviceInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/syskit/robot/device_instance.rb

Overview

A DeviceInstance object is used to represent an actual device on the system

It is returned by Robot.device

Direct Known Subclasses

MasterDeviceInstance, SlaveDeviceInstance

Instance Method Summary collapse

Instance Method Details

#docString

Gets or sets a documentation string for this device

Returns:

  • (String)


20
# File 'lib/syskit/robot/device_instance.rb', line 20

dsl_attribute(:doc) { |s| s.to_str if s }

#instanciate(plan, context = DependencyInjectionContext.new, options = Hash.new) ⇒ Object



47
48
49
# File 'lib/syskit/robot/device_instance.rb', line 47

def instanciate(plan, context = DependencyInjectionContext.new, options = Hash.new)
    to_instance_requirements.instanciate(plan, context, options)
end

#periodFloat

Gets or sets the device period

The device period is the amount of time there is between two samples coming from the device. The value is a floating-point value in seconds.

Returns:

  • (Float)


15
# File 'lib/syskit/robot/device_instance.rb', line 15

dsl_attribute(:period) { |v| Float(v) }

#to_actionObject



43
44
45
# File 'lib/syskit/robot/device_instance.rb', line 43

def to_action
    to_instance_requirements.to_action
end