예제 #1
0
    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)