lib/spnet/storage/link_state.rb
# Make a Link objet from the current LinkState object.  
Make a Link objet from the current LinkState object.
Make a Link objet from the current LinkState object .
def make_link blocks
    raise "from block #{@from.block_name} not found" unless blocks.has_key?(@from.block_name)
    raise "to block #{@to.block_name} not found" unless blocks.has_key?(@to.block_name)
    from_block = blocks[@from.block_name]
    to_block = blocks[@to.block_name]
    raise "from port #{@from.port_name} not found" unless from_block.out_ports.has_key?(@from.port_name)
    raise "to port #{@to.port_name} not found" unless to_block.in_ports.has_key?(@to.port_name)
    from_port = from_block.out_ports[@from.port_name]
    to_port = to_block.in_ports[@to.port_name]
    return Link.new(:from => from_port, :to => to_port)
  end
def make_link blocks raise "from block #{@from.block_name} not found" unless blocks . has_key? ( @from . block_name ) raise "to block #{@to.block_name} not found" unless blocks . has_key? ( @to . block_name ) from_block = blocks [ @from . block_name ] to_block = blocks [ @to . block_name ] raise "from port #{@from.port_name} not found" unless from_block . out_ports . has_key? ( @from . port_name ) raise "to port #{@to.port_name} not found" unless to_block . in_ports . has_key? ( @to . port_name ) from_port = from_block . out_ports [ @from . port_name ] to_port = to_block . in_ports [ @to . port_name ] return Link . new ( :from => from_port , :to => to_port ) end
Make a Link objet from the current LinkState object.
Make a Link objet from the current LinkState object .
blocks