def __customProperties(self):
        """Set the custom properties."""
        self.fit = None
        self.reverse = False  # Reverse the sort?
        self.fullpath = ""
        self.datasets = []  # Contains (doping, filename) tuples
        # doping comes first for easy sorting

        self.listCtrlFiles.InsertColumn(0, "Doping")
        self.listCtrlFiles.InsertColumn(1, "Data Set")
        self.listCtrlFiles.SetColumnWidth(0, -2)

        # Set the validators
        self.textCtrlBaseElement.SetValidator(TextValidator(ALPHA_ONLY))
        self.textCtrlDopant.SetValidator(TextValidator(ALPHA_ONLY))
        return
    def __customProperties(self):
        # Set some reasonable defaults
        self.configuration = None
        self.constraints = {}
        self.stypeMap = {0: 'N', 1: 'X'}
        self.metaNames = ['doping', 'temperature']
        self.constrainables = ['dscale', 'qdamp', 'qbroad']
        self.sampList = ["data", "Nyquist", "custom"]
        self._focusedText = None

        # Note that the rstep and fitrstep attributes are special cases, so they
        # are handled separately. Qmax is also handled with these.
        self.ctrlMap = {
            'fitrmin': 'textCtrlFitFrom',
            'fitrmax': 'textCtrlFitTo',
            'rmin': 'textCtrlDataFrom',
            'rmax': 'textCtrlDataTo',
            'dscale': 'textCtrlScaleFactor',
            'qdamp': 'textCtrlQdamp',
            'qbroad': 'textCtrlQbroad',
            'temperature': 'textCtrlTemperature',
            'doping': 'textCtrlDoping',
        }

        # Give each textCtrl a name that can be referenced and setup the
        # validator
        for (key, value) in self.ctrlMap.items():
            textCtrl = getattr(self, value)
            textCtrl.SetName(key)
            textCtrl.SetValidator(TextValidator(FLOAT_ONLY))
        self.textCtrlFitStep.SetValidator(TextValidator(FLOAT_ONLY))

        # Setup the event code.
        for ctrlName in self.ctrlMap.values():
            textCtrl = getattr(self, ctrlName)
            textCtrl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus)
            textCtrl.Bind(wx.EVT_KILL_FOCUS, self.onLoseFocus)
            textCtrl.Bind(wx.EVT_KEY_DOWN, self.onTextCtrlKey)

        self.textCtrlFitStep.Bind(wx.EVT_KILL_FOCUS, self.onSampling)
        self.textCtrlQmax.Bind(wx.EVT_KILL_FOCUS, self.onSampling)
        self.textCtrlFitStep.Bind(wx.EVT_KEY_DOWN, self.onTextCtrlKey)
        self.textCtrlQmax.Bind(wx.EVT_KEY_DOWN, self.onTextCtrlKey)

        # For blocked text controls.
        self.message = "This variable is constrained. Edit the associated parameter."
        return
Ejemplo n.º 3
0
    def __customProperties(self):
        """Custom Properties go here."""
        self.yDataList.InsertColumn(0, "Y data")
        self.offsetTextCtrl.SetValidator(TextValidator(FLOAT_ONLY,allowNeg=True))

        # Testing Code. Comment or delete this block when finished.
        #self.yDataList.InsertStringItem(sys.maxint, "y1")
        #self.yDataList.InsertStringItem(sys.maxint, "y2")
        #self.yDataList.InsertStringItem(sys.maxint, "y3")
        #self.yDataList.InsertStringItem(sys.maxint, "y4")
        #self.yDataList.InsertStringItem(sys.maxint, "y5")
        # Initialize the sorter.
        #self.yDataList.makeIDM()
        #self.yDataList.initializeSorter()

        return
Ejemplo n.º 4
0
    def __customProperties(self):
        """Set the custom properties of this panel."""
        self.fit = None
        self.ctrlMap = {
            'maxfirst': 'maxFirstTextCtrl',
            'maxlast': 'maxLastTextCtrl',
            'maxstep': 'maxStepTextCtrl',
            'minfirst': 'minFirstTextCtrl',
            'minlast': 'minLastTextCtrl',
            'minstep': 'minStepTextCtrl',
        }

        for var in self.ctrlMap:
            setattr(self, var, None)

        for ctrlname in self.ctrlMap.values():
            textCtrl = getattr(self, ctrlname)
            textCtrl.SetValidator(TextValidator(FLOAT_ONLY))
        return
Ejemplo n.º 5
0
    def __customProperties(self):
        """Set up the custom properites."""
        self._focusedText = None
        self.calculation = None
        self.stypeMap = {0: 'N', 1: 'X'}

        self.ctrlMap = {
            'rmin': 'textCtrlCalcFrom',
            'rmax': 'textCtrlCalcTo',
            'qmax': 'textCtrlQmax',
            'qdamp': 'textCtrlQdamp',
            'qbroad': 'textCtrlQbroad',
            'rstep': 'textCtrlRStep',
            'dscale': 'textCtrlScaleFactor',
        }

        # Give each textCtrl a name that can be referenced and setup the
        # validator
        for (key, value) in self.ctrlMap.items():
            textCtrl = getattr(self, value)
            textCtrl.SetName(key)
            textCtrl.SetValidator(TextValidator(FLOAT_ONLY))

        # Create specific bindings for the textCtrls
        self.textCtrlCalcFrom.Bind(wx.EVT_KILL_FOCUS, self.onCalcRange)
        self.textCtrlCalcTo.Bind(wx.EVT_KILL_FOCUS, self.onCalcRange)
        self.textCtrlQmax.Bind(wx.EVT_KILL_FOCUS, self.onKillFocus)
        self.textCtrlQdamp.Bind(wx.EVT_KILL_FOCUS, self.onKillFocus)
        self.textCtrlQbroad.Bind(wx.EVT_KILL_FOCUS, self.onKillFocus)
        self.textCtrlScaleFactor.Bind(wx.EVT_KILL_FOCUS, self.onKillFocus)
        self.textCtrlRStep.Bind(wx.EVT_KILL_FOCUS, self.onCalcRange)

        # Bind the focus and key events
        for (key, value) in self.ctrlMap.items():
            textCtrl = getattr(self, value)
            textCtrl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus)
            textCtrl.Bind(wx.EVT_KEY_DOWN, self.onTextCtrlKey)

        return