rename all corresponding SFC jumps when SFC step is renamed (but only in DRIVENDRAWING_MODE)
--- a/editors/Viewer.py Wed Dec 14 13:14:45 2016 +0300
+++ b/editors/Viewer.py Tue Dec 20 13:26:24 2016 +0300
@@ -2902,7 +2902,20 @@
if dialog.ShowModal() == wx.ID_OK:
values = dialog.GetValues()
rect = step.GetRedrawRect(1, 1)
- step.SetName(values["name"])
+
+ new_name = values["name"]
+ if self.GetDrawingMode() == DRIVENDRAWING_MODE:
+ old_name = step.GetName().upper()
+ if new_name.upper() != old_name:
+ for block in self.Blocks.itervalues():
+ if isinstance(block, SFC_Jump):
+ if old_name == block.GetTarget().upper():
+ block.SetTarget(new_name)
+ block.RefreshModel()
+ rect = rect.Union(block.GetRedrawRect())
+ block.Refresh(rect)
+ step.SetName(new_name)
+
if values["input"]:
step.AddInput()
else: