22 # along with this program; if not, write to the Free Software |
22 # along with this program; if not, write to the Free Software |
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
24 |
24 |
25 |
25 |
26 from __future__ import absolute_import |
26 from __future__ import absolute_import |
|
27 from __future__ import division |
27 from types import * |
28 from types import * |
28 |
29 |
29 import wx |
30 import wx |
30 |
31 |
31 from editors.Viewer import * |
32 from editors.Viewer import * |
532 self.RefreshStepModel(self.SelectedElement) |
533 self.RefreshStepModel(self.SelectedElement) |
533 connectors = self.SelectedElement.GetConnectors() |
534 connectors = self.SelectedElement.GetConnectors() |
534 pos = connectors["action"].GetPosition(False) |
535 pos = connectors["action"].GetPosition(False) |
535 id = self.GetNewId() |
536 id = self.GetNewId() |
536 actionblock = SFC_ActionBlock(self, [], id) |
537 actionblock = SFC_ActionBlock(self, [], id) |
537 actionblock.SetPosition(pos.x + SFC_WIRE_MIN_SIZE, pos.y - SFC_STEP_DEFAULT_SIZE[1] / 2) |
538 actionblock.SetPosition(pos.x + SFC_WIRE_MIN_SIZE, pos.y - SFC_STEP_DEFAULT_SIZE[1] // 2) |
538 actionblock_connector = actionblock.GetConnector() |
539 actionblock_connector = actionblock.GetConnector() |
539 wire = self.ConnectConnectors(actionblock_connector, connectors["action"]) |
540 wire = self.ConnectConnectors(actionblock_connector, connectors["action"]) |
540 wire.SetPoints([wx.Point(pos.x + SFC_WIRE_MIN_SIZE, pos.y), wx.Point(pos.x, pos.y)]) |
541 wire.SetPoints([wx.Point(pos.x + SFC_WIRE_MIN_SIZE, pos.y), wx.Point(pos.x, pos.y)]) |
541 actionblock.SetActions(actions) |
542 actionblock.SetActions(actions) |
542 self.AddBlock(actionblock) |
543 self.AddBlock(actionblock) |