Simulated Property based on a configuration log file It is automatically replayed if at least one OutputPort of the task is replayed
The property/attribute name
dedicated stream for simulating the port
The underlying TaskContext instance
true –> this property shall be replayed
The attribute type, as a subclass of Typelib::Type
# File lib/orocos/log/task_context.rb, line 394 def initialize(task, stream) raise "Cannot create Property out of #{stream.class}" if !stream.instance_of?(Pocolog::DataStream) @stream = stream @name = stream.name.to_s.match(/\.(.*$)/) raise 'Stream name does not follow the convention TASKNAME.PROPERTYNAME' if @name == nil @name = @name[1] @type = stream.type @task = task @current_value = nil @type_name = stream.typename end
# File lib/orocos/log/task_context.rb, line 406 def doc? false end
Give the full name for this property. It is the stream name.
# File lib/orocos/log/task_context.rb, line 438 def full_name stream.name end
returns the metadata associated with the underlying stream
# File lib/orocos/log/task_context.rb, line 447 def metadata stream.metadata end
# File lib/orocos/log/task_context.rb, line 420 def new_sample type.new end
Returns the number of samples for the property.
# File lib/orocos/log/task_context.rb, line 433 def number_of_samples return @stream.size end
# File lib/orocos/log/task_context.rb, line 424 def orocos_type_name if metadata && metadata.has_key?(:rock_orocos_type_name) metadata[:rock_orocos_type_name] else type_name end end
Read the current value of the property/attribute
# File lib/orocos/log/task_context.rb, line 411 def read @current_value end
Sets a new value for the property/attribute
# File lib/orocos/log/task_context.rb, line 416 def write(value) @current_value = value end