Hi All,
I'm using wxpython to run hardware tests. the gui has a splitter window which the right pane is used for stdout/stderr, the left is the list of test.
when i run on the list of tests, i use functions imported from other file.
the problem is that when i start to run the test (in a loop until the last test), the GUI gets stuck, and at some point it looks as if the same test runs over and over again in undefinite loop !!!
the part of the code that handles the loop is attached, the rest of the functions do not use wxpython, but they use our own DLL.
i tried wx.SafeYield() and self.Update to refresh etc
def OnRunClick(self, event):
dialog = GeneralParametersDialog()
result = dialog.ShowModal()
Num_Of_Tests = self.MidPanel.list.GetItemCount()
for index in range(Num_Of_Tests):
self.MidPanel.list.SetItemBackgroundColour(index,'yellow')
TestName = self.MidPanel.list.GetItemText(index)
TestType = dictionary_data.dict[TestName][0]
if TestType is 'dch':
dch = dictionary_data.dict[TestName][1]
test_param = All_Tests.set_test_param('dch ' + dch + ' results', 0, -99, 0)
TestResult=All_Tests.run_on_dch(test_param,[str(dch)])
elif TestType is 'fach':
SlotFormat = dictionary_data.dict[TestName][1]
test_param = test_param = All_Tests.set_test_param('fach ' + SlotFormat + ' results', 0, -99, 0)
TestResult=All_Tests.Run_on_FACH_RACH(test_param,[int(SlotFormat)])
elif TestType is 'sho':
dch = dictionary_data.dict[TestName][1]
test_param = All_Tests.set_test_param('dch_sho ' + dch + ' results', 0, -99, 0)
TestResult=All_Tests.run_on_dch(test_param,[str(dch)])
elif TestType is 'cm':
CmMethod = dictionary_data.dict[TestName][1]
Pattern = dictionary_data.dict[TestName][2]
MaxNumOfPatterns = dictionary_data.dict[TestName][3]
test_param = All_Tests.set_test_param('cm ' + Pattern + ' results', 0, -99, 0)
TestResult=All_Tests.run_on_cm(test_param,[Pattern, MaxNumOfPatterns])
if TestResult is 'pass':
self.MidPanel.list.SetItemBackgroundColour(index,'green')
else:
self.MidPanel.list.SetItemBackgroundColour(index,'red')
self.RightPanel.log.clear()
Thanks in advance,
Roy.
···
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/