示例#1
0
    def initialize_settings_ui(self):
        # Initializes resamples field
        resamples_label = Label(self, text="Resamples (affects recognition accuracy)")
        resamples_label.place(y=12.5, x=12.5)
        resamples_text = tk.StringVar()
        resamples_text.set(self.settings["resamples"])
        resamples_spin = Spinbox(self, from_=1, to=10, textvariable=resamples_text)
        resamples_spin.config(command=partial(self.save_settings, "resamples", lambda: int(resamples_text.get())))
        resamples_spin.place(y=37.5, x=12.5)
        separator1 = Separator(self, orient='horizontal')
        separator1.place(y=62.5, x=12.5, width=375, height=1)

        # Initializes tolerance field
        tolerance_label = Label(self, text="Face matching tolerance (lower is more strict)")
        tolerance_label.place(y=68.75, x=12.5)
        tolerance_text = tk.StringVar()
        tolerance_text.set(self.settings["tolerance"])
        tolerance_spin = Spinbox(self, from_=0, to=1, increment=0.1, textvariable=tolerance_text)
        tolerance_spin.config(command=partial(self.save_settings, "tolerance", lambda: float(tolerance_text.get())))
        tolerance_spin.place(y=93.75, x=12.5)
        separator2 = Separator(self, orient='horizontal')
        separator2.place(y=118.75, x=12.5, width=375, height=1)

        # Initializes track period field
        track_period_label = Label(self, text="Track period (the number of frames between each recognition)")
        track_period_label.place(y=125, x=12.5)
        track_period_text = tk.StringVar()
        track_period_text.set(self.settings["track_period"])
        track_period_spin = Spinbox(self, from_=1, to=30, textvariable=track_period_text)
        track_period_spin.config(command=partial(self.save_settings, "track_period", lambda: int(track_period_text.get())))
        track_period_spin.place(y=150, x=12.5)
        separator3 = Separator(self, orient='horizontal')
        separator3.place(y=175, x=12.5, width=375, height=1)

        # Initializes blur method field
        blur_method_label = Label(self, text="Blur method")
        blur_method_label.place(y=181.25, x=12.5)
        blur_method_text = tk.StringVar()
        blur_method_text.set(self.settings["blur_method"])
        blur_method_menu = Combobox(self, textvariable=blur_method_text, values=("pixelate", "blur", "blacken"))
        blur_method_text.trace('w', partial(self.save_settings, "blur_method", lambda: blur_method_text.get()))
        blur_method_menu.place(y=206.25, x=12.5)
        separator4 = Separator(self, orient='horizontal')
        separator4.place(y=231.25, x=12.5, width=375, height=1)

        # Initializes blur intensity field
        blur_intensity_label = Label(self, text="Blur intensity (filter size)")
        blur_intensity_label.place(y=237.5, x=12.5)
        blur_intensity_text = tk.StringVar()
        blur_intensity_text.set(self.settings["blur_intensity"])
        blur_intensity_spin = Spinbox(self, from_=1, to=30, textvariable=blur_intensity_text)
        blur_intensity_spin.config(command=partial(self.save_settings, "blur_intensity", lambda: int(blur_intensity_text.get())))
        blur_intensity_spin.place(y=262.5, x=12.5)
        separator5 = Separator(self, orient='horizontal')
        separator5.place(y=287.5, x=12.5, width=375, height=1)

        # Initializes display output field
        display_output_flag = tk.IntVar()
        display_output_flag.set(self.settings["display_output"])
        display_output_checkbox = tk.Checkbutton(self, text='Display output', variable=display_output_flag, onvalue=1, offvalue=0)
        display_output_checkbox.config(command=partial(self.save_settings, "display_output", lambda: display_output_flag.get()))
        display_output_checkbox.place(y=293.75, x=12.5)
	old_data1.append(minus_this)
	old_data2.append(minus_this1)
	old_data3.append(minus_this2)
	minus()
def set_timer_ye():
	if sec_data.get()==0 and min_data.get()==0 and hr_data.get()==0:
		messagebox.showinfo('Info','Please Add More Time.')
	else:
		messagebox.showinfo('Info','Timer Set Successfully')
		start_countdown(sec_data.get(),min_data.get(),hr_data.get())
head=Label(root,text='Timer',font=('Courier',30,'bold'))
head.place(x=125)
sec_label_indict=Label(root,text='Seconds:',font=('Courier',20,'bold'))
sec_label_indict.place(x=135+135,y=55)
sec_spinbox=Spinbox(root,state='readonly',textvariable=sec_data,from_=0,to=59,font=('Arial Rounded MT bold',20,'bold'),width=5)
sec_spinbox.place(x=135+135,y=95)
min_label_indict=Label(root,text='Minutes:',font=('Courier',20,'bold'))
min_label_indict.place(x=135,y=55)
min_spinbox=Spinbox(root,state='readonly',textvariable=min_data,from_=0,to=59,font=('Arial Rounded MT bold',20,'bold'),width=5)
min_spinbox.place(x=135,y=95)
hr_label_indict=Label(root,text='Hours:',font=('Courier',20,'bold'))
hr_label_indict.place(x=1+10,y=55)
hr_spinbox=Spinbox(root,state='readonly',textvariable=hr_data,from_=0,to=99,font=('Arial Rounded MT bold',20,'bold'),width=5)
hr_spinbox.place(x=1,y=95)
set_timer=Button(root,text='Set Timer',command=set_timer_ye,width=15)
set_timer.place(x=130,y=135)
b1=Button(root,text='Reset',command=reset)
b2=Button(root,text='Pause',command=pause_)
b3=Button(root,text='Start',command=Start,state='disabled')
b4=Button(root,text='Cancel',comman=Cancel)
mainloop()
示例#3
0
lbl0 = Label(window, text="Выберите COM-порт:").place(x=15, y=15)
combo = Combobox(window, values=serial_ports())
combo.place(x=15, y=35)
combo.bind('<<ComboboxSelected>>', com_port_state)
combo.set(reestr[0])

lbl01 = Label(window, text="Выберите скорость:").place(x=200, y=15)
combo1 = Combobox(window, values=speeds)
combo1.place(x=200, y=35)
combo1.current(3)

lbl_current = LabelFrame(window, text="Установите параметры тока")
lbl_current.place(x=15, y=70, width=350, heigh=60)

spinbox_current = Spinbox(lbl_current, values=current_values, width=5)
spinbox_current.place(x=5, y=5)
spinbox_current.delete(00, "end")
spinbox_current.insert(0, 0)
lbl_current_A = Label(lbl_current, text="Ток, А")
lbl_current_A.place(x=90, y=5)

spinbox_angle = Spinbox(lbl_current, from_=0, to=360, width=5)
spinbox_angle.place(x=170, y=5)
spinbox_angle.delete(0, "end")
spinbox_angle.insert(0, 0)
lbl_angle = Label(lbl_current, text="Угол")
lbl_angle.place(x=260, y=5)

lbl_phase = LabelFrame(window, text="Выберите задействованные фазы")
lbl_phase.place(x=15, y=135, width=350, heigh=60)