22 wxPython, OGL ���Ѥ�������ݡ��ͥ�ȿ�ɽ������ 28 import wx.lib.colourdb
30 import RtmLineUtil
as lu
35 from RtmDialog
import *
44 SELECTED_COLOR =
"LIGHT BLUE" 45 UNLOADED_COLOR =
"black" 46 INACTIVE_COLOR =
"blue" 47 ACTIVE_COLOR =
"green" 54 VIRTUAL_COLOR =
"WHITE" 66 strDEL_SELECT =
"Delete Selected Item" 67 strREFRESH =
"Refresh" 68 strOPEN =
"Open System" 69 strSAVE =
"Save System" 70 strSAVE_AS =
"Save System As" 71 strDEL_SYS =
"Current System is Deleted when OPEN.\nDelete It?" 79 strDELITEM =
"Delete Item" 82 strASM_CONNECT =
"Connect" 83 strASM_DELETE =
"Delete" 86 strASKMESSAGE =
"Old Connection Information was found.\nDelete it and reconnect?" 90 strSAVE_AS_TITLE =
"Save file as ..." 92 strOPEN_TITLE =
"Open a file" 96 """�ɥ�å����ɥ��åס�����ݡ��ͥ�ȤΥĥ���̤���ƥ����ȥǡ����������륯�饹""" 98 """���饹�ν������TextDropTarget�κ�����
[����]
parent -- �ƥ��饹
log -- ���������ѥ��饹��wx.LogMessage�Υ�åѡ���
[�����]
void
102 log -- ���������ѥ��饹��wx.LogMessage�Υ�åѡ���
[�����]
void
107 wx.TextDropTarget.__init__(self)
112 """�ɥ��å�ǽ�Υ��٥�ȥϥ�ɥ� �̥�����ɥ�����Υɥ��å�����ʸ�����������
[����]
x -- �ޥ�����������Σ���ɸ
y -- �ޥ�����������Σ���ɸ
text -- �ɥ��åפ��줿ʸ����ʸ������ϥ���ݡ��ͥ��̾��
[�����]
void
113 �̥�����ɥ�����Υɥ��å�����ʸ�����������
[����]
x -- �ޥ�����������Σ���ɸ
y -- �ޥ�����������Σ���ɸ
text -- �ɥ��åפ��줿ʸ����ʸ������ϥ���ݡ��ͥ��̾��
[�����]
void
116 x -- �ޥ�����������Σ���ɸ 117 y -- �ޥ�����������Σ���ɸ 118 text -- �ɥ��åפ��줿ʸ����ʸ������ϥ���ݡ��ͥ��̾��
[�����]
void
123 self.log.WriteText(
"(%d, %d)\n%s\n" % (x, y, text))
124 canvas = self.parent.diagram.GetCanvas()
125 dc = wx.ClientDC(self.
parent)
127 self.parent.PrepareDC(dc)
130 if text
not in self.parent.rtc_dict.keys():
133 ref = self.parent.frame.myDict.GetObjRefToFullpath(text)
134 kind = self.parent.frame.myDict.GetKindToFullpath(text)
135 if ref !=
None and kind ==
'rtc':
136 self.parent.rtc_dict[text] =
GRtc(self.
parent, text, x, y)
137 self.parent.rtc_list.append(text)
138 self.parent.rtc_dict[text].refresh()
139 self.parent.remakeLines()
141 print "error: Drag Item does not obj-ref!" 143 self.parent.Redraw(dc)
146 """�ɥ�å����Ρ����٥�ȥϥ�ɥ� �ޥ����������뤬�������åȾ���褿��ƤӽФ����
[����]
x -- �ޥ�����������Σ���ɸ
y -- �ޥ�����������Σ���ɸ
d -- SHIFT or CONTROL �������Υե饰
[�����]
wxDragResult -- �ɥ�å��ξ��֤�ʥ����ƥ�ˡ������Τ���
147 �ޥ����������뤬�������åȾ���褿��ƤӽФ����
[����]
x -- �ޥ�����������Σ���ɸ
y -- �ޥ�����������Σ���ɸ
d -- SHIFT or CONTROL �������Υե饰
[�����]
wxDragResult -- �ɥ�å��ξ��֤�ʥ����ƥ�ˡ������Τ���
150 x -- �ޥ�����������Σ���ɸ 151 y -- �ޥ�����������Σ���ɸ 152 d -- SHIFT or CONTROL �������Υե饰 155 wxDragResult -- �ɥ�å��ξ��֤�ʥ����ƥ�ˡ������Τ��� 161 """����DC��BufferedDC�ˤ����ꡢ��������ؿ�
[����]
canvas -- ������
[�����]
dc -- BufferedDC
169 cdc = wx.ClientDC(canvas)
170 canvas.PrepareDC(cdc)
171 bufSize = wx.Size(1000, 1000)
172 dc = wx.BufferedDC(cdc, bufSize)
174 dc.SetBackground(wx.Brush(canvas.GetBackgroundColour()))
179 """����ݡ��ͥ�Ȥξ��֤ǿ��ο����ѹ�����ؿ�
[����]
shape -- ��(Shape)���֥�������
colorFlag -- ����ݡ��ͥ�Ȥξ��֤�ʸ����
select, unloaded, inactive, active, error, virtual
[�����]
void
182 shape -- ��(Shape)���֥������� colorFlag -- ����ݡ��ͥ�Ȥξ��֤�ʸ����
select, unloaded, inactive, active, error, virtual
[�����]
void
183 colorFlag -- ����ݡ��ͥ�Ȥξ��֤�ʸ���� select, unloaded, inactive, active, error, virtual
[�����]
void
184 select, unloaded, inactive, active, error, virtual 189 if colorFlag ==
'select':
190 shape.SetBrush(wx.Brush(wx.NamedColor(SELECTED_COLOR)))
191 elif colorFlag ==
'unloaded':
192 shape.SetBrush(wx.Brush(wx.NamedColor(UNLOADED_COLOR)))
193 elif colorFlag ==
'inactive':
194 shape.SetBrush(wx.Brush(wx.NamedColor(INACTIVE_COLOR)))
195 elif colorFlag ==
'active':
196 shape.SetBrush(wx.Brush(wx.NamedColor(ACTIVE_COLOR)))
197 elif colorFlag ==
'error':
198 shape.SetBrush(wx.Brush(wx.NamedColor(ERROR_COLOR)))
199 elif colorFlag ==
'virtual':
200 shape.SetBrush(wx.Brush(wx.NamedColor(VIRTUAL_COLOR)))
202 shape.SetBrush(wx.Brush(colorFlag))
208 """CompositeShape�Υ�åѡ����饹""" 210 """���饹�ν������CompositeShape�κ�����
[����]
parent -- �ƥ��饹�����
[�����]
void
213 parent -- �ƥ��饹�����
[�����]
void
218 ogl.CompositeShape.__init__(self)
223 """�����֤��������褹���åѡ����饹""" 225 """���饹�ν������LineShape�κ�����
[����]
parent -- �ƥ��饹�����
canvas -- ShapeCanvas���֥������Ȥ���ꡣ
[�����]
void
228 parent -- �ƥ��饹����� canvas -- ShapeCanvas���֥������Ȥ���ꡣ
[�����]
void
229 canvas -- ShapeCanvas���֥������Ȥ���ꡣ 234 ogl.LineShape.__init__(self)
236 self.SetCanvas(canvas)
237 self.SetPen(wx.Pen(wx.BLUE, 1))
239 self.MakeLineControlPoints(2)
240 diagram = canvas.GetDiagram()
241 diagram.AddShape(self)
244 """���ϡ���λ��ɸ����ꤷ�����������
[����]
startX -- �������賫�Ϥ������ɸ
startY -- �������賫�Ϥ������ɸ
endX -- �������轪λ�������ɸ
endY -- �������轪λ�������ɸ
[�����]
void
247 startX -- �������賫�Ϥ������ɸ 248 startY -- �������賫�Ϥ������ɸ 249 endX -- �������轪λ�������ɸ 250 endY -- �������轪λ�������ɸ 255 self.SetEnds(startX, startY, endX, endY)
259 """�ͳѷ������褹���åѡ����饹""" 261 """���饹�ν������Rectangle������
[����]
parent -- �ƥ��饹�����
width -- �ͳѷ�����
height -- �ͳѷ��ι⤵
[�����]
void
264 parent -- �ƥ��饹����� width -- �ͳѷ�����
height -- �ͳѷ��ι⤵
[�����]
void
265 width -- �ͳѷ����� height -- �ͳѷ��ι⤵
[�����]
void
271 ogl.RectangleShape.__init__(self,width, height)
279 """����ݡ��ȿ�(polygon)�����ѥ��饹""" 281 """���饹�ν����(PolygonShape�κ�����
[����]
parent -- �ƥ��饹�����
points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
284 parent -- �ƥ��饹����� points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
285 points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
290 ogl.PolygonShape.__init__(self)
294 self.CalculatePolygonCentre()
297 """����ݡ��ȿ�(polygon)�κ�����ʺ�ɸ�ƻ����
[����]
points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
300 points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
306 self.UpdateOriginalPoints()
307 self.CalculatePolygonCentre()
311 """�����ȥݡ��ȿ�(polygon)�����ѥ��饹""" 313 """���饹�ν����(PolygonShape�κ�����
[����]
parent -- �ƥ��饹�����
points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
316 parent -- �ƥ��饹����� points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
317 points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
322 ogl.PolygonShape.__init__(self)
326 self.CalculatePolygonCentre()
329 """�����ȥݡ��ȿ�(polygon)�κ�����ʺ�ɸ�ƻ����
[����]
points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
332 points -- ���ץ��Ϣ³����(x,��)��ɸ(wxPoints���ˤ����
[�����]
void
338 self.UpdateOriginalPoints()
339 self.CalculatePolygonCentre()
343 """�ʱ߿����������륯�饹""" 344 def __init__(self, parent, pos_x, pos_y, width, height):
345 """���饹�ν����(EllipseShape�κ�����
[����]
parent -- �ƥ��饹�����
pos_x -- ���褹�����ɸ
pos_y -- ���褹�����ɸ
width -- �ʱߤ���
height -- �ʱߤι⤵
[�����]
void
348 parent -- �ƥ��饹����� pos_x -- ���褹�����ɸ
pos_y -- ���褹�����ɸ
width -- �ʱߤ���
height -- �ʱߤι⤵
[�����]
void
351 width -- �ʱߤ��� height -- �ʱߤι⤵
[�����]
void
357 ogl.EllipseShape.__init__(self, width, height)
365 self.SetPen(wx.Pen(wx.BLACK, 1))
366 self.SetBrush(wx.Brush(
'red'))
370 """�ƥ����Ȥ��������륯�饹""" 372 """���饹�ν������TextShape�κ�����
[����]
parent -- �ƥ��饹����ꤹ��
width -- �ƥ��������襨�ꥢ����
height -- �ƥ��������襨�ꥢ�ι⤵
[�����]
void
375 parent -- �ƥ��饹����ꤹ�� width -- �ƥ��������襨�ꥢ����
height -- �ƥ��������襨�ꥢ�ι⤵
[�����]
void
376 width -- �ƥ��������襨�ꥢ���� height -- �ƥ��������襨�ꥢ�ι⤵
[�����]
void
377 height -- �ƥ��������襨�ꥢ�ι⤵ 382 ogl.TextShape.__init__(self,width, height)
387 """�ġ�����åסʥХ롼��إ�ס˿����������륯�饹""" 389 """���饹�ν�����ʥġ�����åפκ�����
[����]
parent -- �ƥ��饹����ꤹ��
pt -- �ġ�����åפ�ɽ�������ɸ��x,y�ˤΥ��ץ�ǻ���
dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
392 parent -- �ƥ��饹����ꤹ�� pt -- �ġ�����åפ�ɽ�������ɸ��x,y�ˤΥ��ץ�ǻ���
dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
393 pt -- �ġ�����åפ�ɽ�������ɸ��x,y�ˤΥ��ץ�ǻ��� dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
394 dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
406 if parent.tag ==
'in':
407 string1 = parent.inport[
'name']
408 string2 = parent.inport[
'port_type']
410 string1 = parent.outport[
'name']
411 string2 = parent.outport[
'port_type']
412 atr =
'%s\n%s'%(string1, string2)
414 tmp = max(len(string1), len(string2))
416 charW = dc.GetCharWidth()
417 charH = dc.GetCharHeight()
422 self.body.AddText(atr)
424 self.body.FormatText(dc,atr,0)
425 self.body.SetDraggable(
False,
False)
427 self.body.SetX(pt[0]+self.
x_size/2)
428 self.body.SetY(pt[1]-self.
y_size/2)
429 self.body.SetPen(wx.Pen(wx.RED, 1))
430 self.body.SetBrush(wx.Brush(wx.NamedColor(BACK_COLOR)))
433 """�ġ�����å����Х���DC�夫����
[����]
dc -- ���褵��Ƥ���ǥХ���������ƥ����Ȥ����
[�����]
void
436 dc -- ���褵��Ƥ���ǥХ���������ƥ����Ȥ����
[�����]
void
441 canvas = self.body.GetCanvas()
443 self.body.RemoveFromCanvas(canvas)
447 """���ΰ�ư�Ѥαߤ��������륯�饹""" 449 """���饹�ν�����ʱߤ������
[����]
parent -- �ƥ��饹����ꤹ��
tag -- ���̻ҡ�Ϣ��,���Ȥδط���ɽ���ե饰�ˤ����
��Ϣ�֤ϡ������Ǽ���������ź������Ϣ�����Ƥ���
pos_x -- ɽ���������ɸ�����
pos_y -- ɽ���������ɸ�����
[�����]
void
452 parent -- �ƥ��饹����ꤹ�� tag -- ���̻ҡ�Ϣ��,���Ȥδط���ɽ���ե饰�ˤ����
��Ϣ�֤ϡ������Ǽ���������ź������Ϣ�����Ƥ���
pos_x -- ɽ���������ɸ�����
pos_y -- ɽ���������ɸ�����
[�����]
void
453 tag -- ���̻ҡ�Ϣ��,���Ȥδط���ɽ���ե饰�ˤ���� ��Ϣ�֤ϡ������Ǽ���������ź������Ϣ�����Ƥ���
pos_x -- ɽ���������ɸ�����
pos_y -- ɽ���������ɸ�����
[�����]
void
454 ��Ϣ�֤ϡ������Ǽ���������ź������Ϣ�����Ƥ��� pos_x -- ɽ���������ɸ�����
pos_y -- ɽ���������ɸ�����
[�����]
void
455 pos_x -- ɽ���������ɸ����� pos_y -- ɽ���������ɸ�����
[�����]
void
456 pos_y -- ɽ���������ɸ�����
[�����]
void
479 """�ߤ��Х���DC�夫����
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
482 dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
487 canvas = self.body.GetCanvas()
489 self.body.RemoveFromCanvas(canvas)
495 dc -- ���褹��ǥХ���������ƥ����Ȥ���� d_x -- ����ɸ�����а�ư�� (endPoint.x - startPoint.x ���͡�
d_y -- ����ɸ�����а�ư�� (endPoint.y - startPoint.y ���͡�
[�����]
void
496 d_x -- ����ɸ�����а�ư�� (endPoint.x - startPoint.x ���͡� d_y -- ����ɸ�����а�ư�� (endPoint.y - startPoint.y ���͡�
[�����]
void
497 d_y -- ����ɸ�����а�ư�� (endPoint.y - startPoint.y ���͡�
[�����]
void
502 canvas = self.body.GetCanvas()
506 oval_id = oval_tag[0]
512 if oval_tag[1] ==
'oval_width_pos':
513 self.
pos_x = self.body.GetX() + d_x
514 self.
pos_y = self.body.GetY()
516 self.
pos_x = self.body.GetX()
517 self.
pos_y = self.body.GetY() + d_y
520 line.lines[oval_id].Move(dc, self.
pos_x, self.
pos_y)
521 x1,y1,x2,y2 = line.lines[oval_id].GetEnds()
522 line.changeCoordT(oval_id, (x1, y1), (x2, y2) )
527 for x
in range(1,len(line.oval_dict)+1):
528 tag = line.oval_dict[x].
getTag()
529 if oval_id != tag[0]:
530 line_pos_0 = line.coordT[x]
531 line_pos_1 = line.coordT[x+1]
533 if tag[1] ==
'oval_width_pos':
534 hight = line_pos_0[1] - line_pos_1[1]
535 pos_y = line_pos_1[1] + (hight/2)
536 pos_x = line_pos_0[0]
538 width = line_pos_0[0] - line_pos_1[0]
539 pos_x = line_pos_1[0] + (width/2)
540 pos_y = line_pos_1[1]
542 line.oval_dict[x].body.Move(dc, pos_x, pos_y)
545 """�������
[����]
�ʤ�
[�����]
tag -- ���̻ҡ�Ϣ��,���Ȥδط���ɽ���ե饰�ˤ��ֵ�
��Ϣ�֤ϡ������Ǽ���������ź������Ϣ�����Ƥ���
551 tag -- ���̻ҡ�Ϣ��,���Ȥδط���ɽ���ե饰�ˤ��ֵ� ��Ϣ�֤ϡ������Ǽ���������ź������Ϣ�����Ƥ���
552 ��Ϣ�֤ϡ������Ǽ���������ź������Ϣ�����Ƥ��� 563 canvas -- ���褹�륭���Х������ parent -- �ƥ��饹����ꤹ��
[�����]
void
564 parent -- �ƥ��饹����ꤹ��
[�����]
void
578 self.
idx =
'L' + `canvas.line_idx`
587 """��ե�å������ ���ڤӰ�ư�Ѥαߤ���������֤ˤ���
[����]
�ʤ�
[�����]
void
588 ���ڤӰ�ư�Ѥαߤ���������֤ˤ���
[����]
�ʤ�
[�����]
void
596 canvas = self.body.GetCanvas()
597 dc = wx.ClientDC(canvas)
602 """������Ӱ�ư�Ѥαߤ��Х���DC�夫��������
[����]
dc -- ���褵��Ƥ���ǥХ���������ƥ����Ȥ����
canvas -- ���褵��Ƥ��륭���Х������
[�����]
void
605 dc -- ���褵��Ƥ���ǥХ���������ƥ����Ȥ���� canvas -- ���褵��Ƥ��륭���Х������
[�����]
void
606 canvas -- ���褵��Ƥ��륭���Х������
[�����]
void
611 for x
in range(len(self.
lines)):
612 self.
lines[x].Unlink()
613 self.
lines[x].Erase(dc)
614 self.
lines[x].DeleteControlPoints()
615 self.
lines[x].RemoveFromCanvas(canvas)
621 """���κ�� ��Ϣ����Inport/Outport�ξ���(����unsubscribe)�ι���������ƤӽФ�
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
622 ��Ϣ����Inport/Outport�ξ���(����unsubscribe)�ι���������ƤӽФ� 625 dc -- ���褹��ǥХ���������ƥ����Ȥ����
[�����]
void
631 if len(self.g_inp.line_idx) == 1:
634 if len(self.g_outp.line_idx) == 1:
636 canvas = self.
lines[0].GetCanvas()
638 self.g_outp.disconnect(self.
idx)
640 if self.
g_inp !=
None:
641 self.g_inp.disconnect(self.
idx)
663 for cnt
in range(num-1):
670 for x
in range(len(self.
lines)):
673 evthandler2.SetShape(self.
lines[x])
674 evthandler2.SetPreviousHandler(self.
lines[x].GetEventHandler())
675 self.
lines[x].SetEventHandler(evthandler2)
681 startX -- ���賫�ϰ��֤Σ���ɸ 682 startY -- ���賫�ϰ��֤Σ���ɸ 683 endtX -- ���轪λ���֤Σ���ɸ 684 endtY -- ���轪λ���֤Σ���ɸ 690 lineUtil = lu.LineUtil(self, self.
g_inp, self.
g_outp, startX, startY, endX, endY)
691 self.
coordT = lineUtil.drawLine()
702 """���γ������������ʳ������ΰ�ư��
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
movex -- ����������ɸ�����а�ư��
movey -- ����������ɸ�����а�ư��
[�����]
void
705 dc -- ���褹��ǥХ���������ƥ����Ȥ���� movex -- ����������ɸ�����а�ư��
movey -- ����������ɸ�����а�ư��
[�����]
void
706 movex -- ����������ɸ�����а�ư�� 707 movey -- ����������ɸ�����а�ư�� 712 canvas = self.
lines[0].GetCanvas()
714 for x
in range(len(self.
lines)):
715 self.
lines[x].Erase(dc)
716 self.
lines[x].RemoveFromCanvas(canvas)
725 for x
in range(len(self.
lines)):
726 self.
lines[x].Show(
True)
729 """���ν�λ���������ʽ�λ���ΰ�ư��
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
movex -- ��λ������ɸ�����а�ư��
movey -- ��λ������ɸ�����а�ư��
[�����]
void
732 dc -- ���褹��ǥХ���������ƥ����Ȥ���� movex -- ��λ������ɸ�����а�ư��
movey -- ��λ������ɸ�����а�ư��
[�����]
void
733 movex -- ��λ������ɸ�����а�ư�� 734 movey -- ��λ������ɸ�����а�ư�� 739 canvas = self.
lines[0].GetCanvas()
741 for x
in range(len(self.
lines)):
742 self.
lines[x].Erase(dc)
743 self.
lines[x].RemoveFromCanvas(canvas)
752 for x
in range(len(self.
lines)):
753 self.
lines[x].Show(
True)
756 """������������ʿ����ѹ���
[����]
�ʤ�
[�����]
void
764 for x
in range(len(self.
lines)):
765 self.
lines[x].SetBrush(wx.Brush(wx.NamedColor(SELECTED_COLOR)))
766 self.
lines[x].SetPen(wx.Pen(SELECTED_COLOR, 1))
767 self.
lines[x].Flash()
770 """���������������ʿ����ѹ�����ư�Ѥαߤ�����
[����]
�ʤ�
[�����]
void
778 for x
in range(len(self.
lines)):
779 self.
lines[x].SetPen(wx.Pen(INACTIVE_COLOR, 1))
780 self.
lines[x].SetBrush(wx.Brush(wx.NamedColor(INACTIVE_COLOR)))
781 self.
lines[x].Flash()
786 """��ư�����Υ��ߡ��롼����
[����]
dc -- DC�����
movex -- ��ư�������е�Υ
movey -- ��ư�������е�Υ
[�����]
void
789 dc -- DC����� movex -- ��ư�������е�Υ
movey -- ��ư�������е�Υ
[�����]
void
790 movex -- ��ư�������е�Υ 791 movey -- ��ư�������е�Υ 800 ����������ĤΥݡ��Ȥ餫������ꤷ�ܥ�åɤ�ƤӽФ��� 801 canvas.lineTo, canvas.lineFrom �˥ݡ��Ȥ����ꤷ�Ƥ����� 804 canvas -- �������褹�륭���Х������ dc -- �������褹��DC�����
[�����]
void
805 dc -- �������褹��DC�����
[�����]
void
811 ref = canvas.lineTo.parent.ns_dict.GetObjRefToFullpath(canvas.lineTo.parent.fullpath)
814 if canvas.lineFrom.parent.tag ==
'in':
815 self.g_inp = canvas.lineFrom.parent
816 self.g_outp = canvas.lineTo.parent
818 self.g_inp = canvas.lineTo.parent
819 self.g_outp = canvas.lineFrom.parent
821 self.setPoints(self.g_inp.body.GetX(), self.g_inp.body.GetY(), self.g_outp.body.GetX(), self.g_outp.body.GetY())
822 for x
in range(len(self.lines)):
823 evthandler2 = MyEvtHandlerLine()
824 evthandler2.SetShape(self.lines[x])
825 evthandler2.SetPreviousHandler(self.lines[x].GetEventHandler())
826 self.lines[x].SetEventHandler(evthandler2)
829 canvas.line[self.idx] = self
830 self.g_inp.connect(self.idx)
831 canvas.line_idx = canvas.line_idx + 1
832 for x
in range(len(self.lines)):
833 self.lines[x].Show(
True)
835 self.g_inp.body.Move(dc, self.g_inp.body.GetX(), self.g_inp.body.GetY())
836 self.g_outp.body.Move(dc, self.g_outp.body.GetX(), self.g_outp.body.GetY())
841 """����ư���˰�ư�������κ�ɸ�������
[����]
id -- ��ɸ������ꤹ�볫�ϥ���ǥå�����ź������
new_p1 -- ��������ɸ��x,y�ˤγ������ץ�ǻ���
new_p2 -- ��������ɸ��x,y�ˤν�λ���ץ�ǻ���
[�����]
void
844 id -- ��ɸ������ꤹ�볫�ϥ���ǥå�����ź������ new_p1 -- ��������ɸ��x,y�ˤγ������ץ�ǻ���
new_p2 -- ��������ɸ��x,y�ˤν�λ���ץ�ǻ���
[�����]
void
845 new_p1 -- ��������ɸ��x,y�ˤγ������ץ�ǻ��� new_p2 -- ��������ɸ��x,y�ˤν�λ���ץ�ǻ���
[�����]
void
846 new_p2 -- ��������ɸ��x,y�ˤν�λ���ץ�ǻ���
[�����]
void
852 self.
coordT[id+1] = new_p2
855 for cnt
in range(num-1):
862 dc -- ���褹��ǥХ���������ƥ����Ȥ���� pos_new -- ��ư��κ�ɸ�ꥹ��
[�����]
void
863 pos_new -- ��ư��κ�ɸ�ꥹ��
[�����]
void
870 max_num = len(pos_new)
875 for cnt
in range(max_num-1):
880 """����ݡ��ȿ���������륯�饹""" 881 def __init__(self, parent, ns_dict, fullpath, inp, pos_x, pos_y):
882 """���饹�ν�����ʥ���ݡ��ȿ��κ�����
[����]
parent -- �ƥ��饹����ꤹ��
ns_data -- ����ݡ��ͥ�ȤΥǥ�������ʥ
inp -- ����ݡ��ȤΥǥ�������ʥ(in_list[n])
pos_x -- ����ݡ��ȿ��Σ���ɸ
pos_y -- ����ݡ��ȿ��Σ���ɸ
[�����]
void
885 parent -- �ƥ��饹����ꤹ�� ns_data -- ����ݡ��ͥ�ȤΥǥ�������ʥ
inp -- ����ݡ��ȤΥǥ�������ʥ(in_list[n])
pos_x -- ����ݡ��ȿ��Σ���ɸ
pos_y -- ����ݡ��ȿ��Σ���ɸ
[�����]
void
886 ns_data -- ����ݡ��ͥ�ȤΥǥ�������ʥ 887 inp -- ����ݡ��ȤΥǥ�������ʥ(in_list[n]) 888 pos_x -- ����ݡ��ȿ��Σ���ɸ 889 pos_y -- ����ݡ��ȿ��Σ���ɸ 894 ogl.Shape.__init__(self)
912 """x,y��ɸ�⤷����position���������
[����]
name -- �����������ͤΥե饰����ꤹ��
�ե饰�� 915 name -- �����������ͤΥե饰����ꤹ�� �ե饰�� 916 �ե饰��'x', 'y', 'position' 925 elif name ==
'position' :
931 """����ݡ��ȿ����Х���DC�夫��������
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ�
0:������ / 1:���������ʤ�
[�����]
void
934 dc -- ���褹��ǥХ���������ƥ����Ȥ���� rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ�
0:������ / 1:���������ʤ�
[�����]
void
935 rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ� 0:������ / 1:���������ʤ�
[�����]
void
936 0:������ / 1:���������ʤ� 941 canvas = self.body.GetCanvas()
943 self.body.RemoveFromCanvas(canvas)
947 line_list = copy.deepcopy(self.
line_idx)
948 for idx
in line_list:
950 if idx
in canvas.line.keys():
955 """����ݡ��ȿ�����������
[����]
�ʤ�
[�����]
void
969 self.parent.parent.MyAddShape(
970 self.
body, self.
x+POLYGON_SIZE/2-1, self.
y+POLYGON_SIZE/2-1, wx.Pen(OUTLINE_COLOR, 1), wx.Brush(self.
color, wx.SOLID),
"" , 1)
974 ����ݡ��Ȥ˳���դ����Ƥ�������Ʊ���˰�ư������
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
movex -- ����ɸ�����а�ư�̤����
movey -- ����ɸ�����а�ư�̤����
[�����]
void
977 dc -- ���褹��ǥХ���������ƥ����Ȥ���� movex -- ����ɸ�����а�ư�̤����
movey -- ����ɸ�����а�ư�̤����
[�����]
void
978 movex -- ����ɸ�����а�ư�̤���� movey -- ����ɸ�����а�ư�̤����
[�����]
void
979 movey -- ����ɸ�����а�ư�̤����
[�����]
void
984 canvas = self.body.GetCanvas()
988 self.
x = self.body.GetX() + movex
989 self.
y = self.body.GetY() + movey
990 self.body.Move(dc, self.
x, self.
y)
994 canvas.line[line_index].setStartPoint(dc, movex, movey)
997 """����ݡ��Ȥ˳���դ������Υ���ǥå�����������
[����]
idx -- ���Υ���ǥå���
[�����]
void
1006 tmp = self.line_idx.index(idx)
1010 """����ݡ��Ȥ�������֤ˤ���
[����]
�ʤ�
[�����]
void
1018 self.body.SetBrush(wx.Brush(wx.NamedColor(SELECTED_COLOR)))
1022 """����ݡ��Ȥ���������֤ˤ���
[����]
�ʤ�
[�����]
void
1030 self.body.SetBrush(wx.Brush(wx.NamedColor(self.
color)))
1034 """����ݡ��ȿ��Υ������ѹ� 1037 x -- �������ѹ���Σ���ɸ����� y -- �������ѹ���Σ���ɸ�����
ratioW -- �������ѹ���Ԥ�Width�Υ�������Ψ
ratioH -- �������ѹ���Ԥ�Height�Υ�������Ψ
[�����]
void
1038 y -- �������ѹ���Σ���ɸ����� ratioW -- �������ѹ���Ԥ�Width�Υ�������Ψ
ratioH -- �������ѹ���Ԥ�Height�Υ�������Ψ
[�����]
void
1039 ratioW -- �������ѹ���Ԥ�Width�Υ�������Ψ 1040 ratioH -- �������ѹ���Ԥ�Height�Υ�������Ψ 1045 movex = x - self.body.GetX()
1046 movey = y - self.body.GetY()
1050 if self.parent.xy_swap == 1:
1051 self.
y_size, self.
x_size = self.body.GetBoundingBoxMin()
1052 self.parent.py_size, self.parent.px_size = self.parent.px_size, self.parent.py_size
1054 self.
x_size, self.
y_size = self.body.GetBoundingBoxMin()
1057 self.parent.px_size = self.
x_size 1058 self.parent.py_size = self.
y_size 1059 canvas = self.body.GetCanvas()
1060 dc = wx.ClientDC(canvas)
1061 canvas.PrepareDC(dc)
1062 brush = self.body.GetBrush()
1065 self.body.RemoveFromCanvas(canvas)
1068 self.body.updateInportPolygon(self.
points)
1070 self.parent.parent.MyAddShape(
1071 self.
body, self.
x , self.
y,
1072 wx.Pen(OUTLINE_COLOR, 1), brush,
"" , 1)
1076 canvas.line[line_index].setStartPoint(dc, movex, movey)
1079 """���ͥ��Ƚ���(���Υ���ǥå������Ǽ��
[����]
line_idx -- ����ݡ��Ȥ���³�������Υ���ǥå���
[�����]
���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵���� / 1:����
1082 line_idx -- ����ݡ��Ȥ���³�������Υ���ǥå��� 1085 ���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵���� / 1:���� 1087 ref = self.ns_dict.GetObjRefToFullpath(self.
fullpath)
1091 self.line_idx.append(line_idx)
1095 """�ǥ������ͥ��Ƚ���(���Υ���ǥå���������
[����]
line_idx -- ����ݡ��Ȥ���³���Ƥ������Υ���ǥå���
[�����]
���ݥե饰 -- 0:���顼 / 1:����
1098 line_idx -- ����ݡ��Ȥ���³���Ƥ������Υ���ǥå��� 1101 ���ݥե饰 -- 0:���顼 / 1:���� 1110 """����ݡ��ȿ��κ�ɸ���� 1111 ���ߤ�position�ƿ��θ�������ꤹ�� ��ĺ����(x,y)�Υ��ץ����
[����]
�ʤ�
[�����]
void
1112 ��ĺ����(x,y)�Υ��ץ���� 1155 """�����ȥݡ��ȿ���������륯�饹""" 1156 def __init__(self, parent, ns_dict, fullpath, outp, pos_x, pos_y) :
1157 """���饹�ν�����ʥ����ȥݡ��ȿ��κ�����
[����]
parent -- �ƥ��饹����ꤹ��
ns_data -- ����ݡ��ͥ�ȤΥǥ�������ʥ
inp -- ����ݡ��ȤΥǥ�������ʥ(in_list[n])
pos_x -- ����ݡ��ȿ��Σ���ɸ
pos_y -- ����ݡ��ȿ��Σ���ɸ
[�����]
void
1160 parent -- �ƥ��饹����ꤹ�� ns_data -- ����ݡ��ͥ�ȤΥǥ�������ʥ
inp -- ����ݡ��ȤΥǥ�������ʥ(in_list[n])
pos_x -- ����ݡ��ȿ��Σ���ɸ
pos_y -- ����ݡ��ȿ��Σ���ɸ
[�����]
void
1161 ns_data -- ����ݡ��ͥ�ȤΥǥ�������ʥ 1162 inp -- ����ݡ��ȤΥǥ�������ʥ(in_list[n]) 1163 pos_x -- ����ݡ��ȿ��Σ���ɸ 1164 pos_y -- ����ݡ��ȿ��Σ���ɸ 1169 ogl.Shape.__init__(self)
1189 """��ե�å������ ���ߤ���³������Inport�Υ��֥������ȥ�ե����¸�ߤ��뤫���ˤ�
�����å�������³���֤��³�⤷����unsubscribe��¹Ԥ���
[����]
�ʤ�
[�����]
void
1190 ���ߤ���³������Inport�Υ��֥������ȥ�ե����¸�ߤ��뤫���ˤ� �����å�������³���֤��³�⤷����unsubscribe��¹Ԥ���
[����]
�ʤ�
[�����]
void
1191 �����å�������³���֤��³�⤷����unsubscribe��¹Ԥ���
[����]
�ʤ�
[�����]
void
1199 canvas = self.body.GetCanvas()
1200 if canvas.viewMode ==
True:
1203 dc = wx.ClientDC(canvas)
1204 canvas.PrepareDC(dc)
1210 for inp
in self.parent.in_list :
1211 if inp[
'name'] == canvas.line[idx].g_inp.inport[
'name']:
1212 canvas.line[idx].g_inp.inport = inp
1215 ref = canvas.line[idx].g_inp.inport[
'ref']
1216 ref = ref._narrow(RTM.InPort)
1218 except_mess(
'inport object-ref failure:%s\n'%inp[
'name'])
1222 ref = ref._narrow(RTM.OutPort)
1223 rslt = ref.unsubscribe(self.
uuid[idx])
1224 print "refresh:unsubscribe:",rslt
1226 print 'unsubscribe failure: rslt=',rslt
1231 """x,y��ɸ�⤷����position���������
[����]
name -- �����������ͤΥե饰����ꤹ��
�ե饰�� 1234 name -- �����������ͤΥե饰����ꤹ�� �ե饰�� 1235 �ե饰��'x', 'y', 'position' 1244 elif name ==
'position' :
1250 """�����ȥݡ��ȿ���������
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ�
0:������ / 1:���������ʤ�
[�����]
void
1253 dc -- ���褹��ǥХ���������ƥ����Ȥ���� rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ�
0:������ / 1:���������ʤ�
[�����]
void
1254 rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ� 0:������ / 1:���������ʤ�
[�����]
void
1255 0:������ / 1:���������ʤ� 1260 canvas = self.body.GetCanvas()
1262 self.body.RemoveFromCanvas(canvas)
1266 line_list = copy.deepcopy(self.
line_idx)
1267 for idx
in line_list:
1269 if idx
in canvas.line.keys():
1270 del canvas.line[idx]
1274 """�����ȥݡ��ȿ����������
[����]
�ʤ�
[�����]
void
1288 self.parent.parent.MyAddShape(
1289 self.
body, self.
x+POLYGON_SIZE/2-1, self.
y+POLYGON_SIZE/2-1, wx.Pen(OUTLINE_COLOR, 1), wx.Brush(self.
color, wx.SOLID),
"",1)
1293 �����ȥݡ��Ȥ˳���դ����Ƥ�������Ʊ���˰�ư������
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
movex -- ����ɸ�����а�ư�̤����
movey -- ����ɸ�����а�ư�̤����
[�����]
void
1296 dc -- ���褹��ǥХ���������ƥ����Ȥ���� movex -- ����ɸ�����а�ư�̤����
movey -- ����ɸ�����а�ư�̤����
[�����]
void
1297 movex -- ����ɸ�����а�ư�̤���� movey -- ����ɸ�����а�ư�̤����
[�����]
void
1298 movey -- ����ɸ�����а�ư�̤����
[�����]
void
1303 canvas = self.body.GetCanvas()
1304 canvas.PrepareDC(dc)
1306 self.
x = self.body.GetX() + movex
1307 self.
y = self.body.GetY() + movey
1309 self.body.Move(dc, self.
x, self.
y)
1314 canvas.line[line_index].setEndPoint(dc, self.
body,movex, movey)
1318 """�����ȥݡ��Ȥ˳���դ������Υ���ǥå�����������
[����]
idx -- ���Υ���ǥå���
[�����]
void
1327 tmp = self.line_idx.index(idx)
1331 """�����ȥݡ��Ȥ�������֤ˤ���
[����]
�ʤ�
[�����]
void
1339 self.body.SetBrush(wx.Brush(wx.NamedColor(SELECTED_COLOR)))
1343 """�����ȥݡ��Ȥ���������֤ˤ���
[����]
�ʤ�
[�����]
void
1351 self.body.SetBrush(wx.Brush(wx.NamedColor(self.
color)))
1355 """�����ȥݡ��ȿ��Υ������ѹ� 1358 x -- �������ѹ���Σ���ɸ����� y -- �������ѹ���Σ���ɸ�����
ratioW -- �ѹ���Ԥ�Width�Υ�������Ψ
ratioH -- �ѹ���Ԥ�Height�Υ�������Ψ
[�����]
void
1359 y -- �������ѹ���Σ���ɸ����� ratioW -- �ѹ���Ԥ�Width�Υ�������Ψ
ratioH -- �ѹ���Ԥ�Height�Υ�������Ψ
[�����]
void
1360 ratioW -- �ѹ���Ԥ�Width�Υ�������Ψ 1361 ratioH -- �ѹ���Ԥ�Height�Υ�������Ψ 1366 movex = x - self.body.GetX()
1367 movey = y - self.body.GetY()
1371 if self.parent.xy_swap == 1:
1372 self.
y_size, self.
x_size = self.body.GetBoundingBoxMin()
1373 self.parent.py_size, self.parent.px_size = self.parent.px_size, self.parent.py_size
1375 self.
x_size, self.
y_size = self.body.GetBoundingBoxMin()
1377 self.parent.px_size = self.
x_size 1378 self.parent.py_size = self.
y_size 1379 canvas = self.body.GetCanvas()
1380 dc = wx.ClientDC(canvas)
1381 canvas.PrepareDC(dc)
1382 brush = self.body.GetBrush()
1385 self.body.RemoveFromCanvas(canvas)
1388 self.body.updateOutportPolygon(self.
points)
1390 self.parent.parent.MyAddShape(
1391 self.
body, self.
x , self.
y,
1392 wx.Pen(OUTLINE_COLOR, 1), brush,
"" , 1)
1396 canvas.line[line_index].setEndPoint(dc, self.
body,movex, movey)
1399 """���ͥ��Ƚ���(subscribe��ȯ�ԡ�
[����]
line_idx -- ����ݡ��Ȥ���³�������Υ���ǥå���
subscription_type -- ���֥�����ץ�������פ����ʸ���̤���ѡ�
[�����]
���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵��,subscribe���ԡ� / 1:����
1402 line_idx -- ����ݡ��Ȥ���³�������Υ���ǥå��� 1403 subscription_type -- ���֥�����ץ�������פ����ʸ���̤���ѡ�
[�����]
���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵��,subscribe���ԡ� / 1:����
1406 ���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵��,subscribe���ԡ� / 1:���� 1408 canvas = self.body.GetCanvas()
1415 ref = ref._narrow(RTM.OutPort)
1421 inp_ref = canvas.line[line_idx].g_inp.inport[
'ref']
1423 inp_ref = inp_ref._narrow(RTM.InPort)
1429 subscription_list = []
1431 subscription_list = ref._get_subscriptions()
1432 if subscription_list ==
None:
1433 print "get subscriptions failure: return value is None." 1439 connect_num = self.
checkConnect(inp_ref, subscription_list)
1441 if canvas.viewMode ==
False:
1442 if connect_num == -1:
1444 canvas.line[line_idx].subscription_type = subscription_type
1445 canvas.line[line_idx].profile = RTM.SubscriptionProfile(subscription_type,
"",
None,
None,
False,[])
1446 canvas.line[line_idx].profile.out_port = ref
1447 canvas.line[line_idx].profile.in_port = inp_ref
1448 rslt, canvas.line[line_idx].profile = ref.subscribe(canvas.line[line_idx].profile)
1449 self.
uuid[line_idx] = canvas.line[line_idx].profile.id
1452 print "subscribe failure!" 1455 print "connect2 subscribe :",self.
uuid[line_idx]
1459 self.
uuid[line_idx] = subscription_list[connect_num].id
1463 """���ͥ��Ƚ���(���Υ���ǥå������Ǽ��subscribe��ȯ�ԡ�
[����]
line_idx -- ����ݡ��Ȥ���³�������Υ���ǥå���
subscription_type -- ���֥�����ץ�������פ����ʸ���̤���ѡ�
[�����]
���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵��,subscribe���ԡ� / 1:����
1466 line_idx -- ����ݡ��Ȥ���³�������Υ���ǥå��� 1467 subscription_type -- ���֥�����ץ�������פ����ʸ���̤���ѡ�
[�����]
���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵��,subscribe���ԡ� / 1:����
1470 ���ݥե饰 -- 0:���顼(���֥������ȥ�ե����̵��,subscribe���ԡ� / 1:���� 1472 canvas = self.body.GetCanvas()
1479 ref = ref._narrow(RTM.OutPort)
1483 self.parent.refresh()
1489 inp_ref = canvas.line[line_idx].g_inp.inport[
'ref']
1491 inp_ref = inp_ref._narrow(RTM.InPort)
1497 subscription_list = []
1499 subscription_list = ref._get_subscriptions()
1500 if subscription_list ==
None:
1501 print "get subscriptions failure: return value is None." 1507 canvas.line[line_idx].subscription_type = subscription_type
1508 canvas.line[line_idx].profile = RTM.SubscriptionProfile(subscription_type,
"",
None,
None,
False,[])
1511 connect_num = self.
checkConnect(inp_ref, subscription_list)
1517 if canvas.viewMode ==
False:
1518 if connect_num == -1:
1520 canvas.line[line_idx].profile.out_port = ref
1521 canvas.line[line_idx].profile.in_port = inp_ref
1522 (rslt, canvas.line[line_idx].profile) = ref.subscribe(canvas.line[line_idx].profile)
1524 print "subscribe failuer! :rslt=",rslt
1525 self.
uuid[line_idx] = canvas.line[line_idx].profile.id
1526 print "connect subscribe :",self.
uuid[line_idx]
1528 err_mess =
'subscribe failure! :' 1533 self.
uuid[line_idx] = subscription_list[connect_num].id
1536 print "subsrcibe-rslt:",rslt
1539 self.line_idx.append(line_idx)
1544 """�ǥ������ͥ��Ƚ���(���Υ���ǥå���������unsubscribe��ȯ�ԡ�
[����]
line_idx -- �����ȥݡ��Ȥ���³���Ƥ������Υ���ǥå���
[�����]
���ݥե饰 -- 0:���顼 / 1:����
1547 line_idx -- �����ȥݡ��Ȥ���³���Ƥ������Υ���ǥå��� 1550 ���ݥե饰 -- 0:���顼 / 1:���� 1555 canvas = self.body.GetCanvas()
1561 ref = ref._narrow(RTM.OutPort)
1563 inp_obj = canvas.line[line_idx].g_inp.inport[
'ref']
1566 subscription_list = []
1567 subscription_list = ref._get_subscriptions()
1568 if subscription_list ==
None:
1569 print "get subscriptions failure: return value is None." 1572 connect_num = self.
checkConnect(inp_obj, subscription_list)
1578 err_mess =
'outport disconnect failure:' 1581 self.parent.refresh()
1586 if ref !=
None and canvas.viewMode ==
False and connect_num != -1:
1588 print "unsubscribe :",self.
uuid[line_idx]
1589 rslt = ref.unsubscribe(self.
uuid[line_idx])
1591 print 'unsubscribe failure: rslt=',rslt
1593 err_mess =
'unsubscribe failure:' 1605 """����³���� ���֥������Ⱦ������¸�ߤ�����³����(subscribe)�����������
[����]
�ʤ�
[�����]
void
1606 ���֥������Ⱦ������¸�ߤ�����³����(subscribe)����������� 1618 canvas = self.body.GetCanvas()
1619 dc = wx.ClientDC(canvas)
1620 canvas.PrepareDC(dc)
1624 ref = ref._narrow(RTM.OutPort)
1626 err_mess =
'outport obj-ref failure:' 1631 subscription_list = []
1632 subscr_list_tmp = []
1634 subscription_list = ref._get_subscriptions()
1635 subscr_list_tmp = copy.deepcopy(subscription_list)
1636 if subscription_list ==
None:
1637 print "get subscriptions failure: return value is None." 1644 line = canvas.line[line_idx]
1645 (ret2,subscr_list_tmp) = self.
checkConnect2(line,subscr_list_tmp)
1647 rtc_list = self.parent.parent.rtc_list
1648 rtc_dict = self.parent.parent.rtc_dict
1653 for subscr
in subscr_list_tmp:
1654 inp_ref = subscr.in_port
1655 for fullname
in rtc_list:
1656 in_list = rtc_dict[fullname].in_list
1657 in_dict = rtc_dict[fullname].in_dict
1660 if inp[
'name']
in in_dict.keys():
1661 ref = in_dict[inp[
'name']].inport[
'ref']
1662 if inp_ref._is_equivalent(ref):
1663 print "_is_equivalent is OK!!!" 1664 ret_name.append( inp[
'name'] )
1665 ret_obj.append( in_dict[inp[
'name']] )
1666 ret_ref.append(inp_ref)
1668 for num
in range(len(ret_name)):
1669 canvas.lineFrom = self.
body 1670 canvas.lineTo = ret_obj[num].body
1672 line.setLine2port(canvas, dc)
1674 self.line_idx.append(line.idx)
1676 connect_num = self.
checkConnect(ret_ref[num], subscription_list)
1678 self.
uuid[line.idx] = subscription_list[connect_num].id
1680 canvas.lineFrom =
None 1681 canvas.lineTo =
None 1686 """�Ť���³�����뤫�����å����� ���̾�����ʳ�����³�����֥������Ⱦ�ˤ��뤫�����å�����
[����]
�ʤ�
[�����]
ret --- True:���� / False:�ʤ�
1687 ���̾�����ʳ�����³�����֥������Ⱦ�ˤ��뤫�����å�����
[����]
�ʤ�
[�����]
ret --- True:���� / False:�ʤ�
1693 ret --- True:���� / False:�ʤ� 1696 canvas = self.body.GetCanvas()
1699 ref = ref._narrow(RTM.OutPort)
1701 err_mess =
'outport obj-ref failure:' 1706 subscription_list = []
1708 subscription_list = ref._get_subscriptions()
1709 if subscription_list ==
None:
1710 print "get subscriptions failure: return value is None." 1717 line = canvas.line[line_idx]
1718 (ret2,subscription_list) = self.
checkConnect2(line,subscription_list)
1719 if len(subscription_list) > 0:
1725 ���ꤷ����³���inport�ˤΥ�ե�������뤫�����å�����
[����]
inp_obj --- ����ݡ��ȤΥ��֥������ȡ���ե����
ref_list --- ����ݡ��ȤΥ�ե�����ꥹ��
[�����]
ret_num --- subScription_list ��ź����/�ʤ�����-1
1728 inp_obj --- ����ݡ��ȤΥ��֥������ȡ���ե���� 1729 ref_list --- ����ݡ��ȤΥ�ե�����ꥹ��
[�����]
ret_num --- subScription_list ��ź����/�ʤ�����-1
1732 ret_num --- subScription_list ��ź����/�ʤ�����-1 1736 for subscr
in subscr_list:
1737 ref_inp = subscr.in_port
1738 if ref_inp._is_equivalent(inp_obj):
1739 print "checkConnect: _is_equivalent is OK!!!" 1742 ret_num = ret_num + 1
1749 �����å��оݤ���³�����ä����ϡ��ꥹ�Ⱦ夫���������ֵѤ��� �Ť������뤫Ĵ�٤�٤˸ƤФ��
[����]
line --- ���Υ��֥�������
ref_list --- ��³���inport�ˤΥ��֥������ȥ�ե�����ꥹ��
[�����]
(ret, ref_list) --- ret 0:�ʤ� / 1:���� , ref_list: �Ĥ�Υ�ե���ꥹ��
1750 �Ť������뤫Ĵ�٤�٤˸ƤФ��
[����]
line --- ���Υ��֥�������
ref_list --- ��³���inport�ˤΥ��֥������ȥ�ե�����ꥹ��
[�����]
(ret, ref_list) --- ret 0:�ʤ� / 1:���� , ref_list: �Ĥ�Υ�ե���ꥹ��
1753 line --- ���Υ��֥������� ref_list --- ��³���inport�ˤΥ��֥������ȥ�ե�����ꥹ��
[�����]
(ret, ref_list) --- ret 0:�ʤ� / 1:���� , ref_list: �Ĥ�Υ�ե���ꥹ��
1754 ref_list --- ��³���inport�ˤΥ��֥������ȥ�ե�����ꥹ��
[�����]
(ret, ref_list) --- ret 0:�ʤ� / 1:���� , ref_list: �Ĥ�Υ�ե���ꥹ��
1757 (ret, ref_list) --- ret 0:�ʤ� / 1:���� , ref_list: �Ĥ�Υ�ե���ꥹ�� 1760 inp_obj = line.g_inp.inport[
'ref']
1764 for subscr
in subscr_list:
1765 ref_inp = subscr.in_port
1766 if ref_inp._is_equivalent(inp_obj):
1772 del subscr_list[cnt]
1774 return (ret, subscr_list)
1777 """����ݡ��ͥ�Ⱦ����³�����subscribe�ˤ�������
[����]
inp_list --- ��³���subscriptionProfile�ˤΥꥹ��
[�����]
void
1780 inp_list --- ��³���subscriptionProfile�ˤΥꥹ��
[�����]
void
1790 canvas = self.body.GetCanvas()
1792 ref = ref._narrow(RTM.OutPort)
1794 for subscr
in subscr_list:
1795 inp = subscr.in_port
1799 uuid = subscr_list[connect_num].id
1801 if ref !=
None and canvas.viewMode ==
False:
1803 print "unsubscribe2 :",uuid
1804 rslt = ref.unsubscribe(uuid)
1806 print 'unsubscribe2 failure: rslt=',rslt
1808 err_mess =
'unsubscribe failure:' 1813 """����³����
[����]
�ʤ�
[�����]
void
1825 canvas = self.body.GetCanvas()
1828 ref = ref._narrow(RTM.OutPort)
1830 err_mess =
'outport obj-ref failure:' 1835 subscription_list = []
1836 subscr_list_tmp = []
1838 subscription_list = ref._get_subscriptions()
1839 subscr_list_tmp = copy.deepcopy(subscription_list)
1840 if subscription_list ==
None:
1841 print "get subscriptions failure: return value is None." 1848 line = canvas.line[line_idx]
1849 (ret,subscr_list_tmp) = self.
checkConnect2(line,subscr_list_tmp)
1851 self.
connect2(line_idx,line.subscription_type)
1854 inp_ref = canvas.line[line_idx].g_inp.inport[
'ref']
1855 connect_num = self.
checkConnect(inp_ref, subscription_list)
1856 self.
uuid[line_idx] = subscription_list[connect_num].id
1860 line = canvas.line[line_idx]
1861 (ret,subscr_list_tmp) = self.
checkConnect2(line,subscr_list_tmp)
1863 self.
connect2(line_idx,line.subscription_type)
1864 if len(subscr_list_tmp) > 0:
1869 """�����ȥݡ��ȿ��κ�ɸ���� 1870 ���ߤ�position�ƿ��θ�������ꤹ�� ��ĺ����(x,y)�Υ��ץ����
[����]
�ʤ�
[�����]
void
1871 ��ĺ����(x,y)�Υ��ץ���� 1910 """����ݡ��ͥ�ȿ������Τ�������륯�饹""" 1912 """���饹�ν�����ʥ���ݡ��ͥ�ȿ��κ�����
[����]
parent -- �ƥ��饹����ꤹ��
fullpath -- ����ݡ��ͥ�ȤΥ��͡���
pos_x -- ����ݡ��ͥ�ȿ��Σ���ɸ
pos_y -- ����ݡ��ͥ�ȿ��Σ���ɸ
[�����]
void
1915 parent -- �ƥ��饹����ꤹ�� fullpath -- ����ݡ��ͥ�ȤΥ��͡���
pos_x -- ����ݡ��ͥ�ȿ��Σ���ɸ
pos_y -- ����ݡ��ͥ�ȿ��Σ���ɸ
[�����]
void
1916 fullpath -- ����ݡ��ͥ�ȤΥ��͡��� pos_x -- ����ݡ��ͥ�ȿ��Σ���ɸ
pos_y -- ����ݡ��ͥ�ȿ��Σ���ɸ
[�����]
void
1917 pos_x -- ����ݡ��ͥ�ȿ��Σ���ɸ 1918 pos_y -- ����ݡ��ͥ�ȿ��Σ���ɸ 1923 ogl.Shape.__init__(self)
1928 self.
name = self.ns_dict.GetCompName(fullpath)
1929 self.
in_list = self.ns_dict.GetInPortToRef(fullpath)
1964 if outp[
'name']
in self.out_dict.keys():
1968 """�Ť���³����ʲ��̾��ɽ������Ƥ��ʤ�subscribe����ˤ�����å�����
[����]
�ʤ�
[�����]
ret --- True:�Ť����� / False:�Ť�����ʤ�
1974 ret --- True:�Ť����� / False:�Ť�����ʤ� 1978 if outp[
'name']
in self.out_dict.keys():
1985 """����³���� ����ݡ��ͥ�ȤΥ����ȥݡ��Ȥκ���³������ƤӽФ�
[����]
�ʤ�
[�����]
void
1986 ����ݡ��ͥ�ȤΥ����ȥݡ��Ȥκ���³������ƤӽФ� 1995 if outp[
'name']
in self.out_dict.keys():
1999 """�ݡ���(Shape)��Flash�ʺ����衩�ˤ�ƤӽФ� 2000 ����ݡ��ͥ�Ȥγ��β��˥ݡ��Ȥγ����⤰����ॱ�����λ��˸ƤӽФ��Ƥ��롣�ʲ������ ¾���ɤ�����������С������������ѹ�����
[����]
�ʤ�
[�����]
void
2001 ¾���ɤ�����������С������������ѹ�����
[����]
�ʤ�
[�����]
void
2010 if inp[
'name']
in self.in_dict.keys():
2011 self.
in_dict[inp[
'name']].body.Flash()
2013 if outp[
'name']
in self.out_dict.keys():
2014 self.
out_dict[outp[
'name']].body.Flash()
2017 """����ݡ��ͥ�ȤΥ��ơ�����������å�����
[����]
�ʤ�
[�����]
void
2027 canvas = self.body.GetCanvas()
2028 tmp = self.ns_dict.GetCompState(self.
fullpath)
2029 if tmp == RTM.RTComponent.RTC_STARTING
or tmp == RTM.RTComponent.RTC_ACTIVE:
2031 elif tmp == RTM.RTComponent.RTC_READY
or tmp == RTM.RTComponent.RTC_STOPPING:
2033 elif tmp >= RTM.RTComponent.RTC_ABORTING :
2037 if canvas.viewMode ==
True and state !=
'unloaded':
2043 """����ݡ��ͥ�Ȥ�start̿���ȯ��
[����]
�ʤ�
[�����]
void
2052 ref = self.ns_dict.GetObjRefToFullpath(self.
fullpath)
2053 ref = ref._narrow(RTM.RTCBase)
2056 err_mess =
'rtc_start error:%s\n'%self.
fullpath 2061 self.ns_dict.setCompBodyColor(self.
fullpath,
'active')
2062 self.
state =
'active' 2066 """����ݡ��ͥ�Ȥ�stop̿���ȯ��
[����]
�ʤ�
[�����]
void
2075 ref = self.ns_dict.GetObjRefToFullpath(self.
fullpath)
2076 ref = ref._narrow(RTM.RTCBase)
2079 err_mess =
'rtc_stop error:%s\n'%self.
fullpath 2084 self.ns_dict.setCompBodyColor(self.
fullpath,
'inactive')
2085 self.
state =
'inactive' 2089 """����ݡ��ͥ�Ȥ�reset̿���ȯ��
[����]
�ʤ�
[�����]
void
2098 ref = self.ns_dict.GetObjRefToFullpath(self.
fullpath)
2099 ref = ref._narrow(RTM.RTCBase)
2102 err_mess =
'rtc_reset error:%s\n'%self.
fullpath 2110 """����ݡ��ͥ�Ȥ�kill̿���ȯ��
[����]
�ʤ�
[�����]
void
2119 ref = self.ns_dict.GetObjRefToFullpath(self.
fullpath)
2120 ref = ref._narrow(RTM.RTCBase)
2123 err_mess =
'rtc_kill error:%s\n'%self.
fullpath 2128 self.ns_dict.setCompBodyColor(self.
fullpath,
'unloaded')
2129 self.
state =
'inactive' 2133 """����ݡ��ͥ�Ȥ�exit̿���ȯ��
[����]
�ʤ�
[�����]
void
2142 ref = self.ns_dict.GetObjRefToFullpath(self.
fullpath)
2143 ref = ref._narrow(RTM.RTCBase)
2146 err_mess =
'rtc_exit error:%s\n'%self.
fullpath 2151 self.ns_dict.setCompBodyColor(self.
fullpath,
'unloaded')
2152 self.
state =
'unloaded' 2156 """���ơ������ˤ�ꥳ��ݡ��ͥ�Ȥο������ꤹ��
[����]
state --- ����ݡ��ͥ�Ȥξ��֤���ꤹ��
2159 state --- ����ݡ��ͥ�Ȥξ��֤���ꤹ�� 2160 'active','inactive','error',unloaded','virtual' 2165 if state ==
'unloaded':
2166 self.
state =
'unloaded' 2167 self.
color = UNLOADED_COLOR
2168 elif state ==
'active' :
2169 self.
state =
'active' 2170 self.
color = ACTIVE_COLOR
2171 elif state ==
'inactive':
2172 self.
state =
'inactive' 2173 self.
color = INACTIVE_COLOR
2174 elif state ==
'error' :
2175 self.
state =
'error' 2176 self.
color = ERROR_COLOR
2178 canvas = self.parent.diagram.GetCanvas()
2179 dc = wx.ClientDC(canvas)
2180 canvas.PrepareDC(dc)
2181 if canvas.viewMode ==
True and self.
state !=
'unloaded':
2182 self.
state =
'virtual' 2183 self.
color = VIRTUAL_COLOR
2189 """�����ȥݡ��Ȥ�refresh 2198 if outp[
'name']
in self.out_dict.keys():
2202 """��ե�å������ ����ݡ��ͥ�Ȥ�state�ե饰�Ǹ��ߤξ��֡�active,error,inactive���ˤ�����
[����]
�ʤ�
[�����]
void
2203 ����ݡ��ͥ�Ȥ�state�ե饰�Ǹ��ߤξ��֡�active,error,inactive���ˤ�����
[����]
�ʤ�
[�����]
void
2211 old_state = self.
state 2212 canvas = self.body.GetCanvas()
2213 dc = wx.ClientDC(canvas)
2214 canvas.PrepareDC(dc)
2216 ref = self.ns_dict.GetObjRefToFullpath(self.
fullpath)
2217 ref = ref._narrow(RTM.RTCBase)
2218 tmp_port = ref._get_rtc_state()
2219 tmp_port = tmp_port._narrow(RTM.OutPort)
2220 tmp = tmp_port.get()
2223 print "refresh state:",tmp
2229 self.
state =
'unloaded' 2230 self.
color = UNLOADED_COLOR
2237 if outp[
'name']
in self.out_dict.keys():
2238 self.
out_dict[outp[
'name']].outport = outp
2240 if inp[
'name']
in self.in_dict.keys():
2241 self.
in_dict[inp[
'name']].inport = inp
2244 if tmp == RTM.RTComponent.RTC_STARTING
or tmp == RTM.RTComponent.RTC_ACTIVE:
2245 self.
state =
'active' 2246 self.
color = ACTIVE_COLOR
2247 elif tmp == RTM.RTComponent.RTC_STOPPING
or tmp == RTM.RTComponent.RTC_READY:
2248 self.
state =
'inactive' 2249 self.
color = INACTIVE_COLOR
2250 elif tmp >= RTM.RTComponent.RTC_ABORTING :
2251 self.
state =
'error' 2252 self.
color = ERROR_COLOR
2254 self.
state =
'unloaded' 2255 self.
color = UNLOADED_COLOR
2258 if len(self.out_dict.keys()) != len(self.
out_list):
2273 if old_lastrot ==
'LR':
2289 """����ݡ��ͥ�ȿ��������� ����ݡ��ȿ��������ȥݡ��ȿ�����Ϣ��������������
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ�
0:������ / 1:���������ʤ�
[�����]
void
2290 ����ݡ��ȿ��������ȥݡ��ȿ�����Ϣ��������������
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ�
0:������ / 1:���������ʤ�
[�����]
void
2293 dc -- ���褹��ǥХ���������ƥ����Ȥ���� rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ�
0:������ / 1:���������ʤ�
[�����]
void
2294 rot -- ���κ�����ݤ���ꤹ�롣�ʲ�ž�������ǻ��ѡ� 0:������ / 1:���������ʤ�
[�����]
void
2295 0:������ / 1:���������ʤ� 2301 canvas = self.body.GetCanvas()
2303 self.body.RemoveFromCanvas(canvas)
2308 self.bmp.RemoveFromCanvas(canvas)
2312 self.text.RemoveFromCanvas(canvas)
2316 if inp[
'name']
in self.in_dict.keys():
2319 if outp[
'name']
in self.out_dict.keys():
2324 """����ݡ��ͥ�ȿ��κ��� 2327 rot -- ���β�ž������Ԥ��ե饰 2328 0:��ž�ʤ��ʺ�ɸ����ǵ���� 1:��ž����(��¸�κ�ɸ����ѡ�
[�����]
void
2338 pos_x = self.
x + (BOX_WIDTH * self.
ratioW)/2
2339 pos_y = self.
y + self.
y_size/2
2345 canvas = self.parent.diagram.GetCanvas()
2346 dc = wx.ClientDC(canvas)
2347 canvas.PrepareDC(dc)
2348 cnt = len(self.
name)
2349 charW = dc.GetCharWidth()
2350 charH = dc.GetCharHeight()
2351 tmpW = charW * (cnt*1.2)
2357 self.text.AddText(self.
name)
2368 bitmap = wx.NullBitmap
2369 self.bmp.SetSize(10,10,
False)
2371 self.bmp.SetBitmap(bitmap)
2372 self.bmp.parent = self
2373 self.parent.MyAddBmp( self.
bmp, pos_x, pos_y, wx.BLACK_PEN )
2377 self.parent.MyAddShape(self.
baseBox, pos_x, pos_y, wx.BLACK_PEN, wx.Brush(self.
color, wx.SOLID),
"" ,0)
2380 self.body.AddChild(self.
baseBox)
2381 self.body.AddChild(self.
bmp)
2382 self.body.AddChild(self.
text)
2390 self.body.Recompute()
2391 self.body.CalculateSize()
2393 self.parent.MyAddShape(
2394 self.
body, pos_x, pos_y, wx.BLACK_PEN, wx.Brush(self.
color, wx.SOLID),
"" ,0)
2396 self.baseBox.lastx = self.body.GetX()
2397 self.baseBox.lasty = self.body.GetY()
2409 port_y = port_y + (POLYGON_SIZE*self.
ratioH)*2
2412 port_x = self.
x + (BOX_WIDTH*self.
ratioW) - (POLYGON_SIZE*self.
ratioW)/3
2413 port_y = self.
y + (POLYGON_SIZE*self.
ratioH)/2
2419 port_y = port_y + (POLYGON_SIZE*self.
ratioH)*2
2425 """����ݡ��ͥ�ȿ��ΰ�ư���� ����ݡ��ȡ������ȥݡ��ȿ�����Ӵ�Ϣ���������ư
[����]
dc -- ���褹��ǥХ���������ƥ����Ȥ����
movex -- ����ɸ�����а�ư�̤����
movey -- ����ɸ�����а�ư�̤����
[�����]
void
2426 ����ݡ��ȡ������ȥݡ��ȿ�����Ӵ�Ϣ���������ư 2429 dc -- ���褹��ǥХ���������ƥ����Ȥ���� movex -- ����ɸ�����а�ư�̤����
movey -- ����ɸ�����а�ư�̤����
[�����]
void
2430 movex -- ����ɸ�����а�ư�̤���� movey -- ����ɸ�����а�ư�̤����
[�����]
void
2431 movey -- ����ɸ�����а�ư�̤����
[�����]
void
2436 canvas = self.body.GetCanvas()
2438 self.
x = self.body.GetX() + movex
2439 self.
y = self.body.GetY() + movey
2441 self.body.Move(dc, self.
x, self.
y)
2444 if inp[
'name']
in self.in_dict.keys():
2447 if outp[
'name']
in self.out_dict.keys():
2452 """����ݡ��ͥ�ȿ�����������ʿ����ѹ���
[����]
�ʤ�
[�����]
void
2460 self.baseBox.SetBrush(wx.Brush(wx.NamedColor(SELECTED_COLOR)))
2466 """����ݡ��ͥ�ȿ�������������ʿ����ѹ���
[����]
dc -- ���褷�Ƥ����ǥХ���������ƥ����Ȥ����
[�����]
void
2469 dc -- ���褷�Ƥ����ǥХ���������ƥ����Ȥ����
[�����]
void
2480 """����ݡ��ͥ�ȿ��ʥ���ݡ��ȡ������ȥݡ��ȡˤΥ������ѹ����� ����ݡ��ͥ�ȿ����ΤΥ������ѹ��ϥǥե���ȡʥ����ƥ�¦�ˤǹԤ���
[����]
x -- ���褹�����ɸ�����
y -- ���褹�����ɸ�����
ratioW -- �������ѹ�����Width����Ψ�����
ratioH -- �������ѹ�����Height����Ψ�����
[�����]
void
2481 ����ݡ��ͥ�ȿ����ΤΥ������ѹ��ϥǥե���ȡʥ����ƥ�¦�ˤǹԤ���
[����]
x -- ���褹�����ɸ�����
y -- ���褹�����ɸ�����
ratioW -- �������ѹ�����Width����Ψ�����
ratioH -- �������ѹ�����Height����Ψ�����
[�����]
void
2484 x -- ���褹�����ɸ����� y -- ���褹�����ɸ�����
ratioW -- �������ѹ�����Width����Ψ�����
ratioH -- �������ѹ�����Height����Ψ�����
[�����]
void
2485 y -- ���褹�����ɸ����� ratioW -- �������ѹ�����Width����Ψ�����
ratioH -- �������ѹ�����Height����Ψ�����
[�����]
void
2486 ratioW -- �������ѹ�����Width����Ψ����� ratioH -- �������ѹ�����Height����Ψ�����
[�����]
void
2487 ratioH -- �������ѹ�����Height����Ψ�����
[�����]
void
2496 self.
x_size, self.
y_size = self.baseBox.GetBoundingBoxMin()
2498 canvas = self.body.GetCanvas()
2499 dc = wx.ClientDC(canvas)
2500 canvas.PrepareDC(dc)
2513 self.body.Select(
False, dc)
2514 tmp = canvas.selected.index(self.
baseBox)
2515 del canvas.selected[tmp]
2518 self.baseBox.Select(
True, dc)
2519 canvas.selected.append(self.
baseBox)
2528 port_x = self.
x - self.
x_size/2 + x_size -1
2529 port_y = self.
y - self.
y_size/2 + y_size -1
2531 if in_pos ==
'Right':
2532 port_x = self.
x + self.
x_size/2 + x_size/6
2533 elif in_pos ==
'Left':
2534 port_x = self.
x - self.
x_size/2 - x_size/6
2535 elif in_pos ==
'Top':
2536 port_y = self.
y - self.
y_size/2 - y_size/6
2537 elif in_pos ==
'Bottom':
2538 port_y = self.
y + self.
y_size/2 + y_size/6
2541 if inp[
'name']
in self.in_dict.keys():
2544 if in_pos ==
'Right' or in_pos ==
'Left':
2545 port_y = port_y + y_size*2
2547 port_x = port_x + x_size*2
2554 port_x = self.
x - self.
x_size/2 + x_size -1
2555 port_y = self.
y - self.
y_size/2 + y_size -1
2557 if out_pos ==
'Right':
2558 port_x = self.
x + self.
x_size/2 + x_size/6
2559 elif out_pos ==
'Left':
2560 port_x = self.
x - self.
x_size/2 - x_size/6
2561 elif out_pos ==
'Top':
2562 port_y = self.
y - self.
y_size/2 - y_size/6
2563 elif out_pos ==
'Bottom':
2564 port_y = self.
y + self.
y_size/2 + y_size/6
2567 if outp[
'name']
in self.out_dict.keys():
2570 if out_pos ==
'Right' or out_pos ==
'Left':
2571 port_y = port_y + y_size*2
2573 port_x = port_x + x_size*self.
ratioW*2
2581 self.text.SetY(self.
text_y)
2585 tmpw, tmph = self.bmp.GetBoundingBoxMin()
2586 pos_y = self.
y - self.
y_size/2 + tmph/2
2588 pos_y = pos_y + self.
py_size/2
2590 self.bmp.SetY(pos_y)
2597 """����ȿž�ʲ�ž�˽���
[����]
�ʤ�
[�����]
void
2610 self.
x = self.baseBox.GetX()
2611 self.
y = self.baseBox.GetY()
2613 center_x = self.baseBox.GetX()
2614 center_y = self.baseBox.GetY()
2617 self.
x_size, self.
y_size = self.baseBox.GetBoundingBoxMin()
2620 self.
y_size, self.
x_size = self.baseBox.GetBoundingBoxMin()
2623 canvas = self.body.GetCanvas()
2624 dc = wx.ClientDC(canvas)
2625 canvas.PrepareDC(dc)
2636 port_x = self.
x - self.
x_size/2 - p_size/6
2637 port_y = self.
y - self.
y_size/2 + p_size-1
2639 if inp[
'name']
in self.in_dict.keys():
2640 self.
in_dict[inp[
'name']].position =
'Left' 2642 port_y = port_y + p_size*2
2644 port_x = self.
x + self.
x_size/2 + p_size/6
2645 port_y = self.
y - self.
y_size/2 + p_size-1
2647 if outp[
'name']
in self.out_dict.keys():
2648 self.
out_dict[outp[
'name']].position =
'Right' 2650 port_y = port_y + p_size*2
2653 port_x = self.
x + self.
x_size/2 + p_size/6
2654 port_y = self.
y - self.
y_size/2 + p_size-1
2656 if inp[
'name']
in self.in_dict.keys():
2657 self.
in_dict[inp[
'name']].position =
'Right' 2659 port_y = port_y + p_size*2
2661 port_x = self.
x - self.
x_size/2 - p_size/6
2662 port_y = self.
y - self.
y_size/2 + p_size-1
2664 if outp[
'name']
in self.out_dict.keys():
2665 self.
out_dict[outp[
'name']].position =
'Left' 2667 port_y = port_y + p_size*2
2672 self.text.SetY(self.
text_y)
2680 """�岼��ž����
[����]
�ʤ�
[�����]
void
2689 self.
x = center_x = self.baseBox.GetX()
2690 self.
y = center_y = self.baseBox.GetY()
2693 self.
y_size, self.
x_size = self.baseBox.GetBoundingBoxMin()
2696 self.
x_size, self.
y_size = self.baseBox.GetBoundingBoxMin()
2699 canvas = self.body.GetCanvas()
2700 dc = wx.ClientDC(canvas)
2701 canvas.PrepareDC(dc)
2720 port_x = self.
x - self.
x_size/2 + p_size-1
2721 port_y = self.
y - self.
y_size/2 - p_size/6
2723 if inp[
'name']
in self.in_dict.keys():
2724 self.
in_dict[inp[
'name']].position =
'Top' 2726 port_x = port_x + p_size*2
2728 port_x = self.
x - self.
x_size/2 + p_size-1
2729 port_y = self.
y + self.
y_size/2 + p_size/6
2731 if outp[
'name']
in self.out_dict.keys():
2732 self.
out_dict[outp[
'name']].position =
'Bottom' 2734 port_x = port_x + p_size*2
2737 port_x = self.
x - self.
x_size/2 + p_size-1
2738 port_y = self.
y + self.
y_size/2 + p_size/6
2740 if inp[
'name']
in self.in_dict.keys():
2741 self.
in_dict[inp[
'name']].position =
'Bottom' 2743 port_x = port_x + p_size*2
2745 port_x = self.
x - self.
x_size/2 + p_size-1
2746 port_y = self.
y - self.
y_size/2 - p_size/6
2748 if outp[
'name']
in self.out_dict.keys():
2749 self.
out_dict[outp[
'name']].position =
'Top' 2751 port_x = port_x + p_size*2
2756 self.text.SetY(self.
text_y)
2760 tmpw, tmph = self.bmp.GetBoundingBoxMin()
2763 self.bmp.SetY(pos_y)
2771 """�ӥåȥޥå��ѤΥ��ߡ����٥�ȥ��饹""" 2776 log -- �������ϥ��饹�Υ��֥������� frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2777 frame -- ���ơ������С��Υ��֥������� ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2778 ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2783 ogl.ShapeEvtHandler.__init__(self)
2788 """�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2789 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2794 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å�����
[�����]
void
2795 attachment -- ���������
[�����]
void
2803 """�ޥ���������å����˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2804 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2809 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å�����
[�����]
void
2810 attachment -- ���������
[�����]
void
2818 """�������ѹ���λ���˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
pt -- ����ȥ�����ݥ����
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2819 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
pt -- ����ȥ�����ݥ����
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2822 pt -- ����ȥ�����ݥ���� x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2825 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å�����
[�����]
void
2826 attachment -- ���������
[�����]
void
2834 """�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2835 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- ���������
[�����]
void
2840 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å�����
[�����]
void
2841 attachment -- ���������
[�����]
void
2849 class MyEvtHandlerOval(ogl.ShapeEvtHandler):
2850 """����ư�ѤαߤΥ��٥�ȥ��饹""" 2852 """���饹�ν������ShapeEvtHandler�κ�����
[����]
log -- �������ϥ��饹�Υ��֥�������
frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2855 log -- �������ϥ��饹�Υ��֥������� frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2856 frame -- ���ơ������С��Υ��֥������� ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2857 ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2862 ogl.ShapeEvtHandler.__init__(self)
2867 """�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ� �ɥ�å��ե饰��off�ˤ���
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2868 �ɥ�å��ե饰��off�ˤ���
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2873 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2874 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2882 """�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ� �ɥ�å��ե饰��on�ˤ���
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2883 �ɥ�å��ե饰��on�ˤ���
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2888 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2889 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2897 """�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ� ��ư�Ѥαߤ�ɥ�å��ǰ�ư�ʱߤ�dmove��å���Ǵ�Ϣ���������ư�������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2898 ��ư�Ѥαߤ�ɥ�å��ǰ�ư�ʱߤ�dmove��å���Ǵ�Ϣ���������ư�������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2903 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2904 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2910 shape = self.GetShape()
2915 canvas = shape.GetCanvas()
2917 canvas.PrepareDC(dc)
2919 movex = x - shape.lastx
2920 movey = y - shape.lasty
2922 shape.parent.dmove(dc,movex,movey)
2924 shape.lastx = shape.GetX()
2925 shape.lasty = shape.GetY()
2931 """���ߡ����٥�ȥϥ�ɥ�""
def __init__(self, log, frame):
"""���饹�ν����
[����]
log -- �������ϥ��饹�Υ��֥�������
frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
"""
ogl.ShapeEvtHandler.__init__(self)
self.log = log
ogl.ShapeEvtHandler.__init__(self)
self.log = log
self.statbarFrame = frame
def OnEndDragLeft(self, x, y, keys = 0, attachment = 0):
"""�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ�
������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
pass
def OnDragLeft(self, draw, x, y, keys=0, attachment=0):
"""�ɥ�å����˸ƤФ�륤�٥�ȥϥ�ɥ�
������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
pass
def OnBeginDragLeft(self, x, y, keys, attachment):
"""�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ�
������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
pass
def OnLeftClick(self, x, y, keys = 0, attachment = 0):
"""�ޥ���������å��˸ƤФ�륤�٥�ȥϥ�ɥ�
������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
pass
#----------------------------------------------------------------------
class MyEvtHandlerLine(ogl.ShapeEvtHandler):
"""���Υ��٥�ȥ��饹"""
def __init__(self ):
"""���饹�ν����
[����]
�ʤ�
[�����]
void
"""
ogl.ShapeEvtHandler.__init__(self)
def OnLeftClick(self, x, y, keys = 0, attachment = 0):
"""�ޥ���������å����˸ƤФ�륤�٥�ȥϥ�ɥ�
�����������Ԥ�
��������Ǥϡ���ư�Ѥαߤ��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
shape = self.GetShape()
# print shape.__class__, shape.GetClassName()
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
# ��������Ѥ�
if shape in canvas.selected:
# ������֤β��
for obj in shape.parent.lines:
obj.Select(False, dc)
shape.parent.unselected(dc)
for obj in canvas.selected:
if shape == obj:
obj.parent.unselected(dc)
idx = canvas.selected.index(obj)
del canvas.selected[idx]
# ����̤����
else:
# ������֤˰ܹ�
redraw = False
shapeList = canvas.GetDiagram().GetShapeList()
if canvas.selected and keys != 1:
for s in canvas.selected:
s.Select(False, dc)
s.parent.unselected(dc)
canvas.selected = []
canvas.Redraw(dc)
shape.parent.selected()
for obj in shape.parent.lines:
canvas.selected.append(obj)
# create oval on line
line = shape.parent
if (line.coordT == None) or (len(line.coordT) == 2):
return
# ����ư�Ѥαߤ�����
num = len(line.coordT)
line.oval_dict = {}
for oval_id in range(1,num-2):
line_pos_0 = line.coordT[oval_id]
line_pos_1 = line.coordT[oval_id+1]
if line_pos_0[0] == line_pos_1[0] and line_pos_0[1] != line_pos_1[1]: # width line
hight = line_pos_0[1] - line_pos_1[1]
pos_y = line_pos_1[1] + (hight/2)
pos_x = line_pos_0[0]
tag = (oval_id, "oval_width_pos")
elif line_pos_0[0] != line_pos_1[0] and line_pos_0[1] == line_pos_1[1] : # length line
width = line_pos_0[0] - line_pos_1[0]
pos_x = line_pos_1[0] + (width/2)
pos_y = line_pos_1[1]
tag = (oval_id, "oval_length_pos")
line.oval_dict[oval_id] = GRectOval(line, tag, pos_x, pos_y)
line.parent.parent.parent.MyAddOval(line.oval_dict[oval_id].body, pos_x, pos_y)
canvas.Redraw(dc)
#----------------------------------------------------------------------
class MyEvtHandler(ogl.ShapeEvtHandler):
"""����ݡ��ͥ�ȿ��ʻͳѷ������ΤΥ��٥�ȥ��饹"""
def __init__(self, log, frame):
"""���饹�ν����
[����]
log -- �������ϥ��饹�Υ��֥�������
frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
"""
ogl.ShapeEvtHandler.__init__(self)
self.log = log
self.statbarFrame = frame
self.dragOn = 0
def UpdateStatusBar(self, shape):
"""���ơ������С���ɽ���������ι���
[����]
shape -- ���Υ��֥������Ȥ����
[�����]
void
"""
x,y = shape.GetX(), shape.GetY()
width, height = shape.GetBoundingBoxMax()
self.statbarFrame.SetStatusText("Pos: (%d,%d) Size: (%d, %d)" %
(x, y, width, height))
def OnLeftClick(self, x, y, keys = 0, attachment = 0):
"""�ޥ���������å����˸ƤФ�륤�٥�ȥϥ�ɥ�
���Τ��������Ԥ�
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
shape = self.GetShape()
# print shape.__class__, shape.GetClassName()
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
# ����å������ץ��ե�����ɽ��
ref = self.statbarFrame.myDict.GetObjRefToFullpath(shape.parent.fullpath)
try:
ref = ref._narrow(RTM.RTCBase)
self.statbarFrame.profilepanel.RefreshProfile(ref._get_profile())
except:
except_mess("obj-ref error:")
# ���٥�ȤǸƤӽФ��줿��������Ѥߤξ��
if shape in canvas.selected:
#if shape.parent.tag == 'body' or shape.parent.tag == 'line':
# ������
canvas.lineFrom = None
shape.Select(False, dc)
shape.parent.unselected(dc)
for obj in canvas.selected:
if shape == obj:
idx = canvas.selected.index(obj)
del canvas.selected[idx]
canvas.Redraw(dc)
# ���٥�ȤǸƤӽФ��줿����̤����ξ��
else:
# ������֤ذܹ�
canvas.lineFrom = None
redraw = False
shapeList = canvas.GetDiagram().GetShapeList()
shape.Select(True, dc)
shape.parent.selected()
if canvas.selected and keys != 1:
for s in canvas.selected:
s.Select(False, dc)
s.parent.unselected(dc)
canvas.selected = []
canvas.Redraw(dc)
canvas.selected.append(shape)
self.UpdateStatusBar(shape)
def OnEndDragLeft(self, x, y, keys = 0, attachment = 0):
"""�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ�
������֤��������ư
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
if self.dragOn == 1:
shape = self.GetShape()
# self.base_OnEndDragLeft(x, y, keys, attachment)
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
movex = x - shape.lastx
movey = y - shape.lasty
# ������֤��������ư
for obj in canvas.selected:
# body/inport/outport
obj.parent.dmove(dc,movex,movey)
obj.lastx = obj.GetX()
obj.lasty = obj.GetY()
if obj.parent.tag != 'line':
obj.Select(True, dc)
canvas.Redraw(dc)
self.dragOn = 0
self.UpdateStatusBar(shape)
def OnSizingEndDragLeft(self, pt, x, y, keys, attch):
"""�������ѹ���λ���˸ƤФ�륤�٥�ȥϥ�ɥ�
[����]
pt -- ����ȥ�����ݥ����
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
# �ǥե���ȤΥ������ѹ����٥�ȥϥ�ɥ�ƤӽФ�
self.base_OnSizingEndDragLeft(pt, x, y, keys, attch)
shape = self.GetShape()
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
# �������ѹ�����Width,Height����Ψ����
width, height = shape.GetBoundingBoxMax()
ratioW = width / shape.parent.lastBBoxWidth
ratioH = height / shape.parent.lastBBoxHeight
tmpx,tmpy = shape.GetX(), shape.GetY()
# �������ѹ�
shape.parent.updatePolygonSize(tmpx,tmpy,ratioW,ratioH)
self.UpdateStatusBar(shape)
canvas.Redraw(dc)
shape.parent.lastBBoxWidth, shape.parent.lastBBoxHeight = shape.GetBoundingBoxMax()
def OnDragLeft(self, draw, x, y, keys, attachment):
"""�ɥ�å����˸ƤФ�륤�٥�ȥϥ�ɥ�
������֤��������ư
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
shape = self.GetShape()
canvas = shape.GetCanvas()
if self.dragOn == 1:
if shape not in canvas.selected:
pass
else:
width, height = shape.GetBoundingBoxMax()
self.statbarFrame.SetStatusText("Pos: (%d,%d) Size: (%d, %d)" %
(x, y, width, height))
# self.base_OnDragLeft(1, x, y, keys, attachment)
# ����DC(BufferedDC)�������������˳��������ơ�Redrawde��ɽ��ɽ��
dc = getBufferedDC(canvas)
canvas.PrepareDC(dc)
# ����Ѥߤο����ư
movex = x - shape.lastx
movey = y - shape.lasty
for obj in canvas.selected:
obj.DeleteControlPoints()
# inport/outport
obj.parent.dmove(dc,movex,movey)
obj.lastx = obj.GetX()
obj.lasty = obj.GetY()
canvas.Redraw(dc)
def OnBeginDragLeft(self, x, y, keys, attachment):
"""�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ�
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
shape = self.GetShape()
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
if shape not in canvas.selected:
shape.DeleteControlPoints()
if canvas.selected and keys != 1:
for s in canvas.selected:
s.Select(False, dc)
s.parent.unselected(dc)
canvas.selected = []
canvas.Redraw(dc)
shape.Select(True, dc)
shape.parent.selected()
canvas.selected.append(shape)
else:
for s in canvas.selected:
if s.parent.tag == 'line':
s.Select(False, dc)
s.parent.unselected(dc)
idx = canvas.selected.index(s)
del canvas.selected[idx]
canvas.Redraw(dc)
self.log.write("OnBeginDragLeft: %s, %s, %s\n" % (x, y, keys))
# self.base_OnBeginDragLeft(x, y, keys, attachment)
self.dragOn = 1
#----------------------------------------------------------------------
class MyPortEvtHandler(ogl.ShapeEvtHandler):
"""�ݡ��ȤΥ��٥�ȥ��饹"""
def __init__(self, log, frame):
"""���饹�ν����
[����]
log -- �������ϥ��饹�Υ��֥�������
frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
"""
ogl.ShapeEvtHandler.__init__(self)
self.log = log
self.statbarFrame = frame
self.dragOn = 0
def UpdateStatusBar(self, shape):
"""���ơ������С���ɽ���������ι���
[����]
shape -- ���Υ��֥������Ȥ����
[�����]
void
"""
x,y = shape.GetX(), shape.GetY()
width, height = shape.GetBoundingBoxMax()
self.statbarFrame.SetStatusText("Pos: (%d,%d) Size: (%d, %d)" %
(x, y, width, height))
def OnLeftClick(self, x, y, keys = 0, attachment = 0):
"""�ޥ���������å����˸ƤФ�륤�٥�ȥϥ�ɥ�
��������٤Ρ�������or��λ��������
��λ���������ϡ������֤��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
shape = self.GetShape()
# print shape.__class__, shape.GetClassName()
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
ref = shape.parent.ns_dict.GetObjRefToFullpath(shape.parent.fullpath)
try:
ref = ref._narrow(RTM.RTCBase)
tmp = shape.parent.ns_dict.GetCompState(shape.parent.fullpath)
if tmp >= RTM.RTComponent.RTC_ABORTING or tmp == 0:
ref = None
except :
except_mess("except error:")
ref = None
if not ref:
return
if canvas.lineFrom == None:
canvas.lineFrom = shape
elif canvas.lineFrom != shape:
if canvas.lineFrom.parent.tag == 'in':
checktag = 'out'
else:
checktag = 'in'
if shape.parent.tag != checktag:
return
if shape.parent.fullpath == canvas.lineFrom.parent.fullpath:
return
canvas.lineTo = shape
line = GRtcLine(canvas,shape.parent)
line.setLine2port(canvas, dc)
line.g_outp.connect(line.idx, line.g_outp.subscription_type)
canvas.lineFrom = None
canvas.lineTo = None
canvas.Redraw(dc)
self.UpdateStatusBar(shape)
def OnEndDragLeft(self, x, y, keys = 0, attachment = 0):
"""�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ�
�ݡ��Ⱦ�˥ޥ����������뤬������������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
shape = self.GetShape()
ref = shape.parent.ns_dict.GetObjRefToFullpath(shape.parent.fullpath)
try:
ref = ref._narrow(RTM.RTCBase)
tmp = shape.parent.ns_dict.GetCompState(shape.parent.fullpath)
if tmp >= RTM.RTComponent.RTC_ABORTING or tmp == 0:
ref = None
except :
except_mess("except error:")
ref = None
if not ref:
return
if self.dragOn == 1:
# shape.parent.parent.blink.Stop()
self.dragOn = 0
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
canvas.moveLine.removeWidget(dc)
canvas.Redraw(dc)
tmpShape = canvas.FindShape(x,y)
if tmpShape == 0 or not hasattr(tmpShape[0], "parent") or not hasattr(tmpShape[0].parent, "ns_dict"):
return
ref = tmpShape[0].parent.ns_dict.GetObjRefToFullpath(tmpShape[0].parent.fullpath)
try:
ref = ref._narrow(RTM.RTCBase)
tmp = tmpShape[0].parent.ns_dict.GetCompState(tmpShape[0].parent.fullpath)
if tmp >= RTM.RTComponent.RTC_ABORTING or tmp == 0:
ref = None
if shape.parent.fullpath == tmpShape[0].parent.fullpath:
ref = None
except :
except_mess("except error:")
ref = None
if not ref:
return
if canvas.lineFrom.parent.tag == 'in':
checktag = 'out'
else:
checktag = 'in'
if tmpShape[0].parent.tag == checktag:
canvas.lineTo = tmpShape[0]
line = GRtcLine(canvas,shape.parent)
line.setLine2port(canvas, dc)
line.g_outp.connect(line.idx, line.g_outp.subscription_type)
canvas.lineFrom = None
canvas.lineTo = None
canvas.Redraw(dc)
else:
pass
def OnDragLeft(self, draw, x, y, keys, attachment):
"""�ɥ�å����˸ƤФ�륤�٥�ȥϥ�ɥ�
�ޥ�����������Ȼ����֤��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
shape = self.GetShape()
if self.dragOn == 1:
canvas = shape.GetCanvas()
dc = getBufferedDC(canvas)
canvas.PrepareDC(dc)
# create line
canvas.moveLine.setPoints(shape.GetX(), shape.GetY(), x, y)
canvas.moveLine.lines[0].SetPen(wx.Pen(SELECTED_COLOR, 1))
canvas.moveLine.lines[0].Show(True)
canvas.Redraw(dc)
else:
pass
def OnBeginDragLeft(self, x, y, keys, attachment):
"""�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ�
�ɥ�å��ˤ�������������γ���(���֥������ȥ�ե����¸�ߤ������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
"""
self.log.write("OnBeginDragLeft: %s, %s, %s\n" % (x, y, keys))
self.dragOn = 1
shape = self.GetShape()
ref = shape.parent.ns_dict.GetObjRefToFullpath(shape.parent.fullpath)
try:
ref = ref._narrow(RTM.RTCBase)
tmp = shape.parent.ns_dict.GetCompState(shape.parent.fullpath)
if tmp >= RTM.RTComponent.RTC_ABORTING or tmp == 0:
ref = None
except :
ref = None
except_mess("except error:")
if ref:
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
canvas.lineFrom = shape
# make line
canvas.moveLine = GRtcLine(canvas, shape.parent)
canvas.moveLine.setPoints(shape.GetX(), shape.GetY(), x, y)
canvas.moveLine.lines[0].SetPen(wx.Pen(SELECTED_COLOR, 1))
canvas.moveLine.lines[0].Show(True)
# shape.parent.parent.blink.setBlinkState(shape.parent.parent, 'inactive', 'active')
# shape.parent.parent.blink.Start(500)
else:
self.dragOn = 0
#----------------------------------------------------------------------
class RtdSystemDraw(ogl.ShapeCanvas):
"""�������ѤΥ����Х��������饹"""
def __init__(self, parent, log, frame):
"""���饹�ν����
[����]
log -- �������ϥ��饹�Υ��֥�������
frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
parent -- �ƥ�����ɥ������
[�����]
void
"""
ogl.ShapeCanvas.__init__(self, parent)
maxWidth = 1000
maxHeight = 1000
# self.SetScrollbars(20, 20, maxWidth/20, maxHeight/20)
self.x_size = maxWidth
self.y_size = maxHeight
self.log = log
self.frame = frame
self.SetBackgroundColour(wx.WHITE)
self.diagram = ogl.Diagram()
self.save_gdi = []
self.SetDiagram(self.diagram)
self.diagram.SetCanvas(self)
self.tooltip = None
self.rtc_dict = {}
self.rtc_list = []
canvas = self.diagram.GetCanvas()
canvas.lineFrom = None
canvas.lineTo = None
canvas.line_idx = 0
canvas.line = {}
canvas.moveLine = None
canvas.selected = []
canvas.viewMode = False
rRectBrush = wx.Brush("MEDIUM TURQUOISE", wx.SOLID)
dsBrush = wx.Brush("WHITE", wx.SOLID)
# �ɥ�å����ɥ��åס��ɥ��åץ������åȤ�����
dt = MyTextDropTarget(self, log)
self.SetDropTarget(dt)
# ���٥�Ȥγ���
self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
self.Bind(wx.EVT_MIDDLE_DOWN, self.OnMiddleDown)
self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
def changeCompColor(self, fullname, state) :
"""����ݡ��ͥ��ñ�Το����ѹ���rtc_state()���ȡ�
[����]
fullname -- ����ݡ��ͥ�ȤΥե�ѥ�̾
[�����]
void
"""
if fullname in self.rtc_list:
# self.rtc_dict[fullname].refresh()
self.rtc_dict[fullname].changeBodyColor(state)
self.rtc_dict[fullname].state = state
def search_g_inp(self, inp_ref) :
"""����ݡ��Ȥθ���
[����]
inp_ref -- ����ݡ��ȤΥ��֥������ȥ�ե����
[�����]
g_inp -- ����ݡ��ȤΥǥ�������ʥ
"""
print "len rtc_list:",len(self.rtc_list)
for rtc_name in self.rtc_list :
g_rtc = self.rtc_dict[rtc_name]
ref = g_rtc.ns_dict.GetObjRefToFullpath(g_rtc.fullpath)
if ref :
print "len in_list:",len(g_rtc.in_list)
for inp in g_rtc.in_list :
print "inp_ref:",inp_ref, " == ", g_rtc.in_dict[inp['name']].inport['ref']
if inp_ref._is_equivalent(g_rtc.in_dict[inp['name']].inport['ref']) :
print "_is_equivalent is OK!!!"
return g_rtc.in_dict[inp['name']]
def openFileDialog(self):
wildcard = "*.xml |*.xml| *.* |*.*"
dialog = wx.FileDialog( self, strOPEN_TITLE, defaultDir=os.getcwd(),
defaultFile="", wildcard=wildcard, style=wx.OPEN)
if dialog.ShowModal() != wx.ID_OK:
return None
openFileName = dialog.GetPath()
dialog.Destroy()
return openFileName
def loadXML(self):
if len(self.rtc_dict) > 0:
ret = self.askDialog(strDEL_SYS)
if ret != wx.ID_OK:
return
openFileName = self.openFileDialog()
print "open file is :",openFileName
if openFileName == None:
return
# delete
self.deleteAllShape()
rtxml = RtmParser.RtmParser()
dict = rtxml.readXML(openFileName)
canvas = self.diagram.GetCanvas()
canvas.viewMode = True
self.createGRtc_from_dict(dict)
def saveFileDialog(self):
wildcard = "*.xml |*.xml| *.* |*.*"
dialog = wx.FileDialog( self, strSAVE_AS_TITLE, defaultDir=os.getcwd(),
defaultFile="", wildcard=wildcard, style=wx.SAVE)
if dialog.ShowModal() != wx.ID_OK:
return None
saveFileName = dialog.GetPath()
dialog.Destroy()
return saveFileName
def makeDumpData(self):
canvas = self.diagram.GetCanvas()
dict = {}
dict['rtc'] = {}
dict['line'] = []
for fullname in self.rtc_list:
comp = self.rtc_dict[fullname]
name = fullname
x_size, y_size = comp.baseBox.GetBoundingBoxMin()
if comp.lastRot == 'TB':
y_size, x_size = x_size, y_size
x = comp.baseBox.GetX() - x_size/2
y = comp.baseBox.GetY() - y_size/2
# print "Comp name:",name," x=",x," y=",y
dict['rtc'][name] = {}
dict['rtc'][name]['x'] = x
dict['rtc'][name]['y'] = y
if comp.lastRot == 'LR':
if comp.revTogle == 1:
dict['rtc'][name]['rot'] = 'Right'
else:
dict['rtc'][name]['rot'] = 'Left'
else:
if comp.rotTogle == 1:
dict['rtc'][name]['rot'] = 'Top'
else:
dict['rtc'][name]['rot'] = 'Bottom'
# comp.rotTogle # 1 or 0 # 1 :inport's is top side of body
# comp.revTogle # 1 or 0 # 1 :inport's is right side of body
# comp.lastRot # LR(Left/Right) or TB(Top/Bottom)
for line_idx in canvas.line:
out_obj = canvas.line[line_idx].g_outp
in_obj = canvas.line[line_idx].g_inp
tmp = {}
# tmp['type'] =
tmp['pos'] = canvas.line[line_idx].coordT
tmp['in-comp'] = in_obj.fullpath
tmp['in-name'] = in_obj.inport['name']
tmp['out-comp'] = out_obj.fullpath
tmp['out-name'] = out_obj.outport['name']
dict['line'].append(tmp)
return dict
def saveXML(self, saveFileName):
dict = {}
dict = self.makeDumpData()
rtxml = RtmParser.RtmParser()
rtxml.writeXML(saveFileName, dict)
def saveAsXML(self):
saveFileName = self.saveFileDialog()
if saveFileName == None:
return
self.saveXML(saveFileName)
def refresh(self):
"""��ե�å������
����ݡ��ͥ�ȵڤӡ�ɽ�����Υ�ե�å����Ԥ�
[����]
�ʤ�
[�����]
void
"""
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
for obj in canvas.selected:
obj.Select(False, dc)
obj.parent.unselected(dc)
canvas.selected = []
for rtc_name in self.rtc_list:
self.rtc_dict[rtc_name].refresh()
for rtc_name in self.rtc_list:
self.rtc_dict[rtc_name].refresh_outp()
def reConnect(self):
"""����³����
���̾�Υ���ݡ��ͥ�Ȥκ���³������ƤӽФ�
[����]
�ʤ�
[�����]
void
"""
# assembly dummy process
# return
# assembly dummy process
for rtc_name in self.rtc_list:
self.rtc_dict[rtc_name].reConnectLine()
def remakeLines(self):
# assembly dummy process
# return
# assembly dummy process
for rtc_name in self.rtc_list:
self.rtc_dict[rtc_name].remakeLines()
def createGRtc_from_dict(self,dict):
"""�ǥ�������ʥ���饳��ݡ��ͥ�ȿ�������
[����]
dict -- ������֥�Υǥ�������ʥ
[�����]
void
"""
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(canvas)
canvas.PrepareDC(dc)
rtc_list = dict['rtc'].keys()
self.rtc_dict = {}
new_list = []
pos_x = 0
pos_y = 0
for rtc_name in rtc_list:
# obj-ref error check
try:
ref = self.frame.myDict.GetObjRefToFullpath(rtc_name)
if ref == None:
print 'Component Create error!: %s'%rtc_name
continue
ref = ref._narrow(RTM.RTCBase)
tmp = self.frame.myDict.GetCompState(rtc_name)
# if tmp >= RTM.RTComponent.RTC_ABORTING or tmp == 0:
# ref = None
except:
err_mess = 'Component Create error:%s\n'%rtc_name
except_mess(err_mess)
continue
new_list.append(rtc_name)
pos_x = dict['rtc'][rtc_name]['x']
pos_y = dict['rtc'][rtc_name]['y']
comp = GRtc(self, rtc_name, pos_x, pos_y)
comp.changeBodyColor('virtual')
self.rtc_dict[rtc_name] = comp
if dict['rtc'][rtc_name]['rot'] == 'Left':
comp.reversesBody()
elif dict['rtc'][rtc_name]['rot'] == 'Top':
comp.rotatesBody()
elif dict['rtc'][rtc_name]['rot'] == 'Bottom':
comp.rotatesBody()
comp.rotatesBody()
comp.refresh()
if len(new_list) == 0:
canvas.viewMode = False
return
self.rtc_list = new_list
for line_num in range(len(dict['line'])):
line_dict = dict['line'][line_num]
out_comp_name = line_dict['out-comp']
out_name = line_dict['out-name']
in_comp_name = line_dict['in-comp']
in_name = line_dict['in-name']
#error check
if not self.rtc_dict.has_key(out_comp_name):
print 'Assembly Check: Port Connection Error!:',out_comp_name
continue
if not self.rtc_dict[out_comp_name].out_dict.has_key(out_name):
print 'Assembly Check: Port Connection Error!: ',out_comp_name,":",out_name
continue
if not self.rtc_dict.has_key(in_comp_name):
print 'Assembly Check: Port Connection Error!:',in_comp_name
continue
if not self.rtc_dict[in_comp_name].in_dict.has_key(in_name):
print 'Assembly Check: Port Connection Error!: ',in_comp_name,":",in_name
continue
outp_obj = self.rtc_dict[out_comp_name].out_dict[out_name]
inp_obj = self.rtc_dict[in_comp_name].in_dict[in_name]
canvas.lineFrom = outp_obj.body
canvas.lineTo = inp_obj.body
line = GRtcLine(canvas,outp_obj)
line.setLine2port(canvas, dc)
line.g_outp.connect(line.idx, line.g_outp.subscription_type)
pos = []
pos_list = []
pos_list = string.splitfields(line_dict['pos'],',')
for num in range(len(pos_list)/2):
pos.append((string.atof(pos_list[num*2]),string.atof(pos_list[num*2+1])))
#line.move_child
line.childMove(dc, pos)
canvas.lineFrom = None
canvas.lineTo = None
canvas.Redraw(dc)
def MyAddBmp(self, shape, x, y, pen):
"""�ӥåȥޥå�����Ͽ
�����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ�
[����]
shape -- �ӥåȥޥå������
x -- ɽ���������ɸ
y -- ɽ���������ɸ
pen -- �ڥ�ʿ��������ˤ����
[�����]
shape -- wx.Shape �����֥�������
"""
shape.SetDraggable(False, False)
shape.SetCanvas(self)
if pen: shape.SetPen(pen)
shape.SetX(x)
shape.SetY(y)
self.diagram.AddShape(shape)
evthandler = MyEvtHandlerBmp(self.log, self.frame)
evthandler.SetShape(shape)
evthandler.SetPreviousHandler(shape.GetEventHandler())
shape.SetEventHandler(evthandler)
shape.Show(True)
return shape
def MyAddOval(self, shape, x, y):
"""�߿�����Ͽ
�����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ�
[����]
shape -- �ӥåȥޥå������
x -- ɽ���������ɸ
y -- ɽ���������ɸ
[�����]
shape -- wx.Shape �����֥�������
"""
shape.SetDraggable(True, False)
shape.SetCanvas(self)
shape.SetX(x)
shape.SetY(y)
self.diagram.AddShape(shape)
evthandler = MyEvtHandlerOval(self.log, self.frame)
evthandler.SetShape(shape)
evthandler.SetPreviousHandler(shape.GetEventHandler())
shape.SetEventHandler(evthandler)
shape.Show(True)
return shape
def MyAddText(self, shape, x, y, pen, brush=None ):
"""�ƥ����Ȥ���Ͽ
�����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ�
[����]
shape -- �ӥåȥޥå������
x -- ɽ���������ɸ
y -- ɽ���������ɸ
pen -- �ڥ�ʿ��������ˤ����
burush -- �֥饷�ʿ��ˤ����
[�����]
shape -- wx.Shape �����֥�������
"""
shape.SetDraggable(False, False)
shape.SetCanvas(self)
shape.SetX(x)
shape.SetY(y)
if pen: shape.SetPen(pen)
if brush: shape.SetBrush(brush)
self.diagram.AddShape(shape)
evthandler = MyEvtHandlerDummy(self.log, self.frame)
evthandler.SetShape(shape)
evthandler.SetPreviousHandler(shape.GetEventHandler())
shape.SetEventHandler(evthandler)
shape.Show(True)
return shape
def MyAddShape(self, shape, x, y, pen, brush, text, inoutPort=0):
"""����ݡ��ͥ�ȿ����ݡ��ȿ�����Ͽ
�����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ�
[����]
shape -- �ӥåȥޥå������
x -- ɽ���������ɸ
y -- ɽ���������ɸ
pen -- �ڥ�ʿ��������ˤ����
burush -- �֥饷�ʿ��ˤ����
text -- ����ɽ������ʸ��������
inoutPort -- �ݡ��Ȼ���ե饰
0:����ݡ��ͥ������ / 1:Inpot,Outport
[�����]
shape -- wx.Shape �����֥�������
"""
shape.SetDraggable(True, True)
shape.SetCanvas(self)
shape.SetX(x)
shape.SetY(y)
if pen: shape.SetPen(pen)
if brush: shape.SetBrush(brush)
if text: shape.AddText(text)
self.diagram.AddShape(shape)
shape.Show(True)
if inoutPort == 1: # make in/out port event handler
evthandler = MyPortEvtHandler(self.log, self.frame)
evthandler.SetShape(shape)
evthandler.SetPreviousHandler(shape.GetEventHandler())
shape.SetEventHandler(evthandler)
elif inoutPort == 0: # make body event handler
evthandler = MyEvtHandler(self.log, self.frame)
evthandler.SetShape(shape)
evthandler.SetPreviousHandler(shape.GetEventHandler())
shape.SetEventHandler(evthandler)
return shape
def OnDestroy(self, evt):
"""������ɥ�������٥�ȥϥ�ɥ�
[����]
evt -- ���٥��
[�����]
void
"""
# Do some cleanup
for shape in self.diagram.GetShapeList():
if shape.GetParent() == None:
shape.SetCanvas(None)
shape.Destroy()
self.diagram.Destroy()
def deleteShape(self,obj):
"""����������
[����]
�����Ԥ�Shape���֥�������
[�����]
void
"""
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
obj.parent.removeWidget(dc)
if hasattr(obj, "parent") and obj.parent.tag == 'body':
rtc_name = obj.parent.fullpath
if rtc_name in self.rtc_list:
tmp = self.rtc_list.index(rtc_name)
del self.rtc_list[tmp]
del self.rtc_dict[rtc_name]
if hasattr(obj, "parent") and obj.parent.tag == 'line':
idx = obj.parent.idx
if idx in canvas.line.keys():
del canvas.line[idx]
del obj
def deleteAllShape(self):
"""���٤Ƥο���������
[����]
�ʤ�
[�����]
void
"""
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
for s in canvas.selected:
s.Select(False, dc)
s.parent.unselected(dc)
shapeList = canvas.GetDiagram().GetShapeList()
for obj in shapeList:
self.deleteShape(obj)
canvas.selected = []
canvas.line = {}
canvas.Redraw(dc)
def deleteSelectedShape(self):
"""��������������
[����]
�ʤ�
[�����]
void
"""
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
for obj in canvas.selected:
self.deleteShape(obj)
canvas.selected = []
bdc = getBufferedDC(canvas)
canvas.PrepareDC(dc)
canvas.Redraw(dc)
def OnKeyDown(self, evt):
"""�����������Υ��٥�ȥϥ�ɥ�
��������������
[����]
evt -- ���٥��
[�����]
void
"""
evtKey = evt.GetKeyCode()
# DELETE �����λ�������Ƥ��������
if evtKey == wx.WXK_DELETE:
self.deleteSelectedShape()
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
bdc = getBufferedDC(canvas)
canvas.PrepareDC(bdc)
canvas.Redraw(bdc)
def OnPopupStart(self, evt):
"""����ݡ��ͥ�����ΤΥ������Ȥ�Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
pt = self.pt
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0:
tmpShape[0].parent.ref_start()
def OnPopupStop(self, evt):
"""����ݡ��ͥ�����ΤΥ��ȥåפ�Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
pt = self.pt
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0:
tmpShape[0].parent.ref_stop()
def OnPopupReset(self, evt):
pt = self.pt
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0:
tmpShape[0].parent.ref_reset()
def OnPopupExit(self, evt):
pt = self.pt
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0:
tmpShape[0].parent.ref_exit()
def OnPopupKill(self, evt):
pt = self.pt
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0:
tmpShape[0].parent.ref_kill()
def OnPopupDelete(self, evt):
"""����ݡ��ͥ�����Τκ����Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
pt = self.pt
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0:
tmpShape[0].parent.removeWidget(dc)
# rtc_name = tmpShape[0].parent.rtc.ref_key
rtc_name = tmpShape[0].parent.fullpath
del self.rtc_dict[rtc_name]
tmp = self.rtc_list.index(rtc_name)
del self.rtc_list[tmp]
for obj in canvas.selected:
if obj == tmpShape[0]:
tmp = canvas.selected.index(tmpShape[0])
del canvas.selected[tmp]
bdc = getBufferedDC(canvas)
canvas.PrepareDC(bdc)
# canvas.Redraw(bdc)
canvas.Redraw(dc)
def OnPopupSub(self, evt):
"""���֥�˥塼�μ¸��ѥ��ߡ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
print "OnPopupSub!!!"
def OnPopupDelSelectItem(self, evt):
"""���줿�����ƥ�κ����Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
self.deleteSelectedShape()
def OnPopupLoadXML(self, evt):
"""XML�ե�����(comp_data.xml)���ɤ߹��।�٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
self.loadXML()
def OnPopupSaveDefaultXML(self, evt):
"""XML�ե�����(������֥�)����।�٥�ȥϥ�ɥ�
�����¸
�ե�����̾:System?.xml ������ ? �ˤϲ����ֹ椬����
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
filename = "System%d.xml" % self.frame.drawCurNum
self.saveXML(filename)
def OnPopupSaveXML(self, evt):
"""XML�ե�����(������֥�)����।�٥�ȥϥ�ɥ�
�ե�����̾�ѹ�����¸
�ե�����̾�ϡ������������ǥ桼��Ǥ�ջ���
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
self.saveAsXML()
def OnPopupRefresh(self, evt):
"""Refresh������Ԥ����٥�ȥϥ�ɥ�
�Ť���³(����ݡ��ͥ�Ⱦ�ˤ���subuscribe�����롣���̤�����ɽ������Ƥ��ʤ�����)��
����Ȥ��ˡ�ok/cancel������������ɽ����������³�Ⱥǿ��Υ��ơ������ǿ����ѹ�����
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
canvas = self.diagram.GetCanvas()
# yes/no dialog
val = self.DelOldConnectAskDialog()
if val != wx.ID_OK:
return
self.refresh()
self.reConnect()
def checkOtherConnect(self):
ret = False
for rtc_name in self.rtc_list:
ret = self.rtc_dict[rtc_name].checkOtherConnect()
if ret == True:
break
return ret
def askDialog(self, str):
"""������������ɽ����ǽ
ok/cancel ������������ɽ������
[����]
str --- ������������ɽ�������å�����
[�����]
val --- �����������������(wx.ID_OK/wx.ID_CANCEL)
void
"""
# yes/no dialog
val = wx.ID_OK
dlg = RtmDialog(self, -1, str)
dlg.CenterOnParent()
val = dlg.ShowModal()
dlg.Destroy()
return val
def DelOldConnectAskDialog(self):
"""������������ɽ����ǽ
�Ť���³(����ݡ��ͥ�Ⱦ��subscribe��������̾�ˤ�����ɽ������Ƥ��ʤ�)������С�
ok/cancel ������������ɽ������
[����]
�ʤ�
[�����]
val --- �����������������(wx.ID_OK/wx.ID_CANCEL)
�Ť����ʤ����ϡ�wx.ID_OK���֤�
void
"""
# assembly dummy
# return wx.ID_OK
# assembly dummy
# yes/no dialog
val = wx.ID_OK
connect_flag = self.checkOtherConnect()
if connect_flag == True:
val = askDialog(strASKMESSAGE)
return val
def OnPopupConnectView(self, evt):
"""Connect��˥塼�ν�����Ԥ����٥�ȥϥ�ɥ�
������֥�ե������ɤ߹��߸����³��subscribe�˽���
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
canvas = self.diagram.GetCanvas()
# yes/no dialog
val = self.DelOldConnectAskDialog()
if val != wx.ID_OK:
return
canvas.viewMode = False
self.refresh()
self.reConnect()
def OnPopupDeleteView(self, evt):
"""Delete��˥塼�ν�����Ԥ����٥�ȥϥ�ɥ�
������֥�ե������ɤ߹��߸��ɽ�����������������
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
"""
self.deleteAllShape()
canvas = self.diagram.GetCanvas()
canvas.viewMode = False
def makeBodyPopupMenu(self, evt):
"""����ݡ��ͥ�Ⱦ�Υݥåץ��åץ�˥塼�ʥ���ƥ����ȥ�˥塼�˺���
����ݡ��ͥ�ȿ����Τ�On/Off��������˥塼ɽ��
[����]
evt -- ���٥��(wx.MouseEvent)�����
[�����]
void
"""
# ��˥塼��Ϣ�Υ��٥�Ȥ�CommandEvent�ǡ��ޥ������������ɸ���������ʤ�
# �����Ǥϡ���ɸ��self.pt�˳�Ǽ��ľ��Υ�˥塼���٥�Ȥǻ��Ѥ���
self.pt = evt.GetPosition()
if not hasattr(self, "popupID1"):
self.popupID1 = wx.NewId() # start menu
self.popupID2 = wx.NewId() # stop menu
self.popupID3 = wx.NewId() # delete menu
self.popupID4 = wx.NewId() # reset menu
self.popupID5 = wx.NewId() # exit menu
self.popupID6 = wx.NewId() # kill menu
self.Bind(wx.EVT_MENU, self.OnPopupStart, id = self.popupID1)
self.Bind(wx.EVT_MENU, self.OnPopupStop, id = self.popupID2)
self.Bind(wx.EVT_MENU, self.OnPopupDelete, id = self.popupID3)
self.Bind(wx.EVT_MENU, self.OnPopupReset, id = self.popupID4)
self.Bind(wx.EVT_MENU, self.OnPopupExit, id = self.popupID5)
self.Bind(wx.EVT_MENU, self.OnPopupKill, id = self.popupID6)
menu = wx.Menu()
menu.Append(self.popupID1, strSTART)
menu.Append(self.popupID2, strSTOP)
menu.Append(self.popupID4, strRESET)
menu.Append(self.popupID5, strEXIT)
menu.Append(self.popupID6, strKILL)
menu.AppendSeparator()
menu.Append(self.popupID3, strDELITEM)
self.PopupMenu(menu, evt.GetPosition())
menu.Destroy()
def makeBackgroundPopupMenu(self, evt ):
"""�Хå������ɾ�Υݥåץ��åץ�˥塼�ʥ���ƥ����ȥ�˥塼�˺���
����������ɡ������֤Υ�˥塼ɽ��
[����]
evt -- ���٥��(wx.MouseEvent)�����
[�����]
void
"""
# ��˥塼��Ϣ�Υ��٥�Ȥ�CommandEvent�ǡ��ޥ������������ɸ���������ʤ�
# �����Ǥϡ���ɸ��self.pt�˳�Ǽ��ľ��Υ�˥塼���٥�Ȥǻ��Ѥ���
self.pt = evt.GetPosition()
if not hasattr(self, "popupIDa"):
self.popupIDa = wx.NewId() # selected item delete menu
self.popupIDb = wx.NewId() # refresh menu
self.popupIDc = wx.NewId() # xml file load menu
self.popupIDd = wx.NewId() # xml file save menu
self.popupIDe = wx.NewId() # xml file save as menu
self.Bind(wx.EVT_MENU, self.OnPopupDelSelectItem,id = self.popupIDa)
self.Bind(wx.EVT_MENU, self.OnPopupRefresh, id = self.popupIDb)
self.Bind(wx.EVT_MENU, self.OnPopupLoadXML, id = self.popupIDc)
self.Bind(wx.EVT_MENU, self.OnPopupSaveDefaultXML, id = self.popupIDd)
self.Bind(wx.EVT_MENU, self.OnPopupSaveXML, id = self.popupIDe)
menu = wx.Menu()
menu.Append(self.popupIDa, strDEL_SELECT)
menu.AppendSeparator()
menu.Append(self.popupIDb, strREFRESH)
menu.AppendSeparator()
menu.Append(self.popupIDc, strOPEN)
menu.Append(self.popupIDd, strSAVE)
menu.Append(self.popupIDe, strSAVE_AS)
# assembly disable
# menu.FindItemById(self.popupIDc).Enable(False)
# menu.FindItemById(self.popupIDd).Enable(False)
# menu.FindItemById(self.popupIDe).Enable(False)
# assembly disable
self.PopupMenu(menu, evt.GetPosition())
menu.Destroy()
def makeViewModePopupMenu(self, evt ):
"""�Хå������ɾ�Υݥåץ��åץ�˥塼�ʥ���ƥ����ȥ�˥塼�˺���
Connect��Delete �Υ�˥塼ɽ��
[����]
evt -- ���٥��(wx.MouseEvent)�����
[�����]
void
"""
# ��˥塼��Ϣ�Υ��٥�Ȥ�CommandEvent�ǡ��ޥ������������ɸ���������ʤ�
# �����Ǥϡ���ɸ��self.pt�˳�Ǽ��ľ��Υ�˥塼���٥�Ȥǻ��Ѥ���
self.pt = evt.GetPosition()
if not hasattr(self, "popupID01"):
self.popupID01 = wx.NewId() # selected item delete menu
self.popupID02 = wx.NewId() # xml file load menu
self.Bind(wx.EVT_MENU, self.OnPopupConnectView,id = self.popupID01)
self.Bind(wx.EVT_MENU, self.OnPopupDeleteView, id = self.popupID02)
menu = wx.Menu()
menu.Append(self.popupID01, strASM_CONNECT)
menu.AppendSeparator()
menu.Append(self.popupID02, strASM_DELETE)
self.PopupMenu(menu, evt.GetPosition())
menu.Destroy()
def OnRightDown(self, evt):
"""������å���������Υ��٥�ȥϥ�ɥ�
�ޥ����������뤬Inport/Outport����ȡ��ġ�����åסʥХ롼��إ�סˤ�ɽ����Ԥ�
����ݡ��ͥ�����ξ�Ǥϡ��ݥåץ��åץ�˥塼��ɽ����Ԥ�
[����]
evt -- ���٥��
[�����]
void
"""
self.log.write("OnRightDown")
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
pt = evt.GetPosition()
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0:
if hasattr(tmpShape[0], 'parent'):
# Inport/Outport���
if tmpShape[0].parent.tag == 'in' or tmpShape[0].parent.tag == 'out':
# �ġ�����åפκ���
self.tooltip = makeToolTip(tmpShape[0].parent,pt,dc)
self.tooltip.body.SetCanvas(canvas)
self.diagram.AddShape(self.tooltip.body)
self.tooltip.body.Show(True)
# ����ݡ��ͥ�����Τν���
elif tmpShape[0].parent.tag == 'body' and canvas.viewMode == False:
self.makeBodyPopupMenu(evt)
else:
if canvas.viewMode == False:
self.makeBackgroundPopupMenu(evt)
else:
self.makeViewModePopupMenu(evt)
canvas.Redraw(dc)
evt.Skip()
def OnRightUp(self, evt):
"""������å������åפΥ��٥�ȥϥ�ɥ�
�ġ�����åסʥХ롼��إ�סˤκ����Ԥ�
[����]
evt -- ���٥��
[�����]
void
"""
self.log.write("OnRightUp")
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
pt = evt.GetPosition()
if self.tooltip != None:
# �ġ�����åפκ��
self.tooltip.removeWidget(dc)
del self.tooltip
self.tooltip = None
canvas.Redraw(dc)
evt.Skip()
def OnLeftDown(self, evt):
"""������å���������Υ��٥�ȥϥ�ɥ�
�����Х���ο����ʤ����֤Ǻ�����å����줿��������������
[����]
evt -- ���٥��
[�����]
void
"""
pt = evt.GetPosition()
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape == 0:
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
for s in canvas.selected:
s.Select(False, dc)
s.parent.unselected(dc)
canvas.selected = []
canvas.Redraw(dc)
else:
evt.Skip()
def OnMiddleDown(self, evt):
"""�ޥ�����ܥ�������Υ��٥�ȥϥ�ɥ�
����ݡ��ͥ�ȿ������ξ�Dz����줿�顢��ž������Ԥ�
[����]
evt -- ���٥��
[�����]
void
"""
pt = evt.GetPosition()
isShift = evt.ShiftDown()
canvas = self.diagram.GetCanvas()
dc = wx.ClientDC(self)
canvas.PrepareDC(dc)
for s in canvas.selected:
s.Select(False, dc)
s.parent.unselected(dc)
canvas.selected = []
canvas.Redraw(dc)
tmpShape = self.FindShape(pt[0],pt[1])
if tmpShape != 0 and tmpShape[0].parent.tag == 'body' and isShift != True: ## Middle Button
self.log.write("OnMiddleDown: " )
tmpShape[0].parent.reversesBody()
elif tmpShape != 0 and tmpShape[0].parent.tag == 'body' and isShift == True: ## Shift Key Down & Middle Button
self.log.write("OnMiddleDown + Shift Key: " )
tmpShape[0].parent.rotatesBody()
else:
evt.Skip()
canvas.Redraw(dc)
#----------------------------------------------------------------------
def runTest(frame, nb, log):
# This creates some pens and brushes that the OGL library uses.
# It should be called after the app object has been created, but
# before OGL is used.
ogl.OGLInitialize()
wx.lib.colourdb.updateColourDB()
win = TestWindow(nb, log, frame)
return win
#----------------------------------------------------------------------
# The OGL library holds some resources that need to be freed before
# the app shuts down.
class __Cleanup:
def __del__(self, cleanup=ogl.OGLCleanUp):
cleanup()
# When this module gets cleaned up by Python then __cu will be cleaned
# up and it's __dell__ is called, which will then call ogl.OGLCleanUp.
__cu = __Cleanup()
overview = """\
The Object Graphics Library is a library supporting the creation and
manipulation of simple and complex graphic images on a canvas.
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
""" 2936 log -- �������ϥ��饹�Υ��֥������� frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2937 frame -- ���ơ������С��Υ��֥������� ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2938 ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
2943 ogl.ShapeEvtHandler.__init__(self)
2945 ogl.ShapeEvtHandler.__init__(self)
2950 """�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2951 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2956 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2957 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2965 """�ɥ�å����˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2966 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2971 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2972 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2980 """�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2981 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2986 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2987 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2995 """�ޥ���������å��˸ƤФ�륤�٥�ȥϥ�ɥ� ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
2996 ������̤������pass�Τߡˤǥ��٥�Ȥ���Ͽ�����ǥե���Ȥ�ư�����
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3001 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3002 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3011 class MyEvtHandlerLine(ogl.ShapeEvtHandler):
3022 ogl.ShapeEvtHandler.__init__(self)
3025 """�ޥ���������å����˸ƤФ�륤�٥�ȥϥ�ɥ� �����������Ԥ�
��������Ǥϡ���ư�Ѥαߤ��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3027 ��������Ǥϡ���ư�Ѥαߤ��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3032 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3033 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3038 shape = self.GetShape()
3040 canvas = shape.GetCanvas()
3041 dc = wx.ClientDC(canvas)
3042 canvas.PrepareDC(dc)
3044 if shape
in canvas.selected:
3046 for obj
in shape.parent.lines:
3047 obj.Select(
False, dc)
3048 shape.parent.unselected(dc)
3049 for obj
in canvas.selected:
3051 obj.parent.unselected(dc)
3052 idx = canvas.selected.index(obj)
3053 del canvas.selected[idx]
3058 shapeList = canvas.GetDiagram().GetShapeList()
3060 if canvas.selected
and keys != 1:
3061 for s
in canvas.selected:
3063 s.parent.unselected(dc)
3064 canvas.selected = []
3067 shape.parent.selected()
3069 for obj
in shape.parent.lines:
3070 canvas.selected.append(obj)
3074 if (line.coordT ==
None)
or (len(line.coordT) == 2):
3078 num = len(line.coordT)
3080 for oval_id
in range(1,num-2):
3081 line_pos_0 = line.coordT[oval_id]
3082 line_pos_1 = line.coordT[oval_id+1]
3083 if line_pos_0[0] == line_pos_1[0]
and line_pos_0[1] != line_pos_1[1]:
3084 hight = line_pos_0[1] - line_pos_1[1]
3085 pos_y = line_pos_1[1] + (hight/2)
3086 pos_x = line_pos_0[0]
3087 tag = (oval_id,
"oval_width_pos")
3088 elif line_pos_0[0] != line_pos_1[0]
and line_pos_0[1] == line_pos_1[1] :
3089 width = line_pos_0[0] - line_pos_1[0]
3090 pos_x = line_pos_1[0] + (width/2)
3091 pos_y = line_pos_1[1]
3092 tag = (oval_id,
"oval_length_pos")
3093 line.oval_dict[oval_id] =
GRectOval(line, tag, pos_x, pos_y)
3094 line.parent.parent.parent.MyAddOval(line.oval_dict[oval_id].body, pos_x, pos_y)
3101 """����ݡ��ͥ�ȿ��ʻͳѷ������ΤΥ��٥�ȥ��饹""" 3106 log -- �������ϥ��饹�Υ��֥������� frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
3107 frame -- ���ơ������С��Υ��֥������� ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
3108 ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
3113 ogl.ShapeEvtHandler.__init__(self)
3119 """���ơ������С���ɽ���������ι��� 3122 shape -- ���Υ��֥������Ȥ����
[�����]
void
3127 x,y = shape.GetX(), shape.GetY()
3128 width, height = shape.GetBoundingBoxMax()
3129 self.statbarFrame.SetStatusText(
"Pos: (%d,%d) Size: (%d, %d)" %
3130 (x, y, width, height))
3134 """�ޥ���������å����˸ƤФ�륤�٥�ȥϥ�ɥ� ���Τ��������Ԥ�
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3140 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3141 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3146 shape = self.GetShape()
3148 canvas = shape.GetCanvas()
3149 dc = wx.ClientDC(canvas)
3150 canvas.PrepareDC(dc)
3153 ref = self.statbarFrame.myDict.GetObjRefToFullpath(shape.parent.fullpath)
3155 ref = ref._narrow(RTM.RTCBase)
3156 self.statbarFrame.profilepanel.RefreshProfile(ref._get_profile())
3161 if shape
in canvas.selected:
3164 canvas.lineFrom =
None 3165 shape.Select(
False, dc)
3166 shape.parent.unselected(dc)
3167 for obj
in canvas.selected:
3169 idx = canvas.selected.index(obj)
3170 del canvas.selected[idx]
3175 canvas.lineFrom =
None 3177 shapeList = canvas.GetDiagram().GetShapeList()
3179 shape.Select(
True, dc)
3180 shape.parent.selected()
3182 if canvas.selected
and keys != 1:
3183 for s
in canvas.selected:
3185 s.parent.unselected(dc)
3186 canvas.selected = []
3189 canvas.selected.append(shape)
3195 """�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ� ������֤��������ư
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3201 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3202 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3208 shape = self.GetShape()
3211 canvas = shape.GetCanvas()
3212 dc = wx.ClientDC(canvas)
3213 canvas.PrepareDC(dc)
3215 movex = x - shape.lastx
3216 movey = y - shape.lasty
3218 for obj
in canvas.selected:
3221 obj.parent.dmove(dc,movex,movey)
3223 obj.lastx = obj.GetX()
3224 obj.lasty = obj.GetY()
3226 if obj.parent.tag !=
'line':
3227 obj.Select(
True, dc)
3235 """�������ѹ���λ���˸ƤФ�륤�٥�ȥϥ�ɥ�
[����]
pt -- ����ȥ�����ݥ����
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3238 pt -- ����ȥ�����ݥ���� x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3241 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3242 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3248 self.base_OnSizingEndDragLeft(pt, x, y, keys, attch)
3250 shape = self.GetShape()
3251 canvas = shape.GetCanvas()
3252 dc = wx.ClientDC(canvas)
3253 canvas.PrepareDC(dc)
3255 width, height = shape.GetBoundingBoxMax()
3256 ratioW = width / shape.parent.lastBBoxWidth
3257 ratioH = height / shape.parent.lastBBoxHeight
3258 tmpx,tmpy = shape.GetX(), shape.GetY()
3260 shape.parent.updatePolygonSize(tmpx,tmpy,ratioW,ratioH)
3263 shape.parent.lastBBoxWidth, shape.parent.lastBBoxHeight = shape.GetBoundingBoxMax()
3266 """�ɥ�å����˸ƤФ�륤�٥�ȥϥ�ɥ� ������֤��������ư
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3272 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3273 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3278 shape = self.GetShape()
3279 canvas = shape.GetCanvas()
3281 if shape
not in canvas.selected:
3284 width, height = shape.GetBoundingBoxMax()
3285 self.statbarFrame.SetStatusText(
"Pos: (%d,%d) Size: (%d, %d)" %
3286 (x, y, width, height))
3291 canvas.PrepareDC(dc)
3294 movex = x - shape.lastx
3295 movey = y - shape.lasty
3296 for obj
in canvas.selected:
3297 obj.DeleteControlPoints()
3299 obj.parent.dmove(dc,movex,movey)
3301 obj.lastx = obj.GetX()
3302 obj.lasty = obj.GetY()
3307 """�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ�
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3312 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3313 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3318 shape = self.GetShape()
3319 canvas = shape.GetCanvas()
3320 dc = wx.ClientDC(canvas)
3321 canvas.PrepareDC(dc)
3322 if shape
not in canvas.selected:
3323 shape.DeleteControlPoints()
3325 if canvas.selected
and keys != 1:
3326 for s
in canvas.selected:
3328 s.parent.unselected(dc)
3329 canvas.selected = []
3332 shape.Select(
True, dc)
3333 shape.parent.selected()
3334 canvas.selected.append(shape)
3337 for s
in canvas.selected:
3338 if s.parent.tag ==
'line':
3340 s.parent.unselected(dc)
3341 idx = canvas.selected.index(s)
3342 del canvas.selected[idx]
3345 self.log.write(
"OnBeginDragLeft: %s, %s, %s\n" % (x, y, keys))
3352 """�ݡ��ȤΥ��٥�ȥ��饹""" 3357 log -- �������ϥ��饹�Υ��֥������� frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
3358 frame -- ���ơ������С��Υ��֥������� ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
3359 ���嵭�����ϡ�demo�ץ�������̾�ġ������
[�����]
void
3364 ogl.ShapeEvtHandler.__init__(self)
3370 """���ơ������С���ɽ���������ι��� 3373 shape -- ���Υ��֥������Ȥ����
[�����]
void
3378 x,y = shape.GetX(), shape.GetY()
3379 width, height = shape.GetBoundingBoxMax()
3380 self.statbarFrame.SetStatusText(
"Pos: (%d,%d) Size: (%d, %d)" %
3381 (x, y, width, height))
3385 """�ޥ���������å����˸ƤФ�륤�٥�ȥϥ�ɥ� ��������٤Ρ�������or��λ��������
��λ���������ϡ������֤��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3386 ��������٤Ρ�������or��λ�������� ��λ���������ϡ������֤��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3387 ��λ���������ϡ������֤�������� 3392 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3393 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3398 shape = self.GetShape()
3400 canvas = shape.GetCanvas()
3401 dc = wx.ClientDC(canvas)
3402 canvas.PrepareDC(dc)
3403 ref = shape.parent.ns_dict.GetObjRefToFullpath(shape.parent.fullpath)
3405 ref = ref._narrow(RTM.RTCBase)
3406 tmp = shape.parent.ns_dict.GetCompState(shape.parent.fullpath)
3407 if tmp >= RTM.RTComponent.RTC_ABORTING
or tmp == 0:
3416 if canvas.lineFrom ==
None:
3417 canvas.lineFrom = shape
3418 elif canvas.lineFrom != shape:
3419 if canvas.lineFrom.parent.tag ==
'in':
3423 if shape.parent.tag != checktag:
3425 if shape.parent.fullpath == canvas.lineFrom.parent.fullpath:
3428 canvas.lineTo = shape
3429 line =
GRtcLine(canvas,shape.parent)
3430 line.setLine2port(canvas, dc)
3431 line.g_outp.connect(line.idx, line.g_outp.subscription_type)
3433 canvas.lineFrom =
None 3434 canvas.lineTo =
None 3441 """�ɥ�å���λ���˸ƤФ�륤�٥�ȥϥ�ɥ� �ݡ��Ⱦ�˥ޥ����������뤬������������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3442 �ݡ��Ⱦ�˥ޥ����������뤬������������ 3447 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3448 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3453 shape = self.GetShape()
3454 ref = shape.parent.ns_dict.GetObjRefToFullpath(shape.parent.fullpath)
3456 ref = ref._narrow(RTM.RTCBase)
3457 tmp = shape.parent.ns_dict.GetCompState(shape.parent.fullpath)
3458 if tmp >= RTM.RTComponent.RTC_ABORTING
or tmp == 0:
3469 canvas = shape.GetCanvas()
3470 dc = wx.ClientDC(canvas)
3471 canvas.PrepareDC(dc)
3472 canvas.moveLine.removeWidget(dc)
3474 tmpShape = canvas.FindShape(x,y)
3475 if tmpShape == 0
or not hasattr(tmpShape[0],
"parent")
or not hasattr(tmpShape[0].parent,
"ns_dict"):
3477 ref = tmpShape[0].parent.ns_dict.GetObjRefToFullpath(tmpShape[0].parent.fullpath)
3479 ref = ref._narrow(RTM.RTCBase)
3480 tmp = tmpShape[0].parent.ns_dict.GetCompState(tmpShape[0].parent.fullpath)
3481 if tmp >= RTM.RTComponent.RTC_ABORTING
or tmp == 0:
3483 if shape.parent.fullpath == tmpShape[0].parent.fullpath:
3491 if canvas.lineFrom.parent.tag ==
'in':
3495 if tmpShape[0].parent.tag == checktag:
3496 canvas.lineTo = tmpShape[0]
3497 line =
GRtcLine(canvas,shape.parent)
3498 line.setLine2port(canvas, dc)
3499 line.g_outp.connect(line.idx, line.g_outp.subscription_type)
3501 canvas.lineFrom =
None 3502 canvas.lineTo =
None 3508 """�ɥ�å����˸ƤФ�륤�٥�ȥϥ�ɥ� �ޥ�����������Ȼ����֤��������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3509 �ޥ�����������Ȼ����֤�������� 3514 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3515 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3520 shape = self.GetShape()
3522 canvas = shape.GetCanvas()
3524 canvas.PrepareDC(dc)
3527 canvas.moveLine.setPoints(shape.GetX(), shape.GetY(), x, y)
3528 canvas.moveLine.lines[0].SetPen(wx.Pen(SELECTED_COLOR, 1))
3529 canvas.moveLine.lines[0].Show(
True)
3535 """�ɥ�å����ϻ��˸ƤФ�륤�٥�ȥϥ�ɥ� �ɥ�å��ˤ�������������γ���(���֥������ȥ�ե����¸�ߤ������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3536 �ɥ�å��ˤ�������������γ���(���֥������ȥ�ե����¸�ߤ������
[����]
x -- ���٥�Ȼ��Σ���ɸ
y -- ���٥�Ȼ��Σ���ɸ
keys -- �����������֡�SHIFT��CTRL��
attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3541 keys -- �����������֡�SHIFT��CTRL�� attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3542 attachment -- �����å����ȡ�̤���ѡ�
[�����]
void
3547 self.log.write(
"OnBeginDragLeft: %s, %s, %s\n" % (x, y, keys))
3549 shape = self.GetShape()
3550 ref = shape.parent.ns_dict.GetObjRefToFullpath(shape.parent.fullpath)
3552 ref = ref._narrow(RTM.RTCBase)
3553 tmp = shape.parent.ns_dict.GetCompState(shape.parent.fullpath)
3554 if tmp >= RTM.RTComponent.RTC_ABORTING
or tmp == 0:
3560 canvas = shape.GetCanvas()
3561 dc = wx.ClientDC(canvas)
3562 canvas.PrepareDC(dc)
3563 canvas.lineFrom = shape
3565 canvas.moveLine =
GRtcLine(canvas, shape.parent)
3566 canvas.moveLine.setPoints(shape.GetX(), shape.GetY(), x, y)
3567 canvas.moveLine.lines[0].SetPen(wx.Pen(SELECTED_COLOR, 1))
3568 canvas.moveLine.lines[0].Show(
True)
3578 """�������ѤΥ����Х��������饹""" 3583 log -- �������ϥ��饹�Υ��֥������� frame -- ���ơ������С��Υ��֥�������
���嵭�����ϡ�demo�ץ�������̾�ġ������
parent -- �ƥ�����ɥ������
[�����]
void
3584 frame -- ���ơ������С��Υ��֥������� ���嵭�����ϡ�demo�ץ�������̾�ġ������
parent -- �ƥ�����ɥ������
[�����]
void
3585 ���嵭�����ϡ�demo�ץ�������̾�ġ������ parent -- �ƥ�����ɥ������
[�����]
void
3586 parent -- �ƥ�����ɥ������
[�����]
void
3591 ogl.ShapeCanvas.__init__(self, parent)
3601 self.SetBackgroundColour(wx.WHITE)
3605 self.diagram.SetCanvas(self)
3609 canvas = self.diagram.GetCanvas()
3610 canvas.lineFrom =
None 3611 canvas.lineTo =
None 3614 canvas.moveLine =
None 3615 canvas.selected = []
3616 canvas.viewMode =
False 3618 rRectBrush = wx.Brush(
"MEDIUM TURQUOISE", wx.SOLID)
3619 dsBrush = wx.Brush(
"WHITE", wx.SOLID)
3623 self.SetDropTarget(dt)
3626 self.Bind(wx.EVT_WINDOW_DESTROY, self.
OnDestroy)
3627 self.Bind(wx.EVT_KEY_DOWN, self.
OnKeyDown)
3631 self.Bind(wx.EVT_RIGHT_UP, self.
OnRightUp)
3634 """����ݡ��ͥ��ñ�Το����ѹ���rtc_state()���ȡ�
[����]
fullname -- ����ݡ��ͥ�ȤΥե�ѥ�̾
[�����]
void
3637 fullname -- ����ݡ��ͥ�ȤΥե�ѥ�̾ 3644 self.
rtc_dict[fullname].changeBodyColor(state)
3645 self.
rtc_dict[fullname].state = state
3648 """����ݡ��Ȥθ���
[����]
inp_ref -- ����ݡ��ȤΥ��֥������ȥ�ե����
[�����]
g_inp -- ����ݡ��ȤΥǥ�������ʥ
3651 inp_ref -- ����ݡ��ȤΥ��֥������ȥ�ե���� 3654 g_inp -- ����ݡ��ȤΥǥ�������ʥ 3656 print "len rtc_list:",len(self.
rtc_list)
3659 ref = g_rtc.ns_dict.GetObjRefToFullpath(g_rtc.fullpath)
3661 print "len in_list:",len(g_rtc.in_list)
3662 for inp
in g_rtc.in_list :
3663 print "inp_ref:",inp_ref,
" == ", g_rtc.in_dict[inp[
'name']].inport[
'ref']
3664 if inp_ref._is_equivalent(g_rtc.in_dict[inp[
'name']].inport[
'ref']) :
3665 print "_is_equivalent is OK!!!" 3666 return g_rtc.in_dict[inp[
'name']]
3669 wildcard =
"*.xml |*.xml| *.* |*.*" 3670 dialog = wx.FileDialog( self, strOPEN_TITLE, defaultDir=os.getcwd(),
3671 defaultFile=
"", wildcard=wildcard, style=wx.OPEN)
3673 if dialog.ShowModal() != wx.ID_OK:
3676 openFileName = dialog.GetPath()
3687 print "open file is :",openFileName
3688 if openFileName ==
None:
3695 dict = rtxml.readXML(openFileName)
3697 canvas = self.diagram.GetCanvas()
3698 canvas.viewMode =
True 3702 wildcard =
"*.xml |*.xml| *.* |*.*" 3703 dialog = wx.FileDialog( self, strSAVE_AS_TITLE, defaultDir=os.getcwd(),
3704 defaultFile=
"", wildcard=wildcard, style=wx.SAVE)
3706 if dialog.ShowModal() != wx.ID_OK:
3709 saveFileName = dialog.GetPath()
3714 canvas = self.diagram.GetCanvas()
3723 x_size, y_size = comp.baseBox.GetBoundingBoxMin()
3724 if comp.lastRot ==
'TB':
3725 y_size, x_size = x_size, y_size
3727 x = comp.baseBox.GetX() - x_size/2
3728 y = comp.baseBox.GetY() - y_size/2
3730 dict[
'rtc'][name] = {}
3731 dict[
'rtc'][name][
'x'] = x
3732 dict[
'rtc'][name][
'y'] = y
3734 if comp.lastRot ==
'LR':
3735 if comp.revTogle == 1:
3736 dict[
'rtc'][name][
'rot'] =
'Right' 3738 dict[
'rtc'][name][
'rot'] =
'Left' 3740 if comp.rotTogle == 1:
3741 dict[
'rtc'][name][
'rot'] =
'Top' 3743 dict[
'rtc'][name][
'rot'] =
'Bottom' 3749 for line_idx
in canvas.line:
3750 out_obj = canvas.line[line_idx].g_outp
3751 in_obj = canvas.line[line_idx].g_inp
3755 tmp[
'pos'] = canvas.line[line_idx].coordT
3756 tmp[
'in-comp'] = in_obj.fullpath
3757 tmp[
'in-name'] = in_obj.inport[
'name']
3758 tmp[
'out-comp'] = out_obj.fullpath
3759 tmp[
'out-name'] = out_obj.outport[
'name']
3771 rtxml.writeXML(saveFileName, dict)
3775 if saveFileName ==
None:
3781 """��ե�å������ ����ݡ��ͥ�ȵڤӡ�ɽ�����Υ�ե�å����Ԥ�
[����]
�ʤ�
[�����]
void
3782 ����ݡ��ͥ�ȵڤӡ�ɽ�����Υ�ե�å����Ԥ� 3790 canvas = self.diagram.GetCanvas()
3791 dc = wx.ClientDC(canvas)
3792 canvas.PrepareDC(dc)
3793 for obj
in canvas.selected:
3794 obj.Select(
False, dc)
3795 obj.parent.unselected(dc)
3796 canvas.selected = []
3800 self.
rtc_dict[rtc_name].refresh_outp()
3803 """����³���� ���̾�Υ���ݡ��ͥ�Ȥκ���³������ƤӽФ�
[����]
�ʤ�
[�����]
void
3804 ���̾�Υ���ݡ��ͥ�Ȥκ���³������ƤӽФ� 3816 self.
rtc_dict[rtc_name].reConnectLine()
3826 """�ǥ�������ʥ���饳��ݡ��ͥ�ȿ������� 3829 dict -- ������֥�Υǥ�������ʥ 3834 canvas = self.diagram.GetCanvas()
3835 dc = wx.ClientDC(canvas)
3836 canvas.PrepareDC(dc)
3838 rtc_list = dict[
'rtc'].
keys()
3843 for rtc_name
in rtc_list:
3847 ref = self.frame.myDict.GetObjRefToFullpath(rtc_name)
3849 print 'Component Create error!: %s'%rtc_name
3851 ref = ref._narrow(RTM.RTCBase)
3852 tmp = self.frame.myDict.GetCompState(rtc_name)
3856 err_mess =
'Component Create error:%s\n'%rtc_name
3860 new_list.append(rtc_name)
3862 pos_x = dict[
'rtc'][rtc_name][
'x']
3863 pos_y = dict[
'rtc'][rtc_name][
'y']
3864 comp =
GRtc(self, rtc_name, pos_x, pos_y)
3865 comp.changeBodyColor(
'virtual')
3868 if dict[
'rtc'][rtc_name][
'rot'] ==
'Left':
3870 elif dict[
'rtc'][rtc_name][
'rot'] ==
'Top':
3872 elif dict[
'rtc'][rtc_name][
'rot'] ==
'Bottom':
3878 if len(new_list) == 0:
3879 canvas.viewMode =
False 3884 for line_num
in range(len(dict[
'line'])):
3885 line_dict = dict[
'line'][line_num]
3886 out_comp_name = line_dict[
'out-comp']
3887 out_name = line_dict[
'out-name']
3889 in_comp_name = line_dict[
'in-comp']
3890 in_name = line_dict[
'in-name']
3893 if not self.rtc_dict.has_key(out_comp_name):
3894 print 'Assembly Check: Port Connection Error!:',out_comp_name
3896 if not self.
rtc_dict[out_comp_name].out_dict.has_key(out_name):
3897 print 'Assembly Check: Port Connection Error!: ',out_comp_name,
":",out_name
3899 if not self.rtc_dict.has_key(in_comp_name):
3900 print 'Assembly Check: Port Connection Error!:',in_comp_name
3902 if not self.
rtc_dict[in_comp_name].in_dict.has_key(in_name):
3903 print 'Assembly Check: Port Connection Error!: ',in_comp_name,
":",in_name
3906 outp_obj = self.
rtc_dict[out_comp_name].out_dict[out_name]
3907 inp_obj = self.
rtc_dict[in_comp_name].in_dict[in_name]
3909 canvas.lineFrom = outp_obj.body
3910 canvas.lineTo = inp_obj.body
3912 line.setLine2port(canvas, dc)
3913 line.g_outp.connect(line.idx, line.g_outp.subscription_type)
3917 pos_list = string.splitfields(line_dict[
'pos'],
',')
3918 for num
in range(len(pos_list)/2):
3919 pos.append((string.atof(pos_list[num*2]),string.atof(pos_list[num*2+1])))
3922 line.childMove(dc, pos)
3924 canvas.lineFrom =
None 3925 canvas.lineTo =
None 3930 �����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ� 3933 shape -- �ӥåȥޥå������ x -- ɽ���������ɸ
y -- ɽ���������ɸ
pen -- �ڥ�ʿ��������ˤ����
[�����]
shape -- wx.Shape �����֥�������
3936 pen -- �ڥ�ʿ��������ˤ����
[�����]
shape -- wx.Shape �����֥�������
3939 shape -- wx.Shape �����֥������� 3941 shape.SetDraggable(
False,
False)
3942 shape.SetCanvas(self)
3943 if pen: shape.SetPen(pen)
3946 self.diagram.AddShape(shape)
3948 evthandler.SetShape(shape)
3949 evthandler.SetPreviousHandler(shape.GetEventHandler())
3950 shape.SetEventHandler(evthandler)
3957 �����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ� 3960 shape -- �ӥåȥޥå������ x -- ɽ���������ɸ
y -- ɽ���������ɸ
[�����]
shape -- wx.Shape �����֥�������
3965 shape -- wx.Shape �����֥������� 3967 shape.SetDraggable(
True,
False)
3968 shape.SetCanvas(self)
3971 self.diagram.AddShape(shape)
3973 evthandler.SetShape(shape)
3974 evthandler.SetPreviousHandler(shape.GetEventHandler())
3975 shape.SetEventHandler(evthandler)
3982 �����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ� 3985 shape -- �ӥåȥޥå������ x -- ɽ���������ɸ
y -- ɽ���������ɸ
pen -- �ڥ�ʿ��������ˤ����
burush -- �֥饷�ʿ��ˤ����
[�����]
shape -- wx.Shape �����֥�������
3988 pen -- �ڥ�ʿ��������ˤ���� burush -- �֥饷�ʿ��ˤ����
[�����]
shape -- wx.Shape �����֥�������
3989 burush -- �֥饷�ʿ��ˤ����
[�����]
shape -- wx.Shape �����֥�������
3992 shape -- wx.Shape �����֥������� 3994 shape.SetDraggable(
False,
False)
3995 shape.SetCanvas(self)
3998 if pen: shape.SetPen(pen)
3999 if brush: shape.SetBrush(brush)
4000 self.diagram.AddShape(shape)
4002 evthandler.SetShape(shape)
4003 evthandler.SetPreviousHandler(shape.GetEventHandler())
4004 shape.SetEventHandler(evthandler)
4009 def MyAddShape(self, shape, x, y, pen, brush, text, inoutPort=0):
4010 """����ݡ��ͥ�ȿ����ݡ��ȿ�����Ͽ 4011 �����Х�������������ࡢ���٥�ȤȤδ�Ϣ�դ� 4014 shape -- �ӥåȥޥå������ x -- ɽ���������ɸ
y -- ɽ���������ɸ
pen -- �ڥ�ʿ��������ˤ����
burush -- �֥饷�ʿ��ˤ����
text -- ����ɽ������ʸ��������
inoutPort -- �ݡ��Ȼ���ե饰
0:����ݡ��ͥ������ / 1:Inpot,Outport
[�����]
shape -- wx.Shape �����֥�������
4017 pen -- �ڥ�ʿ��������ˤ���� burush -- �֥饷�ʿ��ˤ����
text -- ����ɽ������ʸ��������
inoutPort -- �ݡ��Ȼ���ե饰
0:����ݡ��ͥ������ / 1:Inpot,Outport
[�����]
shape -- wx.Shape �����֥�������
4018 burush -- �֥饷�ʿ��ˤ���� text -- ����ɽ������ʸ��������
inoutPort -- �ݡ��Ȼ���ե饰
0:����ݡ��ͥ������ / 1:Inpot,Outport
[�����]
shape -- wx.Shape �����֥�������
4019 text -- ����ɽ������ʸ�������� inoutPort -- �ݡ��Ȼ���ե饰
0:����ݡ��ͥ������ / 1:Inpot,Outport
[�����]
shape -- wx.Shape �����֥�������
4020 inoutPort -- �ݡ��Ȼ���ե饰 4021 0:����ݡ��ͥ������ / 1:Inpot,Outport 4024 shape -- wx.Shape �����֥������� 4026 shape.SetDraggable(
True,
True)
4027 shape.SetCanvas(self)
4030 if pen: shape.SetPen(pen)
4031 if brush: shape.SetBrush(brush)
4032 if text: shape.AddText(text)
4033 self.diagram.AddShape(shape)
4038 evthandler.SetShape(shape)
4039 evthandler.SetPreviousHandler(shape.GetEventHandler())
4040 shape.SetEventHandler(evthandler)
4041 elif inoutPort == 0:
4043 evthandler.SetShape(shape)
4044 evthandler.SetPreviousHandler(shape.GetEventHandler())
4045 shape.SetEventHandler(evthandler)
4050 """������ɥ�������٥�ȥϥ�ɥ�
[����]
evt -- ���٥��
[�����]
void
4053 evt -- ���٥��
[�����]
void
4059 for shape
in self.diagram.GetShapeList():
4060 if shape.GetParent() ==
None:
4061 shape.SetCanvas(
None)
4064 self.diagram.Destroy()
4067 """����������
[����]
�����Ԥ�Shape���֥�������
[�����]
void
4070 �����Ԥ�Shape���֥�������
[�����]
void
4075 canvas = self.diagram.GetCanvas()
4076 dc = wx.ClientDC(self)
4077 canvas.PrepareDC(dc)
4078 obj.parent.removeWidget(dc)
4080 if hasattr(obj,
"parent")
and obj.parent.tag ==
'body':
4081 rtc_name = obj.parent.fullpath
4083 tmp = self.rtc_list.index(rtc_name)
4086 if hasattr(obj,
"parent")
and obj.parent.tag ==
'line':
4087 idx = obj.parent.idx
4088 if idx
in canvas.line.keys():
4089 del canvas.line[idx]
4094 """���٤Ƥο���������
[����]
�ʤ�
[�����]
void
4102 canvas = self.diagram.GetCanvas()
4103 dc = wx.ClientDC(self)
4104 canvas.PrepareDC(dc)
4106 for s
in canvas.selected:
4108 s.parent.unselected(dc)
4110 shapeList = canvas.GetDiagram().GetShapeList()
4111 for obj
in shapeList:
4114 canvas.selected = []
4120 """��������������
[����]
�ʤ�
[�����]
void
4128 canvas = self.diagram.GetCanvas()
4129 dc = wx.ClientDC(self)
4130 canvas.PrepareDC(dc)
4131 for obj
in canvas.selected:
4134 canvas.selected = []
4136 canvas.PrepareDC(dc)
4141 """�����������Υ��٥�ȥϥ�ɥ� ������ο���������
[����]
evt -- ���٥��
[�����]
void
4142 ��������������
[����]
evt -- ���٥��
[�����]
void
4145 evt -- ���٥��
[�����]
void
4150 evtKey = evt.GetKeyCode()
4152 if evtKey == wx.WXK_DELETE:
4155 canvas = self.diagram.GetCanvas()
4156 dc = wx.ClientDC(self)
4157 canvas.PrepareDC(dc)
4159 canvas.PrepareDC(bdc)
4163 """����ݡ��ͥ�����ΤΥ������Ȥ�Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4166 evt -- ���٥��(wx.CommandEvent) 4172 tmpShape = self.FindShape(pt[0],pt[1])
4174 tmpShape[0].parent.ref_start()
4177 """����ݡ��ͥ�����ΤΥ��ȥåפ�Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4180 evt -- ���٥��(wx.CommandEvent) 4186 tmpShape = self.FindShape(pt[0],pt[1])
4188 tmpShape[0].parent.ref_stop()
4192 tmpShape = self.FindShape(pt[0],pt[1])
4194 tmpShape[0].parent.ref_reset()
4198 tmpShape = self.FindShape(pt[0],pt[1])
4200 tmpShape[0].parent.ref_exit()
4204 tmpShape = self.FindShape(pt[0],pt[1])
4206 tmpShape[0].parent.ref_kill()
4209 """����ݡ��ͥ�����Τκ����Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4212 evt -- ���٥��(wx.CommandEvent) 4217 canvas = self.diagram.GetCanvas()
4218 dc = wx.ClientDC(self)
4219 canvas.PrepareDC(dc)
4221 tmpShape = self.FindShape(pt[0],pt[1])
4223 tmpShape[0].parent.removeWidget(dc)
4226 rtc_name = tmpShape[0].parent.fullpath
4228 tmp = self.rtc_list.index(rtc_name)
4231 for obj
in canvas.selected:
4232 if obj == tmpShape[0]:
4233 tmp = canvas.selected.index(tmpShape[0])
4234 del canvas.selected[tmp]
4236 canvas.PrepareDC(bdc)
4241 """���֥�˥塼�μ¸��ѥ��ߡ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4244 evt -- ���٥��(wx.CommandEvent) 4249 print "OnPopupSub!!!" 4252 """���줿�����ƥ�κ����Ԥ����٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4255 evt -- ���٥��(wx.CommandEvent) 4263 """XML�ե�����(comp_data.xml)���ɤ߹��।�٥�ȥϥ�ɥ�
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4266 evt -- ���٥��(wx.CommandEvent) 4274 """XML�ե�����(������֥�)����।�٥�ȥϥ�ɥ� �����¸
�ե�����̾:System?.xml ������ ? �ˤϲ����ֹ椬����
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4276 �ե�����̾:System?.xml ������ ? �ˤϲ����ֹ椬����
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4279 evt -- ���٥��(wx.CommandEvent) 4284 filename =
"System%d.xml" % self.frame.drawCurNum
4288 """XML�ե�����(������֥�)����।�٥�ȥϥ�ɥ� �ե�����̾�ѹ�����¸
�ե�����̾�ϡ������������ǥ桼��Ǥ�ջ���
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4290 �ե�����̾�ϡ������������ǥ桼��Ǥ�ջ���
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4293 evt -- ���٥��(wx.CommandEvent) 4301 """Refresh������Ԥ����٥�ȥϥ�ɥ� �Ť���³(����ݡ��ͥ�Ⱦ�ˤ���subuscribe�����롣���̤�����ɽ������Ƥ��ʤ�����)��
����Ȥ��ˡ�ok/cancel������������ɽ����������³�Ⱥǿ��Υ��ơ������ǿ����ѹ�����
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4302 �Ť���³(����ݡ��ͥ�Ⱦ�ˤ���subuscribe�����롣���̤�����ɽ������Ƥ��ʤ�����)�� 4303 ����Ȥ��ˡ�ok/cancel������������ɽ����������³�Ⱥǿ��Υ��ơ������ǿ����ѹ�����
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4306 evt -- ���٥��(wx.CommandEvent) 4311 canvas = self.diagram.GetCanvas()
4329 """������������ɽ����ǽ 4330 ok/cancel ������������ɽ������
[����]
str --- ������������ɽ�������å�����
[�����]
val --- �����������������(wx.ID_OK/wx.ID_CANCEL)
void
4333 str --- ������������ɽ�������å����� 4336 val --- �����������������(wx.ID_OK/wx.ID_CANCEL) 4343 dlg.CenterOnParent()
4344 val = dlg.ShowModal()
4350 """������������ɽ����ǽ 4351 �Ť���³(����ݡ��ͥ�Ⱦ��subscribe��������̾�ˤ�����ɽ������Ƥ��ʤ�)������С� 4352 ok/cancel ������������ɽ������
[����]
�ʤ�
[�����]
val --- �����������������(wx.ID_OK/wx.ID_CANCEL)
�Ť����ʤ����ϡ�wx.ID_OK���֤�
void
4358 val --- �����������������(wx.ID_OK/wx.ID_CANCEL) 4359 �Ť����ʤ����ϡ�wx.ID_OK���֤� 4368 if connect_flag ==
True:
4373 """Connect��˥塼�ν�����Ԥ����٥�ȥϥ�ɥ� ������֥�ե������ɤ߹��߸����³��subscribe�˽���
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4374 ������֥�ե������ɤ߹��߸����³��subscribe�˽���
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4377 evt -- ���٥��(wx.CommandEvent) 4382 canvas = self.diagram.GetCanvas()
4388 canvas.viewMode =
False 4393 """Delete��˥塼�ν�����Ԥ����٥�ȥϥ�ɥ� ������֥�ե������ɤ߹��߸��ɽ�����������������
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4394 ������֥�ե������ɤ߹��߸��ɽ�����������������
[����]
evt -- ���٥��(wx.CommandEvent)
[�����]
void
4397 evt -- ���٥��(wx.CommandEvent) 4403 canvas = self.diagram.GetCanvas()
4404 canvas.viewMode =
False 4407 """����ݡ��ͥ�Ⱦ�Υݥåץ��åץ�˥塼�ʥ���ƥ����ȥ�˥塼�˺��� 4408 ����ݡ��ͥ�ȿ����Τ�On/Off��������˥塼ɽ�� 4411 evt -- ���٥��(wx.MouseEvent)�����
[�����]
void
4418 self.
pt = evt.GetPosition()
4419 if not hasattr(self,
"popupID1"):
4436 menu.Append(self.
popupID1, strSTART)
4437 menu.Append(self.
popupID2, strSTOP)
4438 menu.Append(self.
popupID4, strRESET)
4439 menu.Append(self.
popupID5, strEXIT)
4440 menu.Append(self.
popupID6, strKILL)
4441 menu.AppendSeparator()
4442 menu.Append(self.
popupID3, strDELITEM)
4444 self.PopupMenu(menu, evt.GetPosition())
4448 """�Хå������ɾ�Υݥåץ��åץ�˥塼�ʥ���ƥ����ȥ�˥塼�˺��� 4449 ����������ɡ������֤Υ�˥塼ɽ�� 4452 evt -- ���٥��(wx.MouseEvent)�����
[�����]
void
4459 self.
pt = evt.GetPosition()
4460 if not hasattr(self,
"popupIDa"):
4474 menu.Append(self.
popupIDa, strDEL_SELECT)
4475 menu.AppendSeparator()
4476 menu.Append(self.
popupIDb, strREFRESH)
4477 menu.AppendSeparator()
4478 menu.Append(self.
popupIDc, strOPEN)
4479 menu.Append(self.
popupIDd, strSAVE)
4480 menu.Append(self.
popupIDe, strSAVE_AS)
4488 self.PopupMenu(menu, evt.GetPosition())
4492 """�Хå������ɾ�Υݥåץ��åץ�˥塼�ʥ���ƥ����ȥ�˥塼�˺��� 4493 Connect��Delete �Υ�˥塼ɽ�� 4496 evt -- ���٥��(wx.MouseEvent)�����
[�����]
void
4503 self.
pt = evt.GetPosition()
4504 if not hasattr(self,
"popupID01"):
4512 menu.Append(self.
popupID01, strASM_CONNECT)
4513 menu.AppendSeparator()
4514 menu.Append(self.
popupID02, strASM_DELETE)
4516 self.PopupMenu(menu, evt.GetPosition())
4520 """������å���������Υ��٥�ȥϥ�ɥ� �ޥ����������뤬Inport/Outport����ȡ��ġ�����åסʥХ롼��إ�סˤ�ɽ����Ԥ�
����ݡ��ͥ�����ξ�Ǥϡ��ݥåץ��åץ�˥塼��ɽ����Ԥ�
[����]
evt -- ���٥��
[�����]
void
4521 �ޥ����������뤬Inport/Outport����ȡ��ġ�����åסʥХ롼��إ�סˤ�ɽ����Ԥ� 4522 ����ݡ��ͥ�����ξ�Ǥϡ��ݥåץ��åץ�˥塼��ɽ����Ԥ� 4525 evt -- ���٥��
[�����]
void
4530 self.log.write(
"OnRightDown")
4531 canvas = self.diagram.GetCanvas()
4532 dc = wx.ClientDC(self)
4533 canvas.PrepareDC(dc)
4534 pt = evt.GetPosition()
4535 tmpShape = self.FindShape(pt[0],pt[1])
4537 if hasattr(tmpShape[0],
'parent'):
4539 if tmpShape[0].parent.tag ==
'in' or tmpShape[0].parent.tag ==
'out':
4543 self.tooltip.body.SetCanvas(canvas)
4544 self.diagram.AddShape(self.tooltip.body)
4545 self.tooltip.body.Show(
True)
4547 elif tmpShape[0].parent.tag ==
'body' and canvas.viewMode ==
False:
4550 if canvas.viewMode ==
False:
4559 """������å������åפΥ��٥�ȥϥ�ɥ� �ġ�����åסʥХ롼��إ�סˤκ����Ԥ�
[����]
evt -- ���٥��
[�����]
void
4560 �ġ�����åסʥХ롼��إ�סˤκ����Ԥ� 4563 evt -- ���٥��
[�����]
void
4568 self.log.write(
"OnRightUp")
4569 canvas = self.diagram.GetCanvas()
4570 dc = wx.ClientDC(self)
4571 canvas.PrepareDC(dc)
4572 pt = evt.GetPosition()
4575 self.tooltip.removeWidget(dc)
4582 """������å���������Υ��٥�ȥϥ�ɥ� �����Х���ο����ʤ����֤Ǻ�����å����줿��������������
[����]
evt -- ���٥��
[�����]
void
4583 �����Х���ο����ʤ����֤Ǻ�����å����줿��������������
[����]
evt -- ���٥��
[�����]
void
4586 evt -- ���٥��
[�����]
void
4591 pt = evt.GetPosition()
4592 tmpShape = self.FindShape(pt[0],pt[1])
4594 canvas = self.diagram.GetCanvas()
4595 dc = wx.ClientDC(self)
4596 canvas.PrepareDC(dc)
4597 for s
in canvas.selected:
4599 s.parent.unselected(dc)
4600 canvas.selected = []
4606 """�ޥ�����ܥ�������Υ��٥�ȥϥ�ɥ� ����ݡ��ͥ�ȿ������ξ�Dz����줿�顢��ž������Ԥ�
[����]
evt -- ���٥��
[�����]
void
4607 ����ݡ��ͥ�ȿ������ξ�Dz����줿�顢��ž������Ԥ� 4610 evt -- ���٥��
[�����]
void
4615 pt = evt.GetPosition()
4616 isShift = evt.ShiftDown()
4617 canvas = self.diagram.GetCanvas()
4618 dc = wx.ClientDC(self)
4619 canvas.PrepareDC(dc)
4620 for s
in canvas.selected:
4622 s.parent.unselected(dc)
4623 canvas.selected = []
4626 tmpShape = self.FindShape(pt[0],pt[1])
4627 if tmpShape != 0
and tmpShape[0].parent.tag ==
'body' and isShift !=
True:
4628 self.log.write(
"OnMiddleDown: " )
4629 tmpShape[0].parent.reversesBody()
4630 elif tmpShape != 0
and tmpShape[0].parent.tag ==
'body' and isShift ==
True:
4631 self.log.write(
"OnMiddleDown + Shift Key: " )
4632 tmpShape[0].parent.rotatesBody()
4645 wx.lib.colourdb.updateColourDB()
4646 win = TestWindow(nb, log, frame)
4664 The Object Graphics Library is a library supporting the creation and 4665 manipulation of simple and complex graphic images on a canvas. 4669 if __name__ ==
'__main__':
4672 run.main([
'', os.path.basename(sys.argv[0])] + sys.argv[1:])
def __init__(self, parent, points)
def OnPopupDelete(self, evt)
def __del__(self, cleanup=ogl.OGLCleanUp)
def OnPopupDelSelectItem(self, evt)
def OnSizingEndDragLeft(self, pt, x, y, keys, attch)
def OnDragLeft(self, draw, x, y, keys, attachment)
def disconnectToObjref(self, subscr_list)
def __init__(self, log, frame)
def removeWidget(self, dc, rot=0)
def OnPopupConnectView(self, evt)
def MyAddShape(self, shape, x, y, pen, brush, text, inoutPort=0)
def __init__(self, parent)
def delLineIdx(self, idx)
def deleteSelectedShape(self)
def dmove(self, dc, movex, movey)
def MyAddBmp(self, shape, x, y, pen)
def saveXML(self, saveFileName)
def OnBeginDragLeft(self, x, y, keys, attachment)
def disconnect(self, line_idx)
def removeWidget(self, dc)
def OnEndDragLeft(self, x, y, keys=0, attachment=0)
def createWidget(self, rot)
def OnMiddleDown(self, evt)
def connect2(self, line_idx, subscription_type)
def updateInportPolygon(self, points)
def runTest(frame, nb, log)
def OnPopupRefresh(self, evt)
def dmove(self, dc, d_x, d_y)
def setBodyColor(shape, colorFlag)
def __init__(self, parent, ns_dict, fullpath, inp, pos_x, pos_y)
def dmove(self, dc, movex, movey)
def OnEndDragLeft(self, x, y, keys=0, attachment=0)
def OnPopupReset(self, evt)
def UpdateStatusBar(self, shape)
def MyAddOval(self, shape, x, y)
def childMove(self, dc, pos_new)
def checkOtherConnect(self)
def dmove(self, dc, movex, movey)
def __init__(self, canvas, parent)
def getConfig(self, name)
def OnLeftClick(self, x, y, keys=0, attachment=0)
def __init__(self, log, frame)
def OnPopupLoadXML(self, evt)
def MyAddText(self, shape, x, y, pen, brush=None)
def setPoints(self, startX, startY, endX, endY)
def OnBeginDragLeft(self, x, y, keys=0, attachment=0)
def makeBackgroundPopupMenu(self, evt)
def OnBeginDragLeft(self, x, y, keys, attachment)
def __init__(self, parent, points)
def OnSizingEndDragLeft(self, pt, x, y, keys, attch)
def OnRightDown(self, evt)
def setLine2port(self, canvas, dc)
def __init__(self, parent, tag, pos_x, pos_y)
def __init__(self, log, frame)
def getConfig(self, name)
def __init__(self, log, frame)
def __init__(self, parent, log)
def OnDragOver(self, x, y, d)
def __init__(self, parent, width, height)
def __init__(self, parent, log, frame)
def updatePolygonSize(self, x, y, ratioW, ratioH)
def connect(self, line_idx, subscription_type)
def OnPopupKill(self, evt)
def UpdateStatusBar(self, shape)
def OnDropText(self, x, y, text)
def OnLeftClick(self, x, y, keys=0, attachment=0)
def __init__(self, parent, canvas)
def setEndPoint(self, dc, shape, movex, movey)
def makeBodyPopupMenu(self, evt)
def OnPopupSaveDefaultXML(self, evt)
void append(SDOPackage::NVList &dest, const SDOPackage::NVList &src)
Append an element to NVList.
def setPoints(self, startX, startY, endX, endY)
def OnLeftClick(self, x, y, keys=0, attachment=0)
def OnDragLeft(self, draw, x, y, keys, attachment)
def __init__(self, parent, pos_x, pos_y, width, height)
def updatePolygonSize(self, x, y, ratioW, ratioH)
def makeViewModePopupMenu(self, evt)
def OnPopupExit(self, evt)
def OnPopupSaveXML(self, evt)
def setStartPoint(self, dc, movex, movey)
def getBufferedDC(canvas)
def OnPopupDeleteView(self, evt)
def __init__(self, parent, ns_dict, fullpath, outp, pos_x, pos_y)
def updatePolygonSize(self, x, y, ratioW, ratioH)
def disconnect(self, line_idx)
def delLineIdx(self, idx)
def OnBeginDragLeft(self, x, y, keys, attachment)
def OnBeginDragLeft(self, x, y, keys, attachment)
def removeWidget(self, dc, rot=0)
def checkConnect(self, inp_obj, subscr_list)
def __init__(self, parent, fullpath, pos_x, pos_y)
def OnDragLeft(self, draw, x, y, keys, attachment)
def checkOtherConnect(self)
def search_g_inp(self, inp_ref)
def __init__(self, log, frame)
def removeWidget(self, dc)
def OnLeftClick(self, x, y, keys=0, attachment=0)
def changeCoordT(self, id, new_p1, new_p2)
def OnPopupSub(self, evt)
def changeCompColor(self, fullname, state)
def removeWidget(self, dc, rot=0)
def OnDragLeft(self, draw, x, y, keys=0, attachment=0)
def checkOtherConnect(self)
def OnLeftDown(self, evt)
def __init__(self, parent, width, height)
def createGRtc_from_dict(self, dict)
def OnPopupStop(self, evt)
def checkConnect2(self, line, subscr_list)
def OnLeftClick(self, x, y, keys=0, attachment=0)
def OnEndDragLeft(self, x, y, keys=0, attachment=0)
def connect(self, line_idx)
def DelOldConnectAskDialog(self)
def OnEndDragLeft(self, x, y, keys=0, attachment=0)
def changeBodyColor(self, state)
def remove(self, dc, canvas)
def updateOutportPolygon(self, points)
def dmove(self, dc, movex, movey)
def OnPopupStart(self, evt)
def deleteShape(self, obj)
def OnEndDragLeft(self, x, y, keys=0, attachment=0)