Ejemplo n.º 1
0
    def addMechanism(self, name, mech):
        self.mechanisms.append((name, mech))
        il = len(self.mechanisms)
        self.mlist[-1] = (name, self.setMechanism, 'check', self.mechindx, il)
        self.mlist.append([])

        self.mechmenu = make_menu('Mixtures', self, self.mlist)
        self.mechindx.set(il)
        self.mechmenu.grid(row=0, column=0, sticky=W)
Ejemplo n.º 2
0
    def addMechanism(self, name, mech):
        self.mechanisms.append((name, mech))
        il = len(self.mechanisms)
        self.mlist[-1] = (name, self.setMechanism, 'check', self.mechindx, il)
        self.mlist.append([])

        self.mechmenu = make_menu('Mixtures', self, self.mlist)
        self.mechindx.set(il)
        self.mechmenu.grid(row=0,column=0,sticky=W)
Ejemplo n.º 3
0
 def makeMenu(self):
     self.menubar = Frame(self, relief=GROOVE, bd=2)
     self.menubar.grid(row=0, column=0, sticky=N + W + E, columnspan=10)
     f = [('Open...', self.browseForDatafile)]
     #make_menu('File',self.menubar,items)
     make_menu('File', self.menubar, f)
     make_menu('Dataset', self.menubar, self.datasets)
     make_menu('Plot', self.menubar, self.vars)
Ejemplo n.º 4
0
 def makeMenu(self):
     self.menubar = Frame(self, relief=GROOVE,bd=2)
     self.menubar.grid(row=0,column=0,sticky=N+W+E,columnspan=10)
     f = [('Open...',self.browseForDatafile)]
     #make_menu('File',self.menubar,items)
     make_menu('File',self.menubar,f)
     make_menu('Dataset',self.menubar,self.datasets)
     make_menu('Plot',self.menubar,self.vars)
Ejemplo n.º 5
0
    def __init__(self, master, app):
        Frame.__init__(self, master)
        #self.config(relief=GROOVE, bd=4)
        self.app = app
        self.master = master
        self.mechindx = IntVar()
        self.mechindx.set(1)

        #m = Label(self, text = 'Loaded Mechanisms')
        #m.grid(column=0,row=0)
        #         m.bind('<Double-1>',self.show)
        #         self.mechindx.set(0)
        self.mechanisms = []
        self.mlist = [[]]
        i = 1
        #for m in self.mechanisms:
        #    self.mlist.append((m[0], self.setMechanism, 'check', self.mechindx, i))
        #    i = i + 1
        #self.mlist.append([])

        self.mechmenu = make_menu('Mixtures', self, self.mlist)
        self.mechmenu.grid(row=0, column=0, sticky=W)

        self.mfr = None
Ejemplo n.º 6
0
    def __init__(self,master,app):
        Frame.__init__(self,master)
        #self.config(relief=GROOVE, bd=4)
        self.app = app
        self.master = master
        self.mechindx = IntVar()
        self.mechindx.set(1)

        #m = Label(self, text = 'Loaded Mechanisms')
        #m.grid(column=0,row=0)
#         m.bind('<Double-1>',self.show)
#         self.mechindx.set(0)
        self.mechanisms = []
        self.mlist = [ [] ]
        i = 1
        #for m in self.mechanisms:
        #    self.mlist.append((m[0], self.setMechanism, 'check', self.mechindx, i))
        #    i = i + 1
        #self.mlist.append([])

        self.mechmenu = make_menu('Mixtures', self, self.mlist)
        self.mechmenu.grid(row=0,column=0,sticky=W)

        self.mfr = None
Ejemplo n.º 7
0
    def __init__(self, master=None):
        """
        Create a new Application instance.
        Usually this is only called once.
        """
        if master:
            self.master = master
        else:
            t = Tk()
            self.master = t

        self._windows = {}
        self._vis = {}
        self.windows = []

        self.cwin = ControlWindow(_app_title,self.master)
        self.cwin.master.resizable(FALSE,FALSE)

        self.menubar = Frame(self.cwin, relief=GROOVE,bd=2)
        self.menubar.grid(row=0,column=0,sticky=N+W+E)

        self.mixfr = None
        self.thermo = None
        self.transport = None
        self.kinetics = None
        self.rxndata = None
        self.rxnpaths = None
        self.edit = None
        self.fname = None

        self.mechframe = MechManager(self.cwin, self)
        self.mechframe.grid(row=1,column=0,sticky=N+W)

        fileitems = [('Load Mixture...', self.openmech),
                     ('Import Mechanism File...',self.importfile),
                     'separator',
                     ('Load Data File...',self.showdata),
                     'separator',
                     ('Exit', self.stop),
                     []
                     ]
        self.filemenu = make_menu('File', self.menubar, fileitems)


        self.vtherm = IntVar()
        self.vcomp = IntVar()
        self.vtran = IntVar()
        self.vkin = IntVar()
        self.vrxn = IntVar()
        self.vrxn.set(0)
        self.vtherm.set(1)
        self.vedit = IntVar()


        dataitems = [(' Import Flame Data', testit),
                     (' Import CSV Data', testit),
                     []]
        #self.datamenu = make_menu('Data', self.menubar, dataitems)


        #toolitems = [(' Convert...', self.importfile),
        #             []]
        #self.toolmenu = make_menu('Tools', self.menubar, toolitems)


        w = [(' Thermodynamic State', self.showthermo, 'check', self.vtherm),
             (' Composition', self.showcomp, 'check', self.vcomp),
             'separator',
             (' Kinetics', self.showkinetics, 'check', self.vkin),
             (' Reactions...', self.showrxns),
             (' Reaction Paths...', self.showrpaths),
             []]

        self.viewmenu = make_menu('Windows', self.menubar, w)

        self.helpmenu = make_menu('Help', self.menubar,
                                  [('About '+_app_title+'...', self.aboutmix),
                                   ('About Cantera...', testit),
                                   []

                                   ])

        # load the preloaded mechanisms
        for m in _autoload:
            self.loadmech(m[0],m[1],0)

        self.makeWindows()
        self.addWindow('import',ImportFrame(self))

        self.vtherm.set(1)
        self.showthermo()
##         self.vcomp.set(1)
##         self.showcomp()

        self.master.iconify()
        self.master.update()
        self.master.deiconify()
        self.cwin.mainloop()