Exemple #1
0
    def __init__(self, parent, question):
        Frame.__init__(self, parent)
        self.answer = StringVar()
        self.question = Label(self, text=question, style='Title.TLabel')
        self.question.grid(column=0, row=0, padx=10, pady=10, sticky='w')
        self.configure(background='yellow')
        self.question.configure(background='yellow')

        self.bar = Separator(self, orient=HORIZONTAL)
        self.bar.grid(column=0,
                      row=2,
                      columnspan=2,
                      padx=5,
                      pady=5,
                      sticky='nsew')

        self.ok = Button(self, text='OK', command=self.OkBut)
        self.ok.grid(column=0, row=3, padx=5, pady=5)

        self.grid()

        # Center the Window
        parent.update_idletasks()
        xp = (parent.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (parent.winfo_screenheight() / 2) - (self.winfo_height() / 2) - 20
        parent.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(),
                                                 self.winfo_height(), xp, yp))

        self.update()
        parent.mainloop()
Exemple #2
0
    def createFrame(self, root):
        """Creates main frame and data input field."""
        frame = Frame(root)
        frame.pack()
        frame.config(background="#dcdcdc") #well, it has to be, right?
        message = Message(frame, width = 350, text="\n"+Fieller.introd, justify=LEFT, font=("Helvetica", "11"), background="#dcdcdc")
        message.grid(row=0, column=0, rowspan=10, columnspan=4)

        s = Separator(frame, orient=HORIZONTAL)
        s.grid (columnspan=4, sticky=EW)
        # label list for the editable entryboxes
        # entry rows 0-6
        self.ll = ("Nominator (a)", "SD of Nom. (a)", "Denominator (b)", 
            "SD of Denom. (b)", "Correlation coefficient (a, b)", "Alpha", 
            "Total number of observations (Na + Nb)")
        self.sample_value = (14, 3, 7, 2, 0, 0.05, 12)

        self.entries = []
        self.sva = []
        #build labels and entry boxes
        for p in self.ll:
            i = len(self.sva)           #i.e. 0 when empty, 1 on next loop
            self.sva.append(StringVar())
            self.sva[i].trace("w", lambda name, index, mode, var=self.sva[i], 
                i=i: self.entryupdate(var, i))
            Label(frame, text=p, bg="#dcdcdc").grid(column=0, row=i+12, sticky=E)
            e = Entry(frame, width=8, textvariable=self.sva[i], 
                highlightbackground="#dcdcdc")
            e.grid(column=1, row=i+12)
            self.entries.append(e)
            self.entries[i].insert(END,str(self.sample_value[i]))        
        lframe = LabelFrame(root, text="Calculated", background="#dcdcdc", 
            padx=20, pady=2)

#        self.noneditable = ("Degrees of freedom (Na + Nb - 2)", "Two-tailed t value")
        # entry rows 7 & 8
#        for p in self.noneditable:
#            i = len(self.sva)
#            self.sva.append(StringVar())
#            #print self.sva
#            self.sva[i].trace("w", lambda name, index, mode, var=self.sva[i], i=i: self.entryupdate(var, i))
#            Label(lframe, text=p, bg="#dcdcdc").grid(column=0, row=i, padx=5, pady=3, sticky=E)
#            e = Label(lframe, width=8, textvariable=self.sva[i], anchor="w", highlightbackground="black", relief=SUNKEN)
#            e.grid(column=1, row=i, padx=5, pady=3)
#        self.ll = self.ll + self.noneditable
#        self.dfupdate()
#        self.tupdate()

        lframe.pack(padx=10, pady=2)
        tframe = Frame(root, background="#dcdcdc")
        tframe.pack()
        b1 = Button(tframe, text="Calculate", command=self.calback, highlightbackground="#dcdcdc").grid(row=1, columnspan=4)
        Label(tframe, text="", background="#dcdcdc").grid(row=2, column=0, columnspan=4)
        txt = Text(tframe)
        txt.grid(row=3, column=0, columnspan=4, padx=20)
        txt.config(width=60, height=9, font=("Courier", "11"))
        txt.insert(END, "Results will appear here")
        print ("fieller frame GUI created")
        self.txt = txt
Exemple #3
0
class StatusFrame(Frame):
    def __init__(self, parent, passfail, failtext):
        Frame.__init__(self, parent)
        self.status = StringVar()
        self.status_text = StringVar()

        self.statuslbl = Label(self, textvariable=self.status, style='Title.TLabel'); self.statuslbl.grid(column=0, row=1, columnspan=2, padx=100, pady=10)

        self.bar = Separator(self, orient=HORIZONTAL); self.bar.grid(column=0, row=2, columnspan=2, padx=5, pady=5, sticky='nsew')

        self.ok = Button(self, text='OK',  command=self.OkBut, width=10); self.ok.grid(column=0, columnspan=2, row=4, padx=5, pady=5)

        if passfail == 'PASS':
            self.TestPassed()
        elif passfail == 'FAIL':
            self.TestFailed(failtext)
        else:
            self.status.set('What?????')
            
        self.grid()

        # Center the Window
        parent.update_idletasks()
        
        xp = (parent.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (parent.winfo_screenheight() / 2) - (self.winfo_height() / 2) - 20
        parent.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(), self.winfo_height(), xp, yp))

        parent.mainloop()

    def OkBut(self):
        self.quit()

    def StatusText(self, text ):
        self.status_text.set(text)
        

    def TestInProgress(self):
        self.status.set('Test In Progress')
        self.statuslbl.configure(foreground='black')
        
    def TestPassed(self):         
        self.status.set('Test PASSED')
        self.configure(background='green')
        self.statuslbl.configure(background='green',foreground='yellow')
        
    def TestFailed(self, text):         
        self.status.set('Test FAIL')
        self.configure(background='red')
        self.statuslbl.configure(background='red',foreground='yellow')
        self.text = Text( self, relief=SUNKEN, width=110, height=16); self.text.grid(column=0, row=3, columnspan=2, sticky='nsew', padx=10, pady=10)
        self.text.insert(INSERT,text)
Exemple #4
0
    def __init__(self,
                 parent,
                 question,
                 yestxt="Yes",
                 notxt='No',
                 title='Default'):
        Frame.__init__(self, parent)
        self.answer = StringVar()
        #        yestxt = "Start Test"
        #        notxt  = "Exit Test"
        self.title = Label(self, text=title, style='Title.TLabel')
        self.title.grid(column=0, row=0, padx=10, pady=10)
        self.question = Label(self, text=question, style='Title.TLabel')
        self.question.grid(column=0, row=1, padx=10, pady=10, sticky='w')
        #        self.entry = Entry( self, width=25, textvariable=self.answer ); self.entry.grid(column=0, row=1, padx=10)
        #        self.entry.select_range(0,END)
        #        self.entry.icursor(END)
        #        self.entry.bind('<Return>', func=lambda e: self.quit())
        #        self.entry.focus_force()

        self.bar = Separator(self, orient=HORIZONTAL)
        self.bar.grid(column=0,
                      row=2,
                      columnspan=2,
                      padx=5,
                      pady=5,
                      sticky='nsew')

        self.ok = Button(self,
                         text=yestxt,
                         style='TButton',
                         command=self.ButtonYes)
        self.ok.grid(column=0, row=2, padx=5, pady=5, sticky='w')
        self.no = Button(self,
                         text=notxt,
                         style='TButton',
                         command=self.ButtonNo)
        self.no.grid(column=0, row=2, padx=5, pady=5, sticky='e')
        self.ok.bind('<Return>', func=lambda e: self.ButtonYes())
        self.ok.focus_force()

        self.grid()

        # Center the Window
        parent.update_idletasks()
        xp = (parent.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (parent.winfo_screenheight() / 2) - (self.winfo_height() / 2) - 20
        parent.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(),
                                                 self.winfo_height(), xp, yp))

        self.update()
        parent.mainloop()
Exemple #5
0
    def miLogin(self):
        login.title("Acceso")
        login.geometry("400x300+400+200")

        #etiquetas muestra
        self.userL = Label(login, text="Usuario:")
        self.passwordL = Label(login, text="Contraseña:")

        # Declara dos variables de tipo cadena para contener
        # el usuario y la contraseña:
        self.usuario = StringVar()
        self.clave = StringVar()
        self.acceso = BooleanVar()

        # Realiza una lectura del nombre de usuario que
        # inició sesión en el sistema y lo asigna a la
        # variable 'self.usuario'
        self.usuario.set(getpass.getuser())
        #define cajas de entrada usuario
        self.usuario = Entry(login, textvariable=self.usuario, width=30)
        self.password = Entry(login,
                              textvariable=self.clave,
                              width=30,
                              show="*")
        #barra separadora
        self.separ1 = Separator(login, orient=HORIZONTAL)

        #se define los botones
        self.aceptarB = Button(login, text="Aceptar", command=self.aceptar)
        self.cancelarB = Button(login, text="Cancelar", command=quit)

        # Se definen las posiciones de los widgets dentro de
        # la ventana. Todos los controles se van colocando
        # hacia el lado de arriba, excepto, los dos últimos,
        # los botones,
        self.userL.pack(side=TOP, fill=BOTH, expand=True, padx=5, pady=5)
        self.usuario.pack(side=TOP, fill=X, expand=True, padx=5, pady=5)
        self.passwordL.pack(side=TOP, fill=BOTH, expand=True, padx=5, pady=5)
        self.password.pack(side=TOP, fill=X, expand=True, padx=5, pady=5)
        self.separ1.pack(side=TOP, fill=BOTH, expand=True, padx=5, pady=5)
        self.aceptarB.pack(side=LEFT, fill=BOTH, expand=True, padx=5, pady=5)
        self.cancelarB.pack(side=RIGHT, fill=BOTH, expand=True, padx=5, pady=5)

        # Cuando se inicia el programa se asigna el foco
        # a la caja de entrada de la contraseña para que se
        # pueda empezar a escribir directamente:

        self.password.focus_set()

        login.mainloop()
        return self.acceso.get()
Exemple #6
0
def display_ClassConfigs(name,self,controller):
	i=1;j=2; # Column and row incrementers
	sty = Style(self); sty.configure("TSeparator", background="black");
	if name == "DetailsPage":
		inputdata = load_configdata(); set_configunits(); # Load data, store units
		for key in Application.key_order:
			if i>7:	i = 1; j = j+1; # Column limit exceeded, begin new row
			labelName = tk.Label(self,font = NORMAL_FONT,text=key + ":"); labelName.grid(column=i, row=j);
			fieldName = tk.Entry(self); fieldName.grid(column=i+2, row=j, rowspan=1);
			fieldName.insert(1,inputdata[key]);	fieldName.configure(state="readonly");
			if Application.units_set[key] != "None":
				unitsLabel = tk.Label(self,font = NORMAL_FONT,text="("+Application.units_set[key]+")"); unitsLabel.grid(column=i+4, row=j);
			sep = Separator(self, orient="vertical")
			sep.grid(column=6, row=j-1, rowspan=2, sticky="nsew")
			Application.DetailsPage_entries.append(fieldName); Application.DetailsPage_labels.append(labelName); # Store widgets 
			i = i+6 # Column for Second label/entry pair
		backbutton = tk.Button(self, bd = "2", fg = "white", bg = "blue", font = NORMAL_FONT, text="Back",command=lambda: controller.show_frame(SettingsPage)).grid(row=int(math.ceil(len(Application.key_order)/2))+2,column=13,rowspan=1)
		editbutton = tk.Button(self, bd = "2", fg = "white", bg = "gray", font = NORMAL_FONT, text="Edit",command=lambda: controller.show_frame(EditConfigsPage)).grid(row=int(math.ceil(len(Application.key_order)/2))+2,column=12,rowspan=1)
	else:
		for key in Application.key_order:
			if i>7: i = 1; j = j+1; # Column limit exceeded, begin new row
			labelName = tk.Label(self,font = NORMAL_FONT,text=key + ":"); labelName.grid(column=i, row=j);
			fieldName = tk.Entry(self); fieldName.grid(column=i+2, row=j);
			fieldName.insert(5,Application.configData[key]); # Create entry, add data
			if Application.units_set[key] != "None":
				unitsLabel = tk.Label(self,font = NORMAL_FONT,text="("+Application.units_set[key]+")"); unitsLabel.grid(column=i+4, row=j);
			sep = Separator(self, orient="vertical")
			sep.grid(column=6, row=j-1, rowspan=2, sticky="nsew")
			Application.EditPage_entries.append(fieldName); Application.EditPage_labels.append(labelName); # Store widgets
			i = i+6 # Column for Second label/entry pair
		Application.firstEdit = False # Config settings have been edited
	pad_children(self) # Assign padding to child widgets
Exemple #7
0
    def __init__(self, parent, passfail, failtext):
        Frame.__init__(self, parent)
        self.status = StringVar()
        self.status_text = StringVar()

        self.statuslbl = Label(self, textvariable=self.status, style='Title.TLabel'); self.statuslbl.grid(column=0, row=1, columnspan=2, padx=100, pady=10)

        self.bar = Separator(self, orient=HORIZONTAL); self.bar.grid(column=0, row=2, columnspan=2, padx=5, pady=5, sticky='nsew')

        self.ok = Button(self, text='OK',  command=self.OkBut, width=10); self.ok.grid(column=0, columnspan=2, row=4, padx=5, pady=5)

        if passfail == 'PASS':
            self.TestPassed()
        elif passfail == 'FAIL':
            self.TestFailed(failtext)
        else:
            self.status.set('What?????')
            
        self.grid()

        # Center the Window
        parent.update_idletasks()
        
        xp = (parent.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (parent.winfo_screenheight() / 2) - (self.winfo_height() / 2) - 20
        parent.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(), self.winfo_height(), xp, yp))

        parent.mainloop()
Exemple #8
0
def menu():
    frame = Frame(root)
    frame.grid(row=0, column=0)

    def next(command):
        frame.grid_forget()
        command()

    Button(frame,
           text='Force on a charged particle',
           command=lambda: next(rhr_force)).grid(row=0, column=0, sticky='w')
    Button(frame,
           text='Magnetic field from a Current',
           command=lambda: next(rhr_wire)).grid(row=1, column=0, sticky='w')
    Button(frame,
           text='Induced current from a magnetic field',
           command=lambda: next(lenz_law)).grid(row=2, column=0, sticky='w')

    Separator(frame, style='TSeparator',
              orient='horizontal').grid(row=3, columnspan=2, sticky='ew')

    Button(frame, text='Constants',
           command=lambda: next(constants)).grid(row=5, column=0, sticky='w')
    Button(frame, text='Not memes',
           command=lambda: next(memes)).grid(row=6, column=0, sticky='w')
Exemple #9
0
class EntryFrame(Frame):
    def __init__(self, parent, question, default_text):
        Frame.__init__(self, parent)
        self.answer = StringVar()
        self.answer.set(default_text)

        self.question = Label(self, text=question, style='Title.TLabel')
        self.question.grid(column=0, row=0, padx=10, pady=10, sticky='w')
        self.entry = Entry(self, width=25, textvariable=self.answer)
        self.entry.grid(column=0, row=1, padx=10)
        self.entry.select_range(0, END)
        self.entry.icursor(END)
        self.entry.bind('<Return>', func=lambda e: self.quit())
        self.entry.focus_force()

        self.bar = Separator(self, orient=HORIZONTAL)
        self.bar.grid(column=0,
                      row=2,
                      columnspan=2,
                      padx=5,
                      pady=5,
                      sticky='nsew')

        self.ok = Button(self, text='OK', command=self.OkBut)
        self.ok.grid(column=0, row=3, padx=5, pady=5, sticky='e')

        self.grid()

        # Center the Window
        parent.update_idletasks()
        xp = (parent.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (parent.winfo_screenheight() / 2) - (self.winfo_height() / 2) - 20
        parent.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(),
                                                 self.winfo_height(), xp, yp))

        self.update()
        parent.mainloop()

    def OkBut(self):
        self.quit()
Exemple #10
0
    def __init__(self, parent, passfail, failtext):
        Frame.__init__(self, parent)
        self.status = StringVar()
        self.status_text = StringVar()

        self.statuslbl = Label(self,
                               textvariable=self.status,
                               style='Title.TLabel')
        self.statuslbl.grid(column=0, row=1, columnspan=2, padx=100, pady=10)

        self.bar = Separator(self, orient=HORIZONTAL)
        self.bar.grid(column=0,
                      row=2,
                      columnspan=2,
                      padx=5,
                      pady=5,
                      sticky='nsew')

        self.ok = Button(self, text='OK', command=self.OkBut, width=10)
        self.ok.grid(column=0, columnspan=2, row=4, padx=5, pady=5)

        if passfail == 'PASS':
            self.TestPassed()
        elif passfail == 'FAIL':
            self.TestFailed(failtext)
        else:
            self.status.set('What?????')

        self.grid()

        # Center the Window
        parent.update_idletasks()

        xp = (parent.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (parent.winfo_screenheight() / 2) - (self.winfo_height() / 2) - 20
        parent.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(),
                                                 self.winfo_height(), xp, yp))

        parent.mainloop()
Exemple #11
0
    def __init__(self, master=None):
        self.locaties = getLocations()
        # self.locaties=['a', 'bbbb', 'c', 'ddddddddddddd', 'e', 'ff', 'ggggggggggggggggggggggggggg']
        Frame.__init__(self, master)
        self.master.title("BigUtrecht Tiny GUI")

        self.buttons = []

        self.ETLButton = Button(self, text="Download and Extract")
        self.ETLButton["command"] = self.runETL
        self.ETLButton.grid(row=0, column=0, sticky=W + E)

        self.buttons.append(self.ETLButton)

        self.map1Button = Button(self, text="Show Maximum Intensity Map")
        self.map1Button["command"] = self.showMap1
        self.map1Button.grid(row=1, column=0, sticky=W + E)

        self.map2Button = Button(self,
                                 text="Show Average Rush Hour Intensity Map")
        self.map2Button["command"] = self.showMap2
        self.map2Button.grid(row=2, column=0, sticky=W + E)

        Separator(self, orient=VERTICAL).grid(row=0,
                                              column=1,
                                              rowspan=3,
                                              sticky=N + S)

        self.locatieScrollbar = Scrollbar(self)
        self.locatieList = Listbox(self,
                                   yscrollcommand=self.locatieScrollbar.set,
                                   height=3)
        for locatie in self.locaties:
            self.locatieList.insert(END, locatie)
        self.locatieScrollbar['command'] = self.locatieList.yview
        self.locatieList.grid(row=0, column=2, rowspan=2, sticky=N + S + E + W)
        self.locatieScrollbar.grid(row=0,
                                   column=3,
                                   rowspan=2,
                                   sticky=N + S + E)

        self.flowButton = Button(self, text="Show Average Flow for Location")
        self.flowButton['command'] = self.showFlow
        self.flowButton.grid(row=2, column=2, columnspan=2, sticky=W + E)

        self.buttons.append(self.map1Button)
        self.buttons.append(self.map2Button)
        self.buttons.append(self.locatieList)
        self.buttons.append(self.flowButton)

        self.grid()
Exemple #12
0
    def buil_toolbar(self):

        Separator(self, style="TSeparator").pack(side=TOP,
                                                 fill=X,
                                                 expand=False)

        self.toolBar = Frame(self,
                             borderwidth=0,
                             relief=FLAT,
                             highlightthickness=0)
        self.toolBar.pack(side=TOP, fill=X, expand=False)

        Frame(self, height=4, bg="#afc8e1").pack(side=TOP,
                                                 fill=X,
                                                 expand=False)
    def __init__(self, parent, cfg):
        Frame.__init__(
            self,
            parent,
            padx=3,
            pady=3,
        )
        self.cfg = cfg
        self.op_id = StringVar()
        self.op_id.set("")

        self.title = Label(self, text='airFiber Test Station')
        self.title.grid(row=0, column=0, columnspan=2)
        Separator(self, orient=HORIZONTAL).grid(row=1,
                                                column=0,
                                                columnspan=2,
                                                sticky="nsew")

        Label(self, text='Station ID: ').grid(row=2, column=0, sticky='w')
        self.desc = Label(self, text=cfg.desc())
        self.desc.grid(row=2, column=1, sticky='w')

        Label(self, text='Operator ID: ').grid(row=3, column=0, sticky='w')
        Label(self, textvariable=self.op_id).grid(row=3, column=1, sticky='w')

        Label(self, text='Odometer: ').grid(row=4, column=0, sticky='w')
        Label(self, textvariable=cfg.odovalue).grid(row=4,
                                                    column=1,
                                                    sticky='w')

        Label(self, text='SW version:').grid(row=5, column=0, sticky='w')
        #        Label(self, text=release_tag + ' rev %(revno)s' % version_info).grid(row=5, column=1, sticky='w')
        #        Label(self, text='%s  rev %(revno)s' % (release_tag, version_info)).grid(row=3, column=1, sticky='w')

        #       remove build date as per Greg
        #        Label(self, text='build date:').grid(row=6, column=0, sticky='w')
        #        Label(self, text='%(date)s' % version_info).grid(row=6, column=1)

        self.grid()
Exemple #14
0
    def __init__(self, parent, title, odo_name=""):
        Frame.__init__(self, parent)
        self.op_id = StringVar()
        self.op_id.set("")
        self.odo = StringVar()
        self.odo.set("")
        self.description = StringVar()
        self.description.set("")
        self.swVer = StringVar()
        self.swVer.set("0.0.0")
        self.openOdometer(odo_name)

        self.title = Label(self, text=title)
        self.title.grid(row=0, column=0, columnspan=2)
        Separator(self, orient=HORIZONTAL).grid(row=1,
                                                column=0,
                                                columnspan=2,
                                                sticky="nsew")

        Label(self, text='Station ID: ').grid(row=2, column=0, sticky='w')
        self.desc = Label(self, textvariable=self.description)
        self.desc.grid(row=2, column=1, sticky='w')

        Label(self, text='Operator ID: ').grid(row=3, column=0, sticky='w')
        Label(self, textvariable=self.op_id).grid(row=3, column=1, sticky='w')

        Label(self, text='Odometer: ').grid(row=4, column=0, sticky='w')
        Label(self, textvariable=self.odo).grid(row=4, column=1, sticky='w')

        Label(self, text='Test Ver:').grid(row=5, column=0, sticky='w')
        Label(self, textvariable=self.swVer).grid(row=5, column=1, sticky='w')
        #        Label(self, text='%s  rev %(revno)s' % (release_tag, version_info)).grid(row=3, column=1, sticky='w')

        #       remove build date as per Greg
        #        Label(self, text='build date:').grid(row=6, column=0, sticky='w')
        #        Label(self, text='%(date)s' % version_info).grid(row=6, column=1)

        self.grid()
    def __init__(self, root):
        """
        Create a DSP interface instance.

        :param root: is the Tk() interface where the DPS will be drawedstring with the prot name i.e. /dev/ttyUSB0 or COM5 for Windows
        :returns: a new instance of DPS graphical interface

        """

        self.root = root
        root.title("DPS power supplier interface")
        root.protocol("WM_DELETE_WINDOW", self.wnwcmdclose)

        self.dps = None
        self.poller = None
        self.waver = None
        self.strtme = time()
        self.dpsfwave = None
        self.maxoutv = 5
        self.maxoutc = 5

        menubar = Menu(root)

        filemenu = Menu(menubar, tearoff=0)
        filemenu.add_command(label="Exit", command=self.wnwcmdclose)
        menubar.add_cascade(label="File", menu=filemenu)

        scopemenu = Menu(menubar, tearoff=0)
        scopemenu.add_command(label="Load sampled points...",
                              command=self.mnucmdloadsmppts)
        scopemenu.add_command(label="Save sampled points as...",
                              command=self.mnucmdsavesmppts)
        menubar.add_cascade(label="Scope", menu=scopemenu)

        wavemenu = Menu(menubar, tearoff=0)
        wavemenu.add_command(label="New wave", command=self.mnucmdnewwve)
        wavemenu.add_command(label="Load wave...", command=self.mnucmdloadwve)
        wavemenu.add_command(label="Edit wave...", command=self.mnucmdedtwve)
        wavemenu.add_command(label="Save wave as...",
                             command=self.mnucmdsavewve)
        menubar.add_cascade(label="Wave", menu=wavemenu)

        memmenu = Menu(menubar, tearoff=0)
        memmenu.add_command(label="Edit memories...",
                            command=self.mnucmdedtmem)
        menubar.add_cascade(label="Memory", menu=memmenu)

        helpmenu = Menu(menubar, tearoff=0)
        helpmenu.add_command(label="Help...", command=self.mnucmdhelp)
        helpmenu.add_command(label="About...", command=self.mnucmdabout)
        menubar.add_cascade(label="Help", menu=helpmenu)

        root.config(menu=menubar)

        row = 0
        col = 0
        rowspan = 1
        colspan = 1
        insertlabelrow(root, row, col, ("Serial: ", None, "Addr,Baud: "), E)
        col += colspan
        self.svardpsport = StringVar()
        self.svardpsport.set('/dev/ttyUSB0')
        self.entryserport = Entry(root,
                                  textvariable=self.svardpsport,
                                  width=ENTRYWIDTH,
                                  justify='right')
        self.entryserport.grid(row=row, column=col, sticky=W)
        col += colspan
        col += colspan
        self.svardpsaddbrt = StringVar()
        self.svardpsaddbrt.set('1, 9600')
        self.entrydpsadd = Entry(root,
                                 textvariable=self.svardpsaddbrt,
                                 width=ENTRYWIDTH,
                                 justify='right')
        self.entrydpsadd.grid(row=row, column=col, sticky=W)
        col += colspan
        colspan = 2
        self.ivarconctd = IntVar()
        self.ivarconctd.set(0)
        Checkbutton(root,
                    variable=self.ivarconctd,
                    text='Connect',
                    command=self.butcmdconnect).grid(row=row,
                                                     column=col,
                                                     columnspan=colspan,
                                                     sticky=E + W)

        row += rowspan
        col = 0
        colspan = 1
        Separator(root, orient='horizontal').grid(row=row,
                                                  columnspan=8,
                                                  sticky=E + W,
                                                  pady=8)

        row += rowspan
        rowspan = 1
        colspan = 2
        col = 0
        self.ivarbrghtnes = IntVar()
        s = Scale(root,
                  label='Brightness',
                  variable=self.ivarbrghtnes,
                  from_=0,
                  to=5,
                  resolution=1,
                  orient="horizontal")
        s.bind("<ButtonRelease-1>", self.sclbndbrghtnss)
        s.grid(row=row, column=col, columnspan=colspan, sticky=E + W)
        col += colspan
        colspan = 1
        Label(root, text="Model: ").grid(row=row, column=col, sticky=E)
        col += colspan
        self.ivarmodel = IntVar()
        Entry(root,
              textvariable=self.ivarmodel,
              state="readonly",
              width=ENTRYWIDTH,
              justify='right').grid(row=row, column=col, sticky=W)
        col += colspan
        colspan = 2
        self.ivarsetmem = IntVar()
        s = Scale(root,
                  label='Mem Recall',
                  variable=self.ivarsetmem,
                  from_=1,
                  to=9,
                  resolution=1,
                  orient="horizontal")
        s.bind("<ButtonRelease-1>", self.sclbndmemory)
        s.grid(row=row, column=col, columnspan=colspan, sticky=E + W)

        row += rowspan
        colspan = 1
        col = 0
        insertlabelrow(
            root, row, col,
            (("Vinp [V]: ", VCOL), None, "Out Mode: ", None, "Protection: "),
            E)
        self.dvarvinp = DoubleVar()
        self.svarwrmde = StringVar()
        self.setworkmode(0)
        self.svarprot = StringVar()
        self.setprotection(0)
        insertentryrow(
            root, row, col,
            (None, self.dvarvinp, None, self.svarwrmde, None, self.svarprot),
            'right', W, 'readonly')

        colspan = 1
        row += rowspan
        col = 0
        insertlabelrow(root, row, col,
                       (("Vmax [V]: ", VCOL), None, ("Cmax [A]: ", CCOL), None,
                        ("Pmax [W]: ", PCOL)), E)
        self.dvarvmaxm0 = DoubleVar()
        self.dvarcmaxm0 = DoubleVar()
        self.dvarpmaxm0 = DoubleVar()
        entries = insertentryrow(root, row, col,
                                 (None, self.dvarvmaxm0, None, self.dvarcmaxm0,
                                  None, self.dvarpmaxm0), 'right', W)
        for e, f in zip(entries,
                        (self.entbndvmax, self.entbndcmax, self.entbndpmax)):
            e.bind('<FocusOut>', f)
            e.bind('<Return>', f)

        row += rowspan
        col = 0
        insertlabelrow(root, row, col,
                       (("Vout [V]: ", VCOL), None, ("Cout [A]: ", CCOL), None,
                        ("Pout [W]: ", PCOL)), E)
        self.dvarvout = DoubleVar()
        self.dvarcout = DoubleVar()
        self.dvarpout = DoubleVar()
        insertentryrow(
            root, row, col,
            (None, self.dvarvout, None, self.dvarcout, None, self.dvarpout),
            'right', W, 'readonly')

        row += rowspan
        col = 0
        self.scope = Scope(root, [], row, col)

        row += 9
        col = 4
        Label(root, text="Rte[s/Sa]: ").grid(row=row, column=col, sticky=E)
        col += colspan
        self.dvarsecsmp = DoubleVar()
        self.dvarsecsmp.set(self.scope.sampletime())
        e = Entry(root,
                  textvariable=self.dvarsecsmp,
                  width=ENTRYWIDTH,
                  justify='right').grid(row=row, column=col, sticky=W)

        row += rowspan
        col = 0
        colspan = 2
        self.ivaracquire = IntVar()
        self.ivaracquire.set(0)
        Checkbutton(root,
                    variable=self.ivaracquire,
                    text='Run Acquisition',
                    command=self.butcmdacquire).grid(row=row,
                                                     column=col,
                                                     columnspan=2,
                                                     sticky=E + W)
        col += colspan
        self.ivarkeylock = IntVar()
        self.ivarkeylock.set(0)
        Checkbutton(root,
                    variable=self.ivarkeylock,
                    text="Key Lock",
                    command=self.butcmdkeylock).grid(row=row,
                                                     column=col,
                                                     sticky=E + W,
                                                     columnspan=colspan)
        col += colspan
        self.ivaroutenab = IntVar()
        self.ivaroutenab.set(0)
        Checkbutton(root,
                    variable=self.ivaroutenab,
                    text="Output Enable",
                    command=self.butcmdoutenable).grid(row=row,
                                                       column=col,
                                                       sticky=E + W,
                                                       columnspan=colspan)

        row += rowspan
        col = 0
        rowspan = 1
        colspan = 3
        self.dvarvscale = DoubleVar()
        self.voltscale = Scale(root,
                               label='Vset [V]',
                               foreground=VCOL,
                               variable=self.dvarvscale,
                               from_=0,
                               to=self.maxoutv,
                               resolution=1,
                               orient="horizontal")  #, label='Vset[V]'
        self.voltscale.bind("<ButtonRelease-1>", self.sclbndvolt)
        self.voltscale.grid(row=row,
                            column=col,
                            columnspan=colspan,
                            sticky=E + W)
        col += colspan
        self.dvarcscale = DoubleVar()
        self.curntscale = Scale(root,
                                label='Cset[A]',
                                foreground=CCOL,
                                variable=self.dvarcscale,
                                from_=0,
                                to=self.maxoutc,
                                resolution=1,
                                orient="horizontal")  #,label='Cset[A]'
        self.curntscale.bind("<ButtonRelease-1>", self.sclbndcrnt)
        self.curntscale.grid(row=row,
                             column=col,
                             columnspan=colspan,
                             sticky=E + W)

        row += rowspan
        col = 0
        self.dvarvscalef = DoubleVar()
        sc = Scale(root,
                   foreground=VCOL,
                   variable=self.dvarvscalef,
                   from_=0,
                   to=0.99,
                   resolution=0.01,
                   orient="horizontal")
        sc.bind("<ButtonRelease-1>", self.sclbndvolt)
        sc.grid(row=row, column=col, columnspan=colspan, sticky=E + W)
        col += colspan
        self.dvarcscalef = DoubleVar()
        sc = Scale(root,
                   foreground=CCOL,
                   variable=self.dvarcscalef,
                   from_=0,
                   to=0.99,
                   resolution=0.01,
                   orient="horizontal")
        sc.bind("<ButtonRelease-1>", self.sclbndcrnt)
        sc.grid(row=row, column=col, columnspan=colspan, sticky=E + W)

        row += rowspan
        col = 0
        colspan = 1
        Separator(root, orient='horizontal').grid(row=row,
                                                  columnspan=6,
                                                  sticky=E + W,
                                                  pady=8)

        row += rowspan
        colspan = 1
        col = 0
        Label(root, text="Waveform: ").grid(row=row, column=col, sticky=E)
        col += colspan
        colspan = 2
        self.svarwave = StringVar()
        Entry(root,
              textvariable=self.svarwave,
              width=ENTRYWIDTH,
              justify='right',
              state='readonly').grid(row=row,
                                     column=col,
                                     columnspan=colspan,
                                     sticky=E + W)
        col += colspan
        colspan = 1
        self.ivarplaywv = IntVar()
        self.ivarplaywv.set(0)
        Checkbutton(root,
                    variable=self.ivarplaywv,
                    text='Play',
                    command=self.butcmdplaywave).grid(row=row,
                                                      column=col,
                                                      sticky=E + W)
        col += colspan
        self.ivarpausewv = IntVar()
        self.ivarpausewv.set(0)
        Checkbutton(root,
                    variable=self.ivarpausewv,
                    text='Pause',
                    command=self.butcmdpausewave).grid(row=row,
                                                       column=col,
                                                       sticky=E + W)
        col += colspan
        self.ivarloopwv = IntVar()
        self.ivarloopwv.set(0)
        Checkbutton(root, variable=self.ivarloopwv,
                    text='Loop').grid(row=row, column=col, sticky=E + W)

        self.scope.update()
        self.scope.redraw()
Exemple #16
0
    def __init__(self, master):

        plat = platform.system()
        if plat == 'Darwin':

            try:
                system(
                    '''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python" to true' '''
                )
                print("Trying to force Python window to the front on macOS")
            except:
                system(
                    '''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python2.7" to true' '''
                )
                print(
                    "Trying to force Python 2.7 window to the front on macOS")

        self.master = master
        frame = Frame(master)
        frame.config(background="#dcdcdc")
        frame.config(borderwidth=5, relief=GROOVE)
        frame.place(relx=0.5, rely=0.5, anchor=CENTER)
        master.title('Verify v. 0.2')  #   Main frame title
        master.config(background="#dcdcdc")
        master.geometry('820x750')
        menubar = Menu(master)
        """statmenu = Menu(menubar,tearoff=0)
        statmenu.add_command(label="Fieller", command=self.on_fieller)
        
        statmenu.rantest = Menu(statmenu)
        statmenu.rantest.add_command(label="Continuously variable data", command=self.on_rantest_continuous)
        statmenu.rantest.add_command(label="Binomial data (each result= yes or no)", command=self.on_rantest_binomial)
        statmenu.add_cascade(label="Randomisation test", menu=statmenu.rantest)
        
        statmenu.add_command(label="Help", command=self.on_help, state=DISABLED)
        statmenu.add_command(label="Quit", command=master.quit)
        
        menubar.add_cascade(label="Statistical Tests", menu=statmenu)
        master.config(menu=menubar)
      """
        b3 = Button(frame,
                    text="Load traces",
                    width=20,
                    command=self.callback3,
                    highlightbackground="#dcdcdc")
        b3.grid(row=0, column=0, columnspan=2, padx=10, pady=8, sticky=W)

        self.b4 = Button(frame,
                         text="Verify traces variance",
                         width=20,
                         state=DISABLED,
                         command=self.callback2,
                         highlightbackground="#dcdcdc")
        self.b4.grid(row=1, padx=10, pady=8, column=0, columnspan=2)

        self.b5 = Button(frame,
                         text="Plot Variance vs. current",
                         width=20,
                         state=DISABLED,
                         command=self.callback5,
                         highlightbackground="#dcdcdc")
        self.b5.grid(row=2, padx=10, pady=8, column=0, columnspan=2)

        #need to remove Pack to use separator
        s1 = Separator(frame, orient=VERTICAL)
        s1.grid(column=2, row=0, rowspan=40, pady=10, sticky=N + W + S)

        self.input_filename_label = StringVar()
        self.input_filename_label.set("No data loaded yet")
        self.l1 = Label(frame,
                        textvariable=self.input_filename_label,
                        width=40,
                        bg="#dcdcdc")
        self.l1.grid(row=0, column=2, columnspan=4, pady=5)

        Label(frame, text="Baseline range (pts)",
              bg="#dcdcdc").grid(row=1,
                                 column=2,
                                 columnspan=2,
                                 pady=5,
                                 sticky=E)
        self.br = Entry(frame,
                        justify=CENTER,
                        width=5,
                        highlightbackground="#dcdcdc")
        self.br.grid(row=1, column=4, sticky=W, pady=5)
        self.br.insert(END, '0, 50')

        Label(frame, text="Decimation", bg="#dcdcdc").grid(row=2,
                                                           column=2,
                                                           columnspan=2,
                                                           pady=5,
                                                           sticky=E)
        self.de = Entry(frame,
                        justify=CENTER,
                        width=5,
                        highlightbackground="#dcdcdc")
        self.de.grid(row=2, column=4, sticky=W, pady=5)
        self.de.insert(END, '1')

        Label(frame, text="Unitary current amplitude (pA)",
              bg="#dcdcdc").grid(row=3,
                                 column=2,
                                 columnspan=2,
                                 pady=5,
                                 sticky=E)
        self.ua = Entry(frame,
                        justify=CENTER,
                        width=5,
                        highlightbackground="#dcdcdc")
        self.ua.grid(row=3, column=4, sticky=W, pady=5)
        self.ua.insert(END, '1')
        #default unitary current is 1 pA

        Label(frame, text="Output filename", bg="#dcdcdc").grid(row=4,
                                                                column=2,
                                                                columnspan=2,
                                                                pady=5)

        style = Style()
        style.theme_use('clam')
        style.configure("w.TRadiobutton",
                        padding=2,
                        background="#dcdcdc",
                        foreground="black",
                        width=15)
        style.configure("TRadiobutton",
                        padding=2,
                        background="#dcdcdc",
                        foreground="black",
                        width=8)

        MODES = [("verified.txt", 3), ("Save as...", 2), ("v_[infile]", 1),
                 ("[date:time]_v_[infile]", 0)]

        self.v = IntVar()
        self.v.set(0)  # initialize

        #note this is the ttk radiobutton, the tk one doesn't select at first
        for text, mode in MODES:
            b = Radiobutton(frame,
                            text=text,
                            command=self.callback_fname,
                            variable=self.v,
                            value=mode,
                            state=NORMAL)
            b.grid(row=5, padx=10, column=mode + 2, sticky=E)

        #the last button in the loop (0) is the wide one, so gets the wide style.
        b.configure(style='w.TRadiobutton')

        self.traceHost = Frame(frame)
        self.traceHost.grid(row=15, column=0, columnspan=3)
        self.p = Plot(self.traceHost)

        self.Host2D = Frame(frame)
        self.Host2D.grid(row=15, column=3, columnspan=3)
        self.pcv = Plot(self.Host2D)

        s2 = Separator(frame)
        s2.grid(row=25, columnspan=6, sticky=S + E + W)

        message = Message(frame,
                          text=self.introduction,
                          width=800,
                          font=("Courier", 12),
                          bg="#dcdcdc")
        message.grid(row=26, rowspan=8, columnspan=6, sticky=EW)

        s3 = Separator(frame)
        s3.grid(row=35, columnspan=6, sticky=E + W)

        version_text = "https://github.com/aplested/verify\nPython version:\t" + sys.version.replace(
            "\n", "\t")
        version = Message(frame,
                          width=800,
                          text=version_text,
                          justify=LEFT,
                          background="#dcdcdc",
                          font=("Courier", 12))
        version.grid(row=36, columnspan=5, sticky=EW)

        self.b6 = Button(frame,
                         text="Quit",
                         command=master.quit,
                         width=10,
                         highlightbackground="#dcdcdc")
        self.b6.grid(row=36, padx=10, pady=8, column=5, sticky=W)
    def __init__(self, prevroot, datawve):
        """
        Create a waveinterface instance.

        :param prevroot: is the main window 
        :param datawve: is the datapoints to play with
        :returns: a new instance of wave interface

        """
        self.root = maketoplevel(prevroot, True)
        self.root.title("Wave editor")

        self.datawve = datawve

        self.dataclpbrd = []
        self.clipboardtime = 0

        row = 0
        col = 0
        self.tablewve = Table(self.root, self.datawve,
                              ('step', 'time [s]', ('voltage [V]', VCOL),
                               ('current [A]', CCOL)), row, col, TABLEROW,
                              TABLECOL)

        SCOPEROWSPAN = 15
        self.scope = Scope(self.root,
                           self.datawve,
                           TABLEROW + 1 + 1,
                           0,
                           rowspan=SCOPEROWSPAN,
                           showpower=False,
                           horizontaljoin=True,
                           buttoncallback=self.buttoncallback)

        row = 1
        rowspan = 1
        colspan = 1
        col = TABLECOL + colspan
        Button(self.root, text="Pick beg",
               command=self.btncmdpckbeg).grid(row=row,
                                               column=col,
                                               sticky=E + W,
                                               padx=8)
        col = TABLECOL + colspan
        row += rowspan
        Button(self.root, text="Pick end",
               command=self.btncmdpckend).grid(row=row,
                                               column=col,
                                               sticky=E + W,
                                               padx=8)

        Separator(self.root,
                  orient='horizontal').grid(row=TABLEROW + 1,
                                            column=0,
                                            columnspan=TABLECOL + 2 + 1 + 6,
                                            sticky=E + W,
                                            pady=8)

        Separator(self.root, orient='vertical').grid(row=0,
                                                     column=6,
                                                     rowspan=1 + TABLEROW + 1 +
                                                     SCOPEROWSPAN,
                                                     sticky=N + S,
                                                     padx=8)

        row = 0
        COL1 = TABLECOL + 2 + 1
        col = COL1
        colspan = 1
        insertlabelrow(self.root, row, col, (None, None, ('voltage [V]', VCOL),
                                             ('current [A]', CCOL)))

        row += rowspan
        insertlabelrow(self.root, row, col, ('time [s]:', ))
        self.dvartime = DoubleVar()
        self.dvarvoltage = DoubleVar()
        self.dvarcurrent = DoubleVar()
        insertentryrow(
            self.root, row, col,
            (None, self.dvartime, self.dvarvoltage, self.dvarcurrent))
        col += TABLECOL
        Button(self.root, text="Insert",
               command=self.butcmdinsert).grid(row=row,
                                               column=col,
                                               sticky=E + W,
                                               padx=8)

        row += rowspan
        col = COL1
        insertlabelrow(self.root, row, col, ('step :', ))
        self.ivarstep = IntVar()
        insertentryrow(
            self.root, row, col,
            (None, self.ivarstep, self.dvarvoltage, self.dvarcurrent))
        col += TABLECOL
        Button(self.root, text="Modify",
               command=self.butcmdmodify).grid(row=row,
                                               column=col,
                                               sticky=E + W,
                                               padx=8)
        col += colspan
        Button(self.root, text="Delete",
               command=self.butcmddelete).grid(row=row,
                                               column=col,
                                               sticky=E + W,
                                               padx=8)

        row += rowspan
        col = COL1
        insertlabelrow(self.root, row, col, ('pause [s]:', ))
        self.dvarpause = DoubleVar()
        insertentryrow(
            self.root, row, col,
            (None, self.dvarpause, self.dvarvoltage, self.dvarcurrent))
        col += TABLECOL
        Button(self.root, text="Append",
               command=self.butcmdappend).grid(row=row,
                                               column=col,
                                               sticky=E + W,
                                               padx=8)

        self.clipboard = Clipboard(self.root, self.datawve, self.updateview,
                                   TABLEROW + 2, COL1)

        col = COL1 + TABLECOL
        colspan = 1
        row = TABLEROW + 1 + SCOPEROWSPAN
        Button(self.root, text="Help",
               command=self.btncmdhelp).grid(row=row,
                                             column=col,
                                             sticky=E + W,
                                             padx=8)
        col += 1
        Button(self.root, text="Done",
               command=self.butcmddone).grid(row=row,
                                             column=col,
                                             sticky=E + W,
                                             padx=8)

        self.scope.update()
        self.scope.redraw()
Exemple #18
0
class StatusFrame(Frame):
    def __init__(self, parent, passfail, failtext):
        Frame.__init__(self, parent)
        self.status = StringVar()
        self.status_text = StringVar()

        self.statuslbl = Label(self,
                               textvariable=self.status,
                               style='Title.TLabel')
        self.statuslbl.grid(column=0, row=1, columnspan=2, padx=100, pady=10)

        self.bar = Separator(self, orient=HORIZONTAL)
        self.bar.grid(column=0,
                      row=2,
                      columnspan=2,
                      padx=5,
                      pady=5,
                      sticky='nsew')

        self.ok = Button(self, text='OK', command=self.OkBut, width=10)
        self.ok.grid(column=0, columnspan=2, row=4, padx=5, pady=5)

        if passfail == 'PASS':
            self.TestPassed()
        elif passfail == 'FAIL':
            self.TestFailed(failtext)
        else:
            self.status.set('What?????')

        self.grid()

        # Center the Window
        parent.update_idletasks()

        xp = (parent.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (parent.winfo_screenheight() / 2) - (self.winfo_height() / 2) - 20
        parent.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(),
                                                 self.winfo_height(), xp, yp))

        parent.mainloop()

    def OkBut(self):
        self.quit()

    def StatusText(self, text):
        self.status_text.set(text)

    def TestInProgress(self):
        self.status.set('Test In Progress')
        self.statuslbl.configure(foreground='black')

    def TestPassed(self):
        self.status.set('Test PASSED')
        self.configure(background='green')
        self.statuslbl.configure(background='green', foreground='yellow')

    def TestFailed(self, text):
        self.status.set('Test FAIL')
        self.configure(background='red')
        self.statuslbl.configure(background='red', foreground='yellow')
        self.text = Text(self, relief=SUNKEN, width=110, height=16)
        self.text.grid(column=0,
                       row=3,
                       columnspan=2,
                       sticky='nsew',
                       padx=10,
                       pady=10)
        self.text.insert(INSERT, text)
Label(root, text="Tilt").grid(row=0, column=0)
s_tilt = Scale(root, from_=1, to=4095, length=300)
s_tilt.grid(row=1, column=0, pady=5, padx=10)
s_tilt.set(1024)

Label(root, text="Extension").grid(row=0, column=1)
s_ext = Scale(root, from_=2000, to=1050, length=300)
s_ext.grid(row=1, column=1, pady=5, padx=10)

Label(root, text="Pan").grid(row=2, columnspan=2)
s_pan = Scale(root, from_=4095, to=1, orient=HORIZONTAL, length=300)
s_pan.set(2048)
s_pan.grid(row=3, columnspan=2, padx=10)

Separator(root).grid(row=4, columnspan=2, pady=15, sticky="EW")

Label(root, text="Speed").grid(row=5, columnspan=2)
s_step = Scale(root, from_=1, to=30, orient=HORIZONTAL, length=300)
s_step.set(1)
s_step.grid(row=6, columnspan=2, padx=10)

btn_pnl = Frame(root)
btn_pnl.grid(row=7, columnspan=2, pady=10, padx=5)
Button(btn_pnl, text="Halt", fg="red", activeforeground="red",
       command=doHalt).grid()

# initalize to physical state
sensedConfig = p.initToPhysicalConfig(timeout=5)
s_pan.set(sensedConfig[0])
s_tilt.set(sensedConfig[1])
Exemple #20
0
 def add_separator(self, row, padx=7, pady=7):
     s = Separator(self, orient=HORIZONTAL)
     s.grid(row=row, columnspan=3, padx=padx, pady=pady, sticky=(W, E))
Exemple #21
0
def rhr_force():

    #Setting the frame to make cleanup easier
    frame = Frame(root)
    frame.grid(row=0, column=0, sticky='w')

    Separator(frame, style='TSeparator', orient='vertical').grid(row=0,
                                                                 column=1,
                                                                 rowspan=7,
                                                                 sticky='ns')

    #Setting the variables
    b = IntVar()
    v = IntVar()
    f = StringVar()
    f.set('')

    #Method to set the answer if all the radio buttons are selected
    def update():

        #Testing to see if the both radio button sets are selected
        if b.get() is not 0 and v.get() is not 0:
            f.set("Force Direction: {}".format(vector_to_english[str(
                rhr_field(B=b.get(), V=v.get()))]))

    #Set the label for the magnetic field direction
    Label(frame, text="Magnetic Field Direction").grid(row=0,
                                                       column=0,
                                                       sticky='w',
                                                       padx=1)
    for i in range(len(printout_list)):

        #Create the radiobutton for the direction of the field
        Radiobutton(frame,
                    text=printout_list[i],
                    variable=b,
                    value=i + 1,
                    command=lambda: update()).grid(row=i + 1,
                                                   column=0,
                                                   sticky='w',
                                                   padx=1)

    #Set the label for the velocity field direction
    Label(frame, text="Velocity Direction").grid(row=0,
                                                 column=2,
                                                 sticky='w',
                                                 padx=1)
    for i in range(len(printout_list)):

        #Create the radiobutton for the direction of the velocity
        Radiobutton(frame,
                    text=printout_list[i],
                    variable=v,
                    value=i + 1,
                    command=lambda: update()).grid(row=i + 1,
                                                   column=2,
                                                   sticky='w',
                                                   padx=1)

    #Label for the answer
    Label(frame, textvariable=f, font="16").grid(row=8,
                                                 column=0,
                                                 sticky='w',
                                                 columnspan=3)

    #Method and button for returning to the menu
    def return_to_menu():
        frame.grid_forget()
        main()

    Button(frame, text="Back to menu",
           command=lambda: return_to_menu()).grid(row=0, column=3, sticky='w')
Exemple #22
0
def lenz_law():
    frame = Frame(root)
    frame.grid(row=0, column=0, sticky='w')

    Separator(frame, style='TSeparator', orient='vertical').grid(row=0,
                                                                 column=1,
                                                                 rowspan=7,
                                                                 sticky='ns')
    Separator(frame, style='TSeparator', orient='vertical').grid(row=0,
                                                                 column=3,
                                                                 rowspan=7,
                                                                 sticky='ns')

    b = IntVar()
    db = IntVar()
    da = IntVar()
    d = StringVar()
    d.set('')

    def update():
        if b.get() is not 0 and db.get() is not 0 and da.get() is not 0:
            d.set(induced_current(B=b.get(), dB=db.get(), dA=da.get()))

    Label(frame, text="Magnetic Field Direction").grid(row=0,
                                                       column=0,
                                                       sticky='w',
                                                       padx=1)
    for k in range(len(printout_list)):
        Radiobutton(frame,
                    text=printout_list[k],
                    variable=b,
                    value=k + 1,
                    command=lambda: update()).grid(row=k + 1,
                                                   column=0,
                                                   sticky='w',
                                                   padx=1)

    Label(frame, text="Change in the Magnetic Field").grid(row=0,
                                                           column=2,
                                                           sticky='w',
                                                           padx=1)
    for k in range(len(printout_list_3)):
        Radiobutton(frame,
                    text=printout_list_3[k],
                    variable=db,
                    value=k + 1,
                    command=lambda: update()).grid(row=k + 1,
                                                   column=2,
                                                   sticky='w',
                                                   padx=1)

    Label(frame, text="Change in the Area").grid(row=0,
                                                 column=4,
                                                 sticky='w',
                                                 padx=1)
    for k in range(len(printout_list_3)):
        Radiobutton(frame,
                    text=printout_list_3[k],
                    variable=da,
                    value=k + 1,
                    command=lambda: update()).grid(row=k + 1,
                                                   column=4,
                                                   sticky='w',
                                                   padx=1)

    Label(frame, textvariable=d, font="20").grid(row=8,
                                                 column=0,
                                                 sticky='w',
                                                 columnspan=3)

    def return_to_menu():
        frame.grid_forget()
        main()

    Button(frame, text="Back to menu",
           command=lambda: return_to_menu()).grid(row=0, column=5, sticky='w')
Exemple #23
0
def rhr_wire():

    #Setting the frame to make cleanup easier
    frame = Frame(root)
    frame.grid(row=0, column=0, sticky='w')

    Separator(frame, style='TSeparator', orient='vertical').grid(row=0,
                                                                 column=1,
                                                                 rowspan=7,
                                                                 sticky='ns')

    #Setting the variables
    i = IntVar()
    p = IntVar()
    b = StringVar()
    b.set('')

    #Method to set the answer if all the radio buttons are selected
    def update():

        #Testing to see if the both radio button sets are selected
        if i.get() is not 0 and p.get() is not 0:
            b.set(vector_to_english[str(rhr_current(I=i.get(), P=p.get()))])

    #Set the label for the current direction
    Label(frame, text="Current Direction").grid(row=0,
                                                column=0,
                                                sticky='w',
                                                padx=1)
    for k in range(len(printout_list)):

        #Create the radiobutton for the direction of the current
        Radiobutton(frame,
                    text=printout_list[k],
                    variable=i,
                    value=k + 1,
                    command=lambda: update()).grid(row=k + 1,
                                                   column=0,
                                                   sticky='w',
                                                   padx=1)

    #Set the label for the point location
    Label(frame, text="Point Location").grid(row=0,
                                             column=2,
                                             sticky='w',
                                             padx=1)
    for k in range(len(printout_list_2)):

        #Create the radiobutton for the location of the point
        Radiobutton(frame,
                    text=printout_list_2[k],
                    variable=p,
                    value=k + 1,
                    command=lambda: update()).grid(row=k + 1,
                                                   column=2,
                                                   sticky='w',
                                                   padx=1)

    Label(frame, textvariable=b, font="16").grid(row=8,
                                                 column=0,
                                                 sticky='w',
                                                 columnspan=3)

    def return_to_menu():
        frame.grid_forget()
        main()

    Button(frame, text="Back to menu",
           command=lambda: return_to_menu()).grid(row=0, column=3, sticky='w')
Exemple #24
0
min_len_ent.grid(row=11, column=0, padx=5)
lbl_rec_countsec.grid(row=11, column=0, sticky=E, padx=5)

plt_len_lbl.grid(row=10, column=4, sticky=W, pady=5, padx=5)
plt_len_entry.grid(row=11, column=4, sticky=W, pady=5, padx=5)
success_criteria_lbl.grid(row=12, column=4, sticky=W, pady=5, padx=5)
success_criteria_entry.grid(row=13, column=4, sticky=W, pady=5, padx=5)
romi_ver_lbl.grid(row=14, column=4, sticky=W, pady=5, padx=5)
romi_ver_ent.grid(row=15, column=4, sticky=W, pady=5, padx=5)

lst_times.grid(row=12, column=0, sticky=W, rowspan=5, columnspan=2, padx=10)
scrollbar.grid(row=12, column=0, sticky=N + E + S, rowspan=5, padx=1)

Separator(root, orient=HORIZONTAL).grid(row=18,
                                        columnspan=6,
                                        sticky="ew",
                                        pady=10,
                                        padx=10)

lbl_capno.grid(row=19, column=0, sticky=W, pady=10, padx=10)
but_capno.grid(row=19, column=0, sticky=E, pady=10)
col_but_cap.grid(row=19, column=1, sticky=W, pady=5)

lbl_nellcor.grid(row=110, column=0, sticky=W, padx=10, pady=10)
but_nellcor.grid(row=110, column=0, sticky=E, pady=10)
col_but_nellcor.grid(row=110, column=1, sticky=W, pady=10)

lbl_stamper.grid(row=19, column=2, sticky=W, padx=10, pady=10)
but_stamper.grid(row=19, column=2, sticky=E, pady=10)
lbl_mindray.grid(row=110, column=2, sticky=W, padx=10, pady=10)
but_mindray.grid(row=110, column=2, sticky=E, pady=10)
Exemple #25
0
    def __init__(self,
                 master,
                 options,
                 width=20,
                 bordercolor="#cccccc",
                 foreground="black",
                 background="white",
                 activebackground="#2780E3",
                 activeforeground="white",
                 padx=15,
                 pady=7,
                 command=None):
        Frame.__init__(self,
                       master,
                       background=background,
                       highlightbackground=bordercolor,
                       highlightcolor=bordercolor,
                       highlightthickness=1,
                       bd=0)

        self._foreground = foreground
        self._background = background
        self._activebackground = activebackground
        self._activeforeground = activeforeground

        self._items = []

        index = 0
        for option in options:

            if option is None:
                Separator(self, orient=HORIZONTAL).pack(fill=X)
                continue

            if isinstance(option, basestring):
                test = option
                value = option
            else:
                text, value = option

            label_item = Label(self,
                               width=width,
                               text=text,
                               background=background,
                               foreground="black",
                               anchor=W,
                               padx=padx,
                               pady=pady)
            label_item.pack(fill=X)

            label_item.index = index
            label_item.value = value

            label_item.bind("<Enter>", self._on_enter_label_item)
            label_item.bind("<Leave>", self._on_leave_label_item)
            label_item.bind("<1>",
                            lambda event, index=index: self._on_click_item(
                                event.widget, index))
            self._items.append(label_item)

            index += 1

        self._actived_item = None
        self._command = command

        self.bind("<Up>", self._on_up)
        self.bind("<Down>", self._on_down)
        self.bind("<Return>", self._on_return)
Exemple #26
0
 def xgc_hseparator(self, parent, node):
     return Separator(parent, orient=HORIZONTAL)
Exemple #27
0
 def xgc_vseparator(self, parent, node):
     return Separator(parent, orient=VERTICAL)
    def __init__(self, parent, txt=dict(), dicogis_path="../../"):
        """Instanciating the output workbook."""
        self.parent = parent
        Frame.__init__(self)

        # ## GLOBAL ##
        self.app_metrics = StringVar(self)
        self.oc_msg = StringVar(self)
        self.url_input = StringVar(self)

        # logo
        ico_path = path.normpath(path.join(path.abspath(dicogis_path),
                             "data/img/logo_isogeo.gif"))
        self.logo_isogeo = PhotoImage(master=self,
                                      file=ico_path)
        logo_isogeo = Label(self, borderwidth=2, image=self.logo_isogeo)

        # metrics
        self.app_metrics.set("{} metadata in\n"
                             "{} shares owned by\n"
                             "{} workgroups."
                             .format(10,
                                     1,
                                     2))
        lb_app_metrics = Label(self,
                               textvariable=self.app_metrics)

        # # OpenCatalog check
        # self.lb_input_oc = Label(self,
        #                          textvariable=self.oc_msg)

        # if len(self.shares_info[2]) != 0:
        #     logger.error("Any OpenCatalog found among the shares")
        #     self.oc_msg.set(_("{} shares don't have any OpenCatalog."
        #                       "\nAdd OpenCatalog to every share,"
        #                       "\nthen reboot isogeo2office.").format(len(self.shares_info[2])))
        #     self.msg_bar.set(_("Error: some shares don't have OpenCatalog"
        #                        "activated. Fix it first."))
        #     self.status_bar.config(foreground='Red')
        #     btn_open_shares = Button(self,
        #                              text=_("Fix the shares"),
        #                              command=lambda: self.utils.open_urls(self.shares_info[2]))
        #     status_launch = DISABLED
        # elif len(self.shares) != len(self.shares_info[1]):
        #     logger.error("More than one share by workgroup")
        #     self.oc_msg.set(_("Too much shares by workgroup."
        #                       "\nPlease red button to fix it"
        #                       "\nthen reboot isogeo2office.")
        #                     .format(len(self.shares) - len(self.shares_info[1])))
        #     self.msg_bar.set(_("Error: more than one share by worgroup."
        #                        " Click on Admin button to fix it."))
        #     self.status_bar.config(foreground='Red')
        #     btn_open_shares = Button(self,
        #                              text=_("Fix the shares"),
        #                              command=lambda: self.utils.open_urls(self.shares_info[3]),
        #                              style="Error.TButton")
        #     status_launch = DISABLED
        # else:
        #     logger.info("All shares have an OpenCatalog")
        #     self.oc_msg.set(_("Configuration OK."))
        #     li_oc = [share[3] for share in self.shares_info[0]]
        #     btn_open_shares = Button(self,
        #                              text="\U00002692 " + _("Admin shares"),
        #                              command=lambda: self.utils.open_urls(li_oc))
        #     status_launch = ACTIVE

        # # settings
        # txt = _(u"Settings")
        # btn_settings = Button(self,
        #                       text=str("\U0001F510 {}") + _(u"Settings"),
        #                       command=lambda: self.ui_settings_prompt())

        # griding widgets
        logo_isogeo.grid(row=1, rowspan=3,
                         column=0, padx=2,
                         pady=2, sticky="W")
        Separator(self, orient=VERTICAL).grid(row=1, rowspan=3,
                                              column=1, padx=2,
                                              pady=2, sticky="NSE")
        lb_app_metrics.grid(row=1, column=2, rowspan=3, sticky="NWE")
Exemple #29
0
    def createFrame(self, root):
        'Creates main frame and data input field.'
        self.frame = Frame(root)
        self.frame.pack()
        self.frame.config(background="#dcdcdc")  #well, it has to be, right?

        #self.frame.geometry('600x800')
        message = Message(self.frame,
                          text="\n" + rantest.RTINTROD,
                          justify=LEFT,
                          padx=10,
                          width=500,
                          font=("Helvetica", 12),
                          bg="#dcdcdc")
        message.grid(row=0, column=0, rowspan=6, columnspan=2, sticky=W)

        s = Separator(self.frame, orient=HORIZONTAL)
        s.grid(columnspan=2, sticky=EW)

        Label(self.frame,
              text="Please select the data source:",
              justify=LEFT,
              bg="#dcdcdc").grid(row=15, column=0, padx=10, sticky=W)
        Label(
            self.frame,
            text=
            "The calculation will proceed automatically with\n the default number of randomisations (5000).\n\nUse [Repeat Calculation] for more repetitions\n(e.g. to estimate P < 0.001)",
            font=("Helvetica", 12),
            justify=LEFT,
            bg="#dcdcdc").grid(row=15, column=1, rowspan=4, sticky=S)
        self.b1 = Button(self.frame,
                         text="Input data manually",
                         command=self.callback1,
                         highlightbackground="#dcdcdc").grid(row=18,
                                                             column=0,
                                                             sticky=W,
                                                             padx=30)
        self.b2 = Button(self.frame,
                         text="Generic .txt file",
                         command=self.callback2,
                         highlightbackground="#dcdcdc").grid(row=17,
                                                             column=0,
                                                             sticky=W,
                                                             padx=30)
        self.b3 = Button(self.frame,
                         text="Excel Tab-delimited.txt file",
                         command=self.callback3,
                         highlightbackground="#dcdcdc").grid(row=16,
                                                             column=0,
                                                             sticky=W,
                                                             padx=30)

        Label(self.frame, text="Number of randomisations:",
              bg="#dcdcdc").grid(row=22, column=0, padx=30, pady=5, sticky=W)
        #default number of randomizations is 5000
        self.e5 = Entry(self.frame,
                        justify=CENTER,
                        width=12,
                        highlightbackground="#dcdcdc")
        self.e5.grid(row=22, column=1, sticky=W, pady=5)
        self.e5.insert(END, '5000')

        #checkbox for doing a paired test
        self.var1 = IntVar()
        text1 = "Paired test?"
        self.paired = False
        # Callback is not triggered if checkbox is never touched
        # Hence self.paired is set to zero above.
        c1 = Checkbutton(self.frame,
                         text=text1,
                         variable=self.var1,
                         command=self.callback_paired,
                         bg="#dcdcdc").grid(row=23,
                                            column=0,
                                            padx=30,
                                            pady=5,
                                            sticky=W)

        #checkbox to do bootstrap confidence intervals for Hedges' d
        ###Not implemented yet so check button is disabled
        ###Simple CI are calculated until bootstrap is implemented
        self.var2 = IntVar()
        hedges = "Calculate exact confidence intervals for Hedge's d?"
        self.H_CI = 0
        # Callback will not be triggered if checkbox is never touched
        # Hence self.H_CI is set to zero above.
        c2 = Checkbutton(self.frame,
                         text=hedges,
                         state=DISABLED,
                         variable=self.var2,
                         command=self.callback_hedges,
                         bg="#dcdcdc").grid(row=23,
                                            column=1,
                                            padx=30,
                                            pady=5,
                                            sticky=W)

        self.txt = Text(self.frame)
        self.txt.grid(row=25, column=0, columnspan=4, padx=10)
        self.txt.config(width=75, height=25, font=("Courier", "12"))
        self.txt.insert(END, "Results will appear here")

        #both these buttons are ungreyed after results are displayed.
        #Label(self.frame, text="").grid(row=(26), column=0, columnspan=4)
        self.b4 = Button(self.frame,
                         text="Repeat calculation",
                         state=DISABLED,
                         command=self.callback4,
                         highlightbackground="#dcdcdc")
        self.b4.grid(row=27, padx=40, pady=10, column=0, sticky=E)
        self.b5 = Button(self.frame,
                         text="Plot Distribution",
                         state=DISABLED,
                         command=self.callback5,
                         highlightbackground="#dcdcdc")
        self.b5.grid(row=27, padx=40, pady=10, column=1, sticky=W)
    def createFrame(self, root):
        'Creates main frame and data input field.'
        frame = Frame(root)
        frame.pack()
        frame.config(background="#dcdcdc")  #well, it has to be, right?
        #frame.geometry('480x700')

        message = Message(frame,
                          width=420,
                          text="\n" + RantestBinomial.introd,
                          font=("Helvetica", 12),
                          background="#dcdcdc")
        message.grid(row=0, column=0, rowspan=15, columnspan=4)
        s = Separator(frame, orient=HORIZONTAL)
        s.grid(columnspan=4, sticky=EW)

        frame_s1 = LabelFrame(frame, text="Sample 1", background="#dcdcdc")
        frame_s1.grid(row=16, rowspan=3, columnspan=4, padx=20, sticky=W)
        Label(frame_s1, text="Successes:", background="#dcdcdc").grid(row=0,
                                                                      column=0,
                                                                      padx=10,
                                                                      pady=10)
        Label(frame_s1, text="Failures:", background="#dcdcdc").grid(row=0,
                                                                     column=2,
                                                                     pady=10)

        frame_s2 = LabelFrame(frame, text="Sample 2", background="#dcdcdc")
        frame_s2.grid(row=20, rowspan=3, columnspan=4, padx=20, sticky=W)
        Label(frame_s2, text="Successes:", background="#dcdcdc").grid(row=0,
                                                                      column=0,
                                                                      padx=10,
                                                                      pady=10,
                                                                      sticky=E)
        Label(frame_s2, text="Failures:", background="#dcdcdc").grid(row=0,
                                                                     column=2,
                                                                     pady=10)

        e = []
        e1 = Entry(frame_s1, justify=CENTER, width=10)
        e1.grid(row=0, column=1, padx=10)
        e1.insert(END, '3')
        e.append(e1)

        e2 = Entry(frame_s1, justify=CENTER, width=10)
        e2.grid(row=0, column=3, padx=20)
        e2.insert(END, '4')
        e.append(e2)

        e3 = Entry(frame_s2, justify=CENTER, width=10)
        e3.grid(row=0, column=1, padx=10)
        e3.insert(END, '4')
        e.append(e3)

        e4 = Entry(frame_s2, justify=CENTER, width=10)
        e4.grid(row=0, column=3, padx=20)
        e4.insert(END, '5')
        e.append(e4)

        #Label(frame, text="").grid(row=23, column=0, columnspan=2)
        Label(frame, text="Number of randomisations:",
              background="#dcdcdc").grid(row=24,
                                         column=0,
                                         columnspan=3,
                                         pady=5)

        e5 = Entry(frame, justify=CENTER, width=15)
        e5.grid(row=24, column=3, pady=5, sticky=W)
        e5.insert(END, '5000')
        e.append(e5)

        #Label(frame, text="").grid(row=25, column=0, columnspan=2)
        b1 = Button(frame,
                    text="Calculate",
                    command=self.calback1,
                    highlightbackground="#dcdcdc").grid(row=26,
                                                        columnspan=4,
                                                        pady=5)
        #Label(frame, text="").grid(row=27, column=0, columnspan=4)

        txt = Text(frame)
        txt.grid(row=28, column=0, columnspan=4)
        txt.config(width=64, height=18, font=("Courier", "12"))
        txt.insert(END, "Results will appear here")

        #Label(frame, text="").grid(row=29, column=0, columnspan=4)
        b3 = Button(frame,
                    text="Plot Distribution",
                    command=self.calback2,
                    highlightbackground="#dcdcdc").grid(row=40,
                                                        columnspan=4,
                                                        pady=10)
        #Label(frame, text="").grid(row=30, column=0, columnspan=4)

        self.frame = frame
        self.e = e
        self.txt = txt
Exemple #31
0
 def home(self):
     """
 Initialize main window.
 """
     #Configured NS info frame
     nsFrame = Frame(self.window, relief="groove", borderwidth=1)
     Label(nsFrame, text="Configured nameservers:", height=2,
           anchor='w').grid(row=0, sticky="nsew")
     Label(nsFrame, textvariable=self.nsListStr,
           relief="sunken").grid(row=1, sticky="nsew")
     nsFrame.pack(side=TOP, fill=X, padx=20, pady=10, ipadx=20, ipady=5)
     Separator(self.window, orient="horizontal").pack(side=TOP,
                                                      padx=20,
                                                      fill=X)
     #Runtime params frame
     nsFrame = Frame(self.window, relief="groove", borderwidth=1)
     Label(nsFrame, text="Runtime configurations:", height=2,
           anchor='w').grid(row=0, sticky="nsew")
     Label(nsFrame, text="Play mode:").grid(row=1, column=0)
     OptionMenu(nsFrame, self.playModeStr, *PLAY_MODES).grid(row=1,
                                                             column=1)
     Separator(nsFrame, orient="vertical").grid(row=1,
                                                column=2,
                                                sticky="ns",
                                                padx=20)
     Label(nsFrame, text="Interface:").grid(row=1, column=3)
     OptionMenu(nsFrame, self.netInterfaceStr,
                *NET_INTERFACES).grid(row=1, column=4)
     Separator(nsFrame, orient="vertical").grid(row=1,
                                                column=5,
                                                sticky="ns",
                                                padx=20)
     Label(nsFrame, text="Service:").grid(row=1, column=6)
     OptionMenu(nsFrame, self.servicePortsStr,
                *NET_PORTS.keys()).grid(row=1, column=7)
     Separator(nsFrame, orient="vertical").grid(row=1,
                                                column=8,
                                                sticky="ns",
                                                padx=20)
     Label(nsFrame, text="Debug level:").grid(row=1, column=9)
     OptionMenu(nsFrame, self.debugLevelStr, *DEBUG_LEVELS).grid(row=1,
                                                                 column=10)
     nsFrame.pack(side=TOP, fill=X, padx=20, pady=10, ipadx=20, ipady=5)
     Separator(nsFrame, orient="vertical").grid(row=2,
                                                column=2,
                                                sticky="ns",
                                                padx=20)
     Label(nsFrame, text="Max datagram bytes to copy:").grid(row=2,
                                                             column=3)
     Entry(nsFrame,
           width=5,
           text=self.pktCopyMaxSize.get(),
           textvariable=self.pktCopyMaxSize).grid(row=2, column=4)
     Separator(nsFrame, orient="vertical").grid(row=2,
                                                column=5,
                                                sticky="ns",
                                                padx=20)
     nsFrame.pack(side=TOP, fill=X, padx=20, pady=10, ipadx=20, ipady=5)
     Separator(self.window, orient="horizontal").pack(side=TOP,
                                                      padx=20,
                                                      fill=X)
     #filter daemon status frame
     statusFrame = Frame(self.window)
     Label(statusFrame, text="DNS filter status:", height=2,
           anchor='w').grid(row=0, column=0)
     Label(statusFrame, textvariable=self.filterStatusStr).grid(row=0,
                                                                column=1)
     Button(statusFrame,
            textvariable=self.filterControlButStr,
            command=self.changeFilterStatus).grid(row=1, column=0, sticky=W)
     statusFrame.pack(side=TOP, fill=X, padx=20, pady=10, ipadx=20, ipady=5)
     Separator(self.window, orient="horizontal").pack(side=TOP,
                                                      padx=20,
                                                      fill=X)
     #model files frame
     modelFrame = Frame(self.window)
     Label(modelFrame,
           text="Model tags: [{}]".format(configs["model_tags"]),
           height=2,
           anchor='w').grid(row=0, sticky="nsew")
     Label(modelFrame, text="Model configuration", height=2).grid(row=1,
                                                                  sticky=W)
     self.modelConfigFrame(modelFrame).grid(row=2, columnspan=2, sticky=W)
     modelFrame.pack(side=TOP, fill=X, padx=20, pady=10, ipadx=20, ipady=5)
     Separator(self.window, orient="horizontal").pack(side=TOP,
                                                      padx=20,
                                                      fill=X)
     #web report client frame
     reportClientFrame = Frame(self.window)
     Label(reportClientFrame,
           text="Realtime report client status:",
           height=2,
           anchor='w').grid(row=0, column=0)
     Label(reportClientFrame,
           textvariable=self.reportClientStatusStr).grid(row=0, column=1)
     self.reportServerBut = Button(
         reportClientFrame,
         textvariable=self.reportClientControlButStr,
         command=self.changeReportClientStatus,
         state=self.getButtonStateForBool(self.mainDaemonAlive))
     self.reportServerBut.grid(row=1, column=0, sticky=W)
     reportClientFrame.pack(side=TOP,
                            fill=X,
                            padx=20,
                            pady=10,
                            ipadx=20,
                            ipady=5)
     Separator(self.window, orient="horizontal").pack(side=TOP,
                                                      padx=20,
                                                      fill=X)
     #Refresh status frame
     reloadFrame = Frame(self.window)
     Button(reloadFrame, text="Reload",
            command=self.getDaemonStatus).grid(row=0, column=1, sticky=E)
     reloadFrame.pack(side=TOP, fill=X, padx=20, pady=10, ipadx=20, ipady=5)
     Separator(self.window, orient="horizontal").pack(side=TOP,
                                                      padx=20,
                                                      fill=X)
     return
Exemple #32
0
 def add_separator(self, row, padx=7, pady=7):
     s = Separator(self, orient=HORIZONTAL)
     s.grid(row=row, columnspan=3, padx=padx, pady=pady, sticky=(W, E))