def __init__(self, machine_time_step, time_scale_factor):
     threading.Thread.__init__(self)
     self.machine_time_step = machine_time_step
     self.time_scale_factor = time_scale_factor
     self.visualiser = None
     self.done = False
     self.queuer = PortQueuer()
     self.DEBUG = config.getboolean("Visualiser", "debug")
 def __init__(self, machine_time_step, time_scale_factor):
     threading.Thread.__init__(self)
     self.machine_time_step = machine_time_step
     self.time_scale_factor = time_scale_factor
     self.visualiser = None
     self.done = False
     self.queuer = PortQueuer()
     self.DEBUG = config.getboolean("Visualiser", "debug")
Exemple #3
0
    def __init__(self,
                 dao,
                 windows,
                 main_pages,
                 vertex_in_question,
                 real_pages,
                 vertex=None,
                 merged=True):
        super(RasterPage, self).__init__(dao, windows, main_pages, real_pages)
        self.is_merged_version = merged
        #holds all the vertexes being recorded for spikes
        if vertex_in_question is None:
            self.vertex_in_question = list()
            self.vertex_in_question.append(vertex)
        else:
            self.vertex_in_question = sorted(vertex_in_question,
                                             key=lambda vertex: vertex.label)

        #creates a collection of offsets for y plot
        self.off_sets = list()
        current_off_set = 0

        self.x_axis_scope = config.get("Visualiser", "raster_plot_x_scope")
        if self.x_axis_scope == "None":
            self.x_axis_scope = dao.run_time
        if self.x_axis_scope is None:
            self.x_axis_scope = 2000.0

        self.do_fading = config.getboolean("Visualiser",
                                           "raster_plot_do_fading")
        self.data_stores = []

        for vertex in self.vertex_in_question:
            label = str(vertex.label)
            self.data_stores.append(label)
            tuple_data = [(-1, -1), (-1, -1)]
            self.data_stores.append(tuple_data)
            self.off_sets.append(current_off_set)
            current_off_set += vertex.atoms + 15

        #records the maxiumum neuron value
        self.max_y_value = current_off_set

        #set name of page
        self.page = gtk.Frame("raster plot")

        self.figure = None
        self.plot = ScatterplotChart()
        self.axis = None
        self.canvas = None
        self.graphview = None
        if self.is_merged_version:
            label = "merged raster page"
        else:
            label = "Raster page of {}".format(vertex.label)
        main_pages.append_page(self.page, gtk.Label(label))
        #generate plot
        self.generate_plot(0, True)
    def __init__(self, dao, windows, main_pages, vertex_in_question, real_pages,
                 vertex=None, merged=True):
        super(RasterPage, self).__init__(dao, windows, main_pages, real_pages)
        self.is_merged_version = merged
        #holds all the vertexes being recorded for spikes
        if vertex_in_question is None:
            self.vertex_in_question = list()
            self.vertex_in_question.append(vertex)
        else:
            self.vertex_in_question = sorted(vertex_in_question,
                                             key=lambda vertex: vertex.label)

        #creates a collection of offsets for y plot
        self.off_sets = list()
        current_off_set = 0

        self.x_axis_scope = config.get("Visualiser", "raster_plot_x_scope")
        if self.x_axis_scope == "None":
            self.x_axis_scope = dao.run_time
        if self.x_axis_scope is None:
            self.x_axis_scope = 2000.0
        
        self.do_fading = config.getboolean("Visualiser", "raster_plot_do_fading")
        self.data_stores = []
            
        for vertex in self.vertex_in_question:
            label = str(vertex.label)
            self.data_stores.append(label)
            tuple_data = [(-1, -1), (-1, -1)]
            self.data_stores.append(tuple_data)
            self.off_sets.append(current_off_set)
            current_off_set += vertex.atoms + 15

        #records the maxiumum neuron value
        self.max_y_value = current_off_set

        #set name of page
        self.page = gtk.Frame("raster plot")

        self.figure = None
        self.plot = ScatterplotChart()
        self.axis = None
        self.canvas = None
        self.graphview = None
        if self.is_merged_version:
            label = "merged raster page"
        else:
            label = "Raster page of {}".format(vertex.label)
        main_pages.append_page(self.page,
                               gtk.Label(label))
        #generate plot
        self.generate_plot(0, True)
    def create_pages(self, dao):
        self.create_the_notebook_that_holds_pages()
        self.create_machine_static_page()
        #check that the vis has anything to visulise
        if (config.getboolean("Visualiser", "have_board") and
                config.getboolean("Recording", "send_live_spikes")):
            #create default pages
            self.handle_defaults_from_vertex()

            #create a configuration page for pops with record set
            configuration_page = ConfigPage(self.dao, self.open_windows, self.pages,
                                            self.vertex_to_page_mapping, self.real_pages)

        #create a population view if set to by default
        if config.getboolean("Visualiser", "view_population"):
            population_page = gtk.Frame("populations")
            population_page.show()
            pop_view = PopulationView(self.dao, self.open_windows, self, population_page)


        #set all pages to be visable
        for page_id in range(self.pages.get_n_pages()):
            page = self.pages.get_nth_page(page_id)
            page.show()
    def __init__(self, dao, windows, main_pages,
                 vertex_in_question, real_pages):
        super(TopologicalPage, self).__init__(dao, windows,
                                              main_pages, real_pages)

        #holds all the vertexes being recorded for spikes
        self.vertex_in_question = vertex_in_question

        if self.vertex_in_question.visualiser_reset_counters:
            self.data = dict()
            self.data['t'] = self.vertex_in_question.visualiser_reset_counter_period
            self.data['p'] = self
            self.data['pt'] = None
        else:
            self.data = None


        self.placement_fudge = None
        if getattr(self.vertex_in_question,
                   "get_packet_retina_coords", None) is None:
            self.NO_BLOCKS_IN_EXPOSURE_PLOT = \
                vertex_in_question.visualiser_no_colours
            self.NO_COLOR_MAPPING_LABELS = \
                vertex_in_question.visualiser_no_colours

        self.drawing_area = None
        self.objects_to_draw = dict()
        self.max_color_value = {'r': 1, 'g': 1, 'b': 1}
        self.min_color_value = {'r': 0, 'g': 0, 'b': 0}
        number_of_neurons = (self.vertex_in_question.subvertices[0].hi_atom -
                             self.vertex_in_question.subvertices[0].lo_atom)
        if (vertex_in_question.visualiser_2d_dimensions['x'] is None or
            vertex_in_question.visualiser_2d_dimensions['y'] is None):
                self.x_dim = int(math.sqrt(number_of_neurons))
                self.y_dim = int(math.sqrt(number_of_neurons))
                vertex_in_question.visualiser_2d_dimensions = {'x': self.x_dim, 'y': self.y_dim}
        else:
            self.x_dim = vertex_in_question.visualiser_2d_dimensions['x']
            self.y_dim = vertex_in_question.visualiser_2d_dimensions['y']

        #values for tracking color increases
        self.initial_value = 0
        self.max_seen_value = 50
        self.min_seen_value = 0
        self.needs_reseting = False
        self.spikes_that_need_processing = list()
        self.drawing = False

        #holders for determining if you need to redraw
        # everything, or just a section
        self.new_entries = list()
        self.redraw_everything = True

        self.exposure_bar_mapping = dict()


        #stores a offset needed for fading
        retina_drop_off_theshold = None
        if config.getboolean("Visualiser", "retina_plot_drop_off"):
            retina_drop_off_theshold = \
                config.get("Visualiser", "retina_plot_drop_off_value_per_sec")

        self.data_stores = []

       # print self.vertex_in_question
        label = self.vertex_in_question.label
        if label == None:
            label = "Unknown"

        #set name of page
        self.page = gtk.Frame("topological plot")
        main_pages.append_page(self.page,
                               gtk.Label("Topological Page of "
                                         "{}".format(vertex_in_question.label)))
        #generate plot area
        self.generate_plot()

        #generate objects to draw
        self.generate_objects()

        #generate the rectangles that represent the retina view
        self.generate_retina_view()
    def __init__(self, dao, windows, main_pages, vertex_in_question,
                 real_pages):
        super(TopologicalPage, self).__init__(dao, windows, main_pages,
                                              real_pages)

        #holds all the vertexes being recorded for spikes
        self.vertex_in_question = vertex_in_question

        if self.vertex_in_question.visualiser_reset_counters:
            self.data = dict()
            self.data[
                't'] = self.vertex_in_question.visualiser_reset_counter_period
            self.data['p'] = self
            self.data['pt'] = None
        else:
            self.data = None

        self.placement_fudge = None
        if getattr(self.vertex_in_question, "get_packet_retina_coords",
                   None) is None:
            self.NO_BLOCKS_IN_EXPOSURE_PLOT = \
                vertex_in_question.visualiser_no_colours
            self.NO_COLOR_MAPPING_LABELS = \
                vertex_in_question.visualiser_no_colours

        self.drawing_area = None
        self.objects_to_draw = dict()
        self.max_color_value = {'r': 1, 'g': 1, 'b': 1}
        self.min_color_value = {'r': 0, 'g': 0, 'b': 0}
        number_of_neurons = (self.vertex_in_question.subvertices[0].hi_atom -
                             self.vertex_in_question.subvertices[0].lo_atom)
        if (vertex_in_question.visualiser_2d_dimensions['x'] is None
                or vertex_in_question.visualiser_2d_dimensions['y'] is None):
            self.x_dim = int(math.sqrt(number_of_neurons))
            self.y_dim = int(math.sqrt(number_of_neurons))
            vertex_in_question.visualiser_2d_dimensions = {
                'x': self.x_dim,
                'y': self.y_dim
            }
        else:
            self.x_dim = vertex_in_question.visualiser_2d_dimensions['x']
            self.y_dim = vertex_in_question.visualiser_2d_dimensions['y']

        #values for tracking color increases
        self.initial_value = 0
        self.max_seen_value = 50
        self.min_seen_value = 0
        self.needs_reseting = False
        self.spikes_that_need_processing = list()
        self.drawing = False

        #holders for determining if you need to redraw
        # everything, or just a section
        self.new_entries = list()
        self.redraw_everything = True

        self.exposure_bar_mapping = dict()

        #stores a offset needed for fading
        retina_drop_off_theshold = None
        if config.getboolean("Visualiser", "retina_plot_drop_off"):
            retina_drop_off_theshold = \
                config.get("Visualiser", "retina_plot_drop_off_value_per_sec")

        self.data_stores = []

        # print self.vertex_in_question
        label = self.vertex_in_question.label
        if label == None:
            label = "Unknown"

        #set name of page
        self.page = gtk.Frame("topological plot")
        main_pages.append_page(
            self.page,
            gtk.Label("Topological Page of "
                      "{}".format(vertex_in_question.label)))
        #generate plot area
        self.generate_plot()

        #generate objects to draw
        self.generate_objects()

        #generate the rectangles that represent the retina view
        self.generate_retina_view()