示例#1
0
    def ReadConfigFile(self,filename=None):
        "read configuration file "
        if self.mapconf is None:
            self.mapconf = FastMapConfig(filename=filename)
        else:
            try:
                self.mapconf.Read(filename)
            except IOError:
                print "Cannot read %s" % fileanme
                return
        
        self.configfile = filename
        cnf = self.config = self.mapconf.config

        fm_labels = cnf['fast_positioners'].values()
        m1label   = cnf['fast_positioners'].get(cnf['scan']['pos1'],None)
        if m1label is None:  m1label = fm_labels[0]

        sm_labels = cnf['slow_positioners'].values()
        m2label   = cnf['slow_positioners'].get(cnf['scan']['pos2'],None)
        if m2label is None:  m2label = sm_labels[0]

        sm_labels.remove(m1label)

        self.m1choice.Clear()
        self.m1choice.AppendItems(fm_labels)
        self.m1choice.SetStringSelection(m1label)

        self.m2choice.Clear()
        self.m2choice.AppendItems(sm_labels)
        self.m2choice.SetStringSelection(m2label)

        self.dimchoice.Clear()
        self.dimchoice.AppendItems(self._scantypes)
        self.dimchoice.SetSelection(cnf['scan']['dimension']-1)

        self.m1start.SetValue(cnf['scan']['start1'])
        self.m1stop.SetValue(cnf['scan']['stop1'])
        self.m1step.SetValue(cnf['scan']['step1'])
        self.m1time.SetValue(cnf['scan']['time1'])

        self.m2start.SetValue(cnf['scan']['start2'])
        self.m2stop.SetValue(cnf['scan']['stop2'])
        self.m2step.SetValue(cnf['scan']['step2'])
        self.filename.SetValue(new_filename(cnf['scan']['filename']))

        self.connect_mapper()
        self.onM1step()
        self.onDimension()
示例#2
0
    def onMapStart(self,pvname=None,value=None,**kw):
        if value == 0: # stop of map
            self.startbutton.Enable()
            self.abortbutton.Disable()           

            self.usertitles.Enable()
            self.filename.Enable()        

            # if SAVE_ESCAN:
            # self.SaveEscanData()

            fname = str(self.filename.GetValue())

            nfile = new_filename(os.path.abspath(fname))
            self.filename.SetValue(os.path.split(nfile)[1])            
        else: # start of map
            self.startbutton.Disable()
            self.abortbutton.Enable()