Exemplo n.º 1
0
    def init_widgets(self):
        self.content_wrapper = Frame(self)

        self.init_video_info()

        self.screen_title_label = Header1Label(self.content_wrapper,
                                               text="Video Selection")
        self.instruction_label = PLabel(
            self.content_wrapper,
            text="Please choose your left and right video files. "
            "Press Next when finished.\n"
            "(Files must be in MKV format).")
        self.left_video_filename_preview_label = PLabel(
            self.content_wrapper, text="No Video Selected")
        self.left_video_button = Button(
            self.content_wrapper,
            text="Choose Left Video",
            command=lambda: self.select_video_through_button_press(LEFT))
        self.right_video_filename_preview_label = PLabel(
            self.content_wrapper, text="No Video Selected")
        self.right_video_button = Button(
            self.content_wrapper,
            text="Choose Right Video",
            command=lambda: self.select_video_through_button_press(RIGHT))
        self.next_button = Button(self.content_wrapper,
                                  text="Next",
                                  state=DISABLED,
                                  command=lambda: self.next_screen())

        self.add_img_previews()
def setup_hms_input(screen_frame, input_content_wrapper):
    validate_command = (screen_frame.register(validate_hms_input), "%d", "%S")

    screen_frame.hour_label = PLabel(input_content_wrapper, text="H: ")
    screen_frame.hour_input = Entry(input_content_wrapper,
                                    width=ENTRY_WIDTH,
                                    justify=CENTER,
                                    validate="key",
                                    validatecommand=validate_command)
    screen_frame.hour_input.insert(0, 0)
    screen_frame.hour_label.grid(row=0, column=0)
    screen_frame.hour_input.grid(row=0, column=1)

    screen_frame.minute_label = PLabel(input_content_wrapper, text="M: ")
    screen_frame.minute_input = Entry(input_content_wrapper,
                                      width=ENTRY_WIDTH,
                                      justify=CENTER,
                                      validate="key",
                                      validatecommand=validate_command)
    screen_frame.minute_input.insert(0, 0)
    screen_frame.minute_label.grid(row=0, column=2)
    screen_frame.minute_input.grid(row=0, column=3)

    screen_frame.seconds_label = PLabel(input_content_wrapper, text="S: ")
    screen_frame.seconds_input = Entry(input_content_wrapper,
                                       width=ENTRY_WIDTH,
                                       justify=CENTER,
                                       validate="key",
                                       validatecommand=validate_command)
    screen_frame.seconds_input.insert(0, 0)
    screen_frame.seconds_label.grid(row=0, column=4)
    screen_frame.seconds_input.grid(row=0, column=5)

    return screen_frame.hour_input, screen_frame.minute_input, screen_frame.seconds_input
Exemplo n.º 3
0
 def init_widgets(self):
     self.text_container = Frame(self)
     self.screen_title = Header1Label(self.text_container,
                                      text="Stereo Rectification Complete!")
     self.text_1 = PLabel(self.text_container,
                          text=("\n".join([
                              "Your videos have been stereo rectified!",
                              "You can find them in the follow "
                              "paths on your system:"
                          ])))
     self.filenames = PLabel(self.text_container)
     self.thanks_label = PLabel(self.text_container,
                                text="Thank you for your patience!")
     self.finish_button = Button(self.text_container,
                                 text="Finish and Close Window",
                                 command=lambda: sys.exit())
 def init_widgets(self):
     self.content_wrapper = Frame(self)
     self.screen_title = Header1Label(self.content_wrapper, text=SR_FRAME_SELECTION_TITLE)
     self.screen_description = PLabel(self.content_wrapper, text="Please select frames that have a satisfactory "
                                                                 "checkerboard result.")
     self.next_button = Button(self.content_wrapper, text="Next",
                               command=lambda: self.on_next_button())
 def init_widgets(self):
     self.content_wrapper = Frame(self)
     self.screen_title = Header1Label(self.content_wrapper,
                                      text=SR_FRAME_SELECTION_TITLE)
     self.screen_description = PLabel(
         self.content_wrapper,
         text="Please select a frame that has a satisfactory "
         "stereo rectification result.")
Exemplo n.º 6
0
    def init_widgets(self):
        self.content_wrapper = Frame(self)

        self.screen_title = Header1Label(self.content_wrapper)
        self.screen_instruction_1_label = PLabel(self.content_wrapper)

        self.input_content_wrapper = Frame(self.content_wrapper)
        self.hour_input, self.minute_input, self.seconds_input = setup_hms_input(
            self, self.input_content_wrapper)
        self.error_message_label = PLabel(self.content_wrapper, fg="red")

        self.button_wrapper = Frame(self.content_wrapper)
        self.back_button = Button(self.button_wrapper,
                                  text="Back",
                                  command=lambda: self.prev_button_command())
        self.next_button = Button(self.button_wrapper,
                                  text="Next",
                                  command=lambda: self.next_button_command())
    def init_widgets(self):
        self.content_wrapper = Frame(self)
        self.content_wrapper.configure(bg="white")

        self.screen_title = Header1Label(self.content_wrapper)
        self.empty_space_1 = PLabel(self.content_wrapper)
        self.progress_bar_control_var = DoubleVar()
        self.progress_bar = Progressbar(self.content_wrapper,
                                        orient=HORIZONTAL,
                                        mode="determinate",
                                        length=WINDOW_WIDTH / 2,
                                        variable=self.progress_bar_control_var)
        self.wait_text = PLabel(self.content_wrapper)
        self.information_display = PLabel(self.content_wrapper)
        self.empty_space_2 = PLabel(self.content_wrapper)
        self.next_button = Button(self.content_wrapper,
                                  text="Next",
                                  state=DISABLED,
                                  command=lambda: self.on_next_button())
Exemplo n.º 8
0
 def init_widgets(self):
     self.text_container = Frame(self)
     self.welcome_label = Header1Label(
         self.text_container,
         text="Welcome to the full WALL-E footage processing experience!!")
     self.description_label = PLabel(
         self.text_container,
         text="This process helps you perform the following in order:\n"
         "\t1) Frame matching the videos\n"
         "\t2) Finding and generating the best SR map\n"
         "\t3) Stereo rectifying the videos",
         justify=LEFT)
     self.advisory_label = PLabel(
         self.text_container,
         text="(Note: the GUI experience looks best on a Mac)")
     self.good_luck_label = PLabel(self.text_container, text="Good Luck!")
     self.next_button = Button(
         self.text_container,
         text="Get Started",
         command=lambda: self.controller.show_next_frame())
    def init_widgets(self):
        self.content_wrapper = Frame(self)

        self.screen_title = Header1Label(self.content_wrapper,
                                         text=self.screen_title)
        self.screen_description_label = PLabel(
            self.content_wrapper,
            text=("\n\n".join(self.process_description_message_list)))
        self.button_wrapper = Frame(self.content_wrapper)
        self.next_button = Button(self.button_wrapper,
                                  text="Next",
                                  command=lambda: self.on_next_button())
 def init_widgets(self):
     self.content_wrapper = Frame(self)
     self.content_wrapper.configure(background="white")
     self.screen_title = Header1Label(
         self.content_wrapper, text="Scanning video for information...\n")
     self.progress_bar = Progressbar(self.content_wrapper,
                                     orient=HORIZONTAL,
                                     mode="indeterminate",
                                     length=WINDOW_WIDTH / 2)
     self.wait_text = PLabel(
         self.content_wrapper,
         text="\nThis might take a few minutes."
         "\nPlease do not change the video files while this is running.\n")
     self.left_frames_count = PLabel(self.content_wrapper,
                                     text=LEFT_FRAMES_COUNT_PREFIX + "0")
     self.right_frames_count = PLabel(self.content_wrapper,
                                      text=RIGHT_FRAMES_COUNT_PREFIX + "0")
     self.elapsed_time_label = PLabel(self.content_wrapper)
     self.empty_space = PLabel(self.content_wrapper, text=" ")
     self.next_button = Button(
         self.content_wrapper,
         text="Next",
         state=DISABLED,
         command=lambda: self.controller.show_next_frame())
    def init_widgets(self):
        self.content_wrapper = Frame(self)

        self.screen_title = Header1Label(self.content_wrapper,
                                         text=self.screen_title)
        self.screen_description_label = PLabel(
            self.content_wrapper,
            text=("\n\n".join(self.process_description_message_list)))
        self.button_wrapper = Frame(self.content_wrapper)

        if len(self.button_text_list) != len(self.button_command_list):
            raise ValueError(
                "Button text list and command list must have the same length "
                "(each text must correspond with a command in both lists).")

        self.buttons = []
        for i in range(0, len(self.button_text_list)):
            self.buttons.append((Button(self.button_wrapper,
                                        text=self.button_text_list[i],
                                        command=self.button_command_list[i])))
Exemplo n.º 12
0
    def init_widgets(self):
        self.buttons = []
        self.content_wrapper = Frame(self)

        self.title_label = Header1Label(self.content_wrapper,
                                        text="Frame Offset Validation")
        self.subtitle_label = PLabel(
            self.content_wrapper,
            text=
            "Use the buttons below to ensure that the video frame offset is valid. Press Next when finished."
        )

        self.left_frame_num_label = PLabel(self.content_wrapper)
        self.right_frame_num_label = PLabel(self.content_wrapper)

        self.left_video_label = PLabel(self.content_wrapper)
        self.right_video_label = PLabel(self.content_wrapper)

        self.left_offset_label = PLabel(self.content_wrapper)
        self.right_offset_label = PLabel(self.content_wrapper)

        self.left_offset_inc_instr = PLabel(
            self.content_wrapper, text="Increase left video offset by:")
        self.right_offset_inc_instr = PLabel(
            self.content_wrapper, text="Increase right video offset by:")

        self.left_offset_inc_10_button = Button(
            self.content_wrapper,
            text="+10",
            command=lambda: self.adjust_left_offset(10))
        self.left_offset_inc_5_button = Button(
            self.content_wrapper,
            text="+5",
            command=lambda: self.adjust_left_offset(5))
        self.left_offset_inc_1_button = Button(
            self.content_wrapper,
            text="+1",
            command=lambda: self.adjust_left_offset(1))
        self.right_offset_inc_1_button = Button(
            self.content_wrapper,
            text="+1",
            command=lambda: self.adjust_right_offset(1))
        self.right_offset_inc_5_button = Button(
            self.content_wrapper,
            text="+5",
            command=lambda: self.adjust_right_offset(5))
        self.right_offset_inc_10_button = Button(
            self.content_wrapper,
            text="+10",
            command=lambda: self.adjust_right_offset(10))
        self.buttons.extend([
            self.left_offset_inc_10_button, self.left_offset_inc_5_button,
            self.left_offset_inc_1_button, self.right_offset_inc_1_button,
            self.right_offset_inc_5_button, self.right_offset_inc_10_button
        ])

        self.video_navigation_label = PLabel(self.content_wrapper,
                                             text="Video frame navigation:")

        self.left_video_frame_inc_10_button = Button(
            self.content_wrapper,
            text=BACK_10_FRAMEs_TEXT,
            command=lambda: self.adjust_frame_num(-10))
        self.left_video_frame_inc_5_button = Button(
            self.content_wrapper,
            text=BACK_5_FRAMEs_TEXT,
            command=lambda: self.adjust_frame_num(-5))
        self.left_video_frame_inc_1_button = Button(
            self.content_wrapper,
            text=BACK_1_FRAME_TEXT,
            command=lambda: self.adjust_frame_num(-1))
        self.right_video_frame_inc_1_button = Button(
            self.content_wrapper,
            text=FORWARD_1_FRAME_TEXT,
            command=lambda: self.adjust_frame_num(1))
        self.right_video_frame_inc_5_button = Button(
            self.content_wrapper,
            text=FORWARD_5_FRAMES_TEXT,
            command=lambda: self.adjust_frame_num(5))
        self.right_video_frame_inc_10_button = Button(
            self.content_wrapper,
            text=FORWARD_10_FRAMES_TEXT,
            command=lambda: self.adjust_frame_num(10))
        self.buttons.extend([
            self.left_video_frame_inc_10_button,
            self.left_video_frame_inc_5_button,
            self.left_video_frame_inc_1_button,
            self.right_video_frame_inc_1_button,
            self.right_video_frame_inc_5_button,
            self.right_video_frame_inc_10_button
        ])

        self.left_video_frame_inc_300_button = Button(
            self.content_wrapper,
            text=BACK_300_FRAMEs_TEXT,
            command=lambda: self.adjust_frame_num(-300))
        self.left_video_frame_inc_150_button = Button(
            self.content_wrapper,
            text=BACK_150_FRAMEs_TEXT,
            command=lambda: self.adjust_frame_num(-150))
        self.left_video_frame_inc_30_button = Button(
            self.content_wrapper,
            text=BACK_30_FRAMEs_TEXT,
            command=lambda: self.adjust_frame_num(-30))
        self.right_video_frame_inc_30_button = Button(
            self.content_wrapper,
            text=FORWARD_30_FRAMES_TEXT,
            command=lambda: self.adjust_frame_num(30))
        self.right_video_frame_inc_150_button = Button(
            self.content_wrapper,
            text=FORWARD_150_FRAMES_TEXT,
            command=lambda: self.adjust_frame_num(150))
        self.right_video_frame_inc_300_button = Button(
            self.content_wrapper,
            text=FORWARD_300_FRAMES_TEXT,
            command=lambda: self.adjust_frame_num(300))
        self.buttons.extend([
            self.left_video_frame_inc_300_button,
            self.left_video_frame_inc_150_button,
            self.left_video_frame_inc_30_button,
            self.right_video_frame_inc_30_button,
            self.right_video_frame_inc_150_button,
            self.right_video_frame_inc_300_button
        ])

        self.next_button = Button(
            self.content_wrapper,
            text="Next",
            command=lambda: self.controller.show_next_frame())
    def init_widgets(self):
        AbstractTimeSelectionBaseScreen.init_widgets(self)

        self.screen_instruction_1_filename_label = PLabel(self.content_wrapper)
        self.screen_instruction_2_label = PLabel(self.content_wrapper)
        self.empty_label_1 = PLabel(self.content_wrapper)
    def on_show_frame(self):
        self.canvas_wrappers = []
        self.canvases = []
        self.page_num = 0

        if len(self.controller.sr_results) == 0:
            self.controller.show_frame(SrNoFramesFoundScreen)
        else:
            pages = int(ceil(len(self.controller.sr_results) / 10.0))
            for page in range(0, pages):
                canvas_wrapper = Frame(self.content_wrapper,
                                       borderwidth="1",
                                       relief="solid")
                canvas = Canvas(canvas_wrapper,
                                width=int(WINDOW_WIDTH * 7 / 8),
                                height=(WINDOW_HEIGHT * 2 / 3))
                scroll_bar = Scrollbar(canvas_wrapper,
                                       orient=VERTICAL,
                                       command=canvas.yview)
                results_list_frame = Frame(canvas)

                canvas.configure(yscrollcommand=scroll_bar.set)
                canvas.create_window(0, 0, window=results_list_frame)
                canvas.bind_all("<Up>", self.on_up_key)
                canvas.bind_all("<Down>", self.on_down_key)
                canvas.bind_all("<Left>", self.on_left_key)
                canvas.bind_all("<Right>", self.on_right_key)

                canvas.grid(row=0, column=0, sticky="nsew")
                scroll_bar.grid(row=0, column=1, sticky="ns")
                canvas_wrapper.grid(row=2,
                                    column=0,
                                    columnspan=3,
                                    sticky="nsew")

                select_buttons_on_page = []

                for row in range(0, RESULTS_PER_PAGE):
                    result_num = page * RESULTS_PER_PAGE + row
                    if result_num < len(self.controller.sr_results):
                        frame_num = self.controller.sr_results[result_num][
                            FRAME_NUM_LABEL]

                        result_entry = Frame(results_list_frame,
                                             borderwidth="1",
                                             relief="solid")
                        description = PLabel(
                            result_entry,
                            text="Frame #" + str(int(frame_num)) + ", Time: " +
                            str(datetime.timedelta(seconds=frame_num / 30)))
                        preview_wrapper = Frame(result_entry)
                        left_video_preview = Label(
                            preview_wrapper,
                            image=self.controller.sr_results[result_num][LEFT])
                        right_video_preview = Label(
                            preview_wrapper,
                            image=self.controller.sr_results[result_num]
                            [RIGHT])
                        select_button = SrSelectButton(
                            preview_wrapper,
                            self.controller,
                            self.controller.sr_results[result_num]
                            [SR_MAP_LABEL],
                            text="Select")

                        select_buttons_on_page.append(select_button)

                        description.pack()
                        left_video_preview.grid(row=row, column=0)
                        right_video_preview.grid(row=row, column=1)
                        select_button.grid(row=row, column=2)
                        preview_wrapper.pack()
                        result_entry.pack()

                for i in range(0, len(select_buttons_on_page)):
                    select_buttons_on_page[i].configure(
                        command=select_buttons_on_page[i].use_sr_map)

                self.master.update_idletasks()
                canvas.config(scrollregion=canvas.bbox("all"))
                canvas.yview_moveto(0)
                self.canvas_wrappers.append(canvas_wrapper)
                self.canvases.append(canvas)

            self.prev_result_page = Button(
                self.content_wrapper,
                text="<",
                command=lambda: self.prev_page_command())
            self.page_info_label = PLabel(
                self.content_wrapper,
                text=get_page_info_label_message(self.page_num,
                                                 len(self.canvases),
                                                 RESULTS_PER_PAGE))
            self.next_result_page = Button(
                self.content_wrapper,
                text=">",
                command=lambda: self.next_page_command())

            self.prev_result_page.grid(row=3, column=0)
            self.page_info_label.grid(row=3, column=1)
            self.next_result_page.grid(row=3, column=2)
            self.canvas_wrappers[self.page_num].tkraise()