equal
deleted
inserted
replaced
63 define_hmi = hmipyfile.read().decode('utf-8') |
63 define_hmi = hmipyfile.read().decode('utf-8') |
64 hmipyfile.close() |
64 hmipyfile.close() |
65 |
65 |
66 declare_hmi = "\n".join(map(lambda x:"%s = None" % x, |
66 declare_hmi = "\n".join(map(lambda x:"%s = None" % x, |
67 hmi_frames.keys())) |
67 hmi_frames.keys())) |
68 global_hmi = "global "+",".join(hmi_frames.keys()) |
68 global_hmi = "global "+",".join(hmi_frames.keys()) + "\n" |
69 init_hmi = "\n".join(map(lambda x: """\ |
69 init_hmi = "\n".join(map(lambda x: """\ |
70 def OnCloseFrame(evt): |
70 def OnCloseFrame(evt): |
71 wx.MessageBox(_("Please stop PLC to close")) |
71 wx.MessageBox(_("Please stop PLC to close")) |
72 |
72 |
73 %(name)s = %(class)s(None) |
73 %(name)s = %(class)s(None) |
77 cleanup_hmi = "\n".join(map(lambda x:"if %s is not None: %s.Destroy()" % (x,x), hmi_frames.keys())) |
77 cleanup_hmi = "\n".join(map(lambda x:"if %s is not None: %s.Destroy()" % (x,x), hmi_frames.keys())) |
78 |
78 |
79 self.PreSectionsTexts = { |
79 self.PreSectionsTexts = { |
80 "globals":define_hmi + declare_hmi, |
80 "globals":define_hmi + declare_hmi, |
81 "start":global_hmi, |
81 "start":global_hmi, |
82 "stop":global_hmi |
82 "stop":global_hmi + cleanup_hmi |
83 } |
83 } |
84 self.PostSectionsTexts = { |
84 self.PostSectionsTexts = { |
85 "start":init_hmi, |
85 "start":init_hmi, |
86 } |
86 } |
87 |
87 |