Class: Roby::TimeDeltaEvent

Inherits:
DeltaEvent show all
Defined in:
lib/roby/state/events.rb

Overview

An event which emits at a given period (delta in time)

Instance Attribute Summary

Attributes inherited from DeltaEvent

#last_value, #threshold

Attributes inherited from EventGenerator

#command, #event_model, #history, #unreachability_reason, #unreachable_handlers

Attributes inherited from PlanObject

#addition_time, #executable, #execution_engine, #finalization_handlers, #finalization_time, #model, #plan, #promise_executor, #removed_at

Attributes included from Roby::Transaction::Proxying::Cache

#transaction_forwarder_module, #transaction_proxy_module

Attributes included from Relations::DirectedRelationSupport

#relation_graphs

Attributes inherited from DistributedObject

#local_owner_id, #owners

Instance Method Summary collapse

Methods inherited from DeltaEvent

event_types, #or, or, #poll, register_as, #reset

Methods inherited from StateEvent

#disable, #disabled?, #emit, #enable, #enabled?, #initialize, #reset

Methods inherited from EventGenerator

#&, #achieve_asynchronously, #achieve_with, #add_child_object, #call, #call_handlers, #call_unreachable_handlers, #call_without_propagation, #called, #calling, #cancel, #check_call_validity, #check_call_validity_after_calling, #check_emission_validity, #clear_pending, #controlable?, #create_transaction_proxy, #default_command, #delay, #each_precondition, #emit, #emit_failed, #emit_without_propagation, #emitting, #filter, #finalized!, #fire, #fired, #forward, #forward_once, #forward_to, #forward_to_once, #forwarded_to?, #garbage!, #happened?, #if_unreachable, #initialize, #initialize_copy, #initialize_replacement, #last, #mark_unreachable!, match, #match, #model, #name, #new, #on, #once, #pending, #plan=, #precondition, #pretty_print, #realize_with, #related_events, #related_tasks, #replace_by, #signal, #signals, #signals_once, #to_event, #to_execution_exception, #to_execution_exception_matcher, #unreachable!, #unreachable_without_propagation, #until, #when_unreachable, #|

Methods included from DRoby::Identifiable

#droby_id, #initialize_copy

Methods included from DRoby::V5::DRobyConstant::Dump

#droby_dump, #droby_marshallable?

Methods included from DRoby::V5::EventGeneratorDumper

#droby_dump

Methods included from GUI::RelationsCanvasEventGenerator

#display, #display_create, #display_name, #display_time_end, #display_time_start, priorities, style, styles

Methods included from GUI::RelationsCanvasPlanObject

#display, #display_create, #display_events, #display_name, #display_parent

Methods inherited from PlanObject

#add_child_object, #apply_relation_changes, #as_plan, #can_finalize?, #commit_transaction, #concrete_model, #connection_space, #each_finalization_handler, #each_in_neighbour_merged, #each_out_neighbour_merged, #each_plan_child, #engine, #executable?, #finalized!, #finalized?, #forget_peer, #fullfills?, #garbage!, #garbage?, #initialize, #initialize_copy, #initialize_replacement, #merged_relations, #promise, #read_write?, #real_object, #remotely_useful?, #replace_by, #replace_subplan_by, #root_object, #root_object?, #subscribed?, #transaction_proxy?, #transaction_stack, #update_on?, #updated_by?, #when_finalized

Methods included from Models::PlanObject

#child_plan_object, #finalization_handler, #match, #when_finalized

Methods included from GUI::GraphvizPlanObject

#apply_layout, #dot_label, #to_dot

Methods included from Relations::DirectedRelationSupport

#[], #[]=, #add_child_object, #add_parent_object, #child_object?, #child_objects, #clear_vertex, #each_child_object, #each_in_neighbour, #each_out_neighbour, #each_parent_object, #each_relation, #each_relation_graph, #each_relation_sorted, #each_root_relation_graph, #enum_child_objects, #enum_parent_objects, #enum_relations, #leaf?, #parent_object?, #parent_objects, #related_object?, #related_objects, #relation_graph_for, #relations, #remove_child_object, #remove_children, #remove_parent_object, #remove_parents, #remove_relations, #root?, #sorted_relations

Methods inherited from DistributedObject

#add_owner, #clear_owners, #initialize, #initialize_copy, #owned_by?, #remove_owner

Constructor Details

This class inherits a constructor from Roby::StateEvent

Instance Method Details

#deltaObject

Returns how much time elapsed since the last emission



298
299
300
# File 'lib/roby/state/events.rb', line 298

def delta
    Time.now - last_value
end

#has_sample?Boolean

Always true, as we can always measure time

Returns:

  • (Boolean)


293
294
295
# File 'lib/roby/state/events.rb', line 293

def has_sample?
    true
end

#readObject

Returns the current time



303
304
305
# File 'lib/roby/state/events.rb', line 303

def read
    Time.now
end