Ejemplo n.º 1
0
    def call(self):

        # 1. Register file
        if self.pathToRegister:
            self.fileRegistrar.registerFile(self.pathToRegister)

        # 2. generate position
        position = [self.collectionTime]
        if self.filepathToReport:
            position.append(self.filepathToReport)

        processorResults = []
        for processor in self.processors:
            processorResults += list(
                processor.getPosition(self.datasetProvider.getDataset()))
        # 3. display image
        if self.panelName:
            #print "Plotter.plotImage(%r, ...)" % self.panelName
            Plotter.plotImage(
                self.panelName,
                self.renderer.renderShapesOntoDataset(
                    self.datasetProvider.getDataset()))
        if self.panelNameRCP:
            #print "RCPPlotter.imagePlot(%r, ...)" % self.panelNameRCP
            SDAPlotter.imagePlot(
                self.panelNameRCP,
                self.renderer.renderShapesOntoDataset(
                    self.datasetProvider.getDataset()))
        metricsResults = [time.time() - self.time_created
                          ] if self.return_performance_metrics else []
        return position + metricsResults + processorResults
Ejemplo n.º 2
0
    def display(self, retryUntilTimeout=True):
        if self.panel_name == None and self.panel_name_rcp == None:
            raise Exception("No panel_name or panel_name_rcp set in %s. " +
                            "Set this or set %s.display_image=False" %
                            (self.name, self.name))

        if self.panel_name:
            #print "Plotter.plotImage(%r, ...)" % self.panel_name
            Plotter.plotImage(
                self.panel_name,
                self.renderer.renderShapesOntoDataset(
                    self.getDataset(retryUntilTimeout)))
        if self.panel_name_rcp:
            #print "RCPPlotter.imagePlot(%r, ...)" % self.panel_name_rcp
            SDAPlotter.imagePlot(
                self.panel_name_rcp,
                self.renderer.renderShapesOntoDataset(
                    self.getDataset(retryUntilTimeout)))