def dcStart(self, event): """ Creates the instruments, and calls the doStart function. """ log = self.m_textCtrl91 # where stdout will be redirected redir = stuff.RedirectText(log) sys.stdout = redir #print statements, note to avoid 'print' if callafter delay is an issue sys.stderr = redir #python errors if self.filled_grid == True: instruments = self.dcCreateMeter() self.dcDoStart(instruments) else: print("Input grids changed, generate a table again to continue")
def __init__(self, parent): noname.MyFrame1.__init__(self, parent) #the mixin below offers better ctrl c ctr v cut and paste than the basic wxgrid wx.grid.Grid.__bases__ += (pywxgrideditmixin.PyWXGridEditMixin, ) self.m_grid3.__init_mixin__() self.m_grid21.__init_mixin__() self.m_grid2.__init_mixin__() self.m_grid4.__init_mixin__() # self.m_grid8.__init_mixin__() self.number_plots = 1 self.ranges = [] self.paused = True self.Show(True) self.Validate = False self.EVT_RESULT_ID_1 = wx.NewId() #used for GPIB data 1 thread self.worker1 = None # for data source 1 stuff.EVT_RESULT(self, self.OnResult1, self.EVT_RESULT_ID_1) log = self.m_textCtrl81 # where stdout will be redirected redir = stuff.RedirectText(log) sys.stdout = redir #print statements, note to avoid 'print' if callafter delay is an issue sys.stderr = redir #python errors self.data = stuff.SharedList(None) #no data on start up self.cwd = os.getcwd() #identifies working directory at startup. iconFile = os.path.join(self.cwd, 'testpoint.ico') icon1 = wx.Icon(iconFile, wx.BITMAP_TYPE_ICO) self.dirname = 'xxx' self.SetIcon(icon1) self.inst_bus = visa # can be toggled (OnSimulate) to visa 2 for simulation self.START_TIME = 0 #to be overidden when worker thread is called self.filled_grid = False #was grid sucessfuly filled self.loaded_dict = False self.loaded_ranges = False self.OverideSafety = False col_names = [ 'Min', 'Max', '# Readings', 'Pre-reading delay', 'Inter-reading delay', '# Repetitions', '# steps' ] for i in range(len(col_names)): self.m_grid21.SetColLabelValue(i, col_names[i]) #Murray wanted a popup window with info? self.OnAbout(None)