Skip to content

Commit fe79041

Browse files
committed
add refresh button to refresh the file list
Former-commit-id: 621019cd36c634d6c2a9772925a24943256f684f
1 parent 7be55d8 commit fe79041

File tree

3 files changed

+34
-22
lines changed

3 files changed

+34
-22
lines changed

dpx/srxplanargui/live.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
from dpx.confutils.tools import checkFileVal
5959

60-
class LivingThread(threading.Thread):
60+
'''class LivingThread(threading.Thread):
6161
6262
def __init__(self, wdir, maingui):
6363
threading.Thread.__init__(self)
@@ -88,17 +88,17 @@ def run(self):
8888
maingui.newImages()
8989
self.lastctime = os.path.getctime(wdir)
9090
time.sleep(0.5)
91-
return
91+
return'''
9292

9393

9494
class SrXguiLive(SrXgui):
9595

9696
getxgui = Any
9797

9898
def __init__(self, configfile=None, args=None, **kwargs):
99-
'''
100-
init the object, createt the notifications
101-
'''
99+
100+
# init the object, createt the notifications
101+
102102
self.splash = SplashScreen(image=ImageResource('01.png'), show_log_messages=False)
103103
self.splash.open()
104104

@@ -117,8 +117,8 @@ def __init__(self, configfile=None, args=None, **kwargs):
117117
self.help = SrXguiHelp()
118118
self.calibration = Calibration(srx=self.srx, srxconfig=self.srxconfig)
119119

120-
self.liveplot = None
121-
self.last10data = []
120+
'''self.liveplot = None
121+
self.last10data = []'''
122122

123123
self.splash.close()
124124
return
@@ -144,7 +144,7 @@ def processSelected(self, summation=False):
144144
GUI.invoke_later(self.addNewImagesToGetXgui, newchifilelist)
145145
return
146146

147-
def _startCapturing(self):
147+
'''def _startCapturing(self):
148148
self.capturing = True
149149
150150
wdir = self.srxconfig.opendirectory
@@ -156,15 +156,15 @@ def _startCapturing(self):
156156
self.livingthread = LivingThread(wdir, self)
157157
self.livingthread.daemon = True
158158
self.livingthread.start()
159-
return
159+
return'''
160160

161-
def _stopCapturing(self):
161+
'''def _stopCapturing(self):
162162
self.capturing = False
163163
self.livingthread.capturing = False
164164
self.livingthread.join()
165-
return
165+
return'''
166166

167-
###LIVE###
167+
'''###LIVE###
168168
def newImages(self):
169169
newexistfileset = self.srx.loadimage.genFileSet(fullpath=True)
170170
newfileset = newexistfileset - self.existfileset
@@ -179,7 +179,7 @@ def newImages(self):
179179
newchifilelist = [rv['filename'] for rv in rvlist]
180180
GUI.invoke_later(self.addNewImagesToGetXgui, newchifilelist)
181181
self.existfileset = newexistfileset
182-
return
182+
return'''
183183

184184
def addNewImagesToGetXgui(self, filelist):
185185
'''
@@ -198,15 +198,15 @@ def addNewImagesToGetXgui(self, filelist):
198198
self.liveplot, liveplotpanel = self.getxgui.createNewPlot(newdatacontainers)
199199
return
200200

201-
capturing = Bool(False)
201+
'''capturing = Bool(False)
202202
startcapturing_action = \
203203
Action(name='Start Capturing',
204204
action='_startCapturing',
205205
enabled_when='not capturing')
206206
stopcapturing_action = \
207207
Action(name='Stop Capturing',
208208
action='_stopCapturing',
209-
enabled_when='capturing')
209+
enabled_when='capturing')'''
210210
quickstart_action = \
211211
Action(name='Help ',
212212
action='_quickstart')
@@ -233,7 +233,7 @@ def addNewImagesToGetXgui(self, filelist):
233233
HGroup(spring,
234234
Item('selfcalibratebb', enabled_when='not capturing'),
235235
Item('integratbb', enabled_when='not capturing'),
236-
Item('integratessbb', enabled_when='not capturing'),
236+
# Item('integratessbb', enabled_when='not capturing'),
237237
spring,
238238
show_labels=False,
239239
),

dpx/srxplanargui/selectfiles.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ def _plotbb_fired(self):
169169
# imageplot.createPlot()
170170
imageplot.edit_traits()
171171
return
172+
173+
def _refreshbb_fired(self):
174+
self.refreshdatalist = True
175+
return
172176

173177
#-- Traits UI Views --------------------------------------------------------
174178
tableeditor = TableEditor(
@@ -193,21 +197,29 @@ def _plotbb_fired(self):
193197
)
194198

195199
selectallbb = Button('Select all')
196-
plotbb = Button('Image and Mask')
200+
refreshbb = Button('Refresh')
201+
plotbb = Button('Mask')
202+
sumbb = Button('Sum')
197203

198204
traits_view = View(
199205
VGroup(
200206
VGroup(
201207
HGroup(
202208
Item('search', id='search', springy=True,
203209
editor=TextEditor(auto_set=False)),
204-
Item('filetype', label='Type'),
205210
),
211+
HGroup(spring,
212+
Item('selectallbb', show_label=False),
213+
Item('refreshbb', show_label=False),
214+
spring,
215+
Item('filetype', label='Type'),
216+
),
206217
Item('datafiles', id='datafiles', editor=tableeditor),
207218
Item('summary', editor=TitleEditor()),
219+
208220
HGroup(spring,
209-
Item('selectallbb', show_label=False),
210221
Item('plotbb', show_label=False),
222+
Item('sumbb', show_label=False),
211223
spring,
212224
),
213225
dock='horizontal',

dpx/srxplanargui/srxgui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ def _selfcalibratebb_changed(self):
243243
Action(name='Help ',
244244
action='_helpView')
245245

246-
integratbb = Button('Integrate separately')
246+
integratbb = Button('Integrate')
247247
integratessbb = Button('Sum and Integrate')
248-
selfcalibratebb = Button('Calibration')
248+
selfcalibratebb = Button('Calibrate')
249249
helpbb = Button('Help')
250250

251251
traits_view = \
@@ -262,7 +262,7 @@ def _selfcalibratebb_changed(self):
262262
HGroup(spring,
263263
Item('selfcalibratebb'),
264264
Item('integratbb'),
265-
Item('integratessbb'),
265+
# Item('integratessbb'),
266266
spring,
267267
show_labels=False,
268268
),

0 commit comments

Comments
 (0)