Ejemplo n.º 1
0
    def __init__(self, parent):
        self.myParent = parent

        self.dSpb = {}
        self.cbxVar = {}
        self.varCb = {}
        self.dScl = {}
        self.dCspb = {}
        self.fixedvar = ''
        # Read info about names and equations
        self.cnstnm, self.Cdescript, self.dCnst, self.Cunits = sc.NameParsing(
            'cnstnm.csv')
        self.names, self.Vdescript, self.Val, self.Vunits = sc.NameParsing(
            'varn.csv')
        self.eqns, self.inequ, self.unkns = sc.readeqns('equations.txt')

        ## Defining widgets

        # Frame holding everything
        self.mFrame = Frame(self.myParent, height=700, width=1000)
        self.myParent.title = 'Mechanical Design of Distillation Column'
        self.mFrame.grid()

        # Frame for tool bar
        self.frmTbar = Frame(self.mFrame)
        self.frmTbar.grid(row=0, column=0, sticky=E, pady='0.2c', padx='0.2c')

        # Frame for page tabs (to be implemented later)
        self.frmTabs = Frame(self.frmTbar)
        self.frmTabs.grid(row=0, column=0)
        # tb buttons
        self.btnSave = Button(
            self.frmTabs, text="Save",
            command=self.sav)  #  bind to udpent (update entry)
        self.btnSave.grid(row=0, column=0)

        # Frame for page tabs (to be implemented later)
        self.frtbpt = Frame(self.frmTbar)
        self.frtbpt.grid(row=0, column=1)
        # Page index buttons (tab).
        self.btnConstants = Button(self.frtbpt,
                                   text="Constants",
                                   command=self.dispc)
        self.btnConstants.grid(row=0, column=0)
        self.btnDisp1 = Button(self.frtbpt,
                               text="Variables",
                               command=self.disp1)
        self.btnDisp1.grid(row=0, column=1)
        self.btnDisp2 = Button(self.frtbpt, text="2", command=self.disp2)
        self.btnDisp2.grid(row=0, column=2)
        self.btnDisp3 = Button(self.frtbpt, text="3", command=self.disp3)
        self.btnDisp3.grid(row=0, column=3)
Ejemplo n.º 2
0
    def __init__(self, parent):
        self.myParent = parent

        self.dSpb = {}
        self.cbxVar = {}
        self.varCb = {}
        self.dScl = {}
        self.dCspb = {}
        self.fixedvar = ''
        # Read info about names and equations
        self.cnstnm, self.Cdescript, self.dCnst, self.Cunits = sc.NameParsing('cnstnm.csv')
        self.names, self.Vdescript, self.Val, self.Vunits = sc.NameParsing('varn.csv')        
        self.eqns, self.inequ, self.unkns = sc.readeqns('equations.txt')
        
        ## Defining widgets

        # Frame holding everything
        self.mFrame = Frame(self.myParent, height = 700, width = 1000)
        self.myParent.title = 'Mechanical Design of Distillation Column'
        self.mFrame.grid()
        
        # Frame for tool bar
        self.frmTbar = Frame(self.mFrame)
        self.frmTbar.grid(row = 0, column = 0, sticky = E, pady = '0.2c', padx= '0.2c')
        
        # Frame for page tabs (to be implemented later)
        self.frmTabs = Frame(self.frmTbar)
        self.frmTabs.grid(row = 0, column = 0)
        # tb buttons
        self.btnSave = Button(self.frmTabs, text = "Save", command = self.sav) #  bind to udpent (update entry)
        self.btnSave.grid(row = 0, column = 0)
    
        # Frame for page tabs (to be implemented later)
        self.frtbpt = Frame(self.frmTbar)
        self.frtbpt.grid(row = 0, column = 1)
        # Page index buttons (tab).
        self.btnConstants = Button(self.frtbpt, text="Constants",command = self.dispc)
        self.btnConstants.grid(row = 0, column = 0)
        self.btnDisp1 = Button(self.frtbpt, text="Variables", command = self.disp1)        
        self.btnDisp1.grid(row = 0, column = 1)
        self.btnDisp2 = Button(self.frtbpt, text="2",command = self.disp2)
        self.btnDisp2.grid(row = 0, column = 2)
        self.btnDisp3 = Button(self.frtbpt, text="3",command = self.disp3)
        self.btnDisp3.grid(row = 0, column = 3)
Ejemplo n.º 3
0
 def testRead(self):
     eqns, inequ, unkn = solverc.readeqns('eqns.txt')
     self.assertEqual(len(eqns), 4)
     self.assertEqual(len(inequ), 1)
     self.assertEqual(len(unkn), 5)
Ejemplo n.º 4
0
 def testInsert(self):
     eqns, inequ, unkn = solverc.readeqns('eqns.txt')
     eqns, unkn = solverc.InsertKnowns(specV, cnst, eqns, unkn)