Class: Syskit::DRoby::V5::ComBusDumper::DRoby

Inherits:
Roby::DRoby::V5::DRobyModel
  • Object
show all
Defined in:
lib/syskit/droby/v5/droby_dump.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_type, lazy_dispatch, *args) ⇒ DRoby

Returns a new instance of DRoby



78
79
80
81
82
# File 'lib/syskit/droby/v5/droby_dump.rb', line 78

def initialize(message_type, lazy_dispatch, *args)
    @message_type = message_type
    @lazy_dispatch = lazy_dispatch
    super(*args)
end

Instance Attribute Details

#lazy_dispatchObject (readonly)

Returns the value of attribute lazy_dispatch



76
77
78
# File 'lib/syskit/droby/v5/droby_dump.rb', line 76

def lazy_dispatch
  @lazy_dispatch
end

#message_typeObject (readonly)

Returns the value of attribute message_type



75
76
77
# File 'lib/syskit/droby/v5/droby_dump.rb', line 75

def message_type
  @message_type
end

Instance Method Details

#create_new_proxy_model(peer) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/syskit/droby/v5/droby_dump.rb', line 84

def create_new_proxy_model(peer)
    supermodel = peer.local_model(self.supermodel)
    # 2016-05: workaround broken log files in which types
    #          are marshalled as strings instead of type
    #          objects
    if message_type.respond_to?(:to_str)
        message_type = Roby.app.default_loader.resolve_type(self.message_type, define_dummy_type: true)
    else
        message_type = peer.local_object(self.message_type)
    end

    # We unfortunately must register the type on the global
    # loader. We're not ready yet for a fully mixed-loader
    # setup
    Roby.app.default_loader.register_type_model(message_type)

    local_model = supermodel.new_submodel(name: name, lazy_dispatch: lazy_dispatch, message_type: message_type)
    peer.register_model(local_model, remote_siblings)
    local_model
end