-
Notifications
You must be signed in to change notification settings - Fork 0
/
LinearSnapFrame.py
319 lines (181 loc) · 9.47 KB
/
LinearSnapFrame.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
import wx
import wx.xrc
###########################################################################
## Class LinearSnapFrame
###########################################################################
class LinearSnapFrame ( wx.Frame ):
def __init__( self, parent ):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 1366,710 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
bSizer6.Add( ( 10, 0), 0, wx.EXPAND, 5 )
bSizer5 = wx.BoxSizer( wx.VERTICAL )
bSizer72 = wx.BoxSizer( wx.VERTICAL )
bSizer72.Add( ( 0, 10), 0, wx.EXPAND, 5 )
gSizer1 = wx.GridSizer( 3, 3, 0, 0 )
gSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_button5 = wx.Button( self, wx.ID_ANY, u"Short Rail Back", wx.DefaultPosition, wx.DefaultSize, 0 )
gSizer1.Add( self.m_button5, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
gSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_button3 = wx.Button( self, wx.ID_ANY, u"Long Rail Left", wx.DefaultPosition, wx.DefaultSize, 0 )
gSizer1.Add( self.m_button3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
gSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_button4 = wx.Button( self, wx.ID_ANY, u"Long Rail Right", wx.DefaultPosition, wx.DefaultSize, 0 )
gSizer1.Add( self.m_button4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
gSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_button2 = wx.Button( self, wx.ID_ANY, u"Short Rail Forward", wx.DefaultPosition, wx.DefaultSize, 0 )
gSizer1.Add( self.m_button2, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
gSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )
bSizer72.Add( gSizer1, 0, wx.EXPAND, 10 )
bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
self.m_button18 = wx.Button( self, wx.ID_ANY, u"Home", wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer7.Add( self.m_button18, 0, wx.ALL, 5 )
self.m_button19 = wx.Button( self, wx.ID_ANY, u"Find Focus", wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer7.Add( self.m_button19, 0, wx.ALL, 5 )
self.m_SlowMoves = wx.CheckBox( self, wx.ID_ANY, u"Slow Moves", wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer7.Add( self.m_SlowMoves, 0, wx.ALL, 5 )
self.m_EnableLiveView = wx.CheckBox( self, wx.ID_ANY, u"Live View", wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer7.Add( self.m_EnableLiveView, 0, wx.ALL, 5 )
self.m_toggleLight = wx.CheckBox( self, wx.ID_ANY, u"Light", wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer7.Add( self.m_toggleLight, 0, wx.ALL, 5 )
bSizer72.Add( bSizer7, 0, wx.EXPAND, 5 )
bSizer72.Add( ( 0, 20), 0, wx.EXPAND, 5 )
bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Core Type", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText3.Wrap( -1 )
bSizer4.Add( self.m_staticText3, 0, wx.ALL, 5 )
m_coreTypeChoices = [ u"Tall", u"Short" ]
self.m_coreType = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_coreTypeChoices, 0 )
bSizer4.Add( self.m_coreType, 0, wx.ALL, 5 )
bSizer72.Add( bSizer4, 0, wx.EXPAND, 5 )
bSizer72.Add( ( 0, 20), 1, wx.EXPAND, 5 )
bSizer41 = wx.BoxSizer( wx.HORIZONTAL )
self.m_staticText31 = wx.StaticText( self, wx.ID_ANY, u"Core ID", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText31.Wrap( -1 )
bSizer41.Add( self.m_staticText31, 0, wx.ALL, 5 )
self.m_coreId = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,-1 ), 0 )
bSizer41.Add( self.m_coreId, 30, wx.EXPAND, 5 )
bSizer72.Add( bSizer41, 1, wx.EXPAND, 5 )
bSizer72.Add( ( 0, 20), 0, 0, 5 )
bSizer5.Add( bSizer72, 1, wx.EXPAND, 5 )
bSizer5.Add( ( 0, 10), 1, wx.EXPAND, 5 )
self.coreCompleteText = wx.StaticText( self, wx.ID_ANY, u"Core Complete! 🎉", wx.DefaultPosition, wx.DefaultSize, 0 )
self.coreCompleteText.Wrap( -1 )
self.coreCompleteText.SetFont( wx.Font( 30, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, wx.EmptyString ) )
self.coreCompleteText.Hide()
bSizer5.Add( self.coreCompleteText, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5 )
gSizer2 = wx.GridSizer( 0, 3, 0, 0 )
self.halt_button = wx.Button( self, wx.ID_ANY, u"Halt", wx.DefaultPosition, wx.DefaultSize, 0 )
gSizer2.Add( self.halt_button, 0, wx.ALIGN_BOTTOM|wx.ALL, 5 )
self.preferences = wx.Button( self, wx.ID_ANY, u"Preferences", wx.DefaultPosition, wx.DefaultSize, 0 )
gSizer2.Add( self.preferences, 0, wx.ALIGN_BOTTOM|wx.ALL, 5 )
self.start_core = wx.Button( self, wx.ID_ANY, u"Start Core", wx.DefaultPosition, wx.DefaultSize, 0 )
gSizer2.Add( self.start_core, 0, wx.ALIGN_BOTTOM|wx.ALIGN_RIGHT|wx.ALL, 5 )
bSizer5.Add( gSizer2, 1, wx.EXPAND, 5 )
bSizer5.Add( ( 0, 5), 0, wx.EXPAND, 5 )
bSizer6.Add( bSizer5, 0, 0, 5 )
bSizer6.Add( ( 20, 0), 0, wx.EXPAND, 5 )
bSizer61 = wx.BoxSizer( wx.VERTICAL )
self.m_LiveView = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( -1,-1 ), wx.TAB_TRAVERSAL )
self.m_LiveView.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
self.m_LiveView.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
self.m_LiveView.SetMinSize( wx.Size( 320,240 ) )
bSizer61.Add( self.m_LiveView, 1, wx.ALL|wx.EXPAND, 5 )
bSizer71 = wx.BoxSizer( wx.HORIZONTAL )
self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Focus Value:", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText2.Wrap( -1 )
bSizer71.Add( self.m_staticText2, 0, wx.ALL, 5 )
self.m_Focus = wx.StaticText( self, wx.ID_ANY, u"0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_Focus.Wrap( -1 )
bSizer71.Add( self.m_Focus, 0, wx.ALL, 5 )
bSizer71.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Short Rail:", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText4.Wrap( -1 )
bSizer71.Add( self.m_staticText4, 0, wx.ALL, 5 )
self.m_ShortRail = wx.StaticText( self, wx.ID_ANY, u"0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_ShortRail.Wrap( -1 )
bSizer71.Add( self.m_ShortRail, 0, wx.ALL, 5 )
bSizer71.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Long Rail:", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText7.Wrap( -1 )
bSizer71.Add( self.m_staticText7, 0, wx.ALL, 5 )
self.m_LongRail = wx.StaticText( self, wx.ID_ANY, u"0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_LongRail.Wrap( -1 )
bSizer71.Add( self.m_LongRail, 0, wx.ALL, 5 )
bSizer71.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"Photos", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText9.Wrap( -1 )
bSizer71.Add( self.m_staticText9, 0, wx.ALL, 5 )
self.m_PhotoCount = wx.StaticText( self, wx.ID_ANY, u"0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_PhotoCount.Wrap( -1 )
bSizer71.Add( self.m_PhotoCount, 0, wx.ALL, 5 )
bSizer71.Add( ( 0, 0), 1, wx.EXPAND, 5 )
self.m_staticText11 = wx.StaticText( self, wx.ID_ANY, u"Positions", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText11.Wrap( -1 )
bSizer71.Add( self.m_staticText11, 0, wx.ALL, 5 )
self.m_PositionCount = wx.StaticText( self, wx.ID_ANY, u"0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_PositionCount.Wrap( -1 )
bSizer71.Add( self.m_PositionCount, 0, wx.ALL, 5 )
bSizer61.Add( bSizer71, 0, wx.EXPAND, 5 )
bSizer6.Add( bSizer61, 1, wx.EXPAND, 5 )
self.SetSizer( bSizer6 )
self.Layout()
self.Centre( wx.BOTH )
# Connect Events
self.m_coreType.SetSelection( int(self.config.configValues['CoreType'] ))
self.m_button5.Bind( wx.EVT_LEFT_DOWN, self.moveShortBack )
self.m_button5.Bind( wx.EVT_LEFT_UP, self.stopShort )
self.m_button3.Bind( wx.EVT_LEFT_DOWN, self.moveLongLeft )
self.m_button3.Bind( wx.EVT_LEFT_UP, self.stopLong )
self.m_button4.Bind( wx.EVT_LEFT_DOWN, self.moveLongRight )
self.m_button4.Bind( wx.EVT_LEFT_UP, self.stopLong )
self.m_button2.Bind( wx.EVT_LEFT_DOWN, self.moveShortForward )
self.m_button2.Bind( wx.EVT_LEFT_UP, self.stopShort )
self.m_button18.Bind( wx.EVT_LEFT_UP, self.goHome )
self.m_button19.Bind( wx.EVT_LEFT_UP, self.findFocus )
self.halt_button.Bind( wx.EVT_LEFT_UP, self.stopAll )
self.preferences.Bind( wx.EVT_BUTTON, self.openPrefs )
self.start_core.Bind( wx.EVT_LEFT_UP, self.imageCore )
self.m_coreType.Bind( wx.EVT_CHOICE, self.changeCoreType )
def __del__( self ):
pass
def changeCoreType( self, event ):
event.Skip()
def onExitButton(self, event):
event.Skip()
# Virtual event handlers, override them in your derived class
def OnPaint(self, event):
event.Skip()
def NextFrame(self, event):
event.Skip()
def moveShortBack( self, event ):
event.Skip()
def stopShort( self, event ):
event.Skip()
def moveLongLeft( self, event ):
event.Skip()
def stopLong( self, event ):
event.Skip()
def moveLongRight( self, event ):
event.Skip()
def moveShortForward( self, event ):
event.Skip()
def goHome( self, event ):
event.Skip()
def findFocus( self, event ):
event.Skip()
def stopAll( self, event ):
event.Skip()
def imageCore( self, event ):
event.Skip()
def liveView( self, event ):
event.Skip()
def openPrefs( self, event ):
event.Skip()