コード例 #1
0
    def initUI(self):
        
        photo = ImageTk.PhotoImage(file='icon/main_bg_4.jpg')
        w = Tkinter.Label(self,image=photo)
        w.photo = photo 
        w.place(x=0, y=0, relwidth=1, relheight=1)
        #ackground_label.pack()
        
        
        self.api = IntVar()
        self.parent.title("Face Recognition System")
        self.style = Style()
        self.style.theme_use("default")

        self.pack(fill=BOTH, expand=1)
        
        faceplus = Radiobutton(self, text="Face++", variable=self.api, value=1)
        faceplus.place(x=50, y=40)
        
        facer = Radiobutton(self, text="FaceR Animetrics", variable=self.api, value=2)
        facer.place(x=200, y=40)

        start = Button(self, text="Start Recognition",
            command=self.startRecognition)
        start.place(x=100, y=80)
        
        helpButton = Button(self, text="Help",
            command=self.giveHelp)
        helpButton.place(x=100, y=110)
    
        quitButton = Button(self, text="Quit",
            command=self.quitGUI)
        quitButton.place(x=100, y=140)
コード例 #2
0
    def body(self, parent):
        self.tkVar = IntVar()
        self.tkVar.set(-1)
        tkRb1 = Radiobutton(parent,
                            text="QT Console",
                            variable=self.tkVar,
                            value=0,
                            command=self.radio_select)
        tkRb1.grid(row=0)
        tkRb2 = Radiobutton(parent,
                            text="Notebook",
                            variable=self.tkVar,
                            value=1,
                            command=self.radio_select)
        tkRb2.grid(row=1)

        self.tkDir = StringVar()
        self.tkDir.set(self.settings.notebook_dir)
        self.tkDirEntry = Entry(parent,
                                textvariable=self.tkDir,
                                state="disabled")
        self.tkDirEntry.grid(row=2, column=0)
        self.tkBrowseButton = Button(parent,
                                     text="Browse",
                                     state="disabled",
                                     command=self.get_directory)
        self.tkBrowseButton.grid(row=2, column=1)
コード例 #3
0
            def __init__(self, container, frame, label='', text='', row=0, column=0):
                self.container = container
                self.is_b0 = BooleanVar(container.parent)
                self.is_dw = BooleanVar(container.parent)
                self.column = column
                self.direction = StringVar(container.parent)

                self.label_from = Label(frame, text='from')
                self.text_from = Entry(frame)
                self.text_from.insert(0, text)
                self.button_file_from = Button(frame, text='...', command=lambda:filenameDialog_text(self.text_from))
                self.button_rm = Button(frame, text='remove', command=self.click_remove)
                self.radio_ap = Radiobutton(frame, text='AP', variable=self.direction, value='AP', command=self.set_direction)
                self.radio_pa = Radiobutton(frame, text='PA', variable=self.direction, value='PA', command=self.set_direction)

                self.label_to = Label(frame, text='to')
                self.text_to = Entry(frame)
                #self.text_to.insert(0, text)
                self.button_file_to = Button(frame, text='Gen', command=self.set_filename_to)
                self.check_b0 = Checkbutton(frame, text='B0',   variable=self.is_b0)
                self.check_dw = Checkbutton(frame, text='DWI',  variable=self.is_dw)

                self.button_up = Button(frame, text='up', width=3, command=self.click_up)
                self.button_dn = Button(frame, text='down', width=3, command=self.click_dn)

                self.row = -1
                self.change_row(row)
                if text != '':
                    self.set_appa()
                    self.set_filename_to()
コード例 #4
0
ファイル: process.py プロジェクト: Letris/Final_stroke
    def setup_radio_buttons(self):
        '''add atemporal vs temporal choice part'''
        dct = self.user_input

        temporal_processing_flag = BooleanVar()

        # get context dependent frame (regular)
        regular = Raw2Attributes()
        regular_frame = regular.make_frame(self)
        reg_button = Radiobutton(self,
                                 text='raw2attributes',
                                 value=False,
                                 variable=temporal_processing_flag)
        reg_button.grid(row=12, column=0, sticky=W)

        # get context dependent frame (temporal)
        temporal = Raw2Patterns()
        temporal_frame = temporal.make_frame(self)
        tmprl_button = Radiobutton(self,
                                   text='raw2patterns',
                                   value=True,
                                   variable=temporal_processing_flag)
        tmprl_button.grid(row=12, column=1, sticky=W)

        # configure events, invoke one by default
        reg_button.configure(
            command=lambda: self.set_frame(regular_frame, temporal_frame))
        tmprl_button.configure(
            command=lambda: self.set_frame(temporal_frame, regular_frame))
        reg_button.invoke()  # default

        dct['process_temporal'] = temporal_processing_flag
        dct['a-temporal_specific'] = regular.get_values()
        dct['temporal_specific'] = temporal.get_values()
コード例 #5
0
    def initUI(self):

        var = IntVar()

        #General stuff
        self.parent.title("I2C Command Manager")
        self.style = Style()
        self.style.theme_use("default")
        #self.pack(fill=BOTH, expand=1)
        self.parent.configure(background=Constants.BG_COL)

        s = Style()
        s.configure('C.TRadiobutton', background=Constants.BG_COL)

        #Quit button
        quitButton = Button(self.parent, text="Quit", command=self.quit)
        quitButton.place(x=Constants.QUIT_X, y=Constants.QUIT_Y)

        #Radiobuttons
        ledRadio = Radiobutton(
            self.parent,
            text="LED Strip",
            variable=var,
            value=1,
            command=lambda: self.instructor.setAddress(0x04),
            style='C.TRadiobutton')
        vertRadio = Radiobutton(
            self.parent,
            text="Vertical Motion",
            variable=var,
            value=2,
            command=lambda: self.instructor.setAddress(0x06),
            style='C.TRadiobutton')
        ledRadio.place(x=Constants.LED_X, y=Constants.LED_Y)
        vertRadio.place(x=Constants.VERT_X, y=Constants.VERT_Y)
        #ledRadio.configure(background = Constants.BG_COL)

        #Label
        sendLabel = Label(self.parent,
                          text="Enter command:",
                          background=Constants.BG_COL)
        sendLabel.place(x=Constants.SENDL_X, y=Constants.SENDL_Y)

        #Address label
        adLabel = Label(self.parent,
                        text="Select address:",
                        background=Constants.BG_COL)
        adLabel.place(x=Constants.ADL_X, y=Constants.ADL_Y)

        #Text entry box
        textBox = Entry(self.parent, bd=2, width=Constants.TEXT_W)
        textBox.place(x=Constants.TEXT_X, y=Constants.TEXT_Y)

        #Send command button
        sendButton = Button(self.parent,
                            text="Send",
                            command=lambda: self.assignCommand(textBox.get()))
        sendButton.place(x=Constants.SENDB_X, y=Constants.SENDB_Y)
コード例 #6
0
    def __init__(self, master):
        self.master = master
        master.title("Convert SPC files")

        mf = Frame(master, padding="10")
        mf.grid(column=0, row=0, sticky=(N, W, E, S))
        mf.columnconfigure(0, weight=1)
        mf.rowconfigure(0, weight=1)
        self.message = "Enter folder containing *.SPC files"
        self.label_text = StringVar()
        self.folder = StringVar()
        self.output_fmt = StringVar()

        self.label_text.set(self.message)

        self.label = Label(mf, textvariable=self.label_text)
        self.folder_label = Label(mf, text="Folder")
        self.output_fmt_label = Label(mf, text="Output Format")

        self.fmt_txt = Radiobutton(mf, text="TXT", variable=self.output_fmt, value='txt')
        self.fmt_csv = Radiobutton(mf, text="CSV", variable=self.output_fmt, value='csv')
        self.folder_entry = Entry(mf, textvariable=self.folder)

        self.sel_foler = Button(mf, text="Browse", command=self.ask_dir)
        self.convert_btn = Button(mf, text="Convert", command=self.convert)

        # map on grid
        self.label.grid(row=0, column=0, columnspan=4, sticky=W + E)
        self.folder_label.grid(row=1, column=0, sticky=E)
        self.output_fmt_label.grid(row=2, column=0, sticky=E)
        self.folder_entry.grid(row=1, column=1, columnspan=2, sticky=W + E)
        self.fmt_txt.grid(row=2, column=1, sticky=W)
        self.fmt_csv.grid(row=2, column=2, sticky=W)
        self.sel_foler.grid(row=1, column=3, sticky=W)
        self.convert_btn.grid(row=3, column=1, columnspan=2, sticky=W + E)

        for child in mf.winfo_children():
            child.grid_configure(padx=5, pady=5)
コード例 #7
0
ファイル: pySAD.py プロジェクト: AlbMA/PySAD
    def initUI(self):

        self.initText()

        self.parent.title("PySAD")
        self.style = Style()
        self.style.theme_use("clam")

        self.pack(fill=BOTH, expand=1)

        barraLateral = Frame(self, borderwidth=1)
        barraLateral.pack(side=RIGHT, padx=5, pady=5)

        idiomaFrame = Frame(barraLateral, relief=FLAT)
        idiomaFrame.pack(side=TOP)

        self.espButton = Button(idiomaFrame,
                                text="es",
                                width=0,
                                command=lambda: self.updateText(0))
        self.espButton.grid(row=0, column=0)
        self.engButton = Button(idiomaFrame,
                                text="en",
                                width=0,
                                command=lambda: self.updateText(1))
        self.engButton.grid(row=0, column=1)

        self.updateText(0)

        editarFrame = Frame(barraLateral,
                            relief=RAISED,
                            borderwidth=1,
                            width=1000)
        editarFrame.pack(fill=BOTH, expand=1, side=TOP, padx=5, pady=5)

        self.tipoCurva = IntVar()

        tituloSelector = Label(editarFrame, textvariable=self.curTip)
        tituloSelector.grid(row=0, columnspan=2, padx=2, pady=4)
        Radiobutton(editarFrame,
                    textvariable=self.ArcSpi,
                    variable=self.tipoCurva,
                    value=1,
                    command=self.cambiaFormula,
                    width=17).grid(row=1, columnspan=2, sticky=W, padx=4)
        Radiobutton(editarFrame,
                    textvariable=self.LogSpi,
                    variable=self.tipoCurva,
                    value=2,
                    command=self.cambiaFormula).grid(row=2,
                                                     columnspan=2,
                                                     sticky=W,
                                                     padx=4)

        self.formulaLabel = Label(editarFrame)
        self.formulaLabel.grid(row=4, columnspan=2, pady=4)

        Label(editarFrame, textvariable=self.aaa).grid(row=5, column=0, pady=2)
        Label(editarFrame, textvariable=self.bbb).grid(row=6, column=0, pady=2)
        self.labelC = Label(editarFrame, textvariable=self.ccc)
        self.labelC.grid(row=7, column=0, pady=2)
        self.labelC.config(state=DISABLED)
        Label(editarFrame, textvariable=self.Lma).grid(row=8, column=0, pady=2)
        Label(editarFrame, textvariable=self.fre).grid(row=9, column=0, pady=2)

        parA = Entry(editarFrame, width=4, textvariable=self.a)
        parA.grid(row=5, column=1, sticky=W)

        parB = Entry(editarFrame, width=4, textvariable=self.b)
        parB.grid(row=6, column=1, sticky=W)

        self.parC = Entry(editarFrame, width=4, textvariable=self.c)
        self.parC.grid(row=7, column=1, sticky=W)
        self.parC.config(state=DISABLED)

        lMax = Entry(editarFrame, width=4, textvariable=self.lMax)
        lMax.grid(row=8, column=1, sticky=W)
        self.createToolTip(lMax, self.stringText['LmaToo'])

        frec = Entry(editarFrame, width=4, textvariable=self.frec)
        frec.grid(row=9, column=1, sticky=W)
        self.createToolTip(frec, self.stringText['FreToo'])

        self.espejar = IntVar()
        checkEspejar = Checkbutton(editarFrame,
                                   textvariable=self.Mir,
                                   variable=self.espejar,
                                   command=self.activarFuente)
        checkEspejar.grid(row=10, columnspan=2, pady=2, sticky=W, padx=4)
        self.createToolTip(checkEspejar, self.stringText['MirToo'])

        self.fuente = IntVar()
        self.checkFuente = Checkbutton(editarFrame,
                                       textvariable=self.Sou,
                                       state=DISABLED,
                                       variable=self.fuente)
        self.checkFuente.grid(row=11, columnspan=2, pady=2, sticky=W, padx=4)
        self.createToolTip(self.checkFuente, self.stringText['SouToo'])

        okButton = Button(editarFrame,
                          textvariable=self.Gen,
                          command=self.regraficar)
        okButton.grid(row=12, columnspan=2, pady=5)
        self.createToolTip(okButton, self.stringText['GenToo'])

        self.frame2 = Frame(self, borderwidth=1)
        self.frame2.pack(fill=BOTH, expand=1, side=LEFT, padx=5, pady=5)

        self.canvas = FigureCanvasTkAgg(self.f, master=self.frame2)
        self.canvas.get_tk_widget().pack(side=TOP,
                                         fill=BOTH,
                                         expand=1,
                                         padx=10,
                                         pady=10)

        frameGuardar = Frame(barraLateral, relief=FLAT, borderwidth=1)
        frameGuardar.pack(fill=BOTH, expand=1, side=BOTTOM, padx=5, pady=5)

        icGuardar = PhotoImage(
            data=
            '''R0lGODlhEAAQAIABADMzM////yH5BAEKAAEALAAAAAAQABAAAAIlDI55wchvQJQOxontUktTbkHcSJZkGCao161N5U5SLNM1vZlOAQA7'''
        )
        saveButtonNEC = Button(frameGuardar,
                               text=self.stringText['NEC'][0],
                               image=icGuardar,
                               compound=LEFT,
                               command=self.escribirFichero,
                               width=3)
        saveButtonNEC.image = icGuardar
        saveButtonNEC.grid(row=0, column=0, pady=2, padx=2, sticky=W)
        self.createToolTip(saveButtonNEC, self.stringText['NECToo'])

        saveButtonPDF = Button(frameGuardar,
                               text=self.stringText['PDF'][0],
                               image=icGuardar,
                               compound=LEFT,
                               command=self.escribirPDF,
                               width=3)
        saveButtonPDF.image = icGuardar
        saveButtonPDF.grid(row=0, column=2, pady=2, padx=2, sticky=E)
        self.createToolTip(saveButtonPDF, self.stringText['PDFToo'])

        self.helpButton = Button(frameGuardar,
                                 text="?",
                                 command=self.mostrarAyuda,
                                 width=2)
        self.helpButton.grid(row=0, column=3, pady=2, padx=2, sticky=E)

        frame3 = Frame(barraLateral, relief=RAISED, borderwidth=1)
        frame3.pack(fill=BOTH, expand=1, side=BOTTOM, padx=5, pady=5)

        Label(frame3, textvariable=self.lenlen).grid(row=1,
                                                     column=0,
                                                     pady=4,
                                                     padx=12)
        Label(frame3, textvariable=self.radrad).grid(row=2,
                                                     column=0,
                                                     pady=4,
                                                     padx=12)
        Label(frame3, textvariable=self.StringLongitud).grid(row=1,
                                                             column=1,
                                                             pady=4)
        Label(frame3, textvariable=self.StringRadio).grid(row=2,
                                                          column=1,
                                                          pady=4)
コード例 #8
0
    def initUI(self):
        self.title("LMS8001-PLL-VCO Model Definition")

        self.style = Style()
        self.style.theme_use("default")

        self.columnconfigure(0, pad=1)
        self.columnconfigure(1, pad=1)
        self.columnconfigure(2, pad=1)
        #self.columnconfigure(3, pad=1, weight=1)

        self.rowconfigure(0, pad=10)
        self.rowconfigure(1, pad=1, weight=1)
        self.rowconfigure(2, pad=1, weight=1)
        self.rowconfigure(3, pad=15, weight=1)
        self.rowconfigure(4, pad=1, weight=1)

        self.VCO_EM = BooleanVar()
        self.VCO_EM.set(self.parent.VCO_EM.get())
        self.cbox_vco_em = Checkbutton(self,
                                       text='Use EM (RLCK) VCO Model',
                                       onvalue=1,
                                       offvalue=0,
                                       variable=self.VCO_EM,
                                       command=self.on_VCO_EM)
        self.cbox_vco_em.grid(row=0, column=0, columnspan=3, sticky=W)

        self.radio_fvco = IntVar()
        self.radio_fvco.set(int(self.parent.VCO_MEAS_FREQ.get()))
        self.radio_fvco_meas = Radiobutton(
            self,
            text='Use Measured VCO Frequency Values in Analysis',
            variable=self.radio_fvco,
            value=1)
        self.radio_fvco_meas.grid(row=1,
                                  column=0,
                                  columnspan=2,
                                  padx=15,
                                  sticky=W + N)
        self.radio_fvco_sim = Radiobutton(
            self,
            text='Use Simulated VCO Frequency Values in Analysis',
            variable=self.radio_fvco,
            value=0)
        self.radio_fvco_sim.grid(row=2,
                                 column=0,
                                 columnspan=2,
                                 padx=15,
                                 sticky=W + N)

        buttonFreq = Button(self,
                            text='Plot Freq',
                            command=self.on_FREQ,
                            width=10)
        buttonFreq.grid(row=3, column=0, sticky=W + E)

        buttonKVCO = Button(self,
                            text='Plot KVCO',
                            command=self.on_KVCO,
                            width=10)
        buttonKVCO.grid(row=3, column=1, sticky=W + E)

        buttonFSTEP = Button(self,
                             text='Plot FSTEP',
                             command=self.on_FSTEP,
                             width=17)
        buttonFSTEP.grid(row=3, column=2, sticky=W + E)

        buttonOK = Button(self, text='OK', command=self.on_OK, width=10)
        buttonOK.grid(row=4, column=0, sticky=W + E)

        buttonQuit = Button(self, text='Quit', command=self.on_Quit, width=17)
        buttonQuit.grid(row=4, column=2, sticky=W + E)

        buttonApply = Button(self,
                             text='Apply',
                             command=self.on_Apply,
                             width=10)
        buttonApply.grid(row=4, column=1, sticky=W + E)

        self.on_VCO_EM()
コード例 #9
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)
コード例 #10
0
    def __init__(self):
        Frame.__init__(self)
        self.style = Style()
        self.style.theme_use("default")
        self.master.title("Log viewer")
        self.pack(fill=BOTH, expand=True)

        self.used = []  # List of currently plotted series ([str])
        self.series = {}  # List of all series ({str -> [number]})
        self.names = []  # List of all nodes in tree view ([str])
        self.queues = [] # List of all queues ([str])
        self.logs = {} # List of all text logs ({str -> [str]})

        self.rowconfigure(1, weight=1)
        self.columnconfigure(6, weight=3)
        self.columnconfigure(11, weight=1)

        # Series selection takes row 1-2, col 0-2
        self.series_ui = Treeview(self)
        self.series_ui.grid(row=1, column=0, columnspan=2, rowspan=2, sticky=N+S)
        self.series_ui.configure(show="tree")
        self.series_ui.bind("<Double-Button-1>", self.onselect)
        self.series_ui.tag_configure("graphall", foreground="#070")
        self.series_ui.tag_configure("graphnone", foreground="#000")
        self.series_ui.tag_configure("graphsome", foreground="#007")
        series_ui_scroll = Scrollbar(self, command=self.series_ui.yview, orient=VERTICAL)
        series_ui_scroll.grid(row=1, column=2, rowspan=2, sticky=N+S)
        self.series_ui["yscrollcommand"] = series_ui_scroll.set

        # The plot takes row 1-2, col 3-6
        move_mode = StringVar()
        move_mode.set("pan")
        show_path = IntVar()
        show_path.set(0)
        event_bars = IntVar()
        event_bars.set(1)
        show_debug = IntVar()
        show_debug.set(1)
        show_error = IntVar()
        show_error.set(1)
        show_warning = IntVar()
        show_warning.set(1)
        show_info = IntVar()
        show_info.set(1)
        self.plot = HackPlot(self, move_mode, show_path, event_bars,
                [(show_debug, "[DEBUG]"), (show_error, "[ERROR]"), (show_warning, "[WARNING]"), (show_info, "[INFO]")])
        self.plot.canvas.grid(row=1, column=3, columnspan=4, rowspan=2, sticky=N+S+E+W)
        # Text logs take row 1-2, col 7-12
        self.plot.listbox.grid(row=1, column=7, columnspan=5, sticky=N+S+E+W)
        listbox_yscroll = Scrollbar(self, command=self.plot.listbox.yview, orient=VERTICAL)
        listbox_yscroll.grid(row=1, column=12, sticky=N+S)
        self.plot.listbox["yscrollcommand"] = listbox_yscroll.set
        listbox_xscroll = Scrollbar(self, command=self.plot.listbox.xview, orient=HORIZONTAL)
        listbox_xscroll.grid(row=2, column=7, columnspan=5, sticky=E+W)
        self.plot.listbox["xscrollcommand"] = listbox_xscroll.set


        # Controls take row 0, col 0-12
        Button(self, text="Load Directory", command=self.loaddir).grid(row=0, column=0)
        Button(self, text="Load File", command=self.loadfile).grid(row=0, column=1)
        Button(self, text="Fit X", command=self.plot.fit_x).grid(row=0, column=3, sticky=W)
        Button(self, text="Fit Y", command=self.plot.fit_y).grid(row=0, column=4, sticky=W)
        Button(self, text="Fit Auto", command=self.plot.fit_auto).grid(row=0, column=5, sticky=W)
        Button(self, text="Fit Tele", command=self.plot.fit_tele).grid(row=0, column=6, sticky=W)
        # Plot controls in a subframe to manage padding so it doesn't look awful
        move_mode_control = Frame(self, padx=10)
        Radiobutton(move_mode_control, text="Pan", value="pan", variable=move_mode).grid(row=0, column=0, sticky=W)
        Radiobutton(move_mode_control, text="Zoom In", value="zoomin", variable=move_mode).grid(row=0, column=1, sticky=W)
        Radiobutton(move_mode_control, text="Zoom Out", value="zoomout", variable=move_mode).grid(row=0, column=2, sticky=W)
        move_mode_control.grid(row=0, column=7, sticky=W)
        Checkbutton(self, text="Event Bars", variable=event_bars, command=self.plot.show_textlogs).grid(row=0, column=8, sticky=W)
        Checkbutton(self, text="Debug", variable=show_debug, command=self.plot.show_textlogs).grid(row=0, column=9, sticky=W)
        Checkbutton(self, text="Error", variable=show_error, command=self.plot.show_textlogs).grid(row=0, column=10, sticky=W)
        Checkbutton(self, text="Warning", variable=show_warning, command=self.plot.show_textlogs).grid(row=0, column=11, sticky=W)
        Checkbutton(self, text="Info", variable=show_info, command=self.plot.show_textlogs).grid(row=0, column=12, sticky=W)
        Checkbutton(self, text="Directories", variable=show_path, command=self.plot.show_textlogs).grid(row=0, column=13, sticky=E)
コード例 #11
0
    def initUI(self):

        self.parent.title("Append Data")
        self.pack(fill=BOTH, expand=True)
        labelfont20 = ('Roboto', 15, 'bold')
        labelfont10 = ('Roboto', 10, 'bold')
        labelfont8 = ('Roboto', 8, 'bold')

        frame0 = Frame(self)
        frame0.pack()

        lbl0 = Label(frame0, text="Hi Nakul")
        lbl0.config(font=labelfont20)
        lbl0.pack(padx=5, pady=5)
        lbl00 = Label(frame0, text="Fill the data here")
        lbl00.config(font=labelfont10)
        lbl00.pack(padx=5, pady=5)

        ####################################
        frame1 = Frame(self)
        frame1.pack()
        frame1.place(x=50, y=100)

        lbl1 = Label(frame1, text="Name", width=15)
        lbl1.pack(side=LEFT, padx=7, pady=5)

        self.entry1 = Entry(frame1, width=20)
        self.entry1.pack(padx=5, expand=True)

        ####################################
        frame2 = Frame(self)
        frame2.pack()
        frame2.place(x=50, y=130)

        lbl2 = Label(frame2, text="F Name", width=15)
        lbl2.pack(side=LEFT, padx=7, pady=5)

        self.entry2 = Entry(frame2)
        self.entry2.pack(fill=X, padx=5, expand=True)

        ######################################
        frame3 = Frame(self)
        frame3.pack()
        frame3.place(x=50, y=160)

        lbl3 = Label(frame3, text="DOB(D/M/Y)", width=15)
        lbl3.pack(side=LEFT, padx=7, pady=5)

        self.entry3 = Entry(frame3)
        self.entry3.pack(fill=X, padx=5, expand=True)

        #######################################
        frame4 = Frame(self)
        frame4.pack()
        frame4.place(x=50, y=190)

        lbl4 = Label(frame4, text="Medium(H/E)", width=15)
        lbl4.pack(side=LEFT, padx=7, pady=5)

        self.entry4 = Entry(frame4)
        self.entry4.pack(fill=X, padx=5, expand=True)

        ##########################################
        frame5 = Frame(self)
        frame5.pack()
        frame5.place(x=50, y=225)
        MODES = [
            ("M", "Male"),
            ("F", "Female"),
        ]
        lbl5 = Label(frame5, text="Gender", width=15)
        lbl5.pack(side=LEFT, padx=7, pady=5)

        global v
        v = StringVar()
        v.set("Male")  # initialize

        for text, mode in MODES:
            b = Radiobutton(frame5, text=text, variable=v, value=mode)
            b.pack(side=LEFT, padx=10)

        ############################################
        #####printing line
        lbl5a = Label(
            text="___________________________________________________")
        lbl5a.pack()
        lbl5a.place(x=45, y=255)

        ############################################
        frame6 = Frame(self)
        frame6.pack()
        frame6.place(x=50, y=290)

        lbl6 = Label(frame6, text="Phone No:", width=15)
        lbl6.pack(side=LEFT, padx=7, pady=5)

        self.entry6 = Entry(frame6)
        self.entry6.pack(fill=X, padx=5, expand=True)

        ################################################

        frame7 = Frame(self)
        frame7.pack()
        frame7.place(x=50, y=320)

        lbl7 = Label(frame7, text="Landline No:", width=15)
        lbl7.pack(side=LEFT, padx=7, pady=5)

        self.entry7 = Entry(frame7)
        self.entry7.pack(fill=X, padx=5, expand=True)

        ###############################################
        frame8 = Frame(self)
        frame8.pack()
        frame8.place(x=50, y=350)

        lbl8 = Label(frame8, text="Email:", width=15)
        lbl8.pack(side=LEFT, padx=7, pady=5)

        self.entry8 = Entry(frame8)
        self.entry8.pack(fill=X, padx=5, expand=True)

        #############################################
        frame9 = Frame(self)
        frame9.pack()
        frame9.place(x=50, y=380)

        lbl9 = Label(frame9, text="HomeTown:", width=15)
        lbl9.pack(side=LEFT, padx=7, pady=5)

        self.entry9 = Entry(frame9)
        self.entry9.pack(fill=X, padx=5, expand=True)

        ###############################################
        frame10 = Frame(self)
        frame10.pack()
        frame10.place(x=60, y=415)

        lbl10 = Label(frame10, text="Address:")
        lbl10.pack(padx=5, pady=5)

        self.entry10 = Text(frame10, height=5, width=28)
        self.entry10.pack(padx=5, expand=True)

        ##############################################

        #############################################

        frame11 = Frame(self)
        frame11.pack()
        frame11.place(x=350, y=100)

        lbl11x = Label(frame11, text="_______Class 10th Data_______")
        lbl11x.pack(padx=0, pady=0)

        lbl11 = Label(text="%", width=15)
        lbl11.pack(side=LEFT, padx=0, pady=0)
        lbl11.place(x=350, y=130)

        self.entry11 = Entry(width=12)
        self.entry11.pack(padx=1, expand=True)
        self.entry11.place(x=420, y=130)

        lbl11a = Label(text="Passing Year", width=15)
        lbl11a.pack(padx=0, pady=2)
        lbl11a.place(x=350, y=160)

        self.entry11a = Entry(width=12)
        self.entry11a.pack(padx=1, expand=True)
        self.entry11a.place(x=420, y=160)

        lbl11b = Label(text="Board Name", width=15)
        lbl11b.pack(padx=0, pady=2)
        lbl11b.place(x=350, y=190)

        self.entry11b = Entry(width=12)
        self.entry11b.pack(padx=1, expand=True)
        self.entry11b.place(x=420, y=190)

        ####################################################
        frame12 = Frame(self)
        frame12.pack()
        frame12.place(x=510, y=100)

        lbl12x = Label(frame12, text="_______Class 12th Data_______")
        lbl12x.pack(padx=0, pady=0)

        lbl12 = Label(text="%", width=15)
        lbl12.pack(side=LEFT, padx=0, pady=0)
        lbl12.place(x=510, y=130)

        self.entry12 = Entry(width=12)
        self.entry12.pack(padx=1, expand=True)
        self.entry12.place(x=580, y=130)

        lbl12a = Label(text="Passing Year", width=15)
        lbl12a.pack(padx=0, pady=2)
        lbl12a.place(x=510, y=160)

        self.entry12a = Entry(width=12)
        self.entry12a.pack(padx=1, expand=True)
        self.entry12a.place(x=580, y=160)

        lbl12b = Label(text="Board Name", width=15)
        lbl12b.pack(padx=0, pady=2)
        lbl12b.place(x=510, y=190)

        self.entry12b = Entry(width=12)
        self.entry12b.pack(padx=1, expand=True)
        self.entry12b.place(x=580, y=190)

        #####################################################
        frame13 = Frame(self)
        frame13.pack()
        frame13.place(x=670, y=100)

        lbl13x = Label(frame13, text="________B.Tech Data_________")
        lbl13x.pack(padx=0, pady=0)

        lbl13 = Label(text="%", width=15)
        lbl13.pack(side=LEFT, padx=0, pady=0)
        lbl13.place(x=670, y=130)

        self.entry13 = Entry(width=12)
        self.entry13.pack(padx=1, expand=True)
        self.entry13.place(x=740, y=130)

        lbl13a = Label(text="Passing Year", width=15)
        lbl13a.pack(padx=0, pady=2)
        lbl13a.place(x=670, y=160)

        self.entry13a = Entry(width=12)
        self.entry13a.pack(padx=1, expand=True)
        self.entry13a.place(x=740, y=160)

        lbl13b = Label(text="College", width=15)
        lbl13b.pack(padx=0, pady=2)
        lbl13b.place(x=670, y=190)

        self.entry13b = Entry(width=12)
        self.entry13b.pack(padx=1, expand=True)
        self.entry13b.place(x=740, y=190)

        ####################################################

        frame14 = Frame(self)
        frame14.pack()
        frame14.place(x=380, y=255)

        lbl14 = Label(frame14, text="Any Other Info:")
        lbl14.pack(padx=5, pady=5)

        self.entry14 = Text(frame14, height=5, width=28)
        self.entry14.pack(padx=5, expand=True)

        frame15 = Frame(self)
        frame15.pack()
        frame15.place(x=650, y=290)

        openButton = Button(frame15,
                            text="Attatch Resume",
                            width=15,
                            command=self.openResume)
        openButton.pack(padx=5, pady=5)
        self.entry15 = Entry(frame15)
        self.entry15.pack(fill=X, padx=4, expand=True)
        #############################################################
        frame16 = Frame(self)
        frame16.pack()
        frame16.place(x=450, y=500)

        closeButton = Button(frame16,
                             text="SUBMIT",
                             width=35,
                             command=self.getDatax)
        closeButton.pack(padx=5, pady=5)

        #######################################
        framexxx = Frame(self)
        framexxx.pack()
        framexxx.place(x=700, y=600)
        self.xxx = Label(framexxx, text="Recent Changes Will Appear Here")
        self.xxx.config(font=labelfont8)
        self.xxx.pack()

        #######################################

        frame000 = Frame(self)
        frame000.pack()
        frame000.place(x=50, y=600)

        self.lbl000 = Label(frame000,
                            text="Beta/Sample2.0 | (c) Nakul Rathore")
        self.lbl000.config(font=labelfont8)
        self.lbl000.pack(padx=5, pady=5)
コード例 #12
0
    def setup(self, parent):
        parent.title("Z5212 Debug Client by 2017 ZEBEX, Inc. Version 1.3")
        resize_and_center(parent, 900, 480)

        self.conn_status = StringVar()
        self.conn_status.set('...')

        # Top Frame (name entry box, buttons, conn status)
        self.conn_frame = Frame(parent, **self.style.Frame)
        self.conn_frame.pack(side="top", fill="x")

        self.lower_frame = Frame(parent, **self.style.Frame)
        self.lower_frame.pack(side="top", fill="both", expand=1)

        # The message entry
        self.display_frame = Frame(self.lower_frame, **self.style.Frame)
        self.display_frame.pack(side="top",
                                fill="both",
                                expand=1,
                                padx=5,
                                pady=5)

        self.right_frame = Frame(self.lower_frame, **self.style.Frame)
        self.right_frame.pack(side="right", fill="y")

        ###
        # Top Frame Widgets
        ###
        self.name_label = Label(self.conn_frame,
                                textvariable=self.conn_status,
                                **self.style.Label).pack(side="left",
                                                         padx=5,
                                                         pady=5)

        Button(self.conn_frame, text='連線', command=self.conn, **self.style.SettingButton)\
            .pack(side="left", padx=5, pady=5)

        Button(self.conn_frame, text="重新開始", command=self.reopen, **self.style.SettingButton)\
            .pack(side="left", padx=5, pady=5)

        self.ports_Combobox = Combobox(self.conn_frame, values=c.port, width=8)
        # assign function to combobox
        self.ports_Combobox.bind('<<ComboboxSelected>>', self.port_on_select)
        self.ports_Combobox.current(portindex)

        self.baud_rate_Combo = Combobox(self.conn_frame,
                                        values=c.baud,
                                        width=8)
        self.baud_rate_Combo.bind('<<ComboboxSelected>>',
                                  self.baud_rate_on_select)
        self.baud_rate_Combo.current(baudindex)

        self.enter_exit_button = Button(self.conn_frame,
                                        text="回復預設值",
                                        command=self.quit,
                                        **self.style.Button)

        self.ports_Combobox.pack(side="left", padx=5, pady=5)
        self.baud_rate_Combo.pack(side="left", padx=5, pady=5)
        self.enter_exit_button.pack(side="left", padx=5, pady=5)

        ###
        # Image Frame Widgets get image, set quality
        ###

        self.img_frame = Frame(self.conn_frame, **self.style.Frame)
        image_q_label = Label(self.img_frame,
                              text='Quality',
                              anchor="w",
                              **self.style.Label)
        image_q_label.pack(side=LEFT, fill="x")
        self.quality.set(85)
        Radiobutton(self.img_frame,
                    text='L',
                    variable=self.quality,
                    value=35,
                    command=self.selected_quality).pack(side=RIGHT, anchor="w")
        Radiobutton(self.img_frame,
                    text='M',
                    variable=self.quality,
                    value=85,
                    command=self.selected_quality).pack(side=RIGHT, anchor="w")
        Radiobutton(self.img_frame,
                    text='H',
                    variable=self.quality,
                    value=93,
                    command=self.selected_quality).pack(side=RIGHT, anchor="w")

        self.img_frame.pack(side="left", padx=5, pady=5)

        Button(self.conn_frame,
               text='拍照',
               command=self.getimg,
               **self.style.SettingButton).pack(side="left", padx=5, pady=5)

        ###
        # Display Frame Widgets
        ###
        self.display_frame.configure(background='#666666')
        # Create a canvas
        self.canvas = Canvas(self.display_frame,
                             width=640,
                             height=360,
                             bg="#666666")
        self.loadImage('Capture.jpg')
コード例 #13
0
    def pack_view(self, *args, **kwargs):
        layout = kwargs.get('layout', 2)
        image_object = kwargs['image_object']
        image_no = kwargs.get('image_no', None)

        temps_string = [str(value) + 'C' for value in self.__temp_values]  # ['26C', '29C', '35C', '38C']
        temps_editable_text = self.__temps_editable_text
        left_frame = self.display_left(False)

        rdo1 = Radiobutton(left_frame, variable=self.__var_rdo, value=0)
        rdo2 = Radiobutton(left_frame, variable=self.__var_rdo, value=1)
        rdo3 = Radiobutton(left_frame, variable=self.__var_rdo, value=2)
        rdo4 = Radiobutton(left_frame, variable=self.__var_rdo, value=3)

        radio_buttons = [rdo1, rdo2, rdo3, rdo4]
        idx = 0
        for radio_button in radio_buttons:
            radio_button.grid(row=idx, column=0, ipady=10)
            idx += 1

        btn1 = Button(left_frame, text=temps_string[0], command=lambda *args: self.__var_rdo.set(0))
        btn2 = Button(left_frame, text=temps_string[1], command=lambda *args: self.__var_rdo.set(1))
        btn3 = Button(left_frame, text=temps_string[2], command=lambda *args: self.__var_rdo.set(2))
        btn4 = Button(left_frame, text=temps_string[3], command=lambda *args: self.__var_rdo.set(3))

        push_buttons = [btn1, btn2, btn3, btn4]
        idx = 0
        for push_button in push_buttons:
            push_button.grid(row=idx, column=1, ipady=5, ipadx=10)
            idx += 1

        lbl1 = Label(left_frame, text=temps_editable_text[0])
        lbl2 = Label(left_frame, text=temps_editable_text[1])
        lbl3 = Label(left_frame, text=temps_editable_text[2])
        lbl4 = Label(left_frame, text=temps_editable_text[3])

        labels = [lbl1, lbl2, lbl3, lbl4]
        idx = 0
        for label in labels:
            label.grid(row=idx, column=2, ipady=5)
            idx += 1

        # ROW & COLUMN CONFIGURE
        for row in range(4):
            left_frame.rowconfigure(row, weight=2, pad=10)  # row: 0, 1, 2, 3
        for column in range(3):
            left_frame.columnconfigure(column, weight=2, pad=5)  # column: 0, 1, 2

        # image and button
        # adding preview image
        if layout == 3:
            right_frame = self.display_right(True)
            self._prev_img = ImageTk.PhotoImage(image_object)
            self._prev = Label(right_frame, image=self._prev_img)
            self._prev.pack(fill=BOTH, expand=YES, anchor=CENTER)

        # adding next button
        if layout in (2, 3):
            bottom_frame = self.display_bottom(False)
            self.add_next_action_btn(self.on_next_click)

        self.display()
コード例 #14
0
    def initUI(self):

        self.parent.title("Graphs")
        self.style = Style()
        self.style.theme_use("clam")
        self.pack(fill=BOTH, expand=1)

        self.columnconfigure(1, weight=1)
        self.columnconfigure(3, weight=1)
        self.columnconfigure(6, pad=7)
        self.rowconfigure(3, weight=1)
        self.rowconfigure(5, pad=7)

        menu = Menu(self.parent)
        self.parent.config(menu=menu)
        filemenu = Menu(menu)
        menu.add_cascade(label="File", menu=filemenu)
        filemenu.add_command(label="Load data", command=self.load_data)

        # lable to show current file and chanel
        self.file_lbl = Label(self, text="")
        self.file_lbl.grid(row=0, column=3, pady=4, padx=5)

        # list box fro data files
        self.file_list = ScrolledList(self, lambda x: self.load_hunt_data(x))
        self.file_list.grid(row=1,
                            column=0,
                            columnspan=3,
                            rowspan=4,
                            padx=5,
                            sticky=E + W + S + N)

        # chanel graph viewer
        self.graph_viewer = TkinterGraph(self)
        self.graph_viewer.grid(row=1,
                               column=3,
                               columnspan=2,
                               rowspan=4,
                               padx=5,
                               sticky=E + W + S + N)

        btn1 = Button(self, text="Left", command=lambda: self.plot_left())
        btn1.grid(row=1, column=6)

        btn2 = Button(self, text="Right", command=lambda: self.plot_right())
        btn2.grid(row=2, column=6, pady=4)

        # frames for the classifier for the two chanels
        self.frame_left = Frame(self, borderwidth=1)
        self.frame_right = Frame(self, borderwidth=1)
        self.frame_left.grid(row=5, column=3, columnspan=2, rowspan=1)

        btn4 = Button(self, text="SAVE", command=lambda: self.save_graph())
        btn4.grid(row=5, column=6)

        # note manual addition of labels so that the lable will be to the right of tha radio button
        self.classify_left = StringVar()
        Label(self.frame_left, text="Left  :").pack(side=LEFT)
        Label(self.frame_left, text="Type A").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_left,
                          variable=self.classify_left,
                          value="TypeA")
        rb1.pack(side=LEFT)
        Label(self.frame_left, text="Type B").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_left,
                          variable=self.classify_left,
                          value="TypeB")
        rb1.pack(side=LEFT)
        Label(self.frame_left, text="Type C").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_left,
                          variable=self.classify_left,
                          value="TypeC")
        rb1.pack(side=LEFT)
        Label(self.frame_left, text="Type D").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_left,
                          variable=self.classify_left,
                          value="TypeD")
        rb1.pack(side=LEFT)

        self.classify_right = StringVar()
        Label(self.frame_right, text="Right  :").pack(side=LEFT)
        Label(self.frame_right, text="Type A").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_right,
                          variable=self.classify_right,
                          value="TypeA")
        rb1.pack(side=LEFT)
        Label(self.frame_right, text="Type B").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_right,
                          variable=self.classify_right,
                          value="TypeB")
        rb1.pack(side=LEFT)
        Label(self.frame_right, text="Type C").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_right,
                          variable=self.classify_right,
                          value="TypeC")
        rb1.pack(side=LEFT)
        Label(self.frame_right, text="Type D").pack(side=LEFT)
        rb1 = Radiobutton(self.frame_right,
                          variable=self.classify_right,
                          value="TypeD")
        rb1.pack(side=LEFT)