def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "ITUBE", label=self.unitLabels()[idx], addSpace=True, items=['Mo', 'Rh', 'W'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "VOLTAGE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TITLE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEMPERATURE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "E_MIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "E_MAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def lineEdit(widget, master, value, label=None, labelWidth=None, orientation='vertical', box=None, callback=None, valueType=str, validator=None, controlWidth=None, callbackOnType=False, focusInCallback=None, enterPlaceholder=False, **misc): ledit = orange_gui.lineEdit(widget, master, value, label, labelWidth, orientation, box, callback, valueType, validator, controlWidth, callbackOnType, focusInCallback, enterPlaceholder, **misc) if value: if (valueType != str): ledit.setAlignment(Qt.AlignRight) return ledit
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH-5) idx = -1 #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=False, items=['Element(formula)', 'Mixture(formula)', 'Mixture(table)'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) items = xraylib.GetCompoundDataNISTList() gui.comboBox(box1, self, "MAT_LIST", label=self.unitLabels()[idx], addSpace=False, items=items, valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DENSITY", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CALCULATE", label=self.unitLabels()[idx], addSpace=False, items=['Total','PhotoElectric','Rayleigh','Compton','Total-Rayleigh'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=False, items=['Standard', 'User defined', 'Single Value'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "UNIT", label=self.unitLabels()[idx], addSpace=False, items=['barn/atom [Cross Section] *see help*', 'cm^2 [Cross Section] *see help*', 'cm^2/g [Mass abs coef]', 'cm^-1 [Linear abs coef]'], valueType=int, orientation="horizontal", labelWidth=130) self.show_at(self.unitFlags()[idx], box1) # widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def build_gui(self): box = oasysgui.widgetBox( self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH - 5 ) idx = -1 # widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "NAME", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=80 ) self.show_at(self.unitFlags()[idx], box1) # widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "SUBSTANCE", label=self.unitLabels()[idx], addSpace=False, items=["Element (Atomic number)", "Element (Symbol)", "Compound (Formula)", "Mixture (F1:F2:F3...)"], valueType=int, orientation="horizontal", callback=self.set_SUBSTANCE, ) self.show_at(self.unitFlags()[idx], box1) # widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "DESCRIPTION", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=80, ) self.show_at(self.unitFlags()[idx], box1) # widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "FRACTION", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=80, ) self.show_at(self.unitFlags()[idx], box1) # widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "GRID", label=self.unitLabels()[idx], addSpace=False, items=["Standard", "Standard+points", "Points only"], valueType=int, orientation="horizontal", labelWidth=250, ) self.show_at(self.unitFlags()[idx], box1) # widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "GRIDINPUT", label=self.unitLabels()[idx], addSpace=False, items=["From Keyboard", "From file"], valueType=int, orientation="horizontal", labelWidth=250, ) self.show_at(self.unitFlags()[idx], box1) # widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDDATA", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "ELEMENTOUTPUT", label=self.unitLabels()[idx], addSpace=False, items=[ "Cross section [b/atom]", "Cross section [b/atom] & Attenuation coeff [cm2/g]", "Partial interaction coeff & Attenuation coeff [cm2/g]", ], valueType=int, orientation="horizontal", callback=self.set_ELEMENTOUTPUT, ) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MODE", label=self.unitLabels()[idx], addSpace=True, items=['Periodic Layers', 'Individual Layers'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SCAN", label=self.unitLabels()[idx], addSpace=True, items=['Grazing Angle', 'Photon Energy'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "F12_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Create on the fly', 'Use existing file: mlayers.f12'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SUBSTRATE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ODD_MATERIAL", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EVEN_MATERIAL", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "THETA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SCAN_STEP", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ODD_THICKNESS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EVEN_THICKNESS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NLAYERS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() self._input_available = False # Define a tuple of crystals to choose from. self.crystal_names = ("Si", "Ge", "Diamond") print("AlignmentTool: Alignment tool initialized.\n") box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") # widget buttons: generate, set defaults, help gui.button(box0, self, "Apply", callback=self.apply) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.get_doc) box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 # widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "BASE_ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, ) self.show_at(self.unitFlags()[idx], box1) # widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CRYSTAL_NAME", label=self.unitLabels()[idx], addSpace=True, items=['Si', 'Ge', 'Diamond'], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "MILLER_H", label=self.unitLabels()[idx], addSpace=True, valueType=int, ) self.show_at(self.unitFlags()[idx], box1) # widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "MILLER_K", label=self.unitLabels()[idx], addSpace=True, valueType=int, ) self.show_at(self.unitFlags()[idx], box1) # widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "MILLER_L", label=self.unitLabels()[idx], addSpace=True, valueType=int, ) self.show_at(self.unitFlags()[idx], box1) # widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "ALPHA_X", label=self.unitLabels()[idx], addSpace=True, valueType=float, ) self.show_at(self.unitFlags()[idx], box1) # widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MOA", label=self.unitLabels()[idx], addSpace=True, items=['0', '180'], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MODE", label=self.unitLabels()[idx], addSpace=True, items=['Ray-to-crystal', 'Crystal-to-ray'], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=['No', 'Yes'], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) self.process_showers() gui.rubber(self.controlArea) # Load crystal from xraylib. self.CRYSTAL = xraylib.Crystal_GetCrystal( self.crystal_names[self.CRYSTAL_NAME])
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH - 5) idx = -1 #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=False, items=[ 'Element(formula)', 'Compound(formula)', 'Compound(NIST list)' ], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) self.nist_list = nist_compound_list() gui.comboBox(box1, self, "NIST_NAME", label=self.unitLabels()[idx], addSpace=False, items=self.nist_list, valueType=int, orientation="horizontal", labelWidth=150) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DENSITY", label=self.unitLabels()[idx], addSpace=False, valueType=str, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CALCULATE", label=self.unitLabels()[idx], addSpace=False, items=['f1', 'f2', 'delta', 'beta [includes all cross sections]', \ 'mu [cm^-1] [only photoelectric CS]', \ 'mu [cm^2/g] [only photoelectric CS]', 'Cross Section [barn] [only photoelectric CS]', \ 'reflectivity-s', 'reflectivity-p', 'reflectivity-unpol', 'delta/beta'], valueType=int, orientation="horizontal", labelWidth=150) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=False, items=['Standard', 'User defined', 'Single Value'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=False, valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "THETAGRID", label=self.unitLabels()[idx], addSpace=False, items=['Single value', 'User Defined'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ROUGH", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETA1", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETA2", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETAN", label=self.unitLabels()[idx], addSpace=False, valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH-5) idx = -1 #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=False, items=['Element(formula)', 'Mixture(formula)'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DENSITY", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CALCULATE", label=self.unitLabels()[idx], addSpace=False, items=['f1', 'f2', 'delta', 'beta [includes all cross sections]', \ 'mu [cm^-1] [only photoelectric CS]', \ 'mu [cm^2/g] [only photoelectric CS]', 'Cross Section [barn] [only photoelectric CS]', \ 'reflectivity-s', 'reflectivity-p', 'reflectivity-unpol', 'delta/beta'], valueType=int, orientation="horizontal", labelWidth=150) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=False, items=['Standard', 'User defined', 'Single Value'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "THETAGRID", label=self.unitLabels()[idx], addSpace=False, items=['Single value', 'User Defined'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ROUGH", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETA1", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETA2", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETAN", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH - 5) idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NAME", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=80) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SUBSTANCE", label=self.unitLabels()[idx], addSpace=False, items=[ 'Element (Atomic number)', 'Element (Symbol)', 'Compound (Formula)', 'Mixture (F1:F2:F3...)' ], valueType=int, orientation="horizontal", callback=self.set_SUBSTANCE) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DESCRIPTION", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=80) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FRACTION", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=80) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=False, items=['Standard', 'Standard+points', 'Points only'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRIDINPUT", label=self.unitLabels()[idx], addSpace=False, items=['From Keyboard', 'From file'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDDATA", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "ELEMENTOUTPUT", label=self.unitLabels()[idx], addSpace=False, items=[ 'Cross section [b/atom]', 'Cross section [b/atom] & Attenuation coeff [cm2/g]', 'Partial interaction coeff & Attenuation coeff [cm2/g]' ], valueType=int, orientation="horizontal", callback=self.set_ELEMENTOUTPUT) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SUBSTANCE", label=self.unitLabels()[idx], addSpace=True, items=['Element (Atomic number)', 'Element (Symbol)', 'Compound (Formula)', 'Mixture (F1:F2:F3...)'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DESCRIPTION", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FRACTION", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=True, items=['Standard', 'Standard+points', 'Points only'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRIDINPUT", label=self.unitLabels()[idx], addSpace=True, items=['From Keyboard', 'From file'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDDATA", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "ELEMENTOUTPUT", label=self.unitLabels()[idx], addSpace=True, items=['Cross section [b/atom]', 'Cross section [b/atom] & Attenuation coeff [cm2/g]', 'Partial interaction coeff & Attenuation coeff [cm2/g]'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() left_box_1 = oasysgui.widgetBox(self.controlArea, "GID_SL Request Form", addSpace=False, orientation="vertical", width=500, height=680) self.central_tabs = oasysgui.tabWidget(left_box_1) tab_template = oasysgui.createTabPage(self.central_tabs, "Template Options") tab_input = oasysgui.createTabPage(self.central_tabs, "Input Options") left_box_1_1 = oasysgui.widgetBox(tab_template, "", addSpace=False, orientation="vertical", width=480, height=670) gui.separator(left_box_1_1) gui.comboBox(left_box_1_1, self, "template_type", label="Template Type", labelWidth=100, items=["Simplified (coplanar geometries only)", "Full"], callback=self.set_TemplateType, sendSelectedValue=False, orientation="horizontal") self.simplified_box = oasysgui.widgetBox(left_box_1_1, "", addSpace=False, orientation="horizontal", width=470, height=220) gui.radioButtons(self.simplified_box, self, "simplified_form", ["Symmetric Bragg diffraction from perfect crystals", "Symmetric Bragg diffraction from multilayers and superlattices", "Symmetric Bragg diffraction at Bragg angle of 90 degrees (\"back diffraction\")", "Energy scanning of symmetric Bragg diffraction peaks"], callback=self.set_SimplifiedForm) self.full_box = oasysgui.widgetBox(left_box_1_1, "", addSpace=False, orientation="horizontal", width=470, height=220) gui.radioButtons(self.full_box, self, "full_form", ["Symmetric Bragg diffraction from perfect crystals", "Symmetric Bragg diffraction from multilayers and superlattices", "Coplanar extremely asymmetric diffraction of synchrotron radiation", "Grazing incidence (\"surface\") diffraction from perfect crystals", "Grazing incidence (\"surface\") diffraction from multilayers in the scheme\nwith position sensitive detector (PSD)", "Non-coplanar Bragg-Laue diffraction from crystals with a few degrees\nsurface miscut"], callback=self.set_FullForm) # ------------------------------------------------------------- # ------------------------------------------------------------- # ------------------------------------------------------------- gui.separator(tab_input) left_box_2 = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="vertical", width=470) left_box_2_1 = oasysgui.widgetBox(left_box_2, "", addSpace=False, orientation="horizontal", width=470) gui.comboBox(left_box_2_1, self, "xway", label="X-rays specified by", items=["Wavelength (Å)", "Energy (keV)", "Bragg angle (deg)", "X-ray line"], callback=self.set_xway, sendSelectedValue=False, orientation="horizontal") self.box_wave = oasysgui.widgetBox(left_box_2_1, "", addSpace=False, orientation="horizontal", width=100) gui.lineEdit(self.box_wave, self, "wave", label="", labelWidth=0, addSpace=False, valueType=float, orientation="horizontal") self.box_line = oasysgui.widgetBox(left_box_2_1, "", addSpace=False, orientation="horizontal", width=100) XRayServerGui.combobox_text(self.box_line, self, "line", label="", labelWidth=0, items=self.get_lines(), sendSelectedValue=True, orientation="horizontal", selectedValue=self.line) button = gui.button(self.box_line, self, "?", callback=self.help_lines) button.setFixedWidth(15) self.set_xway() gui.comboBox(left_box_2_1, self, "ipol", label="Polarization", items=["Sigma", "Pi", "Mixed"], sendSelectedValue=False, orientation="horizontal") # ------------------------------------------------------------- left_box_3 = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="vertical", width=470) left_box_3_1 = oasysgui.widgetBox(left_box_3, "", addSpace=False, orientation="horizontal", width=470) XRayServerGui.combobox_text(left_box_3_1, self, "code", label="Crystal", labelWidth=40, items=self.get_crystals(), sendSelectedValue=True, orientation="horizontal", selectedValue=self.code) button = gui.button(left_box_3_1, self, "?", callback=self.help_crystals) button.setFixedWidth(15) gui.comboBox(left_box_3_1, self, "df1df2", label=" ", labelWidth=20, items=["Auto DB for f\', f\'\'", "X0h data (0.5-2.5 A)", "Henke (0.4-1200 A)", "Brennan (0.02-400 A)"], sendSelectedValue=False, orientation="horizontal") left_box_3_2 = oasysgui.widgetBox(left_box_3, "", addSpace=False, orientation="horizontal", width=470) gui.lineEdit(left_box_3_2, self, "sigma", label="Sigma", labelWidth=80, addSpace=False, valueType=float, orientation="horizontal") gui.lineEdit(left_box_3_2, self, "w0", label="A W0", labelWidth=50, addSpace=False, valueType=float, orientation="horizontal") gui.lineEdit(left_box_3_2, self, "wh", label=" Wh", labelWidth=50, addSpace=False, valueType=float, orientation="horizontal") # ------------------------------------------------------------- left_box_4 = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="horizontal", width=470) left_box_4_1 = oasysgui.widgetBox(left_box_4, "", addSpace=False, orientation="horizontal", width=240) gui.lineEdit(left_box_4_1, self, "i1", label="Bragg Reflection", labelWidth=97, addSpace=False, valueType=int, orientation="horizontal") gui.lineEdit(left_box_4_1, self, "i2", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") gui.lineEdit(left_box_4_1, self, "i3", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") left_box_4_2 = oasysgui.widgetBox(left_box_4, "", addSpace=False, orientation="horizontal", width=228) gui.lineEdit(left_box_4_2, self, "daa", label=" Substrate da/a", labelWidth=135, addSpace=False, valueType=float, orientation="horizontal") # ------------------------------------------------------------- # ------------------------------------------------------------- self.simplified_input_box = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="vertical", width=470, height=290) gui.comboBox(self.simplified_input_box, self, "igie", label="Geometry specified by", items=["angle of Bragg planes to surface ('+' for g0>gh)", "incidence angle of K0", "exit angle of Kh", "asymmetry factor beta=g0/gh"], callback=self.set_igie_s, sendSelectedValue=False, orientation="horizontal") simplified_input_box_1 = oasysgui.widgetBox(self.simplified_input_box, "", addSpace=False, orientation="horizontal", width=470) gui.lineEdit(simplified_input_box_1, self, "fcentre", label="Value", labelWidth=280, addSpace=False, valueType=float, orientation="horizontal") self.unic_combo_s = gui.comboBox(simplified_input_box_1, self, "unic", label=" ", labelWidth=1, items=[" ", "degr.", "min.", "mrad.", "sec.", "urad"], sendSelectedValue=False, orientation="horizontal") self.set_igie_s() simplified_input_box_2 = oasysgui.widgetBox(self.simplified_input_box, "", addSpace=False, orientation="horizontal", width=470) gui.lineEdit(simplified_input_box_2, self, "scanmin", label="Scan: From", labelWidth=70, addSpace=False, valueType=float, orientation="horizontal") gui.lineEdit(simplified_input_box_2, self, "scanmax", label="To", labelWidth=15, addSpace=False, valueType=float, orientation="horizontal") self.simplified_input_box_scan_1_1 = oasysgui.widgetBox(simplified_input_box_2, "", addSpace=False, orientation="horizontal") gui.comboBox(self.simplified_input_box_scan_1_1, self, "unis", label=" ", labelWidth=1, items=["degr.", "min.", "mrad.", "sec.", "urad"], sendSelectedValue=False, orientation="horizontal") gui.lineEdit(self.simplified_input_box_scan_1_1, self, "nscan", label="Points", labelWidth=40, addSpace=False, valueType=int, orientation="horizontal") self.simplified_input_box_scan_1_2 = oasysgui.widgetBox(self.simplified_input_box, "", addSpace=False, orientation="horizontal", width=470) gui.checkBox(self.simplified_input_box_scan_1_2, self, "invert", "Invert axis", labelWidth=190) gui.comboBox(self.simplified_input_box_scan_1_2, self, "column", label="Plot argument", labelWidth=100, items=["scan angle", "incidence angle", "exit angle"], sendSelectedValue=False, orientation="horizontal") self.simplified_input_box_scan_2_1 = oasysgui.widgetBox(simplified_input_box_2, "", addSpace=False, orientation="horizontal") self.unis_combo_s = gui.comboBox(self.simplified_input_box_scan_2_1, self, "unis", label=" ", labelWidth=1, items=["degr.", "min.", "mrad.", "sec.", "urad", "eV"], sendSelectedValue=False, orientation="horizontal") gui.lineEdit(self.simplified_input_box_scan_2_1, self, "nscan", label="Points", labelWidth=40, addSpace=False, valueType=int, orientation="horizontal") self.simplified_input_box_scan_2_2 = oasysgui.widgetBox(self.simplified_input_box, "", addSpace=False, orientation="horizontal") gui.comboBox(self.simplified_input_box_scan_2_2, self, "axis", label="Scan Type", labelWidth=290, items=["[k0 x h]", "Energy (eV)", "Energy (eV), no X0h recalc"], sendSelectedValue=False, orientation="horizontal", callback=self.set_scan_type_s) self.set_scan_type_s() # ------------------------------------------------------------- # ------------------------------------------------------------- self.full_input_box = oasysgui.widgetBox(tab_input, "", addSpace=True, orientation="vertical", width=470, height=290) gui.comboBox(self.full_input_box, self, "igie", label="Geom. by", labelWidth=60, items=["[1]. Surface orientation & incidence angle of K0", "[2]. Surface orientation & exit angle of Kh", "[3]. Surface orientation & condition of coplanar grazing incidence", "[4]. Surface orientation & condition of coplanar grazing exit", "[5]. Surface orientation & condition of symmetric Bragg case", "[6]. Condition of coplanar reflection & angle of Bragg planes to surface", "[7]. Condition of coplanar reflection & incidence angle of K0", "[8]. Condition of coplanar reflection & exit angle of Kh", "[9]. Condition of coplanar reflection & asymmetry factor beta=g0/gh"], callback=self.set_igie_f, sendSelectedValue=False, orientation="horizontal") gui.label(self.full_input_box, self, "-- Geom. parameter ([1,7]=incidence angle, [2,8]=exit angle, [6]=Bragg planes") full_input_box_1 = oasysgui.widgetBox(self.full_input_box, "", addSpace=False, orientation="vertical", width=470) full_input_box_1_1 = oasysgui.widgetBox(full_input_box_1, "", addSpace=False, orientation="horizontal", width=470) self.le_fcentre = gui.lineEdit(full_input_box_1_1, self, "fcentre", label=" angle, [9]=g0/gh)", labelWidth=250, addSpace=False, valueType=float, orientation="horizontal") self.unic_combo_f = gui.comboBox(full_input_box_1_1, self, "unic", label=" ", labelWidth=1, items=[" ", "degr.", "min.", "mrad.", "sec.", "urad"], sendSelectedValue=False, orientation="horizontal") self.set_igie_f() full_input_box_1_2 = oasysgui.widgetBox(full_input_box_1, "", addSpace=False, orientation="horizontal", width=270) gui.lineEdit(full_input_box_1_2, self, "n1", label="-- Surface plane ([1-5])", labelWidth=135, addSpace=False, valueType=int, orientation="horizontal") gui.lineEdit(full_input_box_1_2, self, "n2", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") gui.lineEdit(full_input_box_1_2, self, "n3", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") full_input_box_2 = oasysgui.widgetBox(self.full_input_box, "", addSpace=False, orientation="horizontal", width=470) full_input_box_2_1 = oasysgui.widgetBox(full_input_box_2, "", addSpace=False, orientation="horizontal", width=270) gui.lineEdit(full_input_box_2_1, self, "m1", label="Miscut direction", labelWidth=135, addSpace=False, valueType=int, orientation="horizontal") gui.lineEdit(full_input_box_2_1, self, "m2", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") gui.lineEdit(full_input_box_2_1, self, "m3", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") full_input_box_2_2 = oasysgui.widgetBox(full_input_box_2, "", addSpace=False, orientation="horizontal") gui.lineEdit(full_input_box_2_2, self, "miscut", label="Miscut angle", addSpace=False, valueType=float, orientation="horizontal") gui.comboBox(full_input_box_2_2, self, "unim", label=" ", labelWidth=1, items=["degr.", "min.", "mrad.", "sec.", "urad"], sendSelectedValue=False, orientation="horizontal") full_input_box_3 = oasysgui.widgetBox(self.full_input_box, "", addSpace=False, orientation="vertical", width=470) full_input_box_3_1 = oasysgui.widgetBox(full_input_box_3, "", addSpace=False, orientation="horizontal", width=470) gui.comboBox(full_input_box_3_1, self, "axis", label="Scan Type", labelWidth=190, items=["Surface normal (N_surface)", "[k0 x N_surface]", "Reciprocal latt.vector (h)", "[k0 x h]", "Other axis", "Takeoff spectrum (PSD)"], sendSelectedValue=False, orientation="horizontal", callback=self.set_scan_type_f) gui.checkBox(full_input_box_3_1, self, "invert", "Invert axis", labelWidth=90) full_input_box_3_2 = oasysgui.widgetBox(full_input_box_3, "", addSpace=False, orientation="horizontal", width=470) self.le_a1 = gui.lineEdit(full_input_box_3_2, self, "a1", label="Indices, if other scan axis", labelWidth=290, addSpace=False, valueType=int, orientation="horizontal") self.le_a2 = gui.lineEdit(full_input_box_3_2, self, "a2", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") self.le_a3 = gui.lineEdit(full_input_box_3_2, self, "a3", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal") self.set_scan_type_f() full_input_box_5 = oasysgui.widgetBox(self.full_input_box, "", addSpace=False, orientation="vertical", width=470) full_input_box_5_1 = oasysgui.widgetBox(full_input_box_5, "", addSpace=False, orientation="horizontal", width=470) gui.lineEdit(full_input_box_5_1, self, "scanmin", label="Scan: From", labelWidth=70, addSpace=False, valueType=float, orientation="horizontal") gui.lineEdit(full_input_box_5_1, self, "scanmax", label="To", labelWidth=15, addSpace=False, valueType=float, orientation="horizontal") gui.comboBox(full_input_box_5_1, self, "unis", label=" ", labelWidth=1, items=["degr.", "min.", "mrad.", "sec.", "urad"], sendSelectedValue=False, orientation="horizontal") gui.lineEdit(full_input_box_5_1, self, "nscan", label="Points", labelWidth=40, addSpace=False, valueType=int, orientation="horizontal") full_input_box_5_2 = oasysgui.widgetBox(full_input_box_5, "", addSpace=False, orientation="horizontal", width=470) gui.comboBox(full_input_box_5_2, self, "column", label="Plot argument", labelWidth=290, items=["scan angle", "incidence angle", "exit angle"], sendSelectedValue=False, orientation="horizontal") # ------------------------------------------------------------- box_alpha = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="horizontal", width=280) self.le_alphamax = gui.lineEdit(box_alpha, self, "alphamax", label="Approximations: alpha_max", labelWidth=170, addSpace=False, valueType=float, orientation="horizontal") gui.label(box_alpha, self, "*|xh|") gui.separator(tab_input) # ------------------------------------------------------------- box_top = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="vertical", width=470) box_top_0 = oasysgui.widgetBox(box_top, "", addSpace=False, orientation="horizontal", width=470) box_top_0_1 = oasysgui.widgetBox(box_top_0, "", addSpace=False, orientation="vertical", width=100) gui.label(box_top_0_1, self, "Top layer profile\n(optional):") button = gui.button(box_top_0_1, self, "? (sintax)", callback=self.help_profile) button.setFixedWidth(90) box_top_0_2 = oasysgui.widgetBox(box_top_0, "", addSpace=False, orientation="horizontal", width=360) self.profile_area = QtWidgets.QTextEdit() self.profile_area.setMaximumHeight(110) self.profile_area.setMaximumWidth(360) box_top_0_2.layout().addWidget(self.profile_area) box_top_labels = oasysgui.widgetBox(box_top, "", addSpace=False, orientation="horizontal", width=470) box_top_labels_1 = oasysgui.widgetBox(box_top_labels, "", addSpace=False, orientation="horizontal", width=100) gui.label(box_top_labels_1, self, "Available Codes:") box_top_labels_2 = oasysgui.widgetBox(box_top_labels, "", addSpace=False, orientation="horizontal", width=360) gui.label(box_top_labels_2, self, "Crystals") gui.label(box_top_labels_2, self, "Non-Crystals") gui.label(box_top_labels_2, self, "Elements") box_top_1 = oasysgui.widgetBox(box_top, "", addSpace=False, orientation="horizontal", width=470) oasysgui.widgetBox(box_top_1, "", addSpace=False, orientation="horizontal", width=100) box_top_1_2 = oasysgui.widgetBox(box_top_1, "", addSpace=False, orientation="horizontal", width=360) crystals_area = QtWidgets.QTextEdit() crystals_area.setMaximumHeight(100) crystals_area.setMaximumWidth(120) crystals_area.setText("\n".join(ListUtility.get_list("crystals"))) crystals_area.setReadOnly(True) non_crystals_area = QtWidgets.QTextEdit() non_crystals_area.setMaximumHeight(100) non_crystals_area.setMaximumWidth(120) non_crystals_area.setText("\n".join(ListUtility.get_list("amorphous"))) non_crystals_area.setReadOnly(True) elements_area = QtWidgets.QTextEdit() elements_area.setMaximumHeight(100) elements_area.setMaximumWidth(120) elements_area.setText("\n".join(ListUtility.get_list("atoms"))) elements_area.setReadOnly(True) box_top_1_2.layout().addWidget(crystals_area) box_top_1_2.layout().addWidget(non_crystals_area) box_top_1_2.layout().addWidget(elements_area) # ----------------------------------------------------------- button = gui.button(tab_input, self, "Submit Query!", callback=self.submit) button.setFixedHeight(30) gui.rubber(self.controlArea) self.tabs = [] self.tabs_widget = oasysgui.tabWidget(self.mainArea) self.initializeTabs() self.set_TemplateType(change_values=False) self.profile_area.textChanged.connect(self.set_profile) self.le_alphamax.focusOutEvent = self.alphamax_focusOutEvent self.alphamax_focusOutEvent(None) gui.rubber(self.mainArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TITLE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CUR", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_MACHINE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_BEAM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PERIOD", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_UNDULATOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "N", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_ENERGY", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 17 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHMIN", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 18 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHMAX", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 19 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHSTEP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 20 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_HARM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 21 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHEL", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 22 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "METHOD", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 23 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IK", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 24 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NEKS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 25 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_PARM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 26 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "RUN_MODE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SUBSTANCE", label=self.unitLabels()[idx], addSpace=True, items=[ 'Element (Atomic number)', 'Element (Symbol)', 'Compound (Formula)', 'Mixture (F1:F2:F3...)' ], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DESCRIPTION", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FRACTION", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=True, items=['Standard', 'Standard+points', 'Points only'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRIDINPUT", label=self.unitLabels()[idx], addSpace=True, items=['From Keyboard', 'From file'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDDATA", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "ELEMENTOUTPUT", label=self.unitLabels()[idx], addSpace=True, items=[ 'Cross section [b/atom]', 'Cross section [b/atom] & Attenuation coeff [cm2/g]', 'Partial interaction coeff & Attenuation coeff [cm2/g]' ], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMPTY1", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMPTY2", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "NELEMENTS", label=self.unitLabels()[idx], addSpace=True, items=['1', '2', '3', '4', '5'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SOURCE", label=self.unitLabels()[idx], addSpace=True, items=['Normalized to 1 ', 'From external file. ', 'xop/source SRCOMPE (Flux) ', 'xop/source SRCOMPW (Power)'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENER_MIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENER_MAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENER_N", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SOURCE_FILE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL1_SYM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL1_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL2_SYM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL2_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL3_SYM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL3_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL4_SYM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL4_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL5_SYM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 17 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL5_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "TYPE_CALC", label=self.unitLabels()[idx], addSpace=True, items=['Energy or Power spectra', 'Angular distribution (all wavelengths)', 'Angular distribution (one wavelength)', '2D flux and power (angular,energy) distribution'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MACHINE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "RB_CHOICE", label=self.unitLabels()[idx], addSpace=True, items=['Magnetic Radius', 'Magnetic Field'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MACHINE_R_M", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "BFIELD_T", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "BEAM_ENERGY_GEV", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CURRENT_A", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "HOR_DIV_MRAD", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "VER_DIV", label=self.unitLabels()[idx], addSpace=True, items=['Full (integrated in Psi)', 'At Psi=0', 'In [PsiMin,PsiMax]', 'At Psi=Psi_Min'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PHOT_ENERGY_MIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PHOT_ENERGY_MAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "LOG_CHOICE", label=self.unitLabels()[idx], addSpace=True, items=['Lin', 'Log'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PSI_MRAD_PLOT", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PSI_MIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PSI_MAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PSI_NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FIELD", label=self.unitLabels()[idx], addSpace=True, items=['Sinusoidal', 'B from file', 'B from harmonics'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPERIODS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ULAMBDA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "K", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PHOT_ENERGY_MIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PHOT_ENERGY_MAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "LOGPLOT", label=self.unitLabels()[idx], addSpace=True, items=['Lin', 'Log'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NTRAJPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CURRENT", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() self.runaction = OWAction("Compute", self) self.runaction.triggered.connect(self.compute) self.addAction(self.runaction) geom = QApplication.desktop().availableGeometry() self.setGeometry(QRect(round(geom.width()*0.05), round(geom.height()*0.05), round(min(geom.width()*0.98, self.MAX_WIDTH)), round(min(geom.height()*0.95, self.MAX_HEIGHT)))) self.setMaximumHeight(self.geometry().height()) self.setMaximumWidth(self.geometry().width()) self.controlArea.setFixedWidth(self.CONTROL_AREA_WIDTH) self.general_options_box = gui.widgetBox(self.controlArea, "General Options", addSpace=True, orientation="horizontal") gui.checkBox(self.general_options_box, self, 'is_automatic_run', 'Automatic Execution') self.button_box = gui.widgetBox(self.controlArea, "", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(self.button_box, self, "Compute", callback=self.compute, height=35) gui.button(self.button_box, self, "Defaults", callback=self.defaults, height=35) gui.separator(self.controlArea, height=10) self.build_gui() gui.rubber(self.controlArea) self.main_tabs = oasysgui.tabWidget(self.mainArea) plot_tab = oasysgui.createTabPage(self.main_tabs, "Results") out_tab = oasysgui.createTabPage(self.main_tabs, "Output") self.view_box = oasysgui.widgetBox(plot_tab, "Results Options", addSpace=False, orientation="horizontal") view_box_1 = oasysgui.widgetBox(self.view_box, "", addSpace=False, orientation="vertical", width=350) self.view_type_combo = gui.comboBox(view_box_1, self, "view_type", label="View Results", labelWidth=220, items=["No", "Yes"], callback=self.set_ViewType, sendSelectedValue=False, orientation="horizontal") oasysgui.widgetBox(self.view_box, "", addSpace=False, orientation="vertical", width=100) #* ------------------------------------------------------------------------------------------------------------- propagation_box = oasysgui.widgetBox(self.view_box, "", addSpace=False, orientation="vertical") self.le_wise_live_propagation_mode = gui.lineEdit(propagation_box, self, "wise_live_propagation_mode", "Propagation Mode", labelWidth=150, valueType=str, orientation="horizontal") self.le_wise_live_propagation_mode.setAlignment(Qt.AlignCenter) self.le_wise_live_propagation_mode.setReadOnly(True) font = QFont(self.le_wise_live_propagation_mode.font()) font.setBold(True) self.le_wise_live_propagation_mode.setFont(font) self.set_wise_live_propagation_mode() #* ------------------------------------------------------------------------------------------------------------- self.tab = [] self.tabs = oasysgui.tabWidget(plot_tab) self.initializeTabs() self.wise_output = QtWidgets.QTextEdit() self.wise_output.setReadOnly(True) self.wise_output.setStyleSheet("background-color: white;") out_box = gui.widgetBox(out_tab, "System Output", addSpace=True, orientation="horizontal") out_box.layout().addWidget(self.wise_output) self.wise_output.setFixedHeight(590) self.wise_output.setFixedWidth(700) gui.rubber(self.mainArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.get_doc) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FROM", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TO", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FUNCTION_NAME", label=self.unitLabels()[idx], addSpace=True, items=['sin(x)', 'cos(x)', 'x^2+x+1', 'Custom'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CUSTOM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=['Yes', 'No'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FILEF0", label=self.unitLabels()[idx], addSpace=True, items=['f0_xop.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FILEF1F2", label=self.unitLabels()[idx], addSpace=True, items=['f1f2_Windt.dat', 'f1f2_EPDL97.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FILECROSSSEC", label=self.unitLabels()[idx], addSpace=True, items=['CrossSec_XCOM.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "ILATTICE", label=self.unitLabels()[idx], addSpace=True, items=['Si', 'Si_NIST', 'Si2', 'Ge', 'Diamond', 'GaAs', 'GaSb', 'GaP', 'InAs', 'InP', 'InSb', 'SiC', 'NaCl', 'CsF', 'LiF', 'KCl', 'CsCl', 'Be', 'Graphite', 'PET', 'Beryl', 'KAP', 'RbAP', 'TlAP', 'Muscovite', 'AlphaQuartz', 'Copper', 'LiNbO3', 'Platinum', 'Gold', 'Sapphire', 'LaB6', 'LaB6_NIST', 'KTP', 'AlphaAlumina', 'Aluminum', 'Iron', 'Titanium'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "HMILLER", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "KMILLER", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "LMILLER", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "I_ABSORP", label=self.unitLabels()[idx], addSpace=True, items=['No', 'Yes (photoelectric)', 'Yes(ph.el+compton)', 'Yes(ph.el+compton+rayleigh)'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEMPER", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY_END", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.calculate_IdealPhaseRetarder) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.get_doc) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 # widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "TYPE", label=self.unitLabels()[idx], addSpace=True, items=[ 'general', 'Quarter Wave Plate (fast-axis horizontal)', 'Quarter Wave Plate (fast-axis vertical)', 'Half Wave Plate (also Ideal Mirror)' ], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "THETA", label=self.unitLabels()[idx], addSpace=True, valueType=float, ) self.show_at(self.unitFlags()[idx], box1) # widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "DELTA", label=self.unitLabels()[idx], addSpace=True, valueType=float, ) self.show_at(self.unitFlags()[idx], box1) # widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH - 5) idx = -1 #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "ILATTICE", label=self.unitLabels()[idx], addSpace=False, items=Crystal_GetCrystalsList(), valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "HMILLER", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "KMILLER", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "LMILLER", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "plot_variable", label=self.unitLabels()[idx], addSpace=False, items=self.plotOptionList()[2:], valueType=int, orientation="horizontal", labelWidth=150) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "TEMPER", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ENERGY_END", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "F1F2", label=self.unitLabels()[idx], addSpace=True, items=['f1f2_Windt.dat', 'f1f2_EPDL97.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MU", label=self.unitLabels()[idx], addSpace=True, items=['CrossSec_XCOM.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SOURCE", label=self.unitLabels()[idx], addSpace=True, items=['Normalized to 1 (Standard E grid) ', 'Normalized to 1 (E from keyboard) ', 'From external file. ', 'xop/source Flux (file: SRCOMPE) ', 'xop/source Power (file: SRCOMPW) '], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DUMMY1", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DUMMY2", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DUMMY3", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENER_MIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENER_MAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENER_N", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SOURCE_FILE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "NELEMENTS", label=self.unitLabels()[idx], addSpace=True, items=['1', '2', '3', '4', '5'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL1_FOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "EL1_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Filter', 'Mirror'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL1_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL1_ANG", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL1_ROU", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL1_DEN", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 17 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL2_FOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 18 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "EL2_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Filter', 'Mirror'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 19 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL2_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 20 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL2_ANG", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 21 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL2_ROU", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 22 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL2_DEN", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 23 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL3_FOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 24 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "EL3_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Filter', 'Mirror'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 25 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL3_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 26 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL3_ANG", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 27 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL3_ROU", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 28 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL3_DEN", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 29 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL4_FOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 30 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "EL4_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Filter', 'Mirror'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 31 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL4_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 32 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL4_ANG", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 33 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL4_ROU", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 34 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL4_DEN", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 35 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL5_FOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 36 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "EL5_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Filter', 'Mirror'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 37 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL5_THI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 38 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL5_ANG", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 39 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL5_ROU", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 40 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EL5_DEN", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") # widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 # widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "CRYSTAL", label=self.unitLabels()[idx], addSpace=True, items=[ "Si", "Si_NIST", "Si2", "Ge", "Diamond", "GaAs", "GaSb", "GaP", "InAs", "InP", "InSb", "SiC", "NaCl", "CsF", "LiF", "KCl", "CsCl", "Be", "Graphite", "PET", "Beryl", "KAP", "RbAP", "TlAP", "Muscovite", "AlphaQuartz", "Copper", "LiNbO3", "Platinum", "Gold", "Sapphire", "LaB6", "LaB6_NIST", "KTP", "AlphaAlumina", "Aluminum", "Iron", "Titanium", ], valueType=int, orientation="horizontal", ) self.show_at(self.unitFlags()[idx], box1) # widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "H", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator() ) self.show_at(self.unitFlags()[idx], box1) # widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "K", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator() ) self.show_at(self.unitFlags()[idx], box1) # widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "L", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator() ) self.show_at(self.unitFlags()[idx], box1) # widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "HMAX", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator() ) self.show_at(self.unitFlags()[idx], box1) # widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "KMAX", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator() ) self.show_at(self.unitFlags()[idx], box1) # widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "LMAX", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator() ) self.show_at(self.unitFlags()[idx], box1) # widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "FHEDGE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator(), ) self.show_at(self.unitFlags()[idx], box1) # widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.comboBox( box1, self, "DISPLAY", label=self.unitLabels()[idx], addSpace=True, items=["Spaghetti", "Spaghetti+Umweg", "Spaghetti+Glitches", "All"], valueType=int, orientation="horizontal", ) self.show_at(self.unitFlags()[idx], box1) # widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "LAMBDA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator(), ) self.show_at(self.unitFlags()[idx], box1) # widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "DELTALAMBDA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator(), ) self.show_at(self.unitFlags()[idx], box1) # widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "PHI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator(), ) self.show_at(self.unitFlags()[idx], box1) # widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "DELTAPHI", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator(), ) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TITLE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CUR", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ITYPE", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PERIOD", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "N", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "KX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "KY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PHASE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "D", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 17 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "XPC", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 18 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "YPC", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 19 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "XPS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 20 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "YPS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 21 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NXP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 22 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NYP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 23 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MODE", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 24 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ICALC", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 25 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHARM", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 26 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPHI", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 27 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NSIG", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 28 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NALPHA", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 29 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DALPHA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 30 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NOMEGA", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 31 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DOMEGA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PERIOD", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPER", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "IMAGNET", label=self.unitLabels()[idx], addSpace=True, items=['Nd-Fe-B', 'Sm-Co'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "ITYPE", label=self.unitLabels()[idx], addSpace=True, items=['planar undulator', 'tapered undulator'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "K", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GAP", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GAPTAP", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def build_gui(self): box0 = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH - 5) idx = -1 # # # box = gui.widgetBox(box0, "Substrate", orientation="vertical") #widget index 0 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "MATERIAL_S", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DENSITY_S", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ROUGHNESS_S", valueType=float, label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # # # box = gui.widgetBox(box0, "Even layer (closer to substrate)", orientation="vertical") #widget index 3 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "MATERIAL_E", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DENSITY_E", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ROUGHNESS_E", valueType=float, label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # # # box = gui.widgetBox(box0, "Odd layer (close to vacuum)", orientation="vertical") #widget index 6 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "MATERIAL_O", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DENSITY_O", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ROUGHNESS_O", valueType=float, label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # # # box = gui.widgetBox(box0, "Bilayers", orientation="vertical") #widget index 9 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THICKNESS", valueType=float, label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GAMMA", valueType=float, label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "NLAYERS", valueType=int, label=self.unitLabels()[idx], addSpace=False, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # # # box = gui.widgetBox(box0, "scan - angle", orientation="vertical") #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "THETA_FLAG", label=self.unitLabels()[idx], addSpace=False, items=['Single Value', 'Scan'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 13 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETA", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 14 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETA_END", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 15 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "THETA_N", label=self.unitLabels()[idx], addSpace=False, valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # # # box = gui.widgetBox(box0, "scan - energy", orientation="vertical") #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "ENERGY_FLAG", label=self.unitLabels()[idx], addSpace=False, items=['Single Value', 'Scan'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 17 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 18 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ENERGY_END", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 19 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "ENERGY_N", label=self.unitLabels()[idx], addSpace=False, valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # # # box = gui.widgetBox(box0, "output", orientation="vertical") # widget index 20 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 21 idx += 1 box1 = gui.widgetBox(box, orientation="horizontal") gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.button(box1, self, "...", callback=self.selectFile) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FILEF0", label=self.unitLabels()[idx], addSpace=True, items=['f0_xop.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FILEF1F2", label=self.unitLabels()[idx], addSpace=True, items=['f1f2_Windt.dat', 'f1f2_EPDL97.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "FILECROSSSEC", label=self.unitLabels()[idx], addSpace=True, items=['CrossSec_XCOM.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CRYSTAL_MATERIAL", label=self.unitLabels()[idx], addSpace=True, items=['Si', 'Si_NIST', 'Si2', 'Ge', 'Diamond', 'GaAs', 'GaSb', 'GaP', 'InAs', 'InP', 'InSb', 'SiC', 'NaCl', 'CsF', 'LiF', 'KCl', 'CsCl', 'Be', 'Graphite', 'PET', 'Beryl', 'KAP', 'RbAP', 'TlAP', 'Muscovite', 'AlphaQuartz', 'Copper', 'LiNbO3', 'Platinum', 'Gold', 'Sapphire', 'LaB6', 'LaB6_NIST', 'KTP', 'AlphaAlumina', 'Aluminum', 'Iron', 'Titanium'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MILLER_INDEX_H", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MILLER_INDEX_K", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MILLER_INDEX_L", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "I_ABSORP", label=self.unitLabels()[idx], addSpace=True, items=['No', 'Yes (photoelectric)', 'Yes(ph.el+compton)', 'Yes(ph.el+compton+rayleigh)'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEMPER", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MOSAIC", label=self.unitLabels()[idx], addSpace=True, items=['Perfect crystal', 'Mosaic', 'Bent Crystal ML', 'Bent Crystal PP'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GEOMETRY", label=self.unitLabels()[idx], addSpace=True, items=['BRAGG: diffr beam', 'LAUE: diffr beam', 'BRAGG: transm beam', 'LAUE: transm beam'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SCAN", label=self.unitLabels()[idx], addSpace=True, items=['Theta (absolute)', 'Th - ThBragg(corrected)', 'Th - Th Bragg', 'Energy [eV]', 'y (Zachariasen)'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "UNIT", label=self.unitLabels()[idx], addSpace=True, items=['Radians', 'micro rads', 'Degrees', 'ArcSec'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SCANFROM", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SCANTO", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SCANPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 17 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ASYMMETRY_ANGLE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 18 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "THICKNESS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 19 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MOSAIC_FWHM", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 20 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "RSAG", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 21 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "RMER", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 22 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "ANISOTROPY", label=self.unitLabels()[idx], addSpace=True, items=['None (isotropic)', 'Default cut', 'Cut directions', 'From file'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 23 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "POISSON", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 24 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CUT", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 25 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILECOMPLIANCE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH-5) idx = -1 #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=False, items=['Element(formula)', 'Compound(formula)', 'Compound(table)'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) items = nist_compound_list() gui.comboBox(box1, self, "MAT_LIST", label=self.unitLabels()[idx], addSpace=False, items=items, valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], addSpace=False, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DENSITY", label=self.unitLabels()[idx], addSpace=False, valueType=str, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CALCULATE", label=self.unitLabels()[idx], addSpace=False, items=['Total','PhotoElectric','Rayleigh','Compton','Total-Rayleigh'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=False, items=['Standard', 'User defined', 'Single Value'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=False, valueType=float, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=False, valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "UNIT", label=self.unitLabels()[idx], addSpace=False, items=['barn/atom [Cross Section] *see help*', 'cm^2 [Cross Section] *see help*', 'cm^2/g [Mass abs coef]', 'cm^-1 [Linear abs coef]'], valueType=int, orientation="horizontal", labelWidth=130) self.show_at(self.unitFlags()[idx], box1) # widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TITLE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CUR", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_MACHINE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_BEAM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PERIOD", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_UNDULATOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "N", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_ENERGY", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 17 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHMIN", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 18 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHMAX", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 19 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHSTEP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 20 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_HARM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 21 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHEL", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 22 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "METHOD", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 23 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IK", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 24 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NEKS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 25 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEXT_PARM", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 26 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "RUN_MODE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ", orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.calculate_IdealLinearPolarizer) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.get_doc) self.process_showers() box = gui.widgetBox(self.controlArea, " ", orientation="vertical") idx = -1 # widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "TYPE", label=self.unitLabels()[idx], addSpace=True, items=[ 'general', 'Liner polarizer (horizontal transmission)', 'Liner polarizer (vertical transmission)', 'Liner polarizer (+45 deg transmission)', 'Liner polarizer (-45 deg transmission)' ], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit( box1, self, "THETA", label=self.unitLabels()[idx], addSpace=True, valueType=float, ) self.show_at(self.unitFlags()[idx], box1) # widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CRYSTAL_MATERIAL", label=self.unitLabels()[idx], addSpace=True, items=['Silicon', 'Germanium', 'Diamond', 'GaAs', 'GaP', 'InAs', 'InP', 'InSb', 'SiC', 'CsF', 'KCl', 'LiF', 'NaCl', 'Graphite', 'Beryllium'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MODE", label=self.unitLabels()[idx], addSpace=True, items=['Reflectivity in Bragg case', 'Transmission in Bragg case', 'Reflectivity in Laue case', 'Transmission in Laue case'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MILLER_INDEX_H", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MILLER_INDEX_K", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MILLER_INDEX_L", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ASYMMETRY_ANGLE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "THICKNESS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TEMPERATURE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SCALE", label=self.unitLabels()[idx], addSpace=True, items=['Automatic', 'External'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "XFROM", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "XTO", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self, parent=None, signalManager=None): widget.OWWidget.__init__(self, parent, signalManager) # GUI possible_geometries = GeometryType.allGeometryTypes() geometries = [geo.description() for geo in possible_geometries] self.geometries_mapping = {} for index,geo in enumerate(possible_geometries): self.geometries_mapping[index] = geo self.cbb_geometry_type = gui.comboBox(self, self, "value_cbb_geometry_type", box=None, label="Geometry type", items=geometries, control2attributeDict=self.geometries_mapping) crystal_names = ["Si", "Diamond"] self.cbb_crystal_name = gui.comboBox(self, self, "value_cbb_crystal_name", box=None, label = "Crystal Name", items = crystal_names, control2attributeDict=self.crystal_names_mapping) self.le_thickness = gui.lineEdit(self, self, "value_le_thickness", label="Thickness [cm]") self.sp_miller_h = gui.spin(self, self, "value_sp_miller_h", -100000, 100000, step=1, label="Miller index h") self.sp_miller_k = gui.spin(self, self, "value_sp_miller_k", -100000, 100000, step=1, label="Miller index k") self.sp_miller_l = gui.spin(self, self, "value_sp_miller_l", -100000, 100000, step=1, label="Miller index l") self.sp_asymmetry_angle = gui.spin(self, self, "value_sp_asymmetry_angle", 0, 90, step=1, label="Asymmetry angle [deg]") self.le_energy_min = gui.lineEdit(self, self, "value_le_energy_min", label="Minimum energy [keV]") self.le_energy_max = gui.lineEdit(self, self, "value_le_energy_max", label="Maximum energy [keV]") self.le_energy_min = gui.lineEdit(self, self, "value_le_energy_points", label="Energy points") self.le_angle_min = gui.lineEdit(self, self, "value_le_angle_min", label="Angle min [micro rad]") self.le_angle_max = gui.lineEdit(self, self, "value_le_angle_max", label="Angle max [micro rad]") self.le_angle_points = gui.lineEdit(self, self, "value_le_angle_points", label="Angle points") self.btn_calculate = gui.button(self, self, "Calculate", self.calculate)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MODE", label=self.unitLabels()[idx], addSpace=True, items=['Periodic Layers', 'Individual Layers'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "SCAN", label=self.unitLabels()[idx], addSpace=True, items=['Grazing Angle', 'Photon Energy'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "F12_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Create on the fly', 'Use existing file: mlayers.f12'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SUBSTRATE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ODD_MATERIAL", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EVEN_MATERIAL", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "THETA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SCAN_STEP", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPOINTS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ODD_THICKNESS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EVEN_THICKNESS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NLAYERS", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DATASETS", label=self.unitLabels()[idx], addSpace=True, items=['all', 'f1f2_Windt.dat', 'f1f2_EPDL97.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Element(formula)', 'Mixture(formula)', 'Mixture(table)'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_LIST", label=self.unitLabels()[idx], addSpace=True, items=['B4C', 'BeO', 'BN', 'Cr2O3', 'CsI', 'GaAs', 'LiF', 'MgO', 'MoSi2', 'TiN', 'Sapphire', 'Polyimide', 'Polypropylene', 'PMMA', 'Polycarbonate', 'Kimfol', 'Mylar', 'Teflon', 'Parylene-C', 'Parylene-N', 'Fluorite', 'Salt', 'NiO', 'SiC', 'Si3N4', 'Silica', 'Quartz', 'Rutile', 'ULE', 'Zerodur', 'water', 'protein', 'lipid', 'nucleosome', 'dna', 'helium', 'chromatin', 'air', 'pmma', 'nitride', 'graphite', 'nickel', 'beryl', 'copper', 'quartz', 'aluminum', 'gold', 'ice', 'carbon', 'polystyrene', 'A-150 TISSUE-EQUIVALENT PLASTIC', 'ADIPOSE TISSUE (ICRU-44)', 'AIR, DRY (NEAR SEA LEVEL)', 'ALANINE', 'B-100 BONE-EQUIVALENT PLASTIC', 'BAKELITE', 'BLOOD, WHOLE (ICRU-44)', 'BONE, CORTICAL (ICRU-44)', 'BRAIN, GREY/WHITE MATTER (ICRU-44)', 'BREAST TISSUE (ICRU-44)', 'C-552 AIR-EQUIVALENT PLASTIC', 'CADMIUM TELLURIDE', 'CALCIUM FLUORIDE', 'CALCIUM SULFATE', '15e-3 M CERIC AMMONIUM SULFATE SOLUTION', 'CESIUM IODIDE', 'CONCRETE, ORDINARY', 'CONCRETE, BARITE (TYPE BA)', 'EYE LENS (ICRU-44)', 'FERROUS SULFATE (STANDARD FRICKE)', 'GADOLINIUM OXYSULFIDE', 'GAFCHROMIC SENSOR', 'GALLIUM ARSENIDE', 'GLASS, BOROSILICATE (PYREX)', 'GLASS, LEAD', 'LITHIUM FLUORIDE', 'LITHIUM TETRABORATE', 'LUNG TISSUE (ICRU-44)', 'MAGNESIUM TETRABORATE', 'MERCURIC IODIDE', 'MUSCLE, SKELETAL (ICRU-44)', 'OVARY (ICRU-44)', 'PHOTOGRAPHIC EMULSION (KODAK TYPE AA)', 'PHOTOGRAPHIC EMULSION (STANDARD NUCLEAR)', 'PLASTIC SCINTILLATOR (VINYLTOLUENE)', 'POLYETHYLENE', 'POLYETHYLENE TEREPHTHALATE (MYLAR)', 'POLYMETHYL METHACRYLATE', 'POLYSTYRENE', 'POLYTETRAFLUOROETHYLENE (TEFLON)', 'POLYVINYL CHLORIDE', 'RADIOCHROMIC DYE FILM (NYLON BASE)', 'TESTIS (ICRU-44)', 'TISSUE, SOFT (ICRU-44)', 'TISSUE, SOFT (ICRU FOUR-COMPONENT)', 'TISSUE-EQUIVALENT GAS (METHANE BASED)', 'TISSUE-EQUIVALENT GAS (PROPANE BASED)', 'WATER, LIQUID'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DENSITY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "CALCULATE", label=self.unitLabels()[idx], addSpace=True, items=['all', 'f1', 'f2', 'delta', 'beta *see help*', 'mu [cm^-1] *see help*', 'mu [cm^2/g] *see help*', 'Cross Section[barn] *see help*', 'reflectivity-s', 'reflectivity-p', 'reflectivity-unpol', 'delta/beta **see help**'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=True, items=['Standard', 'User defined', 'Single Value'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "THETAGRID", label=self.unitLabels()[idx], addSpace=True, items=['Single value', 'User Defined'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ROUGH", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "THETA1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "THETA2", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "THETAN", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DATASETS", label=self.unitLabels()[idx], addSpace=True, items=['all', 'CrossSec_XCOM.dat'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=True, items=['Element(formula)', 'Mixture(formula)', 'Mixture(table)'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_LIST", label=self.unitLabels()[idx], addSpace=True, items=['B4C', 'BeO', 'BN', 'Cr2O3', 'CsI', 'GaAs', 'LiF', 'MgO', 'MoSi2', 'TiN', 'Sapphire', 'Polyimide', 'Polypropylene', 'PMMA', 'Polycarbonate', 'Kimfol', 'Mylar', 'Teflon', 'Parylene-C', 'Parylene-N', 'Fluorite', 'Salt', 'NiO', 'SiC', 'Si3N4', 'Silica', 'Quartz', 'Rutile', 'ULE', 'Zerodur', 'water', 'protein', 'lipid', 'nucleosome', 'dna', 'helium', 'chromatin', 'air', 'pmma', 'nitride', 'graphite', 'nickel', 'beryl', 'copper', 'quartz', 'aluminum', 'gold', 'ice', 'carbon', 'polystyrene', 'A-150 TISSUE-EQUIVALENT PLASTIC', 'ADIPOSE TISSUE (ICRU-44)', 'AIR, DRY (NEAR SEA LEVEL)', 'ALANINE', 'B-100 BONE-EQUIVALENT PLASTIC', 'BAKELITE', 'BLOOD, WHOLE (ICRU-44)', 'BONE, CORTICAL (ICRU-44)', 'BRAIN, GREY/WHITE MATTER (ICRU-44)', 'BREAST TISSUE (ICRU-44)', 'C-552 AIR-EQUIVALENT PLASTIC', 'CADMIUM TELLURIDE', 'CALCIUM FLUORIDE', 'CALCIUM SULFATE', '15e-3 M CERIC AMMONIUM SULFATE SOLUTION', 'CESIUM IODIDE', 'CONCRETE, ORDINARY', 'CONCRETE, BARITE (TYPE BA)', 'EYE LENS (ICRU-44)', 'FERROUS SULFATE (STANDARD FRICKE)', 'GADOLINIUM OXYSULFIDE', 'GAFCHROMIC SENSOR', 'GALLIUM ARSENIDE', 'GLASS, BOROSILICATE (PYREX)', 'GLASS, LEAD', 'LITHIUM FLUORIDE', 'LITHIUM TETRABORATE', 'LUNG TISSUE (ICRU-44)', 'MAGNESIUM TETRABORATE', 'MERCURIC IODIDE', 'MUSCLE, SKELETAL (ICRU-44)', 'OVARY (ICRU-44)', 'PHOTOGRAPHIC EMULSION (KODAK TYPE AA)', 'PHOTOGRAPHIC EMULSION (STANDARD NUCLEAR)', 'PLASTIC SCINTILLATOR (VINYLTOLUENE)', 'POLYETHYLENE', 'POLYETHYLENE TEREPHTHALATE (MYLAR)', 'POLYMETHYL METHACRYLATE', 'POLYSTYRENE', 'POLYTETRAFLUOROETHYLENE (TEFLON)', 'POLYVINYL CHLORIDE', 'RADIOCHROMIC DYE FILM (NYLON BASE)', 'TESTIS (ICRU-44)', 'TISSUE, SOFT (ICRU-44)', 'TISSUE, SOFT (ICRU FOUR-COMPONENT)', 'TISSUE-EQUIVALENT GAS (METHANE BASED)', 'TISSUE-EQUIVALENT GAS (PROPANE BASED)', 'WATER, LIQUID'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DENSITY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CALCULATE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "GRID", label=self.unitLabels()[idx], addSpace=True, items=['Standard', 'User defined', 'Single Value'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "UNIT", label=self.unitLabels()[idx], addSpace=True, items=['barn/atom [Cross Section] *see help*', 'cm^2 [Cross Section] *see help*', 'cm^2/g [Mass abs coef]', 'cm^-1 [Linear abs coef]'], valueType=int, orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH - 5) idx = -1 #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=False, items=['Element(formula)', 'Mixture(formula)'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], orientation="horizontal", addSpace=False) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self, parent=None, signalManager=None): widget.OWWidget.__init__(self, parent, signalManager) self.__optical_source_gaussian = OpticalElement("source gaussian") self.le_x = gui.lineEdit(self.controlArea, self, "value_le_x", label="X [m]", validator=QDoubleValidator(bottom=0.0)) self.le_y = gui.lineEdit(self.controlArea, self, "value_le_y", label="Y [m]", validator=QDoubleValidator(bottom=0.0)) self.le_z = gui.lineEdit(self.controlArea, self, "value_le_z", label="Z [m]", validator=QDoubleValidator(bottom=0.0)) self.le_sigma_x = gui.lineEdit(self.controlArea, self, "value_le_sigma_x", label="sigma X [m]", validator=QDoubleValidator(bottom=0.0)) self.le_sigma_y = gui.lineEdit(self.controlArea, self, "value_le_sigma_y", label="sigma Y [m]", validator=QDoubleValidator(bottom=0.0)) self.le_sigma_x_prime = gui.lineEdit(self.controlArea, self, "value_le_sigma_x_prime", label="sigma X prime [m]", validator=QDoubleValidator(bottom=0.0)) self.le_sigma_y_prime = gui.lineEdit(self.controlArea, self, "value_le_sigma_y_prime", label="sigma Y prime [m]", validator=QDoubleValidator(bottom=0.0)) self.le_sigma_t = gui.lineEdit(self.controlArea, self, "value_le_sigma_t", label="sigma t [m]", validator=QDoubleValidator(bottom=0.0)) self.le_xp = gui.lineEdit(self.controlArea, self, "value_le_xp", label="Xp [m]", validator=QDoubleValidator(bottom=0.0)) self.le_yp = gui.lineEdit(self.controlArea, self, "value_le_yp", label="Yp [m]", validator=QDoubleValidator(bottom=0.0)) self.le_average_photon_energy = gui.lineEdit(self.controlArea, self, "value_le_average_photon_energy", label="Average photon energy [eV]", validator=QDoubleValidator(bottom=0.0)) self.le_pulse_energy = gui.lineEdit(self.controlArea, self, "value_le_pulse_energy", label="Pulse energy [J]", validator=QDoubleValidator(bottom=0.0)) self.le_repetition_rate = gui.lineEdit(self.controlArea, self, "value_le_repetition_rate", label="Repetition rate", validator=QIntValidator(bottom=0)) self.polarizations=Polarization.all() self.cb_polarization = gui.comboBox(self.controlArea, self, "value_cb_polarization", label="Polarization", items=[p.description() for p in self.polarizations]) # TODO: refactor beamline component passing. self.__driver_settings_widget = DriverSettingsWidget(self.__optical_source_gaussian, self, "value_le_driver_settings", SourceGaussian(0.0,0.0,0.0,0.0,0.0)) self.btn_display = gui.button(self, self, "Fire", self.onFire) self.__optical_source_gaussian.setOnSynchronize(self.synchronizeToOpticalElement) self.__optical_source_gaussian.setOnCalculationStart(self.calculationStart) self.__optical_source_gaussian.setOnCalculationFinished(self.calculationFinished)
def build_gui(self): box = oasysgui.widgetBox(self.controlArea, self.name + " Input Parameters", orientation="vertical", width=self.CONTROL_AREA_WIDTH-5) idx = -1 #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "MAT_FLAG", label=self.unitLabels()[idx], addSpace=False, items=['Element(formula)', 'Mixture(formula)'], valueType=int, orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "DESCRIPTOR", label=self.unitLabels()[idx], orientation="horizontal", addSpace=False) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDSTART", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDEND", label=self.unitLabels()[idx], addSpace=False, valueType=float, validator=QDoubleValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) oasysgui.lineEdit(box1, self, "GRIDN", label=self.unitLabels()[idx], addSpace=False, valueType=int, validator=QIntValidator(), orientation="horizontal", labelWidth=250) self.show_at(self.unitFlags()[idx], box1) # widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.comboBox(box1, self, "DUMP_TO_FILE", label=self.unitLabels()[idx], addSpace=True, items=["No", "Yes"], orientation="horizontal") self.show_at(self.unitFlags()[idx], box1) # widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "FILE_NAME", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self, show_general_option_box=True, show_automatic_box=True, show_view_box=True): super().__init__(show_general_option_box=show_general_option_box, show_automatic_box=show_automatic_box) self.main_tabs = oasysgui.tabWidget(self.mainArea) plot_tab = oasysgui.createTabPage(self.main_tabs, "Plots") out_tab = oasysgui.createTabPage(self.main_tabs, "Output") plot_tabs = oasysgui.tabWidget(plot_tab) plotting_tab = oasysgui.createTabPage(plot_tabs, "Output") self.view_box = oasysgui.widgetBox(plotting_tab, "", addSpace=False, orientation="horizontal") if show_view_box: view_box_1 = oasysgui.widgetBox(self.view_box, "", addSpace=False, orientation="vertical", width=350) self.view_type_combo = gui.comboBox(view_box_1, self, "view_type", label="Plot Results", labelWidth=120, items=["No", "Yes (Total Polarization)", "Yes (Polarization Components)"], callback=self.set_PlotQuality, sendSelectedValue=False, orientation="horizontal") range_tab = oasysgui.createTabPage(plot_tabs, "Plot Setting") range_box_1 = oasysgui.widgetBox(range_tab, "", addSpace=False, orientation="vertical", width=450) range_box_2 = oasysgui.widgetBox(range_box_1, "", addSpace=False, orientation="horizontal", width=450) self.range_combo = gui.comboBox(range_box_2, self, "use_range", label="Plotting Range", labelWidth=120, items=["No", "Yes"], callback=self.set_PlottingRange, sendSelectedValue=False, orientation="horizontal") self.refresh_button = gui.button(range_box_2, self, "Refresh", callback=self.replot) self.plot_range_box_1 = oasysgui.widgetBox(range_box_1, "", addSpace=False, orientation="vertical", width=450, height=50) self.plot_range_box_2 = oasysgui.widgetBox(range_box_1, "", addSpace=False, orientation="vertical", width=450, height=50) range_box_2 = oasysgui.widgetBox(self.plot_range_box_1, "", addSpace=False, orientation="horizontal", width=450) oasysgui.lineEdit(range_box_2, self, "range_x_min", "Plotting Range X min [\u03bcm]", labelWidth=170, valueType=float, orientation="horizontal") oasysgui.lineEdit(range_box_2, self, "range_x_max", "max [\u03bcm]", labelWidth=80, valueType=float, orientation="horizontal") range_box_3 = oasysgui.widgetBox(self.plot_range_box_1, "", addSpace=False, orientation="horizontal", width=450) oasysgui.lineEdit(range_box_3, self, "range_y_min", "Plotting Range Y min [\u03bcm]", labelWidth=170, valueType=float, orientation="horizontal") oasysgui.lineEdit(range_box_3, self, "range_y_max", "max [\u03bcm]", labelWidth=80, valueType=float, orientation="horizontal") self.set_PlottingRange() else: self.view_type = 1 self.view_type_combo = QtWidgets.QWidget() self.show_view_box = show_view_box #* ------------------------------------------------------------------------------------------------------------- propagation_box = oasysgui.widgetBox(self.view_box, "", addSpace=False, orientation="vertical") self.le_srw_live_propagation_mode = gui.lineEdit(propagation_box, self, "srw_live_propagation_mode", "Propagation Mode", labelWidth=150, valueType=str, orientation="horizontal") self.le_srw_live_propagation_mode.setAlignment(Qt.AlignCenter) self.le_srw_live_propagation_mode.setReadOnly(True) font = QFont(self.le_srw_live_propagation_mode.font()) font.setBold(True) self.le_srw_live_propagation_mode.setFont(font) self.set_srw_live_propagation_mode() #* ------------------------------------------------------------------------------------------------------------- self.tab = [] self.tabs = oasysgui.tabWidget(plot_tab) self.initializeTabs() self.srw_output = oasysgui.textArea(580, 800) out_box = gui.widgetBox(out_tab, "System Output", addSpace=True, orientation="horizontal") out_box.layout().addWidget(self.srw_output) self.set_PlotQuality()
def __init__(self): super().__init__() box0 = gui.widgetBox(self.controlArea, " ",orientation="horizontal") #widget buttons: compute, set defaults, help gui.button(box0, self, "Compute", callback=self.compute) gui.button(box0, self, "Defaults", callback=self.defaults) gui.button(box0, self, "Help", callback=self.help1) self.process_showers() box = gui.widgetBox(self.controlArea, " ",orientation="vertical") idx = -1 #widget index 0 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "TITLE", label=self.unitLabels()[idx], addSpace=True) self.show_at(self.unitFlags()[idx], box1) #widget index 1 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 2 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "CUR", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 3 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 4 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 5 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGX1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 6 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "SIGY1", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 7 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ITYPE", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 8 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PERIOD", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 9 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "N", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 10 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "KX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 11 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "KY", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 12 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "PHASE", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 13 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMIN", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 14 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "EMAX", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 15 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NENERGY", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 16 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "D", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 17 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "XPC", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 18 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "YPC", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 19 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "XPS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 20 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "YPS", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 21 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NXP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 22 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NYP", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 23 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "MODE", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 24 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "ICALC", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 25 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "IHARM", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 26 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NPHI", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 27 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NSIG", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 28 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NALPHA", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 29 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DALPHA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 30 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "NOMEGA", label=self.unitLabels()[idx], addSpace=True, valueType=int, validator=QIntValidator()) self.show_at(self.unitFlags()[idx], box1) #widget index 31 idx += 1 box1 = gui.widgetBox(box) gui.lineEdit(box1, self, "DOMEGA", label=self.unitLabels()[idx], addSpace=True, valueType=float, validator=QDoubleValidator()) self.show_at(self.unitFlags()[idx], box1) gui.rubber(self.controlArea)
def __init__(self): super().__init__() left_box_1 = oasysgui.widgetBox(self.controlArea, "TER_SL Request Form", addSpace=False, orientation="vertical", width=500, height=680) self.central_tabs = oasysgui.tabWidget(left_box_1) tab_template = oasysgui.createTabPage(self.central_tabs, "Template Options") tab_input = oasysgui.createTabPage(self.central_tabs, "Input Options") left_box_1_1 = oasysgui.widgetBox(tab_template, "", addSpace=False, orientation="vertical", width=480, height=670) gui.separator(left_box_1_1) ter_sl_box = oasysgui.widgetBox(left_box_1_1, "", addSpace=False, orientation="horizontal", width=470, height=220) gui.radioButtons( ter_sl_box, self, "ter_sl_form", [ "Specular reflection from perfect reflectors", "Specular reflection from multilayers", "Specular reflection from perfect reflectors + standing waves", "Specular reflection from multilayers + standing waves" ], callback=self.set_TerSLForm) # ------------------------------------------------------------- # ------------------------------------------------------------- # ------------------------------------------------------------- gui.separator(tab_input) left_box_2 = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="vertical", width=470) left_box_2_1 = oasysgui.widgetBox(left_box_2, "", addSpace=False, orientation="horizontal", width=470) gui.comboBox(left_box_2_1, self, "xway", label="X-rays specified by", items=[ "Wavelength (Å)", "Energy (keV)", "Bragg angle (deg)", "X-ray line" ], callback=self.set_xway, sendSelectedValue=False, orientation="horizontal") self.box_wave = oasysgui.widgetBox(left_box_2_1, "", addSpace=False, orientation="horizontal", width=100) gui.lineEdit(self.box_wave, self, "wave", label="", labelWidth=0, addSpace=False, valueType=float, orientation="horizontal") self.box_line = oasysgui.widgetBox(left_box_2_1, "", addSpace=False, orientation="horizontal", width=100) XRayServerGui.combobox_text(self.box_line, self, "line", label="", labelWidth=0, items=self.get_lines(), sendSelectedValue=True, orientation="horizontal", selectedValue=self.line) button = gui.button(self.box_line, self, "?", callback=self.help_lines) button.setFixedWidth(15) self.set_xway() gui.comboBox(left_box_2_1, self, "ipol", label="Polarization", items=["Sigma", "Pi", "Mixed"], sendSelectedValue=False, orientation="horizontal") # ------------------------------------------------------------- left_box_3 = oasysgui.widgetBox(tab_input, "", addSpace=True, orientation="vertical", width=470) gui.separator(left_box_3, height=4) left_box_3_top = oasysgui.widgetBox(left_box_3, "", addSpace=False, orientation="horizontal", width=470) gui.label(left_box_3_top, self, "Substrate:") left_box_3_content = oasysgui.widgetBox(left_box_3, "", addSpace=False, orientation="horizontal", width=470) left_box_3_left = oasysgui.widgetBox(left_box_3_content, "", addSpace=False, orientation="vertical", width=20) left_box_3_right = oasysgui.widgetBox(left_box_3_content, "", addSpace=False, orientation="vertical", width=445) gui.radioButtons(left_box_3_left, self, "subway", [" ", " ", " "], callback=self.set_subway) self.left_box_3_1 = oasysgui.widgetBox(left_box_3_right, "", addSpace=False, orientation="horizontal", width=445) XRayServerGui.combobox_text(self.left_box_3_1, self, "code", label="Crystal", labelWidth=45, items=self.get_crystals(), sendSelectedValue=True, orientation="horizontal", selectedValue=self.code) button = gui.button(self.left_box_3_1, self, "?", callback=self.help_crystals) button.setFixedWidth(15) gui.comboBox(self.left_box_3_1, self, "df1df2", label=" ", labelWidth=1, items=[ "Auto DB for f\', f\'\'", "X0h data (0.5-2.5 A)", "Henke (0.4-1200 A)", "Brennan (0.02-400 A)" ], sendSelectedValue=False, orientation="horizontal") self.left_box_3_2 = oasysgui.widgetBox(left_box_3_right, "", addSpace=False, orientation="horizontal", width=445) gui.lineEdit(self.left_box_3_2, self, "chem", label="Chemical Formula", labelWidth=110, addSpace=False, valueType=str, orientation="horizontal", callback=self.set_rho) gui.lineEdit(self.left_box_3_2, self, "rho", label=u"\u03C1" + " (g/cm3)", labelWidth=60, addSpace=False, valueType=float, orientation="horizontal") self.left_box_3_3 = oasysgui.widgetBox(left_box_3_right, "", addSpace=False, orientation="vertical", width=445) left_box_3_3_1 = oasysgui.widgetBox(self.left_box_3_3, "", addSpace=False, orientation="horizontal", width=445) gui.lineEdit(left_box_3_3_1, self, "x0", label="Susceptibility x0 (", labelWidth=130, addSpace=False, valueType=float, orientation="horizontal") gui.label(left_box_3_3_1, self, " ) format: x0=(Re(x0), Im(x0))", labelWidth=230) left_box_3_3_2 = oasysgui.widgetBox(self.left_box_3_3, "", addSpace=False, orientation="horizontal", width=445) gui.lineEdit(left_box_3_3_2, self, "w0", label="x0 correction: w0", labelWidth=130, addSpace=False, valueType=float, orientation="horizontal") gui.label(left_box_3_3_2, self, " this is used as: x0 = w0 * x0", labelWidth=230) left_box_3_3_3 = oasysgui.widgetBox(self.left_box_3_3, "", addSpace=False, orientation="horizontal", width=445) gui.lineEdit(left_box_3_3_3, self, "sigma", label="Roughness: sigma [Å]", labelWidth=130, addSpace=False, valueType=float, orientation="horizontal") gui.label(left_box_3_3_3, self, " OR ") gui.lineEdit(left_box_3_3_3, self, "tr", label="Transition layer tr [Å]", labelWidth=120, addSpace=False, valueType=float, orientation="horizontal") self.set_subway() # ------------------------------------------------------------- left_box_4 = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="horizontal", width=470) left_box_4_1 = oasysgui.widgetBox(left_box_4, "", addSpace=False, orientation="vertical", width=470) gui.label(left_box_4_1, self, "Incidence angle limits:") left_box_4_1_1 = oasysgui.widgetBox(left_box_4_1, "", addSpace=False, orientation="horizontal", width=470) gui.lineEdit(left_box_4_1_1, self, "scanmin", label=" From", labelWidth=70, addSpace=False, valueType=float, orientation="horizontal") gui.lineEdit(left_box_4_1_1, self, "scanmax", label="To", labelWidth=15, addSpace=False, valueType=float, orientation="horizontal") gui.comboBox(left_box_4_1_1, self, "unis", label=" ", labelWidth=1, items=["degr.", "min.", "mrad.", "sec.", "urad"], sendSelectedValue=False, orientation="horizontal") gui.lineEdit(left_box_4_1_1, self, "nscan", label="Points", labelWidth=40, addSpace=False, valueType=int, orientation="horizontal") # ------------------------------------------------------------- # ------------------------------------------------------------- self.standing_waves_box = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="vertical", width=470, height=140) self.standing_waves_box_hidden = oasysgui.widgetBox( tab_input, "", addSpace=False, orientation="horizontal", width=470, height=140) gui.separator(self.standing_waves_box, 10) standing_waves_box_1 = oasysgui.widgetBox(self.standing_waves_box, "", addSpace=False, orientation="horizontal", width=120) gui.checkBox(standing_waves_box_1, self, "swflag", "", callback=self.set_swflag) gui.label(standing_waves_box_1, self, "Standing waves:") self.standing_waves_box_2 = oasysgui.widgetBox(self.standing_waves_box, "", addSpace=False, orientation="vertical", width=470) standing_waves_box_2_1 = oasysgui.widgetBox(self.standing_waves_box_2, "", addSpace=False, orientation="horizontal", width=270) gui.lineEdit(standing_waves_box_2_1, self, "swref", label="Reference interface", labelWidth=130, addSpace=False, valueType=int, orientation="horizontal") gui.label(standing_waves_box_2_1, self, " (0=surface)") standing_waves_box_2_2 = oasysgui.widgetBox(self.standing_waves_box_2, "", addSpace=False, orientation="horizontal", width=270) gui.lineEdit(standing_waves_box_2_2, self, "swmin", label="Start offset", labelWidth=130, addSpace=False, valueType=float, orientation="horizontal") gui.label(standing_waves_box_2_2, self, " [Å]", labelWidth=70) standing_waves_box_2_3 = oasysgui.widgetBox(self.standing_waves_box_2, "", addSpace=False, orientation="horizontal", width=270) gui.lineEdit(standing_waves_box_2_3, self, "swmax", label="End offset", labelWidth=130, addSpace=False, valueType=float, orientation="horizontal") gui.label(standing_waves_box_2_3, self, " [Å]", labelWidth=70) standing_waves_box_2_4 = oasysgui.widgetBox(self.standing_waves_box_2, "", addSpace=False, orientation="horizontal", width=270) gui.lineEdit(standing_waves_box_2_4, self, "swpts", label="Number of offsets", labelWidth=130, addSpace=False, valueType=float, orientation="horizontal") gui.label(standing_waves_box_2_4, self, " (max = 401)") self.set_swflag() gui.separator(tab_input) # ------------------------------------------------------------- box_top = oasysgui.widgetBox(tab_input, "", addSpace=False, orientation="vertical", width=470) box_top_0 = oasysgui.widgetBox(box_top, "", addSpace=False, orientation="horizontal", width=250) gui.label(box_top_0, self, "Top layer profile (optional):") button = gui.button(box_top_0, self, "? (sintax)", callback=self.help_profile) button.setFixedWidth(90) box_top_1 = oasysgui.widgetBox(box_top, "", addSpace=False, orientation="horizontal", width=470) self.profile_area = QtWidgets.QTextEdit() self.profile_area.setMaximumHeight(240) self.profile_area.setMaximumWidth(335) self.profile_area.setLineWrapMode(QtWidgets.QTextEdit.NoWrap) box_top_1.layout().addWidget(self.profile_area) gui.separator(box_top_1) box_top_labels = oasysgui.widgetBox(box_top_1, "", addSpace=False, orientation="vertical", width=130) gui.label(box_top_labels, self, "Available Codes:") crystals_area = QtWidgets.QTextEdit() crystals_area.setMaximumHeight(295) crystals_area.setMaximumWidth(130) crystals_area.setText("\n".join(ListUtility.get_list("crystals"))) crystals_area.setReadOnly(True) box_top_labels.layout().addWidget(crystals_area) gui.separator(box_top) # ----------------------------------------------------------- button = gui.button(tab_input, self, "Submit Query!", callback=self.submit) button.setFixedHeight(30) gui.rubber(self.controlArea) self.tabs = [] self.tabs_widget = oasysgui.tabWidget(self.mainArea) self.initializeTabs() self.set_TerSLForm(change_values=False, switch_page=False) self.profile_area.textChanged.connect(self.set_profile)