def callback_gen_plot_command(self): dialog = gpvdm_open(self.sim_dir, act_as_browser=False) ret = dialog.exec_() if ret == QDialog.Accepted: full_file_name = dialog.get_filename() #dialog.destroy() #print cur_dir=os.getcwd() #print full_file_name file_name = os.path.basename(full_file_name) plot_data = dat_file() plot_data.path = self.sim_dir plot_data.example_file0 = full_file_name plot_data.example_file1 = full_file_name plot_now = False if check_info_file(file_name) == True: plot_data.file0 = file_name plot_xy_window = plot_dlg_class(plot_data) plot_xy_window.run() plot_now = plot_xy_window.ret else: plot_data.file0 = file_name plot_data.tag0 = "" plot_data.file1 = "" plot_data.tag1 = "" plot_now = True if plot_now == True: self.plot_results(plot_data)
def callback_gen_plot_command(self): dialog=gpvdm_open(self.sim_dir) ret=dialog.window.exec_() if ret==QDialog.Accepted: full_file_name=dialog.get_filename() #dialog.destroy() #print cur_dir=os.getcwd() #print full_file_name file_name=os.path.basename(full_file_name) plot_data=plot_state() plot_data.path=self.sim_dir plot_data.example_file0=full_file_name plot_data.example_file1=full_file_name plot_now=False if check_info_file(file_name)==True: plot_data.file0=file_name plot_xy_window=plot_dlg_class(plot_data) plot_xy_window.run() plot_now=plot_xy_window.ret else: plot_data.file0=file_name plot_data.tag0="" plot_data.file1="" plot_data.tag1="" plot_now=True if plot_now==True: self.plot_results(plot_data)
def callback_gen_plot_command(self, widget, data=None): #dialog = gtk.FileChooserDialog("File to plot", # None, # gtk.FILE_CHOOSER_ACTION_OPEN, # (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, # gtk.STOCK_OPEN, gtk.RESPONSE_OK)) #dialog.set_default_response(gtk.RESPONSE_OK) #dialog.set_current_folder(self.sim_dir) #filter = gtk.FileFilter() #filter.set_name("Data files") #filter.add_pattern("*.dat") #dialog.add_filter(filter) #filter = gtk.FileFilter() #filter.set_name("Input files") #filter.add_pattern("*.inp") #dialog.add_filter(filter) #dialog.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) #response = dialog.run() dialog=opvdm_open() dialog.init(self.sim_dir) response=dialog.run() if response == True: full_file_name=dialog.get_filename() dialog.destroy() #print cur_dir=os.getcwd() #print full_file_name file_name=os.path.basename(full_file_name) plot_data=plot_state() plot_data.path=self.sim_dir plot_data.example_file0=full_file_name plot_data.example_file1=full_file_name plot_now=False if check_info_file(file_name)==True: plot_data.file0=file_name plot_xy_window=plot_dlg_class(gtk.WINDOW_TOPLEVEL) plot_xy_window.my_init(plot_data) plot_now=plot_xy_window.my_run(plot_data) else: plot_data.file0=file_name plot_data.tag0="" plot_data.file1="" plot_data.tag1="" plot_now=True if plot_now==True: self.plot_results(plot_data) self.plotted_graphs.refresh() else: print _("Closed, no files selected") dialog.destroy()
def callback_reopen_xy_window(self, widget, data=None): if len(self.plotted_graphs) > 0: pos = len(self.plotted_graphs) - 1 plot_data = dat_file() plot_data.file0 = self.plotted_graphs[pos].file0 plot_xy_window = plot_dlg_class(plot_data) plot_xy_window.run() plot_now = plot_xy_window.ret if plot_now == True: self.plot_results(plot_data) self.plotted_graphs.refresh()
def callback_reopen_xy_window(self, widget, data=None): if len(self.plotted_graphs)>0: pos=len(self.plotted_graphs)-1 plot_data=plot_state() plot_data.file0=self.plotted_graphs[pos].file0 plot_xy_window=plot_dlg_class(plot_data) plot_xy_window.run() plot_now=plot_xy_window.ret if plot_now==True: self.plot_results(plot_data) self.plotted_graphs.refresh()