Class: TECSCDE::TECSModel::TmPort
Instance Attribute Summary collapse
-
#offset ⇒ Object
readonly
- @edge_side::Integer() @offset::Integer(mm) # distance from top or left side @owner::TmCell | TmXPortArray (Reverse Reference) @port_def
-
::Port @subscript::Integer | Nil.
#owner
Instance Method Summary
collapse
-
#array? ⇒ Boolean
TmPort#array?.
-
#delete_highlighted ⇒ Object
TmPort#delete_highlighted delete_highlighted if this port is a member of unsubscripted array.
-
#editable? ⇒ Boolean
TmPort#editable?.
-
#get_cell ⇒ Object
-
#get_edge_side ⇒ Object
-
#get_edge_side_name ⇒ Object
-
#get_name ⇒ Object
-
#get_normal_bar_of_edge(join) ⇒ Object
tmport#get_normal_bar_of_edge (1) (6) bar from call port.
-
#get_position ⇒ Object
-
#get_position_in_normal_dir ⇒ Object
-
#get_position_in_tangential_dir ⇒ Object
TmPort#get_position_in_tangential_dir.
-
#get_sign_of_normal ⇒ Object
-
#get_signature ⇒ Object
TmPort# get_signature RETURN::Signature.
-
#get_subscript ⇒ Object
-
#insert(before_after) ⇒ Object
TmPort#insert before_after::Symbol: :before, :after insert if this port is a member of unsubscripted array.
-
#move(x_inc, y_inc) ⇒ Object
TmPort#move.
-
#moved_edge(x_inc_l, x_inc_r, y_inc_t, y_inc_b) ⇒ Object
TmPort#moved_edge moved cell’s edge x_inc_l::Float : left edge moved, value is incremental x_inc_r::Float : right edge moved, value is incremental y_inc_t::Float : top edge moved, value is incremental y_inc_b::Float : bottom edge moved, value is incremental.
-
#owner_cell ⇒ Object
TmPort#owner_cell.
-
#set_position(edge_side, offset) ⇒ Object
TmPort#set_position.
-
#set_subscript(subscript) ⇒ Object
#copy_from, #model, #modified
Instance Attribute Details
@edge_side::Integer() @offset::Integer(mm) # distance from top or left side @owner::TmCell | TmXPortArray (Reverse Reference)
- @port_def
-
::Port
@subscript::Integer | Nil
63
64
65
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 63
def offset
@offset
end
|
Instance Method Details
#array? ⇒ Boolean
193
194
195
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 193
def array?
false
end
|
#delete_highlighted ⇒ Object
TmPort#delete_highlighted
delete_highlighted if this port is a member of unsubscripted array.
207
208
209
210
211
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 207
def delete_highlighted
return unless @owner.editable?
return unless @owner.is_a?(TECSCDE::TECSModel::TmPortArray)
@owner.delete_highlighted(self)
end
|
#editable? ⇒ Boolean
222
223
224
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 222
def editable?
@owner.editable?
end
|
150
151
152
153
154
155
156
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 150
def get_cell
if @owner.is_a?(TECSCDE::TECSModel::TmCell)
@owner
else
@owner.owner
end
end
|
#get_edge_side ⇒ Object
133
134
135
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 133
def get_edge_side
@edge_side
end
|
#get_edge_side_name ⇒ Object
137
138
139
140
141
142
143
144
145
146
147
148
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 137
def get_edge_side_name
case @edge_side
when EDGE_TOP
:EDGE_TOP
when EDGE_BOTTOM
:EDGE_BOTTOM
when EDGE_LEFT
:EDGE_LEFT
when EDGE_RIGHT
:EDGE_RIGHT
end
end
|
172
173
174
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 172
def get_name
@port_def.get_name
end
|
#get_normal_bar_of_edge(join) ⇒ Object
tmport#get_normal_bar_of_edge
(1) (6) bar from call port. this indicate A position. join::TmJoin
#get_position ⇒ Object
158
159
160
161
162
163
164
165
166
167
168
169
170
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 158
def get_position
x, y, w, h = get_cell.get_geometry
case @edge_side
when EDGE_TOP
[x + @offset, y]
when EDGE_BOTTOM
[x + @offset, y + h]
when EDGE_LEFT
[x, y + @offset]
when EDGE_RIGHT
[x + w, y + @offset]
end
end
|
#get_position_in_normal_dir ⇒ Object
125
126
127
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 125
def get_position_in_normal_dir
get_cell.get_edge_position_in_normal_dir(@edge_side)
end
|
#get_position_in_tangential_dir ⇒ Object
TmPort#get_position_in_tangential_dir
120
121
122
123
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 120
def get_position_in_tangential_dir
x, y, _width, _height = get_cell.get_geometry
TECSCDE::TECSModel.vertical?(@edge_side) ? y + @offset : x + @offset
end
|
#get_signature ⇒ Object
TmPort# get_signature
RETURN::Signature
178
179
180
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 178
def get_signature
@port_def.get_signature
end
|
#get_subscript ⇒ Object
182
183
184
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 182
def get_subscript
@subscript
end
|
#insert(before_after) ⇒ Object
TmPort#insert
before_after::Symbol: :before, :after insert if this port is a member of unsubscripted array.
216
217
218
219
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 216
def insert(before_after)
return unless @owner.is_a?(TECSCDE::TECSModel::TmPortArray)
@owner.insert(self, before_after)
end
|
#move(x_inc, y_inc) ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 66
def move(x_inc, y_inc)
modified do
_x, _y, w, h = owner_cell.get_geometry
case @edge_side
when EDGE_LEFT, EDGE_RIGHT
offs = TECSModel.round_length_val(@offset + y_inc)
if offs < 0 || offs > h
return
end
x_inc = 0
when EDGE_TOP, EDGE_BOTTOM
offs = TECSCDE::TECSModel.round_length_val(@offset + x_inc)
if offs < 0 || offs > w
return
end
y_inc = 0
end
@offset = offs
moved_edge(x_inc, x_inc, y_inc, y_inc)
end
end
|
#moved_edge(x_inc_l, x_inc_r, y_inc_t, y_inc_b) ⇒ Object
TmPort#moved_edge
moved cell’s edge x_inc_l::Float : left edge moved, value is incremental x_inc_r::Float : right edge moved, value is incremental y_inc_t::Float : top edge moved, value is incremental y_inc_b::Float : bottom edge moved, value is incremental
96
97
98
99
100
101
102
103
104
105
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 96
def moved_edge(x_inc_l, x_inc_r, y_inc_t, y_inc_b)
case @edge_side
when EDGE_TOP, EDGE_LEFT
moved(x_inc_l, y_inc_t)
when EDGE_BOTTOM
moved(x_inc_l, y_inc_b)
when EDGE_RIGHT
moved(x_inc_r, y_inc_t)
end
end
|
#set_position(edge_side, offset) ⇒ Object
198
199
200
201
202
203
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 198
def set_position(edge_side, offset)
modified do
@edge_side = edge_side
@offset = TECSCDE::TECSModel.round_length_val(offset)
end
end
|
#set_subscript(subscript) ⇒ Object
186
187
188
189
190
|
# File 'lib/tecscde/tecs_model/tm_port.rb', line 186
def set_subscript(subscript)
modified do
@subscript = subscript
end
end
|