Fixed bug wxGlade hmi not closed when stopping PLC
authorLaurent Bessard
Thu, 16 May 2013 00:01:09 +0200
changeset 1151 38d6aaad8ffd
parent 1150 b1c84771e1cf
child 1152 0a8fbd2a00f7
Fixed bug wxGlade hmi not closed when stopping PLC
wxglade_hmi/wxglade_hmi.py
--- a/wxglade_hmi/wxglade_hmi.py	Thu May 16 00:00:35 2013 +0200
+++ b/wxglade_hmi/wxglade_hmi.py	Thu May 16 00:01:09 2013 +0200
@@ -65,7 +65,7 @@
         
         declare_hmi = "\n".join(map(lambda x:"%s = None" % x,
                                 hmi_frames.keys()))
-        global_hmi = "global "+",".join(hmi_frames.keys())
+        global_hmi = "global "+",".join(hmi_frames.keys()) + "\n"
         init_hmi = "\n".join(map(lambda x: """\
 def OnCloseFrame(evt):
     wx.MessageBox(_("Please stop PLC to close"))
@@ -79,7 +79,7 @@
         self.PreSectionsTexts = {
             "globals":define_hmi + declare_hmi,
             "start":global_hmi,
-            "stop":global_hmi
+            "stop":global_hmi + cleanup_hmi
         }
         self.PostSectionsTexts = {
             "start":init_hmi,