author | Edouard Tisserant |
Mon, 08 Nov 2021 14:03:21 +0100 | |
changeset 3384 | bd337d21f686 |
parent 2284 | 64bb520009f3 |
permissions | -rw-r--r-- |
2282
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
1 |
<?xml version='1.0' encoding='utf-8'?> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
2 |
<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml"> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
3 |
<variables> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
4 |
<variable name="Power_ON" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
5 |
<variable name="Power_OFF" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
6 |
<variable name="DrawTest" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
7 |
<variable name="DrawLogo" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
8 |
<variable name="DrawEscher" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
9 |
<variable name="Detect_Circle" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
10 |
<variable name="XaxisPos" type="INT"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
11 |
<variable name="YaxisPos" type="INT"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
12 |
<variable name="ZaxisPos" type="INT"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
13 |
<variable name="TaxisPos" type="INT"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
14 |
<variable name="XaxisMinus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
15 |
<variable name="YaxisMinus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
16 |
<variable name="ZaxisMinus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
17 |
<variable name="TaxisMinus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
18 |
<variable name="XaxisPlus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
19 |
<variable name="YaxisPlus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
20 |
<variable name="ZaxisPlus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
21 |
<variable name="TaxisPlus" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
22 |
<variable name="DrawTestBtn" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
23 |
<variable name="DrawTestBtn2" type="BOOL"/> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
24 |
</variables> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
25 |
<globals> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
26 |
<xhtml:p><![CDATA[ |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
27 |
import ctypes |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
28 |
import wx, sys |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
29 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
30 |
AxisList = ["X","Y","Z","T"] |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
31 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
32 |
PwrButtons = ['Power_ON', |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
33 |
'Power_OFF'] |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
34 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
35 |
ActionButtons = ['Detect_Circle', |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
36 |
'DrawTest', |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
37 |
'DrawLogo', |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
38 |
'DrawEscher'] |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
39 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
40 |
class ThreeDee(wx.StaticText): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
41 |
def __init__(self, *args, **kwargs): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
42 |
self.initialized = False |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
43 |
kwargs["style"] = wx.ALIGN_CENTRE_HORIZONTAL |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
44 |
super(ThreeDee, self).__init__(*args, **kwargs) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
45 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
46 |
self.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD)) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
47 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
48 |
self.positions = [0.]*4 |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
49 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
50 |
self.Message = None |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
51 |
self.NegLimits = None |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
52 |
self.Disk = None |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
53 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
54 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
55 |
def UpdatePositions(self, positions): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
56 |
# get globals from PLC |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
57 |
self.positions = positions |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
58 |
self.SetLabel( |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
59 |
((self.Message +'\n\n') if self.Message else '' )+ |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
60 |
" ".join(["%s %+.2f"%(axis,self.positions[i]) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
61 |
for i,axis in enumerate(AxisList)])) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
62 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
63 |
def MakeButtonFunc(window, sizer, btname): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
64 |
def ButtonDown(event): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
65 |
setattr(PLCGlobals,btname,1) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
66 |
event.Skip() |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
67 |
def ButtonUp(event): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
68 |
setattr(PLCGlobals,btname,0) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
69 |
event.Skip() |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
70 |
obj = wx.BitmapButton(window, -1, wx.Bitmap('%s.png'%btname)) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
71 |
sizer.Add(obj, 2, wx.EXPAND, 0) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
72 |
obj.Bind(wx.EVT_LEFT_DOWN, ButtonDown) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
73 |
obj.Bind(wx.EVT_LEFT_UP, ButtonUp) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
74 |
return obj |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
75 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
76 |
def UpdPos(self): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
77 |
positions = [getattr(PLCGlobals,axname+"axisPos") for axname in AxisList] |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
78 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
79 |
self.window_1.UpdatePositions(positions) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
80 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
81 |
Class_wxglade_hmi.UpdPos = UpdPos |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
82 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
83 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
84 |
#def UpdatePositions(self, event): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
85 |
# |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
86 |
# positions = [getattr(PLCGlobals,axname+"axisPos") for axname in AxisList] |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
87 |
# |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
88 |
# self.window_1.UpdatePositions(positions) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
89 |
# |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
90 |
# event.Skip() |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
91 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
92 |
#Class_wxglade_hmi.UpdatePositions = UpdatePositions |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
93 |
|
2284
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
94 |
def CleanSizer(sizer): |
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
95 |
sizer_len = sizer.GetItemCount() |
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
96 |
if sizer_len > 0: |
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
97 |
for i in reversed(range(sizer_len)): |
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
98 |
sizer.Remove(i) |
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
99 |
|
2282
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
100 |
initorig = Class_wxglade_hmi.__init__ |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
101 |
def Init(self,*args,**kargs): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
102 |
initorig(self,*args,**kargs) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
103 |
sizer = self.GetSizer().GetItem(1).GetSizer().GetItem(0).GetSizer() |
2284
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
104 |
CleanSizer(sizer) |
2282
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
105 |
self.main_buttons = map( |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
106 |
lambda btname: MakeButtonFunc(self, sizer, btname), PwrButtons) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
107 |
sizer = self.GetSizer().GetItem(1).GetSizer().GetItem(1).GetSizer() |
2284
64bb520009f3
Fix wxHMI example after upgrading wxGlade
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
2282
diff
changeset
|
108 |
CleanSizer(sizer) |
2282
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
109 |
self.main_buttons = map( |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
110 |
lambda btname: MakeButtonFunc(self, sizer, btname), ActionButtons) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
111 |
self.axis_buttons = map( |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
112 |
lambda axis:( MakeButtonFunc(self, sizer, axis+"axisMinus"), |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
113 |
MakeButtonFunc(self, sizer, axis+"axisPlus")), |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
114 |
AxisList) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
115 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
116 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
117 |
# self.timer = wx.Timer(self, -1) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
118 |
# self.Bind(wx.EVT_TIMER, self.UpdatePositions, self.timer) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
119 |
# self.ShowFullScreen(True,wx.FULLSCREEN_ALL) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
120 |
# wx.CallAfter(self.timer.Start,200) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
121 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
122 |
Class_wxglade_hmi.__init__ = Init |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
123 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
124 |
def SetPLCTestBtnGlobalVar(self, evt): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
125 |
setattr(PLCGlobals, "DrawTestBtn", evt.GetEventObject().GetValue()) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
126 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
127 |
def SetPLCTestBtn2GlobalVar(self, evt): |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
128 |
setattr(PLCGlobals, "DrawTestBtn2", evt.GetEventObject().GetValue()) |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
129 |
|
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
130 |
]]></xhtml:p> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
131 |
</globals> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
132 |
<init> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
133 |
<xhtml:p><![CDATA[ |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
134 |
]]></xhtml:p> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
135 |
</init> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
136 |
<cleanup> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
137 |
<xhtml:p><![CDATA[ |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
138 |
]]></xhtml:p> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
139 |
</cleanup> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
140 |
<start> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
141 |
<xhtml:p><![CDATA[ |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
142 |
]]></xhtml:p> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
143 |
</start> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
144 |
<stop> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
145 |
<xhtml:p><![CDATA[ |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
146 |
]]></xhtml:p> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
147 |
</stop> |
73f95ba6d3af
Rename extension instance 'wxHMI' to 'wxglade_hmi'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff
changeset
|
148 |
</PyFile> |