def __init__(self, parent, layout='sort'): self.cwd = os.getcwd() self.p = Parameters(interface='GUI') self.master = parent self.initialize() self.GUI = AutoSimVizGUI() if layout == 'sort': # widgets sorted in columns: self.GUI.make_prmGUI(self.master, self.p, sort_widgets=True, height=300, pane=True) else: # only one column of input parameters: self.GUI.make_prmGUI(self.master, self.p, sort_widgets=False, height=300, pane=False) help = """\ Simulate: run oscillator code for solving the differential equation for the spring system. Visualize: run Gnuplot to make plots in PNG and PostScript format and on the screen (optional). Plots are stored in the subdirectory with name equal to 'case'. """ self.GUI.make_buttonGUI(self.master, buttons=[('Simulate', self.simulate), ('Visualize', self.visualize)], logo=os.path.join(os.environ['scripting'], 'src','misc','figs','simviz2.xfig.t.gif'), help=None)
def __init__(self, parent, layout='sort'): self.cwd = os.getcwd() self.p = Parameters(interface='GUI') self.master = parent self.initialize() self.GUI = AutoSimVizGUI() if layout == 'sort': # widgets sorted in columns: self.GUI.make_prmGUI(self.master, self.p, sort_widgets=1, height=300, pane=1) else: # only one column of input parameters: self.GUI.make_prmGUI(self.master, self.p, sort_widgets=0, height=300, pane=0) help = """\ Simulate: run oscillator code for solving the differential equation for the spring system. Visualize: run Gnuplot to make plots in PNG and PostScript format and on the screen (optional). Plots are stored in the subdirectory with name equal to 'case'. """ self.GUI.make_buttonGUI(self.master, buttons=[('Simulate', self.simulate), ('Visualize', self.visualize)], logo=os.path.join(os.environ['scripting'], 'src', 'misc', 'figs', 'simviz2.xfig.t.gif'), help=None)
class SimVizGUI(SimViz): def __init__(self, parent, layout='sort'): self.cwd = os.getcwd() self.p = Parameters(interface='GUI') self.master = parent self.initialize() self.GUI = AutoSimVizGUI() if layout == 'sort': # widgets sorted in columns: self.GUI.make_prmGUI(self.master, self.p, sort_widgets=1, height=300, pane=1) else: # only one column of input parameters: self.GUI.make_prmGUI(self.master, self.p, sort_widgets=0, height=300, pane=0) help = """\ Simulate: run oscillator code for solving the differential equation for the spring system. Visualize: run Gnuplot to make plots in PNG and PostScript format and on the screen (optional). Plots are stored in the subdirectory with name equal to 'case'. """ self.GUI.make_buttonGUI(self.master, buttons=[('Simulate', self.simulate), ('Visualize', self.visualize)], logo=os.path.join(os.environ['scripting'], 'src','misc','figs','simviz2.xfig.t.gif'), help=None) # help=help) self.plot1 = self.GUI.make_curveplotGUI(self.master, no_of_plotframes=1, placement='bottom') def visualize(self): x, y = self.GUI.load_curveplot('sim.dat', self.plot1, curvename='response')
def GUI(parameters, root): gui = AutoSimVizGUI() gui.make_prmGUI(root, parameters, height=300) Button(root, text='Quit', command=root.destroy).pack() root.mainloop() return parameters