def init(self, index): QTabWidget.__init__(self) self.index = index lines = [] self.file_name = os.path.join(get_sim_path(), "is" + str(self.index) + ".inp") lines = inp_load_file(self.file_name) if lines != False: self.tab_name = inp_search_token_value(lines, "#sim_menu_name") else: self.tab_name = "" self.tmesh = tab_fxmesh(self.index) self.addTab(self.tmesh, _("Frequency mesh")) #if inp().isfile("diagram.inp")==False: self.circuit = circuit(self.index, base_file_name="is_fxdomain_data", token="#fxdomain_sim_mode") self.addTab(self.circuit, _("Circuit")) widget = tab_class(self.file_name) self.addTab(widget, _("Simulation")) self.fx_domain_file_name = os.path.join( get_sim_path(), "is_fxdomain_data" + str(self.index) + ".inp") widget = tab_class(self.fx_domain_file_name) self.addTab(widget, _("FX domain simulation"))
def init(self,index): self.tab_label=None self.index=index lines=[] if inp_load_file(lines,"fxdomain"+str(self.index)+".inp")==True: self.tab_name=inp_search_token_value(lines, "#sim_menu_name") else: self.tab_name="" self.title_hbox=gtk.HBox() self.title_hbox.set_size_request(-1, 25) self.label=gtk.Label(self.tab_name.split("@")[0]) self.label.set_justify(gtk.JUSTIFY_LEFT) self.title_hbox.pack_start(self.label, False, True, 0) self.close_button = gtk.Button() close_image = gtk.Image() close_image.set_from_file(os.path.join(get_image_file_path(),"close.png")) close_image.show() self.close_button.add(close_image) self.close_button.props.relief = gtk.RELIEF_NONE self.close_button.set_size_request(25, 25) self.close_button.show() self.title_hbox.pack_end(self.close_button, False, False, 0) self.title_hbox.show_all() self.notebook=gtk.Notebook() self.notebook.show() self.fxmesh = tab_fxmesh() self.fxmesh.init(self.index) self.notebook.append_page(self.fxmesh, gtk.Label(_("Frequency mesh"))) self.pack_start(self.notebook, False, False, 0) self.circuit=circuit() self.circuit.init(self.index) self.notebook.append_page(self.circuit, gtk.Label(_("Circuit"))) self.show()
def init(self,index): QTabWidget.__init__(self) self.index=index lines=[] if inp_load_file(lines,"fxdomain"+str(self.index)+".inp")==True: self.tab_name=inp_search_token_value(lines, "#sim_menu_name") else: self.tab_name="" self.setTabsClosable(True) self.setMovable(True) self.tmesh = tab_fxmesh(self.index) self.addTab(self.tmesh,_("Frequency mesh")) self.circuit=circuit(self.index) self.addTab(self.circuit,_("Circuit"))
def init(self, index): QTabWidget.__init__(self) self.index = index lines = [] self.file_name = os.path.join(get_sim_path(), "fxdomain" + str(self.index) + ".inp") lines = inp_load_file(self.file_name) if lines != False: self.tab_name = inp_search_token_value(lines, "#sim_menu_name") else: self.tab_name = "" self.tmesh = tab_fxmesh(self.index) self.addTab(self.tmesh, _("Frequency mesh")) self.circuit = circuit(self.index) self.addTab(self.circuit, _("Circuit")) widget = tab_class() widget.init(self.file_name, _("Configure")) self.addTab(widget, _("Configure"))