equal
deleted
inserted
replaced
69 |
69 |
70 hmipyfile = open(hmipyfile_path, 'r') |
70 hmipyfile = open(hmipyfile_path, 'r') |
71 define_hmi = hmipyfile.read().decode('utf-8') |
71 define_hmi = hmipyfile.read().decode('utf-8') |
72 hmipyfile.close() |
72 hmipyfile.close() |
73 |
73 |
|
74 else: |
|
75 define_hmi = "" |
|
76 |
74 declare_hmi = "\n".join(["%(name)s = None\n" % x + |
77 declare_hmi = "\n".join(["%(name)s = None\n" % x + |
75 "\n".join(["%(class)s.%(h)s = %(h)s"% |
78 "\n".join(["%(class)s.%(h)s = %(h)s"% |
76 dict(x,h=h) for h in x['handlers']]) |
79 dict(x,h=h) for h in x['handlers']]) |
77 for x in hmi_frames]) |
80 for x in hmi_frames]) |
78 global_hmi = "global %s\n"%",".join( |
81 global_hmi = ("global %s\n"%",".join( |
79 [x["name"] for x in hmi_frames]) |
82 [x["name"] for x in hmi_frames]) |
|
83 if len(hmi_frames) > 0 else "") |
80 init_hmi = "\n".join(["""\ |
84 init_hmi = "\n".join(["""\ |
81 def OnCloseFrame(evt): |
85 def OnCloseFrame(evt): |
82 wx.MessageBox(_("Please stop PLC to close")) |
86 wx.MessageBox(_("Please stop PLC to close")) |
83 |
87 |
84 %(name)s = %(class)s(None) |
88 %(name)s = %(class)s(None) |