Beispiel #1
0
    def __init__(self, experiment):
        """
    Adds the ResultsInspector and a magnifying glass button to the base class.

    experiment -- the running experiment.
    """
        PredictionGUI.__init__(self,
                               experiment=experiment,
                               addInspectorButton=False)

        # Set the RuntimeInspector title
        self.title.SetLabel('Running inference')

        # Add a vertical line in between the inspectors
        self.hSizer.Add(wx.StaticLine(self.panel, style=wx.LI_VERTICAL),
                        flag=wx.EXPAND | wx.LEFT | wx.RIGHT,
                        border=2)

        # Add the ResultsInspector and its title
        resultsSizer = wx.BoxSizer(wx.VERTICAL)
        title = wx.StaticText(self.panel, label='Inference results')
        title.SetFont(self.titleFont)
        self.resultsInspector = ResultsInspector(parent=self.panel,
                                                 network=experiment.network,
                                                 numTopResults=3)
        # Add the title and the inspector button in a horizontal sizer
        titleSizer = wx.BoxSizer(wx.HORIZONTAL)
        titleSizer.Add(title, flag=wx.ALL, border=3)
        titleSizer.AddStretchSpacer()
        titleSizer.Add(self.inspectorBitmap)
        # Add to a vertical sizer
        resultsSizer.Add(titleSizer,
                         flag=wx.EXPAND | wx.RIGHT | wx.BOTTOM,
                         border=2)
        resultsSizer.AddStretchSpacer()
        resultsSizer.Add(
            self.resultsInspector.edit_traits(parent=self.panel,
                                              kind='panel').control)
        resultsSizer.AddStretchSpacer()
        # Add the vertical sizer to the horizontal sizer
        self.hSizer.Add(resultsSizer, flag=wx.ALL | wx.EXPAND, border=3)

        # Append the results inspector to the list of inspectors
        self.inspectors.append(self.resultsInspector)

        # Set the window title
        self.SetTitle("Running inference")