def __init__(self): import os ui_file = pya.QFile( os.path.join(os.path.dirname(os.path.realpath(__file__)), "files", "waveguide_gui.ui")) ui_file.open(pya.QIODevice().ReadOnly) self.window = pya.QFormBuilder().load( ui_file, pya.Application.instance().main_window()) ui_file.close # *** lukasc comment: # waveguide types shouldn't be hardcoded, but rather read from WAVEGUIDES.xml. # I'm don't see the advantage of the waveguide_gui.ui approach, rather than coding the GUI generation within # Python like I did for the FDTD settings GUI in file: # Keybindings: GUI_FDTD_component_simulation #Button Bindings self.window.findChild('ok').clicked(self.ok) self.window.findChild('cancel').clicked(self.close) self.window.findChild('adiabatic').toggled(self.enable) self.window.findChild('bezier').setEnabled(False) self.window.findChild("configuration").currentIndexChanged( self.config_changed) self.loaded_technology = '' self.clicked = True
def test_gui_spoofs(): lygadgets.patch_environment() import pya # Borrowed from SiEPIC-Tools: https://github.com/lukasc-ubc/SiEPIC-Tools wdg = pya.QDialog(pya.Application.instance().main_window()) wdg.setAttribute(pya.Qt.WA_DeleteOnClose) ui_file = pya.QFile(os.path.join(os.path.dirname(os.path.realpath(__file__)), "waveguidebuilder.ui")) ui_file.open(pya.QIODevice().ReadOnly) window = pya.QFormBuilder().load(ui_file, pya.Application.instance().main_window()) ui_file.close
def __init__(self): import os ui_file = pya.QFile(os.path.join(os.path.dirname( os.path.realpath(__file__)), "files", "monte_carlo_gui.ui")) ui_file.open(pya.QIODevice().ReadOnly) self.window = pya.QFormBuilder().load(ui_file, pya.Application.instance().main_window()) ui_file.close self.window.findChild('run').clicked(self.ok) self.window.findChild('cancel').clicked(self.close) self.window.findChild("technology").currentIndexChanged(self.tech_changed) self.window.findChild('num_wafers').minimum = 1 self.window.findChild('num_dies').minimum = 1 self.loaded_technology = '' self.clicked = True
def __init__(self): import os ui_file = pya.QFile(os.path.join(os.path.dirname( os.path.realpath(__file__)), "files", "waveguide_gui.ui")) ui_file.open(pya.QIODevice().ReadOnly) self.window = pya.QFormBuilder().load(ui_file, pya.Application.instance().main_window()) ui_file.close # Button Bindings self.window.findChild('ok').clicked(self.ok) self.window.findChild('cancel').clicked(self.close) self.window.findChild('adiabatic').toggled(self.enable) self.window.findChild('bezier').setEnabled(False) self.window.findChild("configuration").currentIndexChanged(self.config_changed) self.loaded_technology = '' self.clicked = True