def __init__(self, system, periph_num, periph_id, periph_sub_id): gtk.Notebook.__init__(self) PeripheralWidget.__init__(self, system, periph_num, periph_id, periph_sub_id) self.set_border_width(5) # Basic controls tab vbox = gtk.VBox(spacing=5) label = gtk.Label("Basic") self.append_page(vbox, label) self._init_clock_gui(vbox) self._init_memory_gui(vbox) # Scan path tab vbox = gtk.VBox() vbox.set_border_width(5) label = gtk.Label("Scan Path") self.append_page(vbox, label) self.scan_path_chooser = gtk.FileChooserButton("Select Scanpath Description") vbox.pack_start(self.scan_path_chooser, fill=True, expand=False) self.scan_path_load_btn = gtk.Button("Load Scan Path Description") self.scan_path_load_btn.connect("clicked", self._on_load_btn_clicked) vbox.pack_start(self.scan_path_load_btn, fill=True, expand=False) self.scan_path_reset_btn = gtk.Button("Reset Scan Path") self.scan_path_reset_btn.connect("clicked", self._on_reset_btn_clicked) vbox.pack_start(self.scan_path_reset_btn, fill=True, expand=False)
def get_progress_adjustments(self): return ( PeripheralWidget.get_progress_adjustments(self) + [(Spartan3.downloader_decorator.get_adjustment(self), "FPGA Download")] )
def __init__(self, system, periph_num, periph_id, periph_sub_id): gtk.VBox.__init__(self, spacing = 10) PeripheralWidget.__init__(self, system, periph_num, periph_id, periph_sub_id) # Lock for bit-file data variables access self.data_lock = Lock() self.filename = None self.design_name = None self.device_name = None self.datestamp = None self.timestamp = None self.data = None # Data actually on the FPGA self.fpga_filename = None self.fpga_design_name = None self.fpga_device_name = None self.fpga_datestamp = None self.fpga_timestamp = None # Space the widget's contents from the edge of the container as they're just # buttons and labels (which don't have their own padding). self.set_border_width(10) self.table = gtk.Table(rows = 5, columns = 4, homogeneous = False) self.table.set_row_spacings(2) self.pack_start(self.table, fill = True, expand = False) # Add a vertical separator sep = gtk.VSeparator() self.table.attach(sep, 2,3, 0,5, xoptions=gtk.FILL, yoptions=gtk.FILL, xpadding=5) # Add headings self._add_heading("Bit File", 0, 1) self._add_heading("FPGA", 0, 3) # Space between labels and entries self.table.set_col_spacing(0, 10) # File name selection box/button self.filename_box = gtk.FileChooserButton("Select a Bit File") # Set filename filters bit_file_filter = gtk.FileFilter() bit_file_filter.set_name("FPGA Bit File (*.bit)") bit_file_filter.add_pattern("*.bit") self.filename_box.add_filter(bit_file_filter) all_files_filter = gtk.FileFilter() all_files_filter.set_name("All Files") all_files_filter.add_pattern("*") self.filename_box.add_filter(all_files_filter) self.filename_box.connect("file-set", self._on_file_set) self.refresh_button = gtk.Button("Refresh") self.refresh_button.connect("clicked", self._on_file_set) hbox = gtk.HBox(homogeneous = False, spacing = 5) hbox.pack_start(self.filename_box, fill = True, expand = True) hbox.pack_start(self.refresh_button, fill = True, expand = False) # Label displaying the FPGA's loaded filename self.fpga_filename_label = gtk.Label() self.fpga_filename_label.set_ellipsize(pango.ELLIPSIZE_START) self._add_row("File:", hbox, self.fpga_filename_label, 1) # Show the design meta-data self.design_name_label = gtk.Label() self.device_name_label = gtk.Label() self.date_time_stamp_label = gtk.Label() self.fpga_design_name_label = gtk.Label() self.fpga_device_name_label = gtk.Label() self.fpga_date_time_stamp_label = gtk.Label() self._add_row("Design:", self.design_name_label, self.fpga_design_name_label, 2) self._add_row("Target:", self.device_name_label, self.fpga_device_name_label, 3) self._add_row("Synthesised:", self.date_time_stamp_label, self.fpga_date_time_stamp_label, 4) # Add a progress monitor self.progress_monitor = ProgressMonitor(self.system, auto_hide = False) self.progress_monitor.add_adjustment(Spartan3.downloader_decorator.get_adjustment(self)) self.pack_start(self.progress_monitor, fill=True, expand=False) # Box containing the buttons self.button_box = gtk.HButtonBox() self.button_box.set_layout(gtk.BUTTONBOX_CENTER) self.button_box.set_spacing(5) self.pack_start(self.button_box, fill = True, expand = False) # Add a download button self.download_btn = gtk.Button("Download onto FPGA") self.download_btn.set_sensitive(False) self.download_btn.connect("clicked", self._on_donwload_clicked) self.button_box.pack_start(self.download_btn) # Add an erase button self.erase_btn = gtk.Button("Erase FPGA") self.erase_btn.set_sensitive(True) self.erase_btn.connect("clicked", self._on_erase_clicked) self.button_box.pack_start(self.erase_btn) # Update all labels self.display_meta_data()