Class: TECSCDE::TECSModel::TmCPort

Inherits:
TmPort show all
Defined in:
lib/tecscde/tecs_model/tm_c_port.rb

Overview

mikan cp array

Instance Attribute Summary

Attributes inherited from TmPort

#offset

Attributes inherited from TECSCDE::TmObject

#owner

Instance Method Summary collapse

Methods inherited from TmPort

#array?, #delete_highlighted, #editable?, #get_cell, #get_edge_side, #get_edge_side_name, #get_name, #get_normal_bar_of_edge, #get_position, #get_position_in_normal_dir, #get_position_in_tangential_dir, #get_sign_of_normal, #get_signature, #get_subscript, #insert, #move, #moved_edge, #owner_cell, #set_position, #set_subscript

Methods inherited from TECSCDE::TmObject

#copy_from, #model, #modified

Constructor Details

#initialize(owner, port_def, subscript = nil) ⇒ TmCPort

@join::TmJoin



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 58

def initialize(owner, port_def, subscript = nil)
  # p "port_def::#{port_def.get_name}  #{port_def.class}"
  @port_def = port_def
  @owner = owner
  @join = nil
  @subscript = subscript
  # p "subscript=#{subscript}"

  @name = "cCport" # temporal
  @edge_side, @offset = get_cell.get_new_cport_position(port_def)
  modified {}
end

Instance Method Details

#clone_for_undoObject

TmCPort#clone_for_undo



115
116
117
118
119
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 115

def clone_for_undo
  bu = clone
  bu.copy_from(self)
  bu
end

#complete?Boolean

TmCPort#complete?

Returns:

  • (Boolean)


105
106
107
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 105

def complete?
  @join ? true : false
end

#deleteObject

TmCPort#delete

this method is called from TmCell



88
89
90
91
92
93
94
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 88

def delete
  return unless @join
  modified do
    @join.delete
    @join = nil
  end
end

#delete_joinObject

TmCPort#delete_join

this method is called from TmJoin



98
99
100
101
102
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 98

def delete_join
  modified do
    @join = nil
  end
end

#get_join(subscript = nil) ⇒ Object



82
83
84
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 82

def get_join(subscript = nil)
  @join
end

#moved(x_inc, y_inc) ⇒ Object



77
78
79
80
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 77

def moved(x_inc, y_inc)
  return unless @join
  @join.moved_cport(x_inc, y_inc)
end

#optional?Boolean

TmCPort#optional?

Returns:

  • (Boolean)


110
111
112
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 110

def optional?
  @port_def.is_optional?
end

#set_join(join) ⇒ Object



71
72
73
74
75
# File 'lib/tecscde/tecs_model/tm_c_port.rb', line 71

def set_join(join)
  modified do
    @join = join
  end
end